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 /// Creates a new default instance.
81 pub fn new() -> Self {
82 std::default::Default::default()
83 }
84
85 /// Sets the value of [name][crate::model::AddressGroup::name].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
90 /// let x = AddressGroup::new().set_name("example");
91 /// ```
92 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.name = v.into();
94 self
95 }
96
97 /// Sets the value of [description][crate::model::AddressGroup::description].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
102 /// let x = AddressGroup::new().set_description("example");
103 /// ```
104 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.description = v.into();
106 self
107 }
108
109 /// Sets the value of [create_time][crate::model::AddressGroup::create_time].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
114 /// use wkt::Timestamp;
115 /// let x = AddressGroup::new().set_create_time(Timestamp::default()/* use setters */);
116 /// ```
117 pub fn set_create_time<T>(mut self, v: T) -> Self
118 where
119 T: std::convert::Into<wkt::Timestamp>,
120 {
121 self.create_time = std::option::Option::Some(v.into());
122 self
123 }
124
125 /// Sets or clears the value of [create_time][crate::model::AddressGroup::create_time].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
130 /// use wkt::Timestamp;
131 /// let x = AddressGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
132 /// let x = AddressGroup::new().set_or_clear_create_time(None::<Timestamp>);
133 /// ```
134 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
135 where
136 T: std::convert::Into<wkt::Timestamp>,
137 {
138 self.create_time = v.map(|x| x.into());
139 self
140 }
141
142 /// Sets the value of [update_time][crate::model::AddressGroup::update_time].
143 ///
144 /// # Example
145 /// ```ignore,no_run
146 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
147 /// use wkt::Timestamp;
148 /// let x = AddressGroup::new().set_update_time(Timestamp::default()/* use setters */);
149 /// ```
150 pub fn set_update_time<T>(mut self, v: T) -> Self
151 where
152 T: std::convert::Into<wkt::Timestamp>,
153 {
154 self.update_time = std::option::Option::Some(v.into());
155 self
156 }
157
158 /// Sets or clears the value of [update_time][crate::model::AddressGroup::update_time].
159 ///
160 /// # Example
161 /// ```ignore,no_run
162 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
163 /// use wkt::Timestamp;
164 /// let x = AddressGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
165 /// let x = AddressGroup::new().set_or_clear_update_time(None::<Timestamp>);
166 /// ```
167 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
168 where
169 T: std::convert::Into<wkt::Timestamp>,
170 {
171 self.update_time = v.map(|x| x.into());
172 self
173 }
174
175 /// Sets the value of [labels][crate::model::AddressGroup::labels].
176 ///
177 /// # Example
178 /// ```ignore,no_run
179 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
180 /// let x = AddressGroup::new().set_labels([
181 /// ("key0", "abc"),
182 /// ("key1", "xyz"),
183 /// ]);
184 /// ```
185 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
186 where
187 T: std::iter::IntoIterator<Item = (K, V)>,
188 K: std::convert::Into<std::string::String>,
189 V: std::convert::Into<std::string::String>,
190 {
191 use std::iter::Iterator;
192 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
193 self
194 }
195
196 /// Sets the value of [r#type][crate::model::AddressGroup::type].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
201 /// use google_cloud_networksecurity_v1::model::address_group::Type;
202 /// let x0 = AddressGroup::new().set_type(Type::Ipv4);
203 /// let x1 = AddressGroup::new().set_type(Type::Ipv6);
204 /// ```
205 pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
206 mut self,
207 v: T,
208 ) -> Self {
209 self.r#type = v.into();
210 self
211 }
212
213 /// Sets the value of [items][crate::model::AddressGroup::items].
214 ///
215 /// # Example
216 /// ```ignore,no_run
217 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
218 /// let x = AddressGroup::new().set_items(["a", "b", "c"]);
219 /// ```
220 pub fn set_items<T, V>(mut self, v: T) -> Self
221 where
222 T: std::iter::IntoIterator<Item = V>,
223 V: std::convert::Into<std::string::String>,
224 {
225 use std::iter::Iterator;
226 self.items = v.into_iter().map(|i| i.into()).collect();
227 self
228 }
229
230 /// Sets the value of [capacity][crate::model::AddressGroup::capacity].
231 ///
232 /// # Example
233 /// ```ignore,no_run
234 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
235 /// let x = AddressGroup::new().set_capacity(42);
236 /// ```
237 pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
238 self.capacity = v.into();
239 self
240 }
241
242 /// Sets the value of [self_link][crate::model::AddressGroup::self_link].
243 ///
244 /// # Example
245 /// ```ignore,no_run
246 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
247 /// let x = AddressGroup::new().set_self_link("example");
248 /// ```
249 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
250 self.self_link = v.into();
251 self
252 }
253
254 /// Sets the value of [purpose][crate::model::AddressGroup::purpose].
255 ///
256 /// # Example
257 /// ```ignore,no_run
258 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
259 /// use google_cloud_networksecurity_v1::model::address_group::Purpose;
260 /// let x = AddressGroup::new().set_purpose([
261 /// Purpose::Default,
262 /// Purpose::CloudArmor,
263 /// ]);
264 /// ```
265 pub fn set_purpose<T, V>(mut self, v: T) -> Self
266 where
267 T: std::iter::IntoIterator<Item = V>,
268 V: std::convert::Into<crate::model::address_group::Purpose>,
269 {
270 use std::iter::Iterator;
271 self.purpose = v.into_iter().map(|i| i.into()).collect();
272 self
273 }
274}
275
276impl wkt::message::Message for AddressGroup {
277 fn typename() -> &'static str {
278 "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
279 }
280}
281
282/// Defines additional types related to [AddressGroup].
283pub mod address_group {
284 #[allow(unused_imports)]
285 use super::*;
286
287 /// Possible type of the Address Group.
288 ///
289 /// # Working with unknown values
290 ///
291 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
292 /// additional enum variants at any time. Adding new variants is not considered
293 /// a breaking change. Applications should write their code in anticipation of:
294 ///
295 /// - New values appearing in future releases of the client library, **and**
296 /// - New values received dynamically, without application changes.
297 ///
298 /// Please consult the [Working with enums] section in the user guide for some
299 /// guidelines.
300 ///
301 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
302 #[derive(Clone, Debug, PartialEq)]
303 #[non_exhaustive]
304 pub enum Type {
305 /// Default value.
306 Unspecified,
307 /// IP v4 ranges.
308 Ipv4,
309 /// IP v6 ranges.
310 Ipv6,
311 /// If set, the enum was initialized with an unknown value.
312 ///
313 /// Applications can examine the value using [Type::value] or
314 /// [Type::name].
315 UnknownValue(r#type::UnknownValue),
316 }
317
318 #[doc(hidden)]
319 pub mod r#type {
320 #[allow(unused_imports)]
321 use super::*;
322 #[derive(Clone, Debug, PartialEq)]
323 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
324 }
325
326 impl Type {
327 /// Gets the enum value.
328 ///
329 /// Returns `None` if the enum contains an unknown value deserialized from
330 /// the string representation of enums.
331 pub fn value(&self) -> std::option::Option<i32> {
332 match self {
333 Self::Unspecified => std::option::Option::Some(0),
334 Self::Ipv4 => std::option::Option::Some(1),
335 Self::Ipv6 => std::option::Option::Some(2),
336 Self::UnknownValue(u) => u.0.value(),
337 }
338 }
339
340 /// Gets the enum value as a string.
341 ///
342 /// Returns `None` if the enum contains an unknown value deserialized from
343 /// the integer representation of enums.
344 pub fn name(&self) -> std::option::Option<&str> {
345 match self {
346 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
347 Self::Ipv4 => std::option::Option::Some("IPV4"),
348 Self::Ipv6 => std::option::Option::Some("IPV6"),
349 Self::UnknownValue(u) => u.0.name(),
350 }
351 }
352 }
353
354 impl std::default::Default for Type {
355 fn default() -> Self {
356 use std::convert::From;
357 Self::from(0)
358 }
359 }
360
361 impl std::fmt::Display for Type {
362 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
363 wkt::internal::display_enum(f, self.name(), self.value())
364 }
365 }
366
367 impl std::convert::From<i32> for Type {
368 fn from(value: i32) -> Self {
369 match value {
370 0 => Self::Unspecified,
371 1 => Self::Ipv4,
372 2 => Self::Ipv6,
373 _ => Self::UnknownValue(r#type::UnknownValue(
374 wkt::internal::UnknownEnumValue::Integer(value),
375 )),
376 }
377 }
378 }
379
380 impl std::convert::From<&str> for Type {
381 fn from(value: &str) -> Self {
382 use std::string::ToString;
383 match value {
384 "TYPE_UNSPECIFIED" => Self::Unspecified,
385 "IPV4" => Self::Ipv4,
386 "IPV6" => Self::Ipv6,
387 _ => Self::UnknownValue(r#type::UnknownValue(
388 wkt::internal::UnknownEnumValue::String(value.to_string()),
389 )),
390 }
391 }
392 }
393
394 impl serde::ser::Serialize for Type {
395 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
396 where
397 S: serde::Serializer,
398 {
399 match self {
400 Self::Unspecified => serializer.serialize_i32(0),
401 Self::Ipv4 => serializer.serialize_i32(1),
402 Self::Ipv6 => serializer.serialize_i32(2),
403 Self::UnknownValue(u) => u.0.serialize(serializer),
404 }
405 }
406 }
407
408 impl<'de> serde::de::Deserialize<'de> for Type {
409 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
410 where
411 D: serde::Deserializer<'de>,
412 {
413 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
414 ".google.cloud.networksecurity.v1.AddressGroup.Type",
415 ))
416 }
417 }
418
419 /// Purpose of the Address Group.
420 ///
421 /// # Working with unknown values
422 ///
423 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
424 /// additional enum variants at any time. Adding new variants is not considered
425 /// a breaking change. Applications should write their code in anticipation of:
426 ///
427 /// - New values appearing in future releases of the client library, **and**
428 /// - New values received dynamically, without application changes.
429 ///
430 /// Please consult the [Working with enums] section in the user guide for some
431 /// guidelines.
432 ///
433 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
434 #[derive(Clone, Debug, PartialEq)]
435 #[non_exhaustive]
436 pub enum Purpose {
437 /// Default value. Should never happen.
438 Unspecified,
439 /// Address Group is distributed to VMC, and is usable in Firewall Policies
440 /// and other systems that rely on VMC.
441 Default,
442 /// Address Group is usable in Cloud Armor.
443 CloudArmor,
444 /// If set, the enum was initialized with an unknown value.
445 ///
446 /// Applications can examine the value using [Purpose::value] or
447 /// [Purpose::name].
448 UnknownValue(purpose::UnknownValue),
449 }
450
451 #[doc(hidden)]
452 pub mod purpose {
453 #[allow(unused_imports)]
454 use super::*;
455 #[derive(Clone, Debug, PartialEq)]
456 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
457 }
458
459 impl Purpose {
460 /// Gets the enum value.
461 ///
462 /// Returns `None` if the enum contains an unknown value deserialized from
463 /// the string representation of enums.
464 pub fn value(&self) -> std::option::Option<i32> {
465 match self {
466 Self::Unspecified => std::option::Option::Some(0),
467 Self::Default => std::option::Option::Some(1),
468 Self::CloudArmor => std::option::Option::Some(2),
469 Self::UnknownValue(u) => u.0.value(),
470 }
471 }
472
473 /// Gets the enum value as a string.
474 ///
475 /// Returns `None` if the enum contains an unknown value deserialized from
476 /// the integer representation of enums.
477 pub fn name(&self) -> std::option::Option<&str> {
478 match self {
479 Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
480 Self::Default => std::option::Option::Some("DEFAULT"),
481 Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
482 Self::UnknownValue(u) => u.0.name(),
483 }
484 }
485 }
486
487 impl std::default::Default for Purpose {
488 fn default() -> Self {
489 use std::convert::From;
490 Self::from(0)
491 }
492 }
493
494 impl std::fmt::Display for Purpose {
495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
496 wkt::internal::display_enum(f, self.name(), self.value())
497 }
498 }
499
500 impl std::convert::From<i32> for Purpose {
501 fn from(value: i32) -> Self {
502 match value {
503 0 => Self::Unspecified,
504 1 => Self::Default,
505 2 => Self::CloudArmor,
506 _ => Self::UnknownValue(purpose::UnknownValue(
507 wkt::internal::UnknownEnumValue::Integer(value),
508 )),
509 }
510 }
511 }
512
513 impl std::convert::From<&str> for Purpose {
514 fn from(value: &str) -> Self {
515 use std::string::ToString;
516 match value {
517 "PURPOSE_UNSPECIFIED" => Self::Unspecified,
518 "DEFAULT" => Self::Default,
519 "CLOUD_ARMOR" => Self::CloudArmor,
520 _ => Self::UnknownValue(purpose::UnknownValue(
521 wkt::internal::UnknownEnumValue::String(value.to_string()),
522 )),
523 }
524 }
525 }
526
527 impl serde::ser::Serialize for Purpose {
528 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
529 where
530 S: serde::Serializer,
531 {
532 match self {
533 Self::Unspecified => serializer.serialize_i32(0),
534 Self::Default => serializer.serialize_i32(1),
535 Self::CloudArmor => serializer.serialize_i32(2),
536 Self::UnknownValue(u) => u.0.serialize(serializer),
537 }
538 }
539 }
540
541 impl<'de> serde::de::Deserialize<'de> for Purpose {
542 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
543 where
544 D: serde::Deserializer<'de>,
545 {
546 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
547 ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
548 ))
549 }
550 }
551}
552
553/// Request used with the ListAddressGroups method.
554#[derive(Clone, Default, PartialEq)]
555#[non_exhaustive]
556pub struct ListAddressGroupsRequest {
557 /// Required. The project and location from which the AddressGroups
558 /// should be listed, specified in the format
559 /// `projects/*/locations/{location}`.
560 pub parent: std::string::String,
561
562 /// Maximum number of AddressGroups to return per call.
563 pub page_size: i32,
564
565 /// The value returned by the last
566 /// `ListAddressGroupsResponse` Indicates that this is a
567 /// continuation of a prior `ListAddressGroups` call, and
568 /// that the system should return the next page of data.
569 pub page_token: std::string::String,
570
571 /// Optional. If true, allow partial responses for multi-regional Aggregated
572 /// List requests.
573 pub return_partial_success: bool,
574
575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
576}
577
578impl ListAddressGroupsRequest {
579 /// Creates a new default instance.
580 pub fn new() -> Self {
581 std::default::Default::default()
582 }
583
584 /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
589 /// let x = ListAddressGroupsRequest::new().set_parent("example");
590 /// ```
591 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
592 self.parent = v.into();
593 self
594 }
595
596 /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
597 ///
598 /// # Example
599 /// ```ignore,no_run
600 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
601 /// let x = ListAddressGroupsRequest::new().set_page_size(42);
602 /// ```
603 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
604 self.page_size = v.into();
605 self
606 }
607
608 /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
609 ///
610 /// # Example
611 /// ```ignore,no_run
612 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
613 /// let x = ListAddressGroupsRequest::new().set_page_token("example");
614 /// ```
615 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
616 self.page_token = v.into();
617 self
618 }
619
620 /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
621 ///
622 /// # Example
623 /// ```ignore,no_run
624 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
625 /// let x = ListAddressGroupsRequest::new().set_return_partial_success(true);
626 /// ```
627 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
628 self.return_partial_success = v.into();
629 self
630 }
631}
632
633impl wkt::message::Message for ListAddressGroupsRequest {
634 fn typename() -> &'static str {
635 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
636 }
637}
638
639/// Response returned by the ListAddressGroups method.
640#[derive(Clone, Default, PartialEq)]
641#[non_exhaustive]
642pub struct ListAddressGroupsResponse {
643 /// List of AddressGroups resources.
644 pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
645
646 /// If there might be more results than those appearing in this response, then
647 /// `next_page_token` is included. To get the next set of results, call this
648 /// method again using the value of `next_page_token` as `page_token`.
649 pub next_page_token: std::string::String,
650
651 /// Locations that could not be reached.
652 pub unreachable: std::vec::Vec<std::string::String>,
653
654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
655}
656
657impl ListAddressGroupsResponse {
658 /// Creates a new default instance.
659 pub fn new() -> Self {
660 std::default::Default::default()
661 }
662
663 /// Sets the value of [address_groups][crate::model::ListAddressGroupsResponse::address_groups].
664 ///
665 /// # Example
666 /// ```ignore,no_run
667 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
668 /// use google_cloud_networksecurity_v1::model::AddressGroup;
669 /// let x = ListAddressGroupsResponse::new()
670 /// .set_address_groups([
671 /// AddressGroup::default()/* use setters */,
672 /// AddressGroup::default()/* use (different) setters */,
673 /// ]);
674 /// ```
675 pub fn set_address_groups<T, V>(mut self, v: T) -> Self
676 where
677 T: std::iter::IntoIterator<Item = V>,
678 V: std::convert::Into<crate::model::AddressGroup>,
679 {
680 use std::iter::Iterator;
681 self.address_groups = v.into_iter().map(|i| i.into()).collect();
682 self
683 }
684
685 /// Sets the value of [next_page_token][crate::model::ListAddressGroupsResponse::next_page_token].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
690 /// let x = ListAddressGroupsResponse::new().set_next_page_token("example");
691 /// ```
692 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
693 self.next_page_token = v.into();
694 self
695 }
696
697 /// Sets the value of [unreachable][crate::model::ListAddressGroupsResponse::unreachable].
698 ///
699 /// # Example
700 /// ```ignore,no_run
701 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
702 /// let x = ListAddressGroupsResponse::new().set_unreachable(["a", "b", "c"]);
703 /// ```
704 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
705 where
706 T: std::iter::IntoIterator<Item = V>,
707 V: std::convert::Into<std::string::String>,
708 {
709 use std::iter::Iterator;
710 self.unreachable = v.into_iter().map(|i| i.into()).collect();
711 self
712 }
713}
714
715impl wkt::message::Message for ListAddressGroupsResponse {
716 fn typename() -> &'static str {
717 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
718 }
719}
720
721#[doc(hidden)]
722impl google_cloud_gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
723 type PageItem = crate::model::AddressGroup;
724
725 fn items(self) -> std::vec::Vec<Self::PageItem> {
726 self.address_groups
727 }
728
729 fn next_page_token(&self) -> std::string::String {
730 use std::clone::Clone;
731 self.next_page_token.clone()
732 }
733}
734
735/// Request used by the GetAddressGroup method.
736#[derive(Clone, Default, PartialEq)]
737#[non_exhaustive]
738pub struct GetAddressGroupRequest {
739 /// Required. A name of the AddressGroup to get. Must be in the format
740 /// `projects/*/locations/{location}/addressGroups/*`.
741 pub name: std::string::String,
742
743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
744}
745
746impl GetAddressGroupRequest {
747 /// Creates a new default instance.
748 pub fn new() -> Self {
749 std::default::Default::default()
750 }
751
752 /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
753 ///
754 /// # Example
755 /// ```ignore,no_run
756 /// # use google_cloud_networksecurity_v1::model::GetAddressGroupRequest;
757 /// let x = GetAddressGroupRequest::new().set_name("example");
758 /// ```
759 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
760 self.name = v.into();
761 self
762 }
763}
764
765impl wkt::message::Message for GetAddressGroupRequest {
766 fn typename() -> &'static str {
767 "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
768 }
769}
770
771/// Request used by the CreateAddressGroup method.
772#[derive(Clone, Default, PartialEq)]
773#[non_exhaustive]
774pub struct CreateAddressGroupRequest {
775 /// Required. The parent resource of the AddressGroup. Must be in the
776 /// format `projects/*/locations/{location}`.
777 pub parent: std::string::String,
778
779 /// Required. Short name of the AddressGroup resource to be created.
780 /// This value should be 1-63 characters long, containing only
781 /// letters, numbers, hyphens, and underscores, and should not start
782 /// with a number. E.g. "authz_policy".
783 pub address_group_id: std::string::String,
784
785 /// Required. AddressGroup resource to be created.
786 pub address_group: std::option::Option<crate::model::AddressGroup>,
787
788 /// Optional. An optional request ID to identify requests. Specify a unique
789 /// request ID so that if you must retry your request, the server will know to
790 /// ignore the request if it has already been completed. The server will
791 /// guarantee that for at least 60 minutes since the first request.
792 ///
793 /// For example, consider a situation where you make an initial request and
794 /// the request times out. If you make the request again with the same request
795 /// ID, the server can check if original operation with the same request ID
796 /// was received, and if so, will ignore the second request. This prevents
797 /// clients from accidentally creating duplicate commitments.
798 ///
799 /// The request ID must be a valid UUID with the exception that zero UUID is
800 /// not supported (00000000-0000-0000-0000-000000000000).
801 pub request_id: std::string::String,
802
803 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
804}
805
806impl CreateAddressGroupRequest {
807 /// Creates a new default instance.
808 pub fn new() -> Self {
809 std::default::Default::default()
810 }
811
812 /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
813 ///
814 /// # Example
815 /// ```ignore,no_run
816 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
817 /// let x = CreateAddressGroupRequest::new().set_parent("example");
818 /// ```
819 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
820 self.parent = v.into();
821 self
822 }
823
824 /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
825 ///
826 /// # Example
827 /// ```ignore,no_run
828 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
829 /// let x = CreateAddressGroupRequest::new().set_address_group_id("example");
830 /// ```
831 pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
832 mut self,
833 v: T,
834 ) -> Self {
835 self.address_group_id = v.into();
836 self
837 }
838
839 /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
840 ///
841 /// # Example
842 /// ```ignore,no_run
843 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
844 /// use google_cloud_networksecurity_v1::model::AddressGroup;
845 /// let x = CreateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
846 /// ```
847 pub fn set_address_group<T>(mut self, v: T) -> Self
848 where
849 T: std::convert::Into<crate::model::AddressGroup>,
850 {
851 self.address_group = std::option::Option::Some(v.into());
852 self
853 }
854
855 /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
856 ///
857 /// # Example
858 /// ```ignore,no_run
859 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
860 /// use google_cloud_networksecurity_v1::model::AddressGroup;
861 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
862 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
863 /// ```
864 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
865 where
866 T: std::convert::Into<crate::model::AddressGroup>,
867 {
868 self.address_group = v.map(|x| x.into());
869 self
870 }
871
872 /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
873 ///
874 /// # Example
875 /// ```ignore,no_run
876 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
877 /// let x = CreateAddressGroupRequest::new().set_request_id("example");
878 /// ```
879 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
880 self.request_id = v.into();
881 self
882 }
883}
884
885impl wkt::message::Message for CreateAddressGroupRequest {
886 fn typename() -> &'static str {
887 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
888 }
889}
890
891/// Request used by the UpdateAddressGroup method.
892#[derive(Clone, Default, PartialEq)]
893#[non_exhaustive]
894pub struct UpdateAddressGroupRequest {
895 /// Optional. Field mask is used to specify the fields to be overwritten in the
896 /// AddressGroup resource by the update.
897 /// The fields specified in the update_mask are relative to the resource, not
898 /// the full request. A field will be overwritten if it is in the mask. If the
899 /// user does not provide a mask then all fields will be overwritten.
900 pub update_mask: std::option::Option<wkt::FieldMask>,
901
902 /// Required. Updated AddressGroup resource.
903 pub address_group: std::option::Option<crate::model::AddressGroup>,
904
905 /// Optional. An optional request ID to identify requests. Specify a unique
906 /// request ID so that if you must retry your request, the server will know to
907 /// ignore the request if it has already been completed. The server will
908 /// guarantee that for at least 60 minutes since the first request.
909 ///
910 /// For example, consider a situation where you make an initial request and
911 /// the request times out. If you make the request again with the same request
912 /// ID, the server can check if original operation with the same request ID
913 /// was received, and if so, will ignore the second request. This prevents
914 /// clients from accidentally creating duplicate commitments.
915 ///
916 /// The request ID must be a valid UUID with the exception that zero UUID is
917 /// not supported (00000000-0000-0000-0000-000000000000).
918 pub request_id: std::string::String,
919
920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
921}
922
923impl UpdateAddressGroupRequest {
924 /// Creates a new default instance.
925 pub fn new() -> Self {
926 std::default::Default::default()
927 }
928
929 /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
930 ///
931 /// # Example
932 /// ```ignore,no_run
933 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
934 /// use wkt::FieldMask;
935 /// let x = UpdateAddressGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
936 /// ```
937 pub fn set_update_mask<T>(mut self, v: T) -> Self
938 where
939 T: std::convert::Into<wkt::FieldMask>,
940 {
941 self.update_mask = std::option::Option::Some(v.into());
942 self
943 }
944
945 /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
946 ///
947 /// # Example
948 /// ```ignore,no_run
949 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
950 /// use wkt::FieldMask;
951 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
952 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
953 /// ```
954 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
955 where
956 T: std::convert::Into<wkt::FieldMask>,
957 {
958 self.update_mask = v.map(|x| x.into());
959 self
960 }
961
962 /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
963 ///
964 /// # Example
965 /// ```ignore,no_run
966 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
967 /// use google_cloud_networksecurity_v1::model::AddressGroup;
968 /// let x = UpdateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
969 /// ```
970 pub fn set_address_group<T>(mut self, v: T) -> Self
971 where
972 T: std::convert::Into<crate::model::AddressGroup>,
973 {
974 self.address_group = std::option::Option::Some(v.into());
975 self
976 }
977
978 /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
979 ///
980 /// # Example
981 /// ```ignore,no_run
982 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
983 /// use google_cloud_networksecurity_v1::model::AddressGroup;
984 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
985 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
986 /// ```
987 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
988 where
989 T: std::convert::Into<crate::model::AddressGroup>,
990 {
991 self.address_group = v.map(|x| x.into());
992 self
993 }
994
995 /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
996 ///
997 /// # Example
998 /// ```ignore,no_run
999 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
1000 /// let x = UpdateAddressGroupRequest::new().set_request_id("example");
1001 /// ```
1002 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.request_id = v.into();
1004 self
1005 }
1006}
1007
1008impl wkt::message::Message for UpdateAddressGroupRequest {
1009 fn typename() -> &'static str {
1010 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
1011 }
1012}
1013
1014/// Request used by the DeleteAddressGroup method.
1015#[derive(Clone, Default, PartialEq)]
1016#[non_exhaustive]
1017pub struct DeleteAddressGroupRequest {
1018 /// Required. A name of the AddressGroup to delete. Must be in the format
1019 /// `projects/*/locations/{location}/addressGroups/*`.
1020 pub name: std::string::String,
1021
1022 /// Optional. An optional request ID to identify requests. Specify a unique
1023 /// request ID so that if you must retry your request, the server will know to
1024 /// ignore the request if it has already been completed. The server will
1025 /// guarantee that for at least 60 minutes since the first request.
1026 ///
1027 /// For example, consider a situation where you make an initial request and
1028 /// the request times out. If you make the request again with the same request
1029 /// ID, the server can check if original operation with the same request ID
1030 /// was received, and if so, will ignore the second request. This prevents
1031 /// clients from accidentally creating duplicate commitments.
1032 ///
1033 /// The request ID must be a valid UUID with the exception that zero UUID is
1034 /// not supported (00000000-0000-0000-0000-000000000000).
1035 pub request_id: std::string::String,
1036
1037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1038}
1039
1040impl DeleteAddressGroupRequest {
1041 /// Creates a new default instance.
1042 pub fn new() -> Self {
1043 std::default::Default::default()
1044 }
1045
1046 /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1047 ///
1048 /// # Example
1049 /// ```ignore,no_run
1050 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1051 /// let x = DeleteAddressGroupRequest::new().set_name("example");
1052 /// ```
1053 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1054 self.name = v.into();
1055 self
1056 }
1057
1058 /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1059 ///
1060 /// # Example
1061 /// ```ignore,no_run
1062 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1063 /// let x = DeleteAddressGroupRequest::new().set_request_id("example");
1064 /// ```
1065 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.request_id = v.into();
1067 self
1068 }
1069}
1070
1071impl wkt::message::Message for DeleteAddressGroupRequest {
1072 fn typename() -> &'static str {
1073 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
1074 }
1075}
1076
1077/// Request used by the AddAddressGroupItems method.
1078#[derive(Clone, Default, PartialEq)]
1079#[non_exhaustive]
1080pub struct AddAddressGroupItemsRequest {
1081 /// Required. A name of the AddressGroup to add items to. Must be in the format
1082 /// `projects|organization/*/locations/{location}/addressGroups/*`.
1083 pub address_group: std::string::String,
1084
1085 /// Required. List of items to add.
1086 pub items: std::vec::Vec<std::string::String>,
1087
1088 /// Optional. An optional request ID to identify requests. Specify a unique
1089 /// request ID so that if you must retry your request, the server will know to
1090 /// ignore the request if it has already been completed. The server will
1091 /// guarantee that for at least 60 minutes since the first request.
1092 ///
1093 /// For example, consider a situation where you make an initial request and
1094 /// the request times out. If you make the request again with the same request
1095 /// ID, the server can check if original operation with the same request ID
1096 /// was received, and if so, will ignore the second request. This prevents
1097 /// clients from accidentally creating duplicate commitments.
1098 ///
1099 /// The request ID must be a valid UUID with the exception that zero UUID is
1100 /// not supported (00000000-0000-0000-0000-000000000000).
1101 pub request_id: std::string::String,
1102
1103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104}
1105
1106impl AddAddressGroupItemsRequest {
1107 /// Creates a new default instance.
1108 pub fn new() -> Self {
1109 std::default::Default::default()
1110 }
1111
1112 /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
1113 ///
1114 /// # Example
1115 /// ```ignore,no_run
1116 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1117 /// let x = AddAddressGroupItemsRequest::new().set_address_group("example");
1118 /// ```
1119 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.address_group = v.into();
1121 self
1122 }
1123
1124 /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
1125 ///
1126 /// # Example
1127 /// ```ignore,no_run
1128 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1129 /// let x = AddAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1130 /// ```
1131 pub fn set_items<T, V>(mut self, v: T) -> Self
1132 where
1133 T: std::iter::IntoIterator<Item = V>,
1134 V: std::convert::Into<std::string::String>,
1135 {
1136 use std::iter::Iterator;
1137 self.items = v.into_iter().map(|i| i.into()).collect();
1138 self
1139 }
1140
1141 /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
1142 ///
1143 /// # Example
1144 /// ```ignore,no_run
1145 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1146 /// let x = AddAddressGroupItemsRequest::new().set_request_id("example");
1147 /// ```
1148 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.request_id = v.into();
1150 self
1151 }
1152}
1153
1154impl wkt::message::Message for AddAddressGroupItemsRequest {
1155 fn typename() -> &'static str {
1156 "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
1157 }
1158}
1159
1160/// Request used by the RemoveAddressGroupItems method.
1161#[derive(Clone, Default, PartialEq)]
1162#[non_exhaustive]
1163pub struct RemoveAddressGroupItemsRequest {
1164 /// Required. A name of the AddressGroup to remove items from. Must be in the
1165 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1166 pub address_group: std::string::String,
1167
1168 /// Required. List of items to remove.
1169 pub items: std::vec::Vec<std::string::String>,
1170
1171 /// Optional. An optional request ID to identify requests. Specify a unique
1172 /// request ID so that if you must retry your request, the server will know to
1173 /// ignore the request if it has already been completed. The server will
1174 /// guarantee that for at least 60 minutes since the first request.
1175 ///
1176 /// For example, consider a situation where you make an initial request and
1177 /// the request times out. If you make the request again with the same request
1178 /// ID, the server can check if original operation with the same request ID
1179 /// was received, and if so, will ignore the second request. This prevents
1180 /// clients from accidentally creating duplicate commitments.
1181 ///
1182 /// The request ID must be a valid UUID with the exception that zero UUID is
1183 /// not supported (00000000-0000-0000-0000-000000000000).
1184 pub request_id: std::string::String,
1185
1186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1187}
1188
1189impl RemoveAddressGroupItemsRequest {
1190 /// Creates a new default instance.
1191 pub fn new() -> Self {
1192 std::default::Default::default()
1193 }
1194
1195 /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
1196 ///
1197 /// # Example
1198 /// ```ignore,no_run
1199 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1200 /// let x = RemoveAddressGroupItemsRequest::new().set_address_group("example");
1201 /// ```
1202 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1203 self.address_group = v.into();
1204 self
1205 }
1206
1207 /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
1208 ///
1209 /// # Example
1210 /// ```ignore,no_run
1211 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1212 /// let x = RemoveAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1213 /// ```
1214 pub fn set_items<T, V>(mut self, v: T) -> Self
1215 where
1216 T: std::iter::IntoIterator<Item = V>,
1217 V: std::convert::Into<std::string::String>,
1218 {
1219 use std::iter::Iterator;
1220 self.items = v.into_iter().map(|i| i.into()).collect();
1221 self
1222 }
1223
1224 /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
1225 ///
1226 /// # Example
1227 /// ```ignore,no_run
1228 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1229 /// let x = RemoveAddressGroupItemsRequest::new().set_request_id("example");
1230 /// ```
1231 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1232 self.request_id = v.into();
1233 self
1234 }
1235}
1236
1237impl wkt::message::Message for RemoveAddressGroupItemsRequest {
1238 fn typename() -> &'static str {
1239 "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
1240 }
1241}
1242
1243/// Request used by the CloneAddressGroupItems method.
1244#[derive(Clone, Default, PartialEq)]
1245#[non_exhaustive]
1246pub struct CloneAddressGroupItemsRequest {
1247 /// Required. A name of the AddressGroup to clone items to. Must be in the
1248 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1249 pub address_group: std::string::String,
1250
1251 /// Required. Source address group to clone items from.
1252 pub source_address_group: std::string::String,
1253
1254 /// Optional. An optional request ID to identify requests. Specify a unique
1255 /// request ID so that if you must retry your request, the server will know to
1256 /// ignore the request if it has already been completed. The server will
1257 /// guarantee that for at least 60 minutes since the first request.
1258 ///
1259 /// For example, consider a situation where you make an initial request and
1260 /// the request times out. If you make the request again with the same request
1261 /// ID, the server can check if original operation with the same request ID
1262 /// was received, and if so, will ignore the second request. This prevents
1263 /// clients from accidentally creating duplicate commitments.
1264 ///
1265 /// The request ID must be a valid UUID with the exception that zero UUID is
1266 /// not supported (00000000-0000-0000-0000-000000000000).
1267 pub request_id: std::string::String,
1268
1269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1270}
1271
1272impl CloneAddressGroupItemsRequest {
1273 /// Creates a new default instance.
1274 pub fn new() -> Self {
1275 std::default::Default::default()
1276 }
1277
1278 /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
1279 ///
1280 /// # Example
1281 /// ```ignore,no_run
1282 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1283 /// let x = CloneAddressGroupItemsRequest::new().set_address_group("example");
1284 /// ```
1285 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286 self.address_group = v.into();
1287 self
1288 }
1289
1290 /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1295 /// let x = CloneAddressGroupItemsRequest::new().set_source_address_group("example");
1296 /// ```
1297 pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1298 mut self,
1299 v: T,
1300 ) -> Self {
1301 self.source_address_group = v.into();
1302 self
1303 }
1304
1305 /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
1306 ///
1307 /// # Example
1308 /// ```ignore,no_run
1309 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1310 /// let x = CloneAddressGroupItemsRequest::new().set_request_id("example");
1311 /// ```
1312 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1313 self.request_id = v.into();
1314 self
1315 }
1316}
1317
1318impl wkt::message::Message for CloneAddressGroupItemsRequest {
1319 fn typename() -> &'static str {
1320 "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1321 }
1322}
1323
1324/// Request used by the ListAddressGroupReferences method.
1325#[derive(Clone, Default, PartialEq)]
1326#[non_exhaustive]
1327pub struct ListAddressGroupReferencesRequest {
1328 /// Required. A name of the AddressGroup to clone items to. Must be in the
1329 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1330 pub address_group: std::string::String,
1331
1332 /// The maximum number of references to return. If unspecified, server
1333 /// will pick an appropriate default. Server may return fewer items than
1334 /// requested. A caller should only rely on response's
1335 /// [next_page_token][google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]
1336 /// to determine if there are more AddressGroupUsers left to be queried.
1337 ///
1338 /// [google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]: crate::model::ListAddressGroupReferencesResponse::next_page_token
1339 pub page_size: i32,
1340
1341 /// The next_page_token value returned from a previous List request,
1342 /// if any.
1343 pub page_token: std::string::String,
1344
1345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1346}
1347
1348impl ListAddressGroupReferencesRequest {
1349 /// Creates a new default instance.
1350 pub fn new() -> Self {
1351 std::default::Default::default()
1352 }
1353
1354 /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1355 ///
1356 /// # Example
1357 /// ```ignore,no_run
1358 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1359 /// let x = ListAddressGroupReferencesRequest::new().set_address_group("example");
1360 /// ```
1361 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1362 self.address_group = v.into();
1363 self
1364 }
1365
1366 /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1367 ///
1368 /// # Example
1369 /// ```ignore,no_run
1370 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1371 /// let x = ListAddressGroupReferencesRequest::new().set_page_size(42);
1372 /// ```
1373 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1374 self.page_size = v.into();
1375 self
1376 }
1377
1378 /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1379 ///
1380 /// # Example
1381 /// ```ignore,no_run
1382 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1383 /// let x = ListAddressGroupReferencesRequest::new().set_page_token("example");
1384 /// ```
1385 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1386 self.page_token = v.into();
1387 self
1388 }
1389}
1390
1391impl wkt::message::Message for ListAddressGroupReferencesRequest {
1392 fn typename() -> &'static str {
1393 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1394 }
1395}
1396
1397/// Response of the ListAddressGroupReferences method.
1398#[derive(Clone, Default, PartialEq)]
1399#[non_exhaustive]
1400pub struct ListAddressGroupReferencesResponse {
1401 /// A list of references that matches the specified filter in the request.
1402 pub address_group_references:
1403 std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1404
1405 /// If there might be more results than those appearing in this response, then
1406 /// `next_page_token` is included. To get the next set of results, call this
1407 /// method again using the value of `next_page_token` as `page_token`.
1408 pub next_page_token: std::string::String,
1409
1410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1411}
1412
1413impl ListAddressGroupReferencesResponse {
1414 /// Creates a new default instance.
1415 pub fn new() -> Self {
1416 std::default::Default::default()
1417 }
1418
1419 /// Sets the value of [address_group_references][crate::model::ListAddressGroupReferencesResponse::address_group_references].
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1424 /// use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1425 /// let x = ListAddressGroupReferencesResponse::new()
1426 /// .set_address_group_references([
1427 /// AddressGroupReference::default()/* use setters */,
1428 /// AddressGroupReference::default()/* use (different) setters */,
1429 /// ]);
1430 /// ```
1431 pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1432 where
1433 T: std::iter::IntoIterator<Item = V>,
1434 V: std::convert::Into<
1435 crate::model::list_address_group_references_response::AddressGroupReference,
1436 >,
1437 {
1438 use std::iter::Iterator;
1439 self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1440 self
1441 }
1442
1443 /// Sets the value of [next_page_token][crate::model::ListAddressGroupReferencesResponse::next_page_token].
1444 ///
1445 /// # Example
1446 /// ```ignore,no_run
1447 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1448 /// let x = ListAddressGroupReferencesResponse::new().set_next_page_token("example");
1449 /// ```
1450 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1451 self.next_page_token = v.into();
1452 self
1453 }
1454}
1455
1456impl wkt::message::Message for ListAddressGroupReferencesResponse {
1457 fn typename() -> &'static str {
1458 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1459 }
1460}
1461
1462#[doc(hidden)]
1463impl google_cloud_gax::paginator::internal::PageableResponse
1464 for ListAddressGroupReferencesResponse
1465{
1466 type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1467
1468 fn items(self) -> std::vec::Vec<Self::PageItem> {
1469 self.address_group_references
1470 }
1471
1472 fn next_page_token(&self) -> std::string::String {
1473 use std::clone::Clone;
1474 self.next_page_token.clone()
1475 }
1476}
1477
1478/// Defines additional types related to [ListAddressGroupReferencesResponse].
1479pub mod list_address_group_references_response {
1480 #[allow(unused_imports)]
1481 use super::*;
1482
1483 /// The Reference of AddressGroup.
1484 #[derive(Clone, Default, PartialEq)]
1485 #[non_exhaustive]
1486 pub struct AddressGroupReference {
1487 /// FirewallPolicy that is using the Address Group.
1488 pub firewall_policy: std::string::String,
1489
1490 /// Cloud Armor SecurityPolicy that is using the Address Group.
1491 pub security_policy: std::string::String,
1492
1493 /// Rule priority of the FirewallPolicy that is using the Address Group.
1494 pub rule_priority: i32,
1495
1496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1497 }
1498
1499 impl AddressGroupReference {
1500 /// Creates a new default instance.
1501 pub fn new() -> Self {
1502 std::default::Default::default()
1503 }
1504
1505 /// Sets the value of [firewall_policy][crate::model::list_address_group_references_response::AddressGroupReference::firewall_policy].
1506 ///
1507 /// # Example
1508 /// ```ignore,no_run
1509 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1510 /// let x = AddressGroupReference::new().set_firewall_policy("example");
1511 /// ```
1512 pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1513 mut self,
1514 v: T,
1515 ) -> Self {
1516 self.firewall_policy = v.into();
1517 self
1518 }
1519
1520 /// Sets the value of [security_policy][crate::model::list_address_group_references_response::AddressGroupReference::security_policy].
1521 ///
1522 /// # Example
1523 /// ```ignore,no_run
1524 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1525 /// let x = AddressGroupReference::new().set_security_policy("example");
1526 /// ```
1527 pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1528 mut self,
1529 v: T,
1530 ) -> Self {
1531 self.security_policy = v.into();
1532 self
1533 }
1534
1535 /// Sets the value of [rule_priority][crate::model::list_address_group_references_response::AddressGroupReference::rule_priority].
1536 ///
1537 /// # Example
1538 /// ```ignore,no_run
1539 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1540 /// let x = AddressGroupReference::new().set_rule_priority(42);
1541 /// ```
1542 pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1543 self.rule_priority = v.into();
1544 self
1545 }
1546 }
1547
1548 impl wkt::message::Message for AddressGroupReference {
1549 fn typename() -> &'static str {
1550 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1551 }
1552 }
1553}
1554
1555/// AuthorizationPolicy is a resource that specifies how a server
1556/// should authorize incoming connections. This resource in itself does
1557/// not change the configuration unless it's attached to a target https
1558/// proxy or endpoint config selector resource.
1559#[derive(Clone, Default, PartialEq)]
1560#[non_exhaustive]
1561pub struct AuthorizationPolicy {
1562 /// Required. Name of the AuthorizationPolicy resource. It matches pattern
1563 /// `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
1564 pub name: std::string::String,
1565
1566 /// Optional. Free-text description of the resource.
1567 pub description: std::string::String,
1568
1569 /// Output only. The timestamp when the resource was created.
1570 pub create_time: std::option::Option<wkt::Timestamp>,
1571
1572 /// Output only. The timestamp when the resource was updated.
1573 pub update_time: std::option::Option<wkt::Timestamp>,
1574
1575 /// Optional. Set of label tags associated with the AuthorizationPolicy
1576 /// resource.
1577 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1578
1579 /// Required. The action to take when a rule match is found. Possible values
1580 /// are "ALLOW" or "DENY".
1581 pub action: crate::model::authorization_policy::Action,
1582
1583 /// Optional. List of rules to match. Note that at least one of the rules must
1584 /// match in order for the action specified in the 'action' field to be taken.
1585 /// A rule is a match if there is a matching source and destination. If left
1586 /// blank, the action specified in the `action` field will be applied on every
1587 /// request.
1588 pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1589
1590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1591}
1592
1593impl AuthorizationPolicy {
1594 /// Creates a new default instance.
1595 pub fn new() -> Self {
1596 std::default::Default::default()
1597 }
1598
1599 /// Sets the value of [name][crate::model::AuthorizationPolicy::name].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1604 /// let x = AuthorizationPolicy::new().set_name("example");
1605 /// ```
1606 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1607 self.name = v.into();
1608 self
1609 }
1610
1611 /// Sets the value of [description][crate::model::AuthorizationPolicy::description].
1612 ///
1613 /// # Example
1614 /// ```ignore,no_run
1615 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1616 /// let x = AuthorizationPolicy::new().set_description("example");
1617 /// ```
1618 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.description = v.into();
1620 self
1621 }
1622
1623 /// Sets the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1624 ///
1625 /// # Example
1626 /// ```ignore,no_run
1627 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1628 /// use wkt::Timestamp;
1629 /// let x = AuthorizationPolicy::new().set_create_time(Timestamp::default()/* use setters */);
1630 /// ```
1631 pub fn set_create_time<T>(mut self, v: T) -> Self
1632 where
1633 T: std::convert::Into<wkt::Timestamp>,
1634 {
1635 self.create_time = std::option::Option::Some(v.into());
1636 self
1637 }
1638
1639 /// Sets or clears the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1640 ///
1641 /// # Example
1642 /// ```ignore,no_run
1643 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1644 /// use wkt::Timestamp;
1645 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1646 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(None::<Timestamp>);
1647 /// ```
1648 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1649 where
1650 T: std::convert::Into<wkt::Timestamp>,
1651 {
1652 self.create_time = v.map(|x| x.into());
1653 self
1654 }
1655
1656 /// Sets the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1657 ///
1658 /// # Example
1659 /// ```ignore,no_run
1660 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1661 /// use wkt::Timestamp;
1662 /// let x = AuthorizationPolicy::new().set_update_time(Timestamp::default()/* use setters */);
1663 /// ```
1664 pub fn set_update_time<T>(mut self, v: T) -> Self
1665 where
1666 T: std::convert::Into<wkt::Timestamp>,
1667 {
1668 self.update_time = std::option::Option::Some(v.into());
1669 self
1670 }
1671
1672 /// Sets or clears the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1673 ///
1674 /// # Example
1675 /// ```ignore,no_run
1676 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1677 /// use wkt::Timestamp;
1678 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1679 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(None::<Timestamp>);
1680 /// ```
1681 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1682 where
1683 T: std::convert::Into<wkt::Timestamp>,
1684 {
1685 self.update_time = v.map(|x| x.into());
1686 self
1687 }
1688
1689 /// Sets the value of [labels][crate::model::AuthorizationPolicy::labels].
1690 ///
1691 /// # Example
1692 /// ```ignore,no_run
1693 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1694 /// let x = AuthorizationPolicy::new().set_labels([
1695 /// ("key0", "abc"),
1696 /// ("key1", "xyz"),
1697 /// ]);
1698 /// ```
1699 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1700 where
1701 T: std::iter::IntoIterator<Item = (K, V)>,
1702 K: std::convert::Into<std::string::String>,
1703 V: std::convert::Into<std::string::String>,
1704 {
1705 use std::iter::Iterator;
1706 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1707 self
1708 }
1709
1710 /// Sets the value of [action][crate::model::AuthorizationPolicy::action].
1711 ///
1712 /// # Example
1713 /// ```ignore,no_run
1714 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1715 /// use google_cloud_networksecurity_v1::model::authorization_policy::Action;
1716 /// let x0 = AuthorizationPolicy::new().set_action(Action::Allow);
1717 /// let x1 = AuthorizationPolicy::new().set_action(Action::Deny);
1718 /// ```
1719 pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1720 mut self,
1721 v: T,
1722 ) -> Self {
1723 self.action = v.into();
1724 self
1725 }
1726
1727 /// Sets the value of [rules][crate::model::AuthorizationPolicy::rules].
1728 ///
1729 /// # Example
1730 /// ```ignore,no_run
1731 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1732 /// use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1733 /// let x = AuthorizationPolicy::new()
1734 /// .set_rules([
1735 /// Rule::default()/* use setters */,
1736 /// Rule::default()/* use (different) setters */,
1737 /// ]);
1738 /// ```
1739 pub fn set_rules<T, V>(mut self, v: T) -> Self
1740 where
1741 T: std::iter::IntoIterator<Item = V>,
1742 V: std::convert::Into<crate::model::authorization_policy::Rule>,
1743 {
1744 use std::iter::Iterator;
1745 self.rules = v.into_iter().map(|i| i.into()).collect();
1746 self
1747 }
1748}
1749
1750impl wkt::message::Message for AuthorizationPolicy {
1751 fn typename() -> &'static str {
1752 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1753 }
1754}
1755
1756/// Defines additional types related to [AuthorizationPolicy].
1757pub mod authorization_policy {
1758 #[allow(unused_imports)]
1759 use super::*;
1760
1761 /// Specification of rules.
1762 #[derive(Clone, Default, PartialEq)]
1763 #[non_exhaustive]
1764 pub struct Rule {
1765 /// Optional. List of attributes for the traffic source. All of the sources
1766 /// must match. A source is a match if both principals and ip_blocks match.
1767 /// If not set, the action specified in the 'action' field will be applied
1768 /// without any rule checks for the source.
1769 pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1770
1771 /// Optional. List of attributes for the traffic destination. All of the
1772 /// destinations must match. A destination is a match if a request matches
1773 /// all the specified hosts, ports, methods and headers. If not set, the
1774 /// action specified in the 'action' field will be applied without any rule
1775 /// checks for the destination.
1776 pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1777
1778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1779 }
1780
1781 impl Rule {
1782 /// Creates a new default instance.
1783 pub fn new() -> Self {
1784 std::default::Default::default()
1785 }
1786
1787 /// Sets the value of [sources][crate::model::authorization_policy::Rule::sources].
1788 ///
1789 /// # Example
1790 /// ```ignore,no_run
1791 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1792 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1793 /// let x = Rule::new()
1794 /// .set_sources([
1795 /// Source::default()/* use setters */,
1796 /// Source::default()/* use (different) setters */,
1797 /// ]);
1798 /// ```
1799 pub fn set_sources<T, V>(mut self, v: T) -> Self
1800 where
1801 T: std::iter::IntoIterator<Item = V>,
1802 V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1803 {
1804 use std::iter::Iterator;
1805 self.sources = v.into_iter().map(|i| i.into()).collect();
1806 self
1807 }
1808
1809 /// Sets the value of [destinations][crate::model::authorization_policy::Rule::destinations].
1810 ///
1811 /// # Example
1812 /// ```ignore,no_run
1813 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1814 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1815 /// let x = Rule::new()
1816 /// .set_destinations([
1817 /// Destination::default()/* use setters */,
1818 /// Destination::default()/* use (different) setters */,
1819 /// ]);
1820 /// ```
1821 pub fn set_destinations<T, V>(mut self, v: T) -> Self
1822 where
1823 T: std::iter::IntoIterator<Item = V>,
1824 V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1825 {
1826 use std::iter::Iterator;
1827 self.destinations = v.into_iter().map(|i| i.into()).collect();
1828 self
1829 }
1830 }
1831
1832 impl wkt::message::Message for Rule {
1833 fn typename() -> &'static str {
1834 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1835 }
1836 }
1837
1838 /// Defines additional types related to [Rule].
1839 pub mod rule {
1840 #[allow(unused_imports)]
1841 use super::*;
1842
1843 /// Specification of traffic source attributes.
1844 #[derive(Clone, Default, PartialEq)]
1845 #[non_exhaustive]
1846 pub struct Source {
1847 /// Optional. List of peer identities to match for authorization. At least
1848 /// one principal should match. Each peer can be an exact match, or a
1849 /// prefix match (example, "namespace/*") or a suffix match (example,
1850 /// "*/service-account") or a presence match "*". Authorization based on
1851 /// the principal name without certificate validation (configured by
1852 /// ServerTlsPolicy resource) is considered insecure.
1853 pub principals: std::vec::Vec<std::string::String>,
1854
1855 /// Optional. List of CIDR ranges to match based on source IP address. At
1856 /// least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
1857 /// (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
1858 /// alone should be avoided. The IP addresses of any load balancers or
1859 /// proxies should be considered untrusted.
1860 pub ip_blocks: std::vec::Vec<std::string::String>,
1861
1862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1863 }
1864
1865 impl Source {
1866 /// Creates a new default instance.
1867 pub fn new() -> Self {
1868 std::default::Default::default()
1869 }
1870
1871 /// Sets the value of [principals][crate::model::authorization_policy::rule::Source::principals].
1872 ///
1873 /// # Example
1874 /// ```ignore,no_run
1875 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1876 /// let x = Source::new().set_principals(["a", "b", "c"]);
1877 /// ```
1878 pub fn set_principals<T, V>(mut self, v: T) -> Self
1879 where
1880 T: std::iter::IntoIterator<Item = V>,
1881 V: std::convert::Into<std::string::String>,
1882 {
1883 use std::iter::Iterator;
1884 self.principals = v.into_iter().map(|i| i.into()).collect();
1885 self
1886 }
1887
1888 /// Sets the value of [ip_blocks][crate::model::authorization_policy::rule::Source::ip_blocks].
1889 ///
1890 /// # Example
1891 /// ```ignore,no_run
1892 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1893 /// let x = Source::new().set_ip_blocks(["a", "b", "c"]);
1894 /// ```
1895 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1896 where
1897 T: std::iter::IntoIterator<Item = V>,
1898 V: std::convert::Into<std::string::String>,
1899 {
1900 use std::iter::Iterator;
1901 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1902 self
1903 }
1904 }
1905
1906 impl wkt::message::Message for Source {
1907 fn typename() -> &'static str {
1908 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1909 }
1910 }
1911
1912 /// Specification of traffic destination attributes.
1913 #[derive(Clone, Default, PartialEq)]
1914 #[non_exhaustive]
1915 pub struct Destination {
1916 /// Required. List of host names to match. Matched against the ":authority"
1917 /// header in http requests. At least one host should match. Each host can
1918 /// be an exact match, or a prefix match (example "mydomain.*") or a suffix
1919 /// match (example "*.myorg.com") or a presence (any) match "*".
1920 pub hosts: std::vec::Vec<std::string::String>,
1921
1922 /// Required. List of destination ports to match. At least one port should
1923 /// match.
1924 pub ports: std::vec::Vec<u32>,
1925
1926 /// Optional. A list of HTTP methods to match. At least one method should
1927 /// match. Should not be set for gRPC services.
1928 pub methods: std::vec::Vec<std::string::String>,
1929
1930 /// Optional. Match against key:value pair in http header. Provides a
1931 /// flexible match based on HTTP headers, for potentially advanced use
1932 /// cases. At least one header should match. Avoid using header matches to
1933 /// make authorization decisions unless there is a strong guarantee that
1934 /// requests arrive through a trusted client or proxy.
1935 pub http_header_match: std::option::Option<
1936 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1937 >,
1938
1939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1940 }
1941
1942 impl Destination {
1943 /// Creates a new default instance.
1944 pub fn new() -> Self {
1945 std::default::Default::default()
1946 }
1947
1948 /// Sets the value of [hosts][crate::model::authorization_policy::rule::Destination::hosts].
1949 ///
1950 /// # Example
1951 /// ```ignore,no_run
1952 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1953 /// let x = Destination::new().set_hosts(["a", "b", "c"]);
1954 /// ```
1955 pub fn set_hosts<T, V>(mut self, v: T) -> Self
1956 where
1957 T: std::iter::IntoIterator<Item = V>,
1958 V: std::convert::Into<std::string::String>,
1959 {
1960 use std::iter::Iterator;
1961 self.hosts = v.into_iter().map(|i| i.into()).collect();
1962 self
1963 }
1964
1965 /// Sets the value of [ports][crate::model::authorization_policy::rule::Destination::ports].
1966 ///
1967 /// # Example
1968 /// ```ignore,no_run
1969 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1970 /// let x = Destination::new().set_ports([1_u32, 2_u32, 3_u32]);
1971 /// ```
1972 pub fn set_ports<T, V>(mut self, v: T) -> Self
1973 where
1974 T: std::iter::IntoIterator<Item = V>,
1975 V: std::convert::Into<u32>,
1976 {
1977 use std::iter::Iterator;
1978 self.ports = v.into_iter().map(|i| i.into()).collect();
1979 self
1980 }
1981
1982 /// Sets the value of [methods][crate::model::authorization_policy::rule::Destination::methods].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1987 /// let x = Destination::new().set_methods(["a", "b", "c"]);
1988 /// ```
1989 pub fn set_methods<T, V>(mut self, v: T) -> Self
1990 where
1991 T: std::iter::IntoIterator<Item = V>,
1992 V: std::convert::Into<std::string::String>,
1993 {
1994 use std::iter::Iterator;
1995 self.methods = v.into_iter().map(|i| i.into()).collect();
1996 self
1997 }
1998
1999 /// Sets the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2000 ///
2001 /// # Example
2002 /// ```ignore,no_run
2003 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2004 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2005 /// let x = Destination::new().set_http_header_match(HttpHeaderMatch::default()/* use setters */);
2006 /// ```
2007 pub fn set_http_header_match<T>(mut self, v: T) -> Self
2008 where
2009 T: std::convert::Into<
2010 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2011 >,
2012 {
2013 self.http_header_match = std::option::Option::Some(v.into());
2014 self
2015 }
2016
2017 /// Sets or clears the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2018 ///
2019 /// # Example
2020 /// ```ignore,no_run
2021 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2022 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2023 /// let x = Destination::new().set_or_clear_http_header_match(Some(HttpHeaderMatch::default()/* use setters */));
2024 /// let x = Destination::new().set_or_clear_http_header_match(None::<HttpHeaderMatch>);
2025 /// ```
2026 pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
2027 where
2028 T: std::convert::Into<
2029 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2030 >,
2031 {
2032 self.http_header_match = v.map(|x| x.into());
2033 self
2034 }
2035 }
2036
2037 impl wkt::message::Message for Destination {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
2040 }
2041 }
2042
2043 /// Defines additional types related to [Destination].
2044 pub mod destination {
2045 #[allow(unused_imports)]
2046 use super::*;
2047
2048 /// Specification of HTTP header match attributes.
2049 #[derive(Clone, Default, PartialEq)]
2050 #[non_exhaustive]
2051 pub struct HttpHeaderMatch {
2052 /// Required. The name of the HTTP header to match. For matching
2053 /// against the HTTP request's authority, use a headerMatch
2054 /// with the header name ":authority". For matching a
2055 /// request's method, use the headerName ":method".
2056 pub header_name: std::string::String,
2057
2058 #[allow(missing_docs)]
2059 pub r#type: std::option::Option<
2060 crate::model::authorization_policy::rule::destination::http_header_match::Type,
2061 >,
2062
2063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2064 }
2065
2066 impl HttpHeaderMatch {
2067 /// Creates a new default instance.
2068 pub fn new() -> Self {
2069 std::default::Default::default()
2070 }
2071
2072 /// Sets the value of [header_name][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::header_name].
2073 ///
2074 /// # Example
2075 /// ```ignore,no_run
2076 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2077 /// let x = HttpHeaderMatch::new().set_header_name("example");
2078 /// ```
2079 pub fn set_header_name<T: std::convert::Into<std::string::String>>(
2080 mut self,
2081 v: T,
2082 ) -> Self {
2083 self.header_name = v.into();
2084 self
2085 }
2086
2087 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::type].
2088 ///
2089 /// Note that all the setters affecting `r#type` are mutually
2090 /// exclusive.
2091 ///
2092 /// # Example
2093 /// ```ignore,no_run
2094 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2095 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::http_header_match::Type;
2096 /// let x = HttpHeaderMatch::new().set_type(Some(Type::RegexMatch("example".to_string())));
2097 /// ```
2098 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
2099 {
2100 self.r#type = v.into();
2101 self
2102 }
2103
2104 /// The value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2105 /// if it holds a `RegexMatch`, `None` if the field is not set or
2106 /// holds a different branch.
2107 pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
2108 #[allow(unreachable_patterns)]
2109 self.r#type.as_ref().and_then(|v| match v {
2110 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
2111 _ => std::option::Option::None,
2112 })
2113 }
2114
2115 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2116 /// to hold a `RegexMatch`.
2117 ///
2118 /// Note that all the setters affecting `r#type` are
2119 /// mutually exclusive.
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2124 /// let x = HttpHeaderMatch::new().set_regex_match("example");
2125 /// assert!(x.regex_match().is_some());
2126 /// ```
2127 pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
2128 mut self,
2129 v: T,
2130 ) -> Self {
2131 self.r#type = std::option::Option::Some(
2132 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
2133 v.into()
2134 )
2135 );
2136 self
2137 }
2138 }
2139
2140 impl wkt::message::Message for HttpHeaderMatch {
2141 fn typename() -> &'static str {
2142 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
2143 }
2144 }
2145
2146 /// Defines additional types related to [HttpHeaderMatch].
2147 pub mod http_header_match {
2148 #[allow(unused_imports)]
2149 use super::*;
2150
2151 #[allow(missing_docs)]
2152 #[derive(Clone, Debug, PartialEq)]
2153 #[non_exhaustive]
2154 pub enum Type {
2155 /// Required. The value of the header must match the regular expression
2156 /// specified in regexMatch. For regular expression grammar,
2157 /// please see: en.cppreference.com/w/cpp/regex/ecmascript
2158 /// For matching against a port specified in the HTTP
2159 /// request, use a headerMatch with headerName set to Host
2160 /// and a regular expression that satisfies the RFC2616 Host
2161 /// header's port specifier.
2162 RegexMatch(std::string::String),
2163 }
2164 }
2165 }
2166 }
2167
2168 /// Possible values that define what action to take.
2169 ///
2170 /// # Working with unknown values
2171 ///
2172 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2173 /// additional enum variants at any time. Adding new variants is not considered
2174 /// a breaking change. Applications should write their code in anticipation of:
2175 ///
2176 /// - New values appearing in future releases of the client library, **and**
2177 /// - New values received dynamically, without application changes.
2178 ///
2179 /// Please consult the [Working with enums] section in the user guide for some
2180 /// guidelines.
2181 ///
2182 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2183 #[derive(Clone, Debug, PartialEq)]
2184 #[non_exhaustive]
2185 pub enum Action {
2186 /// Default value.
2187 Unspecified,
2188 /// Grant access.
2189 Allow,
2190 /// Deny access.
2191 /// Deny rules should be avoided unless they are used to provide a default
2192 /// "deny all" fallback.
2193 Deny,
2194 /// If set, the enum was initialized with an unknown value.
2195 ///
2196 /// Applications can examine the value using [Action::value] or
2197 /// [Action::name].
2198 UnknownValue(action::UnknownValue),
2199 }
2200
2201 #[doc(hidden)]
2202 pub mod action {
2203 #[allow(unused_imports)]
2204 use super::*;
2205 #[derive(Clone, Debug, PartialEq)]
2206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2207 }
2208
2209 impl Action {
2210 /// Gets the enum value.
2211 ///
2212 /// Returns `None` if the enum contains an unknown value deserialized from
2213 /// the string representation of enums.
2214 pub fn value(&self) -> std::option::Option<i32> {
2215 match self {
2216 Self::Unspecified => std::option::Option::Some(0),
2217 Self::Allow => std::option::Option::Some(1),
2218 Self::Deny => std::option::Option::Some(2),
2219 Self::UnknownValue(u) => u.0.value(),
2220 }
2221 }
2222
2223 /// Gets the enum value as a string.
2224 ///
2225 /// Returns `None` if the enum contains an unknown value deserialized from
2226 /// the integer representation of enums.
2227 pub fn name(&self) -> std::option::Option<&str> {
2228 match self {
2229 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2230 Self::Allow => std::option::Option::Some("ALLOW"),
2231 Self::Deny => std::option::Option::Some("DENY"),
2232 Self::UnknownValue(u) => u.0.name(),
2233 }
2234 }
2235 }
2236
2237 impl std::default::Default for Action {
2238 fn default() -> Self {
2239 use std::convert::From;
2240 Self::from(0)
2241 }
2242 }
2243
2244 impl std::fmt::Display for Action {
2245 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2246 wkt::internal::display_enum(f, self.name(), self.value())
2247 }
2248 }
2249
2250 impl std::convert::From<i32> for Action {
2251 fn from(value: i32) -> Self {
2252 match value {
2253 0 => Self::Unspecified,
2254 1 => Self::Allow,
2255 2 => Self::Deny,
2256 _ => Self::UnknownValue(action::UnknownValue(
2257 wkt::internal::UnknownEnumValue::Integer(value),
2258 )),
2259 }
2260 }
2261 }
2262
2263 impl std::convert::From<&str> for Action {
2264 fn from(value: &str) -> Self {
2265 use std::string::ToString;
2266 match value {
2267 "ACTION_UNSPECIFIED" => Self::Unspecified,
2268 "ALLOW" => Self::Allow,
2269 "DENY" => Self::Deny,
2270 _ => Self::UnknownValue(action::UnknownValue(
2271 wkt::internal::UnknownEnumValue::String(value.to_string()),
2272 )),
2273 }
2274 }
2275 }
2276
2277 impl serde::ser::Serialize for Action {
2278 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2279 where
2280 S: serde::Serializer,
2281 {
2282 match self {
2283 Self::Unspecified => serializer.serialize_i32(0),
2284 Self::Allow => serializer.serialize_i32(1),
2285 Self::Deny => serializer.serialize_i32(2),
2286 Self::UnknownValue(u) => u.0.serialize(serializer),
2287 }
2288 }
2289 }
2290
2291 impl<'de> serde::de::Deserialize<'de> for Action {
2292 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2293 where
2294 D: serde::Deserializer<'de>,
2295 {
2296 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
2297 ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
2298 ))
2299 }
2300 }
2301}
2302
2303/// Request used with the ListAuthorizationPolicies method.
2304#[derive(Clone, Default, PartialEq)]
2305#[non_exhaustive]
2306pub struct ListAuthorizationPoliciesRequest {
2307 /// Required. The project and location from which the AuthorizationPolicies
2308 /// should be listed, specified in the format
2309 /// `projects/{project}/locations/{location}`.
2310 pub parent: std::string::String,
2311
2312 /// Maximum number of AuthorizationPolicies to return per call.
2313 pub page_size: i32,
2314
2315 /// The value returned by the last
2316 /// `ListAuthorizationPoliciesResponse` Indicates that this is a
2317 /// continuation of a prior `ListAuthorizationPolicies` call, and
2318 /// that the system should return the next page of data.
2319 pub page_token: std::string::String,
2320
2321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl ListAuthorizationPoliciesRequest {
2325 /// Creates a new default instance.
2326 pub fn new() -> Self {
2327 std::default::Default::default()
2328 }
2329
2330 /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
2331 ///
2332 /// # Example
2333 /// ```ignore,no_run
2334 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2335 /// let x = ListAuthorizationPoliciesRequest::new().set_parent("example");
2336 /// ```
2337 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2338 self.parent = v.into();
2339 self
2340 }
2341
2342 /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
2343 ///
2344 /// # Example
2345 /// ```ignore,no_run
2346 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2347 /// let x = ListAuthorizationPoliciesRequest::new().set_page_size(42);
2348 /// ```
2349 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2350 self.page_size = v.into();
2351 self
2352 }
2353
2354 /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
2355 ///
2356 /// # Example
2357 /// ```ignore,no_run
2358 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2359 /// let x = ListAuthorizationPoliciesRequest::new().set_page_token("example");
2360 /// ```
2361 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2362 self.page_token = v.into();
2363 self
2364 }
2365}
2366
2367impl wkt::message::Message for ListAuthorizationPoliciesRequest {
2368 fn typename() -> &'static str {
2369 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
2370 }
2371}
2372
2373/// Response returned by the ListAuthorizationPolicies method.
2374#[derive(Clone, Default, PartialEq)]
2375#[non_exhaustive]
2376pub struct ListAuthorizationPoliciesResponse {
2377 /// List of AuthorizationPolicies resources.
2378 pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
2379
2380 /// If there might be more results than those appearing in this response, then
2381 /// `next_page_token` is included. To get the next set of results, call this
2382 /// method again using the value of `next_page_token` as `page_token`.
2383 pub next_page_token: std::string::String,
2384
2385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2386}
2387
2388impl ListAuthorizationPoliciesResponse {
2389 /// Creates a new default instance.
2390 pub fn new() -> Self {
2391 std::default::Default::default()
2392 }
2393
2394 /// Sets the value of [authorization_policies][crate::model::ListAuthorizationPoliciesResponse::authorization_policies].
2395 ///
2396 /// # Example
2397 /// ```ignore,no_run
2398 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2399 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2400 /// let x = ListAuthorizationPoliciesResponse::new()
2401 /// .set_authorization_policies([
2402 /// AuthorizationPolicy::default()/* use setters */,
2403 /// AuthorizationPolicy::default()/* use (different) setters */,
2404 /// ]);
2405 /// ```
2406 pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
2407 where
2408 T: std::iter::IntoIterator<Item = V>,
2409 V: std::convert::Into<crate::model::AuthorizationPolicy>,
2410 {
2411 use std::iter::Iterator;
2412 self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
2413 self
2414 }
2415
2416 /// Sets the value of [next_page_token][crate::model::ListAuthorizationPoliciesResponse::next_page_token].
2417 ///
2418 /// # Example
2419 /// ```ignore,no_run
2420 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2421 /// let x = ListAuthorizationPoliciesResponse::new().set_next_page_token("example");
2422 /// ```
2423 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.next_page_token = v.into();
2425 self
2426 }
2427}
2428
2429impl wkt::message::Message for ListAuthorizationPoliciesResponse {
2430 fn typename() -> &'static str {
2431 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
2432 }
2433}
2434
2435#[doc(hidden)]
2436impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
2437 type PageItem = crate::model::AuthorizationPolicy;
2438
2439 fn items(self) -> std::vec::Vec<Self::PageItem> {
2440 self.authorization_policies
2441 }
2442
2443 fn next_page_token(&self) -> std::string::String {
2444 use std::clone::Clone;
2445 self.next_page_token.clone()
2446 }
2447}
2448
2449/// Request used by the GetAuthorizationPolicy method.
2450#[derive(Clone, Default, PartialEq)]
2451#[non_exhaustive]
2452pub struct GetAuthorizationPolicyRequest {
2453 /// Required. A name of the AuthorizationPolicy to get. Must be in the format
2454 /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
2455 pub name: std::string::String,
2456
2457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2458}
2459
2460impl GetAuthorizationPolicyRequest {
2461 /// Creates a new default instance.
2462 pub fn new() -> Self {
2463 std::default::Default::default()
2464 }
2465
2466 /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
2467 ///
2468 /// # Example
2469 /// ```ignore,no_run
2470 /// # use google_cloud_networksecurity_v1::model::GetAuthorizationPolicyRequest;
2471 /// let x = GetAuthorizationPolicyRequest::new().set_name("example");
2472 /// ```
2473 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.name = v.into();
2475 self
2476 }
2477}
2478
2479impl wkt::message::Message for GetAuthorizationPolicyRequest {
2480 fn typename() -> &'static str {
2481 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
2482 }
2483}
2484
2485/// Request used by the CreateAuthorizationPolicy method.
2486#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct CreateAuthorizationPolicyRequest {
2489 /// Required. The parent resource of the AuthorizationPolicy. Must be in the
2490 /// format `projects/{project}/locations/{location}`.
2491 pub parent: std::string::String,
2492
2493 /// Required. Short name of the AuthorizationPolicy resource to be created.
2494 /// This value should be 1-63 characters long, containing only
2495 /// letters, numbers, hyphens, and underscores, and should not start
2496 /// with a number. E.g. "authz_policy".
2497 pub authorization_policy_id: std::string::String,
2498
2499 /// Required. AuthorizationPolicy resource to be created.
2500 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2501
2502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2503}
2504
2505impl CreateAuthorizationPolicyRequest {
2506 /// Creates a new default instance.
2507 pub fn new() -> Self {
2508 std::default::Default::default()
2509 }
2510
2511 /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
2512 ///
2513 /// # Example
2514 /// ```ignore,no_run
2515 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2516 /// let x = CreateAuthorizationPolicyRequest::new().set_parent("example");
2517 /// ```
2518 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2519 self.parent = v.into();
2520 self
2521 }
2522
2523 /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
2524 ///
2525 /// # Example
2526 /// ```ignore,no_run
2527 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2528 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy_id("example");
2529 /// ```
2530 pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
2531 mut self,
2532 v: T,
2533 ) -> Self {
2534 self.authorization_policy_id = v.into();
2535 self
2536 }
2537
2538 /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2539 ///
2540 /// # Example
2541 /// ```ignore,no_run
2542 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2543 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2544 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2545 /// ```
2546 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2547 where
2548 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2549 {
2550 self.authorization_policy = std::option::Option::Some(v.into());
2551 self
2552 }
2553
2554 /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2555 ///
2556 /// # Example
2557 /// ```ignore,no_run
2558 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2559 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2560 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2561 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2562 /// ```
2563 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2564 where
2565 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2566 {
2567 self.authorization_policy = v.map(|x| x.into());
2568 self
2569 }
2570}
2571
2572impl wkt::message::Message for CreateAuthorizationPolicyRequest {
2573 fn typename() -> &'static str {
2574 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
2575 }
2576}
2577
2578/// Request used by the UpdateAuthorizationPolicy method.
2579#[derive(Clone, Default, PartialEq)]
2580#[non_exhaustive]
2581pub struct UpdateAuthorizationPolicyRequest {
2582 /// Optional. Field mask is used to specify the fields to be overwritten in the
2583 /// AuthorizationPolicy resource by the update.
2584 /// The fields specified in the update_mask are relative to the resource, not
2585 /// the full request. A field will be overwritten if it is in the mask. If the
2586 /// user does not provide a mask then all fields will be overwritten.
2587 pub update_mask: std::option::Option<wkt::FieldMask>,
2588
2589 /// Required. Updated AuthorizationPolicy resource.
2590 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2591
2592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2593}
2594
2595impl UpdateAuthorizationPolicyRequest {
2596 /// Creates a new default instance.
2597 pub fn new() -> Self {
2598 std::default::Default::default()
2599 }
2600
2601 /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2602 ///
2603 /// # Example
2604 /// ```ignore,no_run
2605 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2606 /// use wkt::FieldMask;
2607 /// let x = UpdateAuthorizationPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2608 /// ```
2609 pub fn set_update_mask<T>(mut self, v: T) -> Self
2610 where
2611 T: std::convert::Into<wkt::FieldMask>,
2612 {
2613 self.update_mask = std::option::Option::Some(v.into());
2614 self
2615 }
2616
2617 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2618 ///
2619 /// # Example
2620 /// ```ignore,no_run
2621 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2622 /// use wkt::FieldMask;
2623 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2624 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2625 /// ```
2626 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2627 where
2628 T: std::convert::Into<wkt::FieldMask>,
2629 {
2630 self.update_mask = v.map(|x| x.into());
2631 self
2632 }
2633
2634 /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2635 ///
2636 /// # Example
2637 /// ```ignore,no_run
2638 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2639 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2640 /// let x = UpdateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2641 /// ```
2642 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2643 where
2644 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2645 {
2646 self.authorization_policy = std::option::Option::Some(v.into());
2647 self
2648 }
2649
2650 /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2651 ///
2652 /// # Example
2653 /// ```ignore,no_run
2654 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2655 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2656 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2657 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2658 /// ```
2659 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2660 where
2661 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2662 {
2663 self.authorization_policy = v.map(|x| x.into());
2664 self
2665 }
2666}
2667
2668impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2669 fn typename() -> &'static str {
2670 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2671 }
2672}
2673
2674/// Request used by the DeleteAuthorizationPolicy method.
2675#[derive(Clone, Default, PartialEq)]
2676#[non_exhaustive]
2677pub struct DeleteAuthorizationPolicyRequest {
2678 /// Required. A name of the AuthorizationPolicy to delete. Must be in the
2679 /// format `projects/{project}/locations/{location}/authorizationPolicies/*`.
2680 pub name: std::string::String,
2681
2682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2683}
2684
2685impl DeleteAuthorizationPolicyRequest {
2686 /// Creates a new default instance.
2687 pub fn new() -> Self {
2688 std::default::Default::default()
2689 }
2690
2691 /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
2692 ///
2693 /// # Example
2694 /// ```ignore,no_run
2695 /// # use google_cloud_networksecurity_v1::model::DeleteAuthorizationPolicyRequest;
2696 /// let x = DeleteAuthorizationPolicyRequest::new().set_name("example");
2697 /// ```
2698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2699 self.name = v.into();
2700 self
2701 }
2702}
2703
2704impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2705 fn typename() -> &'static str {
2706 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2707 }
2708}
2709
2710/// `AuthzPolicy` is a resource that allows to forward traffic to a
2711/// callout backend designed to scan the traffic for security purposes.
2712#[derive(Clone, Default, PartialEq)]
2713#[non_exhaustive]
2714pub struct AuthzPolicy {
2715 /// Required. Identifier. Name of the `AuthzPolicy` resource in the following
2716 /// format:
2717 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
2718 pub name: std::string::String,
2719
2720 /// Output only. The timestamp when the resource was created.
2721 pub create_time: std::option::Option<wkt::Timestamp>,
2722
2723 /// Output only. The timestamp when the resource was updated.
2724 pub update_time: std::option::Option<wkt::Timestamp>,
2725
2726 /// Optional. A human-readable description of the resource.
2727 pub description: std::string::String,
2728
2729 /// Optional. Set of labels associated with the `AuthzPolicy` resource.
2730 ///
2731 /// The format must comply with [the following
2732 /// requirements](/compute/docs/labeling-resources#requirements).
2733 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2734
2735 /// Required. Specifies the set of resources to which this policy should be
2736 /// applied to.
2737 pub target: std::option::Option<crate::model::authz_policy::Target>,
2738
2739 /// Optional. A list of authorization HTTP rules to match against the incoming
2740 /// request. A policy match occurs when at least one HTTP rule matches the
2741 /// request or when no HTTP rules are specified in the policy.
2742 /// At least one HTTP Rule is required for Allow or Deny Action. Limited
2743 /// to 5 rules.
2744 pub http_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2745
2746 /// Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
2747 ///
2748 /// When the action is `CUSTOM`, `customProvider` must be specified.
2749 ///
2750 /// When the action is `ALLOW`, only requests matching the policy will
2751 /// be allowed.
2752 ///
2753 /// When the action is `DENY`, only requests matching the policy will be
2754 /// denied.
2755 ///
2756 /// When a request arrives, the policies are evaluated in the following order:
2757 ///
2758 /// 1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
2759 /// policy is evaluated using the custom authorization providers and the
2760 /// request is denied if the provider rejects the request.
2761 ///
2762 /// 1. If there are any `DENY` policies that match the request, the request
2763 /// is denied.
2764 ///
2765 /// 1. If there are no `ALLOW` policies for the resource or if any of the
2766 /// `ALLOW` policies match the request, the request is allowed.
2767 ///
2768 /// 1. Else the request is denied by default if none of the configured
2769 /// AuthzPolicies with `ALLOW` action match the request.
2770 ///
2771 pub action: crate::model::authz_policy::AuthzAction,
2772
2773 /// Optional. Required if the action is `CUSTOM`. Allows delegating
2774 /// authorization decisions to Cloud IAP or to Service Extensions. One of
2775 /// `cloudIap` or `authzExtension` must be specified.
2776 pub custom_provider: std::option::Option<crate::model::authz_policy::CustomProvider>,
2777
2778 /// Optional. Immutable. Defines the type of authorization being performed.
2779 /// If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
2780 /// once AuthzPolicy is created.
2781 pub policy_profile: crate::model::authz_policy::PolicyProfile,
2782
2783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2784}
2785
2786impl AuthzPolicy {
2787 /// Creates a new default instance.
2788 pub fn new() -> Self {
2789 std::default::Default::default()
2790 }
2791
2792 /// Sets the value of [name][crate::model::AuthzPolicy::name].
2793 ///
2794 /// # Example
2795 /// ```ignore,no_run
2796 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2797 /// let x = AuthzPolicy::new().set_name("example");
2798 /// ```
2799 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2800 self.name = v.into();
2801 self
2802 }
2803
2804 /// Sets the value of [create_time][crate::model::AuthzPolicy::create_time].
2805 ///
2806 /// # Example
2807 /// ```ignore,no_run
2808 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2809 /// use wkt::Timestamp;
2810 /// let x = AuthzPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2811 /// ```
2812 pub fn set_create_time<T>(mut self, v: T) -> Self
2813 where
2814 T: std::convert::Into<wkt::Timestamp>,
2815 {
2816 self.create_time = std::option::Option::Some(v.into());
2817 self
2818 }
2819
2820 /// Sets or clears the value of [create_time][crate::model::AuthzPolicy::create_time].
2821 ///
2822 /// # Example
2823 /// ```ignore,no_run
2824 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2825 /// use wkt::Timestamp;
2826 /// let x = AuthzPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2827 /// let x = AuthzPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2828 /// ```
2829 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2830 where
2831 T: std::convert::Into<wkt::Timestamp>,
2832 {
2833 self.create_time = v.map(|x| x.into());
2834 self
2835 }
2836
2837 /// Sets the value of [update_time][crate::model::AuthzPolicy::update_time].
2838 ///
2839 /// # Example
2840 /// ```ignore,no_run
2841 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2842 /// use wkt::Timestamp;
2843 /// let x = AuthzPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2844 /// ```
2845 pub fn set_update_time<T>(mut self, v: T) -> Self
2846 where
2847 T: std::convert::Into<wkt::Timestamp>,
2848 {
2849 self.update_time = std::option::Option::Some(v.into());
2850 self
2851 }
2852
2853 /// Sets or clears the value of [update_time][crate::model::AuthzPolicy::update_time].
2854 ///
2855 /// # Example
2856 /// ```ignore,no_run
2857 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2858 /// use wkt::Timestamp;
2859 /// let x = AuthzPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2860 /// let x = AuthzPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2861 /// ```
2862 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2863 where
2864 T: std::convert::Into<wkt::Timestamp>,
2865 {
2866 self.update_time = v.map(|x| x.into());
2867 self
2868 }
2869
2870 /// Sets the value of [description][crate::model::AuthzPolicy::description].
2871 ///
2872 /// # Example
2873 /// ```ignore,no_run
2874 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2875 /// let x = AuthzPolicy::new().set_description("example");
2876 /// ```
2877 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2878 self.description = v.into();
2879 self
2880 }
2881
2882 /// Sets the value of [labels][crate::model::AuthzPolicy::labels].
2883 ///
2884 /// # Example
2885 /// ```ignore,no_run
2886 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2887 /// let x = AuthzPolicy::new().set_labels([
2888 /// ("key0", "abc"),
2889 /// ("key1", "xyz"),
2890 /// ]);
2891 /// ```
2892 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2893 where
2894 T: std::iter::IntoIterator<Item = (K, V)>,
2895 K: std::convert::Into<std::string::String>,
2896 V: std::convert::Into<std::string::String>,
2897 {
2898 use std::iter::Iterator;
2899 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2900 self
2901 }
2902
2903 /// Sets the value of [target][crate::model::AuthzPolicy::target].
2904 ///
2905 /// # Example
2906 /// ```ignore,no_run
2907 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2908 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2909 /// let x = AuthzPolicy::new().set_target(Target::default()/* use setters */);
2910 /// ```
2911 pub fn set_target<T>(mut self, v: T) -> Self
2912 where
2913 T: std::convert::Into<crate::model::authz_policy::Target>,
2914 {
2915 self.target = std::option::Option::Some(v.into());
2916 self
2917 }
2918
2919 /// Sets or clears the value of [target][crate::model::AuthzPolicy::target].
2920 ///
2921 /// # Example
2922 /// ```ignore,no_run
2923 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2924 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2925 /// let x = AuthzPolicy::new().set_or_clear_target(Some(Target::default()/* use setters */));
2926 /// let x = AuthzPolicy::new().set_or_clear_target(None::<Target>);
2927 /// ```
2928 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
2929 where
2930 T: std::convert::Into<crate::model::authz_policy::Target>,
2931 {
2932 self.target = v.map(|x| x.into());
2933 self
2934 }
2935
2936 /// Sets the value of [http_rules][crate::model::AuthzPolicy::http_rules].
2937 ///
2938 /// # Example
2939 /// ```ignore,no_run
2940 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2941 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
2942 /// let x = AuthzPolicy::new()
2943 /// .set_http_rules([
2944 /// AuthzRule::default()/* use setters */,
2945 /// AuthzRule::default()/* use (different) setters */,
2946 /// ]);
2947 /// ```
2948 pub fn set_http_rules<T, V>(mut self, v: T) -> Self
2949 where
2950 T: std::iter::IntoIterator<Item = V>,
2951 V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
2952 {
2953 use std::iter::Iterator;
2954 self.http_rules = v.into_iter().map(|i| i.into()).collect();
2955 self
2956 }
2957
2958 /// Sets the value of [action][crate::model::AuthzPolicy::action].
2959 ///
2960 /// # Example
2961 /// ```ignore,no_run
2962 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2963 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzAction;
2964 /// let x0 = AuthzPolicy::new().set_action(AuthzAction::Allow);
2965 /// let x1 = AuthzPolicy::new().set_action(AuthzAction::Deny);
2966 /// let x2 = AuthzPolicy::new().set_action(AuthzAction::Custom);
2967 /// ```
2968 pub fn set_action<T: std::convert::Into<crate::model::authz_policy::AuthzAction>>(
2969 mut self,
2970 v: T,
2971 ) -> Self {
2972 self.action = v.into();
2973 self
2974 }
2975
2976 /// Sets the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
2977 ///
2978 /// # Example
2979 /// ```ignore,no_run
2980 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2981 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
2982 /// let x = AuthzPolicy::new().set_custom_provider(CustomProvider::default()/* use setters */);
2983 /// ```
2984 pub fn set_custom_provider<T>(mut self, v: T) -> Self
2985 where
2986 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
2987 {
2988 self.custom_provider = std::option::Option::Some(v.into());
2989 self
2990 }
2991
2992 /// Sets or clears the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
2993 ///
2994 /// # Example
2995 /// ```ignore,no_run
2996 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2997 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
2998 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(Some(CustomProvider::default()/* use setters */));
2999 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(None::<CustomProvider>);
3000 /// ```
3001 pub fn set_or_clear_custom_provider<T>(mut self, v: std::option::Option<T>) -> Self
3002 where
3003 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
3004 {
3005 self.custom_provider = v.map(|x| x.into());
3006 self
3007 }
3008
3009 /// Sets the value of [policy_profile][crate::model::AuthzPolicy::policy_profile].
3010 ///
3011 /// # Example
3012 /// ```ignore,no_run
3013 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3014 /// use google_cloud_networksecurity_v1::model::authz_policy::PolicyProfile;
3015 /// let x0 = AuthzPolicy::new().set_policy_profile(PolicyProfile::RequestAuthz);
3016 /// let x1 = AuthzPolicy::new().set_policy_profile(PolicyProfile::ContentAuthz);
3017 /// ```
3018 pub fn set_policy_profile<T: std::convert::Into<crate::model::authz_policy::PolicyProfile>>(
3019 mut self,
3020 v: T,
3021 ) -> Self {
3022 self.policy_profile = v.into();
3023 self
3024 }
3025}
3026
3027impl wkt::message::Message for AuthzPolicy {
3028 fn typename() -> &'static str {
3029 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy"
3030 }
3031}
3032
3033/// Defines additional types related to [AuthzPolicy].
3034pub mod authz_policy {
3035 #[allow(unused_imports)]
3036 use super::*;
3037
3038 /// Specifies the set of targets to which this policy should be applied to.
3039 #[derive(Clone, Default, PartialEq)]
3040 #[non_exhaustive]
3041 pub struct Target {
3042 /// Optional. All gateways and forwarding rules referenced by this policy and
3043 /// extensions must share the same load balancing scheme. Supported values:
3044 /// `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer
3045 /// to [Backend services
3046 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
3047 pub load_balancing_scheme: crate::model::authz_policy::LoadBalancingScheme,
3048
3049 /// Required. A list of references to the Forwarding Rules on which this
3050 /// policy will be applied.
3051 pub resources: std::vec::Vec<std::string::String>,
3052
3053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3054 }
3055
3056 impl Target {
3057 /// Creates a new default instance.
3058 pub fn new() -> Self {
3059 std::default::Default::default()
3060 }
3061
3062 /// Sets the value of [load_balancing_scheme][crate::model::authz_policy::Target::load_balancing_scheme].
3063 ///
3064 /// # Example
3065 /// ```ignore,no_run
3066 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3067 /// use google_cloud_networksecurity_v1::model::authz_policy::LoadBalancingScheme;
3068 /// let x0 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalManaged);
3069 /// let x1 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::ExternalManaged);
3070 /// let x2 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalSelfManaged);
3071 /// ```
3072 pub fn set_load_balancing_scheme<
3073 T: std::convert::Into<crate::model::authz_policy::LoadBalancingScheme>,
3074 >(
3075 mut self,
3076 v: T,
3077 ) -> Self {
3078 self.load_balancing_scheme = v.into();
3079 self
3080 }
3081
3082 /// Sets the value of [resources][crate::model::authz_policy::Target::resources].
3083 ///
3084 /// # Example
3085 /// ```ignore,no_run
3086 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3087 /// let x = Target::new().set_resources(["a", "b", "c"]);
3088 /// ```
3089 pub fn set_resources<T, V>(mut self, v: T) -> Self
3090 where
3091 T: std::iter::IntoIterator<Item = V>,
3092 V: std::convert::Into<std::string::String>,
3093 {
3094 use std::iter::Iterator;
3095 self.resources = v.into_iter().map(|i| i.into()).collect();
3096 self
3097 }
3098 }
3099
3100 impl wkt::message::Message for Target {
3101 fn typename() -> &'static str {
3102 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.Target"
3103 }
3104 }
3105
3106 /// Conditions to match against the incoming request.
3107 #[derive(Clone, Default, PartialEq)]
3108 #[non_exhaustive]
3109 pub struct AuthzRule {
3110 /// Optional. Describes properties of a source of a request.
3111 pub from: std::option::Option<crate::model::authz_policy::authz_rule::From>,
3112
3113 /// Optional. Describes properties of a target of a request.
3114 pub to: std::option::Option<crate::model::authz_policy::authz_rule::To>,
3115
3116 /// Optional. CEL expression that describes the conditions to be satisfied
3117 /// for the action. The result of the CEL expression is ANDed with the from
3118 /// and to. Refer to the CEL language reference for a list of available
3119 /// attributes.
3120 pub when: std::string::String,
3121
3122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3123 }
3124
3125 impl AuthzRule {
3126 /// Creates a new default instance.
3127 pub fn new() -> Self {
3128 std::default::Default::default()
3129 }
3130
3131 /// Sets the value of [from][crate::model::authz_policy::AuthzRule::from].
3132 ///
3133 /// # Example
3134 /// ```ignore,no_run
3135 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3136 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3137 /// let x = AuthzRule::new().set_from(From::default()/* use setters */);
3138 /// ```
3139 pub fn set_from<T>(mut self, v: T) -> Self
3140 where
3141 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3142 {
3143 self.from = std::option::Option::Some(v.into());
3144 self
3145 }
3146
3147 /// Sets or clears the value of [from][crate::model::authz_policy::AuthzRule::from].
3148 ///
3149 /// # Example
3150 /// ```ignore,no_run
3151 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3152 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3153 /// let x = AuthzRule::new().set_or_clear_from(Some(From::default()/* use setters */));
3154 /// let x = AuthzRule::new().set_or_clear_from(None::<From>);
3155 /// ```
3156 pub fn set_or_clear_from<T>(mut self, v: std::option::Option<T>) -> Self
3157 where
3158 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3159 {
3160 self.from = v.map(|x| x.into());
3161 self
3162 }
3163
3164 /// Sets the value of [to][crate::model::authz_policy::AuthzRule::to].
3165 ///
3166 /// # Example
3167 /// ```ignore,no_run
3168 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3169 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3170 /// let x = AuthzRule::new().set_to(To::default()/* use setters */);
3171 /// ```
3172 pub fn set_to<T>(mut self, v: T) -> Self
3173 where
3174 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3175 {
3176 self.to = std::option::Option::Some(v.into());
3177 self
3178 }
3179
3180 /// Sets or clears the value of [to][crate::model::authz_policy::AuthzRule::to].
3181 ///
3182 /// # Example
3183 /// ```ignore,no_run
3184 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3185 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3186 /// let x = AuthzRule::new().set_or_clear_to(Some(To::default()/* use setters */));
3187 /// let x = AuthzRule::new().set_or_clear_to(None::<To>);
3188 /// ```
3189 pub fn set_or_clear_to<T>(mut self, v: std::option::Option<T>) -> Self
3190 where
3191 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3192 {
3193 self.to = v.map(|x| x.into());
3194 self
3195 }
3196
3197 /// Sets the value of [when][crate::model::authz_policy::AuthzRule::when].
3198 ///
3199 /// # Example
3200 /// ```ignore,no_run
3201 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3202 /// let x = AuthzRule::new().set_when("example");
3203 /// ```
3204 pub fn set_when<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3205 self.when = v.into();
3206 self
3207 }
3208 }
3209
3210 impl wkt::message::Message for AuthzRule {
3211 fn typename() -> &'static str {
3212 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule"
3213 }
3214 }
3215
3216 /// Defines additional types related to [AuthzRule].
3217 pub mod authz_rule {
3218 #[allow(unused_imports)]
3219 use super::*;
3220
3221 /// Determines how a string value should be matched.
3222 #[derive(Clone, Default, PartialEq)]
3223 #[non_exhaustive]
3224 pub struct StringMatch {
3225 /// If true, indicates the exact/prefix/suffix/contains matching should be
3226 /// case insensitive. For example, the matcher ``data`` will match both
3227 /// input string ``Data`` and ``data`` if set to true.
3228 pub ignore_case: bool,
3229
3230 #[allow(missing_docs)]
3231 pub match_pattern: std::option::Option<
3232 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3233 >,
3234
3235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3236 }
3237
3238 impl StringMatch {
3239 /// Creates a new default instance.
3240 pub fn new() -> Self {
3241 std::default::Default::default()
3242 }
3243
3244 /// Sets the value of [ignore_case][crate::model::authz_policy::authz_rule::StringMatch::ignore_case].
3245 ///
3246 /// # Example
3247 /// ```ignore,no_run
3248 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3249 /// let x = StringMatch::new().set_ignore_case(true);
3250 /// ```
3251 pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3252 self.ignore_case = v.into();
3253 self
3254 }
3255
3256 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern].
3257 ///
3258 /// Note that all the setters affecting `match_pattern` are mutually
3259 /// exclusive.
3260 ///
3261 /// # Example
3262 /// ```ignore,no_run
3263 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3264 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::string_match::MatchPattern;
3265 /// let x = StringMatch::new().set_match_pattern(Some(MatchPattern::Exact("example".to_string())));
3266 /// ```
3267 pub fn set_match_pattern<
3268 T: std::convert::Into<
3269 std::option::Option<
3270 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3271 >,
3272 >,
3273 >(
3274 mut self,
3275 v: T,
3276 ) -> Self {
3277 self.match_pattern = v.into();
3278 self
3279 }
3280
3281 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3282 /// if it holds a `Exact`, `None` if the field is not set or
3283 /// holds a different branch.
3284 pub fn exact(&self) -> std::option::Option<&std::string::String> {
3285 #[allow(unreachable_patterns)]
3286 self.match_pattern.as_ref().and_then(|v| match v {
3287 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3288 v,
3289 ) => std::option::Option::Some(v),
3290 _ => std::option::Option::None,
3291 })
3292 }
3293
3294 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3295 /// to hold a `Exact`.
3296 ///
3297 /// Note that all the setters affecting `match_pattern` are
3298 /// mutually exclusive.
3299 ///
3300 /// # Example
3301 /// ```ignore,no_run
3302 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3303 /// let x = StringMatch::new().set_exact("example");
3304 /// assert!(x.exact().is_some());
3305 /// assert!(x.prefix().is_none());
3306 /// assert!(x.suffix().is_none());
3307 /// assert!(x.contains().is_none());
3308 /// ```
3309 pub fn set_exact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3310 self.match_pattern = std::option::Option::Some(
3311 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3312 v.into(),
3313 ),
3314 );
3315 self
3316 }
3317
3318 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3319 /// if it holds a `Prefix`, `None` if the field is not set or
3320 /// holds a different branch.
3321 pub fn prefix(&self) -> std::option::Option<&std::string::String> {
3322 #[allow(unreachable_patterns)]
3323 self.match_pattern.as_ref().and_then(|v| match v {
3324 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3325 v,
3326 ) => std::option::Option::Some(v),
3327 _ => std::option::Option::None,
3328 })
3329 }
3330
3331 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3332 /// to hold a `Prefix`.
3333 ///
3334 /// Note that all the setters affecting `match_pattern` are
3335 /// mutually exclusive.
3336 ///
3337 /// # Example
3338 /// ```ignore,no_run
3339 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3340 /// let x = StringMatch::new().set_prefix("example");
3341 /// assert!(x.prefix().is_some());
3342 /// assert!(x.exact().is_none());
3343 /// assert!(x.suffix().is_none());
3344 /// assert!(x.contains().is_none());
3345 /// ```
3346 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.match_pattern = std::option::Option::Some(
3348 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3349 v.into(),
3350 ),
3351 );
3352 self
3353 }
3354
3355 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3356 /// if it holds a `Suffix`, `None` if the field is not set or
3357 /// holds a different branch.
3358 pub fn suffix(&self) -> std::option::Option<&std::string::String> {
3359 #[allow(unreachable_patterns)]
3360 self.match_pattern.as_ref().and_then(|v| match v {
3361 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3362 v,
3363 ) => std::option::Option::Some(v),
3364 _ => std::option::Option::None,
3365 })
3366 }
3367
3368 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3369 /// to hold a `Suffix`.
3370 ///
3371 /// Note that all the setters affecting `match_pattern` are
3372 /// mutually exclusive.
3373 ///
3374 /// # Example
3375 /// ```ignore,no_run
3376 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3377 /// let x = StringMatch::new().set_suffix("example");
3378 /// assert!(x.suffix().is_some());
3379 /// assert!(x.exact().is_none());
3380 /// assert!(x.prefix().is_none());
3381 /// assert!(x.contains().is_none());
3382 /// ```
3383 pub fn set_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3384 self.match_pattern = std::option::Option::Some(
3385 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3386 v.into(),
3387 ),
3388 );
3389 self
3390 }
3391
3392 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3393 /// if it holds a `Contains`, `None` if the field is not set or
3394 /// holds a different branch.
3395 pub fn contains(&self) -> std::option::Option<&std::string::String> {
3396 #[allow(unreachable_patterns)]
3397 self.match_pattern.as_ref().and_then(|v| match v {
3398 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(v) => std::option::Option::Some(v),
3399 _ => std::option::Option::None,
3400 })
3401 }
3402
3403 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3404 /// to hold a `Contains`.
3405 ///
3406 /// Note that all the setters affecting `match_pattern` are
3407 /// mutually exclusive.
3408 ///
3409 /// # Example
3410 /// ```ignore,no_run
3411 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3412 /// let x = StringMatch::new().set_contains("example");
3413 /// assert!(x.contains().is_some());
3414 /// assert!(x.exact().is_none());
3415 /// assert!(x.prefix().is_none());
3416 /// assert!(x.suffix().is_none());
3417 /// ```
3418 pub fn set_contains<T: std::convert::Into<std::string::String>>(
3419 mut self,
3420 v: T,
3421 ) -> Self {
3422 self.match_pattern = std::option::Option::Some(
3423 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(
3424 v.into(),
3425 ),
3426 );
3427 self
3428 }
3429 }
3430
3431 impl wkt::message::Message for StringMatch {
3432 fn typename() -> &'static str {
3433 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch"
3434 }
3435 }
3436
3437 /// Defines additional types related to [StringMatch].
3438 pub mod string_match {
3439 #[allow(unused_imports)]
3440 use super::*;
3441
3442 #[allow(missing_docs)]
3443 #[derive(Clone, Debug, PartialEq)]
3444 #[non_exhaustive]
3445 pub enum MatchPattern {
3446 /// The input string must match exactly the string specified here.
3447 ///
3448 /// Examples:
3449 ///
3450 /// * ``abc`` only matches the value ``abc``.
3451 Exact(std::string::String),
3452 /// The input string must have the prefix specified here.
3453 /// Note: empty prefix is not allowed, please use regex instead.
3454 ///
3455 /// Examples:
3456 ///
3457 /// * ``abc`` matches the value ``abc.xyz``
3458 Prefix(std::string::String),
3459 /// The input string must have the suffix specified here.
3460 /// Note: empty prefix is not allowed, please use regex instead.
3461 ///
3462 /// Examples:
3463 ///
3464 /// * ``abc`` matches the value ``xyz.abc``
3465 Suffix(std::string::String),
3466 /// The input string must have the substring specified here.
3467 /// Note: empty contains match is not allowed, please use regex instead.
3468 ///
3469 /// Examples:
3470 ///
3471 /// * ``abc`` matches the value ``xyz.abc.def``
3472 Contains(std::string::String),
3473 }
3474 }
3475
3476 /// Represents a range of IP Addresses.
3477 #[derive(Clone, Default, PartialEq)]
3478 #[non_exhaustive]
3479 pub struct IpBlock {
3480 /// Required. The address prefix.
3481 pub prefix: std::string::String,
3482
3483 /// Required. The length of the address range.
3484 pub length: i32,
3485
3486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3487 }
3488
3489 impl IpBlock {
3490 /// Creates a new default instance.
3491 pub fn new() -> Self {
3492 std::default::Default::default()
3493 }
3494
3495 /// Sets the value of [prefix][crate::model::authz_policy::authz_rule::IpBlock::prefix].
3496 ///
3497 /// # Example
3498 /// ```ignore,no_run
3499 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3500 /// let x = IpBlock::new().set_prefix("example");
3501 /// ```
3502 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3503 self.prefix = v.into();
3504 self
3505 }
3506
3507 /// Sets the value of [length][crate::model::authz_policy::authz_rule::IpBlock::length].
3508 ///
3509 /// # Example
3510 /// ```ignore,no_run
3511 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3512 /// let x = IpBlock::new().set_length(42);
3513 /// ```
3514 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3515 self.length = v.into();
3516 self
3517 }
3518 }
3519
3520 impl wkt::message::Message for IpBlock {
3521 fn typename() -> &'static str {
3522 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock"
3523 }
3524 }
3525
3526 /// Describes the properties of a client VM resource accessing the internal
3527 /// application load balancers.
3528 #[derive(Clone, Default, PartialEq)]
3529 #[non_exhaustive]
3530 pub struct RequestResource {
3531 /// Optional. A list of resource tag value permanent IDs to match against
3532 /// the resource manager tags value associated with the source VM of a
3533 /// request.
3534 pub tag_value_id_set: std::option::Option<
3535 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3536 >,
3537
3538 /// Optional. An IAM service account to match against the source
3539 /// service account of the VM sending the request.
3540 pub iam_service_account:
3541 std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3542
3543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3544 }
3545
3546 impl RequestResource {
3547 /// Creates a new default instance.
3548 pub fn new() -> Self {
3549 std::default::Default::default()
3550 }
3551
3552 /// Sets the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3553 ///
3554 /// # Example
3555 /// ```ignore,no_run
3556 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3557 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3558 /// let x = RequestResource::new().set_tag_value_id_set(TagValueIdSet::default()/* use setters */);
3559 /// ```
3560 pub fn set_tag_value_id_set<T>(mut self, v: T) -> Self
3561 where
3562 T: std::convert::Into<
3563 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3564 >,
3565 {
3566 self.tag_value_id_set = std::option::Option::Some(v.into());
3567 self
3568 }
3569
3570 /// Sets or clears the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3571 ///
3572 /// # Example
3573 /// ```ignore,no_run
3574 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3575 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3576 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(Some(TagValueIdSet::default()/* use setters */));
3577 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(None::<TagValueIdSet>);
3578 /// ```
3579 pub fn set_or_clear_tag_value_id_set<T>(mut self, v: std::option::Option<T>) -> Self
3580 where
3581 T: std::convert::Into<
3582 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3583 >,
3584 {
3585 self.tag_value_id_set = v.map(|x| x.into());
3586 self
3587 }
3588
3589 /// Sets the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3590 ///
3591 /// # Example
3592 /// ```ignore,no_run
3593 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3594 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3595 /// let x = RequestResource::new().set_iam_service_account(StringMatch::default()/* use setters */);
3596 /// ```
3597 pub fn set_iam_service_account<T>(mut self, v: T) -> Self
3598 where
3599 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3600 {
3601 self.iam_service_account = std::option::Option::Some(v.into());
3602 self
3603 }
3604
3605 /// Sets or clears the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3610 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3611 /// let x = RequestResource::new().set_or_clear_iam_service_account(Some(StringMatch::default()/* use setters */));
3612 /// let x = RequestResource::new().set_or_clear_iam_service_account(None::<StringMatch>);
3613 /// ```
3614 pub fn set_or_clear_iam_service_account<T>(mut self, v: std::option::Option<T>) -> Self
3615 where
3616 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3617 {
3618 self.iam_service_account = v.map(|x| x.into());
3619 self
3620 }
3621 }
3622
3623 impl wkt::message::Message for RequestResource {
3624 fn typename() -> &'static str {
3625 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource"
3626 }
3627 }
3628
3629 /// Defines additional types related to [RequestResource].
3630 pub mod request_resource {
3631 #[allow(unused_imports)]
3632 use super::*;
3633
3634 /// Describes a set of resource tag value permanent IDs to match against
3635 /// the resource manager tags value associated with the source VM of a
3636 /// request.
3637 #[derive(Clone, Default, PartialEq)]
3638 #[non_exhaustive]
3639 pub struct TagValueIdSet {
3640 /// Required. A list of resource tag value permanent IDs to match against
3641 /// the resource manager tags value associated with the source VM of a
3642 /// request. The match follows AND semantics which means all
3643 /// the ids must match. Limited to 5 ids in the Tag value id set.
3644 pub ids: std::vec::Vec<i64>,
3645
3646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3647 }
3648
3649 impl TagValueIdSet {
3650 /// Creates a new default instance.
3651 pub fn new() -> Self {
3652 std::default::Default::default()
3653 }
3654
3655 /// Sets the value of [ids][crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet::ids].
3656 ///
3657 /// # Example
3658 /// ```ignore,no_run
3659 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3660 /// let x = TagValueIdSet::new().set_ids([1, 2, 3]);
3661 /// ```
3662 pub fn set_ids<T, V>(mut self, v: T) -> Self
3663 where
3664 T: std::iter::IntoIterator<Item = V>,
3665 V: std::convert::Into<i64>,
3666 {
3667 use std::iter::Iterator;
3668 self.ids = v.into_iter().map(|i| i.into()).collect();
3669 self
3670 }
3671 }
3672
3673 impl wkt::message::Message for TagValueIdSet {
3674 fn typename() -> &'static str {
3675 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet"
3676 }
3677 }
3678 }
3679
3680 /// Determines how a HTTP header should be matched.
3681 #[derive(Clone, Default, PartialEq)]
3682 #[non_exhaustive]
3683 pub struct HeaderMatch {
3684 /// Optional. Specifies the name of the header in the request.
3685 pub name: std::string::String,
3686
3687 /// Optional. Specifies how the header match will be performed.
3688 pub value: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3689
3690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3691 }
3692
3693 impl HeaderMatch {
3694 /// Creates a new default instance.
3695 pub fn new() -> Self {
3696 std::default::Default::default()
3697 }
3698
3699 /// Sets the value of [name][crate::model::authz_policy::authz_rule::HeaderMatch::name].
3700 ///
3701 /// # Example
3702 /// ```ignore,no_run
3703 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3704 /// let x = HeaderMatch::new().set_name("example");
3705 /// ```
3706 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3707 self.name = v.into();
3708 self
3709 }
3710
3711 /// Sets the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3712 ///
3713 /// # Example
3714 /// ```ignore,no_run
3715 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3716 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3717 /// let x = HeaderMatch::new().set_value(StringMatch::default()/* use setters */);
3718 /// ```
3719 pub fn set_value<T>(mut self, v: T) -> Self
3720 where
3721 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3722 {
3723 self.value = std::option::Option::Some(v.into());
3724 self
3725 }
3726
3727 /// Sets or clears the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3728 ///
3729 /// # Example
3730 /// ```ignore,no_run
3731 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3732 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3733 /// let x = HeaderMatch::new().set_or_clear_value(Some(StringMatch::default()/* use setters */));
3734 /// let x = HeaderMatch::new().set_or_clear_value(None::<StringMatch>);
3735 /// ```
3736 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
3737 where
3738 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3739 {
3740 self.value = v.map(|x| x.into());
3741 self
3742 }
3743 }
3744
3745 impl wkt::message::Message for HeaderMatch {
3746 fn typename() -> &'static str {
3747 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch"
3748 }
3749 }
3750
3751 /// Describes the properties of a principal to be matched against.
3752 #[derive(Clone, Default, PartialEq)]
3753 #[non_exhaustive]
3754 pub struct Principal {
3755 /// Optional. An enum to decide what principal value the principal rule
3756 /// will match against. If not specified, the PrincipalSelector is
3757 /// CLIENT_CERT_URI_SAN.
3758 pub principal_selector:
3759 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3760
3761 /// Required. A non-empty string whose value is matched against the
3762 /// principal value based on the principal_selector. Only exact match can
3763 /// be applied for CLIENT_CERT_URI_SAN, CLIENT_CERT_DNS_NAME_SAN,
3764 /// CLIENT_CERT_COMMON_NAME selectors.
3765 pub principal: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3766
3767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3768 }
3769
3770 impl Principal {
3771 /// Creates a new default instance.
3772 pub fn new() -> Self {
3773 std::default::Default::default()
3774 }
3775
3776 /// Sets the value of [principal_selector][crate::model::authz_policy::authz_rule::Principal::principal_selector].
3777 ///
3778 /// # Example
3779 /// ```ignore,no_run
3780 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3781 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::principal::PrincipalSelector;
3782 /// let x0 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertUriSan);
3783 /// let x1 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertDnsNameSan);
3784 /// let x2 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertCommonName);
3785 /// ```
3786 pub fn set_principal_selector<
3787 T: std::convert::Into<
3788 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3789 >,
3790 >(
3791 mut self,
3792 v: T,
3793 ) -> Self {
3794 self.principal_selector = v.into();
3795 self
3796 }
3797
3798 /// Sets the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3799 ///
3800 /// # Example
3801 /// ```ignore,no_run
3802 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3803 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3804 /// let x = Principal::new().set_principal(StringMatch::default()/* use setters */);
3805 /// ```
3806 pub fn set_principal<T>(mut self, v: T) -> Self
3807 where
3808 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3809 {
3810 self.principal = std::option::Option::Some(v.into());
3811 self
3812 }
3813
3814 /// Sets or clears the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3815 ///
3816 /// # Example
3817 /// ```ignore,no_run
3818 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3819 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3820 /// let x = Principal::new().set_or_clear_principal(Some(StringMatch::default()/* use setters */));
3821 /// let x = Principal::new().set_or_clear_principal(None::<StringMatch>);
3822 /// ```
3823 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
3824 where
3825 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3826 {
3827 self.principal = v.map(|x| x.into());
3828 self
3829 }
3830 }
3831
3832 impl wkt::message::Message for Principal {
3833 fn typename() -> &'static str {
3834 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal"
3835 }
3836 }
3837
3838 /// Defines additional types related to [Principal].
3839 pub mod principal {
3840 #[allow(unused_imports)]
3841 use super::*;
3842
3843 /// The principal value the principal rule will match against.
3844 ///
3845 /// # Working with unknown values
3846 ///
3847 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3848 /// additional enum variants at any time. Adding new variants is not considered
3849 /// a breaking change. Applications should write their code in anticipation of:
3850 ///
3851 /// - New values appearing in future releases of the client library, **and**
3852 /// - New values received dynamically, without application changes.
3853 ///
3854 /// Please consult the [Working with enums] section in the user guide for some
3855 /// guidelines.
3856 ///
3857 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3858 #[derive(Clone, Debug, PartialEq)]
3859 #[non_exhaustive]
3860 pub enum PrincipalSelector {
3861 /// Unspecified principal selector. It will be treated as
3862 /// CLIENT_CERT_URI_SAN by default.
3863 Unspecified,
3864 /// The principal rule is matched against a list of URI SANs in the
3865 /// validated client's certificate. A match happens when there is any
3866 /// exact URI SAN value match. This is the default principal selector.
3867 ClientCertUriSan,
3868 /// The principal rule is matched against a list of DNS Name SANs in the
3869 /// validated client's certificate. A match happens when there is any
3870 /// exact DNS Name SAN value match.
3871 /// This is only applicable for Application Load Balancers
3872 /// except for classic Global External Application load balancer.
3873 /// CLIENT_CERT_DNS_NAME_SAN is not supported for INTERNAL_SELF_MANAGED
3874 /// load balancing scheme.
3875 ClientCertDnsNameSan,
3876 /// The principal rule is matched against the common name in the client's
3877 /// certificate. Authorization against multiple common names in the
3878 /// client certificate is not supported. Requests with multiple common
3879 /// names in the client certificate will be rejected if
3880 /// CLIENT_CERT_COMMON_NAME is set as the principal selector. A match
3881 /// happens when there is an exact common name value match.
3882 /// This is only applicable for Application Load Balancers
3883 /// except for global external Application Load Balancer and
3884 /// classic Application Load Balancer.
3885 /// CLIENT_CERT_COMMON_NAME is not supported for INTERNAL_SELF_MANAGED
3886 /// load balancing scheme.
3887 ClientCertCommonName,
3888 /// If set, the enum was initialized with an unknown value.
3889 ///
3890 /// Applications can examine the value using [PrincipalSelector::value] or
3891 /// [PrincipalSelector::name].
3892 UnknownValue(principal_selector::UnknownValue),
3893 }
3894
3895 #[doc(hidden)]
3896 pub mod principal_selector {
3897 #[allow(unused_imports)]
3898 use super::*;
3899 #[derive(Clone, Debug, PartialEq)]
3900 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3901 }
3902
3903 impl PrincipalSelector {
3904 /// Gets the enum value.
3905 ///
3906 /// Returns `None` if the enum contains an unknown value deserialized from
3907 /// the string representation of enums.
3908 pub fn value(&self) -> std::option::Option<i32> {
3909 match self {
3910 Self::Unspecified => std::option::Option::Some(0),
3911 Self::ClientCertUriSan => std::option::Option::Some(1),
3912 Self::ClientCertDnsNameSan => std::option::Option::Some(2),
3913 Self::ClientCertCommonName => std::option::Option::Some(3),
3914 Self::UnknownValue(u) => u.0.value(),
3915 }
3916 }
3917
3918 /// Gets the enum value as a string.
3919 ///
3920 /// Returns `None` if the enum contains an unknown value deserialized from
3921 /// the integer representation of enums.
3922 pub fn name(&self) -> std::option::Option<&str> {
3923 match self {
3924 Self::Unspecified => {
3925 std::option::Option::Some("PRINCIPAL_SELECTOR_UNSPECIFIED")
3926 }
3927 Self::ClientCertUriSan => std::option::Option::Some("CLIENT_CERT_URI_SAN"),
3928 Self::ClientCertDnsNameSan => {
3929 std::option::Option::Some("CLIENT_CERT_DNS_NAME_SAN")
3930 }
3931 Self::ClientCertCommonName => {
3932 std::option::Option::Some("CLIENT_CERT_COMMON_NAME")
3933 }
3934 Self::UnknownValue(u) => u.0.name(),
3935 }
3936 }
3937 }
3938
3939 impl std::default::Default for PrincipalSelector {
3940 fn default() -> Self {
3941 use std::convert::From;
3942 Self::from(0)
3943 }
3944 }
3945
3946 impl std::fmt::Display for PrincipalSelector {
3947 fn fmt(
3948 &self,
3949 f: &mut std::fmt::Formatter<'_>,
3950 ) -> std::result::Result<(), std::fmt::Error> {
3951 wkt::internal::display_enum(f, self.name(), self.value())
3952 }
3953 }
3954
3955 impl std::convert::From<i32> for PrincipalSelector {
3956 fn from(value: i32) -> Self {
3957 match value {
3958 0 => Self::Unspecified,
3959 1 => Self::ClientCertUriSan,
3960 2 => Self::ClientCertDnsNameSan,
3961 3 => Self::ClientCertCommonName,
3962 _ => Self::UnknownValue(principal_selector::UnknownValue(
3963 wkt::internal::UnknownEnumValue::Integer(value),
3964 )),
3965 }
3966 }
3967 }
3968
3969 impl std::convert::From<&str> for PrincipalSelector {
3970 fn from(value: &str) -> Self {
3971 use std::string::ToString;
3972 match value {
3973 "PRINCIPAL_SELECTOR_UNSPECIFIED" => Self::Unspecified,
3974 "CLIENT_CERT_URI_SAN" => Self::ClientCertUriSan,
3975 "CLIENT_CERT_DNS_NAME_SAN" => Self::ClientCertDnsNameSan,
3976 "CLIENT_CERT_COMMON_NAME" => Self::ClientCertCommonName,
3977 _ => Self::UnknownValue(principal_selector::UnknownValue(
3978 wkt::internal::UnknownEnumValue::String(value.to_string()),
3979 )),
3980 }
3981 }
3982 }
3983
3984 impl serde::ser::Serialize for PrincipalSelector {
3985 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3986 where
3987 S: serde::Serializer,
3988 {
3989 match self {
3990 Self::Unspecified => serializer.serialize_i32(0),
3991 Self::ClientCertUriSan => serializer.serialize_i32(1),
3992 Self::ClientCertDnsNameSan => serializer.serialize_i32(2),
3993 Self::ClientCertCommonName => serializer.serialize_i32(3),
3994 Self::UnknownValue(u) => u.0.serialize(serializer),
3995 }
3996 }
3997 }
3998
3999 impl<'de> serde::de::Deserialize<'de> for PrincipalSelector {
4000 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4001 where
4002 D: serde::Deserializer<'de>,
4003 {
4004 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrincipalSelector>::new(
4005 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector"))
4006 }
4007 }
4008 }
4009
4010 /// Describes properties of one or more sources of a request.
4011 #[derive(Clone, Default, PartialEq)]
4012 #[non_exhaustive]
4013 pub struct From {
4014 /// Optional. Describes the properties of a request's sources. At least one
4015 /// of sources or notSources must be specified. Limited to 1 source.
4016 /// A match occurs when ANY source (in sources or notSources) matches the
4017 /// request. Within a single source, the match follows AND semantics
4018 /// across fields and OR semantics within a single field, i.e. a match
4019 /// occurs when ANY principal matches AND ANY ipBlocks match.
4020 pub sources: std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4021
4022 /// Optional. Describes the negated properties of request sources. Matches
4023 /// requests from sources that do not match the criteria specified in this
4024 /// field. At least one of sources or notSources must be specified.
4025 pub not_sources:
4026 std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4027
4028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029 }
4030
4031 impl From {
4032 /// Creates a new default instance.
4033 pub fn new() -> Self {
4034 std::default::Default::default()
4035 }
4036
4037 /// Sets the value of [sources][crate::model::authz_policy::authz_rule::From::sources].
4038 ///
4039 /// # Example
4040 /// ```ignore,no_run
4041 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4042 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4043 /// let x = From::new()
4044 /// .set_sources([
4045 /// RequestSource::default()/* use setters */,
4046 /// RequestSource::default()/* use (different) setters */,
4047 /// ]);
4048 /// ```
4049 pub fn set_sources<T, V>(mut self, v: T) -> Self
4050 where
4051 T: std::iter::IntoIterator<Item = V>,
4052 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4053 {
4054 use std::iter::Iterator;
4055 self.sources = v.into_iter().map(|i| i.into()).collect();
4056 self
4057 }
4058
4059 /// Sets the value of [not_sources][crate::model::authz_policy::authz_rule::From::not_sources].
4060 ///
4061 /// # Example
4062 /// ```ignore,no_run
4063 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4064 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4065 /// let x = From::new()
4066 /// .set_not_sources([
4067 /// RequestSource::default()/* use setters */,
4068 /// RequestSource::default()/* use (different) setters */,
4069 /// ]);
4070 /// ```
4071 pub fn set_not_sources<T, V>(mut self, v: T) -> Self
4072 where
4073 T: std::iter::IntoIterator<Item = V>,
4074 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4075 {
4076 use std::iter::Iterator;
4077 self.not_sources = v.into_iter().map(|i| i.into()).collect();
4078 self
4079 }
4080 }
4081
4082 impl wkt::message::Message for From {
4083 fn typename() -> &'static str {
4084 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From"
4085 }
4086 }
4087
4088 /// Defines additional types related to [From].
4089 pub mod from {
4090 #[allow(unused_imports)]
4091 use super::*;
4092
4093 /// Describes the properties of a single source.
4094 #[derive(Clone, Default, PartialEq)]
4095 #[non_exhaustive]
4096 pub struct RequestSource {
4097 /// Optional. A list of identities derived from the client's certificate.
4098 /// This field will not match on a request unless frontend mutual TLS is
4099 /// enabled for the forwarding rule or Gateway and the client certificate
4100 /// has been successfully validated by mTLS.
4101 /// Each identity is a string whose value is matched against a list of
4102 /// URI SANs, DNS Name SANs, or the common name in the client's
4103 /// certificate. A match happens when any principal matches with the
4104 /// rule. Limited to 50 principals per Authorization Policy for regional
4105 /// internal Application Load Balancers, regional external Application
4106 /// Load Balancers, cross-region internal Application Load Balancers, and
4107 /// Cloud Service Mesh. This field is not supported for global external
4108 /// Application Load Balancers.
4109 pub principals: std::vec::Vec<crate::model::authz_policy::authz_rule::Principal>,
4110
4111 /// Optional. A list of IP addresses or IP address ranges to match
4112 /// against the source IP address of the request. Limited to 10 ip_blocks
4113 /// per Authorization Policy
4114 pub ip_blocks: std::vec::Vec<crate::model::authz_policy::authz_rule::IpBlock>,
4115
4116 /// Optional. A list of resources to match against the resource of the
4117 /// source VM of a request. Limited to 10 resources per Authorization
4118 /// Policy.
4119 pub resources:
4120 std::vec::Vec<crate::model::authz_policy::authz_rule::RequestResource>,
4121
4122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4123 }
4124
4125 impl RequestSource {
4126 /// Creates a new default instance.
4127 pub fn new() -> Self {
4128 std::default::Default::default()
4129 }
4130
4131 /// Sets the value of [principals][crate::model::authz_policy::authz_rule::from::RequestSource::principals].
4132 ///
4133 /// # Example
4134 /// ```ignore,no_run
4135 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4136 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
4137 /// let x = RequestSource::new()
4138 /// .set_principals([
4139 /// Principal::default()/* use setters */,
4140 /// Principal::default()/* use (different) setters */,
4141 /// ]);
4142 /// ```
4143 pub fn set_principals<T, V>(mut self, v: T) -> Self
4144 where
4145 T: std::iter::IntoIterator<Item = V>,
4146 V: std::convert::Into<crate::model::authz_policy::authz_rule::Principal>,
4147 {
4148 use std::iter::Iterator;
4149 self.principals = v.into_iter().map(|i| i.into()).collect();
4150 self
4151 }
4152
4153 /// Sets the value of [ip_blocks][crate::model::authz_policy::authz_rule::from::RequestSource::ip_blocks].
4154 ///
4155 /// # Example
4156 /// ```ignore,no_run
4157 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4158 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
4159 /// let x = RequestSource::new()
4160 /// .set_ip_blocks([
4161 /// IpBlock::default()/* use setters */,
4162 /// IpBlock::default()/* use (different) setters */,
4163 /// ]);
4164 /// ```
4165 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
4166 where
4167 T: std::iter::IntoIterator<Item = V>,
4168 V: std::convert::Into<crate::model::authz_policy::authz_rule::IpBlock>,
4169 {
4170 use std::iter::Iterator;
4171 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
4172 self
4173 }
4174
4175 /// Sets the value of [resources][crate::model::authz_policy::authz_rule::from::RequestSource::resources].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4180 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
4181 /// let x = RequestSource::new()
4182 /// .set_resources([
4183 /// RequestResource::default()/* use setters */,
4184 /// RequestResource::default()/* use (different) setters */,
4185 /// ]);
4186 /// ```
4187 pub fn set_resources<T, V>(mut self, v: T) -> Self
4188 where
4189 T: std::iter::IntoIterator<Item = V>,
4190 V: std::convert::Into<crate::model::authz_policy::authz_rule::RequestResource>,
4191 {
4192 use std::iter::Iterator;
4193 self.resources = v.into_iter().map(|i| i.into()).collect();
4194 self
4195 }
4196 }
4197
4198 impl wkt::message::Message for RequestSource {
4199 fn typename() -> &'static str {
4200 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource"
4201 }
4202 }
4203 }
4204
4205 /// Describes properties of one or more targets of a request.
4206 #[derive(Clone, Default, PartialEq)]
4207 #[non_exhaustive]
4208 pub struct To {
4209 /// Optional. Describes properties of one or more targets of a request. At
4210 /// least one of operations or notOperations must be specified. Limited to
4211 /// 1 operation. A match occurs when ANY operation (in operations or
4212 /// notOperations) matches. Within an operation, the match follows AND
4213 /// semantics across fields and OR semantics within a field, i.e. a match
4214 /// occurs when ANY path matches AND ANY header matches and ANY method
4215 /// matches.
4216 pub operations:
4217 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4218
4219 /// Optional. Describes the negated properties of the targets of a request.
4220 /// Matches requests for operations that do not match the criteria
4221 /// specified in this field. At least one of operations or notOperations
4222 /// must be specified.
4223 pub not_operations:
4224 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4225
4226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4227 }
4228
4229 impl To {
4230 /// Creates a new default instance.
4231 pub fn new() -> Self {
4232 std::default::Default::default()
4233 }
4234
4235 /// Sets the value of [operations][crate::model::authz_policy::authz_rule::To::operations].
4236 ///
4237 /// # Example
4238 /// ```ignore,no_run
4239 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4240 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4241 /// let x = To::new()
4242 /// .set_operations([
4243 /// RequestOperation::default()/* use setters */,
4244 /// RequestOperation::default()/* use (different) setters */,
4245 /// ]);
4246 /// ```
4247 pub fn set_operations<T, V>(mut self, v: T) -> Self
4248 where
4249 T: std::iter::IntoIterator<Item = V>,
4250 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4251 {
4252 use std::iter::Iterator;
4253 self.operations = v.into_iter().map(|i| i.into()).collect();
4254 self
4255 }
4256
4257 /// Sets the value of [not_operations][crate::model::authz_policy::authz_rule::To::not_operations].
4258 ///
4259 /// # Example
4260 /// ```ignore,no_run
4261 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4262 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4263 /// let x = To::new()
4264 /// .set_not_operations([
4265 /// RequestOperation::default()/* use setters */,
4266 /// RequestOperation::default()/* use (different) setters */,
4267 /// ]);
4268 /// ```
4269 pub fn set_not_operations<T, V>(mut self, v: T) -> Self
4270 where
4271 T: std::iter::IntoIterator<Item = V>,
4272 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4273 {
4274 use std::iter::Iterator;
4275 self.not_operations = v.into_iter().map(|i| i.into()).collect();
4276 self
4277 }
4278 }
4279
4280 impl wkt::message::Message for To {
4281 fn typename() -> &'static str {
4282 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To"
4283 }
4284 }
4285
4286 /// Defines additional types related to [To].
4287 pub mod to {
4288 #[allow(unused_imports)]
4289 use super::*;
4290
4291 /// Describes properties of one or more targets of a request.
4292 #[derive(Clone, Default, PartialEq)]
4293 #[non_exhaustive]
4294 pub struct RequestOperation {
4295 /// Optional. A list of headers to match against in http header.
4296 pub header_set: std::option::Option<
4297 crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet,
4298 >,
4299
4300 /// Optional. A list of HTTP Hosts to match against. The match can be one
4301 /// of exact, prefix, suffix, or contains (substring match). Matches are
4302 /// always case sensitive unless the ignoreCase is set. Limited to 10
4303 /// hosts per Authorization Policy.
4304 pub hosts: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4305
4306 /// Optional. A list of paths to match against. The match can be one of
4307 /// exact, prefix, suffix, or contains (substring match). Matches are
4308 /// always case sensitive unless the ignoreCase is set. Limited to 10
4309 /// paths per Authorization Policy.
4310 /// Note that this path match includes the query parameters. For gRPC
4311 /// services, this should be a fully-qualified name of the form
4312 /// /package.service/method.
4313 pub paths: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4314
4315 /// Optional. A list of HTTP methods to match against. Each entry must be
4316 /// a valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE,
4317 /// OPTIONS). It only allows exact match and is always case sensitive.
4318 /// Limited to 10 methods per Authorization Policy.
4319 pub methods: std::vec::Vec<std::string::String>,
4320
4321 /// Optional. Defines the MCP protocol attributes to match on. If the MCP
4322 /// payload in the request body cannot be successfully parsed, the
4323 /// request will be denied. This field can be set only for AuthzPolicies
4324 /// targeting AgentGateway resources.
4325 pub mcp: std::option::Option<
4326 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4327 >,
4328
4329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4330 }
4331
4332 impl RequestOperation {
4333 /// Creates a new default instance.
4334 pub fn new() -> Self {
4335 std::default::Default::default()
4336 }
4337
4338 /// Sets the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4339 ///
4340 /// # Example
4341 /// ```ignore,no_run
4342 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4343 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4344 /// let x = RequestOperation::new().set_header_set(HeaderSet::default()/* use setters */);
4345 /// ```
4346 pub fn set_header_set<T>(mut self, v: T) -> Self
4347 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4348 {
4349 self.header_set = std::option::Option::Some(v.into());
4350 self
4351 }
4352
4353 /// Sets or clears the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4354 ///
4355 /// # Example
4356 /// ```ignore,no_run
4357 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4358 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4359 /// let x = RequestOperation::new().set_or_clear_header_set(Some(HeaderSet::default()/* use setters */));
4360 /// let x = RequestOperation::new().set_or_clear_header_set(None::<HeaderSet>);
4361 /// ```
4362 pub fn set_or_clear_header_set<T>(mut self, v: std::option::Option<T>) -> Self
4363 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4364 {
4365 self.header_set = v.map(|x| x.into());
4366 self
4367 }
4368
4369 /// Sets the value of [hosts][crate::model::authz_policy::authz_rule::to::RequestOperation::hosts].
4370 ///
4371 /// # Example
4372 /// ```ignore,no_run
4373 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4374 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4375 /// let x = RequestOperation::new()
4376 /// .set_hosts([
4377 /// StringMatch::default()/* use setters */,
4378 /// StringMatch::default()/* use (different) setters */,
4379 /// ]);
4380 /// ```
4381 pub fn set_hosts<T, V>(mut self, v: T) -> Self
4382 where
4383 T: std::iter::IntoIterator<Item = V>,
4384 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4385 {
4386 use std::iter::Iterator;
4387 self.hosts = v.into_iter().map(|i| i.into()).collect();
4388 self
4389 }
4390
4391 /// Sets the value of [paths][crate::model::authz_policy::authz_rule::to::RequestOperation::paths].
4392 ///
4393 /// # Example
4394 /// ```ignore,no_run
4395 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4396 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4397 /// let x = RequestOperation::new()
4398 /// .set_paths([
4399 /// StringMatch::default()/* use setters */,
4400 /// StringMatch::default()/* use (different) setters */,
4401 /// ]);
4402 /// ```
4403 pub fn set_paths<T, V>(mut self, v: T) -> Self
4404 where
4405 T: std::iter::IntoIterator<Item = V>,
4406 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4407 {
4408 use std::iter::Iterator;
4409 self.paths = v.into_iter().map(|i| i.into()).collect();
4410 self
4411 }
4412
4413 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::RequestOperation::methods].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4418 /// let x = RequestOperation::new().set_methods(["a", "b", "c"]);
4419 /// ```
4420 pub fn set_methods<T, V>(mut self, v: T) -> Self
4421 where
4422 T: std::iter::IntoIterator<Item = V>,
4423 V: std::convert::Into<std::string::String>,
4424 {
4425 use std::iter::Iterator;
4426 self.methods = v.into_iter().map(|i| i.into()).collect();
4427 self
4428 }
4429
4430 /// Sets the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4431 ///
4432 /// # Example
4433 /// ```ignore,no_run
4434 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4435 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4436 /// let x = RequestOperation::new().set_mcp(Mcp::default()/* use setters */);
4437 /// ```
4438 pub fn set_mcp<T>(mut self, v: T) -> Self
4439 where
4440 T: std::convert::Into<
4441 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4442 >,
4443 {
4444 self.mcp = std::option::Option::Some(v.into());
4445 self
4446 }
4447
4448 /// Sets or clears the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4449 ///
4450 /// # Example
4451 /// ```ignore,no_run
4452 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4453 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4454 /// let x = RequestOperation::new().set_or_clear_mcp(Some(Mcp::default()/* use setters */));
4455 /// let x = RequestOperation::new().set_or_clear_mcp(None::<Mcp>);
4456 /// ```
4457 pub fn set_or_clear_mcp<T>(mut self, v: std::option::Option<T>) -> Self
4458 where
4459 T: std::convert::Into<
4460 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4461 >,
4462 {
4463 self.mcp = v.map(|x| x.into());
4464 self
4465 }
4466 }
4467
4468 impl wkt::message::Message for RequestOperation {
4469 fn typename() -> &'static str {
4470 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation"
4471 }
4472 }
4473
4474 /// Defines additional types related to [RequestOperation].
4475 pub mod request_operation {
4476 #[allow(unused_imports)]
4477 use super::*;
4478
4479 /// Describes a set of HTTP headers to match against.
4480 #[derive(Clone, Default, PartialEq)]
4481 #[non_exhaustive]
4482 pub struct HeaderSet {
4483 /// Required. A list of headers to match against in http header.
4484 /// The match can be one of exact, prefix, suffix, or contains
4485 /// (substring match). The match follows AND semantics which means all
4486 /// the headers must match. Matches are always case sensitive unless
4487 /// the ignoreCase is set. Limited to 10 headers per Authorization
4488 /// Policy.
4489 pub headers: std::vec::Vec<crate::model::authz_policy::authz_rule::HeaderMatch>,
4490
4491 pub(crate) _unknown_fields:
4492 serde_json::Map<std::string::String, serde_json::Value>,
4493 }
4494
4495 impl HeaderSet {
4496 /// Creates a new default instance.
4497 pub fn new() -> Self {
4498 std::default::Default::default()
4499 }
4500
4501 /// Sets the value of [headers][crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet::headers].
4502 ///
4503 /// # Example
4504 /// ```ignore,no_run
4505 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4506 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
4507 /// let x = HeaderSet::new()
4508 /// .set_headers([
4509 /// HeaderMatch::default()/* use setters */,
4510 /// HeaderMatch::default()/* use (different) setters */,
4511 /// ]);
4512 /// ```
4513 pub fn set_headers<T, V>(mut self, v: T) -> Self
4514 where
4515 T: std::iter::IntoIterator<Item = V>,
4516 V: std::convert::Into<crate::model::authz_policy::authz_rule::HeaderMatch>,
4517 {
4518 use std::iter::Iterator;
4519 self.headers = v.into_iter().map(|i| i.into()).collect();
4520 self
4521 }
4522 }
4523
4524 impl wkt::message::Message for HeaderSet {
4525 fn typename() -> &'static str {
4526 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet"
4527 }
4528 }
4529
4530 /// Describes a set of MCP methods to match against.
4531 #[derive(Clone, Default, PartialEq)]
4532 #[non_exhaustive]
4533 pub struct MCPMethod {
4534 /// Required. The MCP method to match against. Allowed values are as
4535 /// follows:
4536 ///
4537 /// 1. `tools`, `prompts`, `resources` - these will match against all
4538 /// sub methods under the respective methods.
4539 /// 1. `prompts/list`, `tools/list`, `resources/list`,
4540 /// `resources/templates/list`
4541 /// 1. `prompts/get`, `tools/call`, `resources/subscribe`,
4542 /// `resources/unsubscribe`, `resources/read`
4543 /// Params cannot be specified for categories 1 and 2.
4544 pub name: std::string::String,
4545
4546 /// Optional. A list of MCP method parameters to match against. The
4547 /// match can be one of exact, prefix, suffix, or contains (substring
4548 /// match). Matches are always case sensitive unless the ignoreCase is
4549 /// set. Limited to 10 MCP method parameters per Authorization Policy.
4550 pub params: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4551
4552 pub(crate) _unknown_fields:
4553 serde_json::Map<std::string::String, serde_json::Value>,
4554 }
4555
4556 impl MCPMethod {
4557 /// Creates a new default instance.
4558 pub fn new() -> Self {
4559 std::default::Default::default()
4560 }
4561
4562 /// Sets the value of [name][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::name].
4563 ///
4564 /// # Example
4565 /// ```ignore,no_run
4566 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4567 /// let x = MCPMethod::new().set_name("example");
4568 /// ```
4569 pub fn set_name<T: std::convert::Into<std::string::String>>(
4570 mut self,
4571 v: T,
4572 ) -> Self {
4573 self.name = v.into();
4574 self
4575 }
4576
4577 /// Sets the value of [params][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::params].
4578 ///
4579 /// # Example
4580 /// ```ignore,no_run
4581 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4582 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4583 /// let x = MCPMethod::new()
4584 /// .set_params([
4585 /// StringMatch::default()/* use setters */,
4586 /// StringMatch::default()/* use (different) setters */,
4587 /// ]);
4588 /// ```
4589 pub fn set_params<T, V>(mut self, v: T) -> Self
4590 where
4591 T: std::iter::IntoIterator<Item = V>,
4592 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4593 {
4594 use std::iter::Iterator;
4595 self.params = v.into_iter().map(|i| i.into()).collect();
4596 self
4597 }
4598 }
4599
4600 impl wkt::message::Message for MCPMethod {
4601 fn typename() -> &'static str {
4602 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod"
4603 }
4604 }
4605
4606 /// Describes a set of MCP protocol attributes to match against for a
4607 /// given MCP request.
4608 #[derive(Clone, Default, PartialEq)]
4609 #[non_exhaustive]
4610 pub struct Mcp {
4611
4612 /// Optional. If specified, matches on the MCP protocol’s non-access
4613 /// specific methods namely:
4614 ///
4615 /// * initialize
4616 /// * completion/
4617 /// * logging/
4618 /// * notifications/
4619 /// * ping
4620 /// Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
4621 pub base_protocol_methods_option: crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption,
4622
4623 /// Optional. A list of MCP methods and associated parameters to match
4624 /// on. It is recommended to use this field to match on tools, prompts
4625 /// and resource accesses while setting the baseProtocolMethodsOption
4626 /// to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
4627 /// protocol methods.
4628 /// Limited to 10 MCP methods per Authorization Policy.
4629 pub methods: std::vec::Vec<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>,
4630
4631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4632 }
4633
4634 impl Mcp {
4635 /// Creates a new default instance.
4636 pub fn new() -> Self {
4637 std::default::Default::default()
4638 }
4639
4640 /// Sets the value of [base_protocol_methods_option][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::base_protocol_methods_option].
4641 ///
4642 /// # Example
4643 /// ```ignore,no_run
4644 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4645 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption;
4646 /// let x0 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::SkipBaseProtocolMethods);
4647 /// let x1 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::MatchBaseProtocolMethods);
4648 /// ```
4649 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{
4650 self.base_protocol_methods_option = v.into();
4651 self
4652 }
4653
4654 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::methods].
4655 ///
4656 /// # Example
4657 /// ```ignore,no_run
4658 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4659 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4660 /// let x = Mcp::new()
4661 /// .set_methods([
4662 /// MCPMethod::default()/* use setters */,
4663 /// MCPMethod::default()/* use (different) setters */,
4664 /// ]);
4665 /// ```
4666 pub fn set_methods<T, V>(mut self, v: T) -> Self
4667 where
4668 T: std::iter::IntoIterator<Item = V>,
4669 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>
4670 {
4671 use std::iter::Iterator;
4672 self.methods = v.into_iter().map(|i| i.into()).collect();
4673 self
4674 }
4675 }
4676
4677 impl wkt::message::Message for Mcp {
4678 fn typename() -> &'static str {
4679 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP"
4680 }
4681 }
4682
4683 /// Describes the option to match against the base MCP protocol methods.
4684 ///
4685 /// # Working with unknown values
4686 ///
4687 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4688 /// additional enum variants at any time. Adding new variants is not considered
4689 /// a breaking change. Applications should write their code in anticipation of:
4690 ///
4691 /// - New values appearing in future releases of the client library, **and**
4692 /// - New values received dynamically, without application changes.
4693 ///
4694 /// Please consult the [Working with enums] section in the user guide for some
4695 /// guidelines.
4696 ///
4697 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4698 #[derive(Clone, Debug, PartialEq)]
4699 #[non_exhaustive]
4700 pub enum BaseProtocolMethodsOption {
4701 /// Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS.
4702 Unspecified,
4703 /// Skip matching on the base MCP protocol methods.
4704 SkipBaseProtocolMethods,
4705 /// Match on the base MCP protocol methods.
4706 MatchBaseProtocolMethods,
4707 /// If set, the enum was initialized with an unknown value.
4708 ///
4709 /// Applications can examine the value using [BaseProtocolMethodsOption::value] or
4710 /// [BaseProtocolMethodsOption::name].
4711 UnknownValue(base_protocol_methods_option::UnknownValue),
4712 }
4713
4714 #[doc(hidden)]
4715 pub mod base_protocol_methods_option {
4716 #[allow(unused_imports)]
4717 use super::*;
4718 #[derive(Clone, Debug, PartialEq)]
4719 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4720 }
4721
4722 impl BaseProtocolMethodsOption {
4723 /// Gets the enum value.
4724 ///
4725 /// Returns `None` if the enum contains an unknown value deserialized from
4726 /// the string representation of enums.
4727 pub fn value(&self) -> std::option::Option<i32> {
4728 match self {
4729 Self::Unspecified => std::option::Option::Some(0),
4730 Self::SkipBaseProtocolMethods => std::option::Option::Some(1),
4731 Self::MatchBaseProtocolMethods => std::option::Option::Some(2),
4732 Self::UnknownValue(u) => u.0.value(),
4733 }
4734 }
4735
4736 /// Gets the enum value as a string.
4737 ///
4738 /// Returns `None` if the enum contains an unknown value deserialized from
4739 /// the integer representation of enums.
4740 pub fn name(&self) -> std::option::Option<&str> {
4741 match self {
4742 Self::Unspecified => std::option::Option::Some(
4743 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED",
4744 ),
4745 Self::SkipBaseProtocolMethods => {
4746 std::option::Option::Some("SKIP_BASE_PROTOCOL_METHODS")
4747 }
4748 Self::MatchBaseProtocolMethods => {
4749 std::option::Option::Some("MATCH_BASE_PROTOCOL_METHODS")
4750 }
4751 Self::UnknownValue(u) => u.0.name(),
4752 }
4753 }
4754 }
4755
4756 impl std::default::Default for BaseProtocolMethodsOption {
4757 fn default() -> Self {
4758 use std::convert::From;
4759 Self::from(0)
4760 }
4761 }
4762
4763 impl std::fmt::Display for BaseProtocolMethodsOption {
4764 fn fmt(
4765 &self,
4766 f: &mut std::fmt::Formatter<'_>,
4767 ) -> std::result::Result<(), std::fmt::Error> {
4768 wkt::internal::display_enum(f, self.name(), self.value())
4769 }
4770 }
4771
4772 impl std::convert::From<i32> for BaseProtocolMethodsOption {
4773 fn from(value: i32) -> Self {
4774 match value {
4775 0 => Self::Unspecified,
4776 1 => Self::SkipBaseProtocolMethods,
4777 2 => Self::MatchBaseProtocolMethods,
4778 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4779 wkt::internal::UnknownEnumValue::Integer(value),
4780 )),
4781 }
4782 }
4783 }
4784
4785 impl std::convert::From<&str> for BaseProtocolMethodsOption {
4786 fn from(value: &str) -> Self {
4787 use std::string::ToString;
4788 match value {
4789 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED" => Self::Unspecified,
4790 "SKIP_BASE_PROTOCOL_METHODS" => Self::SkipBaseProtocolMethods,
4791 "MATCH_BASE_PROTOCOL_METHODS" => Self::MatchBaseProtocolMethods,
4792 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4793 wkt::internal::UnknownEnumValue::String(value.to_string()),
4794 )),
4795 }
4796 }
4797 }
4798
4799 impl serde::ser::Serialize for BaseProtocolMethodsOption {
4800 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4801 where
4802 S: serde::Serializer,
4803 {
4804 match self {
4805 Self::Unspecified => serializer.serialize_i32(0),
4806 Self::SkipBaseProtocolMethods => serializer.serialize_i32(1),
4807 Self::MatchBaseProtocolMethods => serializer.serialize_i32(2),
4808 Self::UnknownValue(u) => u.0.serialize(serializer),
4809 }
4810 }
4811 }
4812
4813 impl<'de> serde::de::Deserialize<'de> for BaseProtocolMethodsOption {
4814 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4815 where
4816 D: serde::Deserializer<'de>,
4817 {
4818 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BaseProtocolMethodsOption>::new(
4819 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption"))
4820 }
4821 }
4822 }
4823 }
4824 }
4825
4826 /// Allows delegating authorization decisions to Cloud IAP or to
4827 /// Service Extensions.
4828 #[derive(Clone, Default, PartialEq)]
4829 #[non_exhaustive]
4830 pub struct CustomProvider {
4831 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4832 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4833 /// level is not compatible with Cloud IAP settings in the BackendService.
4834 /// Enabling IAP in both places will result in request failure. Ensure that
4835 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4836 /// both places.
4837 pub cloud_iap: std::option::Option<crate::model::authz_policy::custom_provider::CloudIap>,
4838
4839 /// Optional. Delegate authorization decision to user authored Service
4840 /// Extension. Only one of cloudIap or authzExtension can be specified.
4841 pub authz_extension:
4842 std::option::Option<crate::model::authz_policy::custom_provider::AuthzExtension>,
4843
4844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4845 }
4846
4847 impl CustomProvider {
4848 /// Creates a new default instance.
4849 pub fn new() -> Self {
4850 std::default::Default::default()
4851 }
4852
4853 /// Sets the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4854 ///
4855 /// # Example
4856 /// ```ignore,no_run
4857 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4858 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4859 /// let x = CustomProvider::new().set_cloud_iap(CloudIap::default()/* use setters */);
4860 /// ```
4861 pub fn set_cloud_iap<T>(mut self, v: T) -> Self
4862 where
4863 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4864 {
4865 self.cloud_iap = std::option::Option::Some(v.into());
4866 self
4867 }
4868
4869 /// Sets or clears the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4870 ///
4871 /// # Example
4872 /// ```ignore,no_run
4873 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4874 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4875 /// let x = CustomProvider::new().set_or_clear_cloud_iap(Some(CloudIap::default()/* use setters */));
4876 /// let x = CustomProvider::new().set_or_clear_cloud_iap(None::<CloudIap>);
4877 /// ```
4878 pub fn set_or_clear_cloud_iap<T>(mut self, v: std::option::Option<T>) -> Self
4879 where
4880 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4881 {
4882 self.cloud_iap = v.map(|x| x.into());
4883 self
4884 }
4885
4886 /// Sets the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4887 ///
4888 /// # Example
4889 /// ```ignore,no_run
4890 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4891 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4892 /// let x = CustomProvider::new().set_authz_extension(AuthzExtension::default()/* use setters */);
4893 /// ```
4894 pub fn set_authz_extension<T>(mut self, v: T) -> Self
4895 where
4896 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
4897 {
4898 self.authz_extension = std::option::Option::Some(v.into());
4899 self
4900 }
4901
4902 /// Sets or clears the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4903 ///
4904 /// # Example
4905 /// ```ignore,no_run
4906 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4907 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4908 /// let x = CustomProvider::new().set_or_clear_authz_extension(Some(AuthzExtension::default()/* use setters */));
4909 /// let x = CustomProvider::new().set_or_clear_authz_extension(None::<AuthzExtension>);
4910 /// ```
4911 pub fn set_or_clear_authz_extension<T>(mut self, v: std::option::Option<T>) -> Self
4912 where
4913 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
4914 {
4915 self.authz_extension = v.map(|x| x.into());
4916 self
4917 }
4918 }
4919
4920 impl wkt::message::Message for CustomProvider {
4921 fn typename() -> &'static str {
4922 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider"
4923 }
4924 }
4925
4926 /// Defines additional types related to [CustomProvider].
4927 pub mod custom_provider {
4928 #[allow(unused_imports)]
4929 use super::*;
4930
4931 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4932 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4933 /// level is not compatible with Cloud IAP settings in the BackendService.
4934 /// Enabling IAP in both places will result in request failure. Ensure that
4935 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4936 /// both places.
4937 #[derive(Clone, Default, PartialEq)]
4938 #[non_exhaustive]
4939 pub struct CloudIap {
4940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4941 }
4942
4943 impl CloudIap {
4944 /// Creates a new default instance.
4945 pub fn new() -> Self {
4946 std::default::Default::default()
4947 }
4948 }
4949
4950 impl wkt::message::Message for CloudIap {
4951 fn typename() -> &'static str {
4952 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap"
4953 }
4954 }
4955
4956 /// Optional. Delegate authorization decision to user authored extension.
4957 /// Only one of cloudIap or authzExtension can be specified.
4958 #[derive(Clone, Default, PartialEq)]
4959 #[non_exhaustive]
4960 pub struct AuthzExtension {
4961 /// Required. A list of references to authorization
4962 /// extensions that will be invoked for requests matching this policy.
4963 /// Limited to 1 custom provider.
4964 pub resources: std::vec::Vec<std::string::String>,
4965
4966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4967 }
4968
4969 impl AuthzExtension {
4970 /// Creates a new default instance.
4971 pub fn new() -> Self {
4972 std::default::Default::default()
4973 }
4974
4975 /// Sets the value of [resources][crate::model::authz_policy::custom_provider::AuthzExtension::resources].
4976 ///
4977 /// # Example
4978 /// ```ignore,no_run
4979 /// # use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4980 /// let x = AuthzExtension::new().set_resources(["a", "b", "c"]);
4981 /// ```
4982 pub fn set_resources<T, V>(mut self, v: T) -> Self
4983 where
4984 T: std::iter::IntoIterator<Item = V>,
4985 V: std::convert::Into<std::string::String>,
4986 {
4987 use std::iter::Iterator;
4988 self.resources = v.into_iter().map(|i| i.into()).collect();
4989 self
4990 }
4991 }
4992
4993 impl wkt::message::Message for AuthzExtension {
4994 fn typename() -> &'static str {
4995 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension"
4996 }
4997 }
4998 }
4999
5000 /// Load balancing schemes supported by the `AuthzPolicy` resource. The valid
5001 /// values are `INTERNAL_MANAGED` and
5002 /// `EXTERNAL_MANAGED`. For more information, refer to [Backend services
5003 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
5004 ///
5005 /// # Working with unknown values
5006 ///
5007 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5008 /// additional enum variants at any time. Adding new variants is not considered
5009 /// a breaking change. Applications should write their code in anticipation of:
5010 ///
5011 /// - New values appearing in future releases of the client library, **and**
5012 /// - New values received dynamically, without application changes.
5013 ///
5014 /// Please consult the [Working with enums] section in the user guide for some
5015 /// guidelines.
5016 ///
5017 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5018 #[derive(Clone, Debug, PartialEq)]
5019 #[non_exhaustive]
5020 pub enum LoadBalancingScheme {
5021 /// Default value. Do not use.
5022 Unspecified,
5023 /// Signifies that this is used for Regional internal or Cross-region
5024 /// internal Application Load Balancing.
5025 InternalManaged,
5026 /// Signifies that this is used for Global external or Regional external
5027 /// Application Load Balancing.
5028 ExternalManaged,
5029 /// Signifies that this is used for Cloud Service Mesh. Meant for use by
5030 /// CSM GKE controller only.
5031 InternalSelfManaged,
5032 /// If set, the enum was initialized with an unknown value.
5033 ///
5034 /// Applications can examine the value using [LoadBalancingScheme::value] or
5035 /// [LoadBalancingScheme::name].
5036 UnknownValue(load_balancing_scheme::UnknownValue),
5037 }
5038
5039 #[doc(hidden)]
5040 pub mod load_balancing_scheme {
5041 #[allow(unused_imports)]
5042 use super::*;
5043 #[derive(Clone, Debug, PartialEq)]
5044 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5045 }
5046
5047 impl LoadBalancingScheme {
5048 /// Gets the enum value.
5049 ///
5050 /// Returns `None` if the enum contains an unknown value deserialized from
5051 /// the string representation of enums.
5052 pub fn value(&self) -> std::option::Option<i32> {
5053 match self {
5054 Self::Unspecified => std::option::Option::Some(0),
5055 Self::InternalManaged => std::option::Option::Some(1),
5056 Self::ExternalManaged => std::option::Option::Some(2),
5057 Self::InternalSelfManaged => std::option::Option::Some(3),
5058 Self::UnknownValue(u) => u.0.value(),
5059 }
5060 }
5061
5062 /// Gets the enum value as a string.
5063 ///
5064 /// Returns `None` if the enum contains an unknown value deserialized from
5065 /// the integer representation of enums.
5066 pub fn name(&self) -> std::option::Option<&str> {
5067 match self {
5068 Self::Unspecified => std::option::Option::Some("LOAD_BALANCING_SCHEME_UNSPECIFIED"),
5069 Self::InternalManaged => std::option::Option::Some("INTERNAL_MANAGED"),
5070 Self::ExternalManaged => std::option::Option::Some("EXTERNAL_MANAGED"),
5071 Self::InternalSelfManaged => std::option::Option::Some("INTERNAL_SELF_MANAGED"),
5072 Self::UnknownValue(u) => u.0.name(),
5073 }
5074 }
5075 }
5076
5077 impl std::default::Default for LoadBalancingScheme {
5078 fn default() -> Self {
5079 use std::convert::From;
5080 Self::from(0)
5081 }
5082 }
5083
5084 impl std::fmt::Display for LoadBalancingScheme {
5085 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5086 wkt::internal::display_enum(f, self.name(), self.value())
5087 }
5088 }
5089
5090 impl std::convert::From<i32> for LoadBalancingScheme {
5091 fn from(value: i32) -> Self {
5092 match value {
5093 0 => Self::Unspecified,
5094 1 => Self::InternalManaged,
5095 2 => Self::ExternalManaged,
5096 3 => Self::InternalSelfManaged,
5097 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5098 wkt::internal::UnknownEnumValue::Integer(value),
5099 )),
5100 }
5101 }
5102 }
5103
5104 impl std::convert::From<&str> for LoadBalancingScheme {
5105 fn from(value: &str) -> Self {
5106 use std::string::ToString;
5107 match value {
5108 "LOAD_BALANCING_SCHEME_UNSPECIFIED" => Self::Unspecified,
5109 "INTERNAL_MANAGED" => Self::InternalManaged,
5110 "EXTERNAL_MANAGED" => Self::ExternalManaged,
5111 "INTERNAL_SELF_MANAGED" => Self::InternalSelfManaged,
5112 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5113 wkt::internal::UnknownEnumValue::String(value.to_string()),
5114 )),
5115 }
5116 }
5117 }
5118
5119 impl serde::ser::Serialize for LoadBalancingScheme {
5120 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5121 where
5122 S: serde::Serializer,
5123 {
5124 match self {
5125 Self::Unspecified => serializer.serialize_i32(0),
5126 Self::InternalManaged => serializer.serialize_i32(1),
5127 Self::ExternalManaged => serializer.serialize_i32(2),
5128 Self::InternalSelfManaged => serializer.serialize_i32(3),
5129 Self::UnknownValue(u) => u.0.serialize(serializer),
5130 }
5131 }
5132 }
5133
5134 impl<'de> serde::de::Deserialize<'de> for LoadBalancingScheme {
5135 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5136 where
5137 D: serde::Deserializer<'de>,
5138 {
5139 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancingScheme>::new(
5140 ".google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme",
5141 ))
5142 }
5143 }
5144
5145 /// The action to be applied to this policy. Valid values are
5146 /// `ALLOW`, `DENY`, `CUSTOM`.
5147 ///
5148 /// # Working with unknown values
5149 ///
5150 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5151 /// additional enum variants at any time. Adding new variants is not considered
5152 /// a breaking change. Applications should write their code in anticipation of:
5153 ///
5154 /// - New values appearing in future releases of the client library, **and**
5155 /// - New values received dynamically, without application changes.
5156 ///
5157 /// Please consult the [Working with enums] section in the user guide for some
5158 /// guidelines.
5159 ///
5160 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5161 #[derive(Clone, Debug, PartialEq)]
5162 #[non_exhaustive]
5163 pub enum AuthzAction {
5164 /// Unspecified action.
5165 Unspecified,
5166 /// Allow request to pass through to the backend.
5167 Allow,
5168 /// Deny the request and return a HTTP 404 to the client.
5169 Deny,
5170 /// Delegate the authorization decision to an external authorization engine.
5171 Custom,
5172 /// If set, the enum was initialized with an unknown value.
5173 ///
5174 /// Applications can examine the value using [AuthzAction::value] or
5175 /// [AuthzAction::name].
5176 UnknownValue(authz_action::UnknownValue),
5177 }
5178
5179 #[doc(hidden)]
5180 pub mod authz_action {
5181 #[allow(unused_imports)]
5182 use super::*;
5183 #[derive(Clone, Debug, PartialEq)]
5184 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5185 }
5186
5187 impl AuthzAction {
5188 /// Gets the enum value.
5189 ///
5190 /// Returns `None` if the enum contains an unknown value deserialized from
5191 /// the string representation of enums.
5192 pub fn value(&self) -> std::option::Option<i32> {
5193 match self {
5194 Self::Unspecified => std::option::Option::Some(0),
5195 Self::Allow => std::option::Option::Some(1),
5196 Self::Deny => std::option::Option::Some(2),
5197 Self::Custom => std::option::Option::Some(3),
5198 Self::UnknownValue(u) => u.0.value(),
5199 }
5200 }
5201
5202 /// Gets the enum value as a string.
5203 ///
5204 /// Returns `None` if the enum contains an unknown value deserialized from
5205 /// the integer representation of enums.
5206 pub fn name(&self) -> std::option::Option<&str> {
5207 match self {
5208 Self::Unspecified => std::option::Option::Some("AUTHZ_ACTION_UNSPECIFIED"),
5209 Self::Allow => std::option::Option::Some("ALLOW"),
5210 Self::Deny => std::option::Option::Some("DENY"),
5211 Self::Custom => std::option::Option::Some("CUSTOM"),
5212 Self::UnknownValue(u) => u.0.name(),
5213 }
5214 }
5215 }
5216
5217 impl std::default::Default for AuthzAction {
5218 fn default() -> Self {
5219 use std::convert::From;
5220 Self::from(0)
5221 }
5222 }
5223
5224 impl std::fmt::Display for AuthzAction {
5225 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5226 wkt::internal::display_enum(f, self.name(), self.value())
5227 }
5228 }
5229
5230 impl std::convert::From<i32> for AuthzAction {
5231 fn from(value: i32) -> Self {
5232 match value {
5233 0 => Self::Unspecified,
5234 1 => Self::Allow,
5235 2 => Self::Deny,
5236 3 => Self::Custom,
5237 _ => Self::UnknownValue(authz_action::UnknownValue(
5238 wkt::internal::UnknownEnumValue::Integer(value),
5239 )),
5240 }
5241 }
5242 }
5243
5244 impl std::convert::From<&str> for AuthzAction {
5245 fn from(value: &str) -> Self {
5246 use std::string::ToString;
5247 match value {
5248 "AUTHZ_ACTION_UNSPECIFIED" => Self::Unspecified,
5249 "ALLOW" => Self::Allow,
5250 "DENY" => Self::Deny,
5251 "CUSTOM" => Self::Custom,
5252 _ => Self::UnknownValue(authz_action::UnknownValue(
5253 wkt::internal::UnknownEnumValue::String(value.to_string()),
5254 )),
5255 }
5256 }
5257 }
5258
5259 impl serde::ser::Serialize for AuthzAction {
5260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5261 where
5262 S: serde::Serializer,
5263 {
5264 match self {
5265 Self::Unspecified => serializer.serialize_i32(0),
5266 Self::Allow => serializer.serialize_i32(1),
5267 Self::Deny => serializer.serialize_i32(2),
5268 Self::Custom => serializer.serialize_i32(3),
5269 Self::UnknownValue(u) => u.0.serialize(serializer),
5270 }
5271 }
5272 }
5273
5274 impl<'de> serde::de::Deserialize<'de> for AuthzAction {
5275 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5276 where
5277 D: serde::Deserializer<'de>,
5278 {
5279 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthzAction>::new(
5280 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction",
5281 ))
5282 }
5283 }
5284
5285 /// The type of authorization being performed.
5286 /// New values may be added in the future.
5287 ///
5288 /// # Working with unknown values
5289 ///
5290 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5291 /// additional enum variants at any time. Adding new variants is not considered
5292 /// a breaking change. Applications should write their code in anticipation of:
5293 ///
5294 /// - New values appearing in future releases of the client library, **and**
5295 /// - New values received dynamically, without application changes.
5296 ///
5297 /// Please consult the [Working with enums] section in the user guide for some
5298 /// guidelines.
5299 ///
5300 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5301 #[derive(Clone, Debug, PartialEq)]
5302 #[non_exhaustive]
5303 pub enum PolicyProfile {
5304 /// Unspecified policy profile.
5305 Unspecified,
5306 /// Applies to request authorization. `CUSTOM` authorization
5307 /// policies with Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or
5308 /// `EXT_PROC_GRPC` protocols. Extensions are invoked only for request header
5309 /// events.
5310 RequestAuthz,
5311 /// Applies to content security, sanitization, etc. Only
5312 /// `CUSTOM` action is allowed in this policy profile. AuthzExtensions in the
5313 /// custom provider must support `EXT_PROC_GRPC` protocol only and be capable
5314 /// of receiving all `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY,
5315 /// REQUEST_TRAILERS, RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS)
5316 /// with `FULL_DUPLEX_STREAMED` body send mode.
5317 ContentAuthz,
5318 /// If set, the enum was initialized with an unknown value.
5319 ///
5320 /// Applications can examine the value using [PolicyProfile::value] or
5321 /// [PolicyProfile::name].
5322 UnknownValue(policy_profile::UnknownValue),
5323 }
5324
5325 #[doc(hidden)]
5326 pub mod policy_profile {
5327 #[allow(unused_imports)]
5328 use super::*;
5329 #[derive(Clone, Debug, PartialEq)]
5330 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5331 }
5332
5333 impl PolicyProfile {
5334 /// Gets the enum value.
5335 ///
5336 /// Returns `None` if the enum contains an unknown value deserialized from
5337 /// the string representation of enums.
5338 pub fn value(&self) -> std::option::Option<i32> {
5339 match self {
5340 Self::Unspecified => std::option::Option::Some(0),
5341 Self::RequestAuthz => std::option::Option::Some(1),
5342 Self::ContentAuthz => std::option::Option::Some(2),
5343 Self::UnknownValue(u) => u.0.value(),
5344 }
5345 }
5346
5347 /// Gets the enum value as a string.
5348 ///
5349 /// Returns `None` if the enum contains an unknown value deserialized from
5350 /// the integer representation of enums.
5351 pub fn name(&self) -> std::option::Option<&str> {
5352 match self {
5353 Self::Unspecified => std::option::Option::Some("POLICY_PROFILE_UNSPECIFIED"),
5354 Self::RequestAuthz => std::option::Option::Some("REQUEST_AUTHZ"),
5355 Self::ContentAuthz => std::option::Option::Some("CONTENT_AUTHZ"),
5356 Self::UnknownValue(u) => u.0.name(),
5357 }
5358 }
5359 }
5360
5361 impl std::default::Default for PolicyProfile {
5362 fn default() -> Self {
5363 use std::convert::From;
5364 Self::from(0)
5365 }
5366 }
5367
5368 impl std::fmt::Display for PolicyProfile {
5369 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5370 wkt::internal::display_enum(f, self.name(), self.value())
5371 }
5372 }
5373
5374 impl std::convert::From<i32> for PolicyProfile {
5375 fn from(value: i32) -> Self {
5376 match value {
5377 0 => Self::Unspecified,
5378 1 => Self::RequestAuthz,
5379 2 => Self::ContentAuthz,
5380 _ => Self::UnknownValue(policy_profile::UnknownValue(
5381 wkt::internal::UnknownEnumValue::Integer(value),
5382 )),
5383 }
5384 }
5385 }
5386
5387 impl std::convert::From<&str> for PolicyProfile {
5388 fn from(value: &str) -> Self {
5389 use std::string::ToString;
5390 match value {
5391 "POLICY_PROFILE_UNSPECIFIED" => Self::Unspecified,
5392 "REQUEST_AUTHZ" => Self::RequestAuthz,
5393 "CONTENT_AUTHZ" => Self::ContentAuthz,
5394 _ => Self::UnknownValue(policy_profile::UnknownValue(
5395 wkt::internal::UnknownEnumValue::String(value.to_string()),
5396 )),
5397 }
5398 }
5399 }
5400
5401 impl serde::ser::Serialize for PolicyProfile {
5402 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5403 where
5404 S: serde::Serializer,
5405 {
5406 match self {
5407 Self::Unspecified => serializer.serialize_i32(0),
5408 Self::RequestAuthz => serializer.serialize_i32(1),
5409 Self::ContentAuthz => serializer.serialize_i32(2),
5410 Self::UnknownValue(u) => u.0.serialize(serializer),
5411 }
5412 }
5413 }
5414
5415 impl<'de> serde::de::Deserialize<'de> for PolicyProfile {
5416 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5417 where
5418 D: serde::Deserializer<'de>,
5419 {
5420 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyProfile>::new(
5421 ".google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile",
5422 ))
5423 }
5424 }
5425}
5426
5427/// Message for creating an `AuthzPolicy` resource.
5428#[derive(Clone, Default, PartialEq)]
5429#[non_exhaustive]
5430pub struct CreateAuthzPolicyRequest {
5431 /// Required. The parent resource of the `AuthzPolicy` resource. Must be in
5432 /// the format `projects/{project}/locations/{location}`.
5433 pub parent: std::string::String,
5434
5435 /// Required. User-provided ID of the `AuthzPolicy` resource to be created.
5436 pub authz_policy_id: std::string::String,
5437
5438 /// Required. `AuthzPolicy` resource to be created.
5439 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5440
5441 /// Optional. An optional request ID to identify requests. Specify a unique
5442 /// request ID so that if you must retry your request, the server can ignore
5443 /// the request if it has already been completed. The server guarantees
5444 /// that for at least 60 minutes since the first request.
5445 ///
5446 /// For example, consider a situation where you make an initial request and the
5447 /// request times out. If you make the request again with the same request
5448 /// ID, the server can check if original operation with the same request ID
5449 /// was received, and if so, ignores the second request. This prevents
5450 /// clients from accidentally creating duplicate commitments.
5451 ///
5452 /// The request ID must be a valid UUID with the exception that zero UUID is
5453 /// not supported (00000000-0000-0000-0000-000000000000).
5454 pub request_id: std::string::String,
5455
5456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5457}
5458
5459impl CreateAuthzPolicyRequest {
5460 /// Creates a new default instance.
5461 pub fn new() -> Self {
5462 std::default::Default::default()
5463 }
5464
5465 /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
5466 ///
5467 /// # Example
5468 /// ```ignore,no_run
5469 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5470 /// let x = CreateAuthzPolicyRequest::new().set_parent("example");
5471 /// ```
5472 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473 self.parent = v.into();
5474 self
5475 }
5476
5477 /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
5478 ///
5479 /// # Example
5480 /// ```ignore,no_run
5481 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5482 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy_id("example");
5483 /// ```
5484 pub fn set_authz_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5485 self.authz_policy_id = v.into();
5486 self
5487 }
5488
5489 /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5490 ///
5491 /// # Example
5492 /// ```ignore,no_run
5493 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5494 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5495 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5496 /// ```
5497 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5498 where
5499 T: std::convert::Into<crate::model::AuthzPolicy>,
5500 {
5501 self.authz_policy = std::option::Option::Some(v.into());
5502 self
5503 }
5504
5505 /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5506 ///
5507 /// # Example
5508 /// ```ignore,no_run
5509 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5510 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5511 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5512 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5513 /// ```
5514 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5515 where
5516 T: std::convert::Into<crate::model::AuthzPolicy>,
5517 {
5518 self.authz_policy = v.map(|x| x.into());
5519 self
5520 }
5521
5522 /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
5523 ///
5524 /// # Example
5525 /// ```ignore,no_run
5526 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5527 /// let x = CreateAuthzPolicyRequest::new().set_request_id("example");
5528 /// ```
5529 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5530 self.request_id = v.into();
5531 self
5532 }
5533}
5534
5535impl wkt::message::Message for CreateAuthzPolicyRequest {
5536 fn typename() -> &'static str {
5537 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthzPolicyRequest"
5538 }
5539}
5540
5541/// Message for requesting list of `AuthzPolicy` resources.
5542#[derive(Clone, Default, PartialEq)]
5543#[non_exhaustive]
5544pub struct ListAuthzPoliciesRequest {
5545 /// Required. The project and location from which the `AuthzPolicy` resources
5546 /// are listed, specified in the following format:
5547 /// `projects/{project}/locations/{location}`.
5548 pub parent: std::string::String,
5549
5550 /// Optional. Requested page size. The server might return fewer items than
5551 /// requested. If unspecified, the server picks an appropriate default.
5552 pub page_size: i32,
5553
5554 /// Optional. A token identifying a page of results that the server returns.
5555 pub page_token: std::string::String,
5556
5557 /// Optional. Filtering results.
5558 pub filter: std::string::String,
5559
5560 /// Optional. Hint for how to order the results.
5561 pub order_by: std::string::String,
5562
5563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5564}
5565
5566impl ListAuthzPoliciesRequest {
5567 /// Creates a new default instance.
5568 pub fn new() -> Self {
5569 std::default::Default::default()
5570 }
5571
5572 /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
5573 ///
5574 /// # Example
5575 /// ```ignore,no_run
5576 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5577 /// let x = ListAuthzPoliciesRequest::new().set_parent("example");
5578 /// ```
5579 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5580 self.parent = v.into();
5581 self
5582 }
5583
5584 /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
5585 ///
5586 /// # Example
5587 /// ```ignore,no_run
5588 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5589 /// let x = ListAuthzPoliciesRequest::new().set_page_size(42);
5590 /// ```
5591 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5592 self.page_size = v.into();
5593 self
5594 }
5595
5596 /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
5597 ///
5598 /// # Example
5599 /// ```ignore,no_run
5600 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5601 /// let x = ListAuthzPoliciesRequest::new().set_page_token("example");
5602 /// ```
5603 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5604 self.page_token = v.into();
5605 self
5606 }
5607
5608 /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5613 /// let x = ListAuthzPoliciesRequest::new().set_filter("example");
5614 /// ```
5615 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5616 self.filter = v.into();
5617 self
5618 }
5619
5620 /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
5621 ///
5622 /// # Example
5623 /// ```ignore,no_run
5624 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5625 /// let x = ListAuthzPoliciesRequest::new().set_order_by("example");
5626 /// ```
5627 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5628 self.order_by = v.into();
5629 self
5630 }
5631}
5632
5633impl wkt::message::Message for ListAuthzPoliciesRequest {
5634 fn typename() -> &'static str {
5635 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesRequest"
5636 }
5637}
5638
5639/// Message for response to listing `AuthzPolicy` resources.
5640#[derive(Clone, Default, PartialEq)]
5641#[non_exhaustive]
5642pub struct ListAuthzPoliciesResponse {
5643 /// The list of `AuthzPolicy` resources.
5644 pub authz_policies: std::vec::Vec<crate::model::AuthzPolicy>,
5645
5646 /// A token identifying a page of results that the server returns.
5647 pub next_page_token: std::string::String,
5648
5649 /// Locations that could not be reached.
5650 pub unreachable: std::vec::Vec<std::string::String>,
5651
5652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5653}
5654
5655impl ListAuthzPoliciesResponse {
5656 /// Creates a new default instance.
5657 pub fn new() -> Self {
5658 std::default::Default::default()
5659 }
5660
5661 /// Sets the value of [authz_policies][crate::model::ListAuthzPoliciesResponse::authz_policies].
5662 ///
5663 /// # Example
5664 /// ```ignore,no_run
5665 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5666 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5667 /// let x = ListAuthzPoliciesResponse::new()
5668 /// .set_authz_policies([
5669 /// AuthzPolicy::default()/* use setters */,
5670 /// AuthzPolicy::default()/* use (different) setters */,
5671 /// ]);
5672 /// ```
5673 pub fn set_authz_policies<T, V>(mut self, v: T) -> Self
5674 where
5675 T: std::iter::IntoIterator<Item = V>,
5676 V: std::convert::Into<crate::model::AuthzPolicy>,
5677 {
5678 use std::iter::Iterator;
5679 self.authz_policies = v.into_iter().map(|i| i.into()).collect();
5680 self
5681 }
5682
5683 /// Sets the value of [next_page_token][crate::model::ListAuthzPoliciesResponse::next_page_token].
5684 ///
5685 /// # Example
5686 /// ```ignore,no_run
5687 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5688 /// let x = ListAuthzPoliciesResponse::new().set_next_page_token("example");
5689 /// ```
5690 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5691 self.next_page_token = v.into();
5692 self
5693 }
5694
5695 /// Sets the value of [unreachable][crate::model::ListAuthzPoliciesResponse::unreachable].
5696 ///
5697 /// # Example
5698 /// ```ignore,no_run
5699 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5700 /// let x = ListAuthzPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
5701 /// ```
5702 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5703 where
5704 T: std::iter::IntoIterator<Item = V>,
5705 V: std::convert::Into<std::string::String>,
5706 {
5707 use std::iter::Iterator;
5708 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5709 self
5710 }
5711}
5712
5713impl wkt::message::Message for ListAuthzPoliciesResponse {
5714 fn typename() -> &'static str {
5715 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesResponse"
5716 }
5717}
5718
5719#[doc(hidden)]
5720impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthzPoliciesResponse {
5721 type PageItem = crate::model::AuthzPolicy;
5722
5723 fn items(self) -> std::vec::Vec<Self::PageItem> {
5724 self.authz_policies
5725 }
5726
5727 fn next_page_token(&self) -> std::string::String {
5728 use std::clone::Clone;
5729 self.next_page_token.clone()
5730 }
5731}
5732
5733/// Message for getting a `AuthzPolicy` resource.
5734#[derive(Clone, Default, PartialEq)]
5735#[non_exhaustive]
5736pub struct GetAuthzPolicyRequest {
5737 /// Required. A name of the `AuthzPolicy` resource to get. Must be in the
5738 /// format
5739 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5740 pub name: std::string::String,
5741
5742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5743}
5744
5745impl GetAuthzPolicyRequest {
5746 /// Creates a new default instance.
5747 pub fn new() -> Self {
5748 std::default::Default::default()
5749 }
5750
5751 /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_networksecurity_v1::model::GetAuthzPolicyRequest;
5756 /// let x = GetAuthzPolicyRequest::new().set_name("example");
5757 /// ```
5758 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.name = v.into();
5760 self
5761 }
5762}
5763
5764impl wkt::message::Message for GetAuthzPolicyRequest {
5765 fn typename() -> &'static str {
5766 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthzPolicyRequest"
5767 }
5768}
5769
5770/// Message for updating an `AuthzPolicy` resource.
5771#[derive(Clone, Default, PartialEq)]
5772#[non_exhaustive]
5773pub struct UpdateAuthzPolicyRequest {
5774 /// Required. Used to specify the fields to be overwritten in the
5775 /// `AuthzPolicy` resource by the update.
5776 /// The fields specified in the `update_mask` are relative to the resource, not
5777 /// the full request. A field is overwritten if it is in the mask. If the
5778 /// user does not specify a mask, then all fields are overwritten.
5779 pub update_mask: std::option::Option<wkt::FieldMask>,
5780
5781 /// Required. `AuthzPolicy` resource being updated.
5782 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5783
5784 /// Optional. An optional request ID to identify requests. Specify a unique
5785 /// request ID so that if you must retry your request, the server can ignore
5786 /// the request if it has already been completed. The server guarantees
5787 /// that for at least 60 minutes since the first request.
5788 ///
5789 /// For example, consider a situation where you make an initial request and the
5790 /// request times out. If you make the request again with the same request
5791 /// ID, the server can check if original operation with the same request ID
5792 /// was received, and if so, ignores the second request. This prevents
5793 /// clients from accidentally creating duplicate commitments.
5794 ///
5795 /// The request ID must be a valid UUID with the exception that zero UUID is
5796 /// not supported (00000000-0000-0000-0000-000000000000).
5797 pub request_id: std::string::String,
5798
5799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5800}
5801
5802impl UpdateAuthzPolicyRequest {
5803 /// Creates a new default instance.
5804 pub fn new() -> Self {
5805 std::default::Default::default()
5806 }
5807
5808 /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5809 ///
5810 /// # Example
5811 /// ```ignore,no_run
5812 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5813 /// use wkt::FieldMask;
5814 /// let x = UpdateAuthzPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5815 /// ```
5816 pub fn set_update_mask<T>(mut self, v: T) -> Self
5817 where
5818 T: std::convert::Into<wkt::FieldMask>,
5819 {
5820 self.update_mask = std::option::Option::Some(v.into());
5821 self
5822 }
5823
5824 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5825 ///
5826 /// # Example
5827 /// ```ignore,no_run
5828 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5829 /// use wkt::FieldMask;
5830 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5831 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5832 /// ```
5833 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5834 where
5835 T: std::convert::Into<wkt::FieldMask>,
5836 {
5837 self.update_mask = v.map(|x| x.into());
5838 self
5839 }
5840
5841 /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5842 ///
5843 /// # Example
5844 /// ```ignore,no_run
5845 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5846 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5847 /// let x = UpdateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5848 /// ```
5849 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5850 where
5851 T: std::convert::Into<crate::model::AuthzPolicy>,
5852 {
5853 self.authz_policy = std::option::Option::Some(v.into());
5854 self
5855 }
5856
5857 /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5858 ///
5859 /// # Example
5860 /// ```ignore,no_run
5861 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5862 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5863 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5864 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5865 /// ```
5866 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5867 where
5868 T: std::convert::Into<crate::model::AuthzPolicy>,
5869 {
5870 self.authz_policy = v.map(|x| x.into());
5871 self
5872 }
5873
5874 /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
5875 ///
5876 /// # Example
5877 /// ```ignore,no_run
5878 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5879 /// let x = UpdateAuthzPolicyRequest::new().set_request_id("example");
5880 /// ```
5881 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5882 self.request_id = v.into();
5883 self
5884 }
5885}
5886
5887impl wkt::message::Message for UpdateAuthzPolicyRequest {
5888 fn typename() -> &'static str {
5889 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest"
5890 }
5891}
5892
5893/// Message for deleting an `AuthzPolicy` resource.
5894#[derive(Clone, Default, PartialEq)]
5895#[non_exhaustive]
5896pub struct DeleteAuthzPolicyRequest {
5897 /// Required. The name of the `AuthzPolicy` resource to delete. Must be in
5898 /// the format
5899 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5900 pub name: std::string::String,
5901
5902 /// Optional. An optional request ID to identify requests. Specify a unique
5903 /// request ID so that if you must retry your request, the server can ignore
5904 /// the request if it has already been completed. The server guarantees
5905 /// that for at least 60 minutes after the first request.
5906 ///
5907 /// For example, consider a situation where you make an initial request and the
5908 /// request times out. If you make the request again with the same request
5909 /// ID, the server can check if original operation with the same request ID
5910 /// was received, and if so, ignores the second request. This prevents
5911 /// clients from accidentally creating duplicate commitments.
5912 ///
5913 /// The request ID must be a valid UUID with the exception that zero UUID is
5914 /// not supported (00000000-0000-0000-0000-000000000000).
5915 pub request_id: std::string::String,
5916
5917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5918}
5919
5920impl DeleteAuthzPolicyRequest {
5921 /// Creates a new default instance.
5922 pub fn new() -> Self {
5923 std::default::Default::default()
5924 }
5925
5926 /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
5927 ///
5928 /// # Example
5929 /// ```ignore,no_run
5930 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
5931 /// let x = DeleteAuthzPolicyRequest::new().set_name("example");
5932 /// ```
5933 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5934 self.name = v.into();
5935 self
5936 }
5937
5938 /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
5939 ///
5940 /// # Example
5941 /// ```ignore,no_run
5942 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
5943 /// let x = DeleteAuthzPolicyRequest::new().set_request_id("example");
5944 /// ```
5945 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.request_id = v.into();
5947 self
5948 }
5949}
5950
5951impl wkt::message::Message for DeleteAuthzPolicyRequest {
5952 fn typename() -> &'static str {
5953 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest"
5954 }
5955}
5956
5957/// BackendAuthenticationConfig message groups the TrustConfig together with
5958/// other settings that control how the load balancer authenticates, and
5959/// expresses its identity to, the backend:
5960///
5961/// * `trustConfig` is the attached TrustConfig.
5962///
5963/// * `wellKnownRoots` indicates whether the load balance should trust backend
5964/// server certificates that are issued by public certificate authorities, in
5965/// addition to certificates trusted by the TrustConfig.
5966///
5967/// * `clientCertificate` is a client certificate that the load balancer uses to
5968/// express its identity to the backend, if the connection to the backend uses
5969/// mTLS.
5970///
5971///
5972/// You can attach the BackendAuthenticationConfig to the load balancer's
5973/// BackendService directly determining how that BackendService negotiates TLS.
5974#[derive(Clone, Default, PartialEq)]
5975#[non_exhaustive]
5976pub struct BackendAuthenticationConfig {
5977 /// Required. Name of the BackendAuthenticationConfig resource. It matches the
5978 /// pattern
5979 /// `projects/*/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}`
5980 pub name: std::string::String,
5981
5982 /// Optional. Free-text description of the resource.
5983 pub description: std::string::String,
5984
5985 /// Output only. The timestamp when the resource was created.
5986 pub create_time: std::option::Option<wkt::Timestamp>,
5987
5988 /// Output only. The timestamp when the resource was updated.
5989 pub update_time: std::option::Option<wkt::Timestamp>,
5990
5991 /// Set of label tags associated with the resource.
5992 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5993
5994 /// Optional. A reference to a certificatemanager.googleapis.com.Certificate
5995 /// resource. This is a relative resource path following the form
5996 /// "projects/{project}/locations/{location}/certificates/{certificate}".
5997 ///
5998 /// Used by a BackendService to negotiate mTLS when the backend connection uses
5999 /// TLS and the backend requests a client certificate. Must have a CLIENT_AUTH
6000 /// scope.
6001 pub client_certificate: std::string::String,
6002
6003 /// Optional. A reference to a TrustConfig resource from the
6004 /// certificatemanager.googleapis.com namespace. This is a relative resource
6005 /// path following the form
6006 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}".
6007 ///
6008 /// A BackendService uses the chain of trust represented by this TrustConfig,
6009 /// if specified, to validate the server certificates presented by the backend.
6010 /// Required unless wellKnownRoots is set to PUBLIC_ROOTS.
6011 pub trust_config: std::string::String,
6012
6013 /// Well known roots to use for server certificate validation.
6014 pub well_known_roots: crate::model::backend_authentication_config::WellKnownRoots,
6015
6016 /// Output only. Etag of the resource.
6017 pub etag: std::string::String,
6018
6019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6020}
6021
6022impl BackendAuthenticationConfig {
6023 /// Creates a new default instance.
6024 pub fn new() -> Self {
6025 std::default::Default::default()
6026 }
6027
6028 /// Sets the value of [name][crate::model::BackendAuthenticationConfig::name].
6029 ///
6030 /// # Example
6031 /// ```ignore,no_run
6032 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6033 /// let x = BackendAuthenticationConfig::new().set_name("example");
6034 /// ```
6035 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6036 self.name = v.into();
6037 self
6038 }
6039
6040 /// Sets the value of [description][crate::model::BackendAuthenticationConfig::description].
6041 ///
6042 /// # Example
6043 /// ```ignore,no_run
6044 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6045 /// let x = BackendAuthenticationConfig::new().set_description("example");
6046 /// ```
6047 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6048 self.description = v.into();
6049 self
6050 }
6051
6052 /// Sets the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6053 ///
6054 /// # Example
6055 /// ```ignore,no_run
6056 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6057 /// use wkt::Timestamp;
6058 /// let x = BackendAuthenticationConfig::new().set_create_time(Timestamp::default()/* use setters */);
6059 /// ```
6060 pub fn set_create_time<T>(mut self, v: T) -> Self
6061 where
6062 T: std::convert::Into<wkt::Timestamp>,
6063 {
6064 self.create_time = std::option::Option::Some(v.into());
6065 self
6066 }
6067
6068 /// Sets or clears the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6069 ///
6070 /// # Example
6071 /// ```ignore,no_run
6072 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6073 /// use wkt::Timestamp;
6074 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6075 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(None::<Timestamp>);
6076 /// ```
6077 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6078 where
6079 T: std::convert::Into<wkt::Timestamp>,
6080 {
6081 self.create_time = v.map(|x| x.into());
6082 self
6083 }
6084
6085 /// Sets the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6086 ///
6087 /// # Example
6088 /// ```ignore,no_run
6089 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6090 /// use wkt::Timestamp;
6091 /// let x = BackendAuthenticationConfig::new().set_update_time(Timestamp::default()/* use setters */);
6092 /// ```
6093 pub fn set_update_time<T>(mut self, v: T) -> Self
6094 where
6095 T: std::convert::Into<wkt::Timestamp>,
6096 {
6097 self.update_time = std::option::Option::Some(v.into());
6098 self
6099 }
6100
6101 /// Sets or clears the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6106 /// use wkt::Timestamp;
6107 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6108 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(None::<Timestamp>);
6109 /// ```
6110 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6111 where
6112 T: std::convert::Into<wkt::Timestamp>,
6113 {
6114 self.update_time = v.map(|x| x.into());
6115 self
6116 }
6117
6118 /// Sets the value of [labels][crate::model::BackendAuthenticationConfig::labels].
6119 ///
6120 /// # Example
6121 /// ```ignore,no_run
6122 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6123 /// let x = BackendAuthenticationConfig::new().set_labels([
6124 /// ("key0", "abc"),
6125 /// ("key1", "xyz"),
6126 /// ]);
6127 /// ```
6128 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6129 where
6130 T: std::iter::IntoIterator<Item = (K, V)>,
6131 K: std::convert::Into<std::string::String>,
6132 V: std::convert::Into<std::string::String>,
6133 {
6134 use std::iter::Iterator;
6135 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6136 self
6137 }
6138
6139 /// Sets the value of [client_certificate][crate::model::BackendAuthenticationConfig::client_certificate].
6140 ///
6141 /// # Example
6142 /// ```ignore,no_run
6143 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6144 /// let x = BackendAuthenticationConfig::new().set_client_certificate("example");
6145 /// ```
6146 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6147 mut self,
6148 v: T,
6149 ) -> Self {
6150 self.client_certificate = v.into();
6151 self
6152 }
6153
6154 /// Sets the value of [trust_config][crate::model::BackendAuthenticationConfig::trust_config].
6155 ///
6156 /// # Example
6157 /// ```ignore,no_run
6158 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6159 /// let x = BackendAuthenticationConfig::new().set_trust_config("example");
6160 /// ```
6161 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6162 self.trust_config = v.into();
6163 self
6164 }
6165
6166 /// Sets the value of [well_known_roots][crate::model::BackendAuthenticationConfig::well_known_roots].
6167 ///
6168 /// # Example
6169 /// ```ignore,no_run
6170 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6171 /// use google_cloud_networksecurity_v1::model::backend_authentication_config::WellKnownRoots;
6172 /// let x0 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::None);
6173 /// let x1 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::PublicRoots);
6174 /// ```
6175 pub fn set_well_known_roots<
6176 T: std::convert::Into<crate::model::backend_authentication_config::WellKnownRoots>,
6177 >(
6178 mut self,
6179 v: T,
6180 ) -> Self {
6181 self.well_known_roots = v.into();
6182 self
6183 }
6184
6185 /// Sets the value of [etag][crate::model::BackendAuthenticationConfig::etag].
6186 ///
6187 /// # Example
6188 /// ```ignore,no_run
6189 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6190 /// let x = BackendAuthenticationConfig::new().set_etag("example");
6191 /// ```
6192 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6193 self.etag = v.into();
6194 self
6195 }
6196}
6197
6198impl wkt::message::Message for BackendAuthenticationConfig {
6199 fn typename() -> &'static str {
6200 "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig"
6201 }
6202}
6203
6204/// Defines additional types related to [BackendAuthenticationConfig].
6205pub mod backend_authentication_config {
6206 #[allow(unused_imports)]
6207 use super::*;
6208
6209 /// Enum to specify the well known roots to use for server certificate
6210 /// validation.
6211 ///
6212 /// # Working with unknown values
6213 ///
6214 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6215 /// additional enum variants at any time. Adding new variants is not considered
6216 /// a breaking change. Applications should write their code in anticipation of:
6217 ///
6218 /// - New values appearing in future releases of the client library, **and**
6219 /// - New values received dynamically, without application changes.
6220 ///
6221 /// Please consult the [Working with enums] section in the user guide for some
6222 /// guidelines.
6223 ///
6224 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6225 #[derive(Clone, Debug, PartialEq)]
6226 #[non_exhaustive]
6227 pub enum WellKnownRoots {
6228 /// Equivalent to NONE.
6229 Unspecified,
6230 /// The BackendService will only validate server certificates against roots
6231 /// specified in TrustConfig.
6232 None,
6233 /// The BackendService uses a set of well-known public roots, in addition to
6234 /// any roots specified in the trustConfig field, when validating the server
6235 /// certificates presented by the backend. Validation with these roots is
6236 /// only considered when the TlsSettings.sni field in the BackendService is
6237 /// set.
6238 ///
6239 /// The well-known roots are a set of root CAs managed by Google. CAs in this
6240 /// set can be added or removed without notice.
6241 PublicRoots,
6242 /// If set, the enum was initialized with an unknown value.
6243 ///
6244 /// Applications can examine the value using [WellKnownRoots::value] or
6245 /// [WellKnownRoots::name].
6246 UnknownValue(well_known_roots::UnknownValue),
6247 }
6248
6249 #[doc(hidden)]
6250 pub mod well_known_roots {
6251 #[allow(unused_imports)]
6252 use super::*;
6253 #[derive(Clone, Debug, PartialEq)]
6254 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6255 }
6256
6257 impl WellKnownRoots {
6258 /// Gets the enum value.
6259 ///
6260 /// Returns `None` if the enum contains an unknown value deserialized from
6261 /// the string representation of enums.
6262 pub fn value(&self) -> std::option::Option<i32> {
6263 match self {
6264 Self::Unspecified => std::option::Option::Some(0),
6265 Self::None => std::option::Option::Some(1),
6266 Self::PublicRoots => std::option::Option::Some(2),
6267 Self::UnknownValue(u) => u.0.value(),
6268 }
6269 }
6270
6271 /// Gets the enum value as a string.
6272 ///
6273 /// Returns `None` if the enum contains an unknown value deserialized from
6274 /// the integer representation of enums.
6275 pub fn name(&self) -> std::option::Option<&str> {
6276 match self {
6277 Self::Unspecified => std::option::Option::Some("WELL_KNOWN_ROOTS_UNSPECIFIED"),
6278 Self::None => std::option::Option::Some("NONE"),
6279 Self::PublicRoots => std::option::Option::Some("PUBLIC_ROOTS"),
6280 Self::UnknownValue(u) => u.0.name(),
6281 }
6282 }
6283 }
6284
6285 impl std::default::Default for WellKnownRoots {
6286 fn default() -> Self {
6287 use std::convert::From;
6288 Self::from(0)
6289 }
6290 }
6291
6292 impl std::fmt::Display for WellKnownRoots {
6293 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6294 wkt::internal::display_enum(f, self.name(), self.value())
6295 }
6296 }
6297
6298 impl std::convert::From<i32> for WellKnownRoots {
6299 fn from(value: i32) -> Self {
6300 match value {
6301 0 => Self::Unspecified,
6302 1 => Self::None,
6303 2 => Self::PublicRoots,
6304 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6305 wkt::internal::UnknownEnumValue::Integer(value),
6306 )),
6307 }
6308 }
6309 }
6310
6311 impl std::convert::From<&str> for WellKnownRoots {
6312 fn from(value: &str) -> Self {
6313 use std::string::ToString;
6314 match value {
6315 "WELL_KNOWN_ROOTS_UNSPECIFIED" => Self::Unspecified,
6316 "NONE" => Self::None,
6317 "PUBLIC_ROOTS" => Self::PublicRoots,
6318 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6319 wkt::internal::UnknownEnumValue::String(value.to_string()),
6320 )),
6321 }
6322 }
6323 }
6324
6325 impl serde::ser::Serialize for WellKnownRoots {
6326 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6327 where
6328 S: serde::Serializer,
6329 {
6330 match self {
6331 Self::Unspecified => serializer.serialize_i32(0),
6332 Self::None => serializer.serialize_i32(1),
6333 Self::PublicRoots => serializer.serialize_i32(2),
6334 Self::UnknownValue(u) => u.0.serialize(serializer),
6335 }
6336 }
6337 }
6338
6339 impl<'de> serde::de::Deserialize<'de> for WellKnownRoots {
6340 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6341 where
6342 D: serde::Deserializer<'de>,
6343 {
6344 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WellKnownRoots>::new(
6345 ".google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots",
6346 ))
6347 }
6348 }
6349}
6350
6351/// Request used by the ListBackendAuthenticationConfigs method.
6352#[derive(Clone, Default, PartialEq)]
6353#[non_exhaustive]
6354pub struct ListBackendAuthenticationConfigsRequest {
6355 /// Required. The project and location from which the
6356 /// BackendAuthenticationConfigs should be listed, specified in the format
6357 /// `projects/*/locations/{location}`.
6358 pub parent: std::string::String,
6359
6360 /// Maximum number of BackendAuthenticationConfigs to return per call.
6361 pub page_size: i32,
6362
6363 /// The value returned by the last `ListBackendAuthenticationConfigsResponse`
6364 /// Indicates that this is a continuation of a prior
6365 /// `ListBackendAuthenticationConfigs` call, and that the system
6366 /// should return the next page of data.
6367 pub page_token: std::string::String,
6368
6369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6370}
6371
6372impl ListBackendAuthenticationConfigsRequest {
6373 /// Creates a new default instance.
6374 pub fn new() -> Self {
6375 std::default::Default::default()
6376 }
6377
6378 /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
6379 ///
6380 /// # Example
6381 /// ```ignore,no_run
6382 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6383 /// let x = ListBackendAuthenticationConfigsRequest::new().set_parent("example");
6384 /// ```
6385 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6386 self.parent = v.into();
6387 self
6388 }
6389
6390 /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6395 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_size(42);
6396 /// ```
6397 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6398 self.page_size = v.into();
6399 self
6400 }
6401
6402 /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6407 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_token("example");
6408 /// ```
6409 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6410 self.page_token = v.into();
6411 self
6412 }
6413}
6414
6415impl wkt::message::Message for ListBackendAuthenticationConfigsRequest {
6416 fn typename() -> &'static str {
6417 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest"
6418 }
6419}
6420
6421/// Response returned by the ListBackendAuthenticationConfigs method.
6422#[derive(Clone, Default, PartialEq)]
6423#[non_exhaustive]
6424pub struct ListBackendAuthenticationConfigsResponse {
6425 /// List of BackendAuthenticationConfig resources.
6426 pub backend_authentication_configs: std::vec::Vec<crate::model::BackendAuthenticationConfig>,
6427
6428 /// If there might be more results than those appearing in this response, then
6429 /// `next_page_token` is included. To get the next set of results, call this
6430 /// method again using the value of `next_page_token` as `page_token`.
6431 pub next_page_token: std::string::String,
6432
6433 /// Locations that could not be reached.
6434 pub unreachable: std::vec::Vec<std::string::String>,
6435
6436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6437}
6438
6439impl ListBackendAuthenticationConfigsResponse {
6440 /// Creates a new default instance.
6441 pub fn new() -> Self {
6442 std::default::Default::default()
6443 }
6444
6445 /// Sets the value of [backend_authentication_configs][crate::model::ListBackendAuthenticationConfigsResponse::backend_authentication_configs].
6446 ///
6447 /// # Example
6448 /// ```ignore,no_run
6449 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6450 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6451 /// let x = ListBackendAuthenticationConfigsResponse::new()
6452 /// .set_backend_authentication_configs([
6453 /// BackendAuthenticationConfig::default()/* use setters */,
6454 /// BackendAuthenticationConfig::default()/* use (different) setters */,
6455 /// ]);
6456 /// ```
6457 pub fn set_backend_authentication_configs<T, V>(mut self, v: T) -> Self
6458 where
6459 T: std::iter::IntoIterator<Item = V>,
6460 V: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6461 {
6462 use std::iter::Iterator;
6463 self.backend_authentication_configs = v.into_iter().map(|i| i.into()).collect();
6464 self
6465 }
6466
6467 /// Sets the value of [next_page_token][crate::model::ListBackendAuthenticationConfigsResponse::next_page_token].
6468 ///
6469 /// # Example
6470 /// ```ignore,no_run
6471 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6472 /// let x = ListBackendAuthenticationConfigsResponse::new().set_next_page_token("example");
6473 /// ```
6474 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6475 self.next_page_token = v.into();
6476 self
6477 }
6478
6479 /// Sets the value of [unreachable][crate::model::ListBackendAuthenticationConfigsResponse::unreachable].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6484 /// let x = ListBackendAuthenticationConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6485 /// ```
6486 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6487 where
6488 T: std::iter::IntoIterator<Item = V>,
6489 V: std::convert::Into<std::string::String>,
6490 {
6491 use std::iter::Iterator;
6492 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6493 self
6494 }
6495}
6496
6497impl wkt::message::Message for ListBackendAuthenticationConfigsResponse {
6498 fn typename() -> &'static str {
6499 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse"
6500 }
6501}
6502
6503#[doc(hidden)]
6504impl google_cloud_gax::paginator::internal::PageableResponse
6505 for ListBackendAuthenticationConfigsResponse
6506{
6507 type PageItem = crate::model::BackendAuthenticationConfig;
6508
6509 fn items(self) -> std::vec::Vec<Self::PageItem> {
6510 self.backend_authentication_configs
6511 }
6512
6513 fn next_page_token(&self) -> std::string::String {
6514 use std::clone::Clone;
6515 self.next_page_token.clone()
6516 }
6517}
6518
6519/// Request used by the GetBackendAuthenticationConfig method.
6520#[derive(Clone, Default, PartialEq)]
6521#[non_exhaustive]
6522pub struct GetBackendAuthenticationConfigRequest {
6523 /// Required. A name of the BackendAuthenticationConfig to get. Must be in the
6524 /// format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6525 pub name: std::string::String,
6526
6527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6528}
6529
6530impl GetBackendAuthenticationConfigRequest {
6531 /// Creates a new default instance.
6532 pub fn new() -> Self {
6533 std::default::Default::default()
6534 }
6535
6536 /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
6537 ///
6538 /// # Example
6539 /// ```ignore,no_run
6540 /// # use google_cloud_networksecurity_v1::model::GetBackendAuthenticationConfigRequest;
6541 /// let x = GetBackendAuthenticationConfigRequest::new().set_name("example");
6542 /// ```
6543 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6544 self.name = v.into();
6545 self
6546 }
6547}
6548
6549impl wkt::message::Message for GetBackendAuthenticationConfigRequest {
6550 fn typename() -> &'static str {
6551 "type.googleapis.com/google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest"
6552 }
6553}
6554
6555/// Request used by the CreateBackendAuthenticationConfig method.
6556#[derive(Clone, Default, PartialEq)]
6557#[non_exhaustive]
6558pub struct CreateBackendAuthenticationConfigRequest {
6559 /// Required. The parent resource of the BackendAuthenticationConfig. Must be
6560 /// in the format `projects/*/locations/{location}`.
6561 pub parent: std::string::String,
6562
6563 /// Required. Short name of the BackendAuthenticationConfig resource to be
6564 /// created. This value should be 1-63 characters long, containing only
6565 /// letters, numbers, hyphens, and underscores, and should not start with a
6566 /// number. E.g. "backend-auth-config".
6567 pub backend_authentication_config_id: std::string::String,
6568
6569 /// Required. BackendAuthenticationConfig resource to be created.
6570 pub backend_authentication_config:
6571 std::option::Option<crate::model::BackendAuthenticationConfig>,
6572
6573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6574}
6575
6576impl CreateBackendAuthenticationConfigRequest {
6577 /// Creates a new default instance.
6578 pub fn new() -> Self {
6579 std::default::Default::default()
6580 }
6581
6582 /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
6583 ///
6584 /// # Example
6585 /// ```ignore,no_run
6586 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6587 /// let x = CreateBackendAuthenticationConfigRequest::new().set_parent("example");
6588 /// ```
6589 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6590 self.parent = v.into();
6591 self
6592 }
6593
6594 /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
6595 ///
6596 /// # Example
6597 /// ```ignore,no_run
6598 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6599 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config_id("example");
6600 /// ```
6601 pub fn set_backend_authentication_config_id<T: std::convert::Into<std::string::String>>(
6602 mut self,
6603 v: T,
6604 ) -> Self {
6605 self.backend_authentication_config_id = v.into();
6606 self
6607 }
6608
6609 /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6610 ///
6611 /// # Example
6612 /// ```ignore,no_run
6613 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6614 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6615 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6616 /// ```
6617 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6618 where
6619 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6620 {
6621 self.backend_authentication_config = std::option::Option::Some(v.into());
6622 self
6623 }
6624
6625 /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6626 ///
6627 /// # Example
6628 /// ```ignore,no_run
6629 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6630 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6631 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6632 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6633 /// ```
6634 pub fn set_or_clear_backend_authentication_config<T>(
6635 mut self,
6636 v: std::option::Option<T>,
6637 ) -> Self
6638 where
6639 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6640 {
6641 self.backend_authentication_config = v.map(|x| x.into());
6642 self
6643 }
6644}
6645
6646impl wkt::message::Message for CreateBackendAuthenticationConfigRequest {
6647 fn typename() -> &'static str {
6648 "type.googleapis.com/google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest"
6649 }
6650}
6651
6652/// Request used by UpdateBackendAuthenticationConfig method.
6653#[derive(Clone, Default, PartialEq)]
6654#[non_exhaustive]
6655pub struct UpdateBackendAuthenticationConfigRequest {
6656 /// Optional. Field mask is used to specify the fields to be overwritten in the
6657 /// BackendAuthenticationConfig resource by the update. The fields
6658 /// specified in the update_mask are relative to the resource, not
6659 /// the full request. A field will be overwritten if it is in the
6660 /// mask. If the user does not provide a mask then all fields will be
6661 /// overwritten.
6662 pub update_mask: std::option::Option<wkt::FieldMask>,
6663
6664 /// Required. Updated BackendAuthenticationConfig resource.
6665 pub backend_authentication_config:
6666 std::option::Option<crate::model::BackendAuthenticationConfig>,
6667
6668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6669}
6670
6671impl UpdateBackendAuthenticationConfigRequest {
6672 /// Creates a new default instance.
6673 pub fn new() -> Self {
6674 std::default::Default::default()
6675 }
6676
6677 /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6678 ///
6679 /// # Example
6680 /// ```ignore,no_run
6681 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6682 /// use wkt::FieldMask;
6683 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6684 /// ```
6685 pub fn set_update_mask<T>(mut self, v: T) -> Self
6686 where
6687 T: std::convert::Into<wkt::FieldMask>,
6688 {
6689 self.update_mask = std::option::Option::Some(v.into());
6690 self
6691 }
6692
6693 /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6694 ///
6695 /// # Example
6696 /// ```ignore,no_run
6697 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6698 /// use wkt::FieldMask;
6699 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6700 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6701 /// ```
6702 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6703 where
6704 T: std::convert::Into<wkt::FieldMask>,
6705 {
6706 self.update_mask = v.map(|x| x.into());
6707 self
6708 }
6709
6710 /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6711 ///
6712 /// # Example
6713 /// ```ignore,no_run
6714 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6715 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6716 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6717 /// ```
6718 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6719 where
6720 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6721 {
6722 self.backend_authentication_config = std::option::Option::Some(v.into());
6723 self
6724 }
6725
6726 /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6727 ///
6728 /// # Example
6729 /// ```ignore,no_run
6730 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6731 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6732 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6733 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6734 /// ```
6735 pub fn set_or_clear_backend_authentication_config<T>(
6736 mut self,
6737 v: std::option::Option<T>,
6738 ) -> Self
6739 where
6740 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6741 {
6742 self.backend_authentication_config = v.map(|x| x.into());
6743 self
6744 }
6745}
6746
6747impl wkt::message::Message for UpdateBackendAuthenticationConfigRequest {
6748 fn typename() -> &'static str {
6749 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest"
6750 }
6751}
6752
6753/// Request used by the DeleteBackendAuthenticationConfig method.
6754#[derive(Clone, Default, PartialEq)]
6755#[non_exhaustive]
6756pub struct DeleteBackendAuthenticationConfigRequest {
6757 /// Required. A name of the BackendAuthenticationConfig to delete. Must be in
6758 /// the format
6759 /// `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6760 pub name: std::string::String,
6761
6762 /// Optional. Etag of the resource.
6763 /// If this is provided, it must match the server's etag.
6764 pub etag: std::string::String,
6765
6766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6767}
6768
6769impl DeleteBackendAuthenticationConfigRequest {
6770 /// Creates a new default instance.
6771 pub fn new() -> Self {
6772 std::default::Default::default()
6773 }
6774
6775 /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
6776 ///
6777 /// # Example
6778 /// ```ignore,no_run
6779 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6780 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_name("example");
6781 /// ```
6782 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6783 self.name = v.into();
6784 self
6785 }
6786
6787 /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
6788 ///
6789 /// # Example
6790 /// ```ignore,no_run
6791 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6792 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_etag("example");
6793 /// ```
6794 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.etag = v.into();
6796 self
6797 }
6798}
6799
6800impl wkt::message::Message for DeleteBackendAuthenticationConfigRequest {
6801 fn typename() -> &'static str {
6802 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest"
6803 }
6804}
6805
6806/// ClientTlsPolicy is a resource that specifies how a client should authenticate
6807/// connections to backends of a service. This resource itself does not affect
6808/// configuration unless it is attached to a backend service resource.
6809#[derive(Clone, Default, PartialEq)]
6810#[non_exhaustive]
6811pub struct ClientTlsPolicy {
6812 /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
6813 /// `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}`
6814 pub name: std::string::String,
6815
6816 /// Optional. Free-text description of the resource.
6817 pub description: std::string::String,
6818
6819 /// Output only. The timestamp when the resource was created.
6820 pub create_time: std::option::Option<wkt::Timestamp>,
6821
6822 /// Output only. The timestamp when the resource was updated.
6823 pub update_time: std::option::Option<wkt::Timestamp>,
6824
6825 /// Optional. Set of label tags associated with the resource.
6826 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6827
6828 /// Optional. Server Name Indication string to present to the server during TLS
6829 /// handshake. E.g: "secure.example.com".
6830 pub sni: std::string::String,
6831
6832 /// Optional. Defines a mechanism to provision client identity (public and
6833 /// private keys) for peer to peer authentication. The presence of this
6834 /// dictates mTLS.
6835 pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
6836
6837 /// Optional. Defines the mechanism to obtain the Certificate Authority
6838 /// certificate to validate the server certificate. If empty, client does not
6839 /// validate the server certificate.
6840 pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
6841
6842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6843}
6844
6845impl ClientTlsPolicy {
6846 /// Creates a new default instance.
6847 pub fn new() -> Self {
6848 std::default::Default::default()
6849 }
6850
6851 /// Sets the value of [name][crate::model::ClientTlsPolicy::name].
6852 ///
6853 /// # Example
6854 /// ```ignore,no_run
6855 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6856 /// let x = ClientTlsPolicy::new().set_name("example");
6857 /// ```
6858 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6859 self.name = v.into();
6860 self
6861 }
6862
6863 /// Sets the value of [description][crate::model::ClientTlsPolicy::description].
6864 ///
6865 /// # Example
6866 /// ```ignore,no_run
6867 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6868 /// let x = ClientTlsPolicy::new().set_description("example");
6869 /// ```
6870 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6871 self.description = v.into();
6872 self
6873 }
6874
6875 /// Sets the value of [create_time][crate::model::ClientTlsPolicy::create_time].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6880 /// use wkt::Timestamp;
6881 /// let x = ClientTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
6882 /// ```
6883 pub fn set_create_time<T>(mut self, v: T) -> Self
6884 where
6885 T: std::convert::Into<wkt::Timestamp>,
6886 {
6887 self.create_time = std::option::Option::Some(v.into());
6888 self
6889 }
6890
6891 /// Sets or clears the value of [create_time][crate::model::ClientTlsPolicy::create_time].
6892 ///
6893 /// # Example
6894 /// ```ignore,no_run
6895 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6896 /// use wkt::Timestamp;
6897 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6898 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
6899 /// ```
6900 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6901 where
6902 T: std::convert::Into<wkt::Timestamp>,
6903 {
6904 self.create_time = v.map(|x| x.into());
6905 self
6906 }
6907
6908 /// Sets the value of [update_time][crate::model::ClientTlsPolicy::update_time].
6909 ///
6910 /// # Example
6911 /// ```ignore,no_run
6912 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6913 /// use wkt::Timestamp;
6914 /// let x = ClientTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
6915 /// ```
6916 pub fn set_update_time<T>(mut self, v: T) -> Self
6917 where
6918 T: std::convert::Into<wkt::Timestamp>,
6919 {
6920 self.update_time = std::option::Option::Some(v.into());
6921 self
6922 }
6923
6924 /// Sets or clears the value of [update_time][crate::model::ClientTlsPolicy::update_time].
6925 ///
6926 /// # Example
6927 /// ```ignore,no_run
6928 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6929 /// use wkt::Timestamp;
6930 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6931 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
6932 /// ```
6933 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6934 where
6935 T: std::convert::Into<wkt::Timestamp>,
6936 {
6937 self.update_time = v.map(|x| x.into());
6938 self
6939 }
6940
6941 /// Sets the value of [labels][crate::model::ClientTlsPolicy::labels].
6942 ///
6943 /// # Example
6944 /// ```ignore,no_run
6945 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6946 /// let x = ClientTlsPolicy::new().set_labels([
6947 /// ("key0", "abc"),
6948 /// ("key1", "xyz"),
6949 /// ]);
6950 /// ```
6951 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6952 where
6953 T: std::iter::IntoIterator<Item = (K, V)>,
6954 K: std::convert::Into<std::string::String>,
6955 V: std::convert::Into<std::string::String>,
6956 {
6957 use std::iter::Iterator;
6958 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6959 self
6960 }
6961
6962 /// Sets the value of [sni][crate::model::ClientTlsPolicy::sni].
6963 ///
6964 /// # Example
6965 /// ```ignore,no_run
6966 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6967 /// let x = ClientTlsPolicy::new().set_sni("example");
6968 /// ```
6969 pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6970 self.sni = v.into();
6971 self
6972 }
6973
6974 /// Sets the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
6975 ///
6976 /// # Example
6977 /// ```ignore,no_run
6978 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6979 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
6980 /// let x = ClientTlsPolicy::new().set_client_certificate(CertificateProvider::default()/* use setters */);
6981 /// ```
6982 pub fn set_client_certificate<T>(mut self, v: T) -> Self
6983 where
6984 T: std::convert::Into<crate::model::CertificateProvider>,
6985 {
6986 self.client_certificate = std::option::Option::Some(v.into());
6987 self
6988 }
6989
6990 /// Sets or clears the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
6991 ///
6992 /// # Example
6993 /// ```ignore,no_run
6994 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6995 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
6996 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(Some(CertificateProvider::default()/* use setters */));
6997 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(None::<CertificateProvider>);
6998 /// ```
6999 pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7000 where
7001 T: std::convert::Into<crate::model::CertificateProvider>,
7002 {
7003 self.client_certificate = v.map(|x| x.into());
7004 self
7005 }
7006
7007 /// Sets the value of [server_validation_ca][crate::model::ClientTlsPolicy::server_validation_ca].
7008 ///
7009 /// # Example
7010 /// ```ignore,no_run
7011 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7012 /// use google_cloud_networksecurity_v1::model::ValidationCA;
7013 /// let x = ClientTlsPolicy::new()
7014 /// .set_server_validation_ca([
7015 /// ValidationCA::default()/* use setters */,
7016 /// ValidationCA::default()/* use (different) setters */,
7017 /// ]);
7018 /// ```
7019 pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
7020 where
7021 T: std::iter::IntoIterator<Item = V>,
7022 V: std::convert::Into<crate::model::ValidationCA>,
7023 {
7024 use std::iter::Iterator;
7025 self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
7026 self
7027 }
7028}
7029
7030impl wkt::message::Message for ClientTlsPolicy {
7031 fn typename() -> &'static str {
7032 "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
7033 }
7034}
7035
7036/// Request used by the ListClientTlsPolicies method.
7037#[derive(Clone, Default, PartialEq)]
7038#[non_exhaustive]
7039pub struct ListClientTlsPoliciesRequest {
7040 /// Required. The project and location from which the ClientTlsPolicies should
7041 /// be listed, specified in the format `projects/*/locations/{location}`.
7042 pub parent: std::string::String,
7043
7044 /// Maximum number of ClientTlsPolicies to return per call.
7045 pub page_size: i32,
7046
7047 /// The value returned by the last `ListClientTlsPoliciesResponse`
7048 /// Indicates that this is a continuation of a prior
7049 /// `ListClientTlsPolicies` call, and that the system
7050 /// should return the next page of data.
7051 pub page_token: std::string::String,
7052
7053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7054}
7055
7056impl ListClientTlsPoliciesRequest {
7057 /// Creates a new default instance.
7058 pub fn new() -> Self {
7059 std::default::Default::default()
7060 }
7061
7062 /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
7063 ///
7064 /// # Example
7065 /// ```ignore,no_run
7066 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7067 /// let x = ListClientTlsPoliciesRequest::new().set_parent("example");
7068 /// ```
7069 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7070 self.parent = v.into();
7071 self
7072 }
7073
7074 /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
7075 ///
7076 /// # Example
7077 /// ```ignore,no_run
7078 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7079 /// let x = ListClientTlsPoliciesRequest::new().set_page_size(42);
7080 /// ```
7081 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7082 self.page_size = v.into();
7083 self
7084 }
7085
7086 /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7091 /// let x = ListClientTlsPoliciesRequest::new().set_page_token("example");
7092 /// ```
7093 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7094 self.page_token = v.into();
7095 self
7096 }
7097}
7098
7099impl wkt::message::Message for ListClientTlsPoliciesRequest {
7100 fn typename() -> &'static str {
7101 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
7102 }
7103}
7104
7105/// Response returned by the ListClientTlsPolicies method.
7106#[derive(Clone, Default, PartialEq)]
7107#[non_exhaustive]
7108pub struct ListClientTlsPoliciesResponse {
7109 /// List of ClientTlsPolicy resources.
7110 pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
7111
7112 /// If there might be more results than those appearing in this response, then
7113 /// `next_page_token` is included. To get the next set of results, call this
7114 /// method again using the value of `next_page_token` as `page_token`.
7115 pub next_page_token: std::string::String,
7116
7117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7118}
7119
7120impl ListClientTlsPoliciesResponse {
7121 /// Creates a new default instance.
7122 pub fn new() -> Self {
7123 std::default::Default::default()
7124 }
7125
7126 /// Sets the value of [client_tls_policies][crate::model::ListClientTlsPoliciesResponse::client_tls_policies].
7127 ///
7128 /// # Example
7129 /// ```ignore,no_run
7130 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7131 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7132 /// let x = ListClientTlsPoliciesResponse::new()
7133 /// .set_client_tls_policies([
7134 /// ClientTlsPolicy::default()/* use setters */,
7135 /// ClientTlsPolicy::default()/* use (different) setters */,
7136 /// ]);
7137 /// ```
7138 pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
7139 where
7140 T: std::iter::IntoIterator<Item = V>,
7141 V: std::convert::Into<crate::model::ClientTlsPolicy>,
7142 {
7143 use std::iter::Iterator;
7144 self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
7145 self
7146 }
7147
7148 /// Sets the value of [next_page_token][crate::model::ListClientTlsPoliciesResponse::next_page_token].
7149 ///
7150 /// # Example
7151 /// ```ignore,no_run
7152 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7153 /// let x = ListClientTlsPoliciesResponse::new().set_next_page_token("example");
7154 /// ```
7155 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7156 self.next_page_token = v.into();
7157 self
7158 }
7159}
7160
7161impl wkt::message::Message for ListClientTlsPoliciesResponse {
7162 fn typename() -> &'static str {
7163 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
7164 }
7165}
7166
7167#[doc(hidden)]
7168impl google_cloud_gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
7169 type PageItem = crate::model::ClientTlsPolicy;
7170
7171 fn items(self) -> std::vec::Vec<Self::PageItem> {
7172 self.client_tls_policies
7173 }
7174
7175 fn next_page_token(&self) -> std::string::String {
7176 use std::clone::Clone;
7177 self.next_page_token.clone()
7178 }
7179}
7180
7181/// Request used by the GetClientTlsPolicy method.
7182#[derive(Clone, Default, PartialEq)]
7183#[non_exhaustive]
7184pub struct GetClientTlsPolicyRequest {
7185 /// Required. A name of the ClientTlsPolicy to get. Must be in the format
7186 /// `projects/*/locations/{location}/clientTlsPolicies/*`.
7187 pub name: std::string::String,
7188
7189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7190}
7191
7192impl GetClientTlsPolicyRequest {
7193 /// Creates a new default instance.
7194 pub fn new() -> Self {
7195 std::default::Default::default()
7196 }
7197
7198 /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
7199 ///
7200 /// # Example
7201 /// ```ignore,no_run
7202 /// # use google_cloud_networksecurity_v1::model::GetClientTlsPolicyRequest;
7203 /// let x = GetClientTlsPolicyRequest::new().set_name("example");
7204 /// ```
7205 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7206 self.name = v.into();
7207 self
7208 }
7209}
7210
7211impl wkt::message::Message for GetClientTlsPolicyRequest {
7212 fn typename() -> &'static str {
7213 "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
7214 }
7215}
7216
7217/// Request used by the CreateClientTlsPolicy method.
7218#[derive(Clone, Default, PartialEq)]
7219#[non_exhaustive]
7220pub struct CreateClientTlsPolicyRequest {
7221 /// Required. The parent resource of the ClientTlsPolicy. Must be in
7222 /// the format `projects/*/locations/{location}`.
7223 pub parent: std::string::String,
7224
7225 /// Required. Short name of the ClientTlsPolicy resource to be created. This
7226 /// value should be 1-63 characters long, containing only letters, numbers,
7227 /// hyphens, and underscores, and should not start with a number. E.g.
7228 /// "client_mtls_policy".
7229 pub client_tls_policy_id: std::string::String,
7230
7231 /// Required. ClientTlsPolicy resource to be created.
7232 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7233
7234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7235}
7236
7237impl CreateClientTlsPolicyRequest {
7238 /// Creates a new default instance.
7239 pub fn new() -> Self {
7240 std::default::Default::default()
7241 }
7242
7243 /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
7244 ///
7245 /// # Example
7246 /// ```ignore,no_run
7247 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7248 /// let x = CreateClientTlsPolicyRequest::new().set_parent("example");
7249 /// ```
7250 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7251 self.parent = v.into();
7252 self
7253 }
7254
7255 /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
7256 ///
7257 /// # Example
7258 /// ```ignore,no_run
7259 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7260 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy_id("example");
7261 /// ```
7262 pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
7263 mut self,
7264 v: T,
7265 ) -> Self {
7266 self.client_tls_policy_id = v.into();
7267 self
7268 }
7269
7270 /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7271 ///
7272 /// # Example
7273 /// ```ignore,no_run
7274 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7275 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7276 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7277 /// ```
7278 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7279 where
7280 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7281 {
7282 self.client_tls_policy = std::option::Option::Some(v.into());
7283 self
7284 }
7285
7286 /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7287 ///
7288 /// # Example
7289 /// ```ignore,no_run
7290 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7291 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7292 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7293 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7294 /// ```
7295 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7296 where
7297 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7298 {
7299 self.client_tls_policy = v.map(|x| x.into());
7300 self
7301 }
7302}
7303
7304impl wkt::message::Message for CreateClientTlsPolicyRequest {
7305 fn typename() -> &'static str {
7306 "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
7307 }
7308}
7309
7310/// Request used by UpdateClientTlsPolicy method.
7311#[derive(Clone, Default, PartialEq)]
7312#[non_exhaustive]
7313pub struct UpdateClientTlsPolicyRequest {
7314 /// Optional. Field mask is used to specify the fields to be overwritten in the
7315 /// ClientTlsPolicy resource by the update. The fields
7316 /// specified in the update_mask are relative to the resource, not
7317 /// the full request. A field will be overwritten if it is in the
7318 /// mask. If the user does not provide a mask then all fields will be
7319 /// overwritten.
7320 pub update_mask: std::option::Option<wkt::FieldMask>,
7321
7322 /// Required. Updated ClientTlsPolicy resource.
7323 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7324
7325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7326}
7327
7328impl UpdateClientTlsPolicyRequest {
7329 /// Creates a new default instance.
7330 pub fn new() -> Self {
7331 std::default::Default::default()
7332 }
7333
7334 /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7335 ///
7336 /// # Example
7337 /// ```ignore,no_run
7338 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7339 /// use wkt::FieldMask;
7340 /// let x = UpdateClientTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7341 /// ```
7342 pub fn set_update_mask<T>(mut self, v: T) -> Self
7343 where
7344 T: std::convert::Into<wkt::FieldMask>,
7345 {
7346 self.update_mask = std::option::Option::Some(v.into());
7347 self
7348 }
7349
7350 /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7351 ///
7352 /// # Example
7353 /// ```ignore,no_run
7354 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7355 /// use wkt::FieldMask;
7356 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7357 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7358 /// ```
7359 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7360 where
7361 T: std::convert::Into<wkt::FieldMask>,
7362 {
7363 self.update_mask = v.map(|x| x.into());
7364 self
7365 }
7366
7367 /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7368 ///
7369 /// # Example
7370 /// ```ignore,no_run
7371 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7372 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7373 /// let x = UpdateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7374 /// ```
7375 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7376 where
7377 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7378 {
7379 self.client_tls_policy = std::option::Option::Some(v.into());
7380 self
7381 }
7382
7383 /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7384 ///
7385 /// # Example
7386 /// ```ignore,no_run
7387 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7388 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7389 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7390 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7391 /// ```
7392 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7393 where
7394 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7395 {
7396 self.client_tls_policy = v.map(|x| x.into());
7397 self
7398 }
7399}
7400
7401impl wkt::message::Message for UpdateClientTlsPolicyRequest {
7402 fn typename() -> &'static str {
7403 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
7404 }
7405}
7406
7407/// Request used by the DeleteClientTlsPolicy method.
7408#[derive(Clone, Default, PartialEq)]
7409#[non_exhaustive]
7410pub struct DeleteClientTlsPolicyRequest {
7411 /// Required. A name of the ClientTlsPolicy to delete. Must be in
7412 /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
7413 pub name: std::string::String,
7414
7415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7416}
7417
7418impl DeleteClientTlsPolicyRequest {
7419 /// Creates a new default instance.
7420 pub fn new() -> Self {
7421 std::default::Default::default()
7422 }
7423
7424 /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
7425 ///
7426 /// # Example
7427 /// ```ignore,no_run
7428 /// # use google_cloud_networksecurity_v1::model::DeleteClientTlsPolicyRequest;
7429 /// let x = DeleteClientTlsPolicyRequest::new().set_name("example");
7430 /// ```
7431 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7432 self.name = v.into();
7433 self
7434 }
7435}
7436
7437impl wkt::message::Message for DeleteClientTlsPolicyRequest {
7438 fn typename() -> &'static str {
7439 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
7440 }
7441}
7442
7443/// Represents the metadata of the long-running operation.
7444#[derive(Clone, Default, PartialEq)]
7445#[non_exhaustive]
7446pub struct OperationMetadata {
7447 /// Output only. The time the operation was created.
7448 pub create_time: std::option::Option<wkt::Timestamp>,
7449
7450 /// Output only. The time the operation finished running.
7451 pub end_time: std::option::Option<wkt::Timestamp>,
7452
7453 /// Output only. Server-defined resource path for the target of the operation.
7454 pub target: std::string::String,
7455
7456 /// Output only. Name of the verb executed by the operation.
7457 pub verb: std::string::String,
7458
7459 /// Output only. Human-readable status of the operation, if any.
7460 pub status_message: std::string::String,
7461
7462 /// Output only. Identifies whether the user has requested cancellation
7463 /// of the operation. Operations that have successfully been cancelled
7464 /// have [Operation.error][] value with a
7465 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7466 /// `Code.CANCELLED`.
7467 ///
7468 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
7469 pub requested_cancellation: bool,
7470
7471 /// Output only. API version used to start the operation.
7472 pub api_version: std::string::String,
7473
7474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7475}
7476
7477impl OperationMetadata {
7478 /// Creates a new default instance.
7479 pub fn new() -> Self {
7480 std::default::Default::default()
7481 }
7482
7483 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7484 ///
7485 /// # Example
7486 /// ```ignore,no_run
7487 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7488 /// use wkt::Timestamp;
7489 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7490 /// ```
7491 pub fn set_create_time<T>(mut self, v: T) -> Self
7492 where
7493 T: std::convert::Into<wkt::Timestamp>,
7494 {
7495 self.create_time = std::option::Option::Some(v.into());
7496 self
7497 }
7498
7499 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7500 ///
7501 /// # Example
7502 /// ```ignore,no_run
7503 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7504 /// use wkt::Timestamp;
7505 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7506 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7507 /// ```
7508 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7509 where
7510 T: std::convert::Into<wkt::Timestamp>,
7511 {
7512 self.create_time = v.map(|x| x.into());
7513 self
7514 }
7515
7516 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7521 /// use wkt::Timestamp;
7522 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7523 /// ```
7524 pub fn set_end_time<T>(mut self, v: T) -> Self
7525 where
7526 T: std::convert::Into<wkt::Timestamp>,
7527 {
7528 self.end_time = std::option::Option::Some(v.into());
7529 self
7530 }
7531
7532 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7533 ///
7534 /// # Example
7535 /// ```ignore,no_run
7536 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7537 /// use wkt::Timestamp;
7538 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7539 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7540 /// ```
7541 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7542 where
7543 T: std::convert::Into<wkt::Timestamp>,
7544 {
7545 self.end_time = v.map(|x| x.into());
7546 self
7547 }
7548
7549 /// Sets the value of [target][crate::model::OperationMetadata::target].
7550 ///
7551 /// # Example
7552 /// ```ignore,no_run
7553 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7554 /// let x = OperationMetadata::new().set_target("example");
7555 /// ```
7556 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7557 self.target = v.into();
7558 self
7559 }
7560
7561 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7562 ///
7563 /// # Example
7564 /// ```ignore,no_run
7565 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7566 /// let x = OperationMetadata::new().set_verb("example");
7567 /// ```
7568 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7569 self.verb = v.into();
7570 self
7571 }
7572
7573 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7574 ///
7575 /// # Example
7576 /// ```ignore,no_run
7577 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7578 /// let x = OperationMetadata::new().set_status_message("example");
7579 /// ```
7580 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7581 self.status_message = v.into();
7582 self
7583 }
7584
7585 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7586 ///
7587 /// # Example
7588 /// ```ignore,no_run
7589 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7590 /// let x = OperationMetadata::new().set_requested_cancellation(true);
7591 /// ```
7592 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7593 self.requested_cancellation = v.into();
7594 self
7595 }
7596
7597 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7598 ///
7599 /// # Example
7600 /// ```ignore,no_run
7601 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7602 /// let x = OperationMetadata::new().set_api_version("example");
7603 /// ```
7604 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7605 self.api_version = v.into();
7606 self
7607 }
7608}
7609
7610impl wkt::message::Message for OperationMetadata {
7611 fn typename() -> &'static str {
7612 "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
7613 }
7614}
7615
7616/// A DNS threat detector sends DNS query logs to a _provider_ that then
7617/// analyzes the logs to identify threat events in the DNS queries.
7618/// By default, all VPC networks in your projects are included. You can exclude
7619/// specific networks by supplying `excluded_networks`.
7620#[derive(Clone, Default, PartialEq)]
7621#[non_exhaustive]
7622pub struct DnsThreatDetector {
7623 /// Immutable. Identifier. Name of the DnsThreatDetector resource.
7624 pub name: std::string::String,
7625
7626 /// Output only. Create time stamp.
7627 pub create_time: std::option::Option<wkt::Timestamp>,
7628
7629 /// Output only. Update time stamp.
7630 pub update_time: std::option::Option<wkt::Timestamp>,
7631
7632 /// Optional. Any labels associated with the DnsThreatDetector, listed as key
7633 /// value pairs.
7634 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7635
7636 /// Optional. A list of network resource names which aren't monitored by this
7637 /// DnsThreatDetector.
7638 ///
7639 /// Example:
7640 /// `projects/PROJECT_ID/global/networks/NETWORK_NAME`.
7641 pub excluded_networks: std::vec::Vec<std::string::String>,
7642
7643 /// Required. The provider used for DNS threat analysis.
7644 pub provider: crate::model::dns_threat_detector::Provider,
7645
7646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7647}
7648
7649impl DnsThreatDetector {
7650 /// Creates a new default instance.
7651 pub fn new() -> Self {
7652 std::default::Default::default()
7653 }
7654
7655 /// Sets the value of [name][crate::model::DnsThreatDetector::name].
7656 ///
7657 /// # Example
7658 /// ```ignore,no_run
7659 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7660 /// let x = DnsThreatDetector::new().set_name("example");
7661 /// ```
7662 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7663 self.name = v.into();
7664 self
7665 }
7666
7667 /// Sets the value of [create_time][crate::model::DnsThreatDetector::create_time].
7668 ///
7669 /// # Example
7670 /// ```ignore,no_run
7671 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7672 /// use wkt::Timestamp;
7673 /// let x = DnsThreatDetector::new().set_create_time(Timestamp::default()/* use setters */);
7674 /// ```
7675 pub fn set_create_time<T>(mut self, v: T) -> Self
7676 where
7677 T: std::convert::Into<wkt::Timestamp>,
7678 {
7679 self.create_time = std::option::Option::Some(v.into());
7680 self
7681 }
7682
7683 /// Sets or clears the value of [create_time][crate::model::DnsThreatDetector::create_time].
7684 ///
7685 /// # Example
7686 /// ```ignore,no_run
7687 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7688 /// use wkt::Timestamp;
7689 /// let x = DnsThreatDetector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7690 /// let x = DnsThreatDetector::new().set_or_clear_create_time(None::<Timestamp>);
7691 /// ```
7692 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7693 where
7694 T: std::convert::Into<wkt::Timestamp>,
7695 {
7696 self.create_time = v.map(|x| x.into());
7697 self
7698 }
7699
7700 /// Sets the value of [update_time][crate::model::DnsThreatDetector::update_time].
7701 ///
7702 /// # Example
7703 /// ```ignore,no_run
7704 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7705 /// use wkt::Timestamp;
7706 /// let x = DnsThreatDetector::new().set_update_time(Timestamp::default()/* use setters */);
7707 /// ```
7708 pub fn set_update_time<T>(mut self, v: T) -> Self
7709 where
7710 T: std::convert::Into<wkt::Timestamp>,
7711 {
7712 self.update_time = std::option::Option::Some(v.into());
7713 self
7714 }
7715
7716 /// Sets or clears the value of [update_time][crate::model::DnsThreatDetector::update_time].
7717 ///
7718 /// # Example
7719 /// ```ignore,no_run
7720 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7721 /// use wkt::Timestamp;
7722 /// let x = DnsThreatDetector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7723 /// let x = DnsThreatDetector::new().set_or_clear_update_time(None::<Timestamp>);
7724 /// ```
7725 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7726 where
7727 T: std::convert::Into<wkt::Timestamp>,
7728 {
7729 self.update_time = v.map(|x| x.into());
7730 self
7731 }
7732
7733 /// Sets the value of [labels][crate::model::DnsThreatDetector::labels].
7734 ///
7735 /// # Example
7736 /// ```ignore,no_run
7737 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7738 /// let x = DnsThreatDetector::new().set_labels([
7739 /// ("key0", "abc"),
7740 /// ("key1", "xyz"),
7741 /// ]);
7742 /// ```
7743 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7744 where
7745 T: std::iter::IntoIterator<Item = (K, V)>,
7746 K: std::convert::Into<std::string::String>,
7747 V: std::convert::Into<std::string::String>,
7748 {
7749 use std::iter::Iterator;
7750 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7751 self
7752 }
7753
7754 /// Sets the value of [excluded_networks][crate::model::DnsThreatDetector::excluded_networks].
7755 ///
7756 /// # Example
7757 /// ```ignore,no_run
7758 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7759 /// let x = DnsThreatDetector::new().set_excluded_networks(["a", "b", "c"]);
7760 /// ```
7761 pub fn set_excluded_networks<T, V>(mut self, v: T) -> Self
7762 where
7763 T: std::iter::IntoIterator<Item = V>,
7764 V: std::convert::Into<std::string::String>,
7765 {
7766 use std::iter::Iterator;
7767 self.excluded_networks = v.into_iter().map(|i| i.into()).collect();
7768 self
7769 }
7770
7771 /// Sets the value of [provider][crate::model::DnsThreatDetector::provider].
7772 ///
7773 /// # Example
7774 /// ```ignore,no_run
7775 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7776 /// use google_cloud_networksecurity_v1::model::dns_threat_detector::Provider;
7777 /// let x0 = DnsThreatDetector::new().set_provider(Provider::Infoblox);
7778 /// ```
7779 pub fn set_provider<T: std::convert::Into<crate::model::dns_threat_detector::Provider>>(
7780 mut self,
7781 v: T,
7782 ) -> Self {
7783 self.provider = v.into();
7784 self
7785 }
7786}
7787
7788impl wkt::message::Message for DnsThreatDetector {
7789 fn typename() -> &'static str {
7790 "type.googleapis.com/google.cloud.networksecurity.v1.DnsThreatDetector"
7791 }
7792}
7793
7794/// Defines additional types related to [DnsThreatDetector].
7795pub mod dns_threat_detector {
7796 #[allow(unused_imports)]
7797 use super::*;
7798
7799 /// Name of the provider used for DNS threat analysis.
7800 ///
7801 /// # Working with unknown values
7802 ///
7803 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7804 /// additional enum variants at any time. Adding new variants is not considered
7805 /// a breaking change. Applications should write their code in anticipation of:
7806 ///
7807 /// - New values appearing in future releases of the client library, **and**
7808 /// - New values received dynamically, without application changes.
7809 ///
7810 /// Please consult the [Working with enums] section in the user guide for some
7811 /// guidelines.
7812 ///
7813 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7814 #[derive(Clone, Debug, PartialEq)]
7815 #[non_exhaustive]
7816 pub enum Provider {
7817 /// An unspecified provider.
7818 Unspecified,
7819 /// The Infoblox DNS threat detector provider.
7820 Infoblox,
7821 /// If set, the enum was initialized with an unknown value.
7822 ///
7823 /// Applications can examine the value using [Provider::value] or
7824 /// [Provider::name].
7825 UnknownValue(provider::UnknownValue),
7826 }
7827
7828 #[doc(hidden)]
7829 pub mod provider {
7830 #[allow(unused_imports)]
7831 use super::*;
7832 #[derive(Clone, Debug, PartialEq)]
7833 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7834 }
7835
7836 impl Provider {
7837 /// Gets the enum value.
7838 ///
7839 /// Returns `None` if the enum contains an unknown value deserialized from
7840 /// the string representation of enums.
7841 pub fn value(&self) -> std::option::Option<i32> {
7842 match self {
7843 Self::Unspecified => std::option::Option::Some(0),
7844 Self::Infoblox => std::option::Option::Some(1),
7845 Self::UnknownValue(u) => u.0.value(),
7846 }
7847 }
7848
7849 /// Gets the enum value as a string.
7850 ///
7851 /// Returns `None` if the enum contains an unknown value deserialized from
7852 /// the integer representation of enums.
7853 pub fn name(&self) -> std::option::Option<&str> {
7854 match self {
7855 Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
7856 Self::Infoblox => std::option::Option::Some("INFOBLOX"),
7857 Self::UnknownValue(u) => u.0.name(),
7858 }
7859 }
7860 }
7861
7862 impl std::default::Default for Provider {
7863 fn default() -> Self {
7864 use std::convert::From;
7865 Self::from(0)
7866 }
7867 }
7868
7869 impl std::fmt::Display for Provider {
7870 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7871 wkt::internal::display_enum(f, self.name(), self.value())
7872 }
7873 }
7874
7875 impl std::convert::From<i32> for Provider {
7876 fn from(value: i32) -> Self {
7877 match value {
7878 0 => Self::Unspecified,
7879 1 => Self::Infoblox,
7880 _ => Self::UnknownValue(provider::UnknownValue(
7881 wkt::internal::UnknownEnumValue::Integer(value),
7882 )),
7883 }
7884 }
7885 }
7886
7887 impl std::convert::From<&str> for Provider {
7888 fn from(value: &str) -> Self {
7889 use std::string::ToString;
7890 match value {
7891 "PROVIDER_UNSPECIFIED" => Self::Unspecified,
7892 "INFOBLOX" => Self::Infoblox,
7893 _ => Self::UnknownValue(provider::UnknownValue(
7894 wkt::internal::UnknownEnumValue::String(value.to_string()),
7895 )),
7896 }
7897 }
7898 }
7899
7900 impl serde::ser::Serialize for Provider {
7901 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7902 where
7903 S: serde::Serializer,
7904 {
7905 match self {
7906 Self::Unspecified => serializer.serialize_i32(0),
7907 Self::Infoblox => serializer.serialize_i32(1),
7908 Self::UnknownValue(u) => u.0.serialize(serializer),
7909 }
7910 }
7911 }
7912
7913 impl<'de> serde::de::Deserialize<'de> for Provider {
7914 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7915 where
7916 D: serde::Deserializer<'de>,
7917 {
7918 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
7919 ".google.cloud.networksecurity.v1.DnsThreatDetector.Provider",
7920 ))
7921 }
7922 }
7923}
7924
7925/// The message for requesting a list of DnsThreatDetectors in the project.
7926#[derive(Clone, Default, PartialEq)]
7927#[non_exhaustive]
7928pub struct ListDnsThreatDetectorsRequest {
7929 /// Required. The parent value for `ListDnsThreatDetectorsRequest`.
7930 pub parent: std::string::String,
7931
7932 /// Optional. The requested page size. The server may return fewer items than
7933 /// requested. If unspecified, the server picks an appropriate default.
7934 pub page_size: i32,
7935
7936 /// Optional. A page token received from a previous
7937 /// `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the
7938 /// subsequent page.
7939 pub page_token: std::string::String,
7940
7941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7942}
7943
7944impl ListDnsThreatDetectorsRequest {
7945 /// Creates a new default instance.
7946 pub fn new() -> Self {
7947 std::default::Default::default()
7948 }
7949
7950 /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
7951 ///
7952 /// # Example
7953 /// ```ignore,no_run
7954 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7955 /// let x = ListDnsThreatDetectorsRequest::new().set_parent("example");
7956 /// ```
7957 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7958 self.parent = v.into();
7959 self
7960 }
7961
7962 /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
7963 ///
7964 /// # Example
7965 /// ```ignore,no_run
7966 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7967 /// let x = ListDnsThreatDetectorsRequest::new().set_page_size(42);
7968 /// ```
7969 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7970 self.page_size = v.into();
7971 self
7972 }
7973
7974 /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
7975 ///
7976 /// # Example
7977 /// ```ignore,no_run
7978 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7979 /// let x = ListDnsThreatDetectorsRequest::new().set_page_token("example");
7980 /// ```
7981 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7982 self.page_token = v.into();
7983 self
7984 }
7985}
7986
7987impl wkt::message::Message for ListDnsThreatDetectorsRequest {
7988 fn typename() -> &'static str {
7989 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest"
7990 }
7991}
7992
7993/// The response message to requesting a list of DnsThreatDetectors.
7994#[derive(Clone, Default, PartialEq)]
7995#[non_exhaustive]
7996pub struct ListDnsThreatDetectorsResponse {
7997 /// The list of DnsThreatDetector resources.
7998 pub dns_threat_detectors: std::vec::Vec<crate::model::DnsThreatDetector>,
7999
8000 /// A token, which can be sent as `page_token`, to retrieve the next page.
8001 pub next_page_token: std::string::String,
8002
8003 /// Unordered list. Unreachable `DnsThreatDetector` resources.
8004 pub unreachable: std::vec::Vec<std::string::String>,
8005
8006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8007}
8008
8009impl ListDnsThreatDetectorsResponse {
8010 /// Creates a new default instance.
8011 pub fn new() -> Self {
8012 std::default::Default::default()
8013 }
8014
8015 /// Sets the value of [dns_threat_detectors][crate::model::ListDnsThreatDetectorsResponse::dns_threat_detectors].
8016 ///
8017 /// # Example
8018 /// ```ignore,no_run
8019 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8020 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8021 /// let x = ListDnsThreatDetectorsResponse::new()
8022 /// .set_dns_threat_detectors([
8023 /// DnsThreatDetector::default()/* use setters */,
8024 /// DnsThreatDetector::default()/* use (different) setters */,
8025 /// ]);
8026 /// ```
8027 pub fn set_dns_threat_detectors<T, V>(mut self, v: T) -> Self
8028 where
8029 T: std::iter::IntoIterator<Item = V>,
8030 V: std::convert::Into<crate::model::DnsThreatDetector>,
8031 {
8032 use std::iter::Iterator;
8033 self.dns_threat_detectors = v.into_iter().map(|i| i.into()).collect();
8034 self
8035 }
8036
8037 /// Sets the value of [next_page_token][crate::model::ListDnsThreatDetectorsResponse::next_page_token].
8038 ///
8039 /// # Example
8040 /// ```ignore,no_run
8041 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8042 /// let x = ListDnsThreatDetectorsResponse::new().set_next_page_token("example");
8043 /// ```
8044 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8045 self.next_page_token = v.into();
8046 self
8047 }
8048
8049 /// Sets the value of [unreachable][crate::model::ListDnsThreatDetectorsResponse::unreachable].
8050 ///
8051 /// # Example
8052 /// ```ignore,no_run
8053 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8054 /// let x = ListDnsThreatDetectorsResponse::new().set_unreachable(["a", "b", "c"]);
8055 /// ```
8056 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8057 where
8058 T: std::iter::IntoIterator<Item = V>,
8059 V: std::convert::Into<std::string::String>,
8060 {
8061 use std::iter::Iterator;
8062 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8063 self
8064 }
8065}
8066
8067impl wkt::message::Message for ListDnsThreatDetectorsResponse {
8068 fn typename() -> &'static str {
8069 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse"
8070 }
8071}
8072
8073#[doc(hidden)]
8074impl google_cloud_gax::paginator::internal::PageableResponse for ListDnsThreatDetectorsResponse {
8075 type PageItem = crate::model::DnsThreatDetector;
8076
8077 fn items(self) -> std::vec::Vec<Self::PageItem> {
8078 self.dns_threat_detectors
8079 }
8080
8081 fn next_page_token(&self) -> std::string::String {
8082 use std::clone::Clone;
8083 self.next_page_token.clone()
8084 }
8085}
8086
8087/// The message sent to get a DnsThreatDetector.
8088#[derive(Clone, Default, PartialEq)]
8089#[non_exhaustive]
8090pub struct GetDnsThreatDetectorRequest {
8091 /// Required. Name of the DnsThreatDetector resource.
8092 pub name: std::string::String,
8093
8094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8095}
8096
8097impl GetDnsThreatDetectorRequest {
8098 /// Creates a new default instance.
8099 pub fn new() -> Self {
8100 std::default::Default::default()
8101 }
8102
8103 /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
8104 ///
8105 /// # Example
8106 /// ```ignore,no_run
8107 /// # use google_cloud_networksecurity_v1::model::GetDnsThreatDetectorRequest;
8108 /// let x = GetDnsThreatDetectorRequest::new().set_name("example");
8109 /// ```
8110 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8111 self.name = v.into();
8112 self
8113 }
8114}
8115
8116impl wkt::message::Message for GetDnsThreatDetectorRequest {
8117 fn typename() -> &'static str {
8118 "type.googleapis.com/google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest"
8119 }
8120}
8121
8122/// The message to create a DnsThreatDetector.
8123#[derive(Clone, Default, PartialEq)]
8124#[non_exhaustive]
8125pub struct CreateDnsThreatDetectorRequest {
8126 /// Required. The value for the parent of the DnsThreatDetector resource.
8127 pub parent: std::string::String,
8128
8129 /// Optional. The ID of the requesting DnsThreatDetector object.
8130 /// If this field is not supplied, the service generates an identifier.
8131 pub dns_threat_detector_id: std::string::String,
8132
8133 /// Required. The `DnsThreatDetector` resource to create.
8134 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8135
8136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8137}
8138
8139impl CreateDnsThreatDetectorRequest {
8140 /// Creates a new default instance.
8141 pub fn new() -> Self {
8142 std::default::Default::default()
8143 }
8144
8145 /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
8146 ///
8147 /// # Example
8148 /// ```ignore,no_run
8149 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8150 /// let x = CreateDnsThreatDetectorRequest::new().set_parent("example");
8151 /// ```
8152 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8153 self.parent = v.into();
8154 self
8155 }
8156
8157 /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
8158 ///
8159 /// # Example
8160 /// ```ignore,no_run
8161 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8162 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector_id("example");
8163 /// ```
8164 pub fn set_dns_threat_detector_id<T: std::convert::Into<std::string::String>>(
8165 mut self,
8166 v: T,
8167 ) -> Self {
8168 self.dns_threat_detector_id = v.into();
8169 self
8170 }
8171
8172 /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8173 ///
8174 /// # Example
8175 /// ```ignore,no_run
8176 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8177 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8178 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8179 /// ```
8180 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8181 where
8182 T: std::convert::Into<crate::model::DnsThreatDetector>,
8183 {
8184 self.dns_threat_detector = std::option::Option::Some(v.into());
8185 self
8186 }
8187
8188 /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8189 ///
8190 /// # Example
8191 /// ```ignore,no_run
8192 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8193 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8194 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8195 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8196 /// ```
8197 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8198 where
8199 T: std::convert::Into<crate::model::DnsThreatDetector>,
8200 {
8201 self.dns_threat_detector = v.map(|x| x.into());
8202 self
8203 }
8204}
8205
8206impl wkt::message::Message for CreateDnsThreatDetectorRequest {
8207 fn typename() -> &'static str {
8208 "type.googleapis.com/google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest"
8209 }
8210}
8211
8212/// The message for updating a DnsThreatDetector.
8213#[derive(Clone, Default, PartialEq)]
8214#[non_exhaustive]
8215pub struct UpdateDnsThreatDetectorRequest {
8216 /// Optional. The field mask is used to specify the fields to be overwritten in
8217 /// the DnsThreatDetector resource by the update. The fields specified in the
8218 /// update_mask are relative to the resource, not the full request. A field
8219 /// will be overwritten if it is in the mask. If the mask is not provided then
8220 /// all fields present in the request will be overwritten.
8221 pub update_mask: std::option::Option<wkt::FieldMask>,
8222
8223 /// Required. The DnsThreatDetector resource being updated.
8224 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8225
8226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8227}
8228
8229impl UpdateDnsThreatDetectorRequest {
8230 /// Creates a new default instance.
8231 pub fn new() -> Self {
8232 std::default::Default::default()
8233 }
8234
8235 /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8236 ///
8237 /// # Example
8238 /// ```ignore,no_run
8239 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8240 /// use wkt::FieldMask;
8241 /// let x = UpdateDnsThreatDetectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8242 /// ```
8243 pub fn set_update_mask<T>(mut self, v: T) -> Self
8244 where
8245 T: std::convert::Into<wkt::FieldMask>,
8246 {
8247 self.update_mask = std::option::Option::Some(v.into());
8248 self
8249 }
8250
8251 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8252 ///
8253 /// # Example
8254 /// ```ignore,no_run
8255 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8256 /// use wkt::FieldMask;
8257 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8258 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8259 /// ```
8260 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8261 where
8262 T: std::convert::Into<wkt::FieldMask>,
8263 {
8264 self.update_mask = v.map(|x| x.into());
8265 self
8266 }
8267
8268 /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8269 ///
8270 /// # Example
8271 /// ```ignore,no_run
8272 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8273 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8274 /// let x = UpdateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8275 /// ```
8276 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8277 where
8278 T: std::convert::Into<crate::model::DnsThreatDetector>,
8279 {
8280 self.dns_threat_detector = std::option::Option::Some(v.into());
8281 self
8282 }
8283
8284 /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8285 ///
8286 /// # Example
8287 /// ```ignore,no_run
8288 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8289 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8290 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8291 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8292 /// ```
8293 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8294 where
8295 T: std::convert::Into<crate::model::DnsThreatDetector>,
8296 {
8297 self.dns_threat_detector = v.map(|x| x.into());
8298 self
8299 }
8300}
8301
8302impl wkt::message::Message for UpdateDnsThreatDetectorRequest {
8303 fn typename() -> &'static str {
8304 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest"
8305 }
8306}
8307
8308/// The message for deleting a DnsThreatDetector.
8309#[derive(Clone, Default, PartialEq)]
8310#[non_exhaustive]
8311pub struct DeleteDnsThreatDetectorRequest {
8312 /// Required. Name of the DnsThreatDetector resource.
8313 pub name: std::string::String,
8314
8315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8316}
8317
8318impl DeleteDnsThreatDetectorRequest {
8319 /// Creates a new default instance.
8320 pub fn new() -> Self {
8321 std::default::Default::default()
8322 }
8323
8324 /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
8325 ///
8326 /// # Example
8327 /// ```ignore,no_run
8328 /// # use google_cloud_networksecurity_v1::model::DeleteDnsThreatDetectorRequest;
8329 /// let x = DeleteDnsThreatDetectorRequest::new().set_name("example");
8330 /// ```
8331 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8332 self.name = v.into();
8333 self
8334 }
8335}
8336
8337impl wkt::message::Message for DeleteDnsThreatDetectorRequest {
8338 fn typename() -> &'static str {
8339 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest"
8340 }
8341}
8342
8343/// Message describing Endpoint object.
8344#[derive(Clone, Default, PartialEq)]
8345#[non_exhaustive]
8346pub struct FirewallEndpoint {
8347 /// Immutable. Identifier. Name of resource.
8348 pub name: std::string::String,
8349
8350 /// Optional. Description of the firewall endpoint. Max length 2048
8351 /// characters.
8352 pub description: std::string::String,
8353
8354 /// Output only. Create time stamp.
8355 pub create_time: std::option::Option<wkt::Timestamp>,
8356
8357 /// Output only. Update time stamp
8358 pub update_time: std::option::Option<wkt::Timestamp>,
8359
8360 /// Optional. Labels as key value pairs
8361 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8362
8363 /// Output only. Current state of the endpoint.
8364 pub state: crate::model::firewall_endpoint::State,
8365
8366 /// Output only. Whether reconciling is in progress, recommended per
8367 /// <https://google.aip.dev/128>.
8368 pub reconciling: bool,
8369
8370 /// Output only. List of networks that are associated with this endpoint in the
8371 /// local zone. This is a projection of the FirewallEndpointAssociations
8372 /// pointing at this endpoint. A network will only appear in this list after
8373 /// traffic routing is fully configured. Format:
8374 /// projects/{project}/global/networks/{name}.
8375 #[deprecated]
8376 pub associated_networks: std::vec::Vec<std::string::String>,
8377
8378 /// Output only. List of FirewallEndpointAssociations that are associated to
8379 /// this endpoint. An association will only appear in this list after traffic
8380 /// routing is fully configured.
8381 pub associations: std::vec::Vec<crate::model::firewall_endpoint::AssociationReference>,
8382
8383 /// Output only. [Output Only] Reserved for future use.
8384 pub satisfies_pzs: std::option::Option<bool>,
8385
8386 /// Output only. [Output Only] Reserved for future use.
8387 pub satisfies_pzi: std::option::Option<bool>,
8388
8389 /// Optional. Project to charge for the deployed firewall endpoint.
8390 /// This field must be specified when creating the endpoint in the organization
8391 /// scope, and should be omitted otherwise.
8392 pub billing_project_id: std::string::String,
8393
8394 /// Optional. Settings for the endpoint.
8395 pub endpoint_settings: std::option::Option<crate::model::firewall_endpoint::EndpointSettings>,
8396
8397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8398}
8399
8400impl FirewallEndpoint {
8401 /// Creates a new default instance.
8402 pub fn new() -> Self {
8403 std::default::Default::default()
8404 }
8405
8406 /// Sets the value of [name][crate::model::FirewallEndpoint::name].
8407 ///
8408 /// # Example
8409 /// ```ignore,no_run
8410 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8411 /// let x = FirewallEndpoint::new().set_name("example");
8412 /// ```
8413 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8414 self.name = v.into();
8415 self
8416 }
8417
8418 /// Sets the value of [description][crate::model::FirewallEndpoint::description].
8419 ///
8420 /// # Example
8421 /// ```ignore,no_run
8422 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8423 /// let x = FirewallEndpoint::new().set_description("example");
8424 /// ```
8425 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8426 self.description = v.into();
8427 self
8428 }
8429
8430 /// Sets the value of [create_time][crate::model::FirewallEndpoint::create_time].
8431 ///
8432 /// # Example
8433 /// ```ignore,no_run
8434 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8435 /// use wkt::Timestamp;
8436 /// let x = FirewallEndpoint::new().set_create_time(Timestamp::default()/* use setters */);
8437 /// ```
8438 pub fn set_create_time<T>(mut self, v: T) -> Self
8439 where
8440 T: std::convert::Into<wkt::Timestamp>,
8441 {
8442 self.create_time = std::option::Option::Some(v.into());
8443 self
8444 }
8445
8446 /// Sets or clears the value of [create_time][crate::model::FirewallEndpoint::create_time].
8447 ///
8448 /// # Example
8449 /// ```ignore,no_run
8450 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8451 /// use wkt::Timestamp;
8452 /// let x = FirewallEndpoint::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8453 /// let x = FirewallEndpoint::new().set_or_clear_create_time(None::<Timestamp>);
8454 /// ```
8455 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8456 where
8457 T: std::convert::Into<wkt::Timestamp>,
8458 {
8459 self.create_time = v.map(|x| x.into());
8460 self
8461 }
8462
8463 /// Sets the value of [update_time][crate::model::FirewallEndpoint::update_time].
8464 ///
8465 /// # Example
8466 /// ```ignore,no_run
8467 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8468 /// use wkt::Timestamp;
8469 /// let x = FirewallEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
8470 /// ```
8471 pub fn set_update_time<T>(mut self, v: T) -> Self
8472 where
8473 T: std::convert::Into<wkt::Timestamp>,
8474 {
8475 self.update_time = std::option::Option::Some(v.into());
8476 self
8477 }
8478
8479 /// Sets or clears the value of [update_time][crate::model::FirewallEndpoint::update_time].
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8484 /// use wkt::Timestamp;
8485 /// let x = FirewallEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8486 /// let x = FirewallEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
8487 /// ```
8488 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8489 where
8490 T: std::convert::Into<wkt::Timestamp>,
8491 {
8492 self.update_time = v.map(|x| x.into());
8493 self
8494 }
8495
8496 /// Sets the value of [labels][crate::model::FirewallEndpoint::labels].
8497 ///
8498 /// # Example
8499 /// ```ignore,no_run
8500 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8501 /// let x = FirewallEndpoint::new().set_labels([
8502 /// ("key0", "abc"),
8503 /// ("key1", "xyz"),
8504 /// ]);
8505 /// ```
8506 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8507 where
8508 T: std::iter::IntoIterator<Item = (K, V)>,
8509 K: std::convert::Into<std::string::String>,
8510 V: std::convert::Into<std::string::String>,
8511 {
8512 use std::iter::Iterator;
8513 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8514 self
8515 }
8516
8517 /// Sets the value of [state][crate::model::FirewallEndpoint::state].
8518 ///
8519 /// # Example
8520 /// ```ignore,no_run
8521 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8522 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::State;
8523 /// let x0 = FirewallEndpoint::new().set_state(State::Creating);
8524 /// let x1 = FirewallEndpoint::new().set_state(State::Active);
8525 /// let x2 = FirewallEndpoint::new().set_state(State::Deleting);
8526 /// ```
8527 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint::State>>(
8528 mut self,
8529 v: T,
8530 ) -> Self {
8531 self.state = v.into();
8532 self
8533 }
8534
8535 /// Sets the value of [reconciling][crate::model::FirewallEndpoint::reconciling].
8536 ///
8537 /// # Example
8538 /// ```ignore,no_run
8539 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8540 /// let x = FirewallEndpoint::new().set_reconciling(true);
8541 /// ```
8542 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8543 self.reconciling = v.into();
8544 self
8545 }
8546
8547 /// Sets the value of [associated_networks][crate::model::FirewallEndpoint::associated_networks].
8548 ///
8549 /// # Example
8550 /// ```ignore,no_run
8551 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8552 /// let x = FirewallEndpoint::new().set_associated_networks(["a", "b", "c"]);
8553 /// ```
8554 #[deprecated]
8555 pub fn set_associated_networks<T, V>(mut self, v: T) -> Self
8556 where
8557 T: std::iter::IntoIterator<Item = V>,
8558 V: std::convert::Into<std::string::String>,
8559 {
8560 use std::iter::Iterator;
8561 self.associated_networks = v.into_iter().map(|i| i.into()).collect();
8562 self
8563 }
8564
8565 /// Sets the value of [associations][crate::model::FirewallEndpoint::associations].
8566 ///
8567 /// # Example
8568 /// ```ignore,no_run
8569 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8570 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8571 /// let x = FirewallEndpoint::new()
8572 /// .set_associations([
8573 /// AssociationReference::default()/* use setters */,
8574 /// AssociationReference::default()/* use (different) setters */,
8575 /// ]);
8576 /// ```
8577 pub fn set_associations<T, V>(mut self, v: T) -> Self
8578 where
8579 T: std::iter::IntoIterator<Item = V>,
8580 V: std::convert::Into<crate::model::firewall_endpoint::AssociationReference>,
8581 {
8582 use std::iter::Iterator;
8583 self.associations = v.into_iter().map(|i| i.into()).collect();
8584 self
8585 }
8586
8587 /// Sets the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8588 ///
8589 /// # Example
8590 /// ```ignore,no_run
8591 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8592 /// let x = FirewallEndpoint::new().set_satisfies_pzs(true);
8593 /// ```
8594 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
8595 where
8596 T: std::convert::Into<bool>,
8597 {
8598 self.satisfies_pzs = std::option::Option::Some(v.into());
8599 self
8600 }
8601
8602 /// Sets or clears the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8603 ///
8604 /// # Example
8605 /// ```ignore,no_run
8606 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8607 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(Some(false));
8608 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(None::<bool>);
8609 /// ```
8610 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
8611 where
8612 T: std::convert::Into<bool>,
8613 {
8614 self.satisfies_pzs = v.map(|x| x.into());
8615 self
8616 }
8617
8618 /// Sets the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8619 ///
8620 /// # Example
8621 /// ```ignore,no_run
8622 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8623 /// let x = FirewallEndpoint::new().set_satisfies_pzi(true);
8624 /// ```
8625 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8626 where
8627 T: std::convert::Into<bool>,
8628 {
8629 self.satisfies_pzi = std::option::Option::Some(v.into());
8630 self
8631 }
8632
8633 /// Sets or clears the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8638 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(Some(false));
8639 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(None::<bool>);
8640 /// ```
8641 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8642 where
8643 T: std::convert::Into<bool>,
8644 {
8645 self.satisfies_pzi = v.map(|x| x.into());
8646 self
8647 }
8648
8649 /// Sets the value of [billing_project_id][crate::model::FirewallEndpoint::billing_project_id].
8650 ///
8651 /// # Example
8652 /// ```ignore,no_run
8653 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8654 /// let x = FirewallEndpoint::new().set_billing_project_id("example");
8655 /// ```
8656 pub fn set_billing_project_id<T: std::convert::Into<std::string::String>>(
8657 mut self,
8658 v: T,
8659 ) -> Self {
8660 self.billing_project_id = v.into();
8661 self
8662 }
8663
8664 /// Sets the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8665 ///
8666 /// # Example
8667 /// ```ignore,no_run
8668 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8669 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8670 /// let x = FirewallEndpoint::new().set_endpoint_settings(EndpointSettings::default()/* use setters */);
8671 /// ```
8672 pub fn set_endpoint_settings<T>(mut self, v: T) -> Self
8673 where
8674 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8675 {
8676 self.endpoint_settings = std::option::Option::Some(v.into());
8677 self
8678 }
8679
8680 /// Sets or clears the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8681 ///
8682 /// # Example
8683 /// ```ignore,no_run
8684 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8685 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8686 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(Some(EndpointSettings::default()/* use setters */));
8687 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(None::<EndpointSettings>);
8688 /// ```
8689 pub fn set_or_clear_endpoint_settings<T>(mut self, v: std::option::Option<T>) -> Self
8690 where
8691 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8692 {
8693 self.endpoint_settings = v.map(|x| x.into());
8694 self
8695 }
8696}
8697
8698impl wkt::message::Message for FirewallEndpoint {
8699 fn typename() -> &'static str {
8700 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint"
8701 }
8702}
8703
8704/// Defines additional types related to [FirewallEndpoint].
8705pub mod firewall_endpoint {
8706 #[allow(unused_imports)]
8707 use super::*;
8708
8709 /// This is a subset of the FirewallEndpointAssociation message, containing
8710 /// fields to be used by the consumer.
8711 #[derive(Clone, Default, PartialEq)]
8712 #[non_exhaustive]
8713 pub struct AssociationReference {
8714 /// Output only. The resource name of the FirewallEndpointAssociation.
8715 /// Format:
8716 /// projects/{project}/locations/{location}/firewallEndpointAssociations/{id}
8717 pub name: std::string::String,
8718
8719 /// Output only. The VPC network associated. Format:
8720 /// projects/{project}/global/networks/{name}.
8721 pub network: std::string::String,
8722
8723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8724 }
8725
8726 impl AssociationReference {
8727 /// Creates a new default instance.
8728 pub fn new() -> Self {
8729 std::default::Default::default()
8730 }
8731
8732 /// Sets the value of [name][crate::model::firewall_endpoint::AssociationReference::name].
8733 ///
8734 /// # Example
8735 /// ```ignore,no_run
8736 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8737 /// let x = AssociationReference::new().set_name("example");
8738 /// ```
8739 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8740 self.name = v.into();
8741 self
8742 }
8743
8744 /// Sets the value of [network][crate::model::firewall_endpoint::AssociationReference::network].
8745 ///
8746 /// # Example
8747 /// ```ignore,no_run
8748 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8749 /// let x = AssociationReference::new().set_network("example");
8750 /// ```
8751 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8752 self.network = v.into();
8753 self
8754 }
8755 }
8756
8757 impl wkt::message::Message for AssociationReference {
8758 fn typename() -> &'static str {
8759 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference"
8760 }
8761 }
8762
8763 /// Settings for the endpoint.
8764 #[derive(Clone, Default, PartialEq)]
8765 #[non_exhaustive]
8766 pub struct EndpointSettings {
8767 /// Optional. Immutable. Indicates whether Jumbo Frames are enabled.
8768 /// Default value is false.
8769 pub jumbo_frames_enabled: bool,
8770
8771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8772 }
8773
8774 impl EndpointSettings {
8775 /// Creates a new default instance.
8776 pub fn new() -> Self {
8777 std::default::Default::default()
8778 }
8779
8780 /// Sets the value of [jumbo_frames_enabled][crate::model::firewall_endpoint::EndpointSettings::jumbo_frames_enabled].
8781 ///
8782 /// # Example
8783 /// ```ignore,no_run
8784 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8785 /// let x = EndpointSettings::new().set_jumbo_frames_enabled(true);
8786 /// ```
8787 pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8788 self.jumbo_frames_enabled = v.into();
8789 self
8790 }
8791 }
8792
8793 impl wkt::message::Message for EndpointSettings {
8794 fn typename() -> &'static str {
8795 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings"
8796 }
8797 }
8798
8799 /// Endpoint state.
8800 ///
8801 /// # Working with unknown values
8802 ///
8803 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8804 /// additional enum variants at any time. Adding new variants is not considered
8805 /// a breaking change. Applications should write their code in anticipation of:
8806 ///
8807 /// - New values appearing in future releases of the client library, **and**
8808 /// - New values received dynamically, without application changes.
8809 ///
8810 /// Please consult the [Working with enums] section in the user guide for some
8811 /// guidelines.
8812 ///
8813 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8814 #[derive(Clone, Debug, PartialEq)]
8815 #[non_exhaustive]
8816 pub enum State {
8817 /// Not set.
8818 Unspecified,
8819 /// Being created.
8820 Creating,
8821 /// Processing configuration updates.
8822 Active,
8823 /// Being deleted.
8824 Deleting,
8825 /// Down or in an error state.
8826 Inactive,
8827 /// If set, the enum was initialized with an unknown value.
8828 ///
8829 /// Applications can examine the value using [State::value] or
8830 /// [State::name].
8831 UnknownValue(state::UnknownValue),
8832 }
8833
8834 #[doc(hidden)]
8835 pub mod state {
8836 #[allow(unused_imports)]
8837 use super::*;
8838 #[derive(Clone, Debug, PartialEq)]
8839 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8840 }
8841
8842 impl State {
8843 /// Gets the enum value.
8844 ///
8845 /// Returns `None` if the enum contains an unknown value deserialized from
8846 /// the string representation of enums.
8847 pub fn value(&self) -> std::option::Option<i32> {
8848 match self {
8849 Self::Unspecified => std::option::Option::Some(0),
8850 Self::Creating => std::option::Option::Some(1),
8851 Self::Active => std::option::Option::Some(2),
8852 Self::Deleting => std::option::Option::Some(3),
8853 Self::Inactive => std::option::Option::Some(4),
8854 Self::UnknownValue(u) => u.0.value(),
8855 }
8856 }
8857
8858 /// Gets the enum value as a string.
8859 ///
8860 /// Returns `None` if the enum contains an unknown value deserialized from
8861 /// the integer representation of enums.
8862 pub fn name(&self) -> std::option::Option<&str> {
8863 match self {
8864 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8865 Self::Creating => std::option::Option::Some("CREATING"),
8866 Self::Active => std::option::Option::Some("ACTIVE"),
8867 Self::Deleting => std::option::Option::Some("DELETING"),
8868 Self::Inactive => std::option::Option::Some("INACTIVE"),
8869 Self::UnknownValue(u) => u.0.name(),
8870 }
8871 }
8872 }
8873
8874 impl std::default::Default for State {
8875 fn default() -> Self {
8876 use std::convert::From;
8877 Self::from(0)
8878 }
8879 }
8880
8881 impl std::fmt::Display for State {
8882 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8883 wkt::internal::display_enum(f, self.name(), self.value())
8884 }
8885 }
8886
8887 impl std::convert::From<i32> for State {
8888 fn from(value: i32) -> Self {
8889 match value {
8890 0 => Self::Unspecified,
8891 1 => Self::Creating,
8892 2 => Self::Active,
8893 3 => Self::Deleting,
8894 4 => Self::Inactive,
8895 _ => Self::UnknownValue(state::UnknownValue(
8896 wkt::internal::UnknownEnumValue::Integer(value),
8897 )),
8898 }
8899 }
8900 }
8901
8902 impl std::convert::From<&str> for State {
8903 fn from(value: &str) -> Self {
8904 use std::string::ToString;
8905 match value {
8906 "STATE_UNSPECIFIED" => Self::Unspecified,
8907 "CREATING" => Self::Creating,
8908 "ACTIVE" => Self::Active,
8909 "DELETING" => Self::Deleting,
8910 "INACTIVE" => Self::Inactive,
8911 _ => Self::UnknownValue(state::UnknownValue(
8912 wkt::internal::UnknownEnumValue::String(value.to_string()),
8913 )),
8914 }
8915 }
8916 }
8917
8918 impl serde::ser::Serialize for State {
8919 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8920 where
8921 S: serde::Serializer,
8922 {
8923 match self {
8924 Self::Unspecified => serializer.serialize_i32(0),
8925 Self::Creating => serializer.serialize_i32(1),
8926 Self::Active => serializer.serialize_i32(2),
8927 Self::Deleting => serializer.serialize_i32(3),
8928 Self::Inactive => serializer.serialize_i32(4),
8929 Self::UnknownValue(u) => u.0.serialize(serializer),
8930 }
8931 }
8932 }
8933
8934 impl<'de> serde::de::Deserialize<'de> for State {
8935 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8936 where
8937 D: serde::Deserializer<'de>,
8938 {
8939 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8940 ".google.cloud.networksecurity.v1.FirewallEndpoint.State",
8941 ))
8942 }
8943 }
8944}
8945
8946/// Message for requesting list of Endpoints
8947#[derive(Clone, Default, PartialEq)]
8948#[non_exhaustive]
8949pub struct ListFirewallEndpointsRequest {
8950 /// Required. Parent value for ListEndpointsRequest
8951 pub parent: std::string::String,
8952
8953 /// Optional. Requested page size. Server may return fewer items than
8954 /// requested. If unspecified, server will pick an appropriate default.
8955 pub page_size: i32,
8956
8957 /// A token identifying a page of results the server should return.
8958 pub page_token: std::string::String,
8959
8960 /// Optional. Filtering results
8961 pub filter: std::string::String,
8962
8963 /// Hint for how to order the results
8964 pub order_by: std::string::String,
8965
8966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8967}
8968
8969impl ListFirewallEndpointsRequest {
8970 /// Creates a new default instance.
8971 pub fn new() -> Self {
8972 std::default::Default::default()
8973 }
8974
8975 /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8980 /// let x = ListFirewallEndpointsRequest::new().set_parent("example");
8981 /// ```
8982 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8983 self.parent = v.into();
8984 self
8985 }
8986
8987 /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
8988 ///
8989 /// # Example
8990 /// ```ignore,no_run
8991 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8992 /// let x = ListFirewallEndpointsRequest::new().set_page_size(42);
8993 /// ```
8994 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8995 self.page_size = v.into();
8996 self
8997 }
8998
8999 /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
9000 ///
9001 /// # Example
9002 /// ```ignore,no_run
9003 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9004 /// let x = ListFirewallEndpointsRequest::new().set_page_token("example");
9005 /// ```
9006 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9007 self.page_token = v.into();
9008 self
9009 }
9010
9011 /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
9012 ///
9013 /// # Example
9014 /// ```ignore,no_run
9015 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9016 /// let x = ListFirewallEndpointsRequest::new().set_filter("example");
9017 /// ```
9018 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9019 self.filter = v.into();
9020 self
9021 }
9022
9023 /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
9024 ///
9025 /// # Example
9026 /// ```ignore,no_run
9027 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9028 /// let x = ListFirewallEndpointsRequest::new().set_order_by("example");
9029 /// ```
9030 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9031 self.order_by = v.into();
9032 self
9033 }
9034}
9035
9036impl wkt::message::Message for ListFirewallEndpointsRequest {
9037 fn typename() -> &'static str {
9038 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsRequest"
9039 }
9040}
9041
9042/// Message for response to listing Endpoints
9043#[derive(Clone, Default, PartialEq)]
9044#[non_exhaustive]
9045pub struct ListFirewallEndpointsResponse {
9046 /// The list of Endpoint
9047 pub firewall_endpoints: std::vec::Vec<crate::model::FirewallEndpoint>,
9048
9049 /// A token identifying a page of results the server should return.
9050 pub next_page_token: std::string::String,
9051
9052 /// Locations that could not be reached.
9053 pub unreachable: std::vec::Vec<std::string::String>,
9054
9055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9056}
9057
9058impl ListFirewallEndpointsResponse {
9059 /// Creates a new default instance.
9060 pub fn new() -> Self {
9061 std::default::Default::default()
9062 }
9063
9064 /// Sets the value of [firewall_endpoints][crate::model::ListFirewallEndpointsResponse::firewall_endpoints].
9065 ///
9066 /// # Example
9067 /// ```ignore,no_run
9068 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9069 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9070 /// let x = ListFirewallEndpointsResponse::new()
9071 /// .set_firewall_endpoints([
9072 /// FirewallEndpoint::default()/* use setters */,
9073 /// FirewallEndpoint::default()/* use (different) setters */,
9074 /// ]);
9075 /// ```
9076 pub fn set_firewall_endpoints<T, V>(mut self, v: T) -> Self
9077 where
9078 T: std::iter::IntoIterator<Item = V>,
9079 V: std::convert::Into<crate::model::FirewallEndpoint>,
9080 {
9081 use std::iter::Iterator;
9082 self.firewall_endpoints = v.into_iter().map(|i| i.into()).collect();
9083 self
9084 }
9085
9086 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointsResponse::next_page_token].
9087 ///
9088 /// # Example
9089 /// ```ignore,no_run
9090 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9091 /// let x = ListFirewallEndpointsResponse::new().set_next_page_token("example");
9092 /// ```
9093 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9094 self.next_page_token = v.into();
9095 self
9096 }
9097
9098 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointsResponse::unreachable].
9099 ///
9100 /// # Example
9101 /// ```ignore,no_run
9102 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9103 /// let x = ListFirewallEndpointsResponse::new().set_unreachable(["a", "b", "c"]);
9104 /// ```
9105 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9106 where
9107 T: std::iter::IntoIterator<Item = V>,
9108 V: std::convert::Into<std::string::String>,
9109 {
9110 use std::iter::Iterator;
9111 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9112 self
9113 }
9114}
9115
9116impl wkt::message::Message for ListFirewallEndpointsResponse {
9117 fn typename() -> &'static str {
9118 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsResponse"
9119 }
9120}
9121
9122#[doc(hidden)]
9123impl google_cloud_gax::paginator::internal::PageableResponse for ListFirewallEndpointsResponse {
9124 type PageItem = crate::model::FirewallEndpoint;
9125
9126 fn items(self) -> std::vec::Vec<Self::PageItem> {
9127 self.firewall_endpoints
9128 }
9129
9130 fn next_page_token(&self) -> std::string::String {
9131 use std::clone::Clone;
9132 self.next_page_token.clone()
9133 }
9134}
9135
9136/// Message for getting a Endpoint
9137#[derive(Clone, Default, PartialEq)]
9138#[non_exhaustive]
9139pub struct GetFirewallEndpointRequest {
9140 /// Required. Name of the resource
9141 pub name: std::string::String,
9142
9143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9144}
9145
9146impl GetFirewallEndpointRequest {
9147 /// Creates a new default instance.
9148 pub fn new() -> Self {
9149 std::default::Default::default()
9150 }
9151
9152 /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointRequest;
9157 /// let x = GetFirewallEndpointRequest::new().set_name("example");
9158 /// ```
9159 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160 self.name = v.into();
9161 self
9162 }
9163}
9164
9165impl wkt::message::Message for GetFirewallEndpointRequest {
9166 fn typename() -> &'static str {
9167 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointRequest"
9168 }
9169}
9170
9171/// Message for creating a Endpoint
9172#[derive(Clone, Default, PartialEq)]
9173#[non_exhaustive]
9174pub struct CreateFirewallEndpointRequest {
9175 /// Required. Value for parent.
9176 pub parent: std::string::String,
9177
9178 /// Required. Id of the requesting object.
9179 /// If auto-generating Id server-side, remove this field and
9180 /// firewall_endpoint_id from the method_signature of Create RPC.
9181 pub firewall_endpoint_id: std::string::String,
9182
9183 /// Required. The resource being created
9184 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9185
9186 /// Optional. An optional request ID to identify requests. Specify a unique
9187 /// request ID so that if you must retry your request, the server will know to
9188 /// ignore the request if it has already been completed. The server will
9189 /// guarantee that for at least 60 minutes since the first request.
9190 ///
9191 /// For example, consider a situation where you make an initial request and
9192 /// the request times out. If you make the request again with the same request
9193 /// ID, the server can check if original operation with the same request ID
9194 /// was received, and if so, will ignore the second request. This prevents
9195 /// clients from accidentally creating duplicate commitments.
9196 ///
9197 /// The request ID must be a valid UUID with the exception that zero UUID is
9198 /// not supported (00000000-0000-0000-0000-000000000000).
9199 pub request_id: std::string::String,
9200
9201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9202}
9203
9204impl CreateFirewallEndpointRequest {
9205 /// Creates a new default instance.
9206 pub fn new() -> Self {
9207 std::default::Default::default()
9208 }
9209
9210 /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
9211 ///
9212 /// # Example
9213 /// ```ignore,no_run
9214 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9215 /// let x = CreateFirewallEndpointRequest::new().set_parent("example");
9216 /// ```
9217 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9218 self.parent = v.into();
9219 self
9220 }
9221
9222 /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
9223 ///
9224 /// # Example
9225 /// ```ignore,no_run
9226 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9227 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint_id("example");
9228 /// ```
9229 pub fn set_firewall_endpoint_id<T: std::convert::Into<std::string::String>>(
9230 mut self,
9231 v: T,
9232 ) -> Self {
9233 self.firewall_endpoint_id = v.into();
9234 self
9235 }
9236
9237 /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9238 ///
9239 /// # Example
9240 /// ```ignore,no_run
9241 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9242 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9243 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9244 /// ```
9245 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9246 where
9247 T: std::convert::Into<crate::model::FirewallEndpoint>,
9248 {
9249 self.firewall_endpoint = std::option::Option::Some(v.into());
9250 self
9251 }
9252
9253 /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9254 ///
9255 /// # Example
9256 /// ```ignore,no_run
9257 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9258 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9259 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9260 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9261 /// ```
9262 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9263 where
9264 T: std::convert::Into<crate::model::FirewallEndpoint>,
9265 {
9266 self.firewall_endpoint = v.map(|x| x.into());
9267 self
9268 }
9269
9270 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9275 /// let x = CreateFirewallEndpointRequest::new().set_request_id("example");
9276 /// ```
9277 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9278 self.request_id = v.into();
9279 self
9280 }
9281}
9282
9283impl wkt::message::Message for CreateFirewallEndpointRequest {
9284 fn typename() -> &'static str {
9285 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointRequest"
9286 }
9287}
9288
9289/// Message for updating a Endpoint
9290#[derive(Clone, Default, PartialEq)]
9291#[non_exhaustive]
9292pub struct UpdateFirewallEndpointRequest {
9293 /// Required. Field mask is used to specify the fields to be overwritten in the
9294 /// Endpoint resource by the update.
9295 /// The fields specified in the update_mask are relative to the resource, not
9296 /// the full request. A field will be overwritten if it is in the mask. If the
9297 /// user does not provide a mask then all fields will be overwritten.
9298 pub update_mask: std::option::Option<wkt::FieldMask>,
9299
9300 /// Required. The resource being updated
9301 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9302
9303 /// Optional. An optional request ID to identify requests. Specify a unique
9304 /// request ID so that if you must retry your request, the server will know to
9305 /// ignore the request if it has already been completed. The server will
9306 /// guarantee that for at least 60 minutes since the first request.
9307 ///
9308 /// For example, consider a situation where you make an initial request and
9309 /// the request times out. If you make the request again with the same request
9310 /// ID, the server can check if original operation with the same request ID
9311 /// was received, and if so, will ignore the second request. This prevents
9312 /// clients from accidentally creating duplicate commitments.
9313 ///
9314 /// The request ID must be a valid UUID with the exception that zero UUID is
9315 /// not supported (00000000-0000-0000-0000-000000000000).
9316 pub request_id: std::string::String,
9317
9318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9319}
9320
9321impl UpdateFirewallEndpointRequest {
9322 /// Creates a new default instance.
9323 pub fn new() -> Self {
9324 std::default::Default::default()
9325 }
9326
9327 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9328 ///
9329 /// # Example
9330 /// ```ignore,no_run
9331 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9332 /// use wkt::FieldMask;
9333 /// let x = UpdateFirewallEndpointRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9334 /// ```
9335 pub fn set_update_mask<T>(mut self, v: T) -> Self
9336 where
9337 T: std::convert::Into<wkt::FieldMask>,
9338 {
9339 self.update_mask = std::option::Option::Some(v.into());
9340 self
9341 }
9342
9343 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9344 ///
9345 /// # Example
9346 /// ```ignore,no_run
9347 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9348 /// use wkt::FieldMask;
9349 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9350 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9351 /// ```
9352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9353 where
9354 T: std::convert::Into<wkt::FieldMask>,
9355 {
9356 self.update_mask = v.map(|x| x.into());
9357 self
9358 }
9359
9360 /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9361 ///
9362 /// # Example
9363 /// ```ignore,no_run
9364 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9365 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9366 /// let x = UpdateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9367 /// ```
9368 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9369 where
9370 T: std::convert::Into<crate::model::FirewallEndpoint>,
9371 {
9372 self.firewall_endpoint = std::option::Option::Some(v.into());
9373 self
9374 }
9375
9376 /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9377 ///
9378 /// # Example
9379 /// ```ignore,no_run
9380 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9381 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9382 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9383 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9384 /// ```
9385 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9386 where
9387 T: std::convert::Into<crate::model::FirewallEndpoint>,
9388 {
9389 self.firewall_endpoint = v.map(|x| x.into());
9390 self
9391 }
9392
9393 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
9394 ///
9395 /// # Example
9396 /// ```ignore,no_run
9397 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9398 /// let x = UpdateFirewallEndpointRequest::new().set_request_id("example");
9399 /// ```
9400 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9401 self.request_id = v.into();
9402 self
9403 }
9404}
9405
9406impl wkt::message::Message for UpdateFirewallEndpointRequest {
9407 fn typename() -> &'static str {
9408 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest"
9409 }
9410}
9411
9412/// Message for deleting a Endpoint
9413#[derive(Clone, Default, PartialEq)]
9414#[non_exhaustive]
9415pub struct DeleteFirewallEndpointRequest {
9416 /// Required. Name of the resource
9417 pub name: std::string::String,
9418
9419 /// Optional. An optional request ID to identify requests. Specify a unique
9420 /// request ID so that if you must retry your request, the server will know to
9421 /// ignore the request if it has already been completed. The server will
9422 /// guarantee that for at least 60 minutes after the first request.
9423 ///
9424 /// For example, consider a situation where you make an initial request and
9425 /// the request times out. If you make the request again with the same request
9426 /// ID, the server can check if original operation with the same request ID
9427 /// was received, and if so, will ignore the second request. This prevents
9428 /// clients from accidentally creating duplicate commitments.
9429 ///
9430 /// The request ID must be a valid UUID with the exception that zero UUID is
9431 /// not supported (00000000-0000-0000-0000-000000000000).
9432 pub request_id: std::string::String,
9433
9434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9435}
9436
9437impl DeleteFirewallEndpointRequest {
9438 /// Creates a new default instance.
9439 pub fn new() -> Self {
9440 std::default::Default::default()
9441 }
9442
9443 /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
9444 ///
9445 /// # Example
9446 /// ```ignore,no_run
9447 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9448 /// let x = DeleteFirewallEndpointRequest::new().set_name("example");
9449 /// ```
9450 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9451 self.name = v.into();
9452 self
9453 }
9454
9455 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
9456 ///
9457 /// # Example
9458 /// ```ignore,no_run
9459 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9460 /// let x = DeleteFirewallEndpointRequest::new().set_request_id("example");
9461 /// ```
9462 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9463 self.request_id = v.into();
9464 self
9465 }
9466}
9467
9468impl wkt::message::Message for DeleteFirewallEndpointRequest {
9469 fn typename() -> &'static str {
9470 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest"
9471 }
9472}
9473
9474/// Message describing Association object
9475#[derive(Clone, Default, PartialEq)]
9476#[non_exhaustive]
9477pub struct FirewallEndpointAssociation {
9478 /// Immutable. Identifier. name of resource
9479 pub name: std::string::String,
9480
9481 /// Output only. Create time stamp
9482 pub create_time: std::option::Option<wkt::Timestamp>,
9483
9484 /// Output only. Update time stamp
9485 pub update_time: std::option::Option<wkt::Timestamp>,
9486
9487 /// Optional. Labels as key value pairs
9488 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9489
9490 /// Output only. Current state of the association.
9491 pub state: crate::model::firewall_endpoint_association::State,
9492
9493 /// Required. The URL of the network that is being associated.
9494 pub network: std::string::String,
9495
9496 /// Required. The URL of the FirewallEndpoint that is being associated.
9497 pub firewall_endpoint: std::string::String,
9498
9499 /// Optional. The URL of the TlsInspectionPolicy that is being associated.
9500 pub tls_inspection_policy: std::string::String,
9501
9502 /// Output only. Whether reconciling is in progress, recommended per
9503 /// <https://google.aip.dev/128>.
9504 pub reconciling: bool,
9505
9506 /// Optional. Whether the association is disabled.
9507 /// True indicates that traffic won't be intercepted
9508 pub disabled: bool,
9509
9510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9511}
9512
9513impl FirewallEndpointAssociation {
9514 /// Creates a new default instance.
9515 pub fn new() -> Self {
9516 std::default::Default::default()
9517 }
9518
9519 /// Sets the value of [name][crate::model::FirewallEndpointAssociation::name].
9520 ///
9521 /// # Example
9522 /// ```ignore,no_run
9523 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9524 /// let x = FirewallEndpointAssociation::new().set_name("example");
9525 /// ```
9526 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9527 self.name = v.into();
9528 self
9529 }
9530
9531 /// Sets the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9532 ///
9533 /// # Example
9534 /// ```ignore,no_run
9535 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9536 /// use wkt::Timestamp;
9537 /// let x = FirewallEndpointAssociation::new().set_create_time(Timestamp::default()/* use setters */);
9538 /// ```
9539 pub fn set_create_time<T>(mut self, v: T) -> Self
9540 where
9541 T: std::convert::Into<wkt::Timestamp>,
9542 {
9543 self.create_time = std::option::Option::Some(v.into());
9544 self
9545 }
9546
9547 /// Sets or clears the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9548 ///
9549 /// # Example
9550 /// ```ignore,no_run
9551 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9552 /// use wkt::Timestamp;
9553 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9554 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(None::<Timestamp>);
9555 /// ```
9556 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9557 where
9558 T: std::convert::Into<wkt::Timestamp>,
9559 {
9560 self.create_time = v.map(|x| x.into());
9561 self
9562 }
9563
9564 /// Sets the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9565 ///
9566 /// # Example
9567 /// ```ignore,no_run
9568 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9569 /// use wkt::Timestamp;
9570 /// let x = FirewallEndpointAssociation::new().set_update_time(Timestamp::default()/* use setters */);
9571 /// ```
9572 pub fn set_update_time<T>(mut self, v: T) -> Self
9573 where
9574 T: std::convert::Into<wkt::Timestamp>,
9575 {
9576 self.update_time = std::option::Option::Some(v.into());
9577 self
9578 }
9579
9580 /// Sets or clears the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9585 /// use wkt::Timestamp;
9586 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9587 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(None::<Timestamp>);
9588 /// ```
9589 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9590 where
9591 T: std::convert::Into<wkt::Timestamp>,
9592 {
9593 self.update_time = v.map(|x| x.into());
9594 self
9595 }
9596
9597 /// Sets the value of [labels][crate::model::FirewallEndpointAssociation::labels].
9598 ///
9599 /// # Example
9600 /// ```ignore,no_run
9601 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9602 /// let x = FirewallEndpointAssociation::new().set_labels([
9603 /// ("key0", "abc"),
9604 /// ("key1", "xyz"),
9605 /// ]);
9606 /// ```
9607 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9608 where
9609 T: std::iter::IntoIterator<Item = (K, V)>,
9610 K: std::convert::Into<std::string::String>,
9611 V: std::convert::Into<std::string::String>,
9612 {
9613 use std::iter::Iterator;
9614 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9615 self
9616 }
9617
9618 /// Sets the value of [state][crate::model::FirewallEndpointAssociation::state].
9619 ///
9620 /// # Example
9621 /// ```ignore,no_run
9622 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9623 /// use google_cloud_networksecurity_v1::model::firewall_endpoint_association::State;
9624 /// let x0 = FirewallEndpointAssociation::new().set_state(State::Creating);
9625 /// let x1 = FirewallEndpointAssociation::new().set_state(State::Active);
9626 /// let x2 = FirewallEndpointAssociation::new().set_state(State::Deleting);
9627 /// ```
9628 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint_association::State>>(
9629 mut self,
9630 v: T,
9631 ) -> Self {
9632 self.state = v.into();
9633 self
9634 }
9635
9636 /// Sets the value of [network][crate::model::FirewallEndpointAssociation::network].
9637 ///
9638 /// # Example
9639 /// ```ignore,no_run
9640 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9641 /// let x = FirewallEndpointAssociation::new().set_network("example");
9642 /// ```
9643 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9644 self.network = v.into();
9645 self
9646 }
9647
9648 /// Sets the value of [firewall_endpoint][crate::model::FirewallEndpointAssociation::firewall_endpoint].
9649 ///
9650 /// # Example
9651 /// ```ignore,no_run
9652 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9653 /// let x = FirewallEndpointAssociation::new().set_firewall_endpoint("example");
9654 /// ```
9655 pub fn set_firewall_endpoint<T: std::convert::Into<std::string::String>>(
9656 mut self,
9657 v: T,
9658 ) -> Self {
9659 self.firewall_endpoint = v.into();
9660 self
9661 }
9662
9663 /// Sets the value of [tls_inspection_policy][crate::model::FirewallEndpointAssociation::tls_inspection_policy].
9664 ///
9665 /// # Example
9666 /// ```ignore,no_run
9667 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9668 /// let x = FirewallEndpointAssociation::new().set_tls_inspection_policy("example");
9669 /// ```
9670 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
9671 mut self,
9672 v: T,
9673 ) -> Self {
9674 self.tls_inspection_policy = v.into();
9675 self
9676 }
9677
9678 /// Sets the value of [reconciling][crate::model::FirewallEndpointAssociation::reconciling].
9679 ///
9680 /// # Example
9681 /// ```ignore,no_run
9682 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9683 /// let x = FirewallEndpointAssociation::new().set_reconciling(true);
9684 /// ```
9685 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9686 self.reconciling = v.into();
9687 self
9688 }
9689
9690 /// Sets the value of [disabled][crate::model::FirewallEndpointAssociation::disabled].
9691 ///
9692 /// # Example
9693 /// ```ignore,no_run
9694 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9695 /// let x = FirewallEndpointAssociation::new().set_disabled(true);
9696 /// ```
9697 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9698 self.disabled = v.into();
9699 self
9700 }
9701}
9702
9703impl wkt::message::Message for FirewallEndpointAssociation {
9704 fn typename() -> &'static str {
9705 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpointAssociation"
9706 }
9707}
9708
9709/// Defines additional types related to [FirewallEndpointAssociation].
9710pub mod firewall_endpoint_association {
9711 #[allow(unused_imports)]
9712 use super::*;
9713
9714 /// Association state.
9715 ///
9716 /// # Working with unknown values
9717 ///
9718 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9719 /// additional enum variants at any time. Adding new variants is not considered
9720 /// a breaking change. Applications should write their code in anticipation of:
9721 ///
9722 /// - New values appearing in future releases of the client library, **and**
9723 /// - New values received dynamically, without application changes.
9724 ///
9725 /// Please consult the [Working with enums] section in the user guide for some
9726 /// guidelines.
9727 ///
9728 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9729 #[derive(Clone, Debug, PartialEq)]
9730 #[non_exhaustive]
9731 pub enum State {
9732 /// Not set.
9733 Unspecified,
9734 /// Being created.
9735 Creating,
9736 /// Active and ready for traffic.
9737 Active,
9738 /// Being deleted.
9739 Deleting,
9740 /// Down or in an error state.
9741 Inactive,
9742 /// The project that housed the association has been deleted.
9743 Orphan,
9744 /// If set, the enum was initialized with an unknown value.
9745 ///
9746 /// Applications can examine the value using [State::value] or
9747 /// [State::name].
9748 UnknownValue(state::UnknownValue),
9749 }
9750
9751 #[doc(hidden)]
9752 pub mod state {
9753 #[allow(unused_imports)]
9754 use super::*;
9755 #[derive(Clone, Debug, PartialEq)]
9756 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9757 }
9758
9759 impl State {
9760 /// Gets the enum value.
9761 ///
9762 /// Returns `None` if the enum contains an unknown value deserialized from
9763 /// the string representation of enums.
9764 pub fn value(&self) -> std::option::Option<i32> {
9765 match self {
9766 Self::Unspecified => std::option::Option::Some(0),
9767 Self::Creating => std::option::Option::Some(1),
9768 Self::Active => std::option::Option::Some(2),
9769 Self::Deleting => std::option::Option::Some(3),
9770 Self::Inactive => std::option::Option::Some(4),
9771 Self::Orphan => std::option::Option::Some(5),
9772 Self::UnknownValue(u) => u.0.value(),
9773 }
9774 }
9775
9776 /// Gets the enum value as a string.
9777 ///
9778 /// Returns `None` if the enum contains an unknown value deserialized from
9779 /// the integer representation of enums.
9780 pub fn name(&self) -> std::option::Option<&str> {
9781 match self {
9782 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9783 Self::Creating => std::option::Option::Some("CREATING"),
9784 Self::Active => std::option::Option::Some("ACTIVE"),
9785 Self::Deleting => std::option::Option::Some("DELETING"),
9786 Self::Inactive => std::option::Option::Some("INACTIVE"),
9787 Self::Orphan => std::option::Option::Some("ORPHAN"),
9788 Self::UnknownValue(u) => u.0.name(),
9789 }
9790 }
9791 }
9792
9793 impl std::default::Default for State {
9794 fn default() -> Self {
9795 use std::convert::From;
9796 Self::from(0)
9797 }
9798 }
9799
9800 impl std::fmt::Display for State {
9801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9802 wkt::internal::display_enum(f, self.name(), self.value())
9803 }
9804 }
9805
9806 impl std::convert::From<i32> for State {
9807 fn from(value: i32) -> Self {
9808 match value {
9809 0 => Self::Unspecified,
9810 1 => Self::Creating,
9811 2 => Self::Active,
9812 3 => Self::Deleting,
9813 4 => Self::Inactive,
9814 5 => Self::Orphan,
9815 _ => Self::UnknownValue(state::UnknownValue(
9816 wkt::internal::UnknownEnumValue::Integer(value),
9817 )),
9818 }
9819 }
9820 }
9821
9822 impl std::convert::From<&str> for State {
9823 fn from(value: &str) -> Self {
9824 use std::string::ToString;
9825 match value {
9826 "STATE_UNSPECIFIED" => Self::Unspecified,
9827 "CREATING" => Self::Creating,
9828 "ACTIVE" => Self::Active,
9829 "DELETING" => Self::Deleting,
9830 "INACTIVE" => Self::Inactive,
9831 "ORPHAN" => Self::Orphan,
9832 _ => Self::UnknownValue(state::UnknownValue(
9833 wkt::internal::UnknownEnumValue::String(value.to_string()),
9834 )),
9835 }
9836 }
9837 }
9838
9839 impl serde::ser::Serialize for State {
9840 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9841 where
9842 S: serde::Serializer,
9843 {
9844 match self {
9845 Self::Unspecified => serializer.serialize_i32(0),
9846 Self::Creating => serializer.serialize_i32(1),
9847 Self::Active => serializer.serialize_i32(2),
9848 Self::Deleting => serializer.serialize_i32(3),
9849 Self::Inactive => serializer.serialize_i32(4),
9850 Self::Orphan => serializer.serialize_i32(5),
9851 Self::UnknownValue(u) => u.0.serialize(serializer),
9852 }
9853 }
9854 }
9855
9856 impl<'de> serde::de::Deserialize<'de> for State {
9857 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9858 where
9859 D: serde::Deserializer<'de>,
9860 {
9861 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9862 ".google.cloud.networksecurity.v1.FirewallEndpointAssociation.State",
9863 ))
9864 }
9865 }
9866}
9867
9868/// Message for requesting list of Associations
9869#[derive(Clone, Default, PartialEq)]
9870#[non_exhaustive]
9871pub struct ListFirewallEndpointAssociationsRequest {
9872 /// Required. Parent value for ListAssociationsRequest
9873 pub parent: std::string::String,
9874
9875 /// Optional. Requested page size. Server may return fewer items than
9876 /// requested. If unspecified, server will pick an appropriate default.
9877 pub page_size: i32,
9878
9879 /// A token identifying a page of results the server should return.
9880 pub page_token: std::string::String,
9881
9882 /// Optional. Filtering results
9883 pub filter: std::string::String,
9884
9885 /// Hint for how to order the results
9886 pub order_by: std::string::String,
9887
9888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9889}
9890
9891impl ListFirewallEndpointAssociationsRequest {
9892 /// Creates a new default instance.
9893 pub fn new() -> Self {
9894 std::default::Default::default()
9895 }
9896
9897 /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
9898 ///
9899 /// # Example
9900 /// ```ignore,no_run
9901 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9902 /// let x = ListFirewallEndpointAssociationsRequest::new().set_parent("example");
9903 /// ```
9904 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9905 self.parent = v.into();
9906 self
9907 }
9908
9909 /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
9910 ///
9911 /// # Example
9912 /// ```ignore,no_run
9913 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9914 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_size(42);
9915 /// ```
9916 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9917 self.page_size = v.into();
9918 self
9919 }
9920
9921 /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
9922 ///
9923 /// # Example
9924 /// ```ignore,no_run
9925 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9926 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_token("example");
9927 /// ```
9928 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929 self.page_token = v.into();
9930 self
9931 }
9932
9933 /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
9934 ///
9935 /// # Example
9936 /// ```ignore,no_run
9937 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9938 /// let x = ListFirewallEndpointAssociationsRequest::new().set_filter("example");
9939 /// ```
9940 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9941 self.filter = v.into();
9942 self
9943 }
9944
9945 /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
9946 ///
9947 /// # Example
9948 /// ```ignore,no_run
9949 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9950 /// let x = ListFirewallEndpointAssociationsRequest::new().set_order_by("example");
9951 /// ```
9952 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9953 self.order_by = v.into();
9954 self
9955 }
9956}
9957
9958impl wkt::message::Message for ListFirewallEndpointAssociationsRequest {
9959 fn typename() -> &'static str {
9960 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest"
9961 }
9962}
9963
9964/// Message for response to listing Associations
9965#[derive(Clone, Default, PartialEq)]
9966#[non_exhaustive]
9967pub struct ListFirewallEndpointAssociationsResponse {
9968 /// The list of Association
9969 pub firewall_endpoint_associations: std::vec::Vec<crate::model::FirewallEndpointAssociation>,
9970
9971 /// A token identifying a page of results the server should return.
9972 pub next_page_token: std::string::String,
9973
9974 /// Locations that could not be reached.
9975 pub unreachable: std::vec::Vec<std::string::String>,
9976
9977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9978}
9979
9980impl ListFirewallEndpointAssociationsResponse {
9981 /// Creates a new default instance.
9982 pub fn new() -> Self {
9983 std::default::Default::default()
9984 }
9985
9986 /// Sets the value of [firewall_endpoint_associations][crate::model::ListFirewallEndpointAssociationsResponse::firewall_endpoint_associations].
9987 ///
9988 /// # Example
9989 /// ```ignore,no_run
9990 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
9991 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9992 /// let x = ListFirewallEndpointAssociationsResponse::new()
9993 /// .set_firewall_endpoint_associations([
9994 /// FirewallEndpointAssociation::default()/* use setters */,
9995 /// FirewallEndpointAssociation::default()/* use (different) setters */,
9996 /// ]);
9997 /// ```
9998 pub fn set_firewall_endpoint_associations<T, V>(mut self, v: T) -> Self
9999 where
10000 T: std::iter::IntoIterator<Item = V>,
10001 V: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10002 {
10003 use std::iter::Iterator;
10004 self.firewall_endpoint_associations = v.into_iter().map(|i| i.into()).collect();
10005 self
10006 }
10007
10008 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointAssociationsResponse::next_page_token].
10009 ///
10010 /// # Example
10011 /// ```ignore,no_run
10012 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10013 /// let x = ListFirewallEndpointAssociationsResponse::new().set_next_page_token("example");
10014 /// ```
10015 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10016 self.next_page_token = v.into();
10017 self
10018 }
10019
10020 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointAssociationsResponse::unreachable].
10021 ///
10022 /// # Example
10023 /// ```ignore,no_run
10024 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10025 /// let x = ListFirewallEndpointAssociationsResponse::new().set_unreachable(["a", "b", "c"]);
10026 /// ```
10027 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10028 where
10029 T: std::iter::IntoIterator<Item = V>,
10030 V: std::convert::Into<std::string::String>,
10031 {
10032 use std::iter::Iterator;
10033 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10034 self
10035 }
10036}
10037
10038impl wkt::message::Message for ListFirewallEndpointAssociationsResponse {
10039 fn typename() -> &'static str {
10040 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse"
10041 }
10042}
10043
10044#[doc(hidden)]
10045impl google_cloud_gax::paginator::internal::PageableResponse
10046 for ListFirewallEndpointAssociationsResponse
10047{
10048 type PageItem = crate::model::FirewallEndpointAssociation;
10049
10050 fn items(self) -> std::vec::Vec<Self::PageItem> {
10051 self.firewall_endpoint_associations
10052 }
10053
10054 fn next_page_token(&self) -> std::string::String {
10055 use std::clone::Clone;
10056 self.next_page_token.clone()
10057 }
10058}
10059
10060/// Message for getting a Association
10061#[derive(Clone, Default, PartialEq)]
10062#[non_exhaustive]
10063pub struct GetFirewallEndpointAssociationRequest {
10064 /// Required. Name of the resource
10065 pub name: std::string::String,
10066
10067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10068}
10069
10070impl GetFirewallEndpointAssociationRequest {
10071 /// Creates a new default instance.
10072 pub fn new() -> Self {
10073 std::default::Default::default()
10074 }
10075
10076 /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
10077 ///
10078 /// # Example
10079 /// ```ignore,no_run
10080 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointAssociationRequest;
10081 /// let x = GetFirewallEndpointAssociationRequest::new().set_name("example");
10082 /// ```
10083 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10084 self.name = v.into();
10085 self
10086 }
10087}
10088
10089impl wkt::message::Message for GetFirewallEndpointAssociationRequest {
10090 fn typename() -> &'static str {
10091 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest"
10092 }
10093}
10094
10095/// Message for creating a Association
10096#[derive(Clone, Default, PartialEq)]
10097#[non_exhaustive]
10098pub struct CreateFirewallEndpointAssociationRequest {
10099 /// Required. Value for parent.
10100 pub parent: std::string::String,
10101
10102 /// Optional. Id of the requesting object.
10103 /// If auto-generating Id server-side, remove this field and
10104 /// firewall_endpoint_association_id from the method_signature of Create RPC.
10105 pub firewall_endpoint_association_id: std::string::String,
10106
10107 /// Required. The resource being created
10108 pub firewall_endpoint_association:
10109 std::option::Option<crate::model::FirewallEndpointAssociation>,
10110
10111 /// Optional. An optional request ID to identify requests. Specify a unique
10112 /// request ID so that if you must retry your request, the server will know to
10113 /// ignore the request if it has already been completed. The server will
10114 /// guarantee that for at least 60 minutes since the first request.
10115 ///
10116 /// For example, consider a situation where you make an initial request and
10117 /// the request times out. If you make the request again with the same request
10118 /// ID, the server can check if original operation with the same request ID
10119 /// was received, and if so, will ignore the second request. This prevents
10120 /// clients from accidentally creating duplicate commitments.
10121 ///
10122 /// The request ID must be a valid UUID with the exception that zero UUID is
10123 /// not supported (00000000-0000-0000-0000-000000000000).
10124 pub request_id: std::string::String,
10125
10126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10127}
10128
10129impl CreateFirewallEndpointAssociationRequest {
10130 /// Creates a new default instance.
10131 pub fn new() -> Self {
10132 std::default::Default::default()
10133 }
10134
10135 /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
10136 ///
10137 /// # Example
10138 /// ```ignore,no_run
10139 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10140 /// let x = CreateFirewallEndpointAssociationRequest::new().set_parent("example");
10141 /// ```
10142 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10143 self.parent = v.into();
10144 self
10145 }
10146
10147 /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
10148 ///
10149 /// # Example
10150 /// ```ignore,no_run
10151 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10152 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association_id("example");
10153 /// ```
10154 pub fn set_firewall_endpoint_association_id<T: std::convert::Into<std::string::String>>(
10155 mut self,
10156 v: T,
10157 ) -> Self {
10158 self.firewall_endpoint_association_id = v.into();
10159 self
10160 }
10161
10162 /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10163 ///
10164 /// # Example
10165 /// ```ignore,no_run
10166 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10167 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10168 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10169 /// ```
10170 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10171 where
10172 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10173 {
10174 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10175 self
10176 }
10177
10178 /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10179 ///
10180 /// # Example
10181 /// ```ignore,no_run
10182 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10183 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10184 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10185 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10186 /// ```
10187 pub fn set_or_clear_firewall_endpoint_association<T>(
10188 mut self,
10189 v: std::option::Option<T>,
10190 ) -> Self
10191 where
10192 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10193 {
10194 self.firewall_endpoint_association = v.map(|x| x.into());
10195 self
10196 }
10197
10198 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
10199 ///
10200 /// # Example
10201 /// ```ignore,no_run
10202 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10203 /// let x = CreateFirewallEndpointAssociationRequest::new().set_request_id("example");
10204 /// ```
10205 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10206 self.request_id = v.into();
10207 self
10208 }
10209}
10210
10211impl wkt::message::Message for CreateFirewallEndpointAssociationRequest {
10212 fn typename() -> &'static str {
10213 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest"
10214 }
10215}
10216
10217/// Message for deleting a Association
10218#[derive(Clone, Default, PartialEq)]
10219#[non_exhaustive]
10220pub struct DeleteFirewallEndpointAssociationRequest {
10221 /// Required. Name of the resource
10222 pub name: std::string::String,
10223
10224 /// Optional. An optional request ID to identify requests. Specify a unique
10225 /// request ID so that if you must retry your request, the server will know to
10226 /// ignore the request if it has already been completed. The server will
10227 /// guarantee that for at least 60 minutes after the first request.
10228 ///
10229 /// For example, consider a situation where you make an initial request and
10230 /// the request times out. If you make the request again with the same request
10231 /// ID, the server can check if original operation with the same request ID
10232 /// was received, and if so, will ignore the second request. This prevents
10233 /// clients from accidentally creating duplicate commitments.
10234 ///
10235 /// The request ID must be a valid UUID with the exception that zero UUID is
10236 /// not supported (00000000-0000-0000-0000-000000000000).
10237 pub request_id: std::string::String,
10238
10239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10240}
10241
10242impl DeleteFirewallEndpointAssociationRequest {
10243 /// Creates a new default instance.
10244 pub fn new() -> Self {
10245 std::default::Default::default()
10246 }
10247
10248 /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
10249 ///
10250 /// # Example
10251 /// ```ignore,no_run
10252 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10253 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_name("example");
10254 /// ```
10255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10256 self.name = v.into();
10257 self
10258 }
10259
10260 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
10261 ///
10262 /// # Example
10263 /// ```ignore,no_run
10264 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10265 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_request_id("example");
10266 /// ```
10267 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10268 self.request_id = v.into();
10269 self
10270 }
10271}
10272
10273impl wkt::message::Message for DeleteFirewallEndpointAssociationRequest {
10274 fn typename() -> &'static str {
10275 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest"
10276 }
10277}
10278
10279/// Message for updating an Association
10280#[derive(Clone, Default, PartialEq)]
10281#[non_exhaustive]
10282pub struct UpdateFirewallEndpointAssociationRequest {
10283 /// Required. Field mask is used to specify the fields to be overwritten in the
10284 /// Association resource by the update.
10285 /// The fields specified in the update_mask are relative to the resource, not
10286 /// the full request. A field will be overwritten if it is in the mask. If the
10287 /// user does not provide a mask then all fields will be overwritten.
10288 pub update_mask: std::option::Option<wkt::FieldMask>,
10289
10290 /// Required. The resource being updated
10291 pub firewall_endpoint_association:
10292 std::option::Option<crate::model::FirewallEndpointAssociation>,
10293
10294 /// Optional. An optional request ID to identify requests. Specify a unique
10295 /// request ID so that if you must retry your request, the server will know to
10296 /// ignore the request if it has already been completed. The server will
10297 /// guarantee that for at least 60 minutes since the first request.
10298 ///
10299 /// For example, consider a situation where you make an initial request and
10300 /// the request times out. If you make the request again with the same request
10301 /// ID, the server can check if original operation with the same request ID
10302 /// was received, and if so, will ignore the second request. This prevents
10303 /// clients from accidentally creating duplicate commitments.
10304 ///
10305 /// The request ID must be a valid UUID with the exception that zero UUID is
10306 /// not supported (00000000-0000-0000-0000-000000000000).
10307 pub request_id: std::string::String,
10308
10309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10310}
10311
10312impl UpdateFirewallEndpointAssociationRequest {
10313 /// Creates a new default instance.
10314 pub fn new() -> Self {
10315 std::default::Default::default()
10316 }
10317
10318 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10319 ///
10320 /// # Example
10321 /// ```ignore,no_run
10322 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10323 /// use wkt::FieldMask;
10324 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10325 /// ```
10326 pub fn set_update_mask<T>(mut self, v: T) -> Self
10327 where
10328 T: std::convert::Into<wkt::FieldMask>,
10329 {
10330 self.update_mask = std::option::Option::Some(v.into());
10331 self
10332 }
10333
10334 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10335 ///
10336 /// # Example
10337 /// ```ignore,no_run
10338 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10339 /// use wkt::FieldMask;
10340 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10341 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10342 /// ```
10343 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10344 where
10345 T: std::convert::Into<wkt::FieldMask>,
10346 {
10347 self.update_mask = v.map(|x| x.into());
10348 self
10349 }
10350
10351 /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10352 ///
10353 /// # Example
10354 /// ```ignore,no_run
10355 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10356 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10357 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10358 /// ```
10359 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10360 where
10361 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10362 {
10363 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10364 self
10365 }
10366
10367 /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10368 ///
10369 /// # Example
10370 /// ```ignore,no_run
10371 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10372 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10373 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10374 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10375 /// ```
10376 pub fn set_or_clear_firewall_endpoint_association<T>(
10377 mut self,
10378 v: std::option::Option<T>,
10379 ) -> Self
10380 where
10381 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10382 {
10383 self.firewall_endpoint_association = v.map(|x| x.into());
10384 self
10385 }
10386
10387 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
10388 ///
10389 /// # Example
10390 /// ```ignore,no_run
10391 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10392 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_request_id("example");
10393 /// ```
10394 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10395 self.request_id = v.into();
10396 self
10397 }
10398}
10399
10400impl wkt::message::Message for UpdateFirewallEndpointAssociationRequest {
10401 fn typename() -> &'static str {
10402 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest"
10403 }
10404}
10405
10406/// The GatewaySecurityPolicy resource contains a collection of
10407/// GatewaySecurityPolicyRules and associated metadata.
10408#[derive(Clone, Default, PartialEq)]
10409#[non_exhaustive]
10410pub struct GatewaySecurityPolicy {
10411 /// Required. Name of the resource. Name is of the form
10412 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}
10413 /// gateway_security_policy should match the
10414 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10415 pub name: std::string::String,
10416
10417 /// Output only. The timestamp when the resource was created.
10418 pub create_time: std::option::Option<wkt::Timestamp>,
10419
10420 /// Output only. The timestamp when the resource was updated.
10421 pub update_time: std::option::Option<wkt::Timestamp>,
10422
10423 /// Optional. Free-text description of the resource.
10424 pub description: std::string::String,
10425
10426 /// Optional. Name of a TLS Inspection Policy resource that defines how TLS
10427 /// inspection will be performed for any rule(s) which enables it.
10428 pub tls_inspection_policy: std::string::String,
10429
10430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10431}
10432
10433impl GatewaySecurityPolicy {
10434 /// Creates a new default instance.
10435 pub fn new() -> Self {
10436 std::default::Default::default()
10437 }
10438
10439 /// Sets the value of [name][crate::model::GatewaySecurityPolicy::name].
10440 ///
10441 /// # Example
10442 /// ```ignore,no_run
10443 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10444 /// let x = GatewaySecurityPolicy::new().set_name("example");
10445 /// ```
10446 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10447 self.name = v.into();
10448 self
10449 }
10450
10451 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10452 ///
10453 /// # Example
10454 /// ```ignore,no_run
10455 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10456 /// use wkt::Timestamp;
10457 /// let x = GatewaySecurityPolicy::new().set_create_time(Timestamp::default()/* use setters */);
10458 /// ```
10459 pub fn set_create_time<T>(mut self, v: T) -> Self
10460 where
10461 T: std::convert::Into<wkt::Timestamp>,
10462 {
10463 self.create_time = std::option::Option::Some(v.into());
10464 self
10465 }
10466
10467 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10468 ///
10469 /// # Example
10470 /// ```ignore,no_run
10471 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10472 /// use wkt::Timestamp;
10473 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10474 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(None::<Timestamp>);
10475 /// ```
10476 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10477 where
10478 T: std::convert::Into<wkt::Timestamp>,
10479 {
10480 self.create_time = v.map(|x| x.into());
10481 self
10482 }
10483
10484 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10485 ///
10486 /// # Example
10487 /// ```ignore,no_run
10488 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10489 /// use wkt::Timestamp;
10490 /// let x = GatewaySecurityPolicy::new().set_update_time(Timestamp::default()/* use setters */);
10491 /// ```
10492 pub fn set_update_time<T>(mut self, v: T) -> Self
10493 where
10494 T: std::convert::Into<wkt::Timestamp>,
10495 {
10496 self.update_time = std::option::Option::Some(v.into());
10497 self
10498 }
10499
10500 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10501 ///
10502 /// # Example
10503 /// ```ignore,no_run
10504 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10505 /// use wkt::Timestamp;
10506 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10507 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(None::<Timestamp>);
10508 /// ```
10509 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10510 where
10511 T: std::convert::Into<wkt::Timestamp>,
10512 {
10513 self.update_time = v.map(|x| x.into());
10514 self
10515 }
10516
10517 /// Sets the value of [description][crate::model::GatewaySecurityPolicy::description].
10518 ///
10519 /// # Example
10520 /// ```ignore,no_run
10521 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10522 /// let x = GatewaySecurityPolicy::new().set_description("example");
10523 /// ```
10524 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10525 self.description = v.into();
10526 self
10527 }
10528
10529 /// Sets the value of [tls_inspection_policy][crate::model::GatewaySecurityPolicy::tls_inspection_policy].
10530 ///
10531 /// # Example
10532 /// ```ignore,no_run
10533 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10534 /// let x = GatewaySecurityPolicy::new().set_tls_inspection_policy("example");
10535 /// ```
10536 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
10537 mut self,
10538 v: T,
10539 ) -> Self {
10540 self.tls_inspection_policy = v.into();
10541 self
10542 }
10543}
10544
10545impl wkt::message::Message for GatewaySecurityPolicy {
10546 fn typename() -> &'static str {
10547 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicy"
10548 }
10549}
10550
10551/// Request used by the CreateGatewaySecurityPolicy method.
10552#[derive(Clone, Default, PartialEq)]
10553#[non_exhaustive]
10554pub struct CreateGatewaySecurityPolicyRequest {
10555 /// Required. The parent resource of the GatewaySecurityPolicy. Must be in the
10556 /// format `projects/{project}/locations/{location}`.
10557 pub parent: std::string::String,
10558
10559 /// Required. Short name of the GatewaySecurityPolicy resource to be created.
10560 /// This value should be 1-63 characters long, containing only
10561 /// letters, numbers, hyphens, and underscores, and should not start
10562 /// with a number. E.g. "gateway_security_policy1".
10563 pub gateway_security_policy_id: std::string::String,
10564
10565 /// Required. GatewaySecurityPolicy resource to be created.
10566 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10567
10568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10569}
10570
10571impl CreateGatewaySecurityPolicyRequest {
10572 /// Creates a new default instance.
10573 pub fn new() -> Self {
10574 std::default::Default::default()
10575 }
10576
10577 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
10578 ///
10579 /// # Example
10580 /// ```ignore,no_run
10581 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10582 /// let x = CreateGatewaySecurityPolicyRequest::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 [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
10590 ///
10591 /// # Example
10592 /// ```ignore,no_run
10593 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10594 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy_id("example");
10595 /// ```
10596 pub fn set_gateway_security_policy_id<T: std::convert::Into<std::string::String>>(
10597 mut self,
10598 v: T,
10599 ) -> Self {
10600 self.gateway_security_policy_id = v.into();
10601 self
10602 }
10603
10604 /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10605 ///
10606 /// # Example
10607 /// ```ignore,no_run
10608 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10609 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10610 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10611 /// ```
10612 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10613 where
10614 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10615 {
10616 self.gateway_security_policy = std::option::Option::Some(v.into());
10617 self
10618 }
10619
10620 /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10625 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10626 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10627 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10628 /// ```
10629 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10630 where
10631 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10632 {
10633 self.gateway_security_policy = v.map(|x| x.into());
10634 self
10635 }
10636}
10637
10638impl wkt::message::Message for CreateGatewaySecurityPolicyRequest {
10639 fn typename() -> &'static str {
10640 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest"
10641 }
10642}
10643
10644/// Request used with the ListGatewaySecurityPolicies method.
10645#[derive(Clone, Default, PartialEq)]
10646#[non_exhaustive]
10647pub struct ListGatewaySecurityPoliciesRequest {
10648 /// Required. The project and location from which the GatewaySecurityPolicies
10649 /// should be listed, specified in the format
10650 /// `projects/{project}/locations/{location}`.
10651 pub parent: std::string::String,
10652
10653 /// Maximum number of GatewaySecurityPolicies to return per call.
10654 pub page_size: i32,
10655
10656 /// The value returned by the last
10657 /// 'ListGatewaySecurityPoliciesResponse' Indicates that this is a
10658 /// continuation of a prior 'ListGatewaySecurityPolicies' call, and
10659 /// that the system should return the next page of data.
10660 pub page_token: std::string::String,
10661
10662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10663}
10664
10665impl ListGatewaySecurityPoliciesRequest {
10666 /// Creates a new default instance.
10667 pub fn new() -> Self {
10668 std::default::Default::default()
10669 }
10670
10671 /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
10672 ///
10673 /// # Example
10674 /// ```ignore,no_run
10675 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10676 /// let x = ListGatewaySecurityPoliciesRequest::new().set_parent("example");
10677 /// ```
10678 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10679 self.parent = v.into();
10680 self
10681 }
10682
10683 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
10684 ///
10685 /// # Example
10686 /// ```ignore,no_run
10687 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10688 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_size(42);
10689 /// ```
10690 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10691 self.page_size = v.into();
10692 self
10693 }
10694
10695 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
10696 ///
10697 /// # Example
10698 /// ```ignore,no_run
10699 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10700 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_token("example");
10701 /// ```
10702 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10703 self.page_token = v.into();
10704 self
10705 }
10706}
10707
10708impl wkt::message::Message for ListGatewaySecurityPoliciesRequest {
10709 fn typename() -> &'static str {
10710 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest"
10711 }
10712}
10713
10714/// Response returned by the ListGatewaySecurityPolicies method.
10715#[derive(Clone, Default, PartialEq)]
10716#[non_exhaustive]
10717pub struct ListGatewaySecurityPoliciesResponse {
10718 /// List of GatewaySecurityPolicies resources.
10719 pub gateway_security_policies: std::vec::Vec<crate::model::GatewaySecurityPolicy>,
10720
10721 /// If there might be more results than those appearing in this response, then
10722 /// 'next_page_token' is included. To get the next set of results, call this
10723 /// method again using the value of 'next_page_token' as 'page_token'.
10724 pub next_page_token: std::string::String,
10725
10726 /// Locations that could not be reached.
10727 pub unreachable: std::vec::Vec<std::string::String>,
10728
10729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10730}
10731
10732impl ListGatewaySecurityPoliciesResponse {
10733 /// Creates a new default instance.
10734 pub fn new() -> Self {
10735 std::default::Default::default()
10736 }
10737
10738 /// Sets the value of [gateway_security_policies][crate::model::ListGatewaySecurityPoliciesResponse::gateway_security_policies].
10739 ///
10740 /// # Example
10741 /// ```ignore,no_run
10742 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10743 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10744 /// let x = ListGatewaySecurityPoliciesResponse::new()
10745 /// .set_gateway_security_policies([
10746 /// GatewaySecurityPolicy::default()/* use setters */,
10747 /// GatewaySecurityPolicy::default()/* use (different) setters */,
10748 /// ]);
10749 /// ```
10750 pub fn set_gateway_security_policies<T, V>(mut self, v: T) -> Self
10751 where
10752 T: std::iter::IntoIterator<Item = V>,
10753 V: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10754 {
10755 use std::iter::Iterator;
10756 self.gateway_security_policies = v.into_iter().map(|i| i.into()).collect();
10757 self
10758 }
10759
10760 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPoliciesResponse::next_page_token].
10761 ///
10762 /// # Example
10763 /// ```ignore,no_run
10764 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10765 /// let x = ListGatewaySecurityPoliciesResponse::new().set_next_page_token("example");
10766 /// ```
10767 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10768 self.next_page_token = v.into();
10769 self
10770 }
10771
10772 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPoliciesResponse::unreachable].
10773 ///
10774 /// # Example
10775 /// ```ignore,no_run
10776 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10777 /// let x = ListGatewaySecurityPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10778 /// ```
10779 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10780 where
10781 T: std::iter::IntoIterator<Item = V>,
10782 V: std::convert::Into<std::string::String>,
10783 {
10784 use std::iter::Iterator;
10785 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10786 self
10787 }
10788}
10789
10790impl wkt::message::Message for ListGatewaySecurityPoliciesResponse {
10791 fn typename() -> &'static str {
10792 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse"
10793 }
10794}
10795
10796#[doc(hidden)]
10797impl google_cloud_gax::paginator::internal::PageableResponse
10798 for ListGatewaySecurityPoliciesResponse
10799{
10800 type PageItem = crate::model::GatewaySecurityPolicy;
10801
10802 fn items(self) -> std::vec::Vec<Self::PageItem> {
10803 self.gateway_security_policies
10804 }
10805
10806 fn next_page_token(&self) -> std::string::String {
10807 use std::clone::Clone;
10808 self.next_page_token.clone()
10809 }
10810}
10811
10812/// Request used by the GetGatewaySecurityPolicy method.
10813#[derive(Clone, Default, PartialEq)]
10814#[non_exhaustive]
10815pub struct GetGatewaySecurityPolicyRequest {
10816 /// Required. A name of the GatewaySecurityPolicy to get. Must be in the format
10817 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
10818 pub name: std::string::String,
10819
10820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10821}
10822
10823impl GetGatewaySecurityPolicyRequest {
10824 /// Creates a new default instance.
10825 pub fn new() -> Self {
10826 std::default::Default::default()
10827 }
10828
10829 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
10830 ///
10831 /// # Example
10832 /// ```ignore,no_run
10833 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRequest;
10834 /// let x = GetGatewaySecurityPolicyRequest::new().set_name("example");
10835 /// ```
10836 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10837 self.name = v.into();
10838 self
10839 }
10840}
10841
10842impl wkt::message::Message for GetGatewaySecurityPolicyRequest {
10843 fn typename() -> &'static str {
10844 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest"
10845 }
10846}
10847
10848/// Request used by the DeleteGatewaySecurityPolicy method.
10849#[derive(Clone, Default, PartialEq)]
10850#[non_exhaustive]
10851pub struct DeleteGatewaySecurityPolicyRequest {
10852 /// Required. A name of the GatewaySecurityPolicy to delete. Must be in the
10853 /// format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
10854 pub name: std::string::String,
10855
10856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10857}
10858
10859impl DeleteGatewaySecurityPolicyRequest {
10860 /// Creates a new default instance.
10861 pub fn new() -> Self {
10862 std::default::Default::default()
10863 }
10864
10865 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
10866 ///
10867 /// # Example
10868 /// ```ignore,no_run
10869 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRequest;
10870 /// let x = DeleteGatewaySecurityPolicyRequest::new().set_name("example");
10871 /// ```
10872 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10873 self.name = v.into();
10874 self
10875 }
10876}
10877
10878impl wkt::message::Message for DeleteGatewaySecurityPolicyRequest {
10879 fn typename() -> &'static str {
10880 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest"
10881 }
10882}
10883
10884/// Request used by the UpdateGatewaySecurityPolicy method.
10885#[derive(Clone, Default, PartialEq)]
10886#[non_exhaustive]
10887pub struct UpdateGatewaySecurityPolicyRequest {
10888 /// Optional. Field mask is used to specify the fields to be overwritten in the
10889 /// GatewaySecurityPolicy resource by the update.
10890 /// The fields specified in the update_mask are relative to the resource, not
10891 /// the full request. A field will be overwritten if it is in the mask. If the
10892 /// user does not provide a mask then all fields will be overwritten.
10893 pub update_mask: std::option::Option<wkt::FieldMask>,
10894
10895 /// Required. Updated GatewaySecurityPolicy resource.
10896 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10897
10898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10899}
10900
10901impl UpdateGatewaySecurityPolicyRequest {
10902 /// Creates a new default instance.
10903 pub fn new() -> Self {
10904 std::default::Default::default()
10905 }
10906
10907 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
10908 ///
10909 /// # Example
10910 /// ```ignore,no_run
10911 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10912 /// use wkt::FieldMask;
10913 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10914 /// ```
10915 pub fn set_update_mask<T>(mut self, v: T) -> Self
10916 where
10917 T: std::convert::Into<wkt::FieldMask>,
10918 {
10919 self.update_mask = std::option::Option::Some(v.into());
10920 self
10921 }
10922
10923 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
10924 ///
10925 /// # Example
10926 /// ```ignore,no_run
10927 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10928 /// use wkt::FieldMask;
10929 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10930 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10931 /// ```
10932 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10933 where
10934 T: std::convert::Into<wkt::FieldMask>,
10935 {
10936 self.update_mask = v.map(|x| x.into());
10937 self
10938 }
10939
10940 /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
10941 ///
10942 /// # Example
10943 /// ```ignore,no_run
10944 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10945 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10946 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10947 /// ```
10948 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10949 where
10950 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10951 {
10952 self.gateway_security_policy = std::option::Option::Some(v.into());
10953 self
10954 }
10955
10956 /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
10957 ///
10958 /// # Example
10959 /// ```ignore,no_run
10960 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10961 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10962 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10963 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10964 /// ```
10965 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10966 where
10967 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10968 {
10969 self.gateway_security_policy = v.map(|x| x.into());
10970 self
10971 }
10972}
10973
10974impl wkt::message::Message for UpdateGatewaySecurityPolicyRequest {
10975 fn typename() -> &'static str {
10976 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest"
10977 }
10978}
10979
10980/// The GatewaySecurityPolicyRule resource is in a nested collection within a
10981/// GatewaySecurityPolicy and represents a traffic matching condition and
10982/// associated action to perform.
10983#[derive(Clone, Default, PartialEq)]
10984#[non_exhaustive]
10985pub struct GatewaySecurityPolicyRule {
10986 /// Required. Immutable. Name of the resource. ame is the full resource name so
10987 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}
10988 /// rule should match the
10989 /// pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10990 pub name: std::string::String,
10991
10992 /// Output only. Time when the rule was created.
10993 pub create_time: std::option::Option<wkt::Timestamp>,
10994
10995 /// Output only. Time when the rule was updated.
10996 pub update_time: std::option::Option<wkt::Timestamp>,
10997
10998 /// Required. Whether the rule is enforced.
10999 pub enabled: bool,
11000
11001 /// Required. Priority of the rule.
11002 /// Lower number corresponds to higher precedence.
11003 pub priority: i32,
11004
11005 /// Optional. Free-text description of the resource.
11006 pub description: std::string::String,
11007
11008 /// Required. CEL expression for matching on session criteria.
11009 pub session_matcher: std::string::String,
11010
11011 /// Optional. CEL expression for matching on L7/application level criteria.
11012 pub application_matcher: std::string::String,
11013
11014 /// Optional. Flag to enable TLS inspection of traffic matching on
11015 /// <session_matcher>, can only be true if the parent GatewaySecurityPolicy
11016 /// references a TLSInspectionConfig.
11017 pub tls_inspection_enabled: bool,
11018
11019 #[allow(missing_docs)]
11020 pub profile: std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11021
11022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11023}
11024
11025impl GatewaySecurityPolicyRule {
11026 /// Creates a new default instance.
11027 pub fn new() -> Self {
11028 std::default::Default::default()
11029 }
11030
11031 /// Sets the value of [name][crate::model::GatewaySecurityPolicyRule::name].
11032 ///
11033 /// # Example
11034 /// ```ignore,no_run
11035 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11036 /// let x = GatewaySecurityPolicyRule::new().set_name("example");
11037 /// ```
11038 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11039 self.name = v.into();
11040 self
11041 }
11042
11043 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11044 ///
11045 /// # Example
11046 /// ```ignore,no_run
11047 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11048 /// use wkt::Timestamp;
11049 /// let x = GatewaySecurityPolicyRule::new().set_create_time(Timestamp::default()/* use setters */);
11050 /// ```
11051 pub fn set_create_time<T>(mut self, v: T) -> Self
11052 where
11053 T: std::convert::Into<wkt::Timestamp>,
11054 {
11055 self.create_time = std::option::Option::Some(v.into());
11056 self
11057 }
11058
11059 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11060 ///
11061 /// # Example
11062 /// ```ignore,no_run
11063 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11064 /// use wkt::Timestamp;
11065 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11066 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(None::<Timestamp>);
11067 /// ```
11068 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11069 where
11070 T: std::convert::Into<wkt::Timestamp>,
11071 {
11072 self.create_time = v.map(|x| x.into());
11073 self
11074 }
11075
11076 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11077 ///
11078 /// # Example
11079 /// ```ignore,no_run
11080 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11081 /// use wkt::Timestamp;
11082 /// let x = GatewaySecurityPolicyRule::new().set_update_time(Timestamp::default()/* use setters */);
11083 /// ```
11084 pub fn set_update_time<T>(mut self, v: T) -> Self
11085 where
11086 T: std::convert::Into<wkt::Timestamp>,
11087 {
11088 self.update_time = std::option::Option::Some(v.into());
11089 self
11090 }
11091
11092 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11093 ///
11094 /// # Example
11095 /// ```ignore,no_run
11096 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11097 /// use wkt::Timestamp;
11098 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11099 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(None::<Timestamp>);
11100 /// ```
11101 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11102 where
11103 T: std::convert::Into<wkt::Timestamp>,
11104 {
11105 self.update_time = v.map(|x| x.into());
11106 self
11107 }
11108
11109 /// Sets the value of [enabled][crate::model::GatewaySecurityPolicyRule::enabled].
11110 ///
11111 /// # Example
11112 /// ```ignore,no_run
11113 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11114 /// let x = GatewaySecurityPolicyRule::new().set_enabled(true);
11115 /// ```
11116 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11117 self.enabled = v.into();
11118 self
11119 }
11120
11121 /// Sets the value of [priority][crate::model::GatewaySecurityPolicyRule::priority].
11122 ///
11123 /// # Example
11124 /// ```ignore,no_run
11125 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11126 /// let x = GatewaySecurityPolicyRule::new().set_priority(42);
11127 /// ```
11128 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11129 self.priority = v.into();
11130 self
11131 }
11132
11133 /// Sets the value of [description][crate::model::GatewaySecurityPolicyRule::description].
11134 ///
11135 /// # Example
11136 /// ```ignore,no_run
11137 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11138 /// let x = GatewaySecurityPolicyRule::new().set_description("example");
11139 /// ```
11140 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11141 self.description = v.into();
11142 self
11143 }
11144
11145 /// Sets the value of [session_matcher][crate::model::GatewaySecurityPolicyRule::session_matcher].
11146 ///
11147 /// # Example
11148 /// ```ignore,no_run
11149 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11150 /// let x = GatewaySecurityPolicyRule::new().set_session_matcher("example");
11151 /// ```
11152 pub fn set_session_matcher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11153 self.session_matcher = v.into();
11154 self
11155 }
11156
11157 /// Sets the value of [application_matcher][crate::model::GatewaySecurityPolicyRule::application_matcher].
11158 ///
11159 /// # Example
11160 /// ```ignore,no_run
11161 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11162 /// let x = GatewaySecurityPolicyRule::new().set_application_matcher("example");
11163 /// ```
11164 pub fn set_application_matcher<T: std::convert::Into<std::string::String>>(
11165 mut self,
11166 v: T,
11167 ) -> Self {
11168 self.application_matcher = v.into();
11169 self
11170 }
11171
11172 /// Sets the value of [tls_inspection_enabled][crate::model::GatewaySecurityPolicyRule::tls_inspection_enabled].
11173 ///
11174 /// # Example
11175 /// ```ignore,no_run
11176 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11177 /// let x = GatewaySecurityPolicyRule::new().set_tls_inspection_enabled(true);
11178 /// ```
11179 pub fn set_tls_inspection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11180 self.tls_inspection_enabled = v.into();
11181 self
11182 }
11183
11184 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile].
11185 ///
11186 /// Note that all the setters affecting `profile` are mutually
11187 /// exclusive.
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11192 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11193 /// let x0 = GatewaySecurityPolicyRule::new().set_profile(Some(
11194 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Allow)));
11195 /// let x1 = GatewaySecurityPolicyRule::new().set_profile(Some(
11196 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Deny)));
11197 /// ```
11198 pub fn set_profile<
11199 T: std::convert::Into<
11200 std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11201 >,
11202 >(
11203 mut self,
11204 v: T,
11205 ) -> Self {
11206 self.profile = v.into();
11207 self
11208 }
11209
11210 /// The value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11211 /// if it holds a `BasicProfile`, `None` if the field is not set or
11212 /// holds a different branch.
11213 pub fn basic_profile(
11214 &self,
11215 ) -> std::option::Option<&crate::model::gateway_security_policy_rule::BasicProfile> {
11216 #[allow(unreachable_patterns)]
11217 self.profile.as_ref().and_then(|v| match v {
11218 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v) => {
11219 std::option::Option::Some(v)
11220 }
11221 _ => std::option::Option::None,
11222 })
11223 }
11224
11225 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11226 /// to hold a `BasicProfile`.
11227 ///
11228 /// Note that all the setters affecting `profile` are
11229 /// mutually exclusive.
11230 ///
11231 /// # Example
11232 /// ```ignore,no_run
11233 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11234 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11235 /// let x0 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Allow);
11236 /// let x1 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Deny);
11237 /// assert!(x0.basic_profile().is_some());
11238 /// assert!(x1.basic_profile().is_some());
11239 /// ```
11240 pub fn set_basic_profile<
11241 T: std::convert::Into<crate::model::gateway_security_policy_rule::BasicProfile>,
11242 >(
11243 mut self,
11244 v: T,
11245 ) -> Self {
11246 self.profile = std::option::Option::Some(
11247 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v.into()),
11248 );
11249 self
11250 }
11251}
11252
11253impl wkt::message::Message for GatewaySecurityPolicyRule {
11254 fn typename() -> &'static str {
11255 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicyRule"
11256 }
11257}
11258
11259/// Defines additional types related to [GatewaySecurityPolicyRule].
11260pub mod gateway_security_policy_rule {
11261 #[allow(unused_imports)]
11262 use super::*;
11263
11264 /// enum to define the primitive action.
11265 ///
11266 /// # Working with unknown values
11267 ///
11268 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11269 /// additional enum variants at any time. Adding new variants is not considered
11270 /// a breaking change. Applications should write their code in anticipation of:
11271 ///
11272 /// - New values appearing in future releases of the client library, **and**
11273 /// - New values received dynamically, without application changes.
11274 ///
11275 /// Please consult the [Working with enums] section in the user guide for some
11276 /// guidelines.
11277 ///
11278 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11279 #[derive(Clone, Debug, PartialEq)]
11280 #[non_exhaustive]
11281 pub enum BasicProfile {
11282 /// If there is not a mentioned action for the target.
11283 Unspecified,
11284 /// Allow the matched traffic.
11285 Allow,
11286 /// Deny the matched traffic.
11287 Deny,
11288 /// If set, the enum was initialized with an unknown value.
11289 ///
11290 /// Applications can examine the value using [BasicProfile::value] or
11291 /// [BasicProfile::name].
11292 UnknownValue(basic_profile::UnknownValue),
11293 }
11294
11295 #[doc(hidden)]
11296 pub mod basic_profile {
11297 #[allow(unused_imports)]
11298 use super::*;
11299 #[derive(Clone, Debug, PartialEq)]
11300 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11301 }
11302
11303 impl BasicProfile {
11304 /// Gets the enum value.
11305 ///
11306 /// Returns `None` if the enum contains an unknown value deserialized from
11307 /// the string representation of enums.
11308 pub fn value(&self) -> std::option::Option<i32> {
11309 match self {
11310 Self::Unspecified => std::option::Option::Some(0),
11311 Self::Allow => std::option::Option::Some(1),
11312 Self::Deny => std::option::Option::Some(2),
11313 Self::UnknownValue(u) => u.0.value(),
11314 }
11315 }
11316
11317 /// Gets the enum value as a string.
11318 ///
11319 /// Returns `None` if the enum contains an unknown value deserialized from
11320 /// the integer representation of enums.
11321 pub fn name(&self) -> std::option::Option<&str> {
11322 match self {
11323 Self::Unspecified => std::option::Option::Some("BASIC_PROFILE_UNSPECIFIED"),
11324 Self::Allow => std::option::Option::Some("ALLOW"),
11325 Self::Deny => std::option::Option::Some("DENY"),
11326 Self::UnknownValue(u) => u.0.name(),
11327 }
11328 }
11329 }
11330
11331 impl std::default::Default for BasicProfile {
11332 fn default() -> Self {
11333 use std::convert::From;
11334 Self::from(0)
11335 }
11336 }
11337
11338 impl std::fmt::Display for BasicProfile {
11339 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11340 wkt::internal::display_enum(f, self.name(), self.value())
11341 }
11342 }
11343
11344 impl std::convert::From<i32> for BasicProfile {
11345 fn from(value: i32) -> Self {
11346 match value {
11347 0 => Self::Unspecified,
11348 1 => Self::Allow,
11349 2 => Self::Deny,
11350 _ => Self::UnknownValue(basic_profile::UnknownValue(
11351 wkt::internal::UnknownEnumValue::Integer(value),
11352 )),
11353 }
11354 }
11355 }
11356
11357 impl std::convert::From<&str> for BasicProfile {
11358 fn from(value: &str) -> Self {
11359 use std::string::ToString;
11360 match value {
11361 "BASIC_PROFILE_UNSPECIFIED" => Self::Unspecified,
11362 "ALLOW" => Self::Allow,
11363 "DENY" => Self::Deny,
11364 _ => Self::UnknownValue(basic_profile::UnknownValue(
11365 wkt::internal::UnknownEnumValue::String(value.to_string()),
11366 )),
11367 }
11368 }
11369 }
11370
11371 impl serde::ser::Serialize for BasicProfile {
11372 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11373 where
11374 S: serde::Serializer,
11375 {
11376 match self {
11377 Self::Unspecified => serializer.serialize_i32(0),
11378 Self::Allow => serializer.serialize_i32(1),
11379 Self::Deny => serializer.serialize_i32(2),
11380 Self::UnknownValue(u) => u.0.serialize(serializer),
11381 }
11382 }
11383 }
11384
11385 impl<'de> serde::de::Deserialize<'de> for BasicProfile {
11386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11387 where
11388 D: serde::Deserializer<'de>,
11389 {
11390 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BasicProfile>::new(
11391 ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile",
11392 ))
11393 }
11394 }
11395
11396 #[allow(missing_docs)]
11397 #[derive(Clone, Debug, PartialEq)]
11398 #[non_exhaustive]
11399 pub enum Profile {
11400 /// Required. Profile which tells what the primitive action should be.
11401 BasicProfile(crate::model::gateway_security_policy_rule::BasicProfile),
11402 }
11403}
11404
11405/// Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules.
11406/// Request used by the CreateGatewaySecurityPolicyRule method.
11407#[derive(Clone, Default, PartialEq)]
11408#[non_exhaustive]
11409pub struct CreateGatewaySecurityPolicyRuleRequest {
11410 /// Required. The parent where this rule will be created.
11411 /// Format :
11412 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*
11413 pub parent: std::string::String,
11414
11415 /// Required. The rule to be created.
11416 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11417
11418 /// The ID to use for the rule, which will become the final component of
11419 /// the rule's resource name.
11420 /// This value should be 4-63 characters, and valid characters
11421 /// are /[a-z][0-9]-/.
11422 pub gateway_security_policy_rule_id: std::string::String,
11423
11424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11425}
11426
11427impl CreateGatewaySecurityPolicyRuleRequest {
11428 /// Creates a new default instance.
11429 pub fn new() -> Self {
11430 std::default::Default::default()
11431 }
11432
11433 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
11434 ///
11435 /// # Example
11436 /// ```ignore,no_run
11437 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11438 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_parent("example");
11439 /// ```
11440 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11441 self.parent = v.into();
11442 self
11443 }
11444
11445 /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11446 ///
11447 /// # Example
11448 /// ```ignore,no_run
11449 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11450 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11451 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11452 /// ```
11453 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11454 where
11455 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11456 {
11457 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11458 self
11459 }
11460
11461 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11462 ///
11463 /// # Example
11464 /// ```ignore,no_run
11465 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11466 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11467 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11468 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11469 /// ```
11470 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11471 where
11472 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11473 {
11474 self.gateway_security_policy_rule = v.map(|x| x.into());
11475 self
11476 }
11477
11478 /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
11479 ///
11480 /// # Example
11481 /// ```ignore,no_run
11482 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11483 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule_id("example");
11484 /// ```
11485 pub fn set_gateway_security_policy_rule_id<T: std::convert::Into<std::string::String>>(
11486 mut self,
11487 v: T,
11488 ) -> Self {
11489 self.gateway_security_policy_rule_id = v.into();
11490 self
11491 }
11492}
11493
11494impl wkt::message::Message for CreateGatewaySecurityPolicyRuleRequest {
11495 fn typename() -> &'static str {
11496 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest"
11497 }
11498}
11499
11500/// Request used by the GetGatewaySecurityPolicyRule method.
11501#[derive(Clone, Default, PartialEq)]
11502#[non_exhaustive]
11503pub struct GetGatewaySecurityPolicyRuleRequest {
11504 /// Required. The name of the GatewaySecurityPolicyRule to retrieve.
11505 /// Format:
11506 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
11507 pub name: std::string::String,
11508
11509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11510}
11511
11512impl GetGatewaySecurityPolicyRuleRequest {
11513 /// Creates a new default instance.
11514 pub fn new() -> Self {
11515 std::default::Default::default()
11516 }
11517
11518 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
11519 ///
11520 /// # Example
11521 /// ```ignore,no_run
11522 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRuleRequest;
11523 /// let x = GetGatewaySecurityPolicyRuleRequest::new().set_name("example");
11524 /// ```
11525 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11526 self.name = v.into();
11527 self
11528 }
11529}
11530
11531impl wkt::message::Message for GetGatewaySecurityPolicyRuleRequest {
11532 fn typename() -> &'static str {
11533 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest"
11534 }
11535}
11536
11537/// Request used by the UpdateGatewaySecurityPolicyRule method.
11538#[derive(Clone, Default, PartialEq)]
11539#[non_exhaustive]
11540pub struct UpdateGatewaySecurityPolicyRuleRequest {
11541 /// Optional. Field mask is used to specify the fields to be overwritten in the
11542 /// GatewaySecurityPolicy resource by the update.
11543 /// The fields specified in the update_mask are relative to the resource, not
11544 /// the full request. A field will be overwritten if it is in the mask. If the
11545 /// user does not provide a mask then all fields will be overwritten.
11546 pub update_mask: std::option::Option<wkt::FieldMask>,
11547
11548 /// Required. Updated GatewaySecurityPolicyRule resource.
11549 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11550
11551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11552}
11553
11554impl UpdateGatewaySecurityPolicyRuleRequest {
11555 /// Creates a new default instance.
11556 pub fn new() -> Self {
11557 std::default::Default::default()
11558 }
11559
11560 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11561 ///
11562 /// # Example
11563 /// ```ignore,no_run
11564 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11565 /// use wkt::FieldMask;
11566 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11567 /// ```
11568 pub fn set_update_mask<T>(mut self, v: T) -> Self
11569 where
11570 T: std::convert::Into<wkt::FieldMask>,
11571 {
11572 self.update_mask = std::option::Option::Some(v.into());
11573 self
11574 }
11575
11576 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11577 ///
11578 /// # Example
11579 /// ```ignore,no_run
11580 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11581 /// use wkt::FieldMask;
11582 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11583 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11584 /// ```
11585 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11586 where
11587 T: std::convert::Into<wkt::FieldMask>,
11588 {
11589 self.update_mask = v.map(|x| x.into());
11590 self
11591 }
11592
11593 /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11594 ///
11595 /// # Example
11596 /// ```ignore,no_run
11597 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11598 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11599 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11600 /// ```
11601 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11602 where
11603 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11604 {
11605 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11606 self
11607 }
11608
11609 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11610 ///
11611 /// # Example
11612 /// ```ignore,no_run
11613 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11614 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11615 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11616 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11617 /// ```
11618 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11619 where
11620 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11621 {
11622 self.gateway_security_policy_rule = v.map(|x| x.into());
11623 self
11624 }
11625}
11626
11627impl wkt::message::Message for UpdateGatewaySecurityPolicyRuleRequest {
11628 fn typename() -> &'static str {
11629 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest"
11630 }
11631}
11632
11633/// Request used with the ListGatewaySecurityPolicyRules method.
11634#[derive(Clone, Default, PartialEq)]
11635#[non_exhaustive]
11636pub struct ListGatewaySecurityPolicyRulesRequest {
11637 /// Required. The project, location and GatewaySecurityPolicy from which the
11638 /// GatewaySecurityPolicyRules should be listed, specified in the format
11639 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
11640 pub parent: std::string::String,
11641
11642 /// Maximum number of GatewaySecurityPolicyRules to return per call.
11643 pub page_size: i32,
11644
11645 /// The value returned by the last
11646 /// 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a
11647 /// continuation of a prior 'ListGatewaySecurityPolicyRules' call, and
11648 /// that the system should return the next page of data.
11649 pub page_token: std::string::String,
11650
11651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11652}
11653
11654impl ListGatewaySecurityPolicyRulesRequest {
11655 /// Creates a new default instance.
11656 pub fn new() -> Self {
11657 std::default::Default::default()
11658 }
11659
11660 /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
11661 ///
11662 /// # Example
11663 /// ```ignore,no_run
11664 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11665 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_parent("example");
11666 /// ```
11667 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11668 self.parent = v.into();
11669 self
11670 }
11671
11672 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
11673 ///
11674 /// # Example
11675 /// ```ignore,no_run
11676 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11677 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_size(42);
11678 /// ```
11679 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11680 self.page_size = v.into();
11681 self
11682 }
11683
11684 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
11685 ///
11686 /// # Example
11687 /// ```ignore,no_run
11688 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11689 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_token("example");
11690 /// ```
11691 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11692 self.page_token = v.into();
11693 self
11694 }
11695}
11696
11697impl wkt::message::Message for ListGatewaySecurityPolicyRulesRequest {
11698 fn typename() -> &'static str {
11699 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest"
11700 }
11701}
11702
11703/// Response returned by the ListGatewaySecurityPolicyRules method.
11704#[derive(Clone, Default, PartialEq)]
11705#[non_exhaustive]
11706pub struct ListGatewaySecurityPolicyRulesResponse {
11707 /// List of GatewaySecurityPolicyRule resources.
11708 pub gateway_security_policy_rules: std::vec::Vec<crate::model::GatewaySecurityPolicyRule>,
11709
11710 /// If there might be more results than those appearing in this response, then
11711 /// 'next_page_token' is included. To get the next set of results, call this
11712 /// method again using the value of 'next_page_token' as 'page_token'.
11713 pub next_page_token: std::string::String,
11714
11715 /// Locations that could not be reached.
11716 pub unreachable: std::vec::Vec<std::string::String>,
11717
11718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11719}
11720
11721impl ListGatewaySecurityPolicyRulesResponse {
11722 /// Creates a new default instance.
11723 pub fn new() -> Self {
11724 std::default::Default::default()
11725 }
11726
11727 /// Sets the value of [gateway_security_policy_rules][crate::model::ListGatewaySecurityPolicyRulesResponse::gateway_security_policy_rules].
11728 ///
11729 /// # Example
11730 /// ```ignore,no_run
11731 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11732 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11733 /// let x = ListGatewaySecurityPolicyRulesResponse::new()
11734 /// .set_gateway_security_policy_rules([
11735 /// GatewaySecurityPolicyRule::default()/* use setters */,
11736 /// GatewaySecurityPolicyRule::default()/* use (different) setters */,
11737 /// ]);
11738 /// ```
11739 pub fn set_gateway_security_policy_rules<T, V>(mut self, v: T) -> Self
11740 where
11741 T: std::iter::IntoIterator<Item = V>,
11742 V: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11743 {
11744 use std::iter::Iterator;
11745 self.gateway_security_policy_rules = v.into_iter().map(|i| i.into()).collect();
11746 self
11747 }
11748
11749 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPolicyRulesResponse::next_page_token].
11750 ///
11751 /// # Example
11752 /// ```ignore,no_run
11753 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11754 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_next_page_token("example");
11755 /// ```
11756 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11757 self.next_page_token = v.into();
11758 self
11759 }
11760
11761 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPolicyRulesResponse::unreachable].
11762 ///
11763 /// # Example
11764 /// ```ignore,no_run
11765 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11766 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_unreachable(["a", "b", "c"]);
11767 /// ```
11768 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11769 where
11770 T: std::iter::IntoIterator<Item = V>,
11771 V: std::convert::Into<std::string::String>,
11772 {
11773 use std::iter::Iterator;
11774 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11775 self
11776 }
11777}
11778
11779impl wkt::message::Message for ListGatewaySecurityPolicyRulesResponse {
11780 fn typename() -> &'static str {
11781 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse"
11782 }
11783}
11784
11785#[doc(hidden)]
11786impl google_cloud_gax::paginator::internal::PageableResponse
11787 for ListGatewaySecurityPolicyRulesResponse
11788{
11789 type PageItem = crate::model::GatewaySecurityPolicyRule;
11790
11791 fn items(self) -> std::vec::Vec<Self::PageItem> {
11792 self.gateway_security_policy_rules
11793 }
11794
11795 fn next_page_token(&self) -> std::string::String {
11796 use std::clone::Clone;
11797 self.next_page_token.clone()
11798 }
11799}
11800
11801/// Request used by the DeleteGatewaySecurityPolicyRule method.
11802#[derive(Clone, Default, PartialEq)]
11803#[non_exhaustive]
11804pub struct DeleteGatewaySecurityPolicyRuleRequest {
11805 /// Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the
11806 /// format
11807 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
11808 pub name: std::string::String,
11809
11810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11811}
11812
11813impl DeleteGatewaySecurityPolicyRuleRequest {
11814 /// Creates a new default instance.
11815 pub fn new() -> Self {
11816 std::default::Default::default()
11817 }
11818
11819 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
11820 ///
11821 /// # Example
11822 /// ```ignore,no_run
11823 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRuleRequest;
11824 /// let x = DeleteGatewaySecurityPolicyRuleRequest::new().set_name("example");
11825 /// ```
11826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11827 self.name = v.into();
11828 self
11829 }
11830}
11831
11832impl wkt::message::Message for DeleteGatewaySecurityPolicyRuleRequest {
11833 fn typename() -> &'static str {
11834 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest"
11835 }
11836}
11837
11838/// An endpoint group is a consumer frontend for a deployment group (backend).
11839/// In order to configure intercept for a network, consumers must create:
11840///
11841/// - An association between their network and the endpoint group.
11842/// - A security profile that points to the endpoint group.
11843/// - A firewall rule that references the security profile (group).
11844#[derive(Clone, Default, PartialEq)]
11845#[non_exhaustive]
11846pub struct InterceptEndpointGroup {
11847 /// Immutable. Identifier. The resource name of this endpoint group, for
11848 /// example:
11849 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
11850 /// See <https://google.aip.dev/122> for more details.
11851 pub name: std::string::String,
11852
11853 /// Output only. The timestamp when the resource was created.
11854 /// See <https://google.aip.dev/148#timestamps>.
11855 pub create_time: std::option::Option<wkt::Timestamp>,
11856
11857 /// Output only. The timestamp when the resource was most recently updated.
11858 /// See <https://google.aip.dev/148#timestamps>.
11859 pub update_time: std::option::Option<wkt::Timestamp>,
11860
11861 /// Optional. Labels are key/value pairs that help to organize and filter
11862 /// resources.
11863 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11864
11865 /// Required. Immutable. The deployment group that this endpoint group is
11866 /// connected to, for example:
11867 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
11868 /// See <https://google.aip.dev/124>.
11869 pub intercept_deployment_group: std::string::String,
11870
11871 /// Output only. Details about the connected deployment group to this endpoint
11872 /// group.
11873 pub connected_deployment_group:
11874 std::option::Option<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
11875
11876 /// Output only. The current state of the endpoint group.
11877 /// See <https://google.aip.dev/216>.
11878 pub state: crate::model::intercept_endpoint_group::State,
11879
11880 /// Output only. The current state of the resource does not match the user's
11881 /// intended state, and the system is working to reconcile them. This is part
11882 /// of the normal operation (e.g. adding a new association to the group). See
11883 /// <https://google.aip.dev/128>.
11884 pub reconciling: bool,
11885
11886 /// Output only. List of associations to this endpoint group.
11887 pub associations: std::vec::Vec<crate::model::intercept_endpoint_group::AssociationDetails>,
11888
11889 /// Optional. User-provided description of the endpoint group.
11890 /// Used as additional context for the endpoint group.
11891 pub description: std::string::String,
11892
11893 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11894}
11895
11896impl InterceptEndpointGroup {
11897 /// Creates a new default instance.
11898 pub fn new() -> Self {
11899 std::default::Default::default()
11900 }
11901
11902 /// Sets the value of [name][crate::model::InterceptEndpointGroup::name].
11903 ///
11904 /// # Example
11905 /// ```ignore,no_run
11906 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11907 /// let x = InterceptEndpointGroup::new().set_name("example");
11908 /// ```
11909 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11910 self.name = v.into();
11911 self
11912 }
11913
11914 /// Sets the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
11915 ///
11916 /// # Example
11917 /// ```ignore,no_run
11918 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11919 /// use wkt::Timestamp;
11920 /// let x = InterceptEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
11921 /// ```
11922 pub fn set_create_time<T>(mut self, v: T) -> Self
11923 where
11924 T: std::convert::Into<wkt::Timestamp>,
11925 {
11926 self.create_time = std::option::Option::Some(v.into());
11927 self
11928 }
11929
11930 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
11931 ///
11932 /// # Example
11933 /// ```ignore,no_run
11934 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11935 /// use wkt::Timestamp;
11936 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11937 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
11938 /// ```
11939 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11940 where
11941 T: std::convert::Into<wkt::Timestamp>,
11942 {
11943 self.create_time = v.map(|x| x.into());
11944 self
11945 }
11946
11947 /// Sets the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
11948 ///
11949 /// # Example
11950 /// ```ignore,no_run
11951 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11952 /// use wkt::Timestamp;
11953 /// let x = InterceptEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
11954 /// ```
11955 pub fn set_update_time<T>(mut self, v: T) -> Self
11956 where
11957 T: std::convert::Into<wkt::Timestamp>,
11958 {
11959 self.update_time = std::option::Option::Some(v.into());
11960 self
11961 }
11962
11963 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
11964 ///
11965 /// # Example
11966 /// ```ignore,no_run
11967 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11968 /// use wkt::Timestamp;
11969 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11970 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
11971 /// ```
11972 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11973 where
11974 T: std::convert::Into<wkt::Timestamp>,
11975 {
11976 self.update_time = v.map(|x| x.into());
11977 self
11978 }
11979
11980 /// Sets the value of [labels][crate::model::InterceptEndpointGroup::labels].
11981 ///
11982 /// # Example
11983 /// ```ignore,no_run
11984 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11985 /// let x = InterceptEndpointGroup::new().set_labels([
11986 /// ("key0", "abc"),
11987 /// ("key1", "xyz"),
11988 /// ]);
11989 /// ```
11990 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11991 where
11992 T: std::iter::IntoIterator<Item = (K, V)>,
11993 K: std::convert::Into<std::string::String>,
11994 V: std::convert::Into<std::string::String>,
11995 {
11996 use std::iter::Iterator;
11997 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11998 self
11999 }
12000
12001 /// Sets the value of [intercept_deployment_group][crate::model::InterceptEndpointGroup::intercept_deployment_group].
12002 ///
12003 /// # Example
12004 /// ```ignore,no_run
12005 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12006 /// let x = InterceptEndpointGroup::new().set_intercept_deployment_group("example");
12007 /// ```
12008 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
12009 mut self,
12010 v: T,
12011 ) -> Self {
12012 self.intercept_deployment_group = v.into();
12013 self
12014 }
12015
12016 /// Sets the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12017 ///
12018 /// # Example
12019 /// ```ignore,no_run
12020 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12021 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12022 /// let x = InterceptEndpointGroup::new().set_connected_deployment_group(ConnectedDeploymentGroup::default()/* use setters */);
12023 /// ```
12024 pub fn set_connected_deployment_group<T>(mut self, v: T) -> Self
12025 where
12026 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12027 {
12028 self.connected_deployment_group = std::option::Option::Some(v.into());
12029 self
12030 }
12031
12032 /// Sets or clears the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12033 ///
12034 /// # Example
12035 /// ```ignore,no_run
12036 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12037 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12038 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(Some(ConnectedDeploymentGroup::default()/* use setters */));
12039 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(None::<ConnectedDeploymentGroup>);
12040 /// ```
12041 pub fn set_or_clear_connected_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
12042 where
12043 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12044 {
12045 self.connected_deployment_group = v.map(|x| x.into());
12046 self
12047 }
12048
12049 /// Sets the value of [state][crate::model::InterceptEndpointGroup::state].
12050 ///
12051 /// # Example
12052 /// ```ignore,no_run
12053 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12054 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::State;
12055 /// let x0 = InterceptEndpointGroup::new().set_state(State::Active);
12056 /// let x1 = InterceptEndpointGroup::new().set_state(State::Closed);
12057 /// let x2 = InterceptEndpointGroup::new().set_state(State::Creating);
12058 /// ```
12059 pub fn set_state<T: std::convert::Into<crate::model::intercept_endpoint_group::State>>(
12060 mut self,
12061 v: T,
12062 ) -> Self {
12063 self.state = v.into();
12064 self
12065 }
12066
12067 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroup::reconciling].
12068 ///
12069 /// # Example
12070 /// ```ignore,no_run
12071 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12072 /// let x = InterceptEndpointGroup::new().set_reconciling(true);
12073 /// ```
12074 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12075 self.reconciling = v.into();
12076 self
12077 }
12078
12079 /// Sets the value of [associations][crate::model::InterceptEndpointGroup::associations].
12080 ///
12081 /// # Example
12082 /// ```ignore,no_run
12083 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12084 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12085 /// let x = InterceptEndpointGroup::new()
12086 /// .set_associations([
12087 /// AssociationDetails::default()/* use setters */,
12088 /// AssociationDetails::default()/* use (different) setters */,
12089 /// ]);
12090 /// ```
12091 pub fn set_associations<T, V>(mut self, v: T) -> Self
12092 where
12093 T: std::iter::IntoIterator<Item = V>,
12094 V: std::convert::Into<crate::model::intercept_endpoint_group::AssociationDetails>,
12095 {
12096 use std::iter::Iterator;
12097 self.associations = v.into_iter().map(|i| i.into()).collect();
12098 self
12099 }
12100
12101 /// Sets the value of [description][crate::model::InterceptEndpointGroup::description].
12102 ///
12103 /// # Example
12104 /// ```ignore,no_run
12105 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12106 /// let x = InterceptEndpointGroup::new().set_description("example");
12107 /// ```
12108 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12109 self.description = v.into();
12110 self
12111 }
12112}
12113
12114impl wkt::message::Message for InterceptEndpointGroup {
12115 fn typename() -> &'static str {
12116 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup"
12117 }
12118}
12119
12120/// Defines additional types related to [InterceptEndpointGroup].
12121pub mod intercept_endpoint_group {
12122 #[allow(unused_imports)]
12123 use super::*;
12124
12125 /// The endpoint group's view of a connected deployment group.
12126 #[derive(Clone, Default, PartialEq)]
12127 #[non_exhaustive]
12128 pub struct ConnectedDeploymentGroup {
12129 /// Output only. The connected deployment group's resource name, for example:
12130 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12131 /// See <https://google.aip.dev/124>.
12132 pub name: std::string::String,
12133
12134 /// Output only. The list of locations where the deployment group is present.
12135 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12136
12137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12138 }
12139
12140 impl ConnectedDeploymentGroup {
12141 /// Creates a new default instance.
12142 pub fn new() -> Self {
12143 std::default::Default::default()
12144 }
12145
12146 /// Sets the value of [name][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::name].
12147 ///
12148 /// # Example
12149 /// ```ignore,no_run
12150 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12151 /// let x = ConnectedDeploymentGroup::new().set_name("example");
12152 /// ```
12153 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12154 self.name = v.into();
12155 self
12156 }
12157
12158 /// Sets the value of [locations][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::locations].
12159 ///
12160 /// # Example
12161 /// ```ignore,no_run
12162 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12163 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
12164 /// let x = ConnectedDeploymentGroup::new()
12165 /// .set_locations([
12166 /// InterceptLocation::default()/* use setters */,
12167 /// InterceptLocation::default()/* use (different) setters */,
12168 /// ]);
12169 /// ```
12170 pub fn set_locations<T, V>(mut self, v: T) -> Self
12171 where
12172 T: std::iter::IntoIterator<Item = V>,
12173 V: std::convert::Into<crate::model::InterceptLocation>,
12174 {
12175 use std::iter::Iterator;
12176 self.locations = v.into_iter().map(|i| i.into()).collect();
12177 self
12178 }
12179 }
12180
12181 impl wkt::message::Message for ConnectedDeploymentGroup {
12182 fn typename() -> &'static str {
12183 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup"
12184 }
12185 }
12186
12187 /// The endpoint group's view of a connected association.
12188 #[derive(Clone, Default, PartialEq)]
12189 #[non_exhaustive]
12190 pub struct AssociationDetails {
12191 /// Output only. The connected association's resource name, for example:
12192 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-ega`.
12193 /// See <https://google.aip.dev/124>.
12194 pub name: std::string::String,
12195
12196 /// Output only. The associated network, for example:
12197 /// projects/123456789/global/networks/my-network.
12198 /// See <https://google.aip.dev/124>.
12199 pub network: std::string::String,
12200
12201 /// Output only. Most recent known state of the association.
12202 pub state: crate::model::intercept_endpoint_group_association::State,
12203
12204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12205 }
12206
12207 impl AssociationDetails {
12208 /// Creates a new default instance.
12209 pub fn new() -> Self {
12210 std::default::Default::default()
12211 }
12212
12213 /// Sets the value of [name][crate::model::intercept_endpoint_group::AssociationDetails::name].
12214 ///
12215 /// # Example
12216 /// ```ignore,no_run
12217 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12218 /// let x = AssociationDetails::new().set_name("example");
12219 /// ```
12220 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12221 self.name = v.into();
12222 self
12223 }
12224
12225 /// Sets the value of [network][crate::model::intercept_endpoint_group::AssociationDetails::network].
12226 ///
12227 /// # Example
12228 /// ```ignore,no_run
12229 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12230 /// let x = AssociationDetails::new().set_network("example");
12231 /// ```
12232 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12233 self.network = v.into();
12234 self
12235 }
12236
12237 /// Sets the value of [state][crate::model::intercept_endpoint_group::AssociationDetails::state].
12238 ///
12239 /// # Example
12240 /// ```ignore,no_run
12241 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12242 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
12243 /// let x0 = AssociationDetails::new().set_state(State::Active);
12244 /// let x1 = AssociationDetails::new().set_state(State::Creating);
12245 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
12246 /// ```
12247 pub fn set_state<
12248 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
12249 >(
12250 mut self,
12251 v: T,
12252 ) -> Self {
12253 self.state = v.into();
12254 self
12255 }
12256 }
12257
12258 impl wkt::message::Message for AssociationDetails {
12259 fn typename() -> &'static str {
12260 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails"
12261 }
12262 }
12263
12264 /// Endpoint group state.
12265 ///
12266 /// # Working with unknown values
12267 ///
12268 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12269 /// additional enum variants at any time. Adding new variants is not considered
12270 /// a breaking change. Applications should write their code in anticipation of:
12271 ///
12272 /// - New values appearing in future releases of the client library, **and**
12273 /// - New values received dynamically, without application changes.
12274 ///
12275 /// Please consult the [Working with enums] section in the user guide for some
12276 /// guidelines.
12277 ///
12278 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12279 #[derive(Clone, Debug, PartialEq)]
12280 #[non_exhaustive]
12281 pub enum State {
12282 /// State not set (this is not a valid state).
12283 Unspecified,
12284 /// The endpoint group is ready and in sync with the target deployment group.
12285 Active,
12286 /// The deployment group backing this endpoint group has been force-deleted.
12287 /// This endpoint group cannot be used and interception is effectively
12288 /// disabled.
12289 Closed,
12290 /// The endpoint group is being created.
12291 Creating,
12292 /// The endpoint group is being deleted.
12293 Deleting,
12294 /// The endpoint group is out of sync with the backing deployment group.
12295 /// In most cases, this is a result of a transient issue within the system
12296 /// (e.g. an inaccessible location) and the system is expected to recover
12297 /// automatically. See the associations field for details per network and
12298 /// location.
12299 OutOfSync,
12300 /// An attempt to delete the endpoint group has failed. This is a terminal
12301 /// state and the endpoint group is not expected to recover.
12302 /// The only permitted operation is to retry deleting the endpoint group.
12303 DeleteFailed,
12304 /// If set, the enum was initialized with an unknown value.
12305 ///
12306 /// Applications can examine the value using [State::value] or
12307 /// [State::name].
12308 UnknownValue(state::UnknownValue),
12309 }
12310
12311 #[doc(hidden)]
12312 pub mod state {
12313 #[allow(unused_imports)]
12314 use super::*;
12315 #[derive(Clone, Debug, PartialEq)]
12316 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12317 }
12318
12319 impl State {
12320 /// Gets the enum value.
12321 ///
12322 /// Returns `None` if the enum contains an unknown value deserialized from
12323 /// the string representation of enums.
12324 pub fn value(&self) -> std::option::Option<i32> {
12325 match self {
12326 Self::Unspecified => std::option::Option::Some(0),
12327 Self::Active => std::option::Option::Some(1),
12328 Self::Closed => std::option::Option::Some(2),
12329 Self::Creating => std::option::Option::Some(3),
12330 Self::Deleting => std::option::Option::Some(4),
12331 Self::OutOfSync => std::option::Option::Some(5),
12332 Self::DeleteFailed => std::option::Option::Some(6),
12333 Self::UnknownValue(u) => u.0.value(),
12334 }
12335 }
12336
12337 /// Gets the enum value as a string.
12338 ///
12339 /// Returns `None` if the enum contains an unknown value deserialized from
12340 /// the integer representation of enums.
12341 pub fn name(&self) -> std::option::Option<&str> {
12342 match self {
12343 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12344 Self::Active => std::option::Option::Some("ACTIVE"),
12345 Self::Closed => std::option::Option::Some("CLOSED"),
12346 Self::Creating => std::option::Option::Some("CREATING"),
12347 Self::Deleting => std::option::Option::Some("DELETING"),
12348 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
12349 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
12350 Self::UnknownValue(u) => u.0.name(),
12351 }
12352 }
12353 }
12354
12355 impl std::default::Default for State {
12356 fn default() -> Self {
12357 use std::convert::From;
12358 Self::from(0)
12359 }
12360 }
12361
12362 impl std::fmt::Display for State {
12363 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12364 wkt::internal::display_enum(f, self.name(), self.value())
12365 }
12366 }
12367
12368 impl std::convert::From<i32> for State {
12369 fn from(value: i32) -> Self {
12370 match value {
12371 0 => Self::Unspecified,
12372 1 => Self::Active,
12373 2 => Self::Closed,
12374 3 => Self::Creating,
12375 4 => Self::Deleting,
12376 5 => Self::OutOfSync,
12377 6 => Self::DeleteFailed,
12378 _ => Self::UnknownValue(state::UnknownValue(
12379 wkt::internal::UnknownEnumValue::Integer(value),
12380 )),
12381 }
12382 }
12383 }
12384
12385 impl std::convert::From<&str> for State {
12386 fn from(value: &str) -> Self {
12387 use std::string::ToString;
12388 match value {
12389 "STATE_UNSPECIFIED" => Self::Unspecified,
12390 "ACTIVE" => Self::Active,
12391 "CLOSED" => Self::Closed,
12392 "CREATING" => Self::Creating,
12393 "DELETING" => Self::Deleting,
12394 "OUT_OF_SYNC" => Self::OutOfSync,
12395 "DELETE_FAILED" => Self::DeleteFailed,
12396 _ => Self::UnknownValue(state::UnknownValue(
12397 wkt::internal::UnknownEnumValue::String(value.to_string()),
12398 )),
12399 }
12400 }
12401 }
12402
12403 impl serde::ser::Serialize for State {
12404 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12405 where
12406 S: serde::Serializer,
12407 {
12408 match self {
12409 Self::Unspecified => serializer.serialize_i32(0),
12410 Self::Active => serializer.serialize_i32(1),
12411 Self::Closed => serializer.serialize_i32(2),
12412 Self::Creating => serializer.serialize_i32(3),
12413 Self::Deleting => serializer.serialize_i32(4),
12414 Self::OutOfSync => serializer.serialize_i32(5),
12415 Self::DeleteFailed => serializer.serialize_i32(6),
12416 Self::UnknownValue(u) => u.0.serialize(serializer),
12417 }
12418 }
12419 }
12420
12421 impl<'de> serde::de::Deserialize<'de> for State {
12422 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12423 where
12424 D: serde::Deserializer<'de>,
12425 {
12426 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12427 ".google.cloud.networksecurity.v1.InterceptEndpointGroup.State",
12428 ))
12429 }
12430 }
12431}
12432
12433/// Request message for ListInterceptEndpointGroups.
12434#[derive(Clone, Default, PartialEq)]
12435#[non_exhaustive]
12436pub struct ListInterceptEndpointGroupsRequest {
12437 /// Required. The parent, which owns this collection of endpoint groups.
12438 /// Example: `projects/123456789/locations/global`.
12439 /// See <https://google.aip.dev/132> for more details.
12440 pub parent: std::string::String,
12441
12442 /// Optional. Requested page size. Server may return fewer items than
12443 /// requested. If unspecified, server will pick an appropriate default. See
12444 /// <https://google.aip.dev/158> for more details.
12445 pub page_size: i32,
12446
12447 /// Optional. A page token, received from a previous
12448 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
12449 /// page. When paginating, all other parameters provided to
12450 /// `ListInterceptEndpointGroups` must match the call that provided the page
12451 /// token.
12452 /// See <https://google.aip.dev/158> for more details.
12453 pub page_token: std::string::String,
12454
12455 /// Optional. Filter expression.
12456 /// See <https://google.aip.dev/160#filtering> for more details.
12457 pub filter: std::string::String,
12458
12459 /// Optional. Sort expression.
12460 /// See <https://google.aip.dev/132#ordering> for more details.
12461 pub order_by: std::string::String,
12462
12463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12464}
12465
12466impl ListInterceptEndpointGroupsRequest {
12467 /// Creates a new default instance.
12468 pub fn new() -> Self {
12469 std::default::Default::default()
12470 }
12471
12472 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
12473 ///
12474 /// # Example
12475 /// ```ignore,no_run
12476 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12477 /// let x = ListInterceptEndpointGroupsRequest::new().set_parent("example");
12478 /// ```
12479 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12480 self.parent = v.into();
12481 self
12482 }
12483
12484 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
12485 ///
12486 /// # Example
12487 /// ```ignore,no_run
12488 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12489 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_size(42);
12490 /// ```
12491 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12492 self.page_size = v.into();
12493 self
12494 }
12495
12496 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
12497 ///
12498 /// # Example
12499 /// ```ignore,no_run
12500 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12501 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_token("example");
12502 /// ```
12503 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12504 self.page_token = v.into();
12505 self
12506 }
12507
12508 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
12509 ///
12510 /// # Example
12511 /// ```ignore,no_run
12512 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12513 /// let x = ListInterceptEndpointGroupsRequest::new().set_filter("example");
12514 /// ```
12515 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12516 self.filter = v.into();
12517 self
12518 }
12519
12520 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
12521 ///
12522 /// # Example
12523 /// ```ignore,no_run
12524 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12525 /// let x = ListInterceptEndpointGroupsRequest::new().set_order_by("example");
12526 /// ```
12527 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12528 self.order_by = v.into();
12529 self
12530 }
12531}
12532
12533impl wkt::message::Message for ListInterceptEndpointGroupsRequest {
12534 fn typename() -> &'static str {
12535 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest"
12536 }
12537}
12538
12539/// Response message for ListInterceptEndpointGroups.
12540#[derive(Clone, Default, PartialEq)]
12541#[non_exhaustive]
12542pub struct ListInterceptEndpointGroupsResponse {
12543 /// The endpoint groups from the specified parent.
12544 pub intercept_endpoint_groups: std::vec::Vec<crate::model::InterceptEndpointGroup>,
12545
12546 /// A token that can be sent as `page_token` to retrieve the next page.
12547 /// If this field is omitted, there are no subsequent pages.
12548 /// See <https://google.aip.dev/158> for more details.
12549 pub next_page_token: std::string::String,
12550
12551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12552}
12553
12554impl ListInterceptEndpointGroupsResponse {
12555 /// Creates a new default instance.
12556 pub fn new() -> Self {
12557 std::default::Default::default()
12558 }
12559
12560 /// Sets the value of [intercept_endpoint_groups][crate::model::ListInterceptEndpointGroupsResponse::intercept_endpoint_groups].
12561 ///
12562 /// # Example
12563 /// ```ignore,no_run
12564 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12565 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12566 /// let x = ListInterceptEndpointGroupsResponse::new()
12567 /// .set_intercept_endpoint_groups([
12568 /// InterceptEndpointGroup::default()/* use setters */,
12569 /// InterceptEndpointGroup::default()/* use (different) setters */,
12570 /// ]);
12571 /// ```
12572 pub fn set_intercept_endpoint_groups<T, V>(mut self, v: T) -> Self
12573 where
12574 T: std::iter::IntoIterator<Item = V>,
12575 V: std::convert::Into<crate::model::InterceptEndpointGroup>,
12576 {
12577 use std::iter::Iterator;
12578 self.intercept_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
12579 self
12580 }
12581
12582 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupsResponse::next_page_token].
12583 ///
12584 /// # Example
12585 /// ```ignore,no_run
12586 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12587 /// let x = ListInterceptEndpointGroupsResponse::new().set_next_page_token("example");
12588 /// ```
12589 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12590 self.next_page_token = v.into();
12591 self
12592 }
12593}
12594
12595impl wkt::message::Message for ListInterceptEndpointGroupsResponse {
12596 fn typename() -> &'static str {
12597 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse"
12598 }
12599}
12600
12601#[doc(hidden)]
12602impl google_cloud_gax::paginator::internal::PageableResponse
12603 for ListInterceptEndpointGroupsResponse
12604{
12605 type PageItem = crate::model::InterceptEndpointGroup;
12606
12607 fn items(self) -> std::vec::Vec<Self::PageItem> {
12608 self.intercept_endpoint_groups
12609 }
12610
12611 fn next_page_token(&self) -> std::string::String {
12612 use std::clone::Clone;
12613 self.next_page_token.clone()
12614 }
12615}
12616
12617/// Request message for GetInterceptEndpointGroup.
12618#[derive(Clone, Default, PartialEq)]
12619#[non_exhaustive]
12620pub struct GetInterceptEndpointGroupRequest {
12621 /// Required. The name of the endpoint group to retrieve.
12622 /// Format:
12623 /// projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}
12624 pub name: std::string::String,
12625
12626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12627}
12628
12629impl GetInterceptEndpointGroupRequest {
12630 /// Creates a new default instance.
12631 pub fn new() -> Self {
12632 std::default::Default::default()
12633 }
12634
12635 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
12636 ///
12637 /// # Example
12638 /// ```ignore,no_run
12639 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupRequest;
12640 /// let x = GetInterceptEndpointGroupRequest::new().set_name("example");
12641 /// ```
12642 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12643 self.name = v.into();
12644 self
12645 }
12646}
12647
12648impl wkt::message::Message for GetInterceptEndpointGroupRequest {
12649 fn typename() -> &'static str {
12650 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest"
12651 }
12652}
12653
12654/// Request message for CreateInterceptEndpointGroup.
12655#[derive(Clone, Default, PartialEq)]
12656#[non_exhaustive]
12657pub struct CreateInterceptEndpointGroupRequest {
12658 /// Required. The parent resource where this endpoint group will be created.
12659 /// Format: projects/{project}/locations/{location}
12660 pub parent: std::string::String,
12661
12662 /// Required. The ID to use for the endpoint group, which will become the final
12663 /// component of the endpoint group's resource name.
12664 pub intercept_endpoint_group_id: std::string::String,
12665
12666 /// Required. The endpoint group to create.
12667 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12668
12669 /// Optional. A unique identifier for this request. Must be a UUID4.
12670 /// This request is only idempotent if a `request_id` is provided.
12671 /// See <https://google.aip.dev/155> for more details.
12672 pub request_id: std::string::String,
12673
12674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12675}
12676
12677impl CreateInterceptEndpointGroupRequest {
12678 /// Creates a new default instance.
12679 pub fn new() -> Self {
12680 std::default::Default::default()
12681 }
12682
12683 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
12684 ///
12685 /// # Example
12686 /// ```ignore,no_run
12687 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12688 /// let x = CreateInterceptEndpointGroupRequest::new().set_parent("example");
12689 /// ```
12690 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12691 self.parent = v.into();
12692 self
12693 }
12694
12695 /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
12696 ///
12697 /// # Example
12698 /// ```ignore,no_run
12699 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12700 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group_id("example");
12701 /// ```
12702 pub fn set_intercept_endpoint_group_id<T: std::convert::Into<std::string::String>>(
12703 mut self,
12704 v: T,
12705 ) -> Self {
12706 self.intercept_endpoint_group_id = v.into();
12707 self
12708 }
12709
12710 /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12711 ///
12712 /// # Example
12713 /// ```ignore,no_run
12714 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12715 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12716 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12717 /// ```
12718 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12719 where
12720 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12721 {
12722 self.intercept_endpoint_group = std::option::Option::Some(v.into());
12723 self
12724 }
12725
12726 /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12727 ///
12728 /// # Example
12729 /// ```ignore,no_run
12730 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12731 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12732 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12733 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12734 /// ```
12735 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12736 where
12737 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12738 {
12739 self.intercept_endpoint_group = v.map(|x| x.into());
12740 self
12741 }
12742
12743 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
12744 ///
12745 /// # Example
12746 /// ```ignore,no_run
12747 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12748 /// let x = CreateInterceptEndpointGroupRequest::new().set_request_id("example");
12749 /// ```
12750 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12751 self.request_id = v.into();
12752 self
12753 }
12754}
12755
12756impl wkt::message::Message for CreateInterceptEndpointGroupRequest {
12757 fn typename() -> &'static str {
12758 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest"
12759 }
12760}
12761
12762/// Request message for UpdateInterceptEndpointGroup.
12763#[derive(Clone, Default, PartialEq)]
12764#[non_exhaustive]
12765pub struct UpdateInterceptEndpointGroupRequest {
12766 /// Optional. The list of fields to update.
12767 /// Fields are specified relative to the endpoint group
12768 /// (e.g. `description`; *not* `intercept_endpoint_group.description`).
12769 /// See <https://google.aip.dev/161> for more details.
12770 pub update_mask: std::option::Option<wkt::FieldMask>,
12771
12772 /// Required. The endpoint group to update.
12773 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12774
12775 /// Optional. A unique identifier for this request. Must be a UUID4.
12776 /// This request is only idempotent if a `request_id` is provided.
12777 /// See <https://google.aip.dev/155> for more details.
12778 pub request_id: std::string::String,
12779
12780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12781}
12782
12783impl UpdateInterceptEndpointGroupRequest {
12784 /// Creates a new default instance.
12785 pub fn new() -> Self {
12786 std::default::Default::default()
12787 }
12788
12789 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
12790 ///
12791 /// # Example
12792 /// ```ignore,no_run
12793 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12794 /// use wkt::FieldMask;
12795 /// let x = UpdateInterceptEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12796 /// ```
12797 pub fn set_update_mask<T>(mut self, v: T) -> Self
12798 where
12799 T: std::convert::Into<wkt::FieldMask>,
12800 {
12801 self.update_mask = std::option::Option::Some(v.into());
12802 self
12803 }
12804
12805 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
12806 ///
12807 /// # Example
12808 /// ```ignore,no_run
12809 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12810 /// use wkt::FieldMask;
12811 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12812 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12813 /// ```
12814 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12815 where
12816 T: std::convert::Into<wkt::FieldMask>,
12817 {
12818 self.update_mask = v.map(|x| x.into());
12819 self
12820 }
12821
12822 /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
12823 ///
12824 /// # Example
12825 /// ```ignore,no_run
12826 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12827 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12828 /// let x = UpdateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12829 /// ```
12830 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12831 where
12832 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12833 {
12834 self.intercept_endpoint_group = std::option::Option::Some(v.into());
12835 self
12836 }
12837
12838 /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
12839 ///
12840 /// # Example
12841 /// ```ignore,no_run
12842 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12843 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12844 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12845 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12846 /// ```
12847 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12848 where
12849 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12850 {
12851 self.intercept_endpoint_group = v.map(|x| x.into());
12852 self
12853 }
12854
12855 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
12856 ///
12857 /// # Example
12858 /// ```ignore,no_run
12859 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12860 /// let x = UpdateInterceptEndpointGroupRequest::new().set_request_id("example");
12861 /// ```
12862 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12863 self.request_id = v.into();
12864 self
12865 }
12866}
12867
12868impl wkt::message::Message for UpdateInterceptEndpointGroupRequest {
12869 fn typename() -> &'static str {
12870 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest"
12871 }
12872}
12873
12874/// Request message for DeleteInterceptEndpointGroup.
12875#[derive(Clone, Default, PartialEq)]
12876#[non_exhaustive]
12877pub struct DeleteInterceptEndpointGroupRequest {
12878 /// Required. The endpoint group to delete.
12879 pub name: std::string::String,
12880
12881 /// Optional. A unique identifier for this request. Must be a UUID4.
12882 /// This request is only idempotent if a `request_id` is provided.
12883 /// See <https://google.aip.dev/155> for more details.
12884 pub request_id: std::string::String,
12885
12886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12887}
12888
12889impl DeleteInterceptEndpointGroupRequest {
12890 /// Creates a new default instance.
12891 pub fn new() -> Self {
12892 std::default::Default::default()
12893 }
12894
12895 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
12896 ///
12897 /// # Example
12898 /// ```ignore,no_run
12899 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
12900 /// let x = DeleteInterceptEndpointGroupRequest::new().set_name("example");
12901 /// ```
12902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12903 self.name = v.into();
12904 self
12905 }
12906
12907 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
12908 ///
12909 /// # Example
12910 /// ```ignore,no_run
12911 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
12912 /// let x = DeleteInterceptEndpointGroupRequest::new().set_request_id("example");
12913 /// ```
12914 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12915 self.request_id = v.into();
12916 self
12917 }
12918}
12919
12920impl wkt::message::Message for DeleteInterceptEndpointGroupRequest {
12921 fn typename() -> &'static str {
12922 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest"
12923 }
12924}
12925
12926/// An endpoint group association represents a link between a network and an
12927/// endpoint group in the organization.
12928///
12929/// Creating an association creates the networking infrastructure linking the
12930/// network to the endpoint group, but does not enable intercept by itself.
12931/// To enable intercept, the user must also create a network firewall policy
12932/// containing intercept rules and associate it with the network.
12933#[derive(Clone, Default, PartialEq)]
12934#[non_exhaustive]
12935pub struct InterceptEndpointGroupAssociation {
12936 /// Immutable. Identifier. The resource name of this endpoint group
12937 /// association, for example:
12938 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association`.
12939 /// See <https://google.aip.dev/122> for more details.
12940 pub name: std::string::String,
12941
12942 /// Output only. The timestamp when the resource was created.
12943 /// See <https://google.aip.dev/148#timestamps>.
12944 pub create_time: std::option::Option<wkt::Timestamp>,
12945
12946 /// Output only. The timestamp when the resource was most recently updated.
12947 /// See <https://google.aip.dev/148#timestamps>.
12948 pub update_time: std::option::Option<wkt::Timestamp>,
12949
12950 /// Optional. Labels are key/value pairs that help to organize and filter
12951 /// resources.
12952 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12953
12954 /// Required. Immutable. The endpoint group that this association is connected
12955 /// to, for example:
12956 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
12957 /// See <https://google.aip.dev/124>.
12958 pub intercept_endpoint_group: std::string::String,
12959
12960 /// Required. Immutable. The VPC network that is associated. for example:
12961 /// `projects/123456789/global/networks/my-network`.
12962 /// See <https://google.aip.dev/124>.
12963 pub network: std::string::String,
12964
12965 /// Output only. The list of locations where the association is present. This
12966 /// information is retrieved from the linked endpoint group, and not configured
12967 /// as part of the association itself.
12968 #[deprecated]
12969 pub locations_details:
12970 std::vec::Vec<crate::model::intercept_endpoint_group_association::LocationDetails>,
12971
12972 /// Output only. Current state of the endpoint group association.
12973 pub state: crate::model::intercept_endpoint_group_association::State,
12974
12975 /// Output only. The current state of the resource does not match the user's
12976 /// intended state, and the system is working to reconcile them. This part of
12977 /// the normal operation (e.g. adding a new location to the target deployment
12978 /// group). See <https://google.aip.dev/128>.
12979 pub reconciling: bool,
12980
12981 /// Output only. The list of locations where the association is configured.
12982 /// This information is retrieved from the linked endpoint group.
12983 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12984
12985 /// Output only. Identifier used by the data-path.
12986 /// See the NSI GENEVE format for more details:
12987 /// <https://docs.cloud.google.com/network-security-integration/docs/understand-geneve#network_id>
12988 pub network_cookie: u32,
12989
12990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12991}
12992
12993impl InterceptEndpointGroupAssociation {
12994 /// Creates a new default instance.
12995 pub fn new() -> Self {
12996 std::default::Default::default()
12997 }
12998
12999 /// Sets the value of [name][crate::model::InterceptEndpointGroupAssociation::name].
13000 ///
13001 /// # Example
13002 /// ```ignore,no_run
13003 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13004 /// let x = InterceptEndpointGroupAssociation::new().set_name("example");
13005 /// ```
13006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13007 self.name = v.into();
13008 self
13009 }
13010
13011 /// Sets the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13016 /// use wkt::Timestamp;
13017 /// let x = InterceptEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
13018 /// ```
13019 pub fn set_create_time<T>(mut self, v: T) -> Self
13020 where
13021 T: std::convert::Into<wkt::Timestamp>,
13022 {
13023 self.create_time = std::option::Option::Some(v.into());
13024 self
13025 }
13026
13027 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13028 ///
13029 /// # Example
13030 /// ```ignore,no_run
13031 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13032 /// use wkt::Timestamp;
13033 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13034 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
13035 /// ```
13036 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13037 where
13038 T: std::convert::Into<wkt::Timestamp>,
13039 {
13040 self.create_time = v.map(|x| x.into());
13041 self
13042 }
13043
13044 /// Sets the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13045 ///
13046 /// # Example
13047 /// ```ignore,no_run
13048 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13049 /// use wkt::Timestamp;
13050 /// let x = InterceptEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
13051 /// ```
13052 pub fn set_update_time<T>(mut self, v: T) -> Self
13053 where
13054 T: std::convert::Into<wkt::Timestamp>,
13055 {
13056 self.update_time = std::option::Option::Some(v.into());
13057 self
13058 }
13059
13060 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13061 ///
13062 /// # Example
13063 /// ```ignore,no_run
13064 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13065 /// use wkt::Timestamp;
13066 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13067 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
13068 /// ```
13069 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13070 where
13071 T: std::convert::Into<wkt::Timestamp>,
13072 {
13073 self.update_time = v.map(|x| x.into());
13074 self
13075 }
13076
13077 /// Sets the value of [labels][crate::model::InterceptEndpointGroupAssociation::labels].
13078 ///
13079 /// # Example
13080 /// ```ignore,no_run
13081 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13082 /// let x = InterceptEndpointGroupAssociation::new().set_labels([
13083 /// ("key0", "abc"),
13084 /// ("key1", "xyz"),
13085 /// ]);
13086 /// ```
13087 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13088 where
13089 T: std::iter::IntoIterator<Item = (K, V)>,
13090 K: std::convert::Into<std::string::String>,
13091 V: std::convert::Into<std::string::String>,
13092 {
13093 use std::iter::Iterator;
13094 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13095 self
13096 }
13097
13098 /// Sets the value of [intercept_endpoint_group][crate::model::InterceptEndpointGroupAssociation::intercept_endpoint_group].
13099 ///
13100 /// # Example
13101 /// ```ignore,no_run
13102 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13103 /// let x = InterceptEndpointGroupAssociation::new().set_intercept_endpoint_group("example");
13104 /// ```
13105 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
13106 mut self,
13107 v: T,
13108 ) -> Self {
13109 self.intercept_endpoint_group = v.into();
13110 self
13111 }
13112
13113 /// Sets the value of [network][crate::model::InterceptEndpointGroupAssociation::network].
13114 ///
13115 /// # Example
13116 /// ```ignore,no_run
13117 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13118 /// let x = InterceptEndpointGroupAssociation::new().set_network("example");
13119 /// ```
13120 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13121 self.network = v.into();
13122 self
13123 }
13124
13125 /// Sets the value of [locations_details][crate::model::InterceptEndpointGroupAssociation::locations_details].
13126 ///
13127 /// # Example
13128 /// ```ignore,no_run
13129 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13130 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13131 /// let x = InterceptEndpointGroupAssociation::new()
13132 /// .set_locations_details([
13133 /// LocationDetails::default()/* use setters */,
13134 /// LocationDetails::default()/* use (different) setters */,
13135 /// ]);
13136 /// ```
13137 #[deprecated]
13138 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
13139 where
13140 T: std::iter::IntoIterator<Item = V>,
13141 V: std::convert::Into<crate::model::intercept_endpoint_group_association::LocationDetails>,
13142 {
13143 use std::iter::Iterator;
13144 self.locations_details = v.into_iter().map(|i| i.into()).collect();
13145 self
13146 }
13147
13148 /// Sets the value of [state][crate::model::InterceptEndpointGroupAssociation::state].
13149 ///
13150 /// # Example
13151 /// ```ignore,no_run
13152 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13153 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
13154 /// let x0 = InterceptEndpointGroupAssociation::new().set_state(State::Active);
13155 /// let x1 = InterceptEndpointGroupAssociation::new().set_state(State::Creating);
13156 /// let x2 = InterceptEndpointGroupAssociation::new().set_state(State::Deleting);
13157 /// ```
13158 pub fn set_state<
13159 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
13160 >(
13161 mut self,
13162 v: T,
13163 ) -> Self {
13164 self.state = v.into();
13165 self
13166 }
13167
13168 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroupAssociation::reconciling].
13169 ///
13170 /// # Example
13171 /// ```ignore,no_run
13172 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13173 /// let x = InterceptEndpointGroupAssociation::new().set_reconciling(true);
13174 /// ```
13175 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13176 self.reconciling = v.into();
13177 self
13178 }
13179
13180 /// Sets the value of [locations][crate::model::InterceptEndpointGroupAssociation::locations].
13181 ///
13182 /// # Example
13183 /// ```ignore,no_run
13184 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13185 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
13186 /// let x = InterceptEndpointGroupAssociation::new()
13187 /// .set_locations([
13188 /// InterceptLocation::default()/* use setters */,
13189 /// InterceptLocation::default()/* use (different) setters */,
13190 /// ]);
13191 /// ```
13192 pub fn set_locations<T, V>(mut self, v: T) -> Self
13193 where
13194 T: std::iter::IntoIterator<Item = V>,
13195 V: std::convert::Into<crate::model::InterceptLocation>,
13196 {
13197 use std::iter::Iterator;
13198 self.locations = v.into_iter().map(|i| i.into()).collect();
13199 self
13200 }
13201
13202 /// Sets the value of [network_cookie][crate::model::InterceptEndpointGroupAssociation::network_cookie].
13203 ///
13204 /// # Example
13205 /// ```ignore,no_run
13206 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13207 /// let x = InterceptEndpointGroupAssociation::new().set_network_cookie(42_u32);
13208 /// ```
13209 pub fn set_network_cookie<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
13210 self.network_cookie = v.into();
13211 self
13212 }
13213}
13214
13215impl wkt::message::Message for InterceptEndpointGroupAssociation {
13216 fn typename() -> &'static str {
13217 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation"
13218 }
13219}
13220
13221/// Defines additional types related to [InterceptEndpointGroupAssociation].
13222pub mod intercept_endpoint_group_association {
13223 #[allow(unused_imports)]
13224 use super::*;
13225
13226 /// Contains details about the state of an association in a specific cloud
13227 /// location.
13228 #[derive(Clone, Default, PartialEq)]
13229 #[non_exhaustive]
13230 pub struct LocationDetails {
13231 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
13232 pub location: std::string::String,
13233
13234 /// Output only. The current state of the association in this location.
13235 pub state: crate::model::intercept_endpoint_group_association::location_details::State,
13236
13237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13238 }
13239
13240 impl LocationDetails {
13241 /// Creates a new default instance.
13242 pub fn new() -> Self {
13243 std::default::Default::default()
13244 }
13245
13246 /// Sets the value of [location][crate::model::intercept_endpoint_group_association::LocationDetails::location].
13247 ///
13248 /// # Example
13249 /// ```ignore,no_run
13250 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13251 /// let x = LocationDetails::new().set_location("example");
13252 /// ```
13253 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13254 self.location = v.into();
13255 self
13256 }
13257
13258 /// Sets the value of [state][crate::model::intercept_endpoint_group_association::LocationDetails::state].
13259 ///
13260 /// # Example
13261 /// ```ignore,no_run
13262 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13263 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::location_details::State;
13264 /// let x0 = LocationDetails::new().set_state(State::Active);
13265 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
13266 /// ```
13267 pub fn set_state<
13268 T: std::convert::Into<
13269 crate::model::intercept_endpoint_group_association::location_details::State,
13270 >,
13271 >(
13272 mut self,
13273 v: T,
13274 ) -> Self {
13275 self.state = v.into();
13276 self
13277 }
13278 }
13279
13280 impl wkt::message::Message for LocationDetails {
13281 fn typename() -> &'static str {
13282 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails"
13283 }
13284 }
13285
13286 /// Defines additional types related to [LocationDetails].
13287 pub mod location_details {
13288 #[allow(unused_imports)]
13289 use super::*;
13290
13291 /// The state of association.
13292 ///
13293 /// # Working with unknown values
13294 ///
13295 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13296 /// additional enum variants at any time. Adding new variants is not considered
13297 /// a breaking change. Applications should write their code in anticipation of:
13298 ///
13299 /// - New values appearing in future releases of the client library, **and**
13300 /// - New values received dynamically, without application changes.
13301 ///
13302 /// Please consult the [Working with enums] section in the user guide for some
13303 /// guidelines.
13304 ///
13305 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13306 #[derive(Clone, Debug, PartialEq)]
13307 #[non_exhaustive]
13308 pub enum State {
13309 /// Not set.
13310 Unspecified,
13311 /// The association is ready and in sync with the linked endpoint group.
13312 Active,
13313 /// The association is out of sync with the linked endpoint group.
13314 /// In most cases, this is a result of a transient issue within the system
13315 /// (e.g. an inaccessible location) and the system is expected to recover
13316 /// automatically.
13317 OutOfSync,
13318 /// If set, the enum was initialized with an unknown value.
13319 ///
13320 /// Applications can examine the value using [State::value] or
13321 /// [State::name].
13322 UnknownValue(state::UnknownValue),
13323 }
13324
13325 #[doc(hidden)]
13326 pub mod state {
13327 #[allow(unused_imports)]
13328 use super::*;
13329 #[derive(Clone, Debug, PartialEq)]
13330 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13331 }
13332
13333 impl State {
13334 /// Gets the enum value.
13335 ///
13336 /// Returns `None` if the enum contains an unknown value deserialized from
13337 /// the string representation of enums.
13338 pub fn value(&self) -> std::option::Option<i32> {
13339 match self {
13340 Self::Unspecified => std::option::Option::Some(0),
13341 Self::Active => std::option::Option::Some(1),
13342 Self::OutOfSync => std::option::Option::Some(2),
13343 Self::UnknownValue(u) => u.0.value(),
13344 }
13345 }
13346
13347 /// Gets the enum value as a string.
13348 ///
13349 /// Returns `None` if the enum contains an unknown value deserialized from
13350 /// the integer representation of enums.
13351 pub fn name(&self) -> std::option::Option<&str> {
13352 match self {
13353 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13354 Self::Active => std::option::Option::Some("ACTIVE"),
13355 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13356 Self::UnknownValue(u) => u.0.name(),
13357 }
13358 }
13359 }
13360
13361 impl std::default::Default for State {
13362 fn default() -> Self {
13363 use std::convert::From;
13364 Self::from(0)
13365 }
13366 }
13367
13368 impl std::fmt::Display for State {
13369 fn fmt(
13370 &self,
13371 f: &mut std::fmt::Formatter<'_>,
13372 ) -> std::result::Result<(), std::fmt::Error> {
13373 wkt::internal::display_enum(f, self.name(), self.value())
13374 }
13375 }
13376
13377 impl std::convert::From<i32> for State {
13378 fn from(value: i32) -> Self {
13379 match value {
13380 0 => Self::Unspecified,
13381 1 => Self::Active,
13382 2 => Self::OutOfSync,
13383 _ => Self::UnknownValue(state::UnknownValue(
13384 wkt::internal::UnknownEnumValue::Integer(value),
13385 )),
13386 }
13387 }
13388 }
13389
13390 impl std::convert::From<&str> for State {
13391 fn from(value: &str) -> Self {
13392 use std::string::ToString;
13393 match value {
13394 "STATE_UNSPECIFIED" => Self::Unspecified,
13395 "ACTIVE" => Self::Active,
13396 "OUT_OF_SYNC" => Self::OutOfSync,
13397 _ => Self::UnknownValue(state::UnknownValue(
13398 wkt::internal::UnknownEnumValue::String(value.to_string()),
13399 )),
13400 }
13401 }
13402 }
13403
13404 impl serde::ser::Serialize for State {
13405 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13406 where
13407 S: serde::Serializer,
13408 {
13409 match self {
13410 Self::Unspecified => serializer.serialize_i32(0),
13411 Self::Active => serializer.serialize_i32(1),
13412 Self::OutOfSync => serializer.serialize_i32(2),
13413 Self::UnknownValue(u) => u.0.serialize(serializer),
13414 }
13415 }
13416 }
13417
13418 impl<'de> serde::de::Deserialize<'de> for State {
13419 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13420 where
13421 D: serde::Deserializer<'de>,
13422 {
13423 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13424 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State"))
13425 }
13426 }
13427 }
13428
13429 /// The state of the association.
13430 ///
13431 /// # Working with unknown values
13432 ///
13433 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13434 /// additional enum variants at any time. Adding new variants is not considered
13435 /// a breaking change. Applications should write their code in anticipation of:
13436 ///
13437 /// - New values appearing in future releases of the client library, **and**
13438 /// - New values received dynamically, without application changes.
13439 ///
13440 /// Please consult the [Working with enums] section in the user guide for some
13441 /// guidelines.
13442 ///
13443 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13444 #[derive(Clone, Debug, PartialEq)]
13445 #[non_exhaustive]
13446 pub enum State {
13447 /// Not set.
13448 Unspecified,
13449 /// The association is ready and in sync with the linked endpoint group.
13450 Active,
13451 /// The association is being created.
13452 Creating,
13453 /// The association is being deleted.
13454 Deleting,
13455 /// The association is disabled due to a breaking change in another resource.
13456 Closed,
13457 /// The association is out of sync with the linked endpoint group.
13458 /// In most cases, this is a result of a transient issue within the system
13459 /// (e.g. an inaccessible location) and the system is expected to recover
13460 /// automatically. Check the `locations_details` field for more details.
13461 OutOfSync,
13462 /// An attempt to delete the association has failed. This is a terminal state
13463 /// and the association is not expected to be usable as some of its resources
13464 /// have been deleted.
13465 /// The only permitted operation is to retry deleting the association.
13466 DeleteFailed,
13467 /// If set, the enum was initialized with an unknown value.
13468 ///
13469 /// Applications can examine the value using [State::value] or
13470 /// [State::name].
13471 UnknownValue(state::UnknownValue),
13472 }
13473
13474 #[doc(hidden)]
13475 pub mod state {
13476 #[allow(unused_imports)]
13477 use super::*;
13478 #[derive(Clone, Debug, PartialEq)]
13479 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13480 }
13481
13482 impl State {
13483 /// Gets the enum value.
13484 ///
13485 /// Returns `None` if the enum contains an unknown value deserialized from
13486 /// the string representation of enums.
13487 pub fn value(&self) -> std::option::Option<i32> {
13488 match self {
13489 Self::Unspecified => std::option::Option::Some(0),
13490 Self::Active => std::option::Option::Some(1),
13491 Self::Creating => std::option::Option::Some(2),
13492 Self::Deleting => std::option::Option::Some(3),
13493 Self::Closed => std::option::Option::Some(4),
13494 Self::OutOfSync => std::option::Option::Some(5),
13495 Self::DeleteFailed => std::option::Option::Some(6),
13496 Self::UnknownValue(u) => u.0.value(),
13497 }
13498 }
13499
13500 /// Gets the enum value as a string.
13501 ///
13502 /// Returns `None` if the enum contains an unknown value deserialized from
13503 /// the integer representation of enums.
13504 pub fn name(&self) -> std::option::Option<&str> {
13505 match self {
13506 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13507 Self::Active => std::option::Option::Some("ACTIVE"),
13508 Self::Creating => std::option::Option::Some("CREATING"),
13509 Self::Deleting => std::option::Option::Some("DELETING"),
13510 Self::Closed => std::option::Option::Some("CLOSED"),
13511 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13512 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
13513 Self::UnknownValue(u) => u.0.name(),
13514 }
13515 }
13516 }
13517
13518 impl std::default::Default for State {
13519 fn default() -> Self {
13520 use std::convert::From;
13521 Self::from(0)
13522 }
13523 }
13524
13525 impl std::fmt::Display for State {
13526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13527 wkt::internal::display_enum(f, self.name(), self.value())
13528 }
13529 }
13530
13531 impl std::convert::From<i32> for State {
13532 fn from(value: i32) -> Self {
13533 match value {
13534 0 => Self::Unspecified,
13535 1 => Self::Active,
13536 2 => Self::Creating,
13537 3 => Self::Deleting,
13538 4 => Self::Closed,
13539 5 => Self::OutOfSync,
13540 6 => Self::DeleteFailed,
13541 _ => Self::UnknownValue(state::UnknownValue(
13542 wkt::internal::UnknownEnumValue::Integer(value),
13543 )),
13544 }
13545 }
13546 }
13547
13548 impl std::convert::From<&str> for State {
13549 fn from(value: &str) -> Self {
13550 use std::string::ToString;
13551 match value {
13552 "STATE_UNSPECIFIED" => Self::Unspecified,
13553 "ACTIVE" => Self::Active,
13554 "CREATING" => Self::Creating,
13555 "DELETING" => Self::Deleting,
13556 "CLOSED" => Self::Closed,
13557 "OUT_OF_SYNC" => Self::OutOfSync,
13558 "DELETE_FAILED" => Self::DeleteFailed,
13559 _ => Self::UnknownValue(state::UnknownValue(
13560 wkt::internal::UnknownEnumValue::String(value.to_string()),
13561 )),
13562 }
13563 }
13564 }
13565
13566 impl serde::ser::Serialize for State {
13567 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13568 where
13569 S: serde::Serializer,
13570 {
13571 match self {
13572 Self::Unspecified => serializer.serialize_i32(0),
13573 Self::Active => serializer.serialize_i32(1),
13574 Self::Creating => serializer.serialize_i32(2),
13575 Self::Deleting => serializer.serialize_i32(3),
13576 Self::Closed => serializer.serialize_i32(4),
13577 Self::OutOfSync => serializer.serialize_i32(5),
13578 Self::DeleteFailed => serializer.serialize_i32(6),
13579 Self::UnknownValue(u) => u.0.serialize(serializer),
13580 }
13581 }
13582 }
13583
13584 impl<'de> serde::de::Deserialize<'de> for State {
13585 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13586 where
13587 D: serde::Deserializer<'de>,
13588 {
13589 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13590 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State",
13591 ))
13592 }
13593 }
13594}
13595
13596/// Request message for ListInterceptEndpointGroupAssociations.
13597#[derive(Clone, Default, PartialEq)]
13598#[non_exhaustive]
13599pub struct ListInterceptEndpointGroupAssociationsRequest {
13600 /// Required. The parent, which owns this collection of associations.
13601 /// Example: `projects/123456789/locations/global`.
13602 /// See <https://google.aip.dev/132> for more details.
13603 pub parent: std::string::String,
13604
13605 /// Optional. Requested page size. Server may return fewer items than
13606 /// requested. If unspecified, server will pick an appropriate default. See
13607 /// <https://google.aip.dev/158> for more details.
13608 pub page_size: i32,
13609
13610 /// Optional. A page token, received from a previous
13611 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
13612 /// page. When paginating, all other parameters provided to
13613 /// `ListInterceptEndpointGroups` must match the call that provided the page
13614 /// token. See <https://google.aip.dev/158> for more details.
13615 pub page_token: std::string::String,
13616
13617 /// Optional. Filter expression.
13618 /// See <https://google.aip.dev/160#filtering> for more details.
13619 pub filter: std::string::String,
13620
13621 /// Optional. Sort expression.
13622 /// See <https://google.aip.dev/132#ordering> for more details.
13623 pub order_by: std::string::String,
13624
13625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13626}
13627
13628impl ListInterceptEndpointGroupAssociationsRequest {
13629 /// Creates a new default instance.
13630 pub fn new() -> Self {
13631 std::default::Default::default()
13632 }
13633
13634 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
13635 ///
13636 /// # Example
13637 /// ```ignore,no_run
13638 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13639 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_parent("example");
13640 /// ```
13641 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13642 self.parent = v.into();
13643 self
13644 }
13645
13646 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
13647 ///
13648 /// # Example
13649 /// ```ignore,no_run
13650 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13651 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_size(42);
13652 /// ```
13653 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13654 self.page_size = v.into();
13655 self
13656 }
13657
13658 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
13659 ///
13660 /// # Example
13661 /// ```ignore,no_run
13662 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13663 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_token("example");
13664 /// ```
13665 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13666 self.page_token = v.into();
13667 self
13668 }
13669
13670 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
13671 ///
13672 /// # Example
13673 /// ```ignore,no_run
13674 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13675 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_filter("example");
13676 /// ```
13677 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13678 self.filter = v.into();
13679 self
13680 }
13681
13682 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
13683 ///
13684 /// # Example
13685 /// ```ignore,no_run
13686 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13687 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_order_by("example");
13688 /// ```
13689 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13690 self.order_by = v.into();
13691 self
13692 }
13693}
13694
13695impl wkt::message::Message for ListInterceptEndpointGroupAssociationsRequest {
13696 fn typename() -> &'static str {
13697 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest"
13698 }
13699}
13700
13701/// Response message for ListInterceptEndpointGroupAssociations.
13702#[derive(Clone, Default, PartialEq)]
13703#[non_exhaustive]
13704pub struct ListInterceptEndpointGroupAssociationsResponse {
13705 /// The associations from the specified parent.
13706 pub intercept_endpoint_group_associations:
13707 std::vec::Vec<crate::model::InterceptEndpointGroupAssociation>,
13708
13709 /// A token that can be sent as `page_token` to retrieve the next page.
13710 /// If this field is omitted, there are no subsequent pages.
13711 /// See <https://google.aip.dev/158> for more details.
13712 pub next_page_token: std::string::String,
13713
13714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13715}
13716
13717impl ListInterceptEndpointGroupAssociationsResponse {
13718 /// Creates a new default instance.
13719 pub fn new() -> Self {
13720 std::default::Default::default()
13721 }
13722
13723 /// Sets the value of [intercept_endpoint_group_associations][crate::model::ListInterceptEndpointGroupAssociationsResponse::intercept_endpoint_group_associations].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13728 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13729 /// let x = ListInterceptEndpointGroupAssociationsResponse::new()
13730 /// .set_intercept_endpoint_group_associations([
13731 /// InterceptEndpointGroupAssociation::default()/* use setters */,
13732 /// InterceptEndpointGroupAssociation::default()/* use (different) setters */,
13733 /// ]);
13734 /// ```
13735 pub fn set_intercept_endpoint_group_associations<T, V>(mut self, v: T) -> Self
13736 where
13737 T: std::iter::IntoIterator<Item = V>,
13738 V: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13739 {
13740 use std::iter::Iterator;
13741 self.intercept_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
13742 self
13743 }
13744
13745 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupAssociationsResponse::next_page_token].
13746 ///
13747 /// # Example
13748 /// ```ignore,no_run
13749 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13750 /// let x = ListInterceptEndpointGroupAssociationsResponse::new().set_next_page_token("example");
13751 /// ```
13752 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13753 self.next_page_token = v.into();
13754 self
13755 }
13756}
13757
13758impl wkt::message::Message for ListInterceptEndpointGroupAssociationsResponse {
13759 fn typename() -> &'static str {
13760 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse"
13761 }
13762}
13763
13764#[doc(hidden)]
13765impl google_cloud_gax::paginator::internal::PageableResponse
13766 for ListInterceptEndpointGroupAssociationsResponse
13767{
13768 type PageItem = crate::model::InterceptEndpointGroupAssociation;
13769
13770 fn items(self) -> std::vec::Vec<Self::PageItem> {
13771 self.intercept_endpoint_group_associations
13772 }
13773
13774 fn next_page_token(&self) -> std::string::String {
13775 use std::clone::Clone;
13776 self.next_page_token.clone()
13777 }
13778}
13779
13780/// Request message for GetInterceptEndpointGroupAssociation.
13781#[derive(Clone, Default, PartialEq)]
13782#[non_exhaustive]
13783pub struct GetInterceptEndpointGroupAssociationRequest {
13784 /// Required. The name of the association to retrieve.
13785 /// Format:
13786 /// projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}
13787 pub name: std::string::String,
13788
13789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13790}
13791
13792impl GetInterceptEndpointGroupAssociationRequest {
13793 /// Creates a new default instance.
13794 pub fn new() -> Self {
13795 std::default::Default::default()
13796 }
13797
13798 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
13799 ///
13800 /// # Example
13801 /// ```ignore,no_run
13802 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupAssociationRequest;
13803 /// let x = GetInterceptEndpointGroupAssociationRequest::new().set_name("example");
13804 /// ```
13805 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13806 self.name = v.into();
13807 self
13808 }
13809}
13810
13811impl wkt::message::Message for GetInterceptEndpointGroupAssociationRequest {
13812 fn typename() -> &'static str {
13813 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest"
13814 }
13815}
13816
13817/// Request message for CreateInterceptEndpointGroupAssociation.
13818#[derive(Clone, Default, PartialEq)]
13819#[non_exhaustive]
13820pub struct CreateInterceptEndpointGroupAssociationRequest {
13821 /// Required. The parent resource where this association will be created.
13822 /// Format: projects/{project}/locations/{location}
13823 pub parent: std::string::String,
13824
13825 /// Optional. The ID to use for the new association, which will become the
13826 /// final component of the endpoint group's resource name. If not provided, the
13827 /// server will generate a unique ID.
13828 pub intercept_endpoint_group_association_id: std::string::String,
13829
13830 /// Required. The association to create.
13831 pub intercept_endpoint_group_association:
13832 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
13833
13834 /// Optional. A unique identifier for this request. Must be a UUID4.
13835 /// This request is only idempotent if a `request_id` is provided.
13836 /// See <https://google.aip.dev/155> for more details.
13837 pub request_id: std::string::String,
13838
13839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13840}
13841
13842impl CreateInterceptEndpointGroupAssociationRequest {
13843 /// Creates a new default instance.
13844 pub fn new() -> Self {
13845 std::default::Default::default()
13846 }
13847
13848 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
13849 ///
13850 /// # Example
13851 /// ```ignore,no_run
13852 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13853 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_parent("example");
13854 /// ```
13855 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13856 self.parent = v.into();
13857 self
13858 }
13859
13860 /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
13861 ///
13862 /// # Example
13863 /// ```ignore,no_run
13864 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13865 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association_id("example");
13866 /// ```
13867 pub fn set_intercept_endpoint_group_association_id<
13868 T: std::convert::Into<std::string::String>,
13869 >(
13870 mut self,
13871 v: T,
13872 ) -> Self {
13873 self.intercept_endpoint_group_association_id = v.into();
13874 self
13875 }
13876
13877 /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13878 ///
13879 /// # Example
13880 /// ```ignore,no_run
13881 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13882 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13883 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
13884 /// ```
13885 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
13886 where
13887 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13888 {
13889 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
13890 self
13891 }
13892
13893 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13894 ///
13895 /// # Example
13896 /// ```ignore,no_run
13897 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13898 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13899 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
13900 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
13901 /// ```
13902 pub fn set_or_clear_intercept_endpoint_group_association<T>(
13903 mut self,
13904 v: std::option::Option<T>,
13905 ) -> Self
13906 where
13907 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13908 {
13909 self.intercept_endpoint_group_association = v.map(|x| x.into());
13910 self
13911 }
13912
13913 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
13914 ///
13915 /// # Example
13916 /// ```ignore,no_run
13917 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13918 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
13919 /// ```
13920 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13921 self.request_id = v.into();
13922 self
13923 }
13924}
13925
13926impl wkt::message::Message for CreateInterceptEndpointGroupAssociationRequest {
13927 fn typename() -> &'static str {
13928 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest"
13929 }
13930}
13931
13932/// Request message for UpdateInterceptEndpointGroupAssociation.
13933#[derive(Clone, Default, PartialEq)]
13934#[non_exhaustive]
13935pub struct UpdateInterceptEndpointGroupAssociationRequest {
13936 /// Optional. The list of fields to update.
13937 /// Fields are specified relative to the association
13938 /// (e.g. `description`; *not*
13939 /// `intercept_endpoint_group_association.description`). See
13940 /// <https://google.aip.dev/161> for more details.
13941 pub update_mask: std::option::Option<wkt::FieldMask>,
13942
13943 /// Required. The association to update.
13944 pub intercept_endpoint_group_association:
13945 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
13946
13947 /// Optional. A unique identifier for this request. Must be a UUID4.
13948 /// This request is only idempotent if a `request_id` is provided.
13949 /// See <https://google.aip.dev/155> for more details.
13950 pub request_id: std::string::String,
13951
13952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13953}
13954
13955impl UpdateInterceptEndpointGroupAssociationRequest {
13956 /// Creates a new default instance.
13957 pub fn new() -> Self {
13958 std::default::Default::default()
13959 }
13960
13961 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
13962 ///
13963 /// # Example
13964 /// ```ignore,no_run
13965 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13966 /// use wkt::FieldMask;
13967 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13968 /// ```
13969 pub fn set_update_mask<T>(mut self, v: T) -> Self
13970 where
13971 T: std::convert::Into<wkt::FieldMask>,
13972 {
13973 self.update_mask = std::option::Option::Some(v.into());
13974 self
13975 }
13976
13977 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
13978 ///
13979 /// # Example
13980 /// ```ignore,no_run
13981 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13982 /// use wkt::FieldMask;
13983 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13984 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13985 /// ```
13986 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13987 where
13988 T: std::convert::Into<wkt::FieldMask>,
13989 {
13990 self.update_mask = v.map(|x| x.into());
13991 self
13992 }
13993
13994 /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13995 ///
13996 /// # Example
13997 /// ```ignore,no_run
13998 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13999 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14000 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
14001 /// ```
14002 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
14003 where
14004 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14005 {
14006 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
14007 self
14008 }
14009
14010 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14011 ///
14012 /// # Example
14013 /// ```ignore,no_run
14014 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14015 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14016 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
14017 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
14018 /// ```
14019 pub fn set_or_clear_intercept_endpoint_group_association<T>(
14020 mut self,
14021 v: std::option::Option<T>,
14022 ) -> Self
14023 where
14024 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14025 {
14026 self.intercept_endpoint_group_association = v.map(|x| x.into());
14027 self
14028 }
14029
14030 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
14031 ///
14032 /// # Example
14033 /// ```ignore,no_run
14034 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14035 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14036 /// ```
14037 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14038 self.request_id = v.into();
14039 self
14040 }
14041}
14042
14043impl wkt::message::Message for UpdateInterceptEndpointGroupAssociationRequest {
14044 fn typename() -> &'static str {
14045 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest"
14046 }
14047}
14048
14049/// Request message for DeleteInterceptEndpointGroupAssociation.
14050#[derive(Clone, Default, PartialEq)]
14051#[non_exhaustive]
14052pub struct DeleteInterceptEndpointGroupAssociationRequest {
14053 /// Required. The association to delete.
14054 pub name: std::string::String,
14055
14056 /// Optional. A unique identifier for this request. Must be a UUID4.
14057 /// This request is only idempotent if a `request_id` is provided.
14058 /// See <https://google.aip.dev/155> for more details.
14059 pub request_id: std::string::String,
14060
14061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14062}
14063
14064impl DeleteInterceptEndpointGroupAssociationRequest {
14065 /// Creates a new default instance.
14066 pub fn new() -> Self {
14067 std::default::Default::default()
14068 }
14069
14070 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
14071 ///
14072 /// # Example
14073 /// ```ignore,no_run
14074 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14075 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_name("example");
14076 /// ```
14077 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14078 self.name = v.into();
14079 self
14080 }
14081
14082 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
14083 ///
14084 /// # Example
14085 /// ```ignore,no_run
14086 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14087 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14088 /// ```
14089 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14090 self.request_id = v.into();
14091 self
14092 }
14093}
14094
14095impl wkt::message::Message for DeleteInterceptEndpointGroupAssociationRequest {
14096 fn typename() -> &'static str {
14097 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest"
14098 }
14099}
14100
14101/// A deployment group aggregates many zonal intercept backends (deployments)
14102/// into a single global intercept service. Consumers can connect this service
14103/// using an endpoint group.
14104#[derive(Clone, Default, PartialEq)]
14105#[non_exhaustive]
14106pub struct InterceptDeploymentGroup {
14107 /// Immutable. Identifier. The resource name of this deployment group, for
14108 /// example:
14109 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
14110 /// See <https://google.aip.dev/122> for more details.
14111 pub name: std::string::String,
14112
14113 /// Output only. The timestamp when the resource was created.
14114 /// See <https://google.aip.dev/148#timestamps>.
14115 pub create_time: std::option::Option<wkt::Timestamp>,
14116
14117 /// Output only. The timestamp when the resource was most recently updated.
14118 /// See <https://google.aip.dev/148#timestamps>.
14119 pub update_time: std::option::Option<wkt::Timestamp>,
14120
14121 /// Optional. Labels are key/value pairs that help to organize and filter
14122 /// resources.
14123 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14124
14125 /// Required. Immutable. The network that will be used for all child
14126 /// deployments, for example: `projects/{project}/global/networks/{network}`.
14127 /// See <https://google.aip.dev/124>.
14128 pub network: std::string::String,
14129
14130 /// Output only. The list of endpoint groups that are connected to this
14131 /// resource.
14132 pub connected_endpoint_groups:
14133 std::vec::Vec<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14134
14135 /// Output only. The list of Intercept Deployments that belong to this group.
14136 #[deprecated]
14137 pub nested_deployments: std::vec::Vec<crate::model::intercept_deployment_group::Deployment>,
14138
14139 /// Output only. The current state of the deployment group.
14140 /// See <https://google.aip.dev/216>.
14141 pub state: crate::model::intercept_deployment_group::State,
14142
14143 /// Output only. The current state of the resource does not match the user's
14144 /// intended state, and the system is working to reconcile them. This is part
14145 /// of the normal operation (e.g. adding a new deployment to the group) See
14146 /// <https://google.aip.dev/128>.
14147 pub reconciling: bool,
14148
14149 /// Optional. User-provided description of the deployment group.
14150 /// Used as additional context for the deployment group.
14151 pub description: std::string::String,
14152
14153 /// Output only. The list of locations where the deployment group is present.
14154 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
14155
14156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14157}
14158
14159impl InterceptDeploymentGroup {
14160 /// Creates a new default instance.
14161 pub fn new() -> Self {
14162 std::default::Default::default()
14163 }
14164
14165 /// Sets the value of [name][crate::model::InterceptDeploymentGroup::name].
14166 ///
14167 /// # Example
14168 /// ```ignore,no_run
14169 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14170 /// let x = InterceptDeploymentGroup::new().set_name("example");
14171 /// ```
14172 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14173 self.name = v.into();
14174 self
14175 }
14176
14177 /// Sets the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14178 ///
14179 /// # Example
14180 /// ```ignore,no_run
14181 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14182 /// use wkt::Timestamp;
14183 /// let x = InterceptDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
14184 /// ```
14185 pub fn set_create_time<T>(mut self, v: T) -> Self
14186 where
14187 T: std::convert::Into<wkt::Timestamp>,
14188 {
14189 self.create_time = std::option::Option::Some(v.into());
14190 self
14191 }
14192
14193 /// Sets or clears the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14194 ///
14195 /// # Example
14196 /// ```ignore,no_run
14197 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14198 /// use wkt::Timestamp;
14199 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14200 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
14201 /// ```
14202 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14203 where
14204 T: std::convert::Into<wkt::Timestamp>,
14205 {
14206 self.create_time = v.map(|x| x.into());
14207 self
14208 }
14209
14210 /// Sets the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14211 ///
14212 /// # Example
14213 /// ```ignore,no_run
14214 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14215 /// use wkt::Timestamp;
14216 /// let x = InterceptDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
14217 /// ```
14218 pub fn set_update_time<T>(mut self, v: T) -> Self
14219 where
14220 T: std::convert::Into<wkt::Timestamp>,
14221 {
14222 self.update_time = std::option::Option::Some(v.into());
14223 self
14224 }
14225
14226 /// Sets or clears the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14227 ///
14228 /// # Example
14229 /// ```ignore,no_run
14230 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14231 /// use wkt::Timestamp;
14232 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14233 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
14234 /// ```
14235 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14236 where
14237 T: std::convert::Into<wkt::Timestamp>,
14238 {
14239 self.update_time = v.map(|x| x.into());
14240 self
14241 }
14242
14243 /// Sets the value of [labels][crate::model::InterceptDeploymentGroup::labels].
14244 ///
14245 /// # Example
14246 /// ```ignore,no_run
14247 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14248 /// let x = InterceptDeploymentGroup::new().set_labels([
14249 /// ("key0", "abc"),
14250 /// ("key1", "xyz"),
14251 /// ]);
14252 /// ```
14253 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14254 where
14255 T: std::iter::IntoIterator<Item = (K, V)>,
14256 K: std::convert::Into<std::string::String>,
14257 V: std::convert::Into<std::string::String>,
14258 {
14259 use std::iter::Iterator;
14260 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14261 self
14262 }
14263
14264 /// Sets the value of [network][crate::model::InterceptDeploymentGroup::network].
14265 ///
14266 /// # Example
14267 /// ```ignore,no_run
14268 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14269 /// let x = InterceptDeploymentGroup::new().set_network("example");
14270 /// ```
14271 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14272 self.network = v.into();
14273 self
14274 }
14275
14276 /// Sets the value of [connected_endpoint_groups][crate::model::InterceptDeploymentGroup::connected_endpoint_groups].
14277 ///
14278 /// # Example
14279 /// ```ignore,no_run
14280 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14281 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14282 /// let x = InterceptDeploymentGroup::new()
14283 /// .set_connected_endpoint_groups([
14284 /// ConnectedEndpointGroup::default()/* use setters */,
14285 /// ConnectedEndpointGroup::default()/* use (different) setters */,
14286 /// ]);
14287 /// ```
14288 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
14289 where
14290 T: std::iter::IntoIterator<Item = V>,
14291 V: std::convert::Into<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14292 {
14293 use std::iter::Iterator;
14294 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
14295 self
14296 }
14297
14298 /// Sets the value of [nested_deployments][crate::model::InterceptDeploymentGroup::nested_deployments].
14299 ///
14300 /// # Example
14301 /// ```ignore,no_run
14302 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14303 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14304 /// let x = InterceptDeploymentGroup::new()
14305 /// .set_nested_deployments([
14306 /// Deployment::default()/* use setters */,
14307 /// Deployment::default()/* use (different) setters */,
14308 /// ]);
14309 /// ```
14310 #[deprecated]
14311 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
14312 where
14313 T: std::iter::IntoIterator<Item = V>,
14314 V: std::convert::Into<crate::model::intercept_deployment_group::Deployment>,
14315 {
14316 use std::iter::Iterator;
14317 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
14318 self
14319 }
14320
14321 /// Sets the value of [state][crate::model::InterceptDeploymentGroup::state].
14322 ///
14323 /// # Example
14324 /// ```ignore,no_run
14325 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14326 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::State;
14327 /// let x0 = InterceptDeploymentGroup::new().set_state(State::Active);
14328 /// let x1 = InterceptDeploymentGroup::new().set_state(State::Creating);
14329 /// let x2 = InterceptDeploymentGroup::new().set_state(State::Deleting);
14330 /// ```
14331 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment_group::State>>(
14332 mut self,
14333 v: T,
14334 ) -> Self {
14335 self.state = v.into();
14336 self
14337 }
14338
14339 /// Sets the value of [reconciling][crate::model::InterceptDeploymentGroup::reconciling].
14340 ///
14341 /// # Example
14342 /// ```ignore,no_run
14343 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14344 /// let x = InterceptDeploymentGroup::new().set_reconciling(true);
14345 /// ```
14346 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14347 self.reconciling = v.into();
14348 self
14349 }
14350
14351 /// Sets the value of [description][crate::model::InterceptDeploymentGroup::description].
14352 ///
14353 /// # Example
14354 /// ```ignore,no_run
14355 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14356 /// let x = InterceptDeploymentGroup::new().set_description("example");
14357 /// ```
14358 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14359 self.description = v.into();
14360 self
14361 }
14362
14363 /// Sets the value of [locations][crate::model::InterceptDeploymentGroup::locations].
14364 ///
14365 /// # Example
14366 /// ```ignore,no_run
14367 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14368 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
14369 /// let x = InterceptDeploymentGroup::new()
14370 /// .set_locations([
14371 /// InterceptLocation::default()/* use setters */,
14372 /// InterceptLocation::default()/* use (different) setters */,
14373 /// ]);
14374 /// ```
14375 pub fn set_locations<T, V>(mut self, v: T) -> Self
14376 where
14377 T: std::iter::IntoIterator<Item = V>,
14378 V: std::convert::Into<crate::model::InterceptLocation>,
14379 {
14380 use std::iter::Iterator;
14381 self.locations = v.into_iter().map(|i| i.into()).collect();
14382 self
14383 }
14384}
14385
14386impl wkt::message::Message for InterceptDeploymentGroup {
14387 fn typename() -> &'static str {
14388 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup"
14389 }
14390}
14391
14392/// Defines additional types related to [InterceptDeploymentGroup].
14393pub mod intercept_deployment_group {
14394 #[allow(unused_imports)]
14395 use super::*;
14396
14397 /// An endpoint group connected to this deployment group.
14398 #[derive(Clone, Default, PartialEq)]
14399 #[non_exhaustive]
14400 pub struct ConnectedEndpointGroup {
14401 /// Output only. The connected endpoint group's resource name, for example:
14402 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
14403 /// See <https://google.aip.dev/124>.
14404 pub name: std::string::String,
14405
14406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14407 }
14408
14409 impl ConnectedEndpointGroup {
14410 /// Creates a new default instance.
14411 pub fn new() -> Self {
14412 std::default::Default::default()
14413 }
14414
14415 /// Sets the value of [name][crate::model::intercept_deployment_group::ConnectedEndpointGroup::name].
14416 ///
14417 /// # Example
14418 /// ```ignore,no_run
14419 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14420 /// let x = ConnectedEndpointGroup::new().set_name("example");
14421 /// ```
14422 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14423 self.name = v.into();
14424 self
14425 }
14426 }
14427
14428 impl wkt::message::Message for ConnectedEndpointGroup {
14429 fn typename() -> &'static str {
14430 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup"
14431 }
14432 }
14433
14434 /// A deployment belonging to this deployment group.
14435 #[derive(Clone, Default, PartialEq)]
14436 #[non_exhaustive]
14437 pub struct Deployment {
14438 /// Output only. The name of the Intercept Deployment, in the format:
14439 /// `projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}`.
14440 pub name: std::string::String,
14441
14442 /// Output only. Most recent known state of the deployment.
14443 pub state: crate::model::intercept_deployment::State,
14444
14445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14446 }
14447
14448 impl Deployment {
14449 /// Creates a new default instance.
14450 pub fn new() -> Self {
14451 std::default::Default::default()
14452 }
14453
14454 /// Sets the value of [name][crate::model::intercept_deployment_group::Deployment::name].
14455 ///
14456 /// # Example
14457 /// ```ignore,no_run
14458 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14459 /// let x = Deployment::new().set_name("example");
14460 /// ```
14461 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14462 self.name = v.into();
14463 self
14464 }
14465
14466 /// Sets the value of [state][crate::model::intercept_deployment_group::Deployment::state].
14467 ///
14468 /// # Example
14469 /// ```ignore,no_run
14470 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14471 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
14472 /// let x0 = Deployment::new().set_state(State::Active);
14473 /// let x1 = Deployment::new().set_state(State::Creating);
14474 /// let x2 = Deployment::new().set_state(State::Deleting);
14475 /// ```
14476 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
14477 mut self,
14478 v: T,
14479 ) -> Self {
14480 self.state = v.into();
14481 self
14482 }
14483 }
14484
14485 impl wkt::message::Message for Deployment {
14486 fn typename() -> &'static str {
14487 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment"
14488 }
14489 }
14490
14491 /// The current state of the deployment group.
14492 ///
14493 /// # Working with unknown values
14494 ///
14495 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14496 /// additional enum variants at any time. Adding new variants is not considered
14497 /// a breaking change. Applications should write their code in anticipation of:
14498 ///
14499 /// - New values appearing in future releases of the client library, **and**
14500 /// - New values received dynamically, without application changes.
14501 ///
14502 /// Please consult the [Working with enums] section in the user guide for some
14503 /// guidelines.
14504 ///
14505 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14506 #[derive(Clone, Debug, PartialEq)]
14507 #[non_exhaustive]
14508 pub enum State {
14509 /// State not set (this is not a valid state).
14510 Unspecified,
14511 /// The deployment group is ready.
14512 Active,
14513 /// The deployment group is being created.
14514 Creating,
14515 /// The deployment group is being deleted.
14516 Deleting,
14517 /// If set, the enum was initialized with an unknown value.
14518 ///
14519 /// Applications can examine the value using [State::value] or
14520 /// [State::name].
14521 UnknownValue(state::UnknownValue),
14522 }
14523
14524 #[doc(hidden)]
14525 pub mod state {
14526 #[allow(unused_imports)]
14527 use super::*;
14528 #[derive(Clone, Debug, PartialEq)]
14529 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14530 }
14531
14532 impl State {
14533 /// Gets the enum value.
14534 ///
14535 /// Returns `None` if the enum contains an unknown value deserialized from
14536 /// the string representation of enums.
14537 pub fn value(&self) -> std::option::Option<i32> {
14538 match self {
14539 Self::Unspecified => std::option::Option::Some(0),
14540 Self::Active => std::option::Option::Some(1),
14541 Self::Creating => std::option::Option::Some(2),
14542 Self::Deleting => std::option::Option::Some(3),
14543 Self::UnknownValue(u) => u.0.value(),
14544 }
14545 }
14546
14547 /// Gets the enum value as a string.
14548 ///
14549 /// Returns `None` if the enum contains an unknown value deserialized from
14550 /// the integer representation of enums.
14551 pub fn name(&self) -> std::option::Option<&str> {
14552 match self {
14553 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14554 Self::Active => std::option::Option::Some("ACTIVE"),
14555 Self::Creating => std::option::Option::Some("CREATING"),
14556 Self::Deleting => std::option::Option::Some("DELETING"),
14557 Self::UnknownValue(u) => u.0.name(),
14558 }
14559 }
14560 }
14561
14562 impl std::default::Default for State {
14563 fn default() -> Self {
14564 use std::convert::From;
14565 Self::from(0)
14566 }
14567 }
14568
14569 impl std::fmt::Display for State {
14570 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14571 wkt::internal::display_enum(f, self.name(), self.value())
14572 }
14573 }
14574
14575 impl std::convert::From<i32> for State {
14576 fn from(value: i32) -> Self {
14577 match value {
14578 0 => Self::Unspecified,
14579 1 => Self::Active,
14580 2 => Self::Creating,
14581 3 => Self::Deleting,
14582 _ => Self::UnknownValue(state::UnknownValue(
14583 wkt::internal::UnknownEnumValue::Integer(value),
14584 )),
14585 }
14586 }
14587 }
14588
14589 impl std::convert::From<&str> for State {
14590 fn from(value: &str) -> Self {
14591 use std::string::ToString;
14592 match value {
14593 "STATE_UNSPECIFIED" => Self::Unspecified,
14594 "ACTIVE" => Self::Active,
14595 "CREATING" => Self::Creating,
14596 "DELETING" => Self::Deleting,
14597 _ => Self::UnknownValue(state::UnknownValue(
14598 wkt::internal::UnknownEnumValue::String(value.to_string()),
14599 )),
14600 }
14601 }
14602 }
14603
14604 impl serde::ser::Serialize for State {
14605 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14606 where
14607 S: serde::Serializer,
14608 {
14609 match self {
14610 Self::Unspecified => serializer.serialize_i32(0),
14611 Self::Active => serializer.serialize_i32(1),
14612 Self::Creating => serializer.serialize_i32(2),
14613 Self::Deleting => serializer.serialize_i32(3),
14614 Self::UnknownValue(u) => u.0.serialize(serializer),
14615 }
14616 }
14617 }
14618
14619 impl<'de> serde::de::Deserialize<'de> for State {
14620 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14621 where
14622 D: serde::Deserializer<'de>,
14623 {
14624 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14625 ".google.cloud.networksecurity.v1.InterceptDeploymentGroup.State",
14626 ))
14627 }
14628 }
14629}
14630
14631/// Request message for ListInterceptDeploymentGroups.
14632#[derive(Clone, Default, PartialEq)]
14633#[non_exhaustive]
14634pub struct ListInterceptDeploymentGroupsRequest {
14635 /// Required. The parent, which owns this collection of deployment groups.
14636 /// Example: `projects/123456789/locations/global`.
14637 /// See <https://google.aip.dev/132> for more details.
14638 pub parent: std::string::String,
14639
14640 /// Optional. Requested page size. Server may return fewer items than
14641 /// requested. If unspecified, server will pick an appropriate default. See
14642 /// <https://google.aip.dev/158> for more details.
14643 pub page_size: i32,
14644
14645 /// Optional. A page token, received from a previous
14646 /// `ListInterceptDeploymentGroups` call. Provide this to retrieve the
14647 /// subsequent page. When paginating, all other parameters provided to
14648 /// `ListInterceptDeploymentGroups` must match the call that provided the page
14649 /// token. See <https://google.aip.dev/158> for more details.
14650 pub page_token: std::string::String,
14651
14652 /// Optional. Filter expression.
14653 /// See <https://google.aip.dev/160#filtering> for more details.
14654 pub filter: std::string::String,
14655
14656 /// Optional. Sort expression.
14657 /// See <https://google.aip.dev/132#ordering> for more details.
14658 pub order_by: std::string::String,
14659
14660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14661}
14662
14663impl ListInterceptDeploymentGroupsRequest {
14664 /// Creates a new default instance.
14665 pub fn new() -> Self {
14666 std::default::Default::default()
14667 }
14668
14669 /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
14670 ///
14671 /// # Example
14672 /// ```ignore,no_run
14673 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14674 /// let x = ListInterceptDeploymentGroupsRequest::new().set_parent("example");
14675 /// ```
14676 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14677 self.parent = v.into();
14678 self
14679 }
14680
14681 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
14682 ///
14683 /// # Example
14684 /// ```ignore,no_run
14685 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14686 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_size(42);
14687 /// ```
14688 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14689 self.page_size = v.into();
14690 self
14691 }
14692
14693 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
14694 ///
14695 /// # Example
14696 /// ```ignore,no_run
14697 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14698 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_token("example");
14699 /// ```
14700 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14701 self.page_token = v.into();
14702 self
14703 }
14704
14705 /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
14706 ///
14707 /// # Example
14708 /// ```ignore,no_run
14709 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14710 /// let x = ListInterceptDeploymentGroupsRequest::new().set_filter("example");
14711 /// ```
14712 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14713 self.filter = v.into();
14714 self
14715 }
14716
14717 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
14718 ///
14719 /// # Example
14720 /// ```ignore,no_run
14721 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14722 /// let x = ListInterceptDeploymentGroupsRequest::new().set_order_by("example");
14723 /// ```
14724 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14725 self.order_by = v.into();
14726 self
14727 }
14728}
14729
14730impl wkt::message::Message for ListInterceptDeploymentGroupsRequest {
14731 fn typename() -> &'static str {
14732 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest"
14733 }
14734}
14735
14736/// Response message for ListInterceptDeploymentGroups.
14737#[derive(Clone, Default, PartialEq)]
14738#[non_exhaustive]
14739pub struct ListInterceptDeploymentGroupsResponse {
14740 /// The deployment groups from the specified parent.
14741 pub intercept_deployment_groups: std::vec::Vec<crate::model::InterceptDeploymentGroup>,
14742
14743 /// A token that can be sent as `page_token` to retrieve the next page.
14744 /// If this field is omitted, there are no subsequent pages.
14745 /// See <https://google.aip.dev/158> for more details.
14746 pub next_page_token: std::string::String,
14747
14748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14749}
14750
14751impl ListInterceptDeploymentGroupsResponse {
14752 /// Creates a new default instance.
14753 pub fn new() -> Self {
14754 std::default::Default::default()
14755 }
14756
14757 /// Sets the value of [intercept_deployment_groups][crate::model::ListInterceptDeploymentGroupsResponse::intercept_deployment_groups].
14758 ///
14759 /// # Example
14760 /// ```ignore,no_run
14761 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
14762 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14763 /// let x = ListInterceptDeploymentGroupsResponse::new()
14764 /// .set_intercept_deployment_groups([
14765 /// InterceptDeploymentGroup::default()/* use setters */,
14766 /// InterceptDeploymentGroup::default()/* use (different) setters */,
14767 /// ]);
14768 /// ```
14769 pub fn set_intercept_deployment_groups<T, V>(mut self, v: T) -> Self
14770 where
14771 T: std::iter::IntoIterator<Item = V>,
14772 V: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14773 {
14774 use std::iter::Iterator;
14775 self.intercept_deployment_groups = v.into_iter().map(|i| i.into()).collect();
14776 self
14777 }
14778
14779 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentGroupsResponse::next_page_token].
14780 ///
14781 /// # Example
14782 /// ```ignore,no_run
14783 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
14784 /// let x = ListInterceptDeploymentGroupsResponse::new().set_next_page_token("example");
14785 /// ```
14786 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14787 self.next_page_token = v.into();
14788 self
14789 }
14790}
14791
14792impl wkt::message::Message for ListInterceptDeploymentGroupsResponse {
14793 fn typename() -> &'static str {
14794 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse"
14795 }
14796}
14797
14798#[doc(hidden)]
14799impl google_cloud_gax::paginator::internal::PageableResponse
14800 for ListInterceptDeploymentGroupsResponse
14801{
14802 type PageItem = crate::model::InterceptDeploymentGroup;
14803
14804 fn items(self) -> std::vec::Vec<Self::PageItem> {
14805 self.intercept_deployment_groups
14806 }
14807
14808 fn next_page_token(&self) -> std::string::String {
14809 use std::clone::Clone;
14810 self.next_page_token.clone()
14811 }
14812}
14813
14814/// Request message for GetInterceptDeploymentGroup.
14815#[derive(Clone, Default, PartialEq)]
14816#[non_exhaustive]
14817pub struct GetInterceptDeploymentGroupRequest {
14818 /// Required. The name of the deployment group to retrieve.
14819 /// Format:
14820 /// projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}
14821 pub name: std::string::String,
14822
14823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14824}
14825
14826impl GetInterceptDeploymentGroupRequest {
14827 /// Creates a new default instance.
14828 pub fn new() -> Self {
14829 std::default::Default::default()
14830 }
14831
14832 /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
14833 ///
14834 /// # Example
14835 /// ```ignore,no_run
14836 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentGroupRequest;
14837 /// let x = GetInterceptDeploymentGroupRequest::new().set_name("example");
14838 /// ```
14839 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14840 self.name = v.into();
14841 self
14842 }
14843}
14844
14845impl wkt::message::Message for GetInterceptDeploymentGroupRequest {
14846 fn typename() -> &'static str {
14847 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest"
14848 }
14849}
14850
14851/// Request message for CreateInterceptDeploymentGroup.
14852#[derive(Clone, Default, PartialEq)]
14853#[non_exhaustive]
14854pub struct CreateInterceptDeploymentGroupRequest {
14855 /// Required. The parent resource where this deployment group will be created.
14856 /// Format: projects/{project}/locations/{location}
14857 pub parent: std::string::String,
14858
14859 /// Required. The ID to use for the new deployment group, which will become the
14860 /// final component of the deployment group's resource name.
14861 pub intercept_deployment_group_id: std::string::String,
14862
14863 /// Required. The deployment group to create.
14864 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
14865
14866 /// Optional. A unique identifier for this request. Must be a UUID4.
14867 /// This request is only idempotent if a `request_id` is provided.
14868 /// See <https://google.aip.dev/155> for more details.
14869 pub request_id: std::string::String,
14870
14871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14872}
14873
14874impl CreateInterceptDeploymentGroupRequest {
14875 /// Creates a new default instance.
14876 pub fn new() -> Self {
14877 std::default::Default::default()
14878 }
14879
14880 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
14881 ///
14882 /// # Example
14883 /// ```ignore,no_run
14884 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14885 /// let x = CreateInterceptDeploymentGroupRequest::new().set_parent("example");
14886 /// ```
14887 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14888 self.parent = v.into();
14889 self
14890 }
14891
14892 /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
14893 ///
14894 /// # Example
14895 /// ```ignore,no_run
14896 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14897 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group_id("example");
14898 /// ```
14899 pub fn set_intercept_deployment_group_id<T: std::convert::Into<std::string::String>>(
14900 mut self,
14901 v: T,
14902 ) -> Self {
14903 self.intercept_deployment_group_id = v.into();
14904 self
14905 }
14906
14907 /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
14908 ///
14909 /// # Example
14910 /// ```ignore,no_run
14911 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14912 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14913 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
14914 /// ```
14915 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
14916 where
14917 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14918 {
14919 self.intercept_deployment_group = std::option::Option::Some(v.into());
14920 self
14921 }
14922
14923 /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
14924 ///
14925 /// # Example
14926 /// ```ignore,no_run
14927 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14928 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14929 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
14930 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
14931 /// ```
14932 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
14933 where
14934 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14935 {
14936 self.intercept_deployment_group = v.map(|x| x.into());
14937 self
14938 }
14939
14940 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
14941 ///
14942 /// # Example
14943 /// ```ignore,no_run
14944 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14945 /// let x = CreateInterceptDeploymentGroupRequest::new().set_request_id("example");
14946 /// ```
14947 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14948 self.request_id = v.into();
14949 self
14950 }
14951}
14952
14953impl wkt::message::Message for CreateInterceptDeploymentGroupRequest {
14954 fn typename() -> &'static str {
14955 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest"
14956 }
14957}
14958
14959/// Request message for UpdateInterceptDeploymentGroup.
14960#[derive(Clone, Default, PartialEq)]
14961#[non_exhaustive]
14962pub struct UpdateInterceptDeploymentGroupRequest {
14963 /// Optional. The list of fields to update.
14964 /// Fields are specified relative to the deployment group
14965 /// (e.g. `description`; *not*
14966 /// `intercept_deployment_group.description`). See
14967 /// <https://google.aip.dev/161> for more details.
14968 pub update_mask: std::option::Option<wkt::FieldMask>,
14969
14970 /// Required. The deployment group to update.
14971 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
14972
14973 /// Optional. A unique identifier for this request. Must be a UUID4.
14974 /// This request is only idempotent if a `request_id` is provided.
14975 /// See <https://google.aip.dev/155> for more details.
14976 pub request_id: std::string::String,
14977
14978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14979}
14980
14981impl UpdateInterceptDeploymentGroupRequest {
14982 /// Creates a new default instance.
14983 pub fn new() -> Self {
14984 std::default::Default::default()
14985 }
14986
14987 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
14988 ///
14989 /// # Example
14990 /// ```ignore,no_run
14991 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14992 /// use wkt::FieldMask;
14993 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14994 /// ```
14995 pub fn set_update_mask<T>(mut self, v: T) -> Self
14996 where
14997 T: std::convert::Into<wkt::FieldMask>,
14998 {
14999 self.update_mask = std::option::Option::Some(v.into());
15000 self
15001 }
15002
15003 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
15004 ///
15005 /// # Example
15006 /// ```ignore,no_run
15007 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15008 /// use wkt::FieldMask;
15009 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15010 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15011 /// ```
15012 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15013 where
15014 T: std::convert::Into<wkt::FieldMask>,
15015 {
15016 self.update_mask = v.map(|x| x.into());
15017 self
15018 }
15019
15020 /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15021 ///
15022 /// # Example
15023 /// ```ignore,no_run
15024 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15025 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15026 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
15027 /// ```
15028 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
15029 where
15030 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15031 {
15032 self.intercept_deployment_group = std::option::Option::Some(v.into());
15033 self
15034 }
15035
15036 /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15037 ///
15038 /// # Example
15039 /// ```ignore,no_run
15040 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15041 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15042 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
15043 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
15044 /// ```
15045 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
15046 where
15047 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15048 {
15049 self.intercept_deployment_group = v.map(|x| x.into());
15050 self
15051 }
15052
15053 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
15054 ///
15055 /// # Example
15056 /// ```ignore,no_run
15057 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15058 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_request_id("example");
15059 /// ```
15060 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15061 self.request_id = v.into();
15062 self
15063 }
15064}
15065
15066impl wkt::message::Message for UpdateInterceptDeploymentGroupRequest {
15067 fn typename() -> &'static str {
15068 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest"
15069 }
15070}
15071
15072/// Request message for DeleteInterceptDeploymentGroup.
15073#[derive(Clone, Default, PartialEq)]
15074#[non_exhaustive]
15075pub struct DeleteInterceptDeploymentGroupRequest {
15076 /// Required. The deployment group to delete.
15077 pub name: std::string::String,
15078
15079 /// Optional. A unique identifier for this request. Must be a UUID4.
15080 /// This request is only idempotent if a `request_id` is provided.
15081 /// See <https://google.aip.dev/155> for more details.
15082 pub request_id: std::string::String,
15083
15084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15085}
15086
15087impl DeleteInterceptDeploymentGroupRequest {
15088 /// Creates a new default instance.
15089 pub fn new() -> Self {
15090 std::default::Default::default()
15091 }
15092
15093 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
15094 ///
15095 /// # Example
15096 /// ```ignore,no_run
15097 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15098 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_name("example");
15099 /// ```
15100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15101 self.name = v.into();
15102 self
15103 }
15104
15105 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15110 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_request_id("example");
15111 /// ```
15112 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15113 self.request_id = v.into();
15114 self
15115 }
15116}
15117
15118impl wkt::message::Message for DeleteInterceptDeploymentGroupRequest {
15119 fn typename() -> &'static str {
15120 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest"
15121 }
15122}
15123
15124/// A deployment represents a zonal intercept backend ready to accept
15125/// GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an
15126/// internal passthrough load balancer. Deployments are always part of a
15127/// global deployment group which represents a global intercept service.
15128#[derive(Clone, Default, PartialEq)]
15129#[non_exhaustive]
15130pub struct InterceptDeployment {
15131 /// Immutable. Identifier. The resource name of this deployment, for example:
15132 /// `projects/123456789/locations/us-central1-a/interceptDeployments/my-dep`.
15133 /// See <https://google.aip.dev/122> for more details.
15134 pub name: std::string::String,
15135
15136 /// Output only. The timestamp when the resource was created.
15137 /// See <https://google.aip.dev/148#timestamps>.
15138 pub create_time: std::option::Option<wkt::Timestamp>,
15139
15140 /// Output only. The timestamp when the resource was most recently updated.
15141 /// See <https://google.aip.dev/148#timestamps>.
15142 pub update_time: std::option::Option<wkt::Timestamp>,
15143
15144 /// Optional. Labels are key/value pairs that help to organize and filter
15145 /// resources.
15146 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15147
15148 /// Required. Immutable. The regional forwarding rule that fronts the
15149 /// interceptors, for example:
15150 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`.
15151 /// See <https://google.aip.dev/124>.
15152 pub forwarding_rule: std::string::String,
15153
15154 /// Required. Immutable. The deployment group that this deployment is a part
15155 /// of, for example:
15156 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
15157 /// See <https://google.aip.dev/124>.
15158 pub intercept_deployment_group: std::string::String,
15159
15160 /// Output only. The current state of the deployment.
15161 /// See <https://google.aip.dev/216>.
15162 pub state: crate::model::intercept_deployment::State,
15163
15164 /// Output only. The current state of the resource does not match the user's
15165 /// intended state, and the system is working to reconcile them. This part of
15166 /// the normal operation (e.g. linking a new association to the parent group).
15167 /// See <https://google.aip.dev/128>.
15168 pub reconciling: bool,
15169
15170 /// Optional. User-provided description of the deployment.
15171 /// Used as additional context for the deployment.
15172 pub description: std::string::String,
15173
15174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15175}
15176
15177impl InterceptDeployment {
15178 /// Creates a new default instance.
15179 pub fn new() -> Self {
15180 std::default::Default::default()
15181 }
15182
15183 /// Sets the value of [name][crate::model::InterceptDeployment::name].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15188 /// let x = InterceptDeployment::new().set_name("example");
15189 /// ```
15190 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15191 self.name = v.into();
15192 self
15193 }
15194
15195 /// Sets the value of [create_time][crate::model::InterceptDeployment::create_time].
15196 ///
15197 /// # Example
15198 /// ```ignore,no_run
15199 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15200 /// use wkt::Timestamp;
15201 /// let x = InterceptDeployment::new().set_create_time(Timestamp::default()/* use setters */);
15202 /// ```
15203 pub fn set_create_time<T>(mut self, v: T) -> Self
15204 where
15205 T: std::convert::Into<wkt::Timestamp>,
15206 {
15207 self.create_time = std::option::Option::Some(v.into());
15208 self
15209 }
15210
15211 /// Sets or clears the value of [create_time][crate::model::InterceptDeployment::create_time].
15212 ///
15213 /// # Example
15214 /// ```ignore,no_run
15215 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15216 /// use wkt::Timestamp;
15217 /// let x = InterceptDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15218 /// let x = InterceptDeployment::new().set_or_clear_create_time(None::<Timestamp>);
15219 /// ```
15220 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15221 where
15222 T: std::convert::Into<wkt::Timestamp>,
15223 {
15224 self.create_time = v.map(|x| x.into());
15225 self
15226 }
15227
15228 /// Sets the value of [update_time][crate::model::InterceptDeployment::update_time].
15229 ///
15230 /// # Example
15231 /// ```ignore,no_run
15232 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15233 /// use wkt::Timestamp;
15234 /// let x = InterceptDeployment::new().set_update_time(Timestamp::default()/* use setters */);
15235 /// ```
15236 pub fn set_update_time<T>(mut self, v: T) -> Self
15237 where
15238 T: std::convert::Into<wkt::Timestamp>,
15239 {
15240 self.update_time = std::option::Option::Some(v.into());
15241 self
15242 }
15243
15244 /// Sets or clears the value of [update_time][crate::model::InterceptDeployment::update_time].
15245 ///
15246 /// # Example
15247 /// ```ignore,no_run
15248 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15249 /// use wkt::Timestamp;
15250 /// let x = InterceptDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15251 /// let x = InterceptDeployment::new().set_or_clear_update_time(None::<Timestamp>);
15252 /// ```
15253 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15254 where
15255 T: std::convert::Into<wkt::Timestamp>,
15256 {
15257 self.update_time = v.map(|x| x.into());
15258 self
15259 }
15260
15261 /// Sets the value of [labels][crate::model::InterceptDeployment::labels].
15262 ///
15263 /// # Example
15264 /// ```ignore,no_run
15265 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15266 /// let x = InterceptDeployment::new().set_labels([
15267 /// ("key0", "abc"),
15268 /// ("key1", "xyz"),
15269 /// ]);
15270 /// ```
15271 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15272 where
15273 T: std::iter::IntoIterator<Item = (K, V)>,
15274 K: std::convert::Into<std::string::String>,
15275 V: std::convert::Into<std::string::String>,
15276 {
15277 use std::iter::Iterator;
15278 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15279 self
15280 }
15281
15282 /// Sets the value of [forwarding_rule][crate::model::InterceptDeployment::forwarding_rule].
15283 ///
15284 /// # Example
15285 /// ```ignore,no_run
15286 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15287 /// let x = InterceptDeployment::new().set_forwarding_rule("example");
15288 /// ```
15289 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15290 self.forwarding_rule = v.into();
15291 self
15292 }
15293
15294 /// Sets the value of [intercept_deployment_group][crate::model::InterceptDeployment::intercept_deployment_group].
15295 ///
15296 /// # Example
15297 /// ```ignore,no_run
15298 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15299 /// let x = InterceptDeployment::new().set_intercept_deployment_group("example");
15300 /// ```
15301 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
15302 mut self,
15303 v: T,
15304 ) -> Self {
15305 self.intercept_deployment_group = v.into();
15306 self
15307 }
15308
15309 /// Sets the value of [state][crate::model::InterceptDeployment::state].
15310 ///
15311 /// # Example
15312 /// ```ignore,no_run
15313 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15314 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
15315 /// let x0 = InterceptDeployment::new().set_state(State::Active);
15316 /// let x1 = InterceptDeployment::new().set_state(State::Creating);
15317 /// let x2 = InterceptDeployment::new().set_state(State::Deleting);
15318 /// ```
15319 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
15320 mut self,
15321 v: T,
15322 ) -> Self {
15323 self.state = v.into();
15324 self
15325 }
15326
15327 /// Sets the value of [reconciling][crate::model::InterceptDeployment::reconciling].
15328 ///
15329 /// # Example
15330 /// ```ignore,no_run
15331 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15332 /// let x = InterceptDeployment::new().set_reconciling(true);
15333 /// ```
15334 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15335 self.reconciling = v.into();
15336 self
15337 }
15338
15339 /// Sets the value of [description][crate::model::InterceptDeployment::description].
15340 ///
15341 /// # Example
15342 /// ```ignore,no_run
15343 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15344 /// let x = InterceptDeployment::new().set_description("example");
15345 /// ```
15346 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15347 self.description = v.into();
15348 self
15349 }
15350}
15351
15352impl wkt::message::Message for InterceptDeployment {
15353 fn typename() -> &'static str {
15354 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeployment"
15355 }
15356}
15357
15358/// Defines additional types related to [InterceptDeployment].
15359pub mod intercept_deployment {
15360 #[allow(unused_imports)]
15361 use super::*;
15362
15363 /// The current state of the deployment.
15364 ///
15365 /// # Working with unknown values
15366 ///
15367 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15368 /// additional enum variants at any time. Adding new variants is not considered
15369 /// a breaking change. Applications should write their code in anticipation of:
15370 ///
15371 /// - New values appearing in future releases of the client library, **and**
15372 /// - New values received dynamically, without application changes.
15373 ///
15374 /// Please consult the [Working with enums] section in the user guide for some
15375 /// guidelines.
15376 ///
15377 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15378 #[derive(Clone, Debug, PartialEq)]
15379 #[non_exhaustive]
15380 pub enum State {
15381 /// State not set (this is not a valid state).
15382 Unspecified,
15383 /// The deployment is ready and in sync with the parent group.
15384 Active,
15385 /// The deployment is being created.
15386 Creating,
15387 /// The deployment is being deleted.
15388 Deleting,
15389 /// The deployment is out of sync with the parent group.
15390 /// In most cases, this is a result of a transient issue within the system
15391 /// (e.g. a delayed data-path config) and the system is expected to recover
15392 /// automatically. See the parent deployment group's state for more details.
15393 OutOfSync,
15394 /// An attempt to delete the deployment has failed. This is a terminal state
15395 /// and the deployment is not expected to recover. The only permitted
15396 /// operation is to retry deleting the deployment.
15397 DeleteFailed,
15398 /// If set, the enum was initialized with an unknown value.
15399 ///
15400 /// Applications can examine the value using [State::value] or
15401 /// [State::name].
15402 UnknownValue(state::UnknownValue),
15403 }
15404
15405 #[doc(hidden)]
15406 pub mod state {
15407 #[allow(unused_imports)]
15408 use super::*;
15409 #[derive(Clone, Debug, PartialEq)]
15410 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15411 }
15412
15413 impl State {
15414 /// Gets the enum value.
15415 ///
15416 /// Returns `None` if the enum contains an unknown value deserialized from
15417 /// the string representation of enums.
15418 pub fn value(&self) -> std::option::Option<i32> {
15419 match self {
15420 Self::Unspecified => std::option::Option::Some(0),
15421 Self::Active => std::option::Option::Some(1),
15422 Self::Creating => std::option::Option::Some(2),
15423 Self::Deleting => std::option::Option::Some(3),
15424 Self::OutOfSync => std::option::Option::Some(4),
15425 Self::DeleteFailed => std::option::Option::Some(5),
15426 Self::UnknownValue(u) => u.0.value(),
15427 }
15428 }
15429
15430 /// Gets the enum value as a string.
15431 ///
15432 /// Returns `None` if the enum contains an unknown value deserialized from
15433 /// the integer representation of enums.
15434 pub fn name(&self) -> std::option::Option<&str> {
15435 match self {
15436 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15437 Self::Active => std::option::Option::Some("ACTIVE"),
15438 Self::Creating => std::option::Option::Some("CREATING"),
15439 Self::Deleting => std::option::Option::Some("DELETING"),
15440 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
15441 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
15442 Self::UnknownValue(u) => u.0.name(),
15443 }
15444 }
15445 }
15446
15447 impl std::default::Default for State {
15448 fn default() -> Self {
15449 use std::convert::From;
15450 Self::from(0)
15451 }
15452 }
15453
15454 impl std::fmt::Display for State {
15455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15456 wkt::internal::display_enum(f, self.name(), self.value())
15457 }
15458 }
15459
15460 impl std::convert::From<i32> for State {
15461 fn from(value: i32) -> Self {
15462 match value {
15463 0 => Self::Unspecified,
15464 1 => Self::Active,
15465 2 => Self::Creating,
15466 3 => Self::Deleting,
15467 4 => Self::OutOfSync,
15468 5 => Self::DeleteFailed,
15469 _ => Self::UnknownValue(state::UnknownValue(
15470 wkt::internal::UnknownEnumValue::Integer(value),
15471 )),
15472 }
15473 }
15474 }
15475
15476 impl std::convert::From<&str> for State {
15477 fn from(value: &str) -> Self {
15478 use std::string::ToString;
15479 match value {
15480 "STATE_UNSPECIFIED" => Self::Unspecified,
15481 "ACTIVE" => Self::Active,
15482 "CREATING" => Self::Creating,
15483 "DELETING" => Self::Deleting,
15484 "OUT_OF_SYNC" => Self::OutOfSync,
15485 "DELETE_FAILED" => Self::DeleteFailed,
15486 _ => Self::UnknownValue(state::UnknownValue(
15487 wkt::internal::UnknownEnumValue::String(value.to_string()),
15488 )),
15489 }
15490 }
15491 }
15492
15493 impl serde::ser::Serialize for State {
15494 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15495 where
15496 S: serde::Serializer,
15497 {
15498 match self {
15499 Self::Unspecified => serializer.serialize_i32(0),
15500 Self::Active => serializer.serialize_i32(1),
15501 Self::Creating => serializer.serialize_i32(2),
15502 Self::Deleting => serializer.serialize_i32(3),
15503 Self::OutOfSync => serializer.serialize_i32(4),
15504 Self::DeleteFailed => serializer.serialize_i32(5),
15505 Self::UnknownValue(u) => u.0.serialize(serializer),
15506 }
15507 }
15508 }
15509
15510 impl<'de> serde::de::Deserialize<'de> for State {
15511 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15512 where
15513 D: serde::Deserializer<'de>,
15514 {
15515 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15516 ".google.cloud.networksecurity.v1.InterceptDeployment.State",
15517 ))
15518 }
15519 }
15520}
15521
15522/// Request message for ListInterceptDeployments.
15523#[derive(Clone, Default, PartialEq)]
15524#[non_exhaustive]
15525pub struct ListInterceptDeploymentsRequest {
15526 /// Required. The parent, which owns this collection of deployments.
15527 /// Example: `projects/123456789/locations/us-central1-a`.
15528 /// See <https://google.aip.dev/132> for more details.
15529 pub parent: std::string::String,
15530
15531 /// Optional. Requested page size. Server may return fewer items than
15532 /// requested. If unspecified, server will pick an appropriate default. See
15533 /// <https://google.aip.dev/158> for more details.
15534 pub page_size: i32,
15535
15536 /// Optional. A page token, received from a previous `ListInterceptDeployments`
15537 /// call. Provide this to retrieve the subsequent page. When paginating, all
15538 /// other parameters provided to `ListInterceptDeployments` must match the call
15539 /// that provided the page token. See <https://google.aip.dev/158> for more
15540 /// details.
15541 pub page_token: std::string::String,
15542
15543 /// Optional. Filter expression.
15544 /// See <https://google.aip.dev/160#filtering> for more details.
15545 pub filter: std::string::String,
15546
15547 /// Optional. Sort expression.
15548 /// See <https://google.aip.dev/132#ordering> for more details.
15549 pub order_by: std::string::String,
15550
15551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15552}
15553
15554impl ListInterceptDeploymentsRequest {
15555 /// Creates a new default instance.
15556 pub fn new() -> Self {
15557 std::default::Default::default()
15558 }
15559
15560 /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
15561 ///
15562 /// # Example
15563 /// ```ignore,no_run
15564 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15565 /// let x = ListInterceptDeploymentsRequest::new().set_parent("example");
15566 /// ```
15567 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15568 self.parent = v.into();
15569 self
15570 }
15571
15572 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
15573 ///
15574 /// # Example
15575 /// ```ignore,no_run
15576 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15577 /// let x = ListInterceptDeploymentsRequest::new().set_page_size(42);
15578 /// ```
15579 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15580 self.page_size = v.into();
15581 self
15582 }
15583
15584 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
15585 ///
15586 /// # Example
15587 /// ```ignore,no_run
15588 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15589 /// let x = ListInterceptDeploymentsRequest::new().set_page_token("example");
15590 /// ```
15591 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15592 self.page_token = v.into();
15593 self
15594 }
15595
15596 /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
15597 ///
15598 /// # Example
15599 /// ```ignore,no_run
15600 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15601 /// let x = ListInterceptDeploymentsRequest::new().set_filter("example");
15602 /// ```
15603 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15604 self.filter = v.into();
15605 self
15606 }
15607
15608 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
15609 ///
15610 /// # Example
15611 /// ```ignore,no_run
15612 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15613 /// let x = ListInterceptDeploymentsRequest::new().set_order_by("example");
15614 /// ```
15615 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15616 self.order_by = v.into();
15617 self
15618 }
15619}
15620
15621impl wkt::message::Message for ListInterceptDeploymentsRequest {
15622 fn typename() -> &'static str {
15623 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest"
15624 }
15625}
15626
15627/// Response message for ListInterceptDeployments.
15628#[derive(Clone, Default, PartialEq)]
15629#[non_exhaustive]
15630pub struct ListInterceptDeploymentsResponse {
15631 /// The deployments from the specified parent.
15632 pub intercept_deployments: std::vec::Vec<crate::model::InterceptDeployment>,
15633
15634 /// A token that can be sent as `page_token` to retrieve the next page.
15635 /// If this field is omitted, there are no subsequent pages.
15636 /// See <https://google.aip.dev/158> for more details.
15637 pub next_page_token: std::string::String,
15638
15639 /// Locations that could not be reached.
15640 pub unreachable: std::vec::Vec<std::string::String>,
15641
15642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15643}
15644
15645impl ListInterceptDeploymentsResponse {
15646 /// Creates a new default instance.
15647 pub fn new() -> Self {
15648 std::default::Default::default()
15649 }
15650
15651 /// Sets the value of [intercept_deployments][crate::model::ListInterceptDeploymentsResponse::intercept_deployments].
15652 ///
15653 /// # Example
15654 /// ```ignore,no_run
15655 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15656 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15657 /// let x = ListInterceptDeploymentsResponse::new()
15658 /// .set_intercept_deployments([
15659 /// InterceptDeployment::default()/* use setters */,
15660 /// InterceptDeployment::default()/* use (different) setters */,
15661 /// ]);
15662 /// ```
15663 pub fn set_intercept_deployments<T, V>(mut self, v: T) -> Self
15664 where
15665 T: std::iter::IntoIterator<Item = V>,
15666 V: std::convert::Into<crate::model::InterceptDeployment>,
15667 {
15668 use std::iter::Iterator;
15669 self.intercept_deployments = v.into_iter().map(|i| i.into()).collect();
15670 self
15671 }
15672
15673 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentsResponse::next_page_token].
15674 ///
15675 /// # Example
15676 /// ```ignore,no_run
15677 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15678 /// let x = ListInterceptDeploymentsResponse::new().set_next_page_token("example");
15679 /// ```
15680 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15681 self.next_page_token = v.into();
15682 self
15683 }
15684
15685 /// Sets the value of [unreachable][crate::model::ListInterceptDeploymentsResponse::unreachable].
15686 ///
15687 /// # Example
15688 /// ```ignore,no_run
15689 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15690 /// let x = ListInterceptDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
15691 /// ```
15692 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15693 where
15694 T: std::iter::IntoIterator<Item = V>,
15695 V: std::convert::Into<std::string::String>,
15696 {
15697 use std::iter::Iterator;
15698 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15699 self
15700 }
15701}
15702
15703impl wkt::message::Message for ListInterceptDeploymentsResponse {
15704 fn typename() -> &'static str {
15705 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse"
15706 }
15707}
15708
15709#[doc(hidden)]
15710impl google_cloud_gax::paginator::internal::PageableResponse for ListInterceptDeploymentsResponse {
15711 type PageItem = crate::model::InterceptDeployment;
15712
15713 fn items(self) -> std::vec::Vec<Self::PageItem> {
15714 self.intercept_deployments
15715 }
15716
15717 fn next_page_token(&self) -> std::string::String {
15718 use std::clone::Clone;
15719 self.next_page_token.clone()
15720 }
15721}
15722
15723/// Request message for GetInterceptDeployment.
15724#[derive(Clone, Default, PartialEq)]
15725#[non_exhaustive]
15726pub struct GetInterceptDeploymentRequest {
15727 /// Required. The name of the deployment to retrieve.
15728 /// Format:
15729 /// projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}
15730 pub name: std::string::String,
15731
15732 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15733}
15734
15735impl GetInterceptDeploymentRequest {
15736 /// Creates a new default instance.
15737 pub fn new() -> Self {
15738 std::default::Default::default()
15739 }
15740
15741 /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
15742 ///
15743 /// # Example
15744 /// ```ignore,no_run
15745 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentRequest;
15746 /// let x = GetInterceptDeploymentRequest::new().set_name("example");
15747 /// ```
15748 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15749 self.name = v.into();
15750 self
15751 }
15752}
15753
15754impl wkt::message::Message for GetInterceptDeploymentRequest {
15755 fn typename() -> &'static str {
15756 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentRequest"
15757 }
15758}
15759
15760/// Request message for CreateInterceptDeployment.
15761#[derive(Clone, Default, PartialEq)]
15762#[non_exhaustive]
15763pub struct CreateInterceptDeploymentRequest {
15764 /// Required. The parent resource where this deployment will be created.
15765 /// Format: projects/{project}/locations/{location}
15766 pub parent: std::string::String,
15767
15768 /// Required. The ID to use for the new deployment, which will become the final
15769 /// component of the deployment's resource name.
15770 pub intercept_deployment_id: std::string::String,
15771
15772 /// Required. The deployment to create.
15773 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
15774
15775 /// Optional. A unique identifier for this request. Must be a UUID4.
15776 /// This request is only idempotent if a `request_id` is provided.
15777 /// See <https://google.aip.dev/155> for more details.
15778 pub request_id: std::string::String,
15779
15780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15781}
15782
15783impl CreateInterceptDeploymentRequest {
15784 /// Creates a new default instance.
15785 pub fn new() -> Self {
15786 std::default::Default::default()
15787 }
15788
15789 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
15790 ///
15791 /// # Example
15792 /// ```ignore,no_run
15793 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15794 /// let x = CreateInterceptDeploymentRequest::new().set_parent("example");
15795 /// ```
15796 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15797 self.parent = v.into();
15798 self
15799 }
15800
15801 /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
15802 ///
15803 /// # Example
15804 /// ```ignore,no_run
15805 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15806 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment_id("example");
15807 /// ```
15808 pub fn set_intercept_deployment_id<T: std::convert::Into<std::string::String>>(
15809 mut self,
15810 v: T,
15811 ) -> Self {
15812 self.intercept_deployment_id = v.into();
15813 self
15814 }
15815
15816 /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
15817 ///
15818 /// # Example
15819 /// ```ignore,no_run
15820 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15821 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15822 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
15823 /// ```
15824 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
15825 where
15826 T: std::convert::Into<crate::model::InterceptDeployment>,
15827 {
15828 self.intercept_deployment = std::option::Option::Some(v.into());
15829 self
15830 }
15831
15832 /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
15833 ///
15834 /// # Example
15835 /// ```ignore,no_run
15836 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15837 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15838 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
15839 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
15840 /// ```
15841 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
15842 where
15843 T: std::convert::Into<crate::model::InterceptDeployment>,
15844 {
15845 self.intercept_deployment = v.map(|x| x.into());
15846 self
15847 }
15848
15849 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
15850 ///
15851 /// # Example
15852 /// ```ignore,no_run
15853 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15854 /// let x = CreateInterceptDeploymentRequest::new().set_request_id("example");
15855 /// ```
15856 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15857 self.request_id = v.into();
15858 self
15859 }
15860}
15861
15862impl wkt::message::Message for CreateInterceptDeploymentRequest {
15863 fn typename() -> &'static str {
15864 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest"
15865 }
15866}
15867
15868/// Request message for UpdateInterceptDeployment.
15869#[derive(Clone, Default, PartialEq)]
15870#[non_exhaustive]
15871pub struct UpdateInterceptDeploymentRequest {
15872 /// Optional. The list of fields to update.
15873 /// Fields are specified relative to the deployment
15874 /// (e.g. `description`; *not* `intercept_deployment.description`).
15875 /// See <https://google.aip.dev/161> for more details.
15876 pub update_mask: std::option::Option<wkt::FieldMask>,
15877
15878 /// Required. The deployment to update.
15879 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
15880
15881 /// Optional. A unique identifier for this request. Must be a UUID4.
15882 /// This request is only idempotent if a `request_id` is provided.
15883 /// See <https://google.aip.dev/155> for more details.
15884 pub request_id: std::string::String,
15885
15886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15887}
15888
15889impl UpdateInterceptDeploymentRequest {
15890 /// Creates a new default instance.
15891 pub fn new() -> Self {
15892 std::default::Default::default()
15893 }
15894
15895 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
15896 ///
15897 /// # Example
15898 /// ```ignore,no_run
15899 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15900 /// use wkt::FieldMask;
15901 /// let x = UpdateInterceptDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15902 /// ```
15903 pub fn set_update_mask<T>(mut self, v: T) -> Self
15904 where
15905 T: std::convert::Into<wkt::FieldMask>,
15906 {
15907 self.update_mask = std::option::Option::Some(v.into());
15908 self
15909 }
15910
15911 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
15912 ///
15913 /// # Example
15914 /// ```ignore,no_run
15915 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15916 /// use wkt::FieldMask;
15917 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15918 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15919 /// ```
15920 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15921 where
15922 T: std::convert::Into<wkt::FieldMask>,
15923 {
15924 self.update_mask = v.map(|x| x.into());
15925 self
15926 }
15927
15928 /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
15929 ///
15930 /// # Example
15931 /// ```ignore,no_run
15932 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15933 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15934 /// let x = UpdateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
15935 /// ```
15936 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
15937 where
15938 T: std::convert::Into<crate::model::InterceptDeployment>,
15939 {
15940 self.intercept_deployment = std::option::Option::Some(v.into());
15941 self
15942 }
15943
15944 /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
15945 ///
15946 /// # Example
15947 /// ```ignore,no_run
15948 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15949 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15950 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
15951 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
15952 /// ```
15953 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
15954 where
15955 T: std::convert::Into<crate::model::InterceptDeployment>,
15956 {
15957 self.intercept_deployment = v.map(|x| x.into());
15958 self
15959 }
15960
15961 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
15962 ///
15963 /// # Example
15964 /// ```ignore,no_run
15965 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15966 /// let x = UpdateInterceptDeploymentRequest::new().set_request_id("example");
15967 /// ```
15968 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15969 self.request_id = v.into();
15970 self
15971 }
15972}
15973
15974impl wkt::message::Message for UpdateInterceptDeploymentRequest {
15975 fn typename() -> &'static str {
15976 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest"
15977 }
15978}
15979
15980/// Request message for DeleteInterceptDeployment.
15981#[derive(Clone, Default, PartialEq)]
15982#[non_exhaustive]
15983pub struct DeleteInterceptDeploymentRequest {
15984 /// Required. Name of the resource
15985 pub name: std::string::String,
15986
15987 /// Optional. A unique identifier for this request. Must be a UUID4.
15988 /// This request is only idempotent if a `request_id` is provided.
15989 /// See <https://google.aip.dev/155> for more details.
15990 pub request_id: std::string::String,
15991
15992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15993}
15994
15995impl DeleteInterceptDeploymentRequest {
15996 /// Creates a new default instance.
15997 pub fn new() -> Self {
15998 std::default::Default::default()
15999 }
16000
16001 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
16002 ///
16003 /// # Example
16004 /// ```ignore,no_run
16005 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16006 /// let x = DeleteInterceptDeploymentRequest::new().set_name("example");
16007 /// ```
16008 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16009 self.name = v.into();
16010 self
16011 }
16012
16013 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
16014 ///
16015 /// # Example
16016 /// ```ignore,no_run
16017 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16018 /// let x = DeleteInterceptDeploymentRequest::new().set_request_id("example");
16019 /// ```
16020 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16021 self.request_id = v.into();
16022 self
16023 }
16024}
16025
16026impl wkt::message::Message for DeleteInterceptDeploymentRequest {
16027 fn typename() -> &'static str {
16028 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest"
16029 }
16030}
16031
16032/// Details about intercept in a specific cloud location.
16033#[derive(Clone, Default, PartialEq)]
16034#[non_exhaustive]
16035pub struct InterceptLocation {
16036 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
16037 pub location: std::string::String,
16038
16039 /// Output only. The current state of the association in this location.
16040 pub state: crate::model::intercept_location::State,
16041
16042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16043}
16044
16045impl InterceptLocation {
16046 /// Creates a new default instance.
16047 pub fn new() -> Self {
16048 std::default::Default::default()
16049 }
16050
16051 /// Sets the value of [location][crate::model::InterceptLocation::location].
16052 ///
16053 /// # Example
16054 /// ```ignore,no_run
16055 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16056 /// let x = InterceptLocation::new().set_location("example");
16057 /// ```
16058 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16059 self.location = v.into();
16060 self
16061 }
16062
16063 /// Sets the value of [state][crate::model::InterceptLocation::state].
16064 ///
16065 /// # Example
16066 /// ```ignore,no_run
16067 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16068 /// use google_cloud_networksecurity_v1::model::intercept_location::State;
16069 /// let x0 = InterceptLocation::new().set_state(State::Active);
16070 /// let x1 = InterceptLocation::new().set_state(State::OutOfSync);
16071 /// ```
16072 pub fn set_state<T: std::convert::Into<crate::model::intercept_location::State>>(
16073 mut self,
16074 v: T,
16075 ) -> Self {
16076 self.state = v.into();
16077 self
16078 }
16079}
16080
16081impl wkt::message::Message for InterceptLocation {
16082 fn typename() -> &'static str {
16083 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptLocation"
16084 }
16085}
16086
16087/// Defines additional types related to [InterceptLocation].
16088pub mod intercept_location {
16089 #[allow(unused_imports)]
16090 use super::*;
16091
16092 /// The current state of a resource in the location.
16093 ///
16094 /// # Working with unknown values
16095 ///
16096 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16097 /// additional enum variants at any time. Adding new variants is not considered
16098 /// a breaking change. Applications should write their code in anticipation of:
16099 ///
16100 /// - New values appearing in future releases of the client library, **and**
16101 /// - New values received dynamically, without application changes.
16102 ///
16103 /// Please consult the [Working with enums] section in the user guide for some
16104 /// guidelines.
16105 ///
16106 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16107 #[derive(Clone, Debug, PartialEq)]
16108 #[non_exhaustive]
16109 pub enum State {
16110 /// State not set (this is not a valid state).
16111 Unspecified,
16112 /// The resource is ready and in sync in the location.
16113 Active,
16114 /// The resource is out of sync in the location.
16115 /// In most cases, this is a result of a transient issue within the system
16116 /// (e.g. an inaccessible location) and the system is expected to recover
16117 /// automatically.
16118 OutOfSync,
16119 /// If set, the enum was initialized with an unknown value.
16120 ///
16121 /// Applications can examine the value using [State::value] or
16122 /// [State::name].
16123 UnknownValue(state::UnknownValue),
16124 }
16125
16126 #[doc(hidden)]
16127 pub mod state {
16128 #[allow(unused_imports)]
16129 use super::*;
16130 #[derive(Clone, Debug, PartialEq)]
16131 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16132 }
16133
16134 impl State {
16135 /// Gets the enum value.
16136 ///
16137 /// Returns `None` if the enum contains an unknown value deserialized from
16138 /// the string representation of enums.
16139 pub fn value(&self) -> std::option::Option<i32> {
16140 match self {
16141 Self::Unspecified => std::option::Option::Some(0),
16142 Self::Active => std::option::Option::Some(1),
16143 Self::OutOfSync => std::option::Option::Some(2),
16144 Self::UnknownValue(u) => u.0.value(),
16145 }
16146 }
16147
16148 /// Gets the enum value as a string.
16149 ///
16150 /// Returns `None` if the enum contains an unknown value deserialized from
16151 /// the integer representation of enums.
16152 pub fn name(&self) -> std::option::Option<&str> {
16153 match self {
16154 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16155 Self::Active => std::option::Option::Some("ACTIVE"),
16156 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16157 Self::UnknownValue(u) => u.0.name(),
16158 }
16159 }
16160 }
16161
16162 impl std::default::Default for State {
16163 fn default() -> Self {
16164 use std::convert::From;
16165 Self::from(0)
16166 }
16167 }
16168
16169 impl std::fmt::Display for State {
16170 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16171 wkt::internal::display_enum(f, self.name(), self.value())
16172 }
16173 }
16174
16175 impl std::convert::From<i32> for State {
16176 fn from(value: i32) -> Self {
16177 match value {
16178 0 => Self::Unspecified,
16179 1 => Self::Active,
16180 2 => Self::OutOfSync,
16181 _ => Self::UnknownValue(state::UnknownValue(
16182 wkt::internal::UnknownEnumValue::Integer(value),
16183 )),
16184 }
16185 }
16186 }
16187
16188 impl std::convert::From<&str> for State {
16189 fn from(value: &str) -> Self {
16190 use std::string::ToString;
16191 match value {
16192 "STATE_UNSPECIFIED" => Self::Unspecified,
16193 "ACTIVE" => Self::Active,
16194 "OUT_OF_SYNC" => Self::OutOfSync,
16195 _ => Self::UnknownValue(state::UnknownValue(
16196 wkt::internal::UnknownEnumValue::String(value.to_string()),
16197 )),
16198 }
16199 }
16200 }
16201
16202 impl serde::ser::Serialize for State {
16203 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16204 where
16205 S: serde::Serializer,
16206 {
16207 match self {
16208 Self::Unspecified => serializer.serialize_i32(0),
16209 Self::Active => serializer.serialize_i32(1),
16210 Self::OutOfSync => serializer.serialize_i32(2),
16211 Self::UnknownValue(u) => u.0.serialize(serializer),
16212 }
16213 }
16214 }
16215
16216 impl<'de> serde::de::Deserialize<'de> for State {
16217 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16218 where
16219 D: serde::Deserializer<'de>,
16220 {
16221 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16222 ".google.cloud.networksecurity.v1.InterceptLocation.State",
16223 ))
16224 }
16225 }
16226}
16227
16228/// An endpoint group is a consumer frontend for a deployment group (backend).
16229/// In order to configure mirroring for a network, consumers must create:
16230///
16231/// - An association between their network and the endpoint group.
16232/// - A security profile that points to the endpoint group.
16233/// - A mirroring rule that references the security profile (group).
16234#[derive(Clone, Default, PartialEq)]
16235#[non_exhaustive]
16236pub struct MirroringEndpointGroup {
16237 /// Immutable. Identifier. The resource name of this endpoint group, for
16238 /// example:
16239 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
16240 /// See <https://google.aip.dev/122> for more details.
16241 pub name: std::string::String,
16242
16243 /// Output only. The timestamp when the resource was created.
16244 /// See <https://google.aip.dev/148#timestamps>.
16245 pub create_time: std::option::Option<wkt::Timestamp>,
16246
16247 /// Output only. The timestamp when the resource was most recently updated.
16248 /// See <https://google.aip.dev/148#timestamps>.
16249 pub update_time: std::option::Option<wkt::Timestamp>,
16250
16251 /// Optional. Labels are key/value pairs that help to organize and filter
16252 /// resources.
16253 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16254
16255 /// Immutable. The deployment group that this DIRECT endpoint group is
16256 /// connected to, for example:
16257 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16258 /// See <https://google.aip.dev/124>.
16259 pub mirroring_deployment_group: std::string::String,
16260
16261 /// Output only. List of details about the connected deployment groups to this
16262 /// endpoint group.
16263 pub connected_deployment_groups:
16264 std::vec::Vec<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16265
16266 /// Output only. The current state of the endpoint group.
16267 /// See <https://google.aip.dev/216>.
16268 pub state: crate::model::mirroring_endpoint_group::State,
16269
16270 /// Output only. The current state of the resource does not match the user's
16271 /// intended state, and the system is working to reconcile them. This is part
16272 /// of the normal operation (e.g. adding a new association to the group). See
16273 /// <https://google.aip.dev/128>.
16274 pub reconciling: bool,
16275
16276 /// Immutable. The type of the endpoint group.
16277 /// If left unspecified, defaults to DIRECT.
16278 pub r#type: crate::model::mirroring_endpoint_group::Type,
16279
16280 /// Output only. List of associations to this endpoint group.
16281 pub associations: std::vec::Vec<crate::model::mirroring_endpoint_group::AssociationDetails>,
16282
16283 /// Optional. User-provided description of the endpoint group.
16284 /// Used as additional context for the endpoint group.
16285 pub description: std::string::String,
16286
16287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16288}
16289
16290impl MirroringEndpointGroup {
16291 /// Creates a new default instance.
16292 pub fn new() -> Self {
16293 std::default::Default::default()
16294 }
16295
16296 /// Sets the value of [name][crate::model::MirroringEndpointGroup::name].
16297 ///
16298 /// # Example
16299 /// ```ignore,no_run
16300 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16301 /// let x = MirroringEndpointGroup::new().set_name("example");
16302 /// ```
16303 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16304 self.name = v.into();
16305 self
16306 }
16307
16308 /// Sets the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16309 ///
16310 /// # Example
16311 /// ```ignore,no_run
16312 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16313 /// use wkt::Timestamp;
16314 /// let x = MirroringEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
16315 /// ```
16316 pub fn set_create_time<T>(mut self, v: T) -> Self
16317 where
16318 T: std::convert::Into<wkt::Timestamp>,
16319 {
16320 self.create_time = std::option::Option::Some(v.into());
16321 self
16322 }
16323
16324 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16325 ///
16326 /// # Example
16327 /// ```ignore,no_run
16328 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16329 /// use wkt::Timestamp;
16330 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16331 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
16332 /// ```
16333 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16334 where
16335 T: std::convert::Into<wkt::Timestamp>,
16336 {
16337 self.create_time = v.map(|x| x.into());
16338 self
16339 }
16340
16341 /// Sets the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16342 ///
16343 /// # Example
16344 /// ```ignore,no_run
16345 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16346 /// use wkt::Timestamp;
16347 /// let x = MirroringEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
16348 /// ```
16349 pub fn set_update_time<T>(mut self, v: T) -> Self
16350 where
16351 T: std::convert::Into<wkt::Timestamp>,
16352 {
16353 self.update_time = std::option::Option::Some(v.into());
16354 self
16355 }
16356
16357 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16358 ///
16359 /// # Example
16360 /// ```ignore,no_run
16361 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16362 /// use wkt::Timestamp;
16363 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16364 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
16365 /// ```
16366 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16367 where
16368 T: std::convert::Into<wkt::Timestamp>,
16369 {
16370 self.update_time = v.map(|x| x.into());
16371 self
16372 }
16373
16374 /// Sets the value of [labels][crate::model::MirroringEndpointGroup::labels].
16375 ///
16376 /// # Example
16377 /// ```ignore,no_run
16378 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16379 /// let x = MirroringEndpointGroup::new().set_labels([
16380 /// ("key0", "abc"),
16381 /// ("key1", "xyz"),
16382 /// ]);
16383 /// ```
16384 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16385 where
16386 T: std::iter::IntoIterator<Item = (K, V)>,
16387 K: std::convert::Into<std::string::String>,
16388 V: std::convert::Into<std::string::String>,
16389 {
16390 use std::iter::Iterator;
16391 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16392 self
16393 }
16394
16395 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringEndpointGroup::mirroring_deployment_group].
16396 ///
16397 /// # Example
16398 /// ```ignore,no_run
16399 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16400 /// let x = MirroringEndpointGroup::new().set_mirroring_deployment_group("example");
16401 /// ```
16402 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
16403 mut self,
16404 v: T,
16405 ) -> Self {
16406 self.mirroring_deployment_group = v.into();
16407 self
16408 }
16409
16410 /// Sets the value of [connected_deployment_groups][crate::model::MirroringEndpointGroup::connected_deployment_groups].
16411 ///
16412 /// # Example
16413 /// ```ignore,no_run
16414 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16415 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16416 /// let x = MirroringEndpointGroup::new()
16417 /// .set_connected_deployment_groups([
16418 /// ConnectedDeploymentGroup::default()/* use setters */,
16419 /// ConnectedDeploymentGroup::default()/* use (different) setters */,
16420 /// ]);
16421 /// ```
16422 pub fn set_connected_deployment_groups<T, V>(mut self, v: T) -> Self
16423 where
16424 T: std::iter::IntoIterator<Item = V>,
16425 V: std::convert::Into<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16426 {
16427 use std::iter::Iterator;
16428 self.connected_deployment_groups = v.into_iter().map(|i| i.into()).collect();
16429 self
16430 }
16431
16432 /// Sets the value of [state][crate::model::MirroringEndpointGroup::state].
16433 ///
16434 /// # Example
16435 /// ```ignore,no_run
16436 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16437 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::State;
16438 /// let x0 = MirroringEndpointGroup::new().set_state(State::Active);
16439 /// let x1 = MirroringEndpointGroup::new().set_state(State::Closed);
16440 /// let x2 = MirroringEndpointGroup::new().set_state(State::Creating);
16441 /// ```
16442 pub fn set_state<T: std::convert::Into<crate::model::mirroring_endpoint_group::State>>(
16443 mut self,
16444 v: T,
16445 ) -> Self {
16446 self.state = v.into();
16447 self
16448 }
16449
16450 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroup::reconciling].
16451 ///
16452 /// # Example
16453 /// ```ignore,no_run
16454 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16455 /// let x = MirroringEndpointGroup::new().set_reconciling(true);
16456 /// ```
16457 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16458 self.reconciling = v.into();
16459 self
16460 }
16461
16462 /// Sets the value of [r#type][crate::model::MirroringEndpointGroup::type].
16463 ///
16464 /// # Example
16465 /// ```ignore,no_run
16466 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16467 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::Type;
16468 /// let x0 = MirroringEndpointGroup::new().set_type(Type::Direct);
16469 /// ```
16470 pub fn set_type<T: std::convert::Into<crate::model::mirroring_endpoint_group::Type>>(
16471 mut self,
16472 v: T,
16473 ) -> Self {
16474 self.r#type = v.into();
16475 self
16476 }
16477
16478 /// Sets the value of [associations][crate::model::MirroringEndpointGroup::associations].
16479 ///
16480 /// # Example
16481 /// ```ignore,no_run
16482 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16483 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16484 /// let x = MirroringEndpointGroup::new()
16485 /// .set_associations([
16486 /// AssociationDetails::default()/* use setters */,
16487 /// AssociationDetails::default()/* use (different) setters */,
16488 /// ]);
16489 /// ```
16490 pub fn set_associations<T, V>(mut self, v: T) -> Self
16491 where
16492 T: std::iter::IntoIterator<Item = V>,
16493 V: std::convert::Into<crate::model::mirroring_endpoint_group::AssociationDetails>,
16494 {
16495 use std::iter::Iterator;
16496 self.associations = v.into_iter().map(|i| i.into()).collect();
16497 self
16498 }
16499
16500 /// Sets the value of [description][crate::model::MirroringEndpointGroup::description].
16501 ///
16502 /// # Example
16503 /// ```ignore,no_run
16504 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16505 /// let x = MirroringEndpointGroup::new().set_description("example");
16506 /// ```
16507 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16508 self.description = v.into();
16509 self
16510 }
16511}
16512
16513impl wkt::message::Message for MirroringEndpointGroup {
16514 fn typename() -> &'static str {
16515 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup"
16516 }
16517}
16518
16519/// Defines additional types related to [MirroringEndpointGroup].
16520pub mod mirroring_endpoint_group {
16521 #[allow(unused_imports)]
16522 use super::*;
16523
16524 /// The endpoint group's view of a connected deployment group.
16525 #[derive(Clone, Default, PartialEq)]
16526 #[non_exhaustive]
16527 pub struct ConnectedDeploymentGroup {
16528 /// Output only. The connected deployment group's resource name, for example:
16529 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16530 /// See <https://google.aip.dev/124>.
16531 pub name: std::string::String,
16532
16533 /// Output only. The list of locations where the deployment group is present.
16534 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
16535
16536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16537 }
16538
16539 impl ConnectedDeploymentGroup {
16540 /// Creates a new default instance.
16541 pub fn new() -> Self {
16542 std::default::Default::default()
16543 }
16544
16545 /// Sets the value of [name][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::name].
16546 ///
16547 /// # Example
16548 /// ```ignore,no_run
16549 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16550 /// let x = ConnectedDeploymentGroup::new().set_name("example");
16551 /// ```
16552 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16553 self.name = v.into();
16554 self
16555 }
16556
16557 /// Sets the value of [locations][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::locations].
16558 ///
16559 /// # Example
16560 /// ```ignore,no_run
16561 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16562 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
16563 /// let x = ConnectedDeploymentGroup::new()
16564 /// .set_locations([
16565 /// MirroringLocation::default()/* use setters */,
16566 /// MirroringLocation::default()/* use (different) setters */,
16567 /// ]);
16568 /// ```
16569 pub fn set_locations<T, V>(mut self, v: T) -> Self
16570 where
16571 T: std::iter::IntoIterator<Item = V>,
16572 V: std::convert::Into<crate::model::MirroringLocation>,
16573 {
16574 use std::iter::Iterator;
16575 self.locations = v.into_iter().map(|i| i.into()).collect();
16576 self
16577 }
16578 }
16579
16580 impl wkt::message::Message for ConnectedDeploymentGroup {
16581 fn typename() -> &'static str {
16582 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup"
16583 }
16584 }
16585
16586 /// The endpoint group's view of a connected association.
16587 #[derive(Clone, Default, PartialEq)]
16588 #[non_exhaustive]
16589 pub struct AssociationDetails {
16590 /// Output only. The connected association's resource name, for example:
16591 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-ega`.
16592 /// See <https://google.aip.dev/124>.
16593 pub name: std::string::String,
16594
16595 /// Output only. The associated network, for example:
16596 /// projects/123456789/global/networks/my-network.
16597 /// See <https://google.aip.dev/124>.
16598 pub network: std::string::String,
16599
16600 /// Output only. Most recent known state of the association.
16601 pub state: crate::model::mirroring_endpoint_group_association::State,
16602
16603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16604 }
16605
16606 impl AssociationDetails {
16607 /// Creates a new default instance.
16608 pub fn new() -> Self {
16609 std::default::Default::default()
16610 }
16611
16612 /// Sets the value of [name][crate::model::mirroring_endpoint_group::AssociationDetails::name].
16613 ///
16614 /// # Example
16615 /// ```ignore,no_run
16616 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16617 /// let x = AssociationDetails::new().set_name("example");
16618 /// ```
16619 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16620 self.name = v.into();
16621 self
16622 }
16623
16624 /// Sets the value of [network][crate::model::mirroring_endpoint_group::AssociationDetails::network].
16625 ///
16626 /// # Example
16627 /// ```ignore,no_run
16628 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16629 /// let x = AssociationDetails::new().set_network("example");
16630 /// ```
16631 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16632 self.network = v.into();
16633 self
16634 }
16635
16636 /// Sets the value of [state][crate::model::mirroring_endpoint_group::AssociationDetails::state].
16637 ///
16638 /// # Example
16639 /// ```ignore,no_run
16640 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16641 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
16642 /// let x0 = AssociationDetails::new().set_state(State::Active);
16643 /// let x1 = AssociationDetails::new().set_state(State::Creating);
16644 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
16645 /// ```
16646 pub fn set_state<
16647 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
16648 >(
16649 mut self,
16650 v: T,
16651 ) -> Self {
16652 self.state = v.into();
16653 self
16654 }
16655 }
16656
16657 impl wkt::message::Message for AssociationDetails {
16658 fn typename() -> &'static str {
16659 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails"
16660 }
16661 }
16662
16663 /// The current state of the endpoint group.
16664 ///
16665 /// # Working with unknown values
16666 ///
16667 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16668 /// additional enum variants at any time. Adding new variants is not considered
16669 /// a breaking change. Applications should write their code in anticipation of:
16670 ///
16671 /// - New values appearing in future releases of the client library, **and**
16672 /// - New values received dynamically, without application changes.
16673 ///
16674 /// Please consult the [Working with enums] section in the user guide for some
16675 /// guidelines.
16676 ///
16677 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16678 #[derive(Clone, Debug, PartialEq)]
16679 #[non_exhaustive]
16680 pub enum State {
16681 /// State not set (this is not a valid state).
16682 Unspecified,
16683 /// The endpoint group is ready and in sync with the target deployment group.
16684 Active,
16685 /// The deployment group backing this endpoint group has been force-deleted.
16686 /// This endpoint group cannot be used and mirroring is effectively disabled.
16687 Closed,
16688 /// The endpoint group is being created.
16689 Creating,
16690 /// The endpoint group is being deleted.
16691 Deleting,
16692 /// The endpoint group is out of sync with the backing deployment group.
16693 /// In most cases, this is a result of a transient issue within the system
16694 /// (e.g. an inaccessible location) and the system is expected to recover
16695 /// automatically. See the associations field for details per network and
16696 /// location.
16697 OutOfSync,
16698 /// An attempt to delete the endpoint group has failed. This is a terminal
16699 /// state and the endpoint group is not expected to recover.
16700 /// The only permitted operation is to retry deleting the endpoint group.
16701 DeleteFailed,
16702 /// If set, the enum was initialized with an unknown value.
16703 ///
16704 /// Applications can examine the value using [State::value] or
16705 /// [State::name].
16706 UnknownValue(state::UnknownValue),
16707 }
16708
16709 #[doc(hidden)]
16710 pub mod state {
16711 #[allow(unused_imports)]
16712 use super::*;
16713 #[derive(Clone, Debug, PartialEq)]
16714 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16715 }
16716
16717 impl State {
16718 /// Gets the enum value.
16719 ///
16720 /// Returns `None` if the enum contains an unknown value deserialized from
16721 /// the string representation of enums.
16722 pub fn value(&self) -> std::option::Option<i32> {
16723 match self {
16724 Self::Unspecified => std::option::Option::Some(0),
16725 Self::Active => std::option::Option::Some(1),
16726 Self::Closed => std::option::Option::Some(2),
16727 Self::Creating => std::option::Option::Some(3),
16728 Self::Deleting => std::option::Option::Some(4),
16729 Self::OutOfSync => std::option::Option::Some(5),
16730 Self::DeleteFailed => std::option::Option::Some(6),
16731 Self::UnknownValue(u) => u.0.value(),
16732 }
16733 }
16734
16735 /// Gets the enum value as a string.
16736 ///
16737 /// Returns `None` if the enum contains an unknown value deserialized from
16738 /// the integer representation of enums.
16739 pub fn name(&self) -> std::option::Option<&str> {
16740 match self {
16741 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16742 Self::Active => std::option::Option::Some("ACTIVE"),
16743 Self::Closed => std::option::Option::Some("CLOSED"),
16744 Self::Creating => std::option::Option::Some("CREATING"),
16745 Self::Deleting => std::option::Option::Some("DELETING"),
16746 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16747 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
16748 Self::UnknownValue(u) => u.0.name(),
16749 }
16750 }
16751 }
16752
16753 impl std::default::Default for State {
16754 fn default() -> Self {
16755 use std::convert::From;
16756 Self::from(0)
16757 }
16758 }
16759
16760 impl std::fmt::Display for State {
16761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16762 wkt::internal::display_enum(f, self.name(), self.value())
16763 }
16764 }
16765
16766 impl std::convert::From<i32> for State {
16767 fn from(value: i32) -> Self {
16768 match value {
16769 0 => Self::Unspecified,
16770 1 => Self::Active,
16771 2 => Self::Closed,
16772 3 => Self::Creating,
16773 4 => Self::Deleting,
16774 5 => Self::OutOfSync,
16775 6 => Self::DeleteFailed,
16776 _ => Self::UnknownValue(state::UnknownValue(
16777 wkt::internal::UnknownEnumValue::Integer(value),
16778 )),
16779 }
16780 }
16781 }
16782
16783 impl std::convert::From<&str> for State {
16784 fn from(value: &str) -> Self {
16785 use std::string::ToString;
16786 match value {
16787 "STATE_UNSPECIFIED" => Self::Unspecified,
16788 "ACTIVE" => Self::Active,
16789 "CLOSED" => Self::Closed,
16790 "CREATING" => Self::Creating,
16791 "DELETING" => Self::Deleting,
16792 "OUT_OF_SYNC" => Self::OutOfSync,
16793 "DELETE_FAILED" => Self::DeleteFailed,
16794 _ => Self::UnknownValue(state::UnknownValue(
16795 wkt::internal::UnknownEnumValue::String(value.to_string()),
16796 )),
16797 }
16798 }
16799 }
16800
16801 impl serde::ser::Serialize for State {
16802 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16803 where
16804 S: serde::Serializer,
16805 {
16806 match self {
16807 Self::Unspecified => serializer.serialize_i32(0),
16808 Self::Active => serializer.serialize_i32(1),
16809 Self::Closed => serializer.serialize_i32(2),
16810 Self::Creating => serializer.serialize_i32(3),
16811 Self::Deleting => serializer.serialize_i32(4),
16812 Self::OutOfSync => serializer.serialize_i32(5),
16813 Self::DeleteFailed => serializer.serialize_i32(6),
16814 Self::UnknownValue(u) => u.0.serialize(serializer),
16815 }
16816 }
16817 }
16818
16819 impl<'de> serde::de::Deserialize<'de> for State {
16820 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16821 where
16822 D: serde::Deserializer<'de>,
16823 {
16824 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16825 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.State",
16826 ))
16827 }
16828 }
16829
16830 /// The type of the endpoint group.
16831 ///
16832 /// # Working with unknown values
16833 ///
16834 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16835 /// additional enum variants at any time. Adding new variants is not considered
16836 /// a breaking change. Applications should write their code in anticipation of:
16837 ///
16838 /// - New values appearing in future releases of the client library, **and**
16839 /// - New values received dynamically, without application changes.
16840 ///
16841 /// Please consult the [Working with enums] section in the user guide for some
16842 /// guidelines.
16843 ///
16844 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16845 #[derive(Clone, Debug, PartialEq)]
16846 #[non_exhaustive]
16847 pub enum Type {
16848 /// Not set.
16849 Unspecified,
16850 /// An endpoint group that sends packets to a single deployment group.
16851 Direct,
16852 /// If set, the enum was initialized with an unknown value.
16853 ///
16854 /// Applications can examine the value using [Type::value] or
16855 /// [Type::name].
16856 UnknownValue(r#type::UnknownValue),
16857 }
16858
16859 #[doc(hidden)]
16860 pub mod r#type {
16861 #[allow(unused_imports)]
16862 use super::*;
16863 #[derive(Clone, Debug, PartialEq)]
16864 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16865 }
16866
16867 impl Type {
16868 /// Gets the enum value.
16869 ///
16870 /// Returns `None` if the enum contains an unknown value deserialized from
16871 /// the string representation of enums.
16872 pub fn value(&self) -> std::option::Option<i32> {
16873 match self {
16874 Self::Unspecified => std::option::Option::Some(0),
16875 Self::Direct => std::option::Option::Some(1),
16876 Self::UnknownValue(u) => u.0.value(),
16877 }
16878 }
16879
16880 /// Gets the enum value as a string.
16881 ///
16882 /// Returns `None` if the enum contains an unknown value deserialized from
16883 /// the integer representation of enums.
16884 pub fn name(&self) -> std::option::Option<&str> {
16885 match self {
16886 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
16887 Self::Direct => std::option::Option::Some("DIRECT"),
16888 Self::UnknownValue(u) => u.0.name(),
16889 }
16890 }
16891 }
16892
16893 impl std::default::Default for Type {
16894 fn default() -> Self {
16895 use std::convert::From;
16896 Self::from(0)
16897 }
16898 }
16899
16900 impl std::fmt::Display for Type {
16901 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16902 wkt::internal::display_enum(f, self.name(), self.value())
16903 }
16904 }
16905
16906 impl std::convert::From<i32> for Type {
16907 fn from(value: i32) -> Self {
16908 match value {
16909 0 => Self::Unspecified,
16910 1 => Self::Direct,
16911 _ => Self::UnknownValue(r#type::UnknownValue(
16912 wkt::internal::UnknownEnumValue::Integer(value),
16913 )),
16914 }
16915 }
16916 }
16917
16918 impl std::convert::From<&str> for Type {
16919 fn from(value: &str) -> Self {
16920 use std::string::ToString;
16921 match value {
16922 "TYPE_UNSPECIFIED" => Self::Unspecified,
16923 "DIRECT" => Self::Direct,
16924 _ => Self::UnknownValue(r#type::UnknownValue(
16925 wkt::internal::UnknownEnumValue::String(value.to_string()),
16926 )),
16927 }
16928 }
16929 }
16930
16931 impl serde::ser::Serialize for Type {
16932 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16933 where
16934 S: serde::Serializer,
16935 {
16936 match self {
16937 Self::Unspecified => serializer.serialize_i32(0),
16938 Self::Direct => serializer.serialize_i32(1),
16939 Self::UnknownValue(u) => u.0.serialize(serializer),
16940 }
16941 }
16942 }
16943
16944 impl<'de> serde::de::Deserialize<'de> for Type {
16945 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16946 where
16947 D: serde::Deserializer<'de>,
16948 {
16949 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
16950 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.Type",
16951 ))
16952 }
16953 }
16954}
16955
16956/// Request message for ListMirroringEndpointGroups.
16957#[derive(Clone, Default, PartialEq)]
16958#[non_exhaustive]
16959pub struct ListMirroringEndpointGroupsRequest {
16960 /// Required. The parent, which owns this collection of endpoint groups.
16961 /// Example: `projects/123456789/locations/global`.
16962 /// See <https://google.aip.dev/132> for more details.
16963 pub parent: std::string::String,
16964
16965 /// Optional. Requested page size. Server may return fewer items than
16966 /// requested. If unspecified, server will pick an appropriate default. See
16967 /// <https://google.aip.dev/158> for more details.
16968 pub page_size: i32,
16969
16970 /// Optional. A page token, received from a previous
16971 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
16972 /// page. When paginating, all other parameters provided to
16973 /// `ListMirroringEndpointGroups` must match the call that provided the page
16974 /// token.
16975 /// See <https://google.aip.dev/158> for more details.
16976 pub page_token: std::string::String,
16977
16978 /// Optional. Filter expression.
16979 /// See <https://google.aip.dev/160#filtering> for more details.
16980 pub filter: std::string::String,
16981
16982 /// Optional. Sort expression.
16983 /// See <https://google.aip.dev/132#ordering> for more details.
16984 pub order_by: std::string::String,
16985
16986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16987}
16988
16989impl ListMirroringEndpointGroupsRequest {
16990 /// Creates a new default instance.
16991 pub fn new() -> Self {
16992 std::default::Default::default()
16993 }
16994
16995 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
16996 ///
16997 /// # Example
16998 /// ```ignore,no_run
16999 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17000 /// let x = ListMirroringEndpointGroupsRequest::new().set_parent("example");
17001 /// ```
17002 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17003 self.parent = v.into();
17004 self
17005 }
17006
17007 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
17008 ///
17009 /// # Example
17010 /// ```ignore,no_run
17011 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17012 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_size(42);
17013 /// ```
17014 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17015 self.page_size = v.into();
17016 self
17017 }
17018
17019 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
17020 ///
17021 /// # Example
17022 /// ```ignore,no_run
17023 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17024 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_token("example");
17025 /// ```
17026 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17027 self.page_token = v.into();
17028 self
17029 }
17030
17031 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
17032 ///
17033 /// # Example
17034 /// ```ignore,no_run
17035 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17036 /// let x = ListMirroringEndpointGroupsRequest::new().set_filter("example");
17037 /// ```
17038 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17039 self.filter = v.into();
17040 self
17041 }
17042
17043 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
17044 ///
17045 /// # Example
17046 /// ```ignore,no_run
17047 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17048 /// let x = ListMirroringEndpointGroupsRequest::new().set_order_by("example");
17049 /// ```
17050 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17051 self.order_by = v.into();
17052 self
17053 }
17054}
17055
17056impl wkt::message::Message for ListMirroringEndpointGroupsRequest {
17057 fn typename() -> &'static str {
17058 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest"
17059 }
17060}
17061
17062/// Response message for ListMirroringEndpointGroups.
17063#[derive(Clone, Default, PartialEq)]
17064#[non_exhaustive]
17065pub struct ListMirroringEndpointGroupsResponse {
17066 /// The endpoint groups from the specified parent.
17067 pub mirroring_endpoint_groups: std::vec::Vec<crate::model::MirroringEndpointGroup>,
17068
17069 /// A token that can be sent as `page_token` to retrieve the next page.
17070 /// If this field is omitted, there are no subsequent pages.
17071 /// See <https://google.aip.dev/158> for more details.
17072 pub next_page_token: std::string::String,
17073
17074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17075}
17076
17077impl ListMirroringEndpointGroupsResponse {
17078 /// Creates a new default instance.
17079 pub fn new() -> Self {
17080 std::default::Default::default()
17081 }
17082
17083 /// Sets the value of [mirroring_endpoint_groups][crate::model::ListMirroringEndpointGroupsResponse::mirroring_endpoint_groups].
17084 ///
17085 /// # Example
17086 /// ```ignore,no_run
17087 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17088 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17089 /// let x = ListMirroringEndpointGroupsResponse::new()
17090 /// .set_mirroring_endpoint_groups([
17091 /// MirroringEndpointGroup::default()/* use setters */,
17092 /// MirroringEndpointGroup::default()/* use (different) setters */,
17093 /// ]);
17094 /// ```
17095 pub fn set_mirroring_endpoint_groups<T, V>(mut self, v: T) -> Self
17096 where
17097 T: std::iter::IntoIterator<Item = V>,
17098 V: std::convert::Into<crate::model::MirroringEndpointGroup>,
17099 {
17100 use std::iter::Iterator;
17101 self.mirroring_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
17102 self
17103 }
17104
17105 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupsResponse::next_page_token].
17106 ///
17107 /// # Example
17108 /// ```ignore,no_run
17109 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17110 /// let x = ListMirroringEndpointGroupsResponse::new().set_next_page_token("example");
17111 /// ```
17112 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17113 self.next_page_token = v.into();
17114 self
17115 }
17116}
17117
17118impl wkt::message::Message for ListMirroringEndpointGroupsResponse {
17119 fn typename() -> &'static str {
17120 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse"
17121 }
17122}
17123
17124#[doc(hidden)]
17125impl google_cloud_gax::paginator::internal::PageableResponse
17126 for ListMirroringEndpointGroupsResponse
17127{
17128 type PageItem = crate::model::MirroringEndpointGroup;
17129
17130 fn items(self) -> std::vec::Vec<Self::PageItem> {
17131 self.mirroring_endpoint_groups
17132 }
17133
17134 fn next_page_token(&self) -> std::string::String {
17135 use std::clone::Clone;
17136 self.next_page_token.clone()
17137 }
17138}
17139
17140/// Request message for GetMirroringEndpointGroup.
17141#[derive(Clone, Default, PartialEq)]
17142#[non_exhaustive]
17143pub struct GetMirroringEndpointGroupRequest {
17144 /// Required. The name of the endpoint group to retrieve.
17145 /// Format:
17146 /// projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}
17147 pub name: std::string::String,
17148
17149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17150}
17151
17152impl GetMirroringEndpointGroupRequest {
17153 /// Creates a new default instance.
17154 pub fn new() -> Self {
17155 std::default::Default::default()
17156 }
17157
17158 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
17159 ///
17160 /// # Example
17161 /// ```ignore,no_run
17162 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupRequest;
17163 /// let x = GetMirroringEndpointGroupRequest::new().set_name("example");
17164 /// ```
17165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17166 self.name = v.into();
17167 self
17168 }
17169}
17170
17171impl wkt::message::Message for GetMirroringEndpointGroupRequest {
17172 fn typename() -> &'static str {
17173 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest"
17174 }
17175}
17176
17177/// Request message for CreateMirroringEndpointGroup.
17178#[derive(Clone, Default, PartialEq)]
17179#[non_exhaustive]
17180pub struct CreateMirroringEndpointGroupRequest {
17181 /// Required. The parent resource where this endpoint group will be created.
17182 /// Format: projects/{project}/locations/{location}
17183 pub parent: std::string::String,
17184
17185 /// Required. The ID to use for the endpoint group, which will become the final
17186 /// component of the endpoint group's resource name.
17187 pub mirroring_endpoint_group_id: std::string::String,
17188
17189 /// Required. The endpoint group to create.
17190 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17191
17192 /// Optional. A unique identifier for this request. Must be a UUID4.
17193 /// This request is only idempotent if a `request_id` is provided.
17194 /// See <https://google.aip.dev/155> for more details.
17195 pub request_id: std::string::String,
17196
17197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17198}
17199
17200impl CreateMirroringEndpointGroupRequest {
17201 /// Creates a new default instance.
17202 pub fn new() -> Self {
17203 std::default::Default::default()
17204 }
17205
17206 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
17207 ///
17208 /// # Example
17209 /// ```ignore,no_run
17210 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17211 /// let x = CreateMirroringEndpointGroupRequest::new().set_parent("example");
17212 /// ```
17213 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17214 self.parent = v.into();
17215 self
17216 }
17217
17218 /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
17219 ///
17220 /// # Example
17221 /// ```ignore,no_run
17222 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17223 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group_id("example");
17224 /// ```
17225 pub fn set_mirroring_endpoint_group_id<T: std::convert::Into<std::string::String>>(
17226 mut self,
17227 v: T,
17228 ) -> Self {
17229 self.mirroring_endpoint_group_id = v.into();
17230 self
17231 }
17232
17233 /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17234 ///
17235 /// # Example
17236 /// ```ignore,no_run
17237 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17238 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17239 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17240 /// ```
17241 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17242 where
17243 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17244 {
17245 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17246 self
17247 }
17248
17249 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17250 ///
17251 /// # Example
17252 /// ```ignore,no_run
17253 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17254 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17255 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17256 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17257 /// ```
17258 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17259 where
17260 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17261 {
17262 self.mirroring_endpoint_group = v.map(|x| x.into());
17263 self
17264 }
17265
17266 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
17267 ///
17268 /// # Example
17269 /// ```ignore,no_run
17270 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17271 /// let x = CreateMirroringEndpointGroupRequest::new().set_request_id("example");
17272 /// ```
17273 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17274 self.request_id = v.into();
17275 self
17276 }
17277}
17278
17279impl wkt::message::Message for CreateMirroringEndpointGroupRequest {
17280 fn typename() -> &'static str {
17281 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest"
17282 }
17283}
17284
17285/// Request message for UpdateMirroringEndpointGroup.
17286#[derive(Clone, Default, PartialEq)]
17287#[non_exhaustive]
17288pub struct UpdateMirroringEndpointGroupRequest {
17289 /// Optional. The list of fields to update.
17290 /// Fields are specified relative to the endpoint group
17291 /// (e.g. `description`; *not* `mirroring_endpoint_group.description`).
17292 /// See <https://google.aip.dev/161> for more details.
17293 pub update_mask: std::option::Option<wkt::FieldMask>,
17294
17295 /// Required. The endpoint group to update.
17296 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17297
17298 /// Optional. A unique identifier for this request. Must be a UUID4.
17299 /// This request is only idempotent if a `request_id` is provided.
17300 /// See <https://google.aip.dev/155> for more details.
17301 pub request_id: std::string::String,
17302
17303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17304}
17305
17306impl UpdateMirroringEndpointGroupRequest {
17307 /// Creates a new default instance.
17308 pub fn new() -> Self {
17309 std::default::Default::default()
17310 }
17311
17312 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17313 ///
17314 /// # Example
17315 /// ```ignore,no_run
17316 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17317 /// use wkt::FieldMask;
17318 /// let x = UpdateMirroringEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17319 /// ```
17320 pub fn set_update_mask<T>(mut self, v: T) -> Self
17321 where
17322 T: std::convert::Into<wkt::FieldMask>,
17323 {
17324 self.update_mask = std::option::Option::Some(v.into());
17325 self
17326 }
17327
17328 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17329 ///
17330 /// # Example
17331 /// ```ignore,no_run
17332 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17333 /// use wkt::FieldMask;
17334 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17335 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17336 /// ```
17337 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17338 where
17339 T: std::convert::Into<wkt::FieldMask>,
17340 {
17341 self.update_mask = v.map(|x| x.into());
17342 self
17343 }
17344
17345 /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17346 ///
17347 /// # Example
17348 /// ```ignore,no_run
17349 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17350 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17351 /// let x = UpdateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17352 /// ```
17353 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17354 where
17355 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17356 {
17357 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17358 self
17359 }
17360
17361 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17362 ///
17363 /// # Example
17364 /// ```ignore,no_run
17365 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17366 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17367 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17368 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17369 /// ```
17370 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17371 where
17372 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17373 {
17374 self.mirroring_endpoint_group = v.map(|x| x.into());
17375 self
17376 }
17377
17378 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
17379 ///
17380 /// # Example
17381 /// ```ignore,no_run
17382 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17383 /// let x = UpdateMirroringEndpointGroupRequest::new().set_request_id("example");
17384 /// ```
17385 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17386 self.request_id = v.into();
17387 self
17388 }
17389}
17390
17391impl wkt::message::Message for UpdateMirroringEndpointGroupRequest {
17392 fn typename() -> &'static str {
17393 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest"
17394 }
17395}
17396
17397/// Request message for DeleteMirroringEndpointGroup.
17398#[derive(Clone, Default, PartialEq)]
17399#[non_exhaustive]
17400pub struct DeleteMirroringEndpointGroupRequest {
17401 /// Required. The endpoint group to delete.
17402 pub name: std::string::String,
17403
17404 /// Optional. A unique identifier for this request. Must be a UUID4.
17405 /// This request is only idempotent if a `request_id` is provided.
17406 /// See <https://google.aip.dev/155> for more details.
17407 pub request_id: std::string::String,
17408
17409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17410}
17411
17412impl DeleteMirroringEndpointGroupRequest {
17413 /// Creates a new default instance.
17414 pub fn new() -> Self {
17415 std::default::Default::default()
17416 }
17417
17418 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
17419 ///
17420 /// # Example
17421 /// ```ignore,no_run
17422 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17423 /// let x = DeleteMirroringEndpointGroupRequest::new().set_name("example");
17424 /// ```
17425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17426 self.name = v.into();
17427 self
17428 }
17429
17430 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
17431 ///
17432 /// # Example
17433 /// ```ignore,no_run
17434 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17435 /// let x = DeleteMirroringEndpointGroupRequest::new().set_request_id("example");
17436 /// ```
17437 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17438 self.request_id = v.into();
17439 self
17440 }
17441}
17442
17443impl wkt::message::Message for DeleteMirroringEndpointGroupRequest {
17444 fn typename() -> &'static str {
17445 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest"
17446 }
17447}
17448
17449/// An endpoint group association represents a link between a network and an
17450/// endpoint group in the organization.
17451///
17452/// Creating an association creates the networking infrastructure linking the
17453/// network to the endpoint group, but does not enable mirroring by itself.
17454/// To enable mirroring, the user must also create a network firewall policy
17455/// containing mirroring rules and associate it with the network.
17456#[derive(Clone, Default, PartialEq)]
17457#[non_exhaustive]
17458pub struct MirroringEndpointGroupAssociation {
17459 /// Immutable. Identifier. The resource name of this endpoint group
17460 /// association, for example:
17461 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-eg-association`.
17462 /// See <https://google.aip.dev/122> for more details.
17463 pub name: std::string::String,
17464
17465 /// Output only. The timestamp when the resource was created.
17466 /// See <https://google.aip.dev/148#timestamps>.
17467 pub create_time: std::option::Option<wkt::Timestamp>,
17468
17469 /// Output only. The timestamp when the resource was most recently updated.
17470 /// See <https://google.aip.dev/148#timestamps>.
17471 pub update_time: std::option::Option<wkt::Timestamp>,
17472
17473 /// Optional. Labels are key/value pairs that help to organize and filter
17474 /// resources.
17475 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17476
17477 /// Immutable. The endpoint group that this association is connected to, for
17478 /// example:
17479 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
17480 /// See <https://google.aip.dev/124>.
17481 pub mirroring_endpoint_group: std::string::String,
17482
17483 /// Immutable. The VPC network that is associated. for example:
17484 /// `projects/123456789/global/networks/my-network`.
17485 /// See <https://google.aip.dev/124>.
17486 pub network: std::string::String,
17487
17488 /// Output only. The list of locations where the association is present. This
17489 /// information is retrieved from the linked endpoint group, and not configured
17490 /// as part of the association itself.
17491 #[deprecated]
17492 pub locations_details:
17493 std::vec::Vec<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17494
17495 /// Output only. Current state of the endpoint group association.
17496 pub state: crate::model::mirroring_endpoint_group_association::State,
17497
17498 /// Output only. The current state of the resource does not match the user's
17499 /// intended state, and the system is working to reconcile them. This part of
17500 /// the normal operation (e.g. adding a new location to the target deployment
17501 /// group). See <https://google.aip.dev/128>.
17502 pub reconciling: bool,
17503
17504 /// Output only. The list of locations where the association is configured.
17505 /// This information is retrieved from the linked endpoint group.
17506 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
17507
17508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17509}
17510
17511impl MirroringEndpointGroupAssociation {
17512 /// Creates a new default instance.
17513 pub fn new() -> Self {
17514 std::default::Default::default()
17515 }
17516
17517 /// Sets the value of [name][crate::model::MirroringEndpointGroupAssociation::name].
17518 ///
17519 /// # Example
17520 /// ```ignore,no_run
17521 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17522 /// let x = MirroringEndpointGroupAssociation::new().set_name("example");
17523 /// ```
17524 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17525 self.name = v.into();
17526 self
17527 }
17528
17529 /// Sets the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17530 ///
17531 /// # Example
17532 /// ```ignore,no_run
17533 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17534 /// use wkt::Timestamp;
17535 /// let x = MirroringEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
17536 /// ```
17537 pub fn set_create_time<T>(mut self, v: T) -> Self
17538 where
17539 T: std::convert::Into<wkt::Timestamp>,
17540 {
17541 self.create_time = std::option::Option::Some(v.into());
17542 self
17543 }
17544
17545 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17546 ///
17547 /// # Example
17548 /// ```ignore,no_run
17549 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17550 /// use wkt::Timestamp;
17551 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17552 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
17553 /// ```
17554 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17555 where
17556 T: std::convert::Into<wkt::Timestamp>,
17557 {
17558 self.create_time = v.map(|x| x.into());
17559 self
17560 }
17561
17562 /// Sets the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17563 ///
17564 /// # Example
17565 /// ```ignore,no_run
17566 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17567 /// use wkt::Timestamp;
17568 /// let x = MirroringEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
17569 /// ```
17570 pub fn set_update_time<T>(mut self, v: T) -> Self
17571 where
17572 T: std::convert::Into<wkt::Timestamp>,
17573 {
17574 self.update_time = std::option::Option::Some(v.into());
17575 self
17576 }
17577
17578 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17579 ///
17580 /// # Example
17581 /// ```ignore,no_run
17582 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17583 /// use wkt::Timestamp;
17584 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17585 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
17586 /// ```
17587 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17588 where
17589 T: std::convert::Into<wkt::Timestamp>,
17590 {
17591 self.update_time = v.map(|x| x.into());
17592 self
17593 }
17594
17595 /// Sets the value of [labels][crate::model::MirroringEndpointGroupAssociation::labels].
17596 ///
17597 /// # Example
17598 /// ```ignore,no_run
17599 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17600 /// let x = MirroringEndpointGroupAssociation::new().set_labels([
17601 /// ("key0", "abc"),
17602 /// ("key1", "xyz"),
17603 /// ]);
17604 /// ```
17605 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17606 where
17607 T: std::iter::IntoIterator<Item = (K, V)>,
17608 K: std::convert::Into<std::string::String>,
17609 V: std::convert::Into<std::string::String>,
17610 {
17611 use std::iter::Iterator;
17612 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17613 self
17614 }
17615
17616 /// Sets the value of [mirroring_endpoint_group][crate::model::MirroringEndpointGroupAssociation::mirroring_endpoint_group].
17617 ///
17618 /// # Example
17619 /// ```ignore,no_run
17620 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17621 /// let x = MirroringEndpointGroupAssociation::new().set_mirroring_endpoint_group("example");
17622 /// ```
17623 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
17624 mut self,
17625 v: T,
17626 ) -> Self {
17627 self.mirroring_endpoint_group = v.into();
17628 self
17629 }
17630
17631 /// Sets the value of [network][crate::model::MirroringEndpointGroupAssociation::network].
17632 ///
17633 /// # Example
17634 /// ```ignore,no_run
17635 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17636 /// let x = MirroringEndpointGroupAssociation::new().set_network("example");
17637 /// ```
17638 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17639 self.network = v.into();
17640 self
17641 }
17642
17643 /// Sets the value of [locations_details][crate::model::MirroringEndpointGroupAssociation::locations_details].
17644 ///
17645 /// # Example
17646 /// ```ignore,no_run
17647 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17648 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17649 /// let x = MirroringEndpointGroupAssociation::new()
17650 /// .set_locations_details([
17651 /// LocationDetails::default()/* use setters */,
17652 /// LocationDetails::default()/* use (different) setters */,
17653 /// ]);
17654 /// ```
17655 #[deprecated]
17656 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
17657 where
17658 T: std::iter::IntoIterator<Item = V>,
17659 V: std::convert::Into<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17660 {
17661 use std::iter::Iterator;
17662 self.locations_details = v.into_iter().map(|i| i.into()).collect();
17663 self
17664 }
17665
17666 /// Sets the value of [state][crate::model::MirroringEndpointGroupAssociation::state].
17667 ///
17668 /// # Example
17669 /// ```ignore,no_run
17670 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17671 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
17672 /// let x0 = MirroringEndpointGroupAssociation::new().set_state(State::Active);
17673 /// let x1 = MirroringEndpointGroupAssociation::new().set_state(State::Creating);
17674 /// let x2 = MirroringEndpointGroupAssociation::new().set_state(State::Deleting);
17675 /// ```
17676 pub fn set_state<
17677 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
17678 >(
17679 mut self,
17680 v: T,
17681 ) -> Self {
17682 self.state = v.into();
17683 self
17684 }
17685
17686 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroupAssociation::reconciling].
17687 ///
17688 /// # Example
17689 /// ```ignore,no_run
17690 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17691 /// let x = MirroringEndpointGroupAssociation::new().set_reconciling(true);
17692 /// ```
17693 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17694 self.reconciling = v.into();
17695 self
17696 }
17697
17698 /// Sets the value of [locations][crate::model::MirroringEndpointGroupAssociation::locations].
17699 ///
17700 /// # Example
17701 /// ```ignore,no_run
17702 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17703 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
17704 /// let x = MirroringEndpointGroupAssociation::new()
17705 /// .set_locations([
17706 /// MirroringLocation::default()/* use setters */,
17707 /// MirroringLocation::default()/* use (different) setters */,
17708 /// ]);
17709 /// ```
17710 pub fn set_locations<T, V>(mut self, v: T) -> Self
17711 where
17712 T: std::iter::IntoIterator<Item = V>,
17713 V: std::convert::Into<crate::model::MirroringLocation>,
17714 {
17715 use std::iter::Iterator;
17716 self.locations = v.into_iter().map(|i| i.into()).collect();
17717 self
17718 }
17719}
17720
17721impl wkt::message::Message for MirroringEndpointGroupAssociation {
17722 fn typename() -> &'static str {
17723 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation"
17724 }
17725}
17726
17727/// Defines additional types related to [MirroringEndpointGroupAssociation].
17728pub mod mirroring_endpoint_group_association {
17729 #[allow(unused_imports)]
17730 use super::*;
17731
17732 /// Contains details about the state of an association in a specific cloud
17733 /// location.
17734 #[derive(Clone, Default, PartialEq)]
17735 #[non_exhaustive]
17736 pub struct LocationDetails {
17737 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
17738 pub location: std::string::String,
17739
17740 /// Output only. The current state of the association in this location.
17741 pub state: crate::model::mirroring_endpoint_group_association::location_details::State,
17742
17743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17744 }
17745
17746 impl LocationDetails {
17747 /// Creates a new default instance.
17748 pub fn new() -> Self {
17749 std::default::Default::default()
17750 }
17751
17752 /// Sets the value of [location][crate::model::mirroring_endpoint_group_association::LocationDetails::location].
17753 ///
17754 /// # Example
17755 /// ```ignore,no_run
17756 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17757 /// let x = LocationDetails::new().set_location("example");
17758 /// ```
17759 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17760 self.location = v.into();
17761 self
17762 }
17763
17764 /// Sets the value of [state][crate::model::mirroring_endpoint_group_association::LocationDetails::state].
17765 ///
17766 /// # Example
17767 /// ```ignore,no_run
17768 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17769 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::location_details::State;
17770 /// let x0 = LocationDetails::new().set_state(State::Active);
17771 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
17772 /// ```
17773 pub fn set_state<
17774 T: std::convert::Into<
17775 crate::model::mirroring_endpoint_group_association::location_details::State,
17776 >,
17777 >(
17778 mut self,
17779 v: T,
17780 ) -> Self {
17781 self.state = v.into();
17782 self
17783 }
17784 }
17785
17786 impl wkt::message::Message for LocationDetails {
17787 fn typename() -> &'static str {
17788 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails"
17789 }
17790 }
17791
17792 /// Defines additional types related to [LocationDetails].
17793 pub mod location_details {
17794 #[allow(unused_imports)]
17795 use super::*;
17796
17797 /// The state of association.
17798 ///
17799 /// # Working with unknown values
17800 ///
17801 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17802 /// additional enum variants at any time. Adding new variants is not considered
17803 /// a breaking change. Applications should write their code in anticipation of:
17804 ///
17805 /// - New values appearing in future releases of the client library, **and**
17806 /// - New values received dynamically, without application changes.
17807 ///
17808 /// Please consult the [Working with enums] section in the user guide for some
17809 /// guidelines.
17810 ///
17811 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17812 #[derive(Clone, Debug, PartialEq)]
17813 #[non_exhaustive]
17814 pub enum State {
17815 /// Not set.
17816 Unspecified,
17817 /// The association is ready and in sync with the linked endpoint group.
17818 Active,
17819 /// The association is out of sync with the linked endpoint group.
17820 /// In most cases, this is a result of a transient issue within the system
17821 /// (e.g. an inaccessible location) and the system is expected to recover
17822 /// automatically.
17823 OutOfSync,
17824 /// If set, the enum was initialized with an unknown value.
17825 ///
17826 /// Applications can examine the value using [State::value] or
17827 /// [State::name].
17828 UnknownValue(state::UnknownValue),
17829 }
17830
17831 #[doc(hidden)]
17832 pub mod state {
17833 #[allow(unused_imports)]
17834 use super::*;
17835 #[derive(Clone, Debug, PartialEq)]
17836 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17837 }
17838
17839 impl State {
17840 /// Gets the enum value.
17841 ///
17842 /// Returns `None` if the enum contains an unknown value deserialized from
17843 /// the string representation of enums.
17844 pub fn value(&self) -> std::option::Option<i32> {
17845 match self {
17846 Self::Unspecified => std::option::Option::Some(0),
17847 Self::Active => std::option::Option::Some(1),
17848 Self::OutOfSync => std::option::Option::Some(2),
17849 Self::UnknownValue(u) => u.0.value(),
17850 }
17851 }
17852
17853 /// Gets the enum value as a string.
17854 ///
17855 /// Returns `None` if the enum contains an unknown value deserialized from
17856 /// the integer representation of enums.
17857 pub fn name(&self) -> std::option::Option<&str> {
17858 match self {
17859 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17860 Self::Active => std::option::Option::Some("ACTIVE"),
17861 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
17862 Self::UnknownValue(u) => u.0.name(),
17863 }
17864 }
17865 }
17866
17867 impl std::default::Default for State {
17868 fn default() -> Self {
17869 use std::convert::From;
17870 Self::from(0)
17871 }
17872 }
17873
17874 impl std::fmt::Display for State {
17875 fn fmt(
17876 &self,
17877 f: &mut std::fmt::Formatter<'_>,
17878 ) -> std::result::Result<(), std::fmt::Error> {
17879 wkt::internal::display_enum(f, self.name(), self.value())
17880 }
17881 }
17882
17883 impl std::convert::From<i32> for State {
17884 fn from(value: i32) -> Self {
17885 match value {
17886 0 => Self::Unspecified,
17887 1 => Self::Active,
17888 2 => Self::OutOfSync,
17889 _ => Self::UnknownValue(state::UnknownValue(
17890 wkt::internal::UnknownEnumValue::Integer(value),
17891 )),
17892 }
17893 }
17894 }
17895
17896 impl std::convert::From<&str> for State {
17897 fn from(value: &str) -> Self {
17898 use std::string::ToString;
17899 match value {
17900 "STATE_UNSPECIFIED" => Self::Unspecified,
17901 "ACTIVE" => Self::Active,
17902 "OUT_OF_SYNC" => Self::OutOfSync,
17903 _ => Self::UnknownValue(state::UnknownValue(
17904 wkt::internal::UnknownEnumValue::String(value.to_string()),
17905 )),
17906 }
17907 }
17908 }
17909
17910 impl serde::ser::Serialize for State {
17911 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17912 where
17913 S: serde::Serializer,
17914 {
17915 match self {
17916 Self::Unspecified => serializer.serialize_i32(0),
17917 Self::Active => serializer.serialize_i32(1),
17918 Self::OutOfSync => serializer.serialize_i32(2),
17919 Self::UnknownValue(u) => u.0.serialize(serializer),
17920 }
17921 }
17922 }
17923
17924 impl<'de> serde::de::Deserialize<'de> for State {
17925 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17926 where
17927 D: serde::Deserializer<'de>,
17928 {
17929 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17930 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State"))
17931 }
17932 }
17933 }
17934
17935 /// The state of the association.
17936 ///
17937 /// # Working with unknown values
17938 ///
17939 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17940 /// additional enum variants at any time. Adding new variants is not considered
17941 /// a breaking change. Applications should write their code in anticipation of:
17942 ///
17943 /// - New values appearing in future releases of the client library, **and**
17944 /// - New values received dynamically, without application changes.
17945 ///
17946 /// Please consult the [Working with enums] section in the user guide for some
17947 /// guidelines.
17948 ///
17949 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17950 #[derive(Clone, Debug, PartialEq)]
17951 #[non_exhaustive]
17952 pub enum State {
17953 /// Not set.
17954 Unspecified,
17955 /// The association is ready and in sync with the linked endpoint group.
17956 Active,
17957 /// The association is being created.
17958 Creating,
17959 /// The association is being deleted.
17960 Deleting,
17961 /// The association is disabled due to a breaking change in another resource.
17962 Closed,
17963 /// The association is out of sync with the linked endpoint group.
17964 /// In most cases, this is a result of a transient issue within the system
17965 /// (e.g. an inaccessible location) and the system is expected to recover
17966 /// automatically. Check the `locations_details` field for more details.
17967 OutOfSync,
17968 /// An attempt to delete the association has failed. This is a terminal state
17969 /// and the association is not expected to be usable as some of its resources
17970 /// have been deleted.
17971 /// The only permitted operation is to retry deleting the association.
17972 DeleteFailed,
17973 /// If set, the enum was initialized with an unknown value.
17974 ///
17975 /// Applications can examine the value using [State::value] or
17976 /// [State::name].
17977 UnknownValue(state::UnknownValue),
17978 }
17979
17980 #[doc(hidden)]
17981 pub mod state {
17982 #[allow(unused_imports)]
17983 use super::*;
17984 #[derive(Clone, Debug, PartialEq)]
17985 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17986 }
17987
17988 impl State {
17989 /// Gets the enum value.
17990 ///
17991 /// Returns `None` if the enum contains an unknown value deserialized from
17992 /// the string representation of enums.
17993 pub fn value(&self) -> std::option::Option<i32> {
17994 match self {
17995 Self::Unspecified => std::option::Option::Some(0),
17996 Self::Active => std::option::Option::Some(1),
17997 Self::Creating => std::option::Option::Some(3),
17998 Self::Deleting => std::option::Option::Some(4),
17999 Self::Closed => std::option::Option::Some(5),
18000 Self::OutOfSync => std::option::Option::Some(6),
18001 Self::DeleteFailed => std::option::Option::Some(7),
18002 Self::UnknownValue(u) => u.0.value(),
18003 }
18004 }
18005
18006 /// Gets the enum value as a string.
18007 ///
18008 /// Returns `None` if the enum contains an unknown value deserialized from
18009 /// the integer representation of enums.
18010 pub fn name(&self) -> std::option::Option<&str> {
18011 match self {
18012 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18013 Self::Active => std::option::Option::Some("ACTIVE"),
18014 Self::Creating => std::option::Option::Some("CREATING"),
18015 Self::Deleting => std::option::Option::Some("DELETING"),
18016 Self::Closed => std::option::Option::Some("CLOSED"),
18017 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
18018 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
18019 Self::UnknownValue(u) => u.0.name(),
18020 }
18021 }
18022 }
18023
18024 impl std::default::Default for State {
18025 fn default() -> Self {
18026 use std::convert::From;
18027 Self::from(0)
18028 }
18029 }
18030
18031 impl std::fmt::Display for State {
18032 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18033 wkt::internal::display_enum(f, self.name(), self.value())
18034 }
18035 }
18036
18037 impl std::convert::From<i32> for State {
18038 fn from(value: i32) -> Self {
18039 match value {
18040 0 => Self::Unspecified,
18041 1 => Self::Active,
18042 3 => Self::Creating,
18043 4 => Self::Deleting,
18044 5 => Self::Closed,
18045 6 => Self::OutOfSync,
18046 7 => Self::DeleteFailed,
18047 _ => Self::UnknownValue(state::UnknownValue(
18048 wkt::internal::UnknownEnumValue::Integer(value),
18049 )),
18050 }
18051 }
18052 }
18053
18054 impl std::convert::From<&str> for State {
18055 fn from(value: &str) -> Self {
18056 use std::string::ToString;
18057 match value {
18058 "STATE_UNSPECIFIED" => Self::Unspecified,
18059 "ACTIVE" => Self::Active,
18060 "CREATING" => Self::Creating,
18061 "DELETING" => Self::Deleting,
18062 "CLOSED" => Self::Closed,
18063 "OUT_OF_SYNC" => Self::OutOfSync,
18064 "DELETE_FAILED" => Self::DeleteFailed,
18065 _ => Self::UnknownValue(state::UnknownValue(
18066 wkt::internal::UnknownEnumValue::String(value.to_string()),
18067 )),
18068 }
18069 }
18070 }
18071
18072 impl serde::ser::Serialize for State {
18073 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18074 where
18075 S: serde::Serializer,
18076 {
18077 match self {
18078 Self::Unspecified => serializer.serialize_i32(0),
18079 Self::Active => serializer.serialize_i32(1),
18080 Self::Creating => serializer.serialize_i32(3),
18081 Self::Deleting => serializer.serialize_i32(4),
18082 Self::Closed => serializer.serialize_i32(5),
18083 Self::OutOfSync => serializer.serialize_i32(6),
18084 Self::DeleteFailed => serializer.serialize_i32(7),
18085 Self::UnknownValue(u) => u.0.serialize(serializer),
18086 }
18087 }
18088 }
18089
18090 impl<'de> serde::de::Deserialize<'de> for State {
18091 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18092 where
18093 D: serde::Deserializer<'de>,
18094 {
18095 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18096 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State",
18097 ))
18098 }
18099 }
18100}
18101
18102/// Request message for ListMirroringEndpointGroupAssociations.
18103#[derive(Clone, Default, PartialEq)]
18104#[non_exhaustive]
18105pub struct ListMirroringEndpointGroupAssociationsRequest {
18106 /// Required. The parent, which owns this collection of associations.
18107 /// Example: `projects/123456789/locations/global`.
18108 /// See <https://google.aip.dev/132> for more details.
18109 pub parent: std::string::String,
18110
18111 /// Optional. Requested page size. Server may return fewer items than
18112 /// requested. If unspecified, server will pick an appropriate default. See
18113 /// <https://google.aip.dev/158> for more details.
18114 pub page_size: i32,
18115
18116 /// Optional. A page token, received from a previous
18117 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
18118 /// page. When paginating, all other parameters provided to
18119 /// `ListMirroringEndpointGroups` must match the call that provided the page
18120 /// token. See <https://google.aip.dev/158> for more details.
18121 pub page_token: std::string::String,
18122
18123 /// Optional. Filter expression.
18124 /// See <https://google.aip.dev/160#filtering> for more details.
18125 pub filter: std::string::String,
18126
18127 /// Optional. Sort expression.
18128 /// See <https://google.aip.dev/132#ordering> for more details.
18129 pub order_by: std::string::String,
18130
18131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18132}
18133
18134impl ListMirroringEndpointGroupAssociationsRequest {
18135 /// Creates a new default instance.
18136 pub fn new() -> Self {
18137 std::default::Default::default()
18138 }
18139
18140 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
18141 ///
18142 /// # Example
18143 /// ```ignore,no_run
18144 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18145 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_parent("example");
18146 /// ```
18147 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18148 self.parent = v.into();
18149 self
18150 }
18151
18152 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
18153 ///
18154 /// # Example
18155 /// ```ignore,no_run
18156 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18157 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_size(42);
18158 /// ```
18159 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18160 self.page_size = v.into();
18161 self
18162 }
18163
18164 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
18165 ///
18166 /// # Example
18167 /// ```ignore,no_run
18168 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18169 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_token("example");
18170 /// ```
18171 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18172 self.page_token = v.into();
18173 self
18174 }
18175
18176 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
18177 ///
18178 /// # Example
18179 /// ```ignore,no_run
18180 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18181 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_filter("example");
18182 /// ```
18183 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18184 self.filter = v.into();
18185 self
18186 }
18187
18188 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
18189 ///
18190 /// # Example
18191 /// ```ignore,no_run
18192 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18193 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_order_by("example");
18194 /// ```
18195 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18196 self.order_by = v.into();
18197 self
18198 }
18199}
18200
18201impl wkt::message::Message for ListMirroringEndpointGroupAssociationsRequest {
18202 fn typename() -> &'static str {
18203 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest"
18204 }
18205}
18206
18207/// Response message for ListMirroringEndpointGroupAssociations.
18208#[derive(Clone, Default, PartialEq)]
18209#[non_exhaustive]
18210pub struct ListMirroringEndpointGroupAssociationsResponse {
18211 /// The associations from the specified parent.
18212 pub mirroring_endpoint_group_associations:
18213 std::vec::Vec<crate::model::MirroringEndpointGroupAssociation>,
18214
18215 /// A token that can be sent as `page_token` to retrieve the next page.
18216 /// If this field is omitted, there are no subsequent pages.
18217 /// See <https://google.aip.dev/158> for more details.
18218 pub next_page_token: std::string::String,
18219
18220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18221}
18222
18223impl ListMirroringEndpointGroupAssociationsResponse {
18224 /// Creates a new default instance.
18225 pub fn new() -> Self {
18226 std::default::Default::default()
18227 }
18228
18229 /// Sets the value of [mirroring_endpoint_group_associations][crate::model::ListMirroringEndpointGroupAssociationsResponse::mirroring_endpoint_group_associations].
18230 ///
18231 /// # Example
18232 /// ```ignore,no_run
18233 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18234 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18235 /// let x = ListMirroringEndpointGroupAssociationsResponse::new()
18236 /// .set_mirroring_endpoint_group_associations([
18237 /// MirroringEndpointGroupAssociation::default()/* use setters */,
18238 /// MirroringEndpointGroupAssociation::default()/* use (different) setters */,
18239 /// ]);
18240 /// ```
18241 pub fn set_mirroring_endpoint_group_associations<T, V>(mut self, v: T) -> Self
18242 where
18243 T: std::iter::IntoIterator<Item = V>,
18244 V: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18245 {
18246 use std::iter::Iterator;
18247 self.mirroring_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
18248 self
18249 }
18250
18251 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupAssociationsResponse::next_page_token].
18252 ///
18253 /// # Example
18254 /// ```ignore,no_run
18255 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18256 /// let x = ListMirroringEndpointGroupAssociationsResponse::new().set_next_page_token("example");
18257 /// ```
18258 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18259 self.next_page_token = v.into();
18260 self
18261 }
18262}
18263
18264impl wkt::message::Message for ListMirroringEndpointGroupAssociationsResponse {
18265 fn typename() -> &'static str {
18266 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse"
18267 }
18268}
18269
18270#[doc(hidden)]
18271impl google_cloud_gax::paginator::internal::PageableResponse
18272 for ListMirroringEndpointGroupAssociationsResponse
18273{
18274 type PageItem = crate::model::MirroringEndpointGroupAssociation;
18275
18276 fn items(self) -> std::vec::Vec<Self::PageItem> {
18277 self.mirroring_endpoint_group_associations
18278 }
18279
18280 fn next_page_token(&self) -> std::string::String {
18281 use std::clone::Clone;
18282 self.next_page_token.clone()
18283 }
18284}
18285
18286/// Request message for GetMirroringEndpointGroupAssociation.
18287#[derive(Clone, Default, PartialEq)]
18288#[non_exhaustive]
18289pub struct GetMirroringEndpointGroupAssociationRequest {
18290 /// Required. The name of the association to retrieve.
18291 /// Format:
18292 /// projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}
18293 pub name: std::string::String,
18294
18295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18296}
18297
18298impl GetMirroringEndpointGroupAssociationRequest {
18299 /// Creates a new default instance.
18300 pub fn new() -> Self {
18301 std::default::Default::default()
18302 }
18303
18304 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
18305 ///
18306 /// # Example
18307 /// ```ignore,no_run
18308 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupAssociationRequest;
18309 /// let x = GetMirroringEndpointGroupAssociationRequest::new().set_name("example");
18310 /// ```
18311 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18312 self.name = v.into();
18313 self
18314 }
18315}
18316
18317impl wkt::message::Message for GetMirroringEndpointGroupAssociationRequest {
18318 fn typename() -> &'static str {
18319 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest"
18320 }
18321}
18322
18323/// Request message for CreateMirroringEndpointGroupAssociation.
18324#[derive(Clone, Default, PartialEq)]
18325#[non_exhaustive]
18326pub struct CreateMirroringEndpointGroupAssociationRequest {
18327 /// Required. The parent resource where this association will be created.
18328 /// Format: projects/{project}/locations/{location}
18329 pub parent: std::string::String,
18330
18331 /// Optional. The ID to use for the new association, which will become the
18332 /// final component of the endpoint group's resource name. If not provided, the
18333 /// server will generate a unique ID.
18334 pub mirroring_endpoint_group_association_id: std::string::String,
18335
18336 /// Required. The association to create.
18337 pub mirroring_endpoint_group_association:
18338 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18339
18340 /// Optional. A unique identifier for this request. Must be a UUID4.
18341 /// This request is only idempotent if a `request_id` is provided.
18342 /// See <https://google.aip.dev/155> for more details.
18343 pub request_id: std::string::String,
18344
18345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18346}
18347
18348impl CreateMirroringEndpointGroupAssociationRequest {
18349 /// Creates a new default instance.
18350 pub fn new() -> Self {
18351 std::default::Default::default()
18352 }
18353
18354 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
18355 ///
18356 /// # Example
18357 /// ```ignore,no_run
18358 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18359 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_parent("example");
18360 /// ```
18361 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18362 self.parent = v.into();
18363 self
18364 }
18365
18366 /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
18367 ///
18368 /// # Example
18369 /// ```ignore,no_run
18370 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18371 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association_id("example");
18372 /// ```
18373 pub fn set_mirroring_endpoint_group_association_id<
18374 T: std::convert::Into<std::string::String>,
18375 >(
18376 mut self,
18377 v: T,
18378 ) -> Self {
18379 self.mirroring_endpoint_group_association_id = v.into();
18380 self
18381 }
18382
18383 /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18384 ///
18385 /// # Example
18386 /// ```ignore,no_run
18387 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18388 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18389 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18390 /// ```
18391 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18392 where
18393 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18394 {
18395 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18396 self
18397 }
18398
18399 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18400 ///
18401 /// # Example
18402 /// ```ignore,no_run
18403 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18404 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18405 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18406 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18407 /// ```
18408 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18409 mut self,
18410 v: std::option::Option<T>,
18411 ) -> Self
18412 where
18413 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18414 {
18415 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18416 self
18417 }
18418
18419 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
18420 ///
18421 /// # Example
18422 /// ```ignore,no_run
18423 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18424 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18425 /// ```
18426 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18427 self.request_id = v.into();
18428 self
18429 }
18430}
18431
18432impl wkt::message::Message for CreateMirroringEndpointGroupAssociationRequest {
18433 fn typename() -> &'static str {
18434 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest"
18435 }
18436}
18437
18438/// Request message for UpdateMirroringEndpointGroupAssociation.
18439#[derive(Clone, Default, PartialEq)]
18440#[non_exhaustive]
18441pub struct UpdateMirroringEndpointGroupAssociationRequest {
18442 /// Optional. The list of fields to update.
18443 /// Fields are specified relative to the association
18444 /// (e.g. `description`; *not*
18445 /// `mirroring_endpoint_group_association.description`). See
18446 /// <https://google.aip.dev/161> for more details.
18447 pub update_mask: std::option::Option<wkt::FieldMask>,
18448
18449 /// Required. The association to update.
18450 pub mirroring_endpoint_group_association:
18451 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18452
18453 /// Optional. A unique identifier for this request. Must be a UUID4.
18454 /// This request is only idempotent if a `request_id` is provided.
18455 /// See <https://google.aip.dev/155> for more details.
18456 pub request_id: std::string::String,
18457
18458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18459}
18460
18461impl UpdateMirroringEndpointGroupAssociationRequest {
18462 /// Creates a new default instance.
18463 pub fn new() -> Self {
18464 std::default::Default::default()
18465 }
18466
18467 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18468 ///
18469 /// # Example
18470 /// ```ignore,no_run
18471 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18472 /// use wkt::FieldMask;
18473 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
18474 /// ```
18475 pub fn set_update_mask<T>(mut self, v: T) -> Self
18476 where
18477 T: std::convert::Into<wkt::FieldMask>,
18478 {
18479 self.update_mask = std::option::Option::Some(v.into());
18480 self
18481 }
18482
18483 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18484 ///
18485 /// # Example
18486 /// ```ignore,no_run
18487 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18488 /// use wkt::FieldMask;
18489 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
18490 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
18491 /// ```
18492 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18493 where
18494 T: std::convert::Into<wkt::FieldMask>,
18495 {
18496 self.update_mask = v.map(|x| x.into());
18497 self
18498 }
18499
18500 /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18501 ///
18502 /// # Example
18503 /// ```ignore,no_run
18504 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18505 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18506 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18507 /// ```
18508 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18509 where
18510 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18511 {
18512 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18513 self
18514 }
18515
18516 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18517 ///
18518 /// # Example
18519 /// ```ignore,no_run
18520 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18521 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18522 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18523 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18524 /// ```
18525 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18526 mut self,
18527 v: std::option::Option<T>,
18528 ) -> Self
18529 where
18530 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18531 {
18532 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18533 self
18534 }
18535
18536 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
18537 ///
18538 /// # Example
18539 /// ```ignore,no_run
18540 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18541 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18542 /// ```
18543 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18544 self.request_id = v.into();
18545 self
18546 }
18547}
18548
18549impl wkt::message::Message for UpdateMirroringEndpointGroupAssociationRequest {
18550 fn typename() -> &'static str {
18551 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest"
18552 }
18553}
18554
18555/// Request message for DeleteMirroringEndpointGroupAssociation.
18556#[derive(Clone, Default, PartialEq)]
18557#[non_exhaustive]
18558pub struct DeleteMirroringEndpointGroupAssociationRequest {
18559 /// Required. The association to delete.
18560 pub name: std::string::String,
18561
18562 /// Optional. A unique identifier for this request. Must be a UUID4.
18563 /// This request is only idempotent if a `request_id` is provided.
18564 /// See <https://google.aip.dev/155> for more details.
18565 pub request_id: std::string::String,
18566
18567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18568}
18569
18570impl DeleteMirroringEndpointGroupAssociationRequest {
18571 /// Creates a new default instance.
18572 pub fn new() -> Self {
18573 std::default::Default::default()
18574 }
18575
18576 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
18577 ///
18578 /// # Example
18579 /// ```ignore,no_run
18580 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18581 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_name("example");
18582 /// ```
18583 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18584 self.name = v.into();
18585 self
18586 }
18587
18588 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
18589 ///
18590 /// # Example
18591 /// ```ignore,no_run
18592 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18593 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18594 /// ```
18595 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18596 self.request_id = v.into();
18597 self
18598 }
18599}
18600
18601impl wkt::message::Message for DeleteMirroringEndpointGroupAssociationRequest {
18602 fn typename() -> &'static str {
18603 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest"
18604 }
18605}
18606
18607/// A deployment group aggregates many zonal mirroring backends (deployments)
18608/// into a single global mirroring service. Consumers can connect this service
18609/// using an endpoint group.
18610#[derive(Clone, Default, PartialEq)]
18611#[non_exhaustive]
18612pub struct MirroringDeploymentGroup {
18613 /// Immutable. Identifier. The resource name of this deployment group, for
18614 /// example:
18615 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
18616 /// See <https://google.aip.dev/122> for more details.
18617 pub name: std::string::String,
18618
18619 /// Output only. The timestamp when the resource was created.
18620 /// See <https://google.aip.dev/148#timestamps>.
18621 pub create_time: std::option::Option<wkt::Timestamp>,
18622
18623 /// Output only. The timestamp when the resource was most recently updated.
18624 /// See <https://google.aip.dev/148#timestamps>.
18625 pub update_time: std::option::Option<wkt::Timestamp>,
18626
18627 /// Optional. Labels are key/value pairs that help to organize and filter
18628 /// resources.
18629 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18630
18631 /// Required. Immutable. The network that will be used for all child
18632 /// deployments, for example: `projects/{project}/global/networks/{network}`.
18633 /// See <https://google.aip.dev/124>.
18634 pub network: std::string::String,
18635
18636 /// Output only. The list of endpoint groups that are connected to this
18637 /// resource.
18638 pub connected_endpoint_groups:
18639 std::vec::Vec<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18640
18641 /// Output only. The list of Mirroring Deployments that belong to this group.
18642 #[deprecated]
18643 pub nested_deployments: std::vec::Vec<crate::model::mirroring_deployment_group::Deployment>,
18644
18645 /// Output only. The current state of the deployment group.
18646 /// See <https://google.aip.dev/216>.
18647 pub state: crate::model::mirroring_deployment_group::State,
18648
18649 /// Output only. The current state of the resource does not match the user's
18650 /// intended state, and the system is working to reconcile them. This is part
18651 /// of the normal operation (e.g. adding a new deployment to the group) See
18652 /// <https://google.aip.dev/128>.
18653 pub reconciling: bool,
18654
18655 /// Optional. User-provided description of the deployment group.
18656 /// Used as additional context for the deployment group.
18657 pub description: std::string::String,
18658
18659 /// Output only. The list of locations where the deployment group is present.
18660 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
18661
18662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18663}
18664
18665impl MirroringDeploymentGroup {
18666 /// Creates a new default instance.
18667 pub fn new() -> Self {
18668 std::default::Default::default()
18669 }
18670
18671 /// Sets the value of [name][crate::model::MirroringDeploymentGroup::name].
18672 ///
18673 /// # Example
18674 /// ```ignore,no_run
18675 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18676 /// let x = MirroringDeploymentGroup::new().set_name("example");
18677 /// ```
18678 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18679 self.name = v.into();
18680 self
18681 }
18682
18683 /// Sets the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
18684 ///
18685 /// # Example
18686 /// ```ignore,no_run
18687 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18688 /// use wkt::Timestamp;
18689 /// let x = MirroringDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
18690 /// ```
18691 pub fn set_create_time<T>(mut self, v: T) -> Self
18692 where
18693 T: std::convert::Into<wkt::Timestamp>,
18694 {
18695 self.create_time = std::option::Option::Some(v.into());
18696 self
18697 }
18698
18699 /// Sets or clears the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
18700 ///
18701 /// # Example
18702 /// ```ignore,no_run
18703 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18704 /// use wkt::Timestamp;
18705 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18706 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
18707 /// ```
18708 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18709 where
18710 T: std::convert::Into<wkt::Timestamp>,
18711 {
18712 self.create_time = v.map(|x| x.into());
18713 self
18714 }
18715
18716 /// Sets the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
18717 ///
18718 /// # Example
18719 /// ```ignore,no_run
18720 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18721 /// use wkt::Timestamp;
18722 /// let x = MirroringDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
18723 /// ```
18724 pub fn set_update_time<T>(mut self, v: T) -> Self
18725 where
18726 T: std::convert::Into<wkt::Timestamp>,
18727 {
18728 self.update_time = std::option::Option::Some(v.into());
18729 self
18730 }
18731
18732 /// Sets or clears the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
18733 ///
18734 /// # Example
18735 /// ```ignore,no_run
18736 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18737 /// use wkt::Timestamp;
18738 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18739 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
18740 /// ```
18741 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18742 where
18743 T: std::convert::Into<wkt::Timestamp>,
18744 {
18745 self.update_time = v.map(|x| x.into());
18746 self
18747 }
18748
18749 /// Sets the value of [labels][crate::model::MirroringDeploymentGroup::labels].
18750 ///
18751 /// # Example
18752 /// ```ignore,no_run
18753 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18754 /// let x = MirroringDeploymentGroup::new().set_labels([
18755 /// ("key0", "abc"),
18756 /// ("key1", "xyz"),
18757 /// ]);
18758 /// ```
18759 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18760 where
18761 T: std::iter::IntoIterator<Item = (K, V)>,
18762 K: std::convert::Into<std::string::String>,
18763 V: std::convert::Into<std::string::String>,
18764 {
18765 use std::iter::Iterator;
18766 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18767 self
18768 }
18769
18770 /// Sets the value of [network][crate::model::MirroringDeploymentGroup::network].
18771 ///
18772 /// # Example
18773 /// ```ignore,no_run
18774 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18775 /// let x = MirroringDeploymentGroup::new().set_network("example");
18776 /// ```
18777 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18778 self.network = v.into();
18779 self
18780 }
18781
18782 /// Sets the value of [connected_endpoint_groups][crate::model::MirroringDeploymentGroup::connected_endpoint_groups].
18783 ///
18784 /// # Example
18785 /// ```ignore,no_run
18786 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18787 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
18788 /// let x = MirroringDeploymentGroup::new()
18789 /// .set_connected_endpoint_groups([
18790 /// ConnectedEndpointGroup::default()/* use setters */,
18791 /// ConnectedEndpointGroup::default()/* use (different) setters */,
18792 /// ]);
18793 /// ```
18794 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
18795 where
18796 T: std::iter::IntoIterator<Item = V>,
18797 V: std::convert::Into<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18798 {
18799 use std::iter::Iterator;
18800 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
18801 self
18802 }
18803
18804 /// Sets the value of [nested_deployments][crate::model::MirroringDeploymentGroup::nested_deployments].
18805 ///
18806 /// # Example
18807 /// ```ignore,no_run
18808 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18809 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18810 /// let x = MirroringDeploymentGroup::new()
18811 /// .set_nested_deployments([
18812 /// Deployment::default()/* use setters */,
18813 /// Deployment::default()/* use (different) setters */,
18814 /// ]);
18815 /// ```
18816 #[deprecated]
18817 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
18818 where
18819 T: std::iter::IntoIterator<Item = V>,
18820 V: std::convert::Into<crate::model::mirroring_deployment_group::Deployment>,
18821 {
18822 use std::iter::Iterator;
18823 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
18824 self
18825 }
18826
18827 /// Sets the value of [state][crate::model::MirroringDeploymentGroup::state].
18828 ///
18829 /// # Example
18830 /// ```ignore,no_run
18831 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18832 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::State;
18833 /// let x0 = MirroringDeploymentGroup::new().set_state(State::Active);
18834 /// let x1 = MirroringDeploymentGroup::new().set_state(State::Creating);
18835 /// let x2 = MirroringDeploymentGroup::new().set_state(State::Deleting);
18836 /// ```
18837 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment_group::State>>(
18838 mut self,
18839 v: T,
18840 ) -> Self {
18841 self.state = v.into();
18842 self
18843 }
18844
18845 /// Sets the value of [reconciling][crate::model::MirroringDeploymentGroup::reconciling].
18846 ///
18847 /// # Example
18848 /// ```ignore,no_run
18849 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18850 /// let x = MirroringDeploymentGroup::new().set_reconciling(true);
18851 /// ```
18852 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18853 self.reconciling = v.into();
18854 self
18855 }
18856
18857 /// Sets the value of [description][crate::model::MirroringDeploymentGroup::description].
18858 ///
18859 /// # Example
18860 /// ```ignore,no_run
18861 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18862 /// let x = MirroringDeploymentGroup::new().set_description("example");
18863 /// ```
18864 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18865 self.description = v.into();
18866 self
18867 }
18868
18869 /// Sets the value of [locations][crate::model::MirroringDeploymentGroup::locations].
18870 ///
18871 /// # Example
18872 /// ```ignore,no_run
18873 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18874 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
18875 /// let x = MirroringDeploymentGroup::new()
18876 /// .set_locations([
18877 /// MirroringLocation::default()/* use setters */,
18878 /// MirroringLocation::default()/* use (different) setters */,
18879 /// ]);
18880 /// ```
18881 pub fn set_locations<T, V>(mut self, v: T) -> Self
18882 where
18883 T: std::iter::IntoIterator<Item = V>,
18884 V: std::convert::Into<crate::model::MirroringLocation>,
18885 {
18886 use std::iter::Iterator;
18887 self.locations = v.into_iter().map(|i| i.into()).collect();
18888 self
18889 }
18890}
18891
18892impl wkt::message::Message for MirroringDeploymentGroup {
18893 fn typename() -> &'static str {
18894 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup"
18895 }
18896}
18897
18898/// Defines additional types related to [MirroringDeploymentGroup].
18899pub mod mirroring_deployment_group {
18900 #[allow(unused_imports)]
18901 use super::*;
18902
18903 /// An endpoint group connected to this deployment group.
18904 #[derive(Clone, Default, PartialEq)]
18905 #[non_exhaustive]
18906 pub struct ConnectedEndpointGroup {
18907 /// Output only. The connected endpoint group's resource name, for example:
18908 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
18909 /// See <https://google.aip.dev/124>.
18910 pub name: std::string::String,
18911
18912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18913 }
18914
18915 impl ConnectedEndpointGroup {
18916 /// Creates a new default instance.
18917 pub fn new() -> Self {
18918 std::default::Default::default()
18919 }
18920
18921 /// Sets the value of [name][crate::model::mirroring_deployment_group::ConnectedEndpointGroup::name].
18922 ///
18923 /// # Example
18924 /// ```ignore,no_run
18925 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
18926 /// let x = ConnectedEndpointGroup::new().set_name("example");
18927 /// ```
18928 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18929 self.name = v.into();
18930 self
18931 }
18932 }
18933
18934 impl wkt::message::Message for ConnectedEndpointGroup {
18935 fn typename() -> &'static str {
18936 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup"
18937 }
18938 }
18939
18940 /// A deployment belonging to this deployment group.
18941 #[derive(Clone, Default, PartialEq)]
18942 #[non_exhaustive]
18943 pub struct Deployment {
18944 /// Output only. The name of the Mirroring Deployment, in the format:
18945 /// `projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}`.
18946 pub name: std::string::String,
18947
18948 /// Output only. Most recent known state of the deployment.
18949 pub state: crate::model::mirroring_deployment::State,
18950
18951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18952 }
18953
18954 impl Deployment {
18955 /// Creates a new default instance.
18956 pub fn new() -> Self {
18957 std::default::Default::default()
18958 }
18959
18960 /// Sets the value of [name][crate::model::mirroring_deployment_group::Deployment::name].
18961 ///
18962 /// # Example
18963 /// ```ignore,no_run
18964 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18965 /// let x = Deployment::new().set_name("example");
18966 /// ```
18967 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18968 self.name = v.into();
18969 self
18970 }
18971
18972 /// Sets the value of [state][crate::model::mirroring_deployment_group::Deployment::state].
18973 ///
18974 /// # Example
18975 /// ```ignore,no_run
18976 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18977 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
18978 /// let x0 = Deployment::new().set_state(State::Active);
18979 /// let x1 = Deployment::new().set_state(State::Creating);
18980 /// let x2 = Deployment::new().set_state(State::Deleting);
18981 /// ```
18982 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
18983 mut self,
18984 v: T,
18985 ) -> Self {
18986 self.state = v.into();
18987 self
18988 }
18989 }
18990
18991 impl wkt::message::Message for Deployment {
18992 fn typename() -> &'static str {
18993 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment"
18994 }
18995 }
18996
18997 /// The current state of the deployment group.
18998 ///
18999 /// # Working with unknown values
19000 ///
19001 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19002 /// additional enum variants at any time. Adding new variants is not considered
19003 /// a breaking change. Applications should write their code in anticipation of:
19004 ///
19005 /// - New values appearing in future releases of the client library, **and**
19006 /// - New values received dynamically, without application changes.
19007 ///
19008 /// Please consult the [Working with enums] section in the user guide for some
19009 /// guidelines.
19010 ///
19011 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19012 #[derive(Clone, Debug, PartialEq)]
19013 #[non_exhaustive]
19014 pub enum State {
19015 /// State not set (this is not a valid state).
19016 Unspecified,
19017 /// The deployment group is ready.
19018 Active,
19019 /// The deployment group is being created.
19020 Creating,
19021 /// The deployment group is being deleted.
19022 Deleting,
19023 /// The deployment group is being wiped out (project deleted).
19024 Closed,
19025 /// If set, the enum was initialized with an unknown value.
19026 ///
19027 /// Applications can examine the value using [State::value] or
19028 /// [State::name].
19029 UnknownValue(state::UnknownValue),
19030 }
19031
19032 #[doc(hidden)]
19033 pub mod state {
19034 #[allow(unused_imports)]
19035 use super::*;
19036 #[derive(Clone, Debug, PartialEq)]
19037 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19038 }
19039
19040 impl State {
19041 /// Gets the enum value.
19042 ///
19043 /// Returns `None` if the enum contains an unknown value deserialized from
19044 /// the string representation of enums.
19045 pub fn value(&self) -> std::option::Option<i32> {
19046 match self {
19047 Self::Unspecified => std::option::Option::Some(0),
19048 Self::Active => std::option::Option::Some(1),
19049 Self::Creating => std::option::Option::Some(2),
19050 Self::Deleting => std::option::Option::Some(3),
19051 Self::Closed => std::option::Option::Some(4),
19052 Self::UnknownValue(u) => u.0.value(),
19053 }
19054 }
19055
19056 /// Gets the enum value as a string.
19057 ///
19058 /// Returns `None` if the enum contains an unknown value deserialized from
19059 /// the integer representation of enums.
19060 pub fn name(&self) -> std::option::Option<&str> {
19061 match self {
19062 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
19063 Self::Active => std::option::Option::Some("ACTIVE"),
19064 Self::Creating => std::option::Option::Some("CREATING"),
19065 Self::Deleting => std::option::Option::Some("DELETING"),
19066 Self::Closed => std::option::Option::Some("CLOSED"),
19067 Self::UnknownValue(u) => u.0.name(),
19068 }
19069 }
19070 }
19071
19072 impl std::default::Default for State {
19073 fn default() -> Self {
19074 use std::convert::From;
19075 Self::from(0)
19076 }
19077 }
19078
19079 impl std::fmt::Display for State {
19080 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19081 wkt::internal::display_enum(f, self.name(), self.value())
19082 }
19083 }
19084
19085 impl std::convert::From<i32> for State {
19086 fn from(value: i32) -> Self {
19087 match value {
19088 0 => Self::Unspecified,
19089 1 => Self::Active,
19090 2 => Self::Creating,
19091 3 => Self::Deleting,
19092 4 => Self::Closed,
19093 _ => Self::UnknownValue(state::UnknownValue(
19094 wkt::internal::UnknownEnumValue::Integer(value),
19095 )),
19096 }
19097 }
19098 }
19099
19100 impl std::convert::From<&str> for State {
19101 fn from(value: &str) -> Self {
19102 use std::string::ToString;
19103 match value {
19104 "STATE_UNSPECIFIED" => Self::Unspecified,
19105 "ACTIVE" => Self::Active,
19106 "CREATING" => Self::Creating,
19107 "DELETING" => Self::Deleting,
19108 "CLOSED" => Self::Closed,
19109 _ => Self::UnknownValue(state::UnknownValue(
19110 wkt::internal::UnknownEnumValue::String(value.to_string()),
19111 )),
19112 }
19113 }
19114 }
19115
19116 impl serde::ser::Serialize for State {
19117 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19118 where
19119 S: serde::Serializer,
19120 {
19121 match self {
19122 Self::Unspecified => serializer.serialize_i32(0),
19123 Self::Active => serializer.serialize_i32(1),
19124 Self::Creating => serializer.serialize_i32(2),
19125 Self::Deleting => serializer.serialize_i32(3),
19126 Self::Closed => serializer.serialize_i32(4),
19127 Self::UnknownValue(u) => u.0.serialize(serializer),
19128 }
19129 }
19130 }
19131
19132 impl<'de> serde::de::Deserialize<'de> for State {
19133 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19134 where
19135 D: serde::Deserializer<'de>,
19136 {
19137 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19138 ".google.cloud.networksecurity.v1.MirroringDeploymentGroup.State",
19139 ))
19140 }
19141 }
19142}
19143
19144/// Request message for ListMirroringDeploymentGroups.
19145#[derive(Clone, Default, PartialEq)]
19146#[non_exhaustive]
19147pub struct ListMirroringDeploymentGroupsRequest {
19148 /// Required. The parent, which owns this collection of deployment groups.
19149 /// Example: `projects/123456789/locations/global`.
19150 /// See <https://google.aip.dev/132> for more details.
19151 pub parent: std::string::String,
19152
19153 /// Optional. Requested page size. Server may return fewer items than
19154 /// requested. If unspecified, server will pick an appropriate default. See
19155 /// <https://google.aip.dev/158> for more details.
19156 pub page_size: i32,
19157
19158 /// Optional. A page token, received from a previous
19159 /// `ListMirroringDeploymentGroups` call. Provide this to retrieve the
19160 /// subsequent page. When paginating, all other parameters provided to
19161 /// `ListMirroringDeploymentGroups` must match the call that provided the page
19162 /// token. See <https://google.aip.dev/158> for more details.
19163 pub page_token: std::string::String,
19164
19165 /// Optional. Filter expression.
19166 /// See <https://google.aip.dev/160#filtering> for more details.
19167 pub filter: std::string::String,
19168
19169 /// Optional. Sort expression.
19170 /// See <https://google.aip.dev/132#ordering> for more details.
19171 pub order_by: std::string::String,
19172
19173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19174}
19175
19176impl ListMirroringDeploymentGroupsRequest {
19177 /// Creates a new default instance.
19178 pub fn new() -> Self {
19179 std::default::Default::default()
19180 }
19181
19182 /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
19183 ///
19184 /// # Example
19185 /// ```ignore,no_run
19186 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19187 /// let x = ListMirroringDeploymentGroupsRequest::new().set_parent("example");
19188 /// ```
19189 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19190 self.parent = v.into();
19191 self
19192 }
19193
19194 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
19195 ///
19196 /// # Example
19197 /// ```ignore,no_run
19198 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19199 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_size(42);
19200 /// ```
19201 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19202 self.page_size = v.into();
19203 self
19204 }
19205
19206 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
19207 ///
19208 /// # Example
19209 /// ```ignore,no_run
19210 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19211 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_token("example");
19212 /// ```
19213 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19214 self.page_token = v.into();
19215 self
19216 }
19217
19218 /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
19219 ///
19220 /// # Example
19221 /// ```ignore,no_run
19222 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19223 /// let x = ListMirroringDeploymentGroupsRequest::new().set_filter("example");
19224 /// ```
19225 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19226 self.filter = v.into();
19227 self
19228 }
19229
19230 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
19231 ///
19232 /// # Example
19233 /// ```ignore,no_run
19234 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19235 /// let x = ListMirroringDeploymentGroupsRequest::new().set_order_by("example");
19236 /// ```
19237 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19238 self.order_by = v.into();
19239 self
19240 }
19241}
19242
19243impl wkt::message::Message for ListMirroringDeploymentGroupsRequest {
19244 fn typename() -> &'static str {
19245 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest"
19246 }
19247}
19248
19249/// Response message for ListMirroringDeploymentGroups.
19250#[derive(Clone, Default, PartialEq)]
19251#[non_exhaustive]
19252pub struct ListMirroringDeploymentGroupsResponse {
19253 /// The deployment groups from the specified parent.
19254 pub mirroring_deployment_groups: std::vec::Vec<crate::model::MirroringDeploymentGroup>,
19255
19256 /// A token that can be sent as `page_token` to retrieve the next page.
19257 /// If this field is omitted, there are no subsequent pages.
19258 /// See <https://google.aip.dev/158> for more details.
19259 pub next_page_token: std::string::String,
19260
19261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19262}
19263
19264impl ListMirroringDeploymentGroupsResponse {
19265 /// Creates a new default instance.
19266 pub fn new() -> Self {
19267 std::default::Default::default()
19268 }
19269
19270 /// Sets the value of [mirroring_deployment_groups][crate::model::ListMirroringDeploymentGroupsResponse::mirroring_deployment_groups].
19271 ///
19272 /// # Example
19273 /// ```ignore,no_run
19274 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19275 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19276 /// let x = ListMirroringDeploymentGroupsResponse::new()
19277 /// .set_mirroring_deployment_groups([
19278 /// MirroringDeploymentGroup::default()/* use setters */,
19279 /// MirroringDeploymentGroup::default()/* use (different) setters */,
19280 /// ]);
19281 /// ```
19282 pub fn set_mirroring_deployment_groups<T, V>(mut self, v: T) -> Self
19283 where
19284 T: std::iter::IntoIterator<Item = V>,
19285 V: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19286 {
19287 use std::iter::Iterator;
19288 self.mirroring_deployment_groups = v.into_iter().map(|i| i.into()).collect();
19289 self
19290 }
19291
19292 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentGroupsResponse::next_page_token].
19293 ///
19294 /// # Example
19295 /// ```ignore,no_run
19296 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19297 /// let x = ListMirroringDeploymentGroupsResponse::new().set_next_page_token("example");
19298 /// ```
19299 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19300 self.next_page_token = v.into();
19301 self
19302 }
19303}
19304
19305impl wkt::message::Message for ListMirroringDeploymentGroupsResponse {
19306 fn typename() -> &'static str {
19307 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse"
19308 }
19309}
19310
19311#[doc(hidden)]
19312impl google_cloud_gax::paginator::internal::PageableResponse
19313 for ListMirroringDeploymentGroupsResponse
19314{
19315 type PageItem = crate::model::MirroringDeploymentGroup;
19316
19317 fn items(self) -> std::vec::Vec<Self::PageItem> {
19318 self.mirroring_deployment_groups
19319 }
19320
19321 fn next_page_token(&self) -> std::string::String {
19322 use std::clone::Clone;
19323 self.next_page_token.clone()
19324 }
19325}
19326
19327/// Request message for GetMirroringDeploymentGroup.
19328#[derive(Clone, Default, PartialEq)]
19329#[non_exhaustive]
19330pub struct GetMirroringDeploymentGroupRequest {
19331 /// Required. The name of the deployment group to retrieve.
19332 /// Format:
19333 /// projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}
19334 pub name: std::string::String,
19335
19336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19337}
19338
19339impl GetMirroringDeploymentGroupRequest {
19340 /// Creates a new default instance.
19341 pub fn new() -> Self {
19342 std::default::Default::default()
19343 }
19344
19345 /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
19346 ///
19347 /// # Example
19348 /// ```ignore,no_run
19349 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentGroupRequest;
19350 /// let x = GetMirroringDeploymentGroupRequest::new().set_name("example");
19351 /// ```
19352 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19353 self.name = v.into();
19354 self
19355 }
19356}
19357
19358impl wkt::message::Message for GetMirroringDeploymentGroupRequest {
19359 fn typename() -> &'static str {
19360 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest"
19361 }
19362}
19363
19364/// Request message for CreateMirroringDeploymentGroup.
19365#[derive(Clone, Default, PartialEq)]
19366#[non_exhaustive]
19367pub struct CreateMirroringDeploymentGroupRequest {
19368 /// Required. The parent resource where this deployment group will be created.
19369 /// Format: projects/{project}/locations/{location}
19370 pub parent: std::string::String,
19371
19372 /// Required. The ID to use for the new deployment group, which will become the
19373 /// final component of the deployment group's resource name.
19374 pub mirroring_deployment_group_id: std::string::String,
19375
19376 /// Required. The deployment group to create.
19377 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19378
19379 /// Optional. A unique identifier for this request. Must be a UUID4.
19380 /// This request is only idempotent if a `request_id` is provided.
19381 /// See <https://google.aip.dev/155> for more details.
19382 pub request_id: std::string::String,
19383
19384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19385}
19386
19387impl CreateMirroringDeploymentGroupRequest {
19388 /// Creates a new default instance.
19389 pub fn new() -> Self {
19390 std::default::Default::default()
19391 }
19392
19393 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
19394 ///
19395 /// # Example
19396 /// ```ignore,no_run
19397 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19398 /// let x = CreateMirroringDeploymentGroupRequest::new().set_parent("example");
19399 /// ```
19400 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19401 self.parent = v.into();
19402 self
19403 }
19404
19405 /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
19406 ///
19407 /// # Example
19408 /// ```ignore,no_run
19409 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19410 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group_id("example");
19411 /// ```
19412 pub fn set_mirroring_deployment_group_id<T: std::convert::Into<std::string::String>>(
19413 mut self,
19414 v: T,
19415 ) -> Self {
19416 self.mirroring_deployment_group_id = v.into();
19417 self
19418 }
19419
19420 /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19421 ///
19422 /// # Example
19423 /// ```ignore,no_run
19424 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19425 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19426 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19427 /// ```
19428 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19429 where
19430 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19431 {
19432 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19433 self
19434 }
19435
19436 /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19437 ///
19438 /// # Example
19439 /// ```ignore,no_run
19440 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19441 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19442 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19443 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19444 /// ```
19445 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19446 where
19447 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19448 {
19449 self.mirroring_deployment_group = v.map(|x| x.into());
19450 self
19451 }
19452
19453 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
19454 ///
19455 /// # Example
19456 /// ```ignore,no_run
19457 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19458 /// let x = CreateMirroringDeploymentGroupRequest::new().set_request_id("example");
19459 /// ```
19460 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19461 self.request_id = v.into();
19462 self
19463 }
19464}
19465
19466impl wkt::message::Message for CreateMirroringDeploymentGroupRequest {
19467 fn typename() -> &'static str {
19468 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest"
19469 }
19470}
19471
19472/// Request message for UpdateMirroringDeploymentGroup.
19473#[derive(Clone, Default, PartialEq)]
19474#[non_exhaustive]
19475pub struct UpdateMirroringDeploymentGroupRequest {
19476 /// Optional. The list of fields to update.
19477 /// Fields are specified relative to the deployment group
19478 /// (e.g. `description`; *not*
19479 /// `mirroring_deployment_group.description`). See
19480 /// <https://google.aip.dev/161> for more details.
19481 pub update_mask: std::option::Option<wkt::FieldMask>,
19482
19483 /// Required. The deployment group to update.
19484 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19485
19486 /// Optional. A unique identifier for this request. Must be a UUID4.
19487 /// This request is only idempotent if a `request_id` is provided.
19488 /// See <https://google.aip.dev/155> for more details.
19489 pub request_id: std::string::String,
19490
19491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19492}
19493
19494impl UpdateMirroringDeploymentGroupRequest {
19495 /// Creates a new default instance.
19496 pub fn new() -> Self {
19497 std::default::Default::default()
19498 }
19499
19500 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19501 ///
19502 /// # Example
19503 /// ```ignore,no_run
19504 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19505 /// use wkt::FieldMask;
19506 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
19507 /// ```
19508 pub fn set_update_mask<T>(mut self, v: T) -> Self
19509 where
19510 T: std::convert::Into<wkt::FieldMask>,
19511 {
19512 self.update_mask = std::option::Option::Some(v.into());
19513 self
19514 }
19515
19516 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19517 ///
19518 /// # Example
19519 /// ```ignore,no_run
19520 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19521 /// use wkt::FieldMask;
19522 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
19523 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
19524 /// ```
19525 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19526 where
19527 T: std::convert::Into<wkt::FieldMask>,
19528 {
19529 self.update_mask = v.map(|x| x.into());
19530 self
19531 }
19532
19533 /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19534 ///
19535 /// # Example
19536 /// ```ignore,no_run
19537 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19538 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19539 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19540 /// ```
19541 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19542 where
19543 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19544 {
19545 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19546 self
19547 }
19548
19549 /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19550 ///
19551 /// # Example
19552 /// ```ignore,no_run
19553 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19554 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19555 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19556 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19557 /// ```
19558 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19559 where
19560 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19561 {
19562 self.mirroring_deployment_group = v.map(|x| x.into());
19563 self
19564 }
19565
19566 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
19567 ///
19568 /// # Example
19569 /// ```ignore,no_run
19570 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19571 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_request_id("example");
19572 /// ```
19573 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19574 self.request_id = v.into();
19575 self
19576 }
19577}
19578
19579impl wkt::message::Message for UpdateMirroringDeploymentGroupRequest {
19580 fn typename() -> &'static str {
19581 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest"
19582 }
19583}
19584
19585/// Request message for DeleteMirroringDeploymentGroup.
19586#[derive(Clone, Default, PartialEq)]
19587#[non_exhaustive]
19588pub struct DeleteMirroringDeploymentGroupRequest {
19589 /// Required. The deployment group to delete.
19590 pub name: std::string::String,
19591
19592 /// Optional. A unique identifier for this request. Must be a UUID4.
19593 /// This request is only idempotent if a `request_id` is provided.
19594 /// See <https://google.aip.dev/155> for more details.
19595 pub request_id: std::string::String,
19596
19597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19598}
19599
19600impl DeleteMirroringDeploymentGroupRequest {
19601 /// Creates a new default instance.
19602 pub fn new() -> Self {
19603 std::default::Default::default()
19604 }
19605
19606 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
19607 ///
19608 /// # Example
19609 /// ```ignore,no_run
19610 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19611 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_name("example");
19612 /// ```
19613 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19614 self.name = v.into();
19615 self
19616 }
19617
19618 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
19619 ///
19620 /// # Example
19621 /// ```ignore,no_run
19622 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19623 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_request_id("example");
19624 /// ```
19625 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19626 self.request_id = v.into();
19627 self
19628 }
19629}
19630
19631impl wkt::message::Message for DeleteMirroringDeploymentGroupRequest {
19632 fn typename() -> &'static str {
19633 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest"
19634 }
19635}
19636
19637/// A deployment represents a zonal mirroring backend ready to accept
19638/// GENEVE-encapsulated replica traffic, e.g. a zonal instance group fronted by
19639/// an internal passthrough load balancer. Deployments are always part of a
19640/// global deployment group which represents a global mirroring service.
19641#[derive(Clone, Default, PartialEq)]
19642#[non_exhaustive]
19643pub struct MirroringDeployment {
19644 /// Immutable. Identifier. The resource name of this deployment, for example:
19645 /// `projects/123456789/locations/us-central1-a/mirroringDeployments/my-dep`.
19646 /// See <https://google.aip.dev/122> for more details.
19647 pub name: std::string::String,
19648
19649 /// Output only. The timestamp when the resource was created.
19650 /// See <https://google.aip.dev/148#timestamps>.
19651 pub create_time: std::option::Option<wkt::Timestamp>,
19652
19653 /// Output only. The timestamp when the resource was most recently updated.
19654 /// See <https://google.aip.dev/148#timestamps>.
19655 pub update_time: std::option::Option<wkt::Timestamp>,
19656
19657 /// Optional. Labels are key/value pairs that help to organize and filter
19658 /// resources.
19659 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
19660
19661 /// Required. Immutable. The regional forwarding rule that fronts the mirroring
19662 /// collectors, for example:
19663 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`. See
19664 /// <https://google.aip.dev/124>.
19665 pub forwarding_rule: std::string::String,
19666
19667 /// Required. Immutable. The deployment group that this deployment is a part
19668 /// of, for example:
19669 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
19670 /// See <https://google.aip.dev/124>.
19671 pub mirroring_deployment_group: std::string::String,
19672
19673 /// Output only. The current state of the deployment.
19674 /// See <https://google.aip.dev/216>.
19675 pub state: crate::model::mirroring_deployment::State,
19676
19677 /// Output only. The current state of the resource does not match the user's
19678 /// intended state, and the system is working to reconcile them. This part of
19679 /// the normal operation (e.g. linking a new association to the parent group).
19680 /// See <https://google.aip.dev/128>.
19681 pub reconciling: bool,
19682
19683 /// Optional. User-provided description of the deployment.
19684 /// Used as additional context for the deployment.
19685 pub description: std::string::String,
19686
19687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19688}
19689
19690impl MirroringDeployment {
19691 /// Creates a new default instance.
19692 pub fn new() -> Self {
19693 std::default::Default::default()
19694 }
19695
19696 /// Sets the value of [name][crate::model::MirroringDeployment::name].
19697 ///
19698 /// # Example
19699 /// ```ignore,no_run
19700 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19701 /// let x = MirroringDeployment::new().set_name("example");
19702 /// ```
19703 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19704 self.name = v.into();
19705 self
19706 }
19707
19708 /// Sets the value of [create_time][crate::model::MirroringDeployment::create_time].
19709 ///
19710 /// # Example
19711 /// ```ignore,no_run
19712 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19713 /// use wkt::Timestamp;
19714 /// let x = MirroringDeployment::new().set_create_time(Timestamp::default()/* use setters */);
19715 /// ```
19716 pub fn set_create_time<T>(mut self, v: T) -> Self
19717 where
19718 T: std::convert::Into<wkt::Timestamp>,
19719 {
19720 self.create_time = std::option::Option::Some(v.into());
19721 self
19722 }
19723
19724 /// Sets or clears the value of [create_time][crate::model::MirroringDeployment::create_time].
19725 ///
19726 /// # Example
19727 /// ```ignore,no_run
19728 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19729 /// use wkt::Timestamp;
19730 /// let x = MirroringDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
19731 /// let x = MirroringDeployment::new().set_or_clear_create_time(None::<Timestamp>);
19732 /// ```
19733 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
19734 where
19735 T: std::convert::Into<wkt::Timestamp>,
19736 {
19737 self.create_time = v.map(|x| x.into());
19738 self
19739 }
19740
19741 /// Sets the value of [update_time][crate::model::MirroringDeployment::update_time].
19742 ///
19743 /// # Example
19744 /// ```ignore,no_run
19745 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19746 /// use wkt::Timestamp;
19747 /// let x = MirroringDeployment::new().set_update_time(Timestamp::default()/* use setters */);
19748 /// ```
19749 pub fn set_update_time<T>(mut self, v: T) -> Self
19750 where
19751 T: std::convert::Into<wkt::Timestamp>,
19752 {
19753 self.update_time = std::option::Option::Some(v.into());
19754 self
19755 }
19756
19757 /// Sets or clears the value of [update_time][crate::model::MirroringDeployment::update_time].
19758 ///
19759 /// # Example
19760 /// ```ignore,no_run
19761 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19762 /// use wkt::Timestamp;
19763 /// let x = MirroringDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
19764 /// let x = MirroringDeployment::new().set_or_clear_update_time(None::<Timestamp>);
19765 /// ```
19766 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
19767 where
19768 T: std::convert::Into<wkt::Timestamp>,
19769 {
19770 self.update_time = v.map(|x| x.into());
19771 self
19772 }
19773
19774 /// Sets the value of [labels][crate::model::MirroringDeployment::labels].
19775 ///
19776 /// # Example
19777 /// ```ignore,no_run
19778 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19779 /// let x = MirroringDeployment::new().set_labels([
19780 /// ("key0", "abc"),
19781 /// ("key1", "xyz"),
19782 /// ]);
19783 /// ```
19784 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
19785 where
19786 T: std::iter::IntoIterator<Item = (K, V)>,
19787 K: std::convert::Into<std::string::String>,
19788 V: std::convert::Into<std::string::String>,
19789 {
19790 use std::iter::Iterator;
19791 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
19792 self
19793 }
19794
19795 /// Sets the value of [forwarding_rule][crate::model::MirroringDeployment::forwarding_rule].
19796 ///
19797 /// # Example
19798 /// ```ignore,no_run
19799 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19800 /// let x = MirroringDeployment::new().set_forwarding_rule("example");
19801 /// ```
19802 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19803 self.forwarding_rule = v.into();
19804 self
19805 }
19806
19807 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringDeployment::mirroring_deployment_group].
19808 ///
19809 /// # Example
19810 /// ```ignore,no_run
19811 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19812 /// let x = MirroringDeployment::new().set_mirroring_deployment_group("example");
19813 /// ```
19814 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
19815 mut self,
19816 v: T,
19817 ) -> Self {
19818 self.mirroring_deployment_group = v.into();
19819 self
19820 }
19821
19822 /// Sets the value of [state][crate::model::MirroringDeployment::state].
19823 ///
19824 /// # Example
19825 /// ```ignore,no_run
19826 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19827 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
19828 /// let x0 = MirroringDeployment::new().set_state(State::Active);
19829 /// let x1 = MirroringDeployment::new().set_state(State::Creating);
19830 /// let x2 = MirroringDeployment::new().set_state(State::Deleting);
19831 /// ```
19832 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
19833 mut self,
19834 v: T,
19835 ) -> Self {
19836 self.state = v.into();
19837 self
19838 }
19839
19840 /// Sets the value of [reconciling][crate::model::MirroringDeployment::reconciling].
19841 ///
19842 /// # Example
19843 /// ```ignore,no_run
19844 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19845 /// let x = MirroringDeployment::new().set_reconciling(true);
19846 /// ```
19847 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19848 self.reconciling = v.into();
19849 self
19850 }
19851
19852 /// Sets the value of [description][crate::model::MirroringDeployment::description].
19853 ///
19854 /// # Example
19855 /// ```ignore,no_run
19856 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19857 /// let x = MirroringDeployment::new().set_description("example");
19858 /// ```
19859 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19860 self.description = v.into();
19861 self
19862 }
19863}
19864
19865impl wkt::message::Message for MirroringDeployment {
19866 fn typename() -> &'static str {
19867 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeployment"
19868 }
19869}
19870
19871/// Defines additional types related to [MirroringDeployment].
19872pub mod mirroring_deployment {
19873 #[allow(unused_imports)]
19874 use super::*;
19875
19876 /// The current state of the deployment.
19877 ///
19878 /// # Working with unknown values
19879 ///
19880 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19881 /// additional enum variants at any time. Adding new variants is not considered
19882 /// a breaking change. Applications should write their code in anticipation of:
19883 ///
19884 /// - New values appearing in future releases of the client library, **and**
19885 /// - New values received dynamically, without application changes.
19886 ///
19887 /// Please consult the [Working with enums] section in the user guide for some
19888 /// guidelines.
19889 ///
19890 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19891 #[derive(Clone, Debug, PartialEq)]
19892 #[non_exhaustive]
19893 pub enum State {
19894 /// State not set (this is not a valid state).
19895 Unspecified,
19896 /// The deployment is ready and in sync with the parent group.
19897 Active,
19898 /// The deployment is being created.
19899 Creating,
19900 /// The deployment is being deleted.
19901 Deleting,
19902 /// The deployment is out of sync with the parent group.
19903 /// In most cases, this is a result of a transient issue within the system
19904 /// (e.g. a delayed data-path config) and the system is expected to recover
19905 /// automatically. See the parent deployment group's state for more details.
19906 OutOfSync,
19907 /// An attempt to delete the deployment has failed. This is a terminal state
19908 /// and the deployment is not expected to recover. The only permitted
19909 /// operation is to retry deleting the deployment.
19910 DeleteFailed,
19911 /// If set, the enum was initialized with an unknown value.
19912 ///
19913 /// Applications can examine the value using [State::value] or
19914 /// [State::name].
19915 UnknownValue(state::UnknownValue),
19916 }
19917
19918 #[doc(hidden)]
19919 pub mod state {
19920 #[allow(unused_imports)]
19921 use super::*;
19922 #[derive(Clone, Debug, PartialEq)]
19923 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19924 }
19925
19926 impl State {
19927 /// Gets the enum value.
19928 ///
19929 /// Returns `None` if the enum contains an unknown value deserialized from
19930 /// the string representation of enums.
19931 pub fn value(&self) -> std::option::Option<i32> {
19932 match self {
19933 Self::Unspecified => std::option::Option::Some(0),
19934 Self::Active => std::option::Option::Some(1),
19935 Self::Creating => std::option::Option::Some(2),
19936 Self::Deleting => std::option::Option::Some(3),
19937 Self::OutOfSync => std::option::Option::Some(4),
19938 Self::DeleteFailed => std::option::Option::Some(5),
19939 Self::UnknownValue(u) => u.0.value(),
19940 }
19941 }
19942
19943 /// Gets the enum value as a string.
19944 ///
19945 /// Returns `None` if the enum contains an unknown value deserialized from
19946 /// the integer representation of enums.
19947 pub fn name(&self) -> std::option::Option<&str> {
19948 match self {
19949 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
19950 Self::Active => std::option::Option::Some("ACTIVE"),
19951 Self::Creating => std::option::Option::Some("CREATING"),
19952 Self::Deleting => std::option::Option::Some("DELETING"),
19953 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
19954 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
19955 Self::UnknownValue(u) => u.0.name(),
19956 }
19957 }
19958 }
19959
19960 impl std::default::Default for State {
19961 fn default() -> Self {
19962 use std::convert::From;
19963 Self::from(0)
19964 }
19965 }
19966
19967 impl std::fmt::Display for State {
19968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19969 wkt::internal::display_enum(f, self.name(), self.value())
19970 }
19971 }
19972
19973 impl std::convert::From<i32> for State {
19974 fn from(value: i32) -> Self {
19975 match value {
19976 0 => Self::Unspecified,
19977 1 => Self::Active,
19978 2 => Self::Creating,
19979 3 => Self::Deleting,
19980 4 => Self::OutOfSync,
19981 5 => Self::DeleteFailed,
19982 _ => Self::UnknownValue(state::UnknownValue(
19983 wkt::internal::UnknownEnumValue::Integer(value),
19984 )),
19985 }
19986 }
19987 }
19988
19989 impl std::convert::From<&str> for State {
19990 fn from(value: &str) -> Self {
19991 use std::string::ToString;
19992 match value {
19993 "STATE_UNSPECIFIED" => Self::Unspecified,
19994 "ACTIVE" => Self::Active,
19995 "CREATING" => Self::Creating,
19996 "DELETING" => Self::Deleting,
19997 "OUT_OF_SYNC" => Self::OutOfSync,
19998 "DELETE_FAILED" => Self::DeleteFailed,
19999 _ => Self::UnknownValue(state::UnknownValue(
20000 wkt::internal::UnknownEnumValue::String(value.to_string()),
20001 )),
20002 }
20003 }
20004 }
20005
20006 impl serde::ser::Serialize for State {
20007 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20008 where
20009 S: serde::Serializer,
20010 {
20011 match self {
20012 Self::Unspecified => serializer.serialize_i32(0),
20013 Self::Active => serializer.serialize_i32(1),
20014 Self::Creating => serializer.serialize_i32(2),
20015 Self::Deleting => serializer.serialize_i32(3),
20016 Self::OutOfSync => serializer.serialize_i32(4),
20017 Self::DeleteFailed => serializer.serialize_i32(5),
20018 Self::UnknownValue(u) => u.0.serialize(serializer),
20019 }
20020 }
20021 }
20022
20023 impl<'de> serde::de::Deserialize<'de> for State {
20024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20025 where
20026 D: serde::Deserializer<'de>,
20027 {
20028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
20029 ".google.cloud.networksecurity.v1.MirroringDeployment.State",
20030 ))
20031 }
20032 }
20033}
20034
20035/// Request message for ListMirroringDeployments.
20036#[derive(Clone, Default, PartialEq)]
20037#[non_exhaustive]
20038pub struct ListMirroringDeploymentsRequest {
20039 /// Required. The parent, which owns this collection of deployments.
20040 /// Example: `projects/123456789/locations/us-central1-a`.
20041 /// See <https://google.aip.dev/132> for more details.
20042 pub parent: std::string::String,
20043
20044 /// Optional. Requested page size. Server may return fewer items than
20045 /// requested. If unspecified, server will pick an appropriate default. See
20046 /// <https://google.aip.dev/158> for more details.
20047 pub page_size: i32,
20048
20049 /// Optional. A page token, received from a previous `ListMirroringDeployments`
20050 /// call. Provide this to retrieve the subsequent page. When paginating, all
20051 /// other parameters provided to `ListMirroringDeployments` must match the call
20052 /// that provided the page token. See <https://google.aip.dev/158> for more
20053 /// details.
20054 pub page_token: std::string::String,
20055
20056 /// Optional. Filter expression.
20057 /// See <https://google.aip.dev/160#filtering> for more details.
20058 pub filter: std::string::String,
20059
20060 /// Optional. Sort expression.
20061 /// See <https://google.aip.dev/132#ordering> for more details.
20062 pub order_by: std::string::String,
20063
20064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20065}
20066
20067impl ListMirroringDeploymentsRequest {
20068 /// Creates a new default instance.
20069 pub fn new() -> Self {
20070 std::default::Default::default()
20071 }
20072
20073 /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
20074 ///
20075 /// # Example
20076 /// ```ignore,no_run
20077 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20078 /// let x = ListMirroringDeploymentsRequest::new().set_parent("example");
20079 /// ```
20080 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20081 self.parent = v.into();
20082 self
20083 }
20084
20085 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
20086 ///
20087 /// # Example
20088 /// ```ignore,no_run
20089 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20090 /// let x = ListMirroringDeploymentsRequest::new().set_page_size(42);
20091 /// ```
20092 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20093 self.page_size = v.into();
20094 self
20095 }
20096
20097 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
20098 ///
20099 /// # Example
20100 /// ```ignore,no_run
20101 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20102 /// let x = ListMirroringDeploymentsRequest::new().set_page_token("example");
20103 /// ```
20104 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20105 self.page_token = v.into();
20106 self
20107 }
20108
20109 /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
20110 ///
20111 /// # Example
20112 /// ```ignore,no_run
20113 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20114 /// let x = ListMirroringDeploymentsRequest::new().set_filter("example");
20115 /// ```
20116 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20117 self.filter = v.into();
20118 self
20119 }
20120
20121 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
20122 ///
20123 /// # Example
20124 /// ```ignore,no_run
20125 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20126 /// let x = ListMirroringDeploymentsRequest::new().set_order_by("example");
20127 /// ```
20128 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20129 self.order_by = v.into();
20130 self
20131 }
20132}
20133
20134impl wkt::message::Message for ListMirroringDeploymentsRequest {
20135 fn typename() -> &'static str {
20136 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest"
20137 }
20138}
20139
20140/// Response message for ListMirroringDeployments.
20141#[derive(Clone, Default, PartialEq)]
20142#[non_exhaustive]
20143pub struct ListMirroringDeploymentsResponse {
20144 /// The deployments from the specified parent.
20145 pub mirroring_deployments: std::vec::Vec<crate::model::MirroringDeployment>,
20146
20147 /// A token that can be sent as `page_token` to retrieve the next page.
20148 /// If this field is omitted, there are no subsequent pages.
20149 /// See <https://google.aip.dev/158> for more details.
20150 pub next_page_token: std::string::String,
20151
20152 /// Locations that could not be reached.
20153 pub unreachable: std::vec::Vec<std::string::String>,
20154
20155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20156}
20157
20158impl ListMirroringDeploymentsResponse {
20159 /// Creates a new default instance.
20160 pub fn new() -> Self {
20161 std::default::Default::default()
20162 }
20163
20164 /// Sets the value of [mirroring_deployments][crate::model::ListMirroringDeploymentsResponse::mirroring_deployments].
20165 ///
20166 /// # Example
20167 /// ```ignore,no_run
20168 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20169 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20170 /// let x = ListMirroringDeploymentsResponse::new()
20171 /// .set_mirroring_deployments([
20172 /// MirroringDeployment::default()/* use setters */,
20173 /// MirroringDeployment::default()/* use (different) setters */,
20174 /// ]);
20175 /// ```
20176 pub fn set_mirroring_deployments<T, V>(mut self, v: T) -> Self
20177 where
20178 T: std::iter::IntoIterator<Item = V>,
20179 V: std::convert::Into<crate::model::MirroringDeployment>,
20180 {
20181 use std::iter::Iterator;
20182 self.mirroring_deployments = v.into_iter().map(|i| i.into()).collect();
20183 self
20184 }
20185
20186 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentsResponse::next_page_token].
20187 ///
20188 /// # Example
20189 /// ```ignore,no_run
20190 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20191 /// let x = ListMirroringDeploymentsResponse::new().set_next_page_token("example");
20192 /// ```
20193 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20194 self.next_page_token = v.into();
20195 self
20196 }
20197
20198 /// Sets the value of [unreachable][crate::model::ListMirroringDeploymentsResponse::unreachable].
20199 ///
20200 /// # Example
20201 /// ```ignore,no_run
20202 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20203 /// let x = ListMirroringDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
20204 /// ```
20205 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20206 where
20207 T: std::iter::IntoIterator<Item = V>,
20208 V: std::convert::Into<std::string::String>,
20209 {
20210 use std::iter::Iterator;
20211 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20212 self
20213 }
20214}
20215
20216impl wkt::message::Message for ListMirroringDeploymentsResponse {
20217 fn typename() -> &'static str {
20218 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse"
20219 }
20220}
20221
20222#[doc(hidden)]
20223impl google_cloud_gax::paginator::internal::PageableResponse for ListMirroringDeploymentsResponse {
20224 type PageItem = crate::model::MirroringDeployment;
20225
20226 fn items(self) -> std::vec::Vec<Self::PageItem> {
20227 self.mirroring_deployments
20228 }
20229
20230 fn next_page_token(&self) -> std::string::String {
20231 use std::clone::Clone;
20232 self.next_page_token.clone()
20233 }
20234}
20235
20236/// Request message for GetMirroringDeployment.
20237#[derive(Clone, Default, PartialEq)]
20238#[non_exhaustive]
20239pub struct GetMirroringDeploymentRequest {
20240 /// Required. The name of the deployment to retrieve.
20241 /// Format:
20242 /// projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}
20243 pub name: std::string::String,
20244
20245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20246}
20247
20248impl GetMirroringDeploymentRequest {
20249 /// Creates a new default instance.
20250 pub fn new() -> Self {
20251 std::default::Default::default()
20252 }
20253
20254 /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
20255 ///
20256 /// # Example
20257 /// ```ignore,no_run
20258 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentRequest;
20259 /// let x = GetMirroringDeploymentRequest::new().set_name("example");
20260 /// ```
20261 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20262 self.name = v.into();
20263 self
20264 }
20265}
20266
20267impl wkt::message::Message for GetMirroringDeploymentRequest {
20268 fn typename() -> &'static str {
20269 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentRequest"
20270 }
20271}
20272
20273/// Request message for CreateMirroringDeployment.
20274#[derive(Clone, Default, PartialEq)]
20275#[non_exhaustive]
20276pub struct CreateMirroringDeploymentRequest {
20277 /// Required. The parent resource where this deployment will be created.
20278 /// Format: projects/{project}/locations/{location}
20279 pub parent: std::string::String,
20280
20281 /// Required. The ID to use for the new deployment, which will become the final
20282 /// component of the deployment's resource name.
20283 pub mirroring_deployment_id: std::string::String,
20284
20285 /// Required. The deployment to create.
20286 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20287
20288 /// Optional. A unique identifier for this request. Must be a UUID4.
20289 /// This request is only idempotent if a `request_id` is provided.
20290 /// See <https://google.aip.dev/155> for more details.
20291 pub request_id: std::string::String,
20292
20293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20294}
20295
20296impl CreateMirroringDeploymentRequest {
20297 /// Creates a new default instance.
20298 pub fn new() -> Self {
20299 std::default::Default::default()
20300 }
20301
20302 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
20303 ///
20304 /// # Example
20305 /// ```ignore,no_run
20306 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20307 /// let x = CreateMirroringDeploymentRequest::new().set_parent("example");
20308 /// ```
20309 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20310 self.parent = v.into();
20311 self
20312 }
20313
20314 /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
20315 ///
20316 /// # Example
20317 /// ```ignore,no_run
20318 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20319 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment_id("example");
20320 /// ```
20321 pub fn set_mirroring_deployment_id<T: std::convert::Into<std::string::String>>(
20322 mut self,
20323 v: T,
20324 ) -> Self {
20325 self.mirroring_deployment_id = v.into();
20326 self
20327 }
20328
20329 /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20330 ///
20331 /// # Example
20332 /// ```ignore,no_run
20333 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20334 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20335 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20336 /// ```
20337 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20338 where
20339 T: std::convert::Into<crate::model::MirroringDeployment>,
20340 {
20341 self.mirroring_deployment = std::option::Option::Some(v.into());
20342 self
20343 }
20344
20345 /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20346 ///
20347 /// # Example
20348 /// ```ignore,no_run
20349 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20350 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20351 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20352 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20353 /// ```
20354 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20355 where
20356 T: std::convert::Into<crate::model::MirroringDeployment>,
20357 {
20358 self.mirroring_deployment = v.map(|x| x.into());
20359 self
20360 }
20361
20362 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
20363 ///
20364 /// # Example
20365 /// ```ignore,no_run
20366 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20367 /// let x = CreateMirroringDeploymentRequest::new().set_request_id("example");
20368 /// ```
20369 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20370 self.request_id = v.into();
20371 self
20372 }
20373}
20374
20375impl wkt::message::Message for CreateMirroringDeploymentRequest {
20376 fn typename() -> &'static str {
20377 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest"
20378 }
20379}
20380
20381/// Request message for UpdateMirroringDeployment.
20382#[derive(Clone, Default, PartialEq)]
20383#[non_exhaustive]
20384pub struct UpdateMirroringDeploymentRequest {
20385 /// Optional. The list of fields to update.
20386 /// Fields are specified relative to the deployment
20387 /// (e.g. `description`; *not* `mirroring_deployment.description`).
20388 /// See <https://google.aip.dev/161> for more details.
20389 pub update_mask: std::option::Option<wkt::FieldMask>,
20390
20391 /// Required. The deployment to update.
20392 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20393
20394 /// Optional. A unique identifier for this request. Must be a UUID4.
20395 /// This request is only idempotent if a `request_id` is provided.
20396 /// See <https://google.aip.dev/155> for more details.
20397 pub request_id: std::string::String,
20398
20399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20400}
20401
20402impl UpdateMirroringDeploymentRequest {
20403 /// Creates a new default instance.
20404 pub fn new() -> Self {
20405 std::default::Default::default()
20406 }
20407
20408 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20409 ///
20410 /// # Example
20411 /// ```ignore,no_run
20412 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20413 /// use wkt::FieldMask;
20414 /// let x = UpdateMirroringDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20415 /// ```
20416 pub fn set_update_mask<T>(mut self, v: T) -> Self
20417 where
20418 T: std::convert::Into<wkt::FieldMask>,
20419 {
20420 self.update_mask = std::option::Option::Some(v.into());
20421 self
20422 }
20423
20424 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20425 ///
20426 /// # Example
20427 /// ```ignore,no_run
20428 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20429 /// use wkt::FieldMask;
20430 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20431 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20432 /// ```
20433 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20434 where
20435 T: std::convert::Into<wkt::FieldMask>,
20436 {
20437 self.update_mask = v.map(|x| x.into());
20438 self
20439 }
20440
20441 /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20442 ///
20443 /// # Example
20444 /// ```ignore,no_run
20445 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20446 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20447 /// let x = UpdateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20448 /// ```
20449 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20450 where
20451 T: std::convert::Into<crate::model::MirroringDeployment>,
20452 {
20453 self.mirroring_deployment = std::option::Option::Some(v.into());
20454 self
20455 }
20456
20457 /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20458 ///
20459 /// # Example
20460 /// ```ignore,no_run
20461 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20462 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20463 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20464 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20465 /// ```
20466 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20467 where
20468 T: std::convert::Into<crate::model::MirroringDeployment>,
20469 {
20470 self.mirroring_deployment = v.map(|x| x.into());
20471 self
20472 }
20473
20474 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
20475 ///
20476 /// # Example
20477 /// ```ignore,no_run
20478 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20479 /// let x = UpdateMirroringDeploymentRequest::new().set_request_id("example");
20480 /// ```
20481 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20482 self.request_id = v.into();
20483 self
20484 }
20485}
20486
20487impl wkt::message::Message for UpdateMirroringDeploymentRequest {
20488 fn typename() -> &'static str {
20489 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest"
20490 }
20491}
20492
20493/// Request message for DeleteMirroringDeployment.
20494#[derive(Clone, Default, PartialEq)]
20495#[non_exhaustive]
20496pub struct DeleteMirroringDeploymentRequest {
20497 /// Required. Name of the resource
20498 pub name: std::string::String,
20499
20500 /// Optional. A unique identifier for this request. Must be a UUID4.
20501 /// This request is only idempotent if a `request_id` is provided.
20502 /// See <https://google.aip.dev/155> for more details.
20503 pub request_id: std::string::String,
20504
20505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20506}
20507
20508impl DeleteMirroringDeploymentRequest {
20509 /// Creates a new default instance.
20510 pub fn new() -> Self {
20511 std::default::Default::default()
20512 }
20513
20514 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
20515 ///
20516 /// # Example
20517 /// ```ignore,no_run
20518 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20519 /// let x = DeleteMirroringDeploymentRequest::new().set_name("example");
20520 /// ```
20521 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20522 self.name = v.into();
20523 self
20524 }
20525
20526 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
20527 ///
20528 /// # Example
20529 /// ```ignore,no_run
20530 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20531 /// let x = DeleteMirroringDeploymentRequest::new().set_request_id("example");
20532 /// ```
20533 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20534 self.request_id = v.into();
20535 self
20536 }
20537}
20538
20539impl wkt::message::Message for DeleteMirroringDeploymentRequest {
20540 fn typename() -> &'static str {
20541 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest"
20542 }
20543}
20544
20545/// Details about mirroring in a specific cloud location.
20546#[derive(Clone, Default, PartialEq)]
20547#[non_exhaustive]
20548pub struct MirroringLocation {
20549 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
20550 pub location: std::string::String,
20551
20552 /// Output only. The current state of the association in this location.
20553 pub state: crate::model::mirroring_location::State,
20554
20555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20556}
20557
20558impl MirroringLocation {
20559 /// Creates a new default instance.
20560 pub fn new() -> Self {
20561 std::default::Default::default()
20562 }
20563
20564 /// Sets the value of [location][crate::model::MirroringLocation::location].
20565 ///
20566 /// # Example
20567 /// ```ignore,no_run
20568 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20569 /// let x = MirroringLocation::new().set_location("example");
20570 /// ```
20571 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20572 self.location = v.into();
20573 self
20574 }
20575
20576 /// Sets the value of [state][crate::model::MirroringLocation::state].
20577 ///
20578 /// # Example
20579 /// ```ignore,no_run
20580 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20581 /// use google_cloud_networksecurity_v1::model::mirroring_location::State;
20582 /// let x0 = MirroringLocation::new().set_state(State::Active);
20583 /// let x1 = MirroringLocation::new().set_state(State::OutOfSync);
20584 /// ```
20585 pub fn set_state<T: std::convert::Into<crate::model::mirroring_location::State>>(
20586 mut self,
20587 v: T,
20588 ) -> Self {
20589 self.state = v.into();
20590 self
20591 }
20592}
20593
20594impl wkt::message::Message for MirroringLocation {
20595 fn typename() -> &'static str {
20596 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringLocation"
20597 }
20598}
20599
20600/// Defines additional types related to [MirroringLocation].
20601pub mod mirroring_location {
20602 #[allow(unused_imports)]
20603 use super::*;
20604
20605 /// The current state of a resource in the location.
20606 ///
20607 /// # Working with unknown values
20608 ///
20609 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20610 /// additional enum variants at any time. Adding new variants is not considered
20611 /// a breaking change. Applications should write their code in anticipation of:
20612 ///
20613 /// - New values appearing in future releases of the client library, **and**
20614 /// - New values received dynamically, without application changes.
20615 ///
20616 /// Please consult the [Working with enums] section in the user guide for some
20617 /// guidelines.
20618 ///
20619 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20620 #[derive(Clone, Debug, PartialEq)]
20621 #[non_exhaustive]
20622 pub enum State {
20623 /// State not set (this is not a valid state).
20624 Unspecified,
20625 /// The resource is ready and in sync in the location.
20626 Active,
20627 /// The resource is out of sync in the location.
20628 /// In most cases, this is a result of a transient issue within the system
20629 /// (e.g. an inaccessible location) and the system is expected to recover
20630 /// automatically.
20631 OutOfSync,
20632 /// If set, the enum was initialized with an unknown value.
20633 ///
20634 /// Applications can examine the value using [State::value] or
20635 /// [State::name].
20636 UnknownValue(state::UnknownValue),
20637 }
20638
20639 #[doc(hidden)]
20640 pub mod state {
20641 #[allow(unused_imports)]
20642 use super::*;
20643 #[derive(Clone, Debug, PartialEq)]
20644 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20645 }
20646
20647 impl State {
20648 /// Gets the enum value.
20649 ///
20650 /// Returns `None` if the enum contains an unknown value deserialized from
20651 /// the string representation of enums.
20652 pub fn value(&self) -> std::option::Option<i32> {
20653 match self {
20654 Self::Unspecified => std::option::Option::Some(0),
20655 Self::Active => std::option::Option::Some(1),
20656 Self::OutOfSync => std::option::Option::Some(2),
20657 Self::UnknownValue(u) => u.0.value(),
20658 }
20659 }
20660
20661 /// Gets the enum value as a string.
20662 ///
20663 /// Returns `None` if the enum contains an unknown value deserialized from
20664 /// the integer representation of enums.
20665 pub fn name(&self) -> std::option::Option<&str> {
20666 match self {
20667 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
20668 Self::Active => std::option::Option::Some("ACTIVE"),
20669 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
20670 Self::UnknownValue(u) => u.0.name(),
20671 }
20672 }
20673 }
20674
20675 impl std::default::Default for State {
20676 fn default() -> Self {
20677 use std::convert::From;
20678 Self::from(0)
20679 }
20680 }
20681
20682 impl std::fmt::Display for State {
20683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20684 wkt::internal::display_enum(f, self.name(), self.value())
20685 }
20686 }
20687
20688 impl std::convert::From<i32> for State {
20689 fn from(value: i32) -> Self {
20690 match value {
20691 0 => Self::Unspecified,
20692 1 => Self::Active,
20693 2 => Self::OutOfSync,
20694 _ => Self::UnknownValue(state::UnknownValue(
20695 wkt::internal::UnknownEnumValue::Integer(value),
20696 )),
20697 }
20698 }
20699 }
20700
20701 impl std::convert::From<&str> for State {
20702 fn from(value: &str) -> Self {
20703 use std::string::ToString;
20704 match value {
20705 "STATE_UNSPECIFIED" => Self::Unspecified,
20706 "ACTIVE" => Self::Active,
20707 "OUT_OF_SYNC" => Self::OutOfSync,
20708 _ => Self::UnknownValue(state::UnknownValue(
20709 wkt::internal::UnknownEnumValue::String(value.to_string()),
20710 )),
20711 }
20712 }
20713 }
20714
20715 impl serde::ser::Serialize for State {
20716 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20717 where
20718 S: serde::Serializer,
20719 {
20720 match self {
20721 Self::Unspecified => serializer.serialize_i32(0),
20722 Self::Active => serializer.serialize_i32(1),
20723 Self::OutOfSync => serializer.serialize_i32(2),
20724 Self::UnknownValue(u) => u.0.serialize(serializer),
20725 }
20726 }
20727 }
20728
20729 impl<'de> serde::de::Deserialize<'de> for State {
20730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20731 where
20732 D: serde::Deserializer<'de>,
20733 {
20734 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
20735 ".google.cloud.networksecurity.v1.MirroringLocation.State",
20736 ))
20737 }
20738 }
20739}
20740
20741/// SecurityProfileGroup is a resource that defines the behavior for various
20742/// ProfileTypes.
20743#[derive(Clone, Default, PartialEq)]
20744#[non_exhaustive]
20745pub struct SecurityProfileGroup {
20746 /// Immutable. Identifier. Name of the SecurityProfileGroup resource. It
20747 /// matches pattern
20748 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
20749 pub name: std::string::String,
20750
20751 /// Optional. An optional description of the profile group. Max length 2048
20752 /// characters.
20753 pub description: std::string::String,
20754
20755 /// Output only. Resource creation timestamp.
20756 pub create_time: std::option::Option<wkt::Timestamp>,
20757
20758 /// Output only. Last resource update timestamp.
20759 pub update_time: std::option::Option<wkt::Timestamp>,
20760
20761 /// Output only. This checksum is computed by the server based on the value of
20762 /// other fields, and may be sent on update and delete requests to ensure the
20763 /// client has an up-to-date value before proceeding.
20764 pub etag: std::string::String,
20765
20766 /// Output only. Identifier used by the data-path. Unique within {container,
20767 /// location}.
20768 pub data_path_id: u64,
20769
20770 /// Optional. Labels as key value pairs.
20771 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
20772
20773 /// Optional. Reference to a SecurityProfile with the ThreatPrevention
20774 /// configuration.
20775 pub threat_prevention_profile: std::string::String,
20776
20777 /// Optional. Reference to a SecurityProfile with the CustomMirroring
20778 /// configuration.
20779 pub custom_mirroring_profile: std::string::String,
20780
20781 /// Optional. Reference to a SecurityProfile with the CustomIntercept
20782 /// configuration.
20783 pub custom_intercept_profile: std::string::String,
20784
20785 /// Optional. Reference to a SecurityProfile with the UrlFiltering
20786 /// configuration.
20787 pub url_filtering_profile: std::string::String,
20788
20789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20790}
20791
20792impl SecurityProfileGroup {
20793 /// Creates a new default instance.
20794 pub fn new() -> Self {
20795 std::default::Default::default()
20796 }
20797
20798 /// Sets the value of [name][crate::model::SecurityProfileGroup::name].
20799 ///
20800 /// # Example
20801 /// ```ignore,no_run
20802 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20803 /// let x = SecurityProfileGroup::new().set_name("example");
20804 /// ```
20805 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20806 self.name = v.into();
20807 self
20808 }
20809
20810 /// Sets the value of [description][crate::model::SecurityProfileGroup::description].
20811 ///
20812 /// # Example
20813 /// ```ignore,no_run
20814 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20815 /// let x = SecurityProfileGroup::new().set_description("example");
20816 /// ```
20817 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20818 self.description = v.into();
20819 self
20820 }
20821
20822 /// Sets the value of [create_time][crate::model::SecurityProfileGroup::create_time].
20823 ///
20824 /// # Example
20825 /// ```ignore,no_run
20826 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20827 /// use wkt::Timestamp;
20828 /// let x = SecurityProfileGroup::new().set_create_time(Timestamp::default()/* use setters */);
20829 /// ```
20830 pub fn set_create_time<T>(mut self, v: T) -> Self
20831 where
20832 T: std::convert::Into<wkt::Timestamp>,
20833 {
20834 self.create_time = std::option::Option::Some(v.into());
20835 self
20836 }
20837
20838 /// Sets or clears the value of [create_time][crate::model::SecurityProfileGroup::create_time].
20839 ///
20840 /// # Example
20841 /// ```ignore,no_run
20842 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20843 /// use wkt::Timestamp;
20844 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20845 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(None::<Timestamp>);
20846 /// ```
20847 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20848 where
20849 T: std::convert::Into<wkt::Timestamp>,
20850 {
20851 self.create_time = v.map(|x| x.into());
20852 self
20853 }
20854
20855 /// Sets the value of [update_time][crate::model::SecurityProfileGroup::update_time].
20856 ///
20857 /// # Example
20858 /// ```ignore,no_run
20859 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20860 /// use wkt::Timestamp;
20861 /// let x = SecurityProfileGroup::new().set_update_time(Timestamp::default()/* use setters */);
20862 /// ```
20863 pub fn set_update_time<T>(mut self, v: T) -> Self
20864 where
20865 T: std::convert::Into<wkt::Timestamp>,
20866 {
20867 self.update_time = std::option::Option::Some(v.into());
20868 self
20869 }
20870
20871 /// Sets or clears the value of [update_time][crate::model::SecurityProfileGroup::update_time].
20872 ///
20873 /// # Example
20874 /// ```ignore,no_run
20875 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20876 /// use wkt::Timestamp;
20877 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20878 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(None::<Timestamp>);
20879 /// ```
20880 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20881 where
20882 T: std::convert::Into<wkt::Timestamp>,
20883 {
20884 self.update_time = v.map(|x| x.into());
20885 self
20886 }
20887
20888 /// Sets the value of [etag][crate::model::SecurityProfileGroup::etag].
20889 ///
20890 /// # Example
20891 /// ```ignore,no_run
20892 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20893 /// let x = SecurityProfileGroup::new().set_etag("example");
20894 /// ```
20895 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20896 self.etag = v.into();
20897 self
20898 }
20899
20900 /// Sets the value of [data_path_id][crate::model::SecurityProfileGroup::data_path_id].
20901 ///
20902 /// # Example
20903 /// ```ignore,no_run
20904 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20905 /// let x = SecurityProfileGroup::new().set_data_path_id(42_u32);
20906 /// ```
20907 pub fn set_data_path_id<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
20908 self.data_path_id = v.into();
20909 self
20910 }
20911
20912 /// Sets the value of [labels][crate::model::SecurityProfileGroup::labels].
20913 ///
20914 /// # Example
20915 /// ```ignore,no_run
20916 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20917 /// let x = SecurityProfileGroup::new().set_labels([
20918 /// ("key0", "abc"),
20919 /// ("key1", "xyz"),
20920 /// ]);
20921 /// ```
20922 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20923 where
20924 T: std::iter::IntoIterator<Item = (K, V)>,
20925 K: std::convert::Into<std::string::String>,
20926 V: std::convert::Into<std::string::String>,
20927 {
20928 use std::iter::Iterator;
20929 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20930 self
20931 }
20932
20933 /// Sets the value of [threat_prevention_profile][crate::model::SecurityProfileGroup::threat_prevention_profile].
20934 ///
20935 /// # Example
20936 /// ```ignore,no_run
20937 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20938 /// let x = SecurityProfileGroup::new().set_threat_prevention_profile("example");
20939 /// ```
20940 pub fn set_threat_prevention_profile<T: std::convert::Into<std::string::String>>(
20941 mut self,
20942 v: T,
20943 ) -> Self {
20944 self.threat_prevention_profile = v.into();
20945 self
20946 }
20947
20948 /// Sets the value of [custom_mirroring_profile][crate::model::SecurityProfileGroup::custom_mirroring_profile].
20949 ///
20950 /// # Example
20951 /// ```ignore,no_run
20952 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20953 /// let x = SecurityProfileGroup::new().set_custom_mirroring_profile("example");
20954 /// ```
20955 pub fn set_custom_mirroring_profile<T: std::convert::Into<std::string::String>>(
20956 mut self,
20957 v: T,
20958 ) -> Self {
20959 self.custom_mirroring_profile = v.into();
20960 self
20961 }
20962
20963 /// Sets the value of [custom_intercept_profile][crate::model::SecurityProfileGroup::custom_intercept_profile].
20964 ///
20965 /// # Example
20966 /// ```ignore,no_run
20967 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20968 /// let x = SecurityProfileGroup::new().set_custom_intercept_profile("example");
20969 /// ```
20970 pub fn set_custom_intercept_profile<T: std::convert::Into<std::string::String>>(
20971 mut self,
20972 v: T,
20973 ) -> Self {
20974 self.custom_intercept_profile = v.into();
20975 self
20976 }
20977
20978 /// Sets the value of [url_filtering_profile][crate::model::SecurityProfileGroup::url_filtering_profile].
20979 ///
20980 /// # Example
20981 /// ```ignore,no_run
20982 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20983 /// let x = SecurityProfileGroup::new().set_url_filtering_profile("example");
20984 /// ```
20985 pub fn set_url_filtering_profile<T: std::convert::Into<std::string::String>>(
20986 mut self,
20987 v: T,
20988 ) -> Self {
20989 self.url_filtering_profile = v.into();
20990 self
20991 }
20992}
20993
20994impl wkt::message::Message for SecurityProfileGroup {
20995 fn typename() -> &'static str {
20996 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfileGroup"
20997 }
20998}
20999
21000/// SecurityProfile is a resource that defines the behavior for one of many
21001/// ProfileTypes.
21002#[derive(Clone, Default, PartialEq)]
21003#[non_exhaustive]
21004pub struct SecurityProfile {
21005 /// Immutable. Identifier. Name of the SecurityProfile resource. It matches
21006 /// pattern
21007 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile}`.
21008 pub name: std::string::String,
21009
21010 /// Optional. An optional description of the profile. Max length 512
21011 /// characters.
21012 pub description: std::string::String,
21013
21014 /// Output only. Resource creation timestamp.
21015 pub create_time: std::option::Option<wkt::Timestamp>,
21016
21017 /// Output only. Last resource update timestamp.
21018 pub update_time: std::option::Option<wkt::Timestamp>,
21019
21020 /// Output only. This checksum is computed by the server based on the value of
21021 /// other fields, and may be sent on update and delete requests to ensure the
21022 /// client has an up-to-date value before proceeding.
21023 pub etag: std::string::String,
21024
21025 /// Optional. Labels as key value pairs.
21026 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
21027
21028 /// Immutable. The single ProfileType that the SecurityProfile resource
21029 /// configures.
21030 pub r#type: crate::model::security_profile::ProfileType,
21031
21032 /// The behavior for the ProfileType that the SecurityProfile resource is meant
21033 /// to configure. This field must correspond to the ProfileType of the
21034 /// SecurityProfile.
21035 pub profile: std::option::Option<crate::model::security_profile::Profile>,
21036
21037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21038}
21039
21040impl SecurityProfile {
21041 /// Creates a new default instance.
21042 pub fn new() -> Self {
21043 std::default::Default::default()
21044 }
21045
21046 /// Sets the value of [name][crate::model::SecurityProfile::name].
21047 ///
21048 /// # Example
21049 /// ```ignore,no_run
21050 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21051 /// let x = SecurityProfile::new().set_name("example");
21052 /// ```
21053 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21054 self.name = v.into();
21055 self
21056 }
21057
21058 /// Sets the value of [description][crate::model::SecurityProfile::description].
21059 ///
21060 /// # Example
21061 /// ```ignore,no_run
21062 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21063 /// let x = SecurityProfile::new().set_description("example");
21064 /// ```
21065 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21066 self.description = v.into();
21067 self
21068 }
21069
21070 /// Sets the value of [create_time][crate::model::SecurityProfile::create_time].
21071 ///
21072 /// # Example
21073 /// ```ignore,no_run
21074 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21075 /// use wkt::Timestamp;
21076 /// let x = SecurityProfile::new().set_create_time(Timestamp::default()/* use setters */);
21077 /// ```
21078 pub fn set_create_time<T>(mut self, v: T) -> Self
21079 where
21080 T: std::convert::Into<wkt::Timestamp>,
21081 {
21082 self.create_time = std::option::Option::Some(v.into());
21083 self
21084 }
21085
21086 /// Sets or clears the value of [create_time][crate::model::SecurityProfile::create_time].
21087 ///
21088 /// # Example
21089 /// ```ignore,no_run
21090 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21091 /// use wkt::Timestamp;
21092 /// let x = SecurityProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21093 /// let x = SecurityProfile::new().set_or_clear_create_time(None::<Timestamp>);
21094 /// ```
21095 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21096 where
21097 T: std::convert::Into<wkt::Timestamp>,
21098 {
21099 self.create_time = v.map(|x| x.into());
21100 self
21101 }
21102
21103 /// Sets the value of [update_time][crate::model::SecurityProfile::update_time].
21104 ///
21105 /// # Example
21106 /// ```ignore,no_run
21107 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21108 /// use wkt::Timestamp;
21109 /// let x = SecurityProfile::new().set_update_time(Timestamp::default()/* use setters */);
21110 /// ```
21111 pub fn set_update_time<T>(mut self, v: T) -> Self
21112 where
21113 T: std::convert::Into<wkt::Timestamp>,
21114 {
21115 self.update_time = std::option::Option::Some(v.into());
21116 self
21117 }
21118
21119 /// Sets or clears the value of [update_time][crate::model::SecurityProfile::update_time].
21120 ///
21121 /// # Example
21122 /// ```ignore,no_run
21123 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21124 /// use wkt::Timestamp;
21125 /// let x = SecurityProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
21126 /// let x = SecurityProfile::new().set_or_clear_update_time(None::<Timestamp>);
21127 /// ```
21128 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21129 where
21130 T: std::convert::Into<wkt::Timestamp>,
21131 {
21132 self.update_time = v.map(|x| x.into());
21133 self
21134 }
21135
21136 /// Sets the value of [etag][crate::model::SecurityProfile::etag].
21137 ///
21138 /// # Example
21139 /// ```ignore,no_run
21140 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21141 /// let x = SecurityProfile::new().set_etag("example");
21142 /// ```
21143 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21144 self.etag = v.into();
21145 self
21146 }
21147
21148 /// Sets the value of [labels][crate::model::SecurityProfile::labels].
21149 ///
21150 /// # Example
21151 /// ```ignore,no_run
21152 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21153 /// let x = SecurityProfile::new().set_labels([
21154 /// ("key0", "abc"),
21155 /// ("key1", "xyz"),
21156 /// ]);
21157 /// ```
21158 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
21159 where
21160 T: std::iter::IntoIterator<Item = (K, V)>,
21161 K: std::convert::Into<std::string::String>,
21162 V: std::convert::Into<std::string::String>,
21163 {
21164 use std::iter::Iterator;
21165 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21166 self
21167 }
21168
21169 /// Sets the value of [r#type][crate::model::SecurityProfile::type].
21170 ///
21171 /// # Example
21172 /// ```ignore,no_run
21173 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21174 /// use google_cloud_networksecurity_v1::model::security_profile::ProfileType;
21175 /// let x0 = SecurityProfile::new().set_type(ProfileType::ThreatPrevention);
21176 /// let x1 = SecurityProfile::new().set_type(ProfileType::CustomMirroring);
21177 /// let x2 = SecurityProfile::new().set_type(ProfileType::CustomIntercept);
21178 /// ```
21179 pub fn set_type<T: std::convert::Into<crate::model::security_profile::ProfileType>>(
21180 mut self,
21181 v: T,
21182 ) -> Self {
21183 self.r#type = v.into();
21184 self
21185 }
21186
21187 /// Sets the value of [profile][crate::model::SecurityProfile::profile].
21188 ///
21189 /// Note that all the setters affecting `profile` are mutually
21190 /// exclusive.
21191 ///
21192 /// # Example
21193 /// ```ignore,no_run
21194 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21195 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21196 /// let x = SecurityProfile::new().set_profile(Some(
21197 /// google_cloud_networksecurity_v1::model::security_profile::Profile::ThreatPreventionProfile(ThreatPreventionProfile::default().into())));
21198 /// ```
21199 pub fn set_profile<
21200 T: std::convert::Into<std::option::Option<crate::model::security_profile::Profile>>,
21201 >(
21202 mut self,
21203 v: T,
21204 ) -> Self {
21205 self.profile = v.into();
21206 self
21207 }
21208
21209 /// The value of [profile][crate::model::SecurityProfile::profile]
21210 /// if it holds a `ThreatPreventionProfile`, `None` if the field is not set or
21211 /// holds a different branch.
21212 pub fn threat_prevention_profile(
21213 &self,
21214 ) -> std::option::Option<&std::boxed::Box<crate::model::ThreatPreventionProfile>> {
21215 #[allow(unreachable_patterns)]
21216 self.profile.as_ref().and_then(|v| match v {
21217 crate::model::security_profile::Profile::ThreatPreventionProfile(v) => {
21218 std::option::Option::Some(v)
21219 }
21220 _ => std::option::Option::None,
21221 })
21222 }
21223
21224 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21225 /// to hold a `ThreatPreventionProfile`.
21226 ///
21227 /// Note that all the setters affecting `profile` are
21228 /// mutually exclusive.
21229 ///
21230 /// # Example
21231 /// ```ignore,no_run
21232 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21233 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21234 /// let x = SecurityProfile::new().set_threat_prevention_profile(ThreatPreventionProfile::default()/* use setters */);
21235 /// assert!(x.threat_prevention_profile().is_some());
21236 /// assert!(x.custom_mirroring_profile().is_none());
21237 /// assert!(x.custom_intercept_profile().is_none());
21238 /// assert!(x.url_filtering_profile().is_none());
21239 /// ```
21240 pub fn set_threat_prevention_profile<
21241 T: std::convert::Into<std::boxed::Box<crate::model::ThreatPreventionProfile>>,
21242 >(
21243 mut self,
21244 v: T,
21245 ) -> Self {
21246 self.profile = std::option::Option::Some(
21247 crate::model::security_profile::Profile::ThreatPreventionProfile(v.into()),
21248 );
21249 self
21250 }
21251
21252 /// The value of [profile][crate::model::SecurityProfile::profile]
21253 /// if it holds a `CustomMirroringProfile`, `None` if the field is not set or
21254 /// holds a different branch.
21255 pub fn custom_mirroring_profile(
21256 &self,
21257 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomMirroringProfile>> {
21258 #[allow(unreachable_patterns)]
21259 self.profile.as_ref().and_then(|v| match v {
21260 crate::model::security_profile::Profile::CustomMirroringProfile(v) => {
21261 std::option::Option::Some(v)
21262 }
21263 _ => std::option::Option::None,
21264 })
21265 }
21266
21267 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21268 /// to hold a `CustomMirroringProfile`.
21269 ///
21270 /// Note that all the setters affecting `profile` are
21271 /// mutually exclusive.
21272 ///
21273 /// # Example
21274 /// ```ignore,no_run
21275 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21276 /// use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21277 /// let x = SecurityProfile::new().set_custom_mirroring_profile(CustomMirroringProfile::default()/* use setters */);
21278 /// assert!(x.custom_mirroring_profile().is_some());
21279 /// assert!(x.threat_prevention_profile().is_none());
21280 /// assert!(x.custom_intercept_profile().is_none());
21281 /// assert!(x.url_filtering_profile().is_none());
21282 /// ```
21283 pub fn set_custom_mirroring_profile<
21284 T: std::convert::Into<std::boxed::Box<crate::model::CustomMirroringProfile>>,
21285 >(
21286 mut self,
21287 v: T,
21288 ) -> Self {
21289 self.profile = std::option::Option::Some(
21290 crate::model::security_profile::Profile::CustomMirroringProfile(v.into()),
21291 );
21292 self
21293 }
21294
21295 /// The value of [profile][crate::model::SecurityProfile::profile]
21296 /// if it holds a `CustomInterceptProfile`, `None` if the field is not set or
21297 /// holds a different branch.
21298 pub fn custom_intercept_profile(
21299 &self,
21300 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomInterceptProfile>> {
21301 #[allow(unreachable_patterns)]
21302 self.profile.as_ref().and_then(|v| match v {
21303 crate::model::security_profile::Profile::CustomInterceptProfile(v) => {
21304 std::option::Option::Some(v)
21305 }
21306 _ => std::option::Option::None,
21307 })
21308 }
21309
21310 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21311 /// to hold a `CustomInterceptProfile`.
21312 ///
21313 /// Note that all the setters affecting `profile` are
21314 /// mutually exclusive.
21315 ///
21316 /// # Example
21317 /// ```ignore,no_run
21318 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21319 /// use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21320 /// let x = SecurityProfile::new().set_custom_intercept_profile(CustomInterceptProfile::default()/* use setters */);
21321 /// assert!(x.custom_intercept_profile().is_some());
21322 /// assert!(x.threat_prevention_profile().is_none());
21323 /// assert!(x.custom_mirroring_profile().is_none());
21324 /// assert!(x.url_filtering_profile().is_none());
21325 /// ```
21326 pub fn set_custom_intercept_profile<
21327 T: std::convert::Into<std::boxed::Box<crate::model::CustomInterceptProfile>>,
21328 >(
21329 mut self,
21330 v: T,
21331 ) -> Self {
21332 self.profile = std::option::Option::Some(
21333 crate::model::security_profile::Profile::CustomInterceptProfile(v.into()),
21334 );
21335 self
21336 }
21337
21338 /// The value of [profile][crate::model::SecurityProfile::profile]
21339 /// if it holds a `UrlFilteringProfile`, `None` if the field is not set or
21340 /// holds a different branch.
21341 pub fn url_filtering_profile(
21342 &self,
21343 ) -> std::option::Option<&std::boxed::Box<crate::model::UrlFilteringProfile>> {
21344 #[allow(unreachable_patterns)]
21345 self.profile.as_ref().and_then(|v| match v {
21346 crate::model::security_profile::Profile::UrlFilteringProfile(v) => {
21347 std::option::Option::Some(v)
21348 }
21349 _ => std::option::Option::None,
21350 })
21351 }
21352
21353 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21354 /// to hold a `UrlFilteringProfile`.
21355 ///
21356 /// Note that all the setters affecting `profile` are
21357 /// mutually exclusive.
21358 ///
21359 /// # Example
21360 /// ```ignore,no_run
21361 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21362 /// use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
21363 /// let x = SecurityProfile::new().set_url_filtering_profile(UrlFilteringProfile::default()/* use setters */);
21364 /// assert!(x.url_filtering_profile().is_some());
21365 /// assert!(x.threat_prevention_profile().is_none());
21366 /// assert!(x.custom_mirroring_profile().is_none());
21367 /// assert!(x.custom_intercept_profile().is_none());
21368 /// ```
21369 pub fn set_url_filtering_profile<
21370 T: std::convert::Into<std::boxed::Box<crate::model::UrlFilteringProfile>>,
21371 >(
21372 mut self,
21373 v: T,
21374 ) -> Self {
21375 self.profile = std::option::Option::Some(
21376 crate::model::security_profile::Profile::UrlFilteringProfile(v.into()),
21377 );
21378 self
21379 }
21380}
21381
21382impl wkt::message::Message for SecurityProfile {
21383 fn typename() -> &'static str {
21384 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfile"
21385 }
21386}
21387
21388/// Defines additional types related to [SecurityProfile].
21389pub mod security_profile {
21390 #[allow(unused_imports)]
21391 use super::*;
21392
21393 /// The possible types that the SecurityProfile resource can configure.
21394 ///
21395 /// # Working with unknown values
21396 ///
21397 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21398 /// additional enum variants at any time. Adding new variants is not considered
21399 /// a breaking change. Applications should write their code in anticipation of:
21400 ///
21401 /// - New values appearing in future releases of the client library, **and**
21402 /// - New values received dynamically, without application changes.
21403 ///
21404 /// Please consult the [Working with enums] section in the user guide for some
21405 /// guidelines.
21406 ///
21407 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21408 #[derive(Clone, Debug, PartialEq)]
21409 #[non_exhaustive]
21410 pub enum ProfileType {
21411 /// Profile type not specified.
21412 Unspecified,
21413 /// Profile type for threat prevention.
21414 ThreatPrevention,
21415 /// Profile type for packet mirroring v2
21416 CustomMirroring,
21417 /// Profile type for TPPI.
21418 CustomIntercept,
21419 /// Profile type for URL filtering.
21420 UrlFiltering,
21421 /// If set, the enum was initialized with an unknown value.
21422 ///
21423 /// Applications can examine the value using [ProfileType::value] or
21424 /// [ProfileType::name].
21425 UnknownValue(profile_type::UnknownValue),
21426 }
21427
21428 #[doc(hidden)]
21429 pub mod profile_type {
21430 #[allow(unused_imports)]
21431 use super::*;
21432 #[derive(Clone, Debug, PartialEq)]
21433 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21434 }
21435
21436 impl ProfileType {
21437 /// Gets the enum value.
21438 ///
21439 /// Returns `None` if the enum contains an unknown value deserialized from
21440 /// the string representation of enums.
21441 pub fn value(&self) -> std::option::Option<i32> {
21442 match self {
21443 Self::Unspecified => std::option::Option::Some(0),
21444 Self::ThreatPrevention => std::option::Option::Some(1),
21445 Self::CustomMirroring => std::option::Option::Some(2),
21446 Self::CustomIntercept => std::option::Option::Some(3),
21447 Self::UrlFiltering => std::option::Option::Some(5),
21448 Self::UnknownValue(u) => u.0.value(),
21449 }
21450 }
21451
21452 /// Gets the enum value as a string.
21453 ///
21454 /// Returns `None` if the enum contains an unknown value deserialized from
21455 /// the integer representation of enums.
21456 pub fn name(&self) -> std::option::Option<&str> {
21457 match self {
21458 Self::Unspecified => std::option::Option::Some("PROFILE_TYPE_UNSPECIFIED"),
21459 Self::ThreatPrevention => std::option::Option::Some("THREAT_PREVENTION"),
21460 Self::CustomMirroring => std::option::Option::Some("CUSTOM_MIRRORING"),
21461 Self::CustomIntercept => std::option::Option::Some("CUSTOM_INTERCEPT"),
21462 Self::UrlFiltering => std::option::Option::Some("URL_FILTERING"),
21463 Self::UnknownValue(u) => u.0.name(),
21464 }
21465 }
21466 }
21467
21468 impl std::default::Default for ProfileType {
21469 fn default() -> Self {
21470 use std::convert::From;
21471 Self::from(0)
21472 }
21473 }
21474
21475 impl std::fmt::Display for ProfileType {
21476 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21477 wkt::internal::display_enum(f, self.name(), self.value())
21478 }
21479 }
21480
21481 impl std::convert::From<i32> for ProfileType {
21482 fn from(value: i32) -> Self {
21483 match value {
21484 0 => Self::Unspecified,
21485 1 => Self::ThreatPrevention,
21486 2 => Self::CustomMirroring,
21487 3 => Self::CustomIntercept,
21488 5 => Self::UrlFiltering,
21489 _ => Self::UnknownValue(profile_type::UnknownValue(
21490 wkt::internal::UnknownEnumValue::Integer(value),
21491 )),
21492 }
21493 }
21494 }
21495
21496 impl std::convert::From<&str> for ProfileType {
21497 fn from(value: &str) -> Self {
21498 use std::string::ToString;
21499 match value {
21500 "PROFILE_TYPE_UNSPECIFIED" => Self::Unspecified,
21501 "THREAT_PREVENTION" => Self::ThreatPrevention,
21502 "CUSTOM_MIRRORING" => Self::CustomMirroring,
21503 "CUSTOM_INTERCEPT" => Self::CustomIntercept,
21504 "URL_FILTERING" => Self::UrlFiltering,
21505 _ => Self::UnknownValue(profile_type::UnknownValue(
21506 wkt::internal::UnknownEnumValue::String(value.to_string()),
21507 )),
21508 }
21509 }
21510 }
21511
21512 impl serde::ser::Serialize for ProfileType {
21513 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21514 where
21515 S: serde::Serializer,
21516 {
21517 match self {
21518 Self::Unspecified => serializer.serialize_i32(0),
21519 Self::ThreatPrevention => serializer.serialize_i32(1),
21520 Self::CustomMirroring => serializer.serialize_i32(2),
21521 Self::CustomIntercept => serializer.serialize_i32(3),
21522 Self::UrlFiltering => serializer.serialize_i32(5),
21523 Self::UnknownValue(u) => u.0.serialize(serializer),
21524 }
21525 }
21526 }
21527
21528 impl<'de> serde::de::Deserialize<'de> for ProfileType {
21529 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21530 where
21531 D: serde::Deserializer<'de>,
21532 {
21533 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProfileType>::new(
21534 ".google.cloud.networksecurity.v1.SecurityProfile.ProfileType",
21535 ))
21536 }
21537 }
21538
21539 /// The behavior for the ProfileType that the SecurityProfile resource is meant
21540 /// to configure. This field must correspond to the ProfileType of the
21541 /// SecurityProfile.
21542 #[derive(Clone, Debug, PartialEq)]
21543 #[non_exhaustive]
21544 pub enum Profile {
21545 /// The threat prevention configuration for the SecurityProfile.
21546 ThreatPreventionProfile(std::boxed::Box<crate::model::ThreatPreventionProfile>),
21547 /// The custom Packet Mirroring v2 configuration for the SecurityProfile.
21548 CustomMirroringProfile(std::boxed::Box<crate::model::CustomMirroringProfile>),
21549 /// The custom TPPI configuration for the SecurityProfile.
21550 CustomInterceptProfile(std::boxed::Box<crate::model::CustomInterceptProfile>),
21551 /// The URL filtering configuration for the SecurityProfile.
21552 UrlFilteringProfile(std::boxed::Box<crate::model::UrlFilteringProfile>),
21553 }
21554}
21555
21556/// CustomInterceptProfile defines in-band integration behavior (intercept).
21557/// It is used by firewall rules with an APPLY_SECURITY_PROFILE_GROUP action.
21558#[derive(Clone, Default, PartialEq)]
21559#[non_exhaustive]
21560pub struct CustomInterceptProfile {
21561 /// Required. The target InterceptEndpointGroup.
21562 /// When a firewall rule with this security profile attached matches a packet,
21563 /// the packet will be intercepted to the location-local target in this group.
21564 pub intercept_endpoint_group: std::string::String,
21565
21566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21567}
21568
21569impl CustomInterceptProfile {
21570 /// Creates a new default instance.
21571 pub fn new() -> Self {
21572 std::default::Default::default()
21573 }
21574
21575 /// Sets the value of [intercept_endpoint_group][crate::model::CustomInterceptProfile::intercept_endpoint_group].
21576 ///
21577 /// # Example
21578 /// ```ignore,no_run
21579 /// # use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21580 /// let x = CustomInterceptProfile::new().set_intercept_endpoint_group("example");
21581 /// ```
21582 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
21583 mut self,
21584 v: T,
21585 ) -> Self {
21586 self.intercept_endpoint_group = v.into();
21587 self
21588 }
21589}
21590
21591impl wkt::message::Message for CustomInterceptProfile {
21592 fn typename() -> &'static str {
21593 "type.googleapis.com/google.cloud.networksecurity.v1.CustomInterceptProfile"
21594 }
21595}
21596
21597/// CustomMirroringProfile defines out-of-band integration behavior (mirroring).
21598/// It is used by mirroring rules with a MIRROR action.
21599#[derive(Clone, Default, PartialEq)]
21600#[non_exhaustive]
21601pub struct CustomMirroringProfile {
21602 /// Required. Immutable. The target MirroringEndpointGroup.
21603 /// When a mirroring rule with this security profile attached matches a packet,
21604 /// a replica will be mirrored to the location-local target in this group.
21605 pub mirroring_endpoint_group: std::string::String,
21606
21607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21608}
21609
21610impl CustomMirroringProfile {
21611 /// Creates a new default instance.
21612 pub fn new() -> Self {
21613 std::default::Default::default()
21614 }
21615
21616 /// Sets the value of [mirroring_endpoint_group][crate::model::CustomMirroringProfile::mirroring_endpoint_group].
21617 ///
21618 /// # Example
21619 /// ```ignore,no_run
21620 /// # use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21621 /// let x = CustomMirroringProfile::new().set_mirroring_endpoint_group("example");
21622 /// ```
21623 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
21624 mut self,
21625 v: T,
21626 ) -> Self {
21627 self.mirroring_endpoint_group = v.into();
21628 self
21629 }
21630}
21631
21632impl wkt::message::Message for CustomMirroringProfile {
21633 fn typename() -> &'static str {
21634 "type.googleapis.com/google.cloud.networksecurity.v1.CustomMirroringProfile"
21635 }
21636}
21637
21638/// Request used with the ListSecurityProfileGroups method.
21639#[derive(Clone, Default, PartialEq)]
21640#[non_exhaustive]
21641pub struct ListSecurityProfileGroupsRequest {
21642 /// Required. The project or organization and location from which the
21643 /// SecurityProfileGroups should be listed, specified in the format
21644 /// `projects|organizations/*/locations/{location}`.
21645 pub parent: std::string::String,
21646
21647 /// Optional. Maximum number of SecurityProfileGroups to return per call.
21648 pub page_size: i32,
21649
21650 /// Optional. The value returned by the last
21651 /// `ListSecurityProfileGroupsResponse` Indicates that this is a
21652 /// continuation of a prior `ListSecurityProfileGroups` call, and
21653 /// that the system should return the next page of data.
21654 pub page_token: std::string::String,
21655
21656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21657}
21658
21659impl ListSecurityProfileGroupsRequest {
21660 /// Creates a new default instance.
21661 pub fn new() -> Self {
21662 std::default::Default::default()
21663 }
21664
21665 /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
21666 ///
21667 /// # Example
21668 /// ```ignore,no_run
21669 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21670 /// let x = ListSecurityProfileGroupsRequest::new().set_parent("example");
21671 /// ```
21672 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21673 self.parent = v.into();
21674 self
21675 }
21676
21677 /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
21678 ///
21679 /// # Example
21680 /// ```ignore,no_run
21681 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21682 /// let x = ListSecurityProfileGroupsRequest::new().set_page_size(42);
21683 /// ```
21684 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21685 self.page_size = v.into();
21686 self
21687 }
21688
21689 /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
21690 ///
21691 /// # Example
21692 /// ```ignore,no_run
21693 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21694 /// let x = ListSecurityProfileGroupsRequest::new().set_page_token("example");
21695 /// ```
21696 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21697 self.page_token = v.into();
21698 self
21699 }
21700}
21701
21702impl wkt::message::Message for ListSecurityProfileGroupsRequest {
21703 fn typename() -> &'static str {
21704 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest"
21705 }
21706}
21707
21708/// Response returned by the ListSecurityProfileGroups method.
21709#[derive(Clone, Default, PartialEq)]
21710#[non_exhaustive]
21711pub struct ListSecurityProfileGroupsResponse {
21712 /// List of SecurityProfileGroups resources.
21713 pub security_profile_groups: std::vec::Vec<crate::model::SecurityProfileGroup>,
21714
21715 /// If there might be more results than those appearing in this response, then
21716 /// `next_page_token` is included. To get the next set of results, call this
21717 /// method again using the value of `next_page_token` as `page_token`.
21718 pub next_page_token: std::string::String,
21719
21720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21721}
21722
21723impl ListSecurityProfileGroupsResponse {
21724 /// Creates a new default instance.
21725 pub fn new() -> Self {
21726 std::default::Default::default()
21727 }
21728
21729 /// Sets the value of [security_profile_groups][crate::model::ListSecurityProfileGroupsResponse::security_profile_groups].
21730 ///
21731 /// # Example
21732 /// ```ignore,no_run
21733 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
21734 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21735 /// let x = ListSecurityProfileGroupsResponse::new()
21736 /// .set_security_profile_groups([
21737 /// SecurityProfileGroup::default()/* use setters */,
21738 /// SecurityProfileGroup::default()/* use (different) setters */,
21739 /// ]);
21740 /// ```
21741 pub fn set_security_profile_groups<T, V>(mut self, v: T) -> Self
21742 where
21743 T: std::iter::IntoIterator<Item = V>,
21744 V: std::convert::Into<crate::model::SecurityProfileGroup>,
21745 {
21746 use std::iter::Iterator;
21747 self.security_profile_groups = v.into_iter().map(|i| i.into()).collect();
21748 self
21749 }
21750
21751 /// Sets the value of [next_page_token][crate::model::ListSecurityProfileGroupsResponse::next_page_token].
21752 ///
21753 /// # Example
21754 /// ```ignore,no_run
21755 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
21756 /// let x = ListSecurityProfileGroupsResponse::new().set_next_page_token("example");
21757 /// ```
21758 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21759 self.next_page_token = v.into();
21760 self
21761 }
21762}
21763
21764impl wkt::message::Message for ListSecurityProfileGroupsResponse {
21765 fn typename() -> &'static str {
21766 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse"
21767 }
21768}
21769
21770#[doc(hidden)]
21771impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfileGroupsResponse {
21772 type PageItem = crate::model::SecurityProfileGroup;
21773
21774 fn items(self) -> std::vec::Vec<Self::PageItem> {
21775 self.security_profile_groups
21776 }
21777
21778 fn next_page_token(&self) -> std::string::String {
21779 use std::clone::Clone;
21780 self.next_page_token.clone()
21781 }
21782}
21783
21784/// Request used by the GetSecurityProfileGroup method.
21785#[derive(Clone, Default, PartialEq)]
21786#[non_exhaustive]
21787pub struct GetSecurityProfileGroupRequest {
21788 /// Required. A name of the SecurityProfileGroup to get. Must be in the format
21789 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
21790 pub name: std::string::String,
21791
21792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21793}
21794
21795impl GetSecurityProfileGroupRequest {
21796 /// Creates a new default instance.
21797 pub fn new() -> Self {
21798 std::default::Default::default()
21799 }
21800
21801 /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
21802 ///
21803 /// # Example
21804 /// ```ignore,no_run
21805 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileGroupRequest;
21806 /// let x = GetSecurityProfileGroupRequest::new().set_name("example");
21807 /// ```
21808 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21809 self.name = v.into();
21810 self
21811 }
21812}
21813
21814impl wkt::message::Message for GetSecurityProfileGroupRequest {
21815 fn typename() -> &'static str {
21816 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest"
21817 }
21818}
21819
21820/// Request used by the CreateSecurityProfileGroup method.
21821#[derive(Clone, Default, PartialEq)]
21822#[non_exhaustive]
21823pub struct CreateSecurityProfileGroupRequest {
21824 /// Required. The parent resource of the SecurityProfileGroup. Must be in the
21825 /// format `projects|organizations/*/locations/{location}`.
21826 pub parent: std::string::String,
21827
21828 /// Required. Short name of the SecurityProfileGroup resource to be created.
21829 /// This value should be 1-63 characters long, containing only
21830 /// letters, numbers, hyphens, and underscores, and should not start
21831 /// with a number. E.g. "security_profile_group1".
21832 pub security_profile_group_id: std::string::String,
21833
21834 /// Required. SecurityProfileGroup resource to be created.
21835 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
21836
21837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21838}
21839
21840impl CreateSecurityProfileGroupRequest {
21841 /// Creates a new default instance.
21842 pub fn new() -> Self {
21843 std::default::Default::default()
21844 }
21845
21846 /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
21847 ///
21848 /// # Example
21849 /// ```ignore,no_run
21850 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21851 /// let x = CreateSecurityProfileGroupRequest::new().set_parent("example");
21852 /// ```
21853 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21854 self.parent = v.into();
21855 self
21856 }
21857
21858 /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
21859 ///
21860 /// # Example
21861 /// ```ignore,no_run
21862 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21863 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group_id("example");
21864 /// ```
21865 pub fn set_security_profile_group_id<T: std::convert::Into<std::string::String>>(
21866 mut self,
21867 v: T,
21868 ) -> Self {
21869 self.security_profile_group_id = v.into();
21870 self
21871 }
21872
21873 /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21874 ///
21875 /// # Example
21876 /// ```ignore,no_run
21877 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21878 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21879 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
21880 /// ```
21881 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21882 where
21883 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21884 {
21885 self.security_profile_group = std::option::Option::Some(v.into());
21886 self
21887 }
21888
21889 /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21890 ///
21891 /// # Example
21892 /// ```ignore,no_run
21893 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21894 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21895 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
21896 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
21897 /// ```
21898 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21899 where
21900 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21901 {
21902 self.security_profile_group = v.map(|x| x.into());
21903 self
21904 }
21905}
21906
21907impl wkt::message::Message for CreateSecurityProfileGroupRequest {
21908 fn typename() -> &'static str {
21909 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest"
21910 }
21911}
21912
21913/// Request used by the UpdateSecurityProfileGroup method.
21914#[derive(Clone, Default, PartialEq)]
21915#[non_exhaustive]
21916pub struct UpdateSecurityProfileGroupRequest {
21917 /// Required. Field mask is used to specify the fields to be overwritten in the
21918 /// SecurityProfileGroup resource by the update.
21919 /// The fields specified in the update_mask are relative to the resource, not
21920 /// the full request. A field will be overwritten if it is in the mask.
21921 pub update_mask: std::option::Option<wkt::FieldMask>,
21922
21923 /// Required. Updated SecurityProfileGroup resource.
21924 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
21925
21926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21927}
21928
21929impl UpdateSecurityProfileGroupRequest {
21930 /// Creates a new default instance.
21931 pub fn new() -> Self {
21932 std::default::Default::default()
21933 }
21934
21935 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21936 ///
21937 /// # Example
21938 /// ```ignore,no_run
21939 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21940 /// use wkt::FieldMask;
21941 /// let x = UpdateSecurityProfileGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21942 /// ```
21943 pub fn set_update_mask<T>(mut self, v: T) -> Self
21944 where
21945 T: std::convert::Into<wkt::FieldMask>,
21946 {
21947 self.update_mask = std::option::Option::Some(v.into());
21948 self
21949 }
21950
21951 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21952 ///
21953 /// # Example
21954 /// ```ignore,no_run
21955 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21956 /// use wkt::FieldMask;
21957 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21958 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21959 /// ```
21960 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21961 where
21962 T: std::convert::Into<wkt::FieldMask>,
21963 {
21964 self.update_mask = v.map(|x| x.into());
21965 self
21966 }
21967
21968 /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21969 ///
21970 /// # Example
21971 /// ```ignore,no_run
21972 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21973 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21974 /// let x = UpdateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
21975 /// ```
21976 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21977 where
21978 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21979 {
21980 self.security_profile_group = std::option::Option::Some(v.into());
21981 self
21982 }
21983
21984 /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21985 ///
21986 /// # Example
21987 /// ```ignore,no_run
21988 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21989 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21990 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
21991 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
21992 /// ```
21993 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21994 where
21995 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21996 {
21997 self.security_profile_group = v.map(|x| x.into());
21998 self
21999 }
22000}
22001
22002impl wkt::message::Message for UpdateSecurityProfileGroupRequest {
22003 fn typename() -> &'static str {
22004 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest"
22005 }
22006}
22007
22008/// Request used by the DeleteSecurityProfileGroup method.
22009#[derive(Clone, Default, PartialEq)]
22010#[non_exhaustive]
22011pub struct DeleteSecurityProfileGroupRequest {
22012 /// Required. A name of the SecurityProfileGroup to delete. Must be in the
22013 /// format
22014 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
22015 pub name: std::string::String,
22016
22017 /// Optional. If client provided etag is out of date, delete will return
22018 /// FAILED_PRECONDITION error.
22019 pub etag: std::string::String,
22020
22021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22022}
22023
22024impl DeleteSecurityProfileGroupRequest {
22025 /// Creates a new default instance.
22026 pub fn new() -> Self {
22027 std::default::Default::default()
22028 }
22029
22030 /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
22031 ///
22032 /// # Example
22033 /// ```ignore,no_run
22034 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22035 /// let x = DeleteSecurityProfileGroupRequest::new().set_name("example");
22036 /// ```
22037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22038 self.name = v.into();
22039 self
22040 }
22041
22042 /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
22043 ///
22044 /// # Example
22045 /// ```ignore,no_run
22046 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22047 /// let x = DeleteSecurityProfileGroupRequest::new().set_etag("example");
22048 /// ```
22049 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22050 self.etag = v.into();
22051 self
22052 }
22053}
22054
22055impl wkt::message::Message for DeleteSecurityProfileGroupRequest {
22056 fn typename() -> &'static str {
22057 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest"
22058 }
22059}
22060
22061/// Request used with the ListSecurityProfiles method.
22062#[derive(Clone, Default, PartialEq)]
22063#[non_exhaustive]
22064pub struct ListSecurityProfilesRequest {
22065 /// Required. The project or organization and location from which the
22066 /// SecurityProfiles should be listed, specified in the format
22067 /// `projects|organizations/*/locations/{location}`.
22068 pub parent: std::string::String,
22069
22070 /// Optional. Maximum number of SecurityProfiles to return per call.
22071 pub page_size: i32,
22072
22073 /// Optional. The value returned by the last
22074 /// `ListSecurityProfilesResponse` Indicates that this is a continuation of a
22075 /// prior `ListSecurityProfiles` call, and that the system should return the
22076 /// next page of data.
22077 pub page_token: std::string::String,
22078
22079 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22080}
22081
22082impl ListSecurityProfilesRequest {
22083 /// Creates a new default instance.
22084 pub fn new() -> Self {
22085 std::default::Default::default()
22086 }
22087
22088 /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
22089 ///
22090 /// # Example
22091 /// ```ignore,no_run
22092 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22093 /// let x = ListSecurityProfilesRequest::new().set_parent("example");
22094 /// ```
22095 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22096 self.parent = v.into();
22097 self
22098 }
22099
22100 /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
22101 ///
22102 /// # Example
22103 /// ```ignore,no_run
22104 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22105 /// let x = ListSecurityProfilesRequest::new().set_page_size(42);
22106 /// ```
22107 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22108 self.page_size = v.into();
22109 self
22110 }
22111
22112 /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
22113 ///
22114 /// # Example
22115 /// ```ignore,no_run
22116 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22117 /// let x = ListSecurityProfilesRequest::new().set_page_token("example");
22118 /// ```
22119 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22120 self.page_token = v.into();
22121 self
22122 }
22123}
22124
22125impl wkt::message::Message for ListSecurityProfilesRequest {
22126 fn typename() -> &'static str {
22127 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesRequest"
22128 }
22129}
22130
22131/// Response returned by the ListSecurityProfiles method.
22132#[derive(Clone, Default, PartialEq)]
22133#[non_exhaustive]
22134pub struct ListSecurityProfilesResponse {
22135 /// List of SecurityProfile resources.
22136 pub security_profiles: std::vec::Vec<crate::model::SecurityProfile>,
22137
22138 /// If there might be more results than those appearing in this response, then
22139 /// `next_page_token` is included. To get the next set of results, call this
22140 /// method again using the value of `next_page_token` as `page_token`.
22141 pub next_page_token: std::string::String,
22142
22143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22144}
22145
22146impl ListSecurityProfilesResponse {
22147 /// Creates a new default instance.
22148 pub fn new() -> Self {
22149 std::default::Default::default()
22150 }
22151
22152 /// Sets the value of [security_profiles][crate::model::ListSecurityProfilesResponse::security_profiles].
22153 ///
22154 /// # Example
22155 /// ```ignore,no_run
22156 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22157 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22158 /// let x = ListSecurityProfilesResponse::new()
22159 /// .set_security_profiles([
22160 /// SecurityProfile::default()/* use setters */,
22161 /// SecurityProfile::default()/* use (different) setters */,
22162 /// ]);
22163 /// ```
22164 pub fn set_security_profiles<T, V>(mut self, v: T) -> Self
22165 where
22166 T: std::iter::IntoIterator<Item = V>,
22167 V: std::convert::Into<crate::model::SecurityProfile>,
22168 {
22169 use std::iter::Iterator;
22170 self.security_profiles = v.into_iter().map(|i| i.into()).collect();
22171 self
22172 }
22173
22174 /// Sets the value of [next_page_token][crate::model::ListSecurityProfilesResponse::next_page_token].
22175 ///
22176 /// # Example
22177 /// ```ignore,no_run
22178 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22179 /// let x = ListSecurityProfilesResponse::new().set_next_page_token("example");
22180 /// ```
22181 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22182 self.next_page_token = v.into();
22183 self
22184 }
22185}
22186
22187impl wkt::message::Message for ListSecurityProfilesResponse {
22188 fn typename() -> &'static str {
22189 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesResponse"
22190 }
22191}
22192
22193#[doc(hidden)]
22194impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfilesResponse {
22195 type PageItem = crate::model::SecurityProfile;
22196
22197 fn items(self) -> std::vec::Vec<Self::PageItem> {
22198 self.security_profiles
22199 }
22200
22201 fn next_page_token(&self) -> std::string::String {
22202 use std::clone::Clone;
22203 self.next_page_token.clone()
22204 }
22205}
22206
22207/// Request used by the GetSecurityProfile method.
22208#[derive(Clone, Default, PartialEq)]
22209#[non_exhaustive]
22210pub struct GetSecurityProfileRequest {
22211 /// Required. A name of the SecurityProfile to get. Must be in the format
22212 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22213 pub name: std::string::String,
22214
22215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22216}
22217
22218impl GetSecurityProfileRequest {
22219 /// Creates a new default instance.
22220 pub fn new() -> Self {
22221 std::default::Default::default()
22222 }
22223
22224 /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
22225 ///
22226 /// # Example
22227 /// ```ignore,no_run
22228 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileRequest;
22229 /// let x = GetSecurityProfileRequest::new().set_name("example");
22230 /// ```
22231 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22232 self.name = v.into();
22233 self
22234 }
22235}
22236
22237impl wkt::message::Message for GetSecurityProfileRequest {
22238 fn typename() -> &'static str {
22239 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileRequest"
22240 }
22241}
22242
22243/// Request used by the CreateSecurityProfile method.
22244#[derive(Clone, Default, PartialEq)]
22245#[non_exhaustive]
22246pub struct CreateSecurityProfileRequest {
22247 /// Required. The parent resource of the SecurityProfile. Must be in the format
22248 /// `projects|organizations/*/locations/{location}`.
22249 pub parent: std::string::String,
22250
22251 /// Required. Short name of the SecurityProfile resource to be created. This
22252 /// value should be 1-63 characters long, containing only letters, numbers,
22253 /// hyphens, and underscores, and should not start with a number. E.g.
22254 /// "security_profile1".
22255 pub security_profile_id: std::string::String,
22256
22257 /// Required. SecurityProfile resource to be created.
22258 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22259
22260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22261}
22262
22263impl CreateSecurityProfileRequest {
22264 /// Creates a new default instance.
22265 pub fn new() -> Self {
22266 std::default::Default::default()
22267 }
22268
22269 /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
22270 ///
22271 /// # Example
22272 /// ```ignore,no_run
22273 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22274 /// let x = CreateSecurityProfileRequest::new().set_parent("example");
22275 /// ```
22276 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22277 self.parent = v.into();
22278 self
22279 }
22280
22281 /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
22282 ///
22283 /// # Example
22284 /// ```ignore,no_run
22285 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22286 /// let x = CreateSecurityProfileRequest::new().set_security_profile_id("example");
22287 /// ```
22288 pub fn set_security_profile_id<T: std::convert::Into<std::string::String>>(
22289 mut self,
22290 v: T,
22291 ) -> Self {
22292 self.security_profile_id = v.into();
22293 self
22294 }
22295
22296 /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22297 ///
22298 /// # Example
22299 /// ```ignore,no_run
22300 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22301 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22302 /// let x = CreateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22303 /// ```
22304 pub fn set_security_profile<T>(mut self, v: T) -> Self
22305 where
22306 T: std::convert::Into<crate::model::SecurityProfile>,
22307 {
22308 self.security_profile = std::option::Option::Some(v.into());
22309 self
22310 }
22311
22312 /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22313 ///
22314 /// # Example
22315 /// ```ignore,no_run
22316 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22317 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22318 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22319 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22320 /// ```
22321 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22322 where
22323 T: std::convert::Into<crate::model::SecurityProfile>,
22324 {
22325 self.security_profile = v.map(|x| x.into());
22326 self
22327 }
22328}
22329
22330impl wkt::message::Message for CreateSecurityProfileRequest {
22331 fn typename() -> &'static str {
22332 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileRequest"
22333 }
22334}
22335
22336/// Request used by the UpdateSecurityProfile method.
22337#[derive(Clone, Default, PartialEq)]
22338#[non_exhaustive]
22339pub struct UpdateSecurityProfileRequest {
22340 /// Required. Field mask is used to specify the fields to be overwritten in the
22341 /// SecurityProfile resource by the update.
22342 /// The fields specified in the update_mask are relative to the resource, not
22343 /// the full request. A field will be overwritten if it is in the mask.
22344 pub update_mask: std::option::Option<wkt::FieldMask>,
22345
22346 /// Required. Updated SecurityProfile resource.
22347 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22348
22349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22350}
22351
22352impl UpdateSecurityProfileRequest {
22353 /// Creates a new default instance.
22354 pub fn new() -> Self {
22355 std::default::Default::default()
22356 }
22357
22358 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22359 ///
22360 /// # Example
22361 /// ```ignore,no_run
22362 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22363 /// use wkt::FieldMask;
22364 /// let x = UpdateSecurityProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22365 /// ```
22366 pub fn set_update_mask<T>(mut self, v: T) -> Self
22367 where
22368 T: std::convert::Into<wkt::FieldMask>,
22369 {
22370 self.update_mask = std::option::Option::Some(v.into());
22371 self
22372 }
22373
22374 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22375 ///
22376 /// # Example
22377 /// ```ignore,no_run
22378 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22379 /// use wkt::FieldMask;
22380 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22381 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22382 /// ```
22383 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22384 where
22385 T: std::convert::Into<wkt::FieldMask>,
22386 {
22387 self.update_mask = v.map(|x| x.into());
22388 self
22389 }
22390
22391 /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22392 ///
22393 /// # Example
22394 /// ```ignore,no_run
22395 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22396 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22397 /// let x = UpdateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22398 /// ```
22399 pub fn set_security_profile<T>(mut self, v: T) -> Self
22400 where
22401 T: std::convert::Into<crate::model::SecurityProfile>,
22402 {
22403 self.security_profile = std::option::Option::Some(v.into());
22404 self
22405 }
22406
22407 /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22408 ///
22409 /// # Example
22410 /// ```ignore,no_run
22411 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22412 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22413 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22414 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22415 /// ```
22416 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22417 where
22418 T: std::convert::Into<crate::model::SecurityProfile>,
22419 {
22420 self.security_profile = v.map(|x| x.into());
22421 self
22422 }
22423}
22424
22425impl wkt::message::Message for UpdateSecurityProfileRequest {
22426 fn typename() -> &'static str {
22427 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileRequest"
22428 }
22429}
22430
22431/// Request used by the DeleteSecurityProfile method.
22432#[derive(Clone, Default, PartialEq)]
22433#[non_exhaustive]
22434pub struct DeleteSecurityProfileRequest {
22435 /// Required. A name of the SecurityProfile to delete. Must be in the format
22436 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22437 pub name: std::string::String,
22438
22439 /// Optional. If client provided etag is out of date, delete will return
22440 /// FAILED_PRECONDITION error.
22441 pub etag: std::string::String,
22442
22443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22444}
22445
22446impl DeleteSecurityProfileRequest {
22447 /// Creates a new default instance.
22448 pub fn new() -> Self {
22449 std::default::Default::default()
22450 }
22451
22452 /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
22453 ///
22454 /// # Example
22455 /// ```ignore,no_run
22456 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22457 /// let x = DeleteSecurityProfileRequest::new().set_name("example");
22458 /// ```
22459 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22460 self.name = v.into();
22461 self
22462 }
22463
22464 /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
22465 ///
22466 /// # Example
22467 /// ```ignore,no_run
22468 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22469 /// let x = DeleteSecurityProfileRequest::new().set_etag("example");
22470 /// ```
22471 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22472 self.etag = v.into();
22473 self
22474 }
22475}
22476
22477impl wkt::message::Message for DeleteSecurityProfileRequest {
22478 fn typename() -> &'static str {
22479 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileRequest"
22480 }
22481}
22482
22483/// ThreatPreventionProfile defines an action for specific threat signatures or
22484/// severity levels.
22485#[derive(Clone, Default, PartialEq)]
22486#[non_exhaustive]
22487pub struct ThreatPreventionProfile {
22488 /// Optional. Configuration for overriding threats actions by severity match.
22489 pub severity_overrides: std::vec::Vec<crate::model::SeverityOverride>,
22490
22491 /// Optional. Configuration for overriding threats actions by threat_id match.
22492 /// If a threat is matched both by configuration provided in severity_overrides
22493 /// and threat_overrides, the threat_overrides action is applied.
22494 pub threat_overrides: std::vec::Vec<crate::model::ThreatOverride>,
22495
22496 /// Optional. Configuration for overriding antivirus actions per protocol.
22497 pub antivirus_overrides: std::vec::Vec<crate::model::AntivirusOverride>,
22498
22499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22500}
22501
22502impl ThreatPreventionProfile {
22503 /// Creates a new default instance.
22504 pub fn new() -> Self {
22505 std::default::Default::default()
22506 }
22507
22508 /// Sets the value of [severity_overrides][crate::model::ThreatPreventionProfile::severity_overrides].
22509 ///
22510 /// # Example
22511 /// ```ignore,no_run
22512 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22513 /// use google_cloud_networksecurity_v1::model::SeverityOverride;
22514 /// let x = ThreatPreventionProfile::new()
22515 /// .set_severity_overrides([
22516 /// SeverityOverride::default()/* use setters */,
22517 /// SeverityOverride::default()/* use (different) setters */,
22518 /// ]);
22519 /// ```
22520 pub fn set_severity_overrides<T, V>(mut self, v: T) -> Self
22521 where
22522 T: std::iter::IntoIterator<Item = V>,
22523 V: std::convert::Into<crate::model::SeverityOverride>,
22524 {
22525 use std::iter::Iterator;
22526 self.severity_overrides = v.into_iter().map(|i| i.into()).collect();
22527 self
22528 }
22529
22530 /// Sets the value of [threat_overrides][crate::model::ThreatPreventionProfile::threat_overrides].
22531 ///
22532 /// # Example
22533 /// ```ignore,no_run
22534 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22535 /// use google_cloud_networksecurity_v1::model::ThreatOverride;
22536 /// let x = ThreatPreventionProfile::new()
22537 /// .set_threat_overrides([
22538 /// ThreatOverride::default()/* use setters */,
22539 /// ThreatOverride::default()/* use (different) setters */,
22540 /// ]);
22541 /// ```
22542 pub fn set_threat_overrides<T, V>(mut self, v: T) -> Self
22543 where
22544 T: std::iter::IntoIterator<Item = V>,
22545 V: std::convert::Into<crate::model::ThreatOverride>,
22546 {
22547 use std::iter::Iterator;
22548 self.threat_overrides = v.into_iter().map(|i| i.into()).collect();
22549 self
22550 }
22551
22552 /// Sets the value of [antivirus_overrides][crate::model::ThreatPreventionProfile::antivirus_overrides].
22553 ///
22554 /// # Example
22555 /// ```ignore,no_run
22556 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22557 /// use google_cloud_networksecurity_v1::model::AntivirusOverride;
22558 /// let x = ThreatPreventionProfile::new()
22559 /// .set_antivirus_overrides([
22560 /// AntivirusOverride::default()/* use setters */,
22561 /// AntivirusOverride::default()/* use (different) setters */,
22562 /// ]);
22563 /// ```
22564 pub fn set_antivirus_overrides<T, V>(mut self, v: T) -> Self
22565 where
22566 T: std::iter::IntoIterator<Item = V>,
22567 V: std::convert::Into<crate::model::AntivirusOverride>,
22568 {
22569 use std::iter::Iterator;
22570 self.antivirus_overrides = v.into_iter().map(|i| i.into()).collect();
22571 self
22572 }
22573}
22574
22575impl wkt::message::Message for ThreatPreventionProfile {
22576 fn typename() -> &'static str {
22577 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatPreventionProfile"
22578 }
22579}
22580
22581/// Defines what action to take for a specific severity match.
22582#[derive(Clone, Default, PartialEq)]
22583#[non_exhaustive]
22584pub struct SeverityOverride {
22585 /// Required. Severity level to match.
22586 pub severity: crate::model::Severity,
22587
22588 /// Required. Threat action override.
22589 pub action: crate::model::ThreatAction,
22590
22591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22592}
22593
22594impl SeverityOverride {
22595 /// Creates a new default instance.
22596 pub fn new() -> Self {
22597 std::default::Default::default()
22598 }
22599
22600 /// Sets the value of [severity][crate::model::SeverityOverride::severity].
22601 ///
22602 /// # Example
22603 /// ```ignore,no_run
22604 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
22605 /// use google_cloud_networksecurity_v1::model::Severity;
22606 /// let x0 = SeverityOverride::new().set_severity(Severity::Informational);
22607 /// let x1 = SeverityOverride::new().set_severity(Severity::Low);
22608 /// let x2 = SeverityOverride::new().set_severity(Severity::Medium);
22609 /// ```
22610 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
22611 self.severity = v.into();
22612 self
22613 }
22614
22615 /// Sets the value of [action][crate::model::SeverityOverride::action].
22616 ///
22617 /// # Example
22618 /// ```ignore,no_run
22619 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
22620 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22621 /// let x0 = SeverityOverride::new().set_action(ThreatAction::DefaultAction);
22622 /// let x1 = SeverityOverride::new().set_action(ThreatAction::Allow);
22623 /// let x2 = SeverityOverride::new().set_action(ThreatAction::Alert);
22624 /// ```
22625 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22626 self.action = v.into();
22627 self
22628 }
22629}
22630
22631impl wkt::message::Message for SeverityOverride {
22632 fn typename() -> &'static str {
22633 "type.googleapis.com/google.cloud.networksecurity.v1.SeverityOverride"
22634 }
22635}
22636
22637/// Defines what action to take for a specific threat_id match.
22638#[derive(Clone, Default, PartialEq)]
22639#[non_exhaustive]
22640pub struct ThreatOverride {
22641 /// Required. Vendor-specific ID of a threat to override.
22642 pub threat_id: std::string::String,
22643
22644 /// Output only. Type of the threat (read only).
22645 pub r#type: crate::model::ThreatType,
22646
22647 /// Required. Threat action override. For some threat types, only a subset of
22648 /// actions applies.
22649 pub action: crate::model::ThreatAction,
22650
22651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22652}
22653
22654impl ThreatOverride {
22655 /// Creates a new default instance.
22656 pub fn new() -> Self {
22657 std::default::Default::default()
22658 }
22659
22660 /// Sets the value of [threat_id][crate::model::ThreatOverride::threat_id].
22661 ///
22662 /// # Example
22663 /// ```ignore,no_run
22664 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22665 /// let x = ThreatOverride::new().set_threat_id("example");
22666 /// ```
22667 pub fn set_threat_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22668 self.threat_id = v.into();
22669 self
22670 }
22671
22672 /// Sets the value of [r#type][crate::model::ThreatOverride::type].
22673 ///
22674 /// # Example
22675 /// ```ignore,no_run
22676 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22677 /// use google_cloud_networksecurity_v1::model::ThreatType;
22678 /// let x0 = ThreatOverride::new().set_type(ThreatType::Unknown);
22679 /// let x1 = ThreatOverride::new().set_type(ThreatType::Vulnerability);
22680 /// let x2 = ThreatOverride::new().set_type(ThreatType::Antivirus);
22681 /// ```
22682 pub fn set_type<T: std::convert::Into<crate::model::ThreatType>>(mut self, v: T) -> Self {
22683 self.r#type = v.into();
22684 self
22685 }
22686
22687 /// Sets the value of [action][crate::model::ThreatOverride::action].
22688 ///
22689 /// # Example
22690 /// ```ignore,no_run
22691 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22692 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22693 /// let x0 = ThreatOverride::new().set_action(ThreatAction::DefaultAction);
22694 /// let x1 = ThreatOverride::new().set_action(ThreatAction::Allow);
22695 /// let x2 = ThreatOverride::new().set_action(ThreatAction::Alert);
22696 /// ```
22697 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22698 self.action = v.into();
22699 self
22700 }
22701}
22702
22703impl wkt::message::Message for ThreatOverride {
22704 fn typename() -> &'static str {
22705 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatOverride"
22706 }
22707}
22708
22709/// Defines what action to take for antivirus threats per protocol.
22710#[derive(Clone, Default, PartialEq)]
22711#[non_exhaustive]
22712pub struct AntivirusOverride {
22713 /// Required. Protocol to match.
22714 pub protocol: crate::model::Protocol,
22715
22716 /// Required. Threat action override. For some threat types, only a subset of
22717 /// actions applies.
22718 pub action: crate::model::ThreatAction,
22719
22720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22721}
22722
22723impl AntivirusOverride {
22724 /// Creates a new default instance.
22725 pub fn new() -> Self {
22726 std::default::Default::default()
22727 }
22728
22729 /// Sets the value of [protocol][crate::model::AntivirusOverride::protocol].
22730 ///
22731 /// # Example
22732 /// ```ignore,no_run
22733 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
22734 /// use google_cloud_networksecurity_v1::model::Protocol;
22735 /// let x0 = AntivirusOverride::new().set_protocol(Protocol::Smtp);
22736 /// let x1 = AntivirusOverride::new().set_protocol(Protocol::Smb);
22737 /// let x2 = AntivirusOverride::new().set_protocol(Protocol::Pop3);
22738 /// ```
22739 pub fn set_protocol<T: std::convert::Into<crate::model::Protocol>>(mut self, v: T) -> Self {
22740 self.protocol = v.into();
22741 self
22742 }
22743
22744 /// Sets the value of [action][crate::model::AntivirusOverride::action].
22745 ///
22746 /// # Example
22747 /// ```ignore,no_run
22748 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
22749 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22750 /// let x0 = AntivirusOverride::new().set_action(ThreatAction::DefaultAction);
22751 /// let x1 = AntivirusOverride::new().set_action(ThreatAction::Allow);
22752 /// let x2 = AntivirusOverride::new().set_action(ThreatAction::Alert);
22753 /// ```
22754 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22755 self.action = v.into();
22756 self
22757 }
22758}
22759
22760impl wkt::message::Message for AntivirusOverride {
22761 fn typename() -> &'static str {
22762 "type.googleapis.com/google.cloud.networksecurity.v1.AntivirusOverride"
22763 }
22764}
22765
22766/// UrlFilteringProfile defines filters based on URL.
22767#[derive(Clone, Default, PartialEq)]
22768#[non_exhaustive]
22769pub struct UrlFilteringProfile {
22770 /// Optional. The list of filtering configs in which each config defines an
22771 /// action to take for some URL match.
22772 pub url_filters: std::vec::Vec<crate::model::UrlFilter>,
22773
22774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22775}
22776
22777impl UrlFilteringProfile {
22778 /// Creates a new default instance.
22779 pub fn new() -> Self {
22780 std::default::Default::default()
22781 }
22782
22783 /// Sets the value of [url_filters][crate::model::UrlFilteringProfile::url_filters].
22784 ///
22785 /// # Example
22786 /// ```ignore,no_run
22787 /// # use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
22788 /// use google_cloud_networksecurity_v1::model::UrlFilter;
22789 /// let x = UrlFilteringProfile::new()
22790 /// .set_url_filters([
22791 /// UrlFilter::default()/* use setters */,
22792 /// UrlFilter::default()/* use (different) setters */,
22793 /// ]);
22794 /// ```
22795 pub fn set_url_filters<T, V>(mut self, v: T) -> Self
22796 where
22797 T: std::iter::IntoIterator<Item = V>,
22798 V: std::convert::Into<crate::model::UrlFilter>,
22799 {
22800 use std::iter::Iterator;
22801 self.url_filters = v.into_iter().map(|i| i.into()).collect();
22802 self
22803 }
22804}
22805
22806impl wkt::message::Message for UrlFilteringProfile {
22807 fn typename() -> &'static str {
22808 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilteringProfile"
22809 }
22810}
22811
22812/// A URL filter defines an action to take for some URL match.
22813#[derive(Clone, Default, PartialEq)]
22814#[non_exhaustive]
22815pub struct UrlFilter {
22816 /// Required. The action taken when this filter is applied.
22817 pub filtering_action: crate::model::url_filter::UrlFilteringAction,
22818
22819 /// Required. The list of strings that a URL must match with for this filter to
22820 /// be applied.
22821 pub urls: std::vec::Vec<std::string::String>,
22822
22823 /// Required. The priority of this filter within the URL Filtering Profile.
22824 /// Lower integers indicate higher priorities. The priority of a filter must be
22825 /// unique within a URL Filtering Profile.
22826 pub priority: std::option::Option<i32>,
22827
22828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22829}
22830
22831impl UrlFilter {
22832 /// Creates a new default instance.
22833 pub fn new() -> Self {
22834 std::default::Default::default()
22835 }
22836
22837 /// Sets the value of [filtering_action][crate::model::UrlFilter::filtering_action].
22838 ///
22839 /// # Example
22840 /// ```ignore,no_run
22841 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22842 /// use google_cloud_networksecurity_v1::model::url_filter::UrlFilteringAction;
22843 /// let x0 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Allow);
22844 /// let x1 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Deny);
22845 /// ```
22846 pub fn set_filtering_action<
22847 T: std::convert::Into<crate::model::url_filter::UrlFilteringAction>,
22848 >(
22849 mut self,
22850 v: T,
22851 ) -> Self {
22852 self.filtering_action = v.into();
22853 self
22854 }
22855
22856 /// Sets the value of [urls][crate::model::UrlFilter::urls].
22857 ///
22858 /// # Example
22859 /// ```ignore,no_run
22860 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22861 /// let x = UrlFilter::new().set_urls(["a", "b", "c"]);
22862 /// ```
22863 pub fn set_urls<T, V>(mut self, v: T) -> Self
22864 where
22865 T: std::iter::IntoIterator<Item = V>,
22866 V: std::convert::Into<std::string::String>,
22867 {
22868 use std::iter::Iterator;
22869 self.urls = v.into_iter().map(|i| i.into()).collect();
22870 self
22871 }
22872
22873 /// Sets the value of [priority][crate::model::UrlFilter::priority].
22874 ///
22875 /// # Example
22876 /// ```ignore,no_run
22877 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22878 /// let x = UrlFilter::new().set_priority(42);
22879 /// ```
22880 pub fn set_priority<T>(mut self, v: T) -> Self
22881 where
22882 T: std::convert::Into<i32>,
22883 {
22884 self.priority = std::option::Option::Some(v.into());
22885 self
22886 }
22887
22888 /// Sets or clears the value of [priority][crate::model::UrlFilter::priority].
22889 ///
22890 /// # Example
22891 /// ```ignore,no_run
22892 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22893 /// let x = UrlFilter::new().set_or_clear_priority(Some(42));
22894 /// let x = UrlFilter::new().set_or_clear_priority(None::<i32>);
22895 /// ```
22896 pub fn set_or_clear_priority<T>(mut self, v: std::option::Option<T>) -> Self
22897 where
22898 T: std::convert::Into<i32>,
22899 {
22900 self.priority = v.map(|x| x.into());
22901 self
22902 }
22903}
22904
22905impl wkt::message::Message for UrlFilter {
22906 fn typename() -> &'static str {
22907 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilter"
22908 }
22909}
22910
22911/// Defines additional types related to [UrlFilter].
22912pub mod url_filter {
22913 #[allow(unused_imports)]
22914 use super::*;
22915
22916 /// Action to be taken when a URL matches a filter.
22917 ///
22918 /// # Working with unknown values
22919 ///
22920 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22921 /// additional enum variants at any time. Adding new variants is not considered
22922 /// a breaking change. Applications should write their code in anticipation of:
22923 ///
22924 /// - New values appearing in future releases of the client library, **and**
22925 /// - New values received dynamically, without application changes.
22926 ///
22927 /// Please consult the [Working with enums] section in the user guide for some
22928 /// guidelines.
22929 ///
22930 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22931 #[derive(Clone, Debug, PartialEq)]
22932 #[non_exhaustive]
22933 pub enum UrlFilteringAction {
22934 /// Filtering action not specified.
22935 Unspecified,
22936 /// The connection matching this filter will be allowed to transmit.
22937 Allow,
22938 /// The connection matching this filter will be dropped.
22939 Deny,
22940 /// If set, the enum was initialized with an unknown value.
22941 ///
22942 /// Applications can examine the value using [UrlFilteringAction::value] or
22943 /// [UrlFilteringAction::name].
22944 UnknownValue(url_filtering_action::UnknownValue),
22945 }
22946
22947 #[doc(hidden)]
22948 pub mod url_filtering_action {
22949 #[allow(unused_imports)]
22950 use super::*;
22951 #[derive(Clone, Debug, PartialEq)]
22952 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22953 }
22954
22955 impl UrlFilteringAction {
22956 /// Gets the enum value.
22957 ///
22958 /// Returns `None` if the enum contains an unknown value deserialized from
22959 /// the string representation of enums.
22960 pub fn value(&self) -> std::option::Option<i32> {
22961 match self {
22962 Self::Unspecified => std::option::Option::Some(0),
22963 Self::Allow => std::option::Option::Some(1),
22964 Self::Deny => std::option::Option::Some(2),
22965 Self::UnknownValue(u) => u.0.value(),
22966 }
22967 }
22968
22969 /// Gets the enum value as a string.
22970 ///
22971 /// Returns `None` if the enum contains an unknown value deserialized from
22972 /// the integer representation of enums.
22973 pub fn name(&self) -> std::option::Option<&str> {
22974 match self {
22975 Self::Unspecified => std::option::Option::Some("URL_FILTERING_ACTION_UNSPECIFIED"),
22976 Self::Allow => std::option::Option::Some("ALLOW"),
22977 Self::Deny => std::option::Option::Some("DENY"),
22978 Self::UnknownValue(u) => u.0.name(),
22979 }
22980 }
22981 }
22982
22983 impl std::default::Default for UrlFilteringAction {
22984 fn default() -> Self {
22985 use std::convert::From;
22986 Self::from(0)
22987 }
22988 }
22989
22990 impl std::fmt::Display for UrlFilteringAction {
22991 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22992 wkt::internal::display_enum(f, self.name(), self.value())
22993 }
22994 }
22995
22996 impl std::convert::From<i32> for UrlFilteringAction {
22997 fn from(value: i32) -> Self {
22998 match value {
22999 0 => Self::Unspecified,
23000 1 => Self::Allow,
23001 2 => Self::Deny,
23002 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23003 wkt::internal::UnknownEnumValue::Integer(value),
23004 )),
23005 }
23006 }
23007 }
23008
23009 impl std::convert::From<&str> for UrlFilteringAction {
23010 fn from(value: &str) -> Self {
23011 use std::string::ToString;
23012 match value {
23013 "URL_FILTERING_ACTION_UNSPECIFIED" => Self::Unspecified,
23014 "ALLOW" => Self::Allow,
23015 "DENY" => Self::Deny,
23016 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23017 wkt::internal::UnknownEnumValue::String(value.to_string()),
23018 )),
23019 }
23020 }
23021 }
23022
23023 impl serde::ser::Serialize for UrlFilteringAction {
23024 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23025 where
23026 S: serde::Serializer,
23027 {
23028 match self {
23029 Self::Unspecified => serializer.serialize_i32(0),
23030 Self::Allow => serializer.serialize_i32(1),
23031 Self::Deny => serializer.serialize_i32(2),
23032 Self::UnknownValue(u) => u.0.serialize(serializer),
23033 }
23034 }
23035 }
23036
23037 impl<'de> serde::de::Deserialize<'de> for UrlFilteringAction {
23038 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23039 where
23040 D: serde::Deserializer<'de>,
23041 {
23042 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UrlFilteringAction>::new(
23043 ".google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction",
23044 ))
23045 }
23046 }
23047}
23048
23049/// ServerTlsPolicy is a resource that specifies how a server should authenticate
23050/// incoming requests. This resource itself does not affect configuration unless
23051/// it is attached to a target HTTPS proxy or endpoint config selector resource.
23052///
23053/// ServerTlsPolicy in the form accepted by Application Load Balancers can
23054/// be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED`
23055/// or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible
23056/// ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with
23057/// Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme.
23058#[derive(Clone, Default, PartialEq)]
23059#[non_exhaustive]
23060pub struct ServerTlsPolicy {
23061 /// Required. Name of the ServerTlsPolicy resource. It matches the pattern
23062 /// `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
23063 pub name: std::string::String,
23064
23065 /// Free-text description of the resource.
23066 pub description: std::string::String,
23067
23068 /// Output only. The timestamp when the resource was created.
23069 pub create_time: std::option::Option<wkt::Timestamp>,
23070
23071 /// Output only. The timestamp when the resource was updated.
23072 pub update_time: std::option::Option<wkt::Timestamp>,
23073
23074 /// Set of label tags associated with the resource.
23075 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
23076
23077 /// This field applies only for Traffic Director policies. It is must be set to
23078 /// false for Application Load Balancer policies.
23079 ///
23080 /// Determines if server allows plaintext connections. If set to true, server
23081 /// allows plain text connections. By default, it is set to false. This setting
23082 /// is not exclusive of other encryption modes. For example, if `allow_open`
23083 /// and `mtls_policy` are set, server allows both plain text and mTLS
23084 /// connections. See documentation of other encryption modes to confirm
23085 /// compatibility.
23086 ///
23087 /// Consider using it if you wish to upgrade in place your deployment to TLS
23088 /// while having mixed TLS and non-TLS traffic reaching port :80.
23089 pub allow_open: bool,
23090
23091 /// Optional if policy is to be used with Traffic Director. For Application
23092 /// Load Balancers must be empty.
23093 ///
23094 /// Defines a mechanism to provision server identity (public and private keys).
23095 /// Cannot be combined with `allow_open` as a permissive mode that allows both
23096 /// plain text and TLS is not supported.
23097 pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
23098
23099 /// This field is required if the policy is used with Application Load
23100 /// Balancers. This field can be empty for Traffic Director.
23101 ///
23102 /// Defines a mechanism to provision peer validation certificates for peer to
23103 /// peer authentication (Mutual TLS - mTLS). If not specified, client
23104 /// certificate will not be requested. The connection is treated as TLS and not
23105 /// mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
23106 /// text and mTLS connections.
23107 pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
23108
23109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23110}
23111
23112impl ServerTlsPolicy {
23113 /// Creates a new default instance.
23114 pub fn new() -> Self {
23115 std::default::Default::default()
23116 }
23117
23118 /// Sets the value of [name][crate::model::ServerTlsPolicy::name].
23119 ///
23120 /// # Example
23121 /// ```ignore,no_run
23122 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23123 /// let x = ServerTlsPolicy::new().set_name("example");
23124 /// ```
23125 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23126 self.name = v.into();
23127 self
23128 }
23129
23130 /// Sets the value of [description][crate::model::ServerTlsPolicy::description].
23131 ///
23132 /// # Example
23133 /// ```ignore,no_run
23134 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23135 /// let x = ServerTlsPolicy::new().set_description("example");
23136 /// ```
23137 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23138 self.description = v.into();
23139 self
23140 }
23141
23142 /// Sets the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23143 ///
23144 /// # Example
23145 /// ```ignore,no_run
23146 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23147 /// use wkt::Timestamp;
23148 /// let x = ServerTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
23149 /// ```
23150 pub fn set_create_time<T>(mut self, v: T) -> Self
23151 where
23152 T: std::convert::Into<wkt::Timestamp>,
23153 {
23154 self.create_time = std::option::Option::Some(v.into());
23155 self
23156 }
23157
23158 /// Sets or clears the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23159 ///
23160 /// # Example
23161 /// ```ignore,no_run
23162 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23163 /// use wkt::Timestamp;
23164 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
23165 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
23166 /// ```
23167 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
23168 where
23169 T: std::convert::Into<wkt::Timestamp>,
23170 {
23171 self.create_time = v.map(|x| x.into());
23172 self
23173 }
23174
23175 /// Sets the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23176 ///
23177 /// # Example
23178 /// ```ignore,no_run
23179 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23180 /// use wkt::Timestamp;
23181 /// let x = ServerTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
23182 /// ```
23183 pub fn set_update_time<T>(mut self, v: T) -> Self
23184 where
23185 T: std::convert::Into<wkt::Timestamp>,
23186 {
23187 self.update_time = std::option::Option::Some(v.into());
23188 self
23189 }
23190
23191 /// Sets or clears the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23192 ///
23193 /// # Example
23194 /// ```ignore,no_run
23195 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23196 /// use wkt::Timestamp;
23197 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
23198 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
23199 /// ```
23200 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
23201 where
23202 T: std::convert::Into<wkt::Timestamp>,
23203 {
23204 self.update_time = v.map(|x| x.into());
23205 self
23206 }
23207
23208 /// Sets the value of [labels][crate::model::ServerTlsPolicy::labels].
23209 ///
23210 /// # Example
23211 /// ```ignore,no_run
23212 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23213 /// let x = ServerTlsPolicy::new().set_labels([
23214 /// ("key0", "abc"),
23215 /// ("key1", "xyz"),
23216 /// ]);
23217 /// ```
23218 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
23219 where
23220 T: std::iter::IntoIterator<Item = (K, V)>,
23221 K: std::convert::Into<std::string::String>,
23222 V: std::convert::Into<std::string::String>,
23223 {
23224 use std::iter::Iterator;
23225 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
23226 self
23227 }
23228
23229 /// Sets the value of [allow_open][crate::model::ServerTlsPolicy::allow_open].
23230 ///
23231 /// # Example
23232 /// ```ignore,no_run
23233 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23234 /// let x = ServerTlsPolicy::new().set_allow_open(true);
23235 /// ```
23236 pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23237 self.allow_open = v.into();
23238 self
23239 }
23240
23241 /// Sets the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23242 ///
23243 /// # Example
23244 /// ```ignore,no_run
23245 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23246 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23247 /// let x = ServerTlsPolicy::new().set_server_certificate(CertificateProvider::default()/* use setters */);
23248 /// ```
23249 pub fn set_server_certificate<T>(mut self, v: T) -> Self
23250 where
23251 T: std::convert::Into<crate::model::CertificateProvider>,
23252 {
23253 self.server_certificate = std::option::Option::Some(v.into());
23254 self
23255 }
23256
23257 /// Sets or clears the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23258 ///
23259 /// # Example
23260 /// ```ignore,no_run
23261 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23262 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23263 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(Some(CertificateProvider::default()/* use setters */));
23264 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(None::<CertificateProvider>);
23265 /// ```
23266 pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23267 where
23268 T: std::convert::Into<crate::model::CertificateProvider>,
23269 {
23270 self.server_certificate = v.map(|x| x.into());
23271 self
23272 }
23273
23274 /// Sets the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23275 ///
23276 /// # Example
23277 /// ```ignore,no_run
23278 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23279 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23280 /// let x = ServerTlsPolicy::new().set_mtls_policy(MTLSPolicy::default()/* use setters */);
23281 /// ```
23282 pub fn set_mtls_policy<T>(mut self, v: T) -> Self
23283 where
23284 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23285 {
23286 self.mtls_policy = std::option::Option::Some(v.into());
23287 self
23288 }
23289
23290 /// Sets or clears the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23291 ///
23292 /// # Example
23293 /// ```ignore,no_run
23294 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23295 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23296 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(Some(MTLSPolicy::default()/* use setters */));
23297 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(None::<MTLSPolicy>);
23298 /// ```
23299 pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23300 where
23301 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23302 {
23303 self.mtls_policy = v.map(|x| x.into());
23304 self
23305 }
23306}
23307
23308impl wkt::message::Message for ServerTlsPolicy {
23309 fn typename() -> &'static str {
23310 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
23311 }
23312}
23313
23314/// Defines additional types related to [ServerTlsPolicy].
23315pub mod server_tls_policy {
23316 #[allow(unused_imports)]
23317 use super::*;
23318
23319 /// Specification of the MTLSPolicy.
23320 #[derive(Clone, Default, PartialEq)]
23321 #[non_exhaustive]
23322 pub struct MTLSPolicy {
23323 /// When the client presents an invalid certificate or no certificate to the
23324 /// load balancer, the `client_validation_mode` specifies how the client
23325 /// connection is handled.
23326 ///
23327 /// Required if the policy is to be used with the Application Load
23328 /// Balancers. For Traffic Director it must be empty.
23329 pub client_validation_mode:
23330 crate::model::server_tls_policy::mtls_policy::ClientValidationMode,
23331
23332 /// Required if the policy is to be used with Traffic Director. For
23333 /// Application Load Balancers it must be empty.
23334 ///
23335 /// Defines the mechanism to obtain the Certificate Authority certificate to
23336 /// validate the client certificate.
23337 pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
23338
23339 /// Reference to the TrustConfig from certificatemanager.googleapis.com
23340 /// namespace.
23341 ///
23342 /// If specified, the chain validation will be performed against certificates
23343 /// configured in the given TrustConfig.
23344 ///
23345 /// Allowed only if the policy is to be used with Application Load
23346 /// Balancers.
23347 pub client_validation_trust_config: std::string::String,
23348
23349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23350 }
23351
23352 impl MTLSPolicy {
23353 /// Creates a new default instance.
23354 pub fn new() -> Self {
23355 std::default::Default::default()
23356 }
23357
23358 /// Sets the value of [client_validation_mode][crate::model::server_tls_policy::MTLSPolicy::client_validation_mode].
23359 ///
23360 /// # Example
23361 /// ```ignore,no_run
23362 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23363 /// use google_cloud_networksecurity_v1::model::server_tls_policy::mtls_policy::ClientValidationMode;
23364 /// let x0 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::AllowInvalidOrMissingClientCert);
23365 /// let x1 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::RejectInvalid);
23366 /// ```
23367 pub fn set_client_validation_mode<
23368 T: std::convert::Into<crate::model::server_tls_policy::mtls_policy::ClientValidationMode>,
23369 >(
23370 mut self,
23371 v: T,
23372 ) -> Self {
23373 self.client_validation_mode = v.into();
23374 self
23375 }
23376
23377 /// Sets the value of [client_validation_ca][crate::model::server_tls_policy::MTLSPolicy::client_validation_ca].
23378 ///
23379 /// # Example
23380 /// ```ignore,no_run
23381 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23382 /// use google_cloud_networksecurity_v1::model::ValidationCA;
23383 /// let x = MTLSPolicy::new()
23384 /// .set_client_validation_ca([
23385 /// ValidationCA::default()/* use setters */,
23386 /// ValidationCA::default()/* use (different) setters */,
23387 /// ]);
23388 /// ```
23389 pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
23390 where
23391 T: std::iter::IntoIterator<Item = V>,
23392 V: std::convert::Into<crate::model::ValidationCA>,
23393 {
23394 use std::iter::Iterator;
23395 self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
23396 self
23397 }
23398
23399 /// Sets the value of [client_validation_trust_config][crate::model::server_tls_policy::MTLSPolicy::client_validation_trust_config].
23400 ///
23401 /// # Example
23402 /// ```ignore,no_run
23403 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23404 /// let x = MTLSPolicy::new().set_client_validation_trust_config("example");
23405 /// ```
23406 pub fn set_client_validation_trust_config<T: std::convert::Into<std::string::String>>(
23407 mut self,
23408 v: T,
23409 ) -> Self {
23410 self.client_validation_trust_config = v.into();
23411 self
23412 }
23413 }
23414
23415 impl wkt::message::Message for MTLSPolicy {
23416 fn typename() -> &'static str {
23417 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
23418 }
23419 }
23420
23421 /// Defines additional types related to [MTLSPolicy].
23422 pub mod mtls_policy {
23423 #[allow(unused_imports)]
23424 use super::*;
23425
23426 /// Mutual TLS certificate validation mode.
23427 ///
23428 /// # Working with unknown values
23429 ///
23430 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23431 /// additional enum variants at any time. Adding new variants is not considered
23432 /// a breaking change. Applications should write their code in anticipation of:
23433 ///
23434 /// - New values appearing in future releases of the client library, **and**
23435 /// - New values received dynamically, without application changes.
23436 ///
23437 /// Please consult the [Working with enums] section in the user guide for some
23438 /// guidelines.
23439 ///
23440 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23441 #[derive(Clone, Debug, PartialEq)]
23442 #[non_exhaustive]
23443 pub enum ClientValidationMode {
23444 /// Not allowed.
23445 Unspecified,
23446 /// Allow connection even if certificate chain validation
23447 /// of the client certificate failed or no client certificate was
23448 /// presented. The proof of possession of the private key is always checked
23449 /// if client certificate was presented. This mode requires the backend to
23450 /// implement processing of data extracted from a client certificate to
23451 /// authenticate the peer, or to reject connections if the client
23452 /// certificate fingerprint is missing.
23453 AllowInvalidOrMissingClientCert,
23454 /// Require a client certificate and allow connection to the backend only
23455 /// if validation of the client certificate passed.
23456 ///
23457 /// If set, requires a reference to non-empty TrustConfig specified in
23458 /// `client_validation_trust_config`.
23459 RejectInvalid,
23460 /// If set, the enum was initialized with an unknown value.
23461 ///
23462 /// Applications can examine the value using [ClientValidationMode::value] or
23463 /// [ClientValidationMode::name].
23464 UnknownValue(client_validation_mode::UnknownValue),
23465 }
23466
23467 #[doc(hidden)]
23468 pub mod client_validation_mode {
23469 #[allow(unused_imports)]
23470 use super::*;
23471 #[derive(Clone, Debug, PartialEq)]
23472 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23473 }
23474
23475 impl ClientValidationMode {
23476 /// Gets the enum value.
23477 ///
23478 /// Returns `None` if the enum contains an unknown value deserialized from
23479 /// the string representation of enums.
23480 pub fn value(&self) -> std::option::Option<i32> {
23481 match self {
23482 Self::Unspecified => std::option::Option::Some(0),
23483 Self::AllowInvalidOrMissingClientCert => std::option::Option::Some(1),
23484 Self::RejectInvalid => std::option::Option::Some(2),
23485 Self::UnknownValue(u) => u.0.value(),
23486 }
23487 }
23488
23489 /// Gets the enum value as a string.
23490 ///
23491 /// Returns `None` if the enum contains an unknown value deserialized from
23492 /// the integer representation of enums.
23493 pub fn name(&self) -> std::option::Option<&str> {
23494 match self {
23495 Self::Unspecified => {
23496 std::option::Option::Some("CLIENT_VALIDATION_MODE_UNSPECIFIED")
23497 }
23498 Self::AllowInvalidOrMissingClientCert => {
23499 std::option::Option::Some("ALLOW_INVALID_OR_MISSING_CLIENT_CERT")
23500 }
23501 Self::RejectInvalid => std::option::Option::Some("REJECT_INVALID"),
23502 Self::UnknownValue(u) => u.0.name(),
23503 }
23504 }
23505 }
23506
23507 impl std::default::Default for ClientValidationMode {
23508 fn default() -> Self {
23509 use std::convert::From;
23510 Self::from(0)
23511 }
23512 }
23513
23514 impl std::fmt::Display for ClientValidationMode {
23515 fn fmt(
23516 &self,
23517 f: &mut std::fmt::Formatter<'_>,
23518 ) -> std::result::Result<(), std::fmt::Error> {
23519 wkt::internal::display_enum(f, self.name(), self.value())
23520 }
23521 }
23522
23523 impl std::convert::From<i32> for ClientValidationMode {
23524 fn from(value: i32) -> Self {
23525 match value {
23526 0 => Self::Unspecified,
23527 1 => Self::AllowInvalidOrMissingClientCert,
23528 2 => Self::RejectInvalid,
23529 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23530 wkt::internal::UnknownEnumValue::Integer(value),
23531 )),
23532 }
23533 }
23534 }
23535
23536 impl std::convert::From<&str> for ClientValidationMode {
23537 fn from(value: &str) -> Self {
23538 use std::string::ToString;
23539 match value {
23540 "CLIENT_VALIDATION_MODE_UNSPECIFIED" => Self::Unspecified,
23541 "ALLOW_INVALID_OR_MISSING_CLIENT_CERT" => Self::AllowInvalidOrMissingClientCert,
23542 "REJECT_INVALID" => Self::RejectInvalid,
23543 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23544 wkt::internal::UnknownEnumValue::String(value.to_string()),
23545 )),
23546 }
23547 }
23548 }
23549
23550 impl serde::ser::Serialize for ClientValidationMode {
23551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23552 where
23553 S: serde::Serializer,
23554 {
23555 match self {
23556 Self::Unspecified => serializer.serialize_i32(0),
23557 Self::AllowInvalidOrMissingClientCert => serializer.serialize_i32(1),
23558 Self::RejectInvalid => serializer.serialize_i32(2),
23559 Self::UnknownValue(u) => u.0.serialize(serializer),
23560 }
23561 }
23562 }
23563
23564 impl<'de> serde::de::Deserialize<'de> for ClientValidationMode {
23565 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23566 where
23567 D: serde::Deserializer<'de>,
23568 {
23569 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClientValidationMode>::new(
23570 ".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode"))
23571 }
23572 }
23573 }
23574}
23575
23576/// Request used by the ListServerTlsPolicies method.
23577#[derive(Clone, Default, PartialEq)]
23578#[non_exhaustive]
23579pub struct ListServerTlsPoliciesRequest {
23580 /// Required. The project and location from which the ServerTlsPolicies should
23581 /// be listed, specified in the format `projects/*/locations/{location}`.
23582 pub parent: std::string::String,
23583
23584 /// Maximum number of ServerTlsPolicies to return per call.
23585 pub page_size: i32,
23586
23587 /// The value returned by the last `ListServerTlsPoliciesResponse`
23588 /// Indicates that this is a continuation of a prior
23589 /// `ListServerTlsPolicies` call, and that the system
23590 /// should return the next page of data.
23591 pub page_token: std::string::String,
23592
23593 /// Optional. Setting this field to `true` will opt the request into returning
23594 /// the resources that are reachable, and into including the names of those
23595 /// that were unreachable in the [ListServerTlsPoliciesResponse.unreachable]
23596 /// field. This can only be `true` when reading across collections e.g. when
23597 /// `parent` is set to `"projects/example/locations/-"`.
23598 pub return_partial_success: bool,
23599
23600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23601}
23602
23603impl ListServerTlsPoliciesRequest {
23604 /// Creates a new default instance.
23605 pub fn new() -> Self {
23606 std::default::Default::default()
23607 }
23608
23609 /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
23610 ///
23611 /// # Example
23612 /// ```ignore,no_run
23613 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23614 /// let x = ListServerTlsPoliciesRequest::new().set_parent("example");
23615 /// ```
23616 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23617 self.parent = v.into();
23618 self
23619 }
23620
23621 /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
23622 ///
23623 /// # Example
23624 /// ```ignore,no_run
23625 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23626 /// let x = ListServerTlsPoliciesRequest::new().set_page_size(42);
23627 /// ```
23628 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23629 self.page_size = v.into();
23630 self
23631 }
23632
23633 /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
23634 ///
23635 /// # Example
23636 /// ```ignore,no_run
23637 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23638 /// let x = ListServerTlsPoliciesRequest::new().set_page_token("example");
23639 /// ```
23640 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23641 self.page_token = v.into();
23642 self
23643 }
23644
23645 /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
23646 ///
23647 /// # Example
23648 /// ```ignore,no_run
23649 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23650 /// let x = ListServerTlsPoliciesRequest::new().set_return_partial_success(true);
23651 /// ```
23652 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23653 self.return_partial_success = v.into();
23654 self
23655 }
23656}
23657
23658impl wkt::message::Message for ListServerTlsPoliciesRequest {
23659 fn typename() -> &'static str {
23660 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
23661 }
23662}
23663
23664/// Response returned by the ListServerTlsPolicies method.
23665#[derive(Clone, Default, PartialEq)]
23666#[non_exhaustive]
23667pub struct ListServerTlsPoliciesResponse {
23668 /// List of ServerTlsPolicy resources.
23669 pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
23670
23671 /// If there might be more results than those appearing in this response, then
23672 /// `next_page_token` is included. To get the next set of results, call this
23673 /// method again using the value of `next_page_token` as `page_token`.
23674 pub next_page_token: std::string::String,
23675
23676 /// Unreachable resources. Populated when the request opts into
23677 /// `return_partial_success` and reading across collections e.g. when
23678 /// attempting to list all resources across all supported locations.
23679 pub unreachable: std::vec::Vec<std::string::String>,
23680
23681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23682}
23683
23684impl ListServerTlsPoliciesResponse {
23685 /// Creates a new default instance.
23686 pub fn new() -> Self {
23687 std::default::Default::default()
23688 }
23689
23690 /// Sets the value of [server_tls_policies][crate::model::ListServerTlsPoliciesResponse::server_tls_policies].
23691 ///
23692 /// # Example
23693 /// ```ignore,no_run
23694 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23695 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23696 /// let x = ListServerTlsPoliciesResponse::new()
23697 /// .set_server_tls_policies([
23698 /// ServerTlsPolicy::default()/* use setters */,
23699 /// ServerTlsPolicy::default()/* use (different) setters */,
23700 /// ]);
23701 /// ```
23702 pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
23703 where
23704 T: std::iter::IntoIterator<Item = V>,
23705 V: std::convert::Into<crate::model::ServerTlsPolicy>,
23706 {
23707 use std::iter::Iterator;
23708 self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
23709 self
23710 }
23711
23712 /// Sets the value of [next_page_token][crate::model::ListServerTlsPoliciesResponse::next_page_token].
23713 ///
23714 /// # Example
23715 /// ```ignore,no_run
23716 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23717 /// let x = ListServerTlsPoliciesResponse::new().set_next_page_token("example");
23718 /// ```
23719 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23720 self.next_page_token = v.into();
23721 self
23722 }
23723
23724 /// Sets the value of [unreachable][crate::model::ListServerTlsPoliciesResponse::unreachable].
23725 ///
23726 /// # Example
23727 /// ```ignore,no_run
23728 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23729 /// let x = ListServerTlsPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
23730 /// ```
23731 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
23732 where
23733 T: std::iter::IntoIterator<Item = V>,
23734 V: std::convert::Into<std::string::String>,
23735 {
23736 use std::iter::Iterator;
23737 self.unreachable = v.into_iter().map(|i| i.into()).collect();
23738 self
23739 }
23740}
23741
23742impl wkt::message::Message for ListServerTlsPoliciesResponse {
23743 fn typename() -> &'static str {
23744 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
23745 }
23746}
23747
23748#[doc(hidden)]
23749impl google_cloud_gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
23750 type PageItem = crate::model::ServerTlsPolicy;
23751
23752 fn items(self) -> std::vec::Vec<Self::PageItem> {
23753 self.server_tls_policies
23754 }
23755
23756 fn next_page_token(&self) -> std::string::String {
23757 use std::clone::Clone;
23758 self.next_page_token.clone()
23759 }
23760}
23761
23762/// Request used by the GetServerTlsPolicy method.
23763#[derive(Clone, Default, PartialEq)]
23764#[non_exhaustive]
23765pub struct GetServerTlsPolicyRequest {
23766 /// Required. A name of the ServerTlsPolicy to get. Must be in the format
23767 /// `projects/*/locations/{location}/serverTlsPolicies/*`.
23768 pub name: std::string::String,
23769
23770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23771}
23772
23773impl GetServerTlsPolicyRequest {
23774 /// Creates a new default instance.
23775 pub fn new() -> Self {
23776 std::default::Default::default()
23777 }
23778
23779 /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
23780 ///
23781 /// # Example
23782 /// ```ignore,no_run
23783 /// # use google_cloud_networksecurity_v1::model::GetServerTlsPolicyRequest;
23784 /// let x = GetServerTlsPolicyRequest::new().set_name("example");
23785 /// ```
23786 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23787 self.name = v.into();
23788 self
23789 }
23790}
23791
23792impl wkt::message::Message for GetServerTlsPolicyRequest {
23793 fn typename() -> &'static str {
23794 "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
23795 }
23796}
23797
23798/// Request used by the CreateServerTlsPolicy method.
23799#[derive(Clone, Default, PartialEq)]
23800#[non_exhaustive]
23801pub struct CreateServerTlsPolicyRequest {
23802 /// Required. The parent resource of the ServerTlsPolicy. Must be in
23803 /// the format `projects/*/locations/{location}`.
23804 pub parent: std::string::String,
23805
23806 /// Required. Short name of the ServerTlsPolicy resource to be created. This
23807 /// value should be 1-63 characters long, containing only letters, numbers,
23808 /// hyphens, and underscores, and should not start with a number. E.g.
23809 /// "server_mtls_policy".
23810 pub server_tls_policy_id: std::string::String,
23811
23812 /// Required. ServerTlsPolicy resource to be created.
23813 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
23814
23815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23816}
23817
23818impl CreateServerTlsPolicyRequest {
23819 /// Creates a new default instance.
23820 pub fn new() -> Self {
23821 std::default::Default::default()
23822 }
23823
23824 /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
23825 ///
23826 /// # Example
23827 /// ```ignore,no_run
23828 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23829 /// let x = CreateServerTlsPolicyRequest::new().set_parent("example");
23830 /// ```
23831 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23832 self.parent = v.into();
23833 self
23834 }
23835
23836 /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
23837 ///
23838 /// # Example
23839 /// ```ignore,no_run
23840 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23841 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy_id("example");
23842 /// ```
23843 pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
23844 mut self,
23845 v: T,
23846 ) -> Self {
23847 self.server_tls_policy_id = v.into();
23848 self
23849 }
23850
23851 /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
23852 ///
23853 /// # Example
23854 /// ```ignore,no_run
23855 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23856 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23857 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
23858 /// ```
23859 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
23860 where
23861 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23862 {
23863 self.server_tls_policy = std::option::Option::Some(v.into());
23864 self
23865 }
23866
23867 /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
23868 ///
23869 /// # Example
23870 /// ```ignore,no_run
23871 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23872 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23873 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
23874 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
23875 /// ```
23876 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23877 where
23878 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23879 {
23880 self.server_tls_policy = v.map(|x| x.into());
23881 self
23882 }
23883}
23884
23885impl wkt::message::Message for CreateServerTlsPolicyRequest {
23886 fn typename() -> &'static str {
23887 "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
23888 }
23889}
23890
23891/// Request used by UpdateServerTlsPolicy method.
23892#[derive(Clone, Default, PartialEq)]
23893#[non_exhaustive]
23894pub struct UpdateServerTlsPolicyRequest {
23895 /// Optional. Field mask is used to specify the fields to be overwritten in the
23896 /// ServerTlsPolicy resource by the update. The fields
23897 /// specified in the update_mask are relative to the resource, not
23898 /// the full request. A field will be overwritten if it is in the
23899 /// mask. If the user does not provide a mask then all fields will be
23900 /// overwritten.
23901 pub update_mask: std::option::Option<wkt::FieldMask>,
23902
23903 /// Required. Updated ServerTlsPolicy resource.
23904 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
23905
23906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23907}
23908
23909impl UpdateServerTlsPolicyRequest {
23910 /// Creates a new default instance.
23911 pub fn new() -> Self {
23912 std::default::Default::default()
23913 }
23914
23915 /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
23916 ///
23917 /// # Example
23918 /// ```ignore,no_run
23919 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23920 /// use wkt::FieldMask;
23921 /// let x = UpdateServerTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
23922 /// ```
23923 pub fn set_update_mask<T>(mut self, v: T) -> Self
23924 where
23925 T: std::convert::Into<wkt::FieldMask>,
23926 {
23927 self.update_mask = std::option::Option::Some(v.into());
23928 self
23929 }
23930
23931 /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
23932 ///
23933 /// # Example
23934 /// ```ignore,no_run
23935 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23936 /// use wkt::FieldMask;
23937 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
23938 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
23939 /// ```
23940 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23941 where
23942 T: std::convert::Into<wkt::FieldMask>,
23943 {
23944 self.update_mask = v.map(|x| x.into());
23945 self
23946 }
23947
23948 /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
23949 ///
23950 /// # Example
23951 /// ```ignore,no_run
23952 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23953 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23954 /// let x = UpdateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
23955 /// ```
23956 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
23957 where
23958 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23959 {
23960 self.server_tls_policy = std::option::Option::Some(v.into());
23961 self
23962 }
23963
23964 /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
23965 ///
23966 /// # Example
23967 /// ```ignore,no_run
23968 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23969 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23970 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
23971 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
23972 /// ```
23973 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23974 where
23975 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23976 {
23977 self.server_tls_policy = v.map(|x| x.into());
23978 self
23979 }
23980}
23981
23982impl wkt::message::Message for UpdateServerTlsPolicyRequest {
23983 fn typename() -> &'static str {
23984 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
23985 }
23986}
23987
23988/// Request used by the DeleteServerTlsPolicy method.
23989#[derive(Clone, Default, PartialEq)]
23990#[non_exhaustive]
23991pub struct DeleteServerTlsPolicyRequest {
23992 /// Required. A name of the ServerTlsPolicy to delete. Must be in
23993 /// the format `projects/*/locations/{location}/serverTlsPolicies/*`.
23994 pub name: std::string::String,
23995
23996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23997}
23998
23999impl DeleteServerTlsPolicyRequest {
24000 /// Creates a new default instance.
24001 pub fn new() -> Self {
24002 std::default::Default::default()
24003 }
24004
24005 /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
24006 ///
24007 /// # Example
24008 /// ```ignore,no_run
24009 /// # use google_cloud_networksecurity_v1::model::DeleteServerTlsPolicyRequest;
24010 /// let x = DeleteServerTlsPolicyRequest::new().set_name("example");
24011 /// ```
24012 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24013 self.name = v.into();
24014 self
24015 }
24016}
24017
24018impl wkt::message::Message for DeleteServerTlsPolicyRequest {
24019 fn typename() -> &'static str {
24020 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
24021 }
24022}
24023
24024/// Specification of the GRPC Endpoint.
24025#[derive(Clone, Default, PartialEq)]
24026#[non_exhaustive]
24027pub struct GrpcEndpoint {
24028 /// Required. The target URI of the gRPC endpoint. Only UDS path is supported,
24029 /// and should start with "unix:".
24030 pub target_uri: std::string::String,
24031
24032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24033}
24034
24035impl GrpcEndpoint {
24036 /// Creates a new default instance.
24037 pub fn new() -> Self {
24038 std::default::Default::default()
24039 }
24040
24041 /// Sets the value of [target_uri][crate::model::GrpcEndpoint::target_uri].
24042 ///
24043 /// # Example
24044 /// ```ignore,no_run
24045 /// # use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24046 /// let x = GrpcEndpoint::new().set_target_uri("example");
24047 /// ```
24048 pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24049 self.target_uri = v.into();
24050 self
24051 }
24052}
24053
24054impl wkt::message::Message for GrpcEndpoint {
24055 fn typename() -> &'static str {
24056 "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
24057 }
24058}
24059
24060/// Specification of ValidationCA. Defines the mechanism to obtain the
24061/// Certificate Authority certificate to validate the peer certificate.
24062#[derive(Clone, Default, PartialEq)]
24063#[non_exhaustive]
24064pub struct ValidationCA {
24065 /// The type of certificate provider which provides the CA certificate.
24066 pub r#type: std::option::Option<crate::model::validation_ca::Type>,
24067
24068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24069}
24070
24071impl ValidationCA {
24072 /// Creates a new default instance.
24073 pub fn new() -> Self {
24074 std::default::Default::default()
24075 }
24076
24077 /// Sets the value of [r#type][crate::model::ValidationCA::type].
24078 ///
24079 /// Note that all the setters affecting `r#type` are mutually
24080 /// exclusive.
24081 ///
24082 /// # Example
24083 /// ```ignore,no_run
24084 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
24085 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24086 /// let x = ValidationCA::new().set_type(Some(
24087 /// google_cloud_networksecurity_v1::model::validation_ca::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
24088 /// ```
24089 pub fn set_type<
24090 T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
24091 >(
24092 mut self,
24093 v: T,
24094 ) -> Self {
24095 self.r#type = v.into();
24096 self
24097 }
24098
24099 /// The value of [r#type][crate::model::ValidationCA::r#type]
24100 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
24101 /// holds a different branch.
24102 pub fn grpc_endpoint(
24103 &self,
24104 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
24105 #[allow(unreachable_patterns)]
24106 self.r#type.as_ref().and_then(|v| match v {
24107 crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
24108 _ => std::option::Option::None,
24109 })
24110 }
24111
24112 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
24113 /// to hold a `GrpcEndpoint`.
24114 ///
24115 /// Note that all the setters affecting `r#type` are
24116 /// mutually exclusive.
24117 ///
24118 /// # Example
24119 /// ```ignore,no_run
24120 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
24121 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24122 /// let x = ValidationCA::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
24123 /// assert!(x.grpc_endpoint().is_some());
24124 /// assert!(x.certificate_provider_instance().is_none());
24125 /// ```
24126 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
24127 mut self,
24128 v: T,
24129 ) -> Self {
24130 self.r#type =
24131 std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
24132 self
24133 }
24134
24135 /// The value of [r#type][crate::model::ValidationCA::r#type]
24136 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
24137 /// holds a different branch.
24138 pub fn certificate_provider_instance(
24139 &self,
24140 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
24141 #[allow(unreachable_patterns)]
24142 self.r#type.as_ref().and_then(|v| match v {
24143 crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
24144 std::option::Option::Some(v)
24145 }
24146 _ => std::option::Option::None,
24147 })
24148 }
24149
24150 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
24151 /// to hold a `CertificateProviderInstance`.
24152 ///
24153 /// Note that all the setters affecting `r#type` are
24154 /// mutually exclusive.
24155 ///
24156 /// # Example
24157 /// ```ignore,no_run
24158 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
24159 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
24160 /// let x = ValidationCA::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
24161 /// assert!(x.certificate_provider_instance().is_some());
24162 /// assert!(x.grpc_endpoint().is_none());
24163 /// ```
24164 pub fn set_certificate_provider_instance<
24165 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
24166 >(
24167 mut self,
24168 v: T,
24169 ) -> Self {
24170 self.r#type = std::option::Option::Some(
24171 crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
24172 );
24173 self
24174 }
24175}
24176
24177impl wkt::message::Message for ValidationCA {
24178 fn typename() -> &'static str {
24179 "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
24180 }
24181}
24182
24183/// Defines additional types related to [ValidationCA].
24184pub mod validation_ca {
24185 #[allow(unused_imports)]
24186 use super::*;
24187
24188 /// The type of certificate provider which provides the CA certificate.
24189 #[derive(Clone, Debug, PartialEq)]
24190 #[non_exhaustive]
24191 pub enum Type {
24192 /// gRPC specific configuration to access the gRPC server to
24193 /// obtain the CA certificate.
24194 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
24195 /// The certificate provider instance specification that will be passed to
24196 /// the data plane, which will be used to load necessary credential
24197 /// information.
24198 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
24199 }
24200}
24201
24202/// Specification of a TLS certificate provider instance. Workloads may have one
24203/// or more CertificateProvider instances (plugins) and one of them is enabled
24204/// and configured by specifying this message. Workloads use the values from this
24205/// message to locate and load the CertificateProvider instance configuration.
24206#[derive(Clone, Default, PartialEq)]
24207#[non_exhaustive]
24208pub struct CertificateProviderInstance {
24209 /// Required. Plugin instance name, used to locate and load CertificateProvider
24210 /// instance configuration. Set to "google_cloud_private_spiffe" to use
24211 /// Certificate Authority Service certificate provider instance.
24212 pub plugin_instance: std::string::String,
24213
24214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24215}
24216
24217impl CertificateProviderInstance {
24218 /// Creates a new default instance.
24219 pub fn new() -> Self {
24220 std::default::Default::default()
24221 }
24222
24223 /// Sets the value of [plugin_instance][crate::model::CertificateProviderInstance::plugin_instance].
24224 ///
24225 /// # Example
24226 /// ```ignore,no_run
24227 /// # use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
24228 /// let x = CertificateProviderInstance::new().set_plugin_instance("example");
24229 /// ```
24230 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24231 self.plugin_instance = v.into();
24232 self
24233 }
24234}
24235
24236impl wkt::message::Message for CertificateProviderInstance {
24237 fn typename() -> &'static str {
24238 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
24239 }
24240}
24241
24242/// Specification of certificate provider. Defines the mechanism to obtain the
24243/// certificate and private key for peer to peer authentication.
24244#[derive(Clone, Default, PartialEq)]
24245#[non_exhaustive]
24246pub struct CertificateProvider {
24247 /// The type of certificate provider which provides the certificates and
24248 /// private keys.
24249 pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
24250
24251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24252}
24253
24254impl CertificateProvider {
24255 /// Creates a new default instance.
24256 pub fn new() -> Self {
24257 std::default::Default::default()
24258 }
24259
24260 /// Sets the value of [r#type][crate::model::CertificateProvider::type].
24261 ///
24262 /// Note that all the setters affecting `r#type` are mutually
24263 /// exclusive.
24264 ///
24265 /// # Example
24266 /// ```ignore,no_run
24267 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24268 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24269 /// let x = CertificateProvider::new().set_type(Some(
24270 /// google_cloud_networksecurity_v1::model::certificate_provider::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
24271 /// ```
24272 pub fn set_type<
24273 T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
24274 >(
24275 mut self,
24276 v: T,
24277 ) -> Self {
24278 self.r#type = v.into();
24279 self
24280 }
24281
24282 /// The value of [r#type][crate::model::CertificateProvider::r#type]
24283 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
24284 /// holds a different branch.
24285 pub fn grpc_endpoint(
24286 &self,
24287 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
24288 #[allow(unreachable_patterns)]
24289 self.r#type.as_ref().and_then(|v| match v {
24290 crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
24291 std::option::Option::Some(v)
24292 }
24293 _ => std::option::Option::None,
24294 })
24295 }
24296
24297 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
24298 /// to hold a `GrpcEndpoint`.
24299 ///
24300 /// Note that all the setters affecting `r#type` are
24301 /// mutually exclusive.
24302 ///
24303 /// # Example
24304 /// ```ignore,no_run
24305 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24306 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24307 /// let x = CertificateProvider::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
24308 /// assert!(x.grpc_endpoint().is_some());
24309 /// assert!(x.certificate_provider_instance().is_none());
24310 /// ```
24311 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
24312 mut self,
24313 v: T,
24314 ) -> Self {
24315 self.r#type = std::option::Option::Some(
24316 crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
24317 );
24318 self
24319 }
24320
24321 /// The value of [r#type][crate::model::CertificateProvider::r#type]
24322 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
24323 /// holds a different branch.
24324 pub fn certificate_provider_instance(
24325 &self,
24326 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
24327 #[allow(unreachable_patterns)]
24328 self.r#type.as_ref().and_then(|v| match v {
24329 crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
24330 std::option::Option::Some(v)
24331 }
24332 _ => std::option::Option::None,
24333 })
24334 }
24335
24336 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
24337 /// to hold a `CertificateProviderInstance`.
24338 ///
24339 /// Note that all the setters affecting `r#type` are
24340 /// mutually exclusive.
24341 ///
24342 /// # Example
24343 /// ```ignore,no_run
24344 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24345 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
24346 /// let x = CertificateProvider::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
24347 /// assert!(x.certificate_provider_instance().is_some());
24348 /// assert!(x.grpc_endpoint().is_none());
24349 /// ```
24350 pub fn set_certificate_provider_instance<
24351 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
24352 >(
24353 mut self,
24354 v: T,
24355 ) -> Self {
24356 self.r#type = std::option::Option::Some(
24357 crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
24358 );
24359 self
24360 }
24361}
24362
24363impl wkt::message::Message for CertificateProvider {
24364 fn typename() -> &'static str {
24365 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
24366 }
24367}
24368
24369/// Defines additional types related to [CertificateProvider].
24370pub mod certificate_provider {
24371 #[allow(unused_imports)]
24372 use super::*;
24373
24374 /// The type of certificate provider which provides the certificates and
24375 /// private keys.
24376 #[derive(Clone, Debug, PartialEq)]
24377 #[non_exhaustive]
24378 pub enum Type {
24379 /// gRPC specific configuration to access the gRPC server to
24380 /// obtain the cert and private key.
24381 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
24382 /// The certificate provider instance specification that will be passed to
24383 /// the data plane, which will be used to load necessary credential
24384 /// information.
24385 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
24386 }
24387}
24388
24389/// The TlsInspectionPolicy resource contains references to CA pools in
24390/// Certificate Authority Service and associated metadata.
24391#[derive(Clone, Default, PartialEq)]
24392#[non_exhaustive]
24393pub struct TlsInspectionPolicy {
24394 /// Required. Name of the resource. Name is of the form
24395 /// projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}
24396 /// tls_inspection_policy should match the
24397 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
24398 pub name: std::string::String,
24399
24400 /// Optional. Free-text description of the resource.
24401 pub description: std::string::String,
24402
24403 /// Output only. The timestamp when the resource was created.
24404 pub create_time: std::option::Option<wkt::Timestamp>,
24405
24406 /// Output only. The timestamp when the resource was updated.
24407 pub update_time: std::option::Option<wkt::Timestamp>,
24408
24409 /// Required. A CA pool resource used to issue interception certificates.
24410 /// The CA pool string has a relative resource path following the form
24411 /// "projects/{project}/locations/{location}/caPools/{ca_pool}".
24412 pub ca_pool: std::string::String,
24413
24414 /// Optional. A TrustConfig resource used when making a connection to the TLS
24415 /// server. This is a relative resource path following the form
24416 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This
24417 /// is necessary to intercept TLS connections to servers with certificates
24418 /// signed by a private CA or self-signed certificates.
24419 /// Note that Secure Web Proxy does not yet honor this field.
24420 pub trust_config: std::string::String,
24421
24422 /// Optional. If FALSE (the default), use our default set of public CAs in
24423 /// addition to any CAs specified in trust_config. These public CAs are
24424 /// currently based on the Mozilla Root Program and are subject to change over
24425 /// time. If TRUE, do not accept our default set of public CAs. Only CAs
24426 /// specified in trust_config will be accepted. This defaults to FALSE (use
24427 /// public CAs in addition to trust_config) for backwards compatibility, but
24428 /// trusting public root CAs is *not recommended* unless the traffic in
24429 /// question is outbound to public web servers. When possible, prefer setting
24430 /// this to "false" and explicitly specifying trusted CAs and certificates in a
24431 /// TrustConfig. Note that Secure Web Proxy does not yet honor this field.
24432 pub exclude_public_ca_set: std::option::Option<bool>,
24433
24434 /// Optional. Minimum TLS version that the firewall should use when negotiating
24435 /// connections with both clients and servers. If this is not set, then the
24436 /// default value is to allow the broadest set of clients and servers (TLS 1.0
24437 /// or higher). Setting this to more restrictive values may improve security,
24438 /// but may also prevent the firewall from connecting to some clients or
24439 /// servers.
24440 /// Note that Secure Web Proxy does not yet honor this field.
24441 pub min_tls_version: crate::model::tls_inspection_policy::TlsVersion,
24442
24443 /// Optional. The selected Profile. If this is not set, then the default value
24444 /// is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE").
24445 /// Setting this to more restrictive values may improve security, but may also
24446 /// prevent the TLS inspection proxy from connecting to some clients or
24447 /// servers. Note that Secure Web Proxy does not yet honor this field.
24448 pub tls_feature_profile: crate::model::tls_inspection_policy::Profile,
24449
24450 /// Optional. List of custom TLS cipher suites selected.
24451 /// This field is valid only if the selected tls_feature_profile is CUSTOM.
24452 /// The [compute.SslPoliciesService.ListAvailableFeatures][] method returns the
24453 /// set of features that can be specified in this list.
24454 /// Note that Secure Web Proxy does not yet honor this field.
24455 pub custom_tls_features: std::vec::Vec<std::string::String>,
24456
24457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24458}
24459
24460impl TlsInspectionPolicy {
24461 /// Creates a new default instance.
24462 pub fn new() -> Self {
24463 std::default::Default::default()
24464 }
24465
24466 /// Sets the value of [name][crate::model::TlsInspectionPolicy::name].
24467 ///
24468 /// # Example
24469 /// ```ignore,no_run
24470 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24471 /// let x = TlsInspectionPolicy::new().set_name("example");
24472 /// ```
24473 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24474 self.name = v.into();
24475 self
24476 }
24477
24478 /// Sets the value of [description][crate::model::TlsInspectionPolicy::description].
24479 ///
24480 /// # Example
24481 /// ```ignore,no_run
24482 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24483 /// let x = TlsInspectionPolicy::new().set_description("example");
24484 /// ```
24485 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24486 self.description = v.into();
24487 self
24488 }
24489
24490 /// Sets the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
24491 ///
24492 /// # Example
24493 /// ```ignore,no_run
24494 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24495 /// use wkt::Timestamp;
24496 /// let x = TlsInspectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
24497 /// ```
24498 pub fn set_create_time<T>(mut self, v: T) -> Self
24499 where
24500 T: std::convert::Into<wkt::Timestamp>,
24501 {
24502 self.create_time = std::option::Option::Some(v.into());
24503 self
24504 }
24505
24506 /// Sets or clears the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
24507 ///
24508 /// # Example
24509 /// ```ignore,no_run
24510 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24511 /// use wkt::Timestamp;
24512 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
24513 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
24514 /// ```
24515 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24516 where
24517 T: std::convert::Into<wkt::Timestamp>,
24518 {
24519 self.create_time = v.map(|x| x.into());
24520 self
24521 }
24522
24523 /// Sets the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
24524 ///
24525 /// # Example
24526 /// ```ignore,no_run
24527 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24528 /// use wkt::Timestamp;
24529 /// let x = TlsInspectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
24530 /// ```
24531 pub fn set_update_time<T>(mut self, v: T) -> Self
24532 where
24533 T: std::convert::Into<wkt::Timestamp>,
24534 {
24535 self.update_time = std::option::Option::Some(v.into());
24536 self
24537 }
24538
24539 /// Sets or clears the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
24540 ///
24541 /// # Example
24542 /// ```ignore,no_run
24543 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24544 /// use wkt::Timestamp;
24545 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
24546 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
24547 /// ```
24548 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24549 where
24550 T: std::convert::Into<wkt::Timestamp>,
24551 {
24552 self.update_time = v.map(|x| x.into());
24553 self
24554 }
24555
24556 /// Sets the value of [ca_pool][crate::model::TlsInspectionPolicy::ca_pool].
24557 ///
24558 /// # Example
24559 /// ```ignore,no_run
24560 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24561 /// let x = TlsInspectionPolicy::new().set_ca_pool("example");
24562 /// ```
24563 pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24564 self.ca_pool = v.into();
24565 self
24566 }
24567
24568 /// Sets the value of [trust_config][crate::model::TlsInspectionPolicy::trust_config].
24569 ///
24570 /// # Example
24571 /// ```ignore,no_run
24572 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24573 /// let x = TlsInspectionPolicy::new().set_trust_config("example");
24574 /// ```
24575 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24576 self.trust_config = v.into();
24577 self
24578 }
24579
24580 /// Sets the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
24581 ///
24582 /// # Example
24583 /// ```ignore,no_run
24584 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24585 /// let x = TlsInspectionPolicy::new().set_exclude_public_ca_set(true);
24586 /// ```
24587 pub fn set_exclude_public_ca_set<T>(mut self, v: T) -> Self
24588 where
24589 T: std::convert::Into<bool>,
24590 {
24591 self.exclude_public_ca_set = std::option::Option::Some(v.into());
24592 self
24593 }
24594
24595 /// Sets or clears the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
24596 ///
24597 /// # Example
24598 /// ```ignore,no_run
24599 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24600 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(Some(false));
24601 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(None::<bool>);
24602 /// ```
24603 pub fn set_or_clear_exclude_public_ca_set<T>(mut self, v: std::option::Option<T>) -> Self
24604 where
24605 T: std::convert::Into<bool>,
24606 {
24607 self.exclude_public_ca_set = v.map(|x| x.into());
24608 self
24609 }
24610
24611 /// Sets the value of [min_tls_version][crate::model::TlsInspectionPolicy::min_tls_version].
24612 ///
24613 /// # Example
24614 /// ```ignore,no_run
24615 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24616 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::TlsVersion;
24617 /// let x0 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls10);
24618 /// let x1 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls11);
24619 /// let x2 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls12);
24620 /// ```
24621 pub fn set_min_tls_version<
24622 T: std::convert::Into<crate::model::tls_inspection_policy::TlsVersion>,
24623 >(
24624 mut self,
24625 v: T,
24626 ) -> Self {
24627 self.min_tls_version = v.into();
24628 self
24629 }
24630
24631 /// Sets the value of [tls_feature_profile][crate::model::TlsInspectionPolicy::tls_feature_profile].
24632 ///
24633 /// # Example
24634 /// ```ignore,no_run
24635 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24636 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::Profile;
24637 /// let x0 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Compatible);
24638 /// let x1 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Modern);
24639 /// let x2 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Restricted);
24640 /// ```
24641 pub fn set_tls_feature_profile<
24642 T: std::convert::Into<crate::model::tls_inspection_policy::Profile>,
24643 >(
24644 mut self,
24645 v: T,
24646 ) -> Self {
24647 self.tls_feature_profile = v.into();
24648 self
24649 }
24650
24651 /// Sets the value of [custom_tls_features][crate::model::TlsInspectionPolicy::custom_tls_features].
24652 ///
24653 /// # Example
24654 /// ```ignore,no_run
24655 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24656 /// let x = TlsInspectionPolicy::new().set_custom_tls_features(["a", "b", "c"]);
24657 /// ```
24658 pub fn set_custom_tls_features<T, V>(mut self, v: T) -> Self
24659 where
24660 T: std::iter::IntoIterator<Item = V>,
24661 V: std::convert::Into<std::string::String>,
24662 {
24663 use std::iter::Iterator;
24664 self.custom_tls_features = v.into_iter().map(|i| i.into()).collect();
24665 self
24666 }
24667}
24668
24669impl wkt::message::Message for TlsInspectionPolicy {
24670 fn typename() -> &'static str {
24671 "type.googleapis.com/google.cloud.networksecurity.v1.TlsInspectionPolicy"
24672 }
24673}
24674
24675/// Defines additional types related to [TlsInspectionPolicy].
24676pub mod tls_inspection_policy {
24677 #[allow(unused_imports)]
24678 use super::*;
24679
24680 /// The minimum version of TLS protocol that can be used by clients or servers
24681 /// to establish a connection with the TLS inspection proxy.
24682 ///
24683 /// # Working with unknown values
24684 ///
24685 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24686 /// additional enum variants at any time. Adding new variants is not considered
24687 /// a breaking change. Applications should write their code in anticipation of:
24688 ///
24689 /// - New values appearing in future releases of the client library, **and**
24690 /// - New values received dynamically, without application changes.
24691 ///
24692 /// Please consult the [Working with enums] section in the user guide for some
24693 /// guidelines.
24694 ///
24695 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24696 #[derive(Clone, Debug, PartialEq)]
24697 #[non_exhaustive]
24698 pub enum TlsVersion {
24699 /// Indicates no TLS version was specified.
24700 Unspecified,
24701 /// TLS 1.0
24702 Tls10,
24703 /// TLS 1.1
24704 Tls11,
24705 /// TLS 1.2
24706 Tls12,
24707 /// TLS 1.3
24708 Tls13,
24709 /// If set, the enum was initialized with an unknown value.
24710 ///
24711 /// Applications can examine the value using [TlsVersion::value] or
24712 /// [TlsVersion::name].
24713 UnknownValue(tls_version::UnknownValue),
24714 }
24715
24716 #[doc(hidden)]
24717 pub mod tls_version {
24718 #[allow(unused_imports)]
24719 use super::*;
24720 #[derive(Clone, Debug, PartialEq)]
24721 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24722 }
24723
24724 impl TlsVersion {
24725 /// Gets the enum value.
24726 ///
24727 /// Returns `None` if the enum contains an unknown value deserialized from
24728 /// the string representation of enums.
24729 pub fn value(&self) -> std::option::Option<i32> {
24730 match self {
24731 Self::Unspecified => std::option::Option::Some(0),
24732 Self::Tls10 => std::option::Option::Some(1),
24733 Self::Tls11 => std::option::Option::Some(2),
24734 Self::Tls12 => std::option::Option::Some(3),
24735 Self::Tls13 => std::option::Option::Some(4),
24736 Self::UnknownValue(u) => u.0.value(),
24737 }
24738 }
24739
24740 /// Gets the enum value as a string.
24741 ///
24742 /// Returns `None` if the enum contains an unknown value deserialized from
24743 /// the integer representation of enums.
24744 pub fn name(&self) -> std::option::Option<&str> {
24745 match self {
24746 Self::Unspecified => std::option::Option::Some("TLS_VERSION_UNSPECIFIED"),
24747 Self::Tls10 => std::option::Option::Some("TLS_1_0"),
24748 Self::Tls11 => std::option::Option::Some("TLS_1_1"),
24749 Self::Tls12 => std::option::Option::Some("TLS_1_2"),
24750 Self::Tls13 => std::option::Option::Some("TLS_1_3"),
24751 Self::UnknownValue(u) => u.0.name(),
24752 }
24753 }
24754 }
24755
24756 impl std::default::Default for TlsVersion {
24757 fn default() -> Self {
24758 use std::convert::From;
24759 Self::from(0)
24760 }
24761 }
24762
24763 impl std::fmt::Display for TlsVersion {
24764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24765 wkt::internal::display_enum(f, self.name(), self.value())
24766 }
24767 }
24768
24769 impl std::convert::From<i32> for TlsVersion {
24770 fn from(value: i32) -> Self {
24771 match value {
24772 0 => Self::Unspecified,
24773 1 => Self::Tls10,
24774 2 => Self::Tls11,
24775 3 => Self::Tls12,
24776 4 => Self::Tls13,
24777 _ => Self::UnknownValue(tls_version::UnknownValue(
24778 wkt::internal::UnknownEnumValue::Integer(value),
24779 )),
24780 }
24781 }
24782 }
24783
24784 impl std::convert::From<&str> for TlsVersion {
24785 fn from(value: &str) -> Self {
24786 use std::string::ToString;
24787 match value {
24788 "TLS_VERSION_UNSPECIFIED" => Self::Unspecified,
24789 "TLS_1_0" => Self::Tls10,
24790 "TLS_1_1" => Self::Tls11,
24791 "TLS_1_2" => Self::Tls12,
24792 "TLS_1_3" => Self::Tls13,
24793 _ => Self::UnknownValue(tls_version::UnknownValue(
24794 wkt::internal::UnknownEnumValue::String(value.to_string()),
24795 )),
24796 }
24797 }
24798 }
24799
24800 impl serde::ser::Serialize for TlsVersion {
24801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24802 where
24803 S: serde::Serializer,
24804 {
24805 match self {
24806 Self::Unspecified => serializer.serialize_i32(0),
24807 Self::Tls10 => serializer.serialize_i32(1),
24808 Self::Tls11 => serializer.serialize_i32(2),
24809 Self::Tls12 => serializer.serialize_i32(3),
24810 Self::Tls13 => serializer.serialize_i32(4),
24811 Self::UnknownValue(u) => u.0.serialize(serializer),
24812 }
24813 }
24814 }
24815
24816 impl<'de> serde::de::Deserialize<'de> for TlsVersion {
24817 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24818 where
24819 D: serde::Deserializer<'de>,
24820 {
24821 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TlsVersion>::new(
24822 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion",
24823 ))
24824 }
24825 }
24826
24827 /// Profile specifies the set of TLS cipher suites (and possibly
24828 /// other features in the future) that can be used by the firewall when
24829 /// negotiating TLS connections with clients and servers. The meaning of these
24830 /// fields is identical to the load balancers' SSLPolicy resource.
24831 ///
24832 /// # Working with unknown values
24833 ///
24834 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24835 /// additional enum variants at any time. Adding new variants is not considered
24836 /// a breaking change. Applications should write their code in anticipation of:
24837 ///
24838 /// - New values appearing in future releases of the client library, **and**
24839 /// - New values received dynamically, without application changes.
24840 ///
24841 /// Please consult the [Working with enums] section in the user guide for some
24842 /// guidelines.
24843 ///
24844 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24845 #[derive(Clone, Debug, PartialEq)]
24846 #[non_exhaustive]
24847 pub enum Profile {
24848 /// Indicates no profile was specified.
24849 Unspecified,
24850 /// Compatible profile. Allows the broadest set of clients, even those
24851 /// which support only out-of-date SSL features to negotiate with the TLS
24852 /// inspection proxy.
24853 Compatible,
24854 /// Modern profile. Supports a wide set of SSL features, allowing modern
24855 /// clients to negotiate SSL with the TLS inspection proxy.
24856 Modern,
24857 /// Restricted profile. Supports a reduced set of SSL features, intended to
24858 /// meet stricter compliance requirements.
24859 Restricted,
24860 /// Custom profile. Allow only the set of allowed SSL features specified in
24861 /// the custom_features field of SslPolicy.
24862 Custom,
24863 /// If set, the enum was initialized with an unknown value.
24864 ///
24865 /// Applications can examine the value using [Profile::value] or
24866 /// [Profile::name].
24867 UnknownValue(profile::UnknownValue),
24868 }
24869
24870 #[doc(hidden)]
24871 pub mod profile {
24872 #[allow(unused_imports)]
24873 use super::*;
24874 #[derive(Clone, Debug, PartialEq)]
24875 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24876 }
24877
24878 impl Profile {
24879 /// Gets the enum value.
24880 ///
24881 /// Returns `None` if the enum contains an unknown value deserialized from
24882 /// the string representation of enums.
24883 pub fn value(&self) -> std::option::Option<i32> {
24884 match self {
24885 Self::Unspecified => std::option::Option::Some(0),
24886 Self::Compatible => std::option::Option::Some(1),
24887 Self::Modern => std::option::Option::Some(2),
24888 Self::Restricted => std::option::Option::Some(3),
24889 Self::Custom => std::option::Option::Some(4),
24890 Self::UnknownValue(u) => u.0.value(),
24891 }
24892 }
24893
24894 /// Gets the enum value as a string.
24895 ///
24896 /// Returns `None` if the enum contains an unknown value deserialized from
24897 /// the integer representation of enums.
24898 pub fn name(&self) -> std::option::Option<&str> {
24899 match self {
24900 Self::Unspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
24901 Self::Compatible => std::option::Option::Some("PROFILE_COMPATIBLE"),
24902 Self::Modern => std::option::Option::Some("PROFILE_MODERN"),
24903 Self::Restricted => std::option::Option::Some("PROFILE_RESTRICTED"),
24904 Self::Custom => std::option::Option::Some("PROFILE_CUSTOM"),
24905 Self::UnknownValue(u) => u.0.name(),
24906 }
24907 }
24908 }
24909
24910 impl std::default::Default for Profile {
24911 fn default() -> Self {
24912 use std::convert::From;
24913 Self::from(0)
24914 }
24915 }
24916
24917 impl std::fmt::Display for Profile {
24918 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24919 wkt::internal::display_enum(f, self.name(), self.value())
24920 }
24921 }
24922
24923 impl std::convert::From<i32> for Profile {
24924 fn from(value: i32) -> Self {
24925 match value {
24926 0 => Self::Unspecified,
24927 1 => Self::Compatible,
24928 2 => Self::Modern,
24929 3 => Self::Restricted,
24930 4 => Self::Custom,
24931 _ => Self::UnknownValue(profile::UnknownValue(
24932 wkt::internal::UnknownEnumValue::Integer(value),
24933 )),
24934 }
24935 }
24936 }
24937
24938 impl std::convert::From<&str> for Profile {
24939 fn from(value: &str) -> Self {
24940 use std::string::ToString;
24941 match value {
24942 "PROFILE_UNSPECIFIED" => Self::Unspecified,
24943 "PROFILE_COMPATIBLE" => Self::Compatible,
24944 "PROFILE_MODERN" => Self::Modern,
24945 "PROFILE_RESTRICTED" => Self::Restricted,
24946 "PROFILE_CUSTOM" => Self::Custom,
24947 _ => Self::UnknownValue(profile::UnknownValue(
24948 wkt::internal::UnknownEnumValue::String(value.to_string()),
24949 )),
24950 }
24951 }
24952 }
24953
24954 impl serde::ser::Serialize for Profile {
24955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24956 where
24957 S: serde::Serializer,
24958 {
24959 match self {
24960 Self::Unspecified => serializer.serialize_i32(0),
24961 Self::Compatible => serializer.serialize_i32(1),
24962 Self::Modern => serializer.serialize_i32(2),
24963 Self::Restricted => serializer.serialize_i32(3),
24964 Self::Custom => serializer.serialize_i32(4),
24965 Self::UnknownValue(u) => u.0.serialize(serializer),
24966 }
24967 }
24968 }
24969
24970 impl<'de> serde::de::Deserialize<'de> for Profile {
24971 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24972 where
24973 D: serde::Deserializer<'de>,
24974 {
24975 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Profile>::new(
24976 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile",
24977 ))
24978 }
24979 }
24980}
24981
24982/// Request used by the CreateTlsInspectionPolicy method.
24983#[derive(Clone, Default, PartialEq)]
24984#[non_exhaustive]
24985pub struct CreateTlsInspectionPolicyRequest {
24986 /// Required. The parent resource of the TlsInspectionPolicy. Must be in the
24987 /// format `projects/{project}/locations/{location}`.
24988 pub parent: std::string::String,
24989
24990 /// Required. Short name of the TlsInspectionPolicy resource to be created.
24991 /// This value should be 1-63 characters long, containing only
24992 /// letters, numbers, hyphens, and underscores, and should not start
24993 /// with a number. E.g. "tls_inspection_policy1".
24994 pub tls_inspection_policy_id: std::string::String,
24995
24996 /// Required. TlsInspectionPolicy resource to be created.
24997 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
24998
24999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25000}
25001
25002impl CreateTlsInspectionPolicyRequest {
25003 /// Creates a new default instance.
25004 pub fn new() -> Self {
25005 std::default::Default::default()
25006 }
25007
25008 /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
25009 ///
25010 /// # Example
25011 /// ```ignore,no_run
25012 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
25013 /// let x = CreateTlsInspectionPolicyRequest::new().set_parent("example");
25014 /// ```
25015 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25016 self.parent = v.into();
25017 self
25018 }
25019
25020 /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
25021 ///
25022 /// # Example
25023 /// ```ignore,no_run
25024 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
25025 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy_id("example");
25026 /// ```
25027 pub fn set_tls_inspection_policy_id<T: std::convert::Into<std::string::String>>(
25028 mut self,
25029 v: T,
25030 ) -> Self {
25031 self.tls_inspection_policy_id = v.into();
25032 self
25033 }
25034
25035 /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
25036 ///
25037 /// # Example
25038 /// ```ignore,no_run
25039 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
25040 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25041 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
25042 /// ```
25043 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
25044 where
25045 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25046 {
25047 self.tls_inspection_policy = std::option::Option::Some(v.into());
25048 self
25049 }
25050
25051 /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
25052 ///
25053 /// # Example
25054 /// ```ignore,no_run
25055 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
25056 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25057 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
25058 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
25059 /// ```
25060 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
25061 where
25062 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25063 {
25064 self.tls_inspection_policy = v.map(|x| x.into());
25065 self
25066 }
25067}
25068
25069impl wkt::message::Message for CreateTlsInspectionPolicyRequest {
25070 fn typename() -> &'static str {
25071 "type.googleapis.com/google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest"
25072 }
25073}
25074
25075/// Request used with the ListTlsInspectionPolicies method.
25076#[derive(Clone, Default, PartialEq)]
25077#[non_exhaustive]
25078pub struct ListTlsInspectionPoliciesRequest {
25079 /// Required. The project and location from which the TlsInspectionPolicies
25080 /// should be listed, specified in the format
25081 /// `projects/{project}/locations/{location}`.
25082 pub parent: std::string::String,
25083
25084 /// Maximum number of TlsInspectionPolicies to return per call.
25085 pub page_size: i32,
25086
25087 /// The value returned by the last
25088 /// 'ListTlsInspectionPoliciesResponse' Indicates that this is a
25089 /// continuation of a prior 'ListTlsInspectionPolicies' call, and
25090 /// that the system should return the next page of data.
25091 pub page_token: std::string::String,
25092
25093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25094}
25095
25096impl ListTlsInspectionPoliciesRequest {
25097 /// Creates a new default instance.
25098 pub fn new() -> Self {
25099 std::default::Default::default()
25100 }
25101
25102 /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
25103 ///
25104 /// # Example
25105 /// ```ignore,no_run
25106 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
25107 /// let x = ListTlsInspectionPoliciesRequest::new().set_parent("example");
25108 /// ```
25109 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25110 self.parent = v.into();
25111 self
25112 }
25113
25114 /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
25115 ///
25116 /// # Example
25117 /// ```ignore,no_run
25118 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
25119 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_size(42);
25120 /// ```
25121 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25122 self.page_size = v.into();
25123 self
25124 }
25125
25126 /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
25127 ///
25128 /// # Example
25129 /// ```ignore,no_run
25130 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
25131 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_token("example");
25132 /// ```
25133 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25134 self.page_token = v.into();
25135 self
25136 }
25137}
25138
25139impl wkt::message::Message for ListTlsInspectionPoliciesRequest {
25140 fn typename() -> &'static str {
25141 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest"
25142 }
25143}
25144
25145/// Response returned by the ListTlsInspectionPolicies method.
25146#[derive(Clone, Default, PartialEq)]
25147#[non_exhaustive]
25148pub struct ListTlsInspectionPoliciesResponse {
25149 /// List of TlsInspectionPolicies resources.
25150 pub tls_inspection_policies: std::vec::Vec<crate::model::TlsInspectionPolicy>,
25151
25152 /// If there might be more results than those appearing in this response, then
25153 /// 'next_page_token' is included. To get the next set of results, call this
25154 /// method again using the value of 'next_page_token' as 'page_token'.
25155 pub next_page_token: std::string::String,
25156
25157 /// Locations that could not be reached.
25158 pub unreachable: std::vec::Vec<std::string::String>,
25159
25160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25161}
25162
25163impl ListTlsInspectionPoliciesResponse {
25164 /// Creates a new default instance.
25165 pub fn new() -> Self {
25166 std::default::Default::default()
25167 }
25168
25169 /// Sets the value of [tls_inspection_policies][crate::model::ListTlsInspectionPoliciesResponse::tls_inspection_policies].
25170 ///
25171 /// # Example
25172 /// ```ignore,no_run
25173 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
25174 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25175 /// let x = ListTlsInspectionPoliciesResponse::new()
25176 /// .set_tls_inspection_policies([
25177 /// TlsInspectionPolicy::default()/* use setters */,
25178 /// TlsInspectionPolicy::default()/* use (different) setters */,
25179 /// ]);
25180 /// ```
25181 pub fn set_tls_inspection_policies<T, V>(mut self, v: T) -> Self
25182 where
25183 T: std::iter::IntoIterator<Item = V>,
25184 V: std::convert::Into<crate::model::TlsInspectionPolicy>,
25185 {
25186 use std::iter::Iterator;
25187 self.tls_inspection_policies = v.into_iter().map(|i| i.into()).collect();
25188 self
25189 }
25190
25191 /// Sets the value of [next_page_token][crate::model::ListTlsInspectionPoliciesResponse::next_page_token].
25192 ///
25193 /// # Example
25194 /// ```ignore,no_run
25195 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
25196 /// let x = ListTlsInspectionPoliciesResponse::new().set_next_page_token("example");
25197 /// ```
25198 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25199 self.next_page_token = v.into();
25200 self
25201 }
25202
25203 /// Sets the value of [unreachable][crate::model::ListTlsInspectionPoliciesResponse::unreachable].
25204 ///
25205 /// # Example
25206 /// ```ignore,no_run
25207 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
25208 /// let x = ListTlsInspectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
25209 /// ```
25210 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25211 where
25212 T: std::iter::IntoIterator<Item = V>,
25213 V: std::convert::Into<std::string::String>,
25214 {
25215 use std::iter::Iterator;
25216 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25217 self
25218 }
25219}
25220
25221impl wkt::message::Message for ListTlsInspectionPoliciesResponse {
25222 fn typename() -> &'static str {
25223 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse"
25224 }
25225}
25226
25227#[doc(hidden)]
25228impl google_cloud_gax::paginator::internal::PageableResponse for ListTlsInspectionPoliciesResponse {
25229 type PageItem = crate::model::TlsInspectionPolicy;
25230
25231 fn items(self) -> std::vec::Vec<Self::PageItem> {
25232 self.tls_inspection_policies
25233 }
25234
25235 fn next_page_token(&self) -> std::string::String {
25236 use std::clone::Clone;
25237 self.next_page_token.clone()
25238 }
25239}
25240
25241/// Request used by the GetTlsInspectionPolicy method.
25242#[derive(Clone, Default, PartialEq)]
25243#[non_exhaustive]
25244pub struct GetTlsInspectionPolicyRequest {
25245 /// Required. A name of the TlsInspectionPolicy to get. Must be in the format
25246 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
25247 pub name: std::string::String,
25248
25249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25250}
25251
25252impl GetTlsInspectionPolicyRequest {
25253 /// Creates a new default instance.
25254 pub fn new() -> Self {
25255 std::default::Default::default()
25256 }
25257
25258 /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
25259 ///
25260 /// # Example
25261 /// ```ignore,no_run
25262 /// # use google_cloud_networksecurity_v1::model::GetTlsInspectionPolicyRequest;
25263 /// let x = GetTlsInspectionPolicyRequest::new().set_name("example");
25264 /// ```
25265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25266 self.name = v.into();
25267 self
25268 }
25269}
25270
25271impl wkt::message::Message for GetTlsInspectionPolicyRequest {
25272 fn typename() -> &'static str {
25273 "type.googleapis.com/google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest"
25274 }
25275}
25276
25277/// Request used by the DeleteTlsInspectionPolicy method.
25278#[derive(Clone, Default, PartialEq)]
25279#[non_exhaustive]
25280pub struct DeleteTlsInspectionPolicyRequest {
25281 /// Required. A name of the TlsInspectionPolicy to delete. Must be in the
25282 /// format
25283 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
25284 pub name: std::string::String,
25285
25286 /// If set to true, any rules for this TlsInspectionPolicy will also be
25287 /// deleted. (Otherwise, the request will only work if the TlsInspectionPolicy
25288 /// has no rules.)
25289 pub force: bool,
25290
25291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25292}
25293
25294impl DeleteTlsInspectionPolicyRequest {
25295 /// Creates a new default instance.
25296 pub fn new() -> Self {
25297 std::default::Default::default()
25298 }
25299
25300 /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
25301 ///
25302 /// # Example
25303 /// ```ignore,no_run
25304 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
25305 /// let x = DeleteTlsInspectionPolicyRequest::new().set_name("example");
25306 /// ```
25307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25308 self.name = v.into();
25309 self
25310 }
25311
25312 /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
25313 ///
25314 /// # Example
25315 /// ```ignore,no_run
25316 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
25317 /// let x = DeleteTlsInspectionPolicyRequest::new().set_force(true);
25318 /// ```
25319 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25320 self.force = v.into();
25321 self
25322 }
25323}
25324
25325impl wkt::message::Message for DeleteTlsInspectionPolicyRequest {
25326 fn typename() -> &'static str {
25327 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest"
25328 }
25329}
25330
25331/// Request used by the UpdateTlsInspectionPolicy method.
25332#[derive(Clone, Default, PartialEq)]
25333#[non_exhaustive]
25334pub struct UpdateTlsInspectionPolicyRequest {
25335 /// Optional. Field mask is used to specify the fields to be overwritten in the
25336 /// TlsInspectionPolicy resource by the update.
25337 /// The fields specified in the update_mask are relative to the resource, not
25338 /// the full request. A field will be overwritten if it is in the mask. If the
25339 /// user does not provide a mask then all fields will be overwritten.
25340 pub update_mask: std::option::Option<wkt::FieldMask>,
25341
25342 /// Required. Updated TlsInspectionPolicy resource.
25343 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
25344
25345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25346}
25347
25348impl UpdateTlsInspectionPolicyRequest {
25349 /// Creates a new default instance.
25350 pub fn new() -> Self {
25351 std::default::Default::default()
25352 }
25353
25354 /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
25355 ///
25356 /// # Example
25357 /// ```ignore,no_run
25358 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25359 /// use wkt::FieldMask;
25360 /// let x = UpdateTlsInspectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
25361 /// ```
25362 pub fn set_update_mask<T>(mut self, v: T) -> Self
25363 where
25364 T: std::convert::Into<wkt::FieldMask>,
25365 {
25366 self.update_mask = std::option::Option::Some(v.into());
25367 self
25368 }
25369
25370 /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
25371 ///
25372 /// # Example
25373 /// ```ignore,no_run
25374 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25375 /// use wkt::FieldMask;
25376 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
25377 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
25378 /// ```
25379 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25380 where
25381 T: std::convert::Into<wkt::FieldMask>,
25382 {
25383 self.update_mask = v.map(|x| x.into());
25384 self
25385 }
25386
25387 /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
25388 ///
25389 /// # Example
25390 /// ```ignore,no_run
25391 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25392 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25393 /// let x = UpdateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
25394 /// ```
25395 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
25396 where
25397 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25398 {
25399 self.tls_inspection_policy = std::option::Option::Some(v.into());
25400 self
25401 }
25402
25403 /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
25404 ///
25405 /// # Example
25406 /// ```ignore,no_run
25407 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25408 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25409 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
25410 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
25411 /// ```
25412 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
25413 where
25414 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25415 {
25416 self.tls_inspection_policy = v.map(|x| x.into());
25417 self
25418 }
25419}
25420
25421impl wkt::message::Message for UpdateTlsInspectionPolicyRequest {
25422 fn typename() -> &'static str {
25423 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest"
25424 }
25425}
25426
25427/// UrlList proto helps users to set reusable, independently manageable lists
25428/// of hosts, host patterns, URLs, URL patterns.
25429#[derive(Clone, Default, PartialEq)]
25430#[non_exhaustive]
25431pub struct UrlList {
25432 /// Required. Name of the resource provided by the user.
25433 /// Name is of the form
25434 /// projects/{project}/locations/{location}/urlLists/{url_list}
25435 /// url_list should match the
25436 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
25437 pub name: std::string::String,
25438
25439 /// Output only. Time when the security policy was created.
25440 pub create_time: std::option::Option<wkt::Timestamp>,
25441
25442 /// Output only. Time when the security policy was updated.
25443 pub update_time: std::option::Option<wkt::Timestamp>,
25444
25445 /// Optional. Free-text description of the resource.
25446 pub description: std::string::String,
25447
25448 /// Required. FQDNs and URLs.
25449 pub values: std::vec::Vec<std::string::String>,
25450
25451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25452}
25453
25454impl UrlList {
25455 /// Creates a new default instance.
25456 pub fn new() -> Self {
25457 std::default::Default::default()
25458 }
25459
25460 /// Sets the value of [name][crate::model::UrlList::name].
25461 ///
25462 /// # Example
25463 /// ```ignore,no_run
25464 /// # use google_cloud_networksecurity_v1::model::UrlList;
25465 /// let x = UrlList::new().set_name("example");
25466 /// ```
25467 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25468 self.name = v.into();
25469 self
25470 }
25471
25472 /// Sets the value of [create_time][crate::model::UrlList::create_time].
25473 ///
25474 /// # Example
25475 /// ```ignore,no_run
25476 /// # use google_cloud_networksecurity_v1::model::UrlList;
25477 /// use wkt::Timestamp;
25478 /// let x = UrlList::new().set_create_time(Timestamp::default()/* use setters */);
25479 /// ```
25480 pub fn set_create_time<T>(mut self, v: T) -> Self
25481 where
25482 T: std::convert::Into<wkt::Timestamp>,
25483 {
25484 self.create_time = std::option::Option::Some(v.into());
25485 self
25486 }
25487
25488 /// Sets or clears the value of [create_time][crate::model::UrlList::create_time].
25489 ///
25490 /// # Example
25491 /// ```ignore,no_run
25492 /// # use google_cloud_networksecurity_v1::model::UrlList;
25493 /// use wkt::Timestamp;
25494 /// let x = UrlList::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
25495 /// let x = UrlList::new().set_or_clear_create_time(None::<Timestamp>);
25496 /// ```
25497 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
25498 where
25499 T: std::convert::Into<wkt::Timestamp>,
25500 {
25501 self.create_time = v.map(|x| x.into());
25502 self
25503 }
25504
25505 /// Sets the value of [update_time][crate::model::UrlList::update_time].
25506 ///
25507 /// # Example
25508 /// ```ignore,no_run
25509 /// # use google_cloud_networksecurity_v1::model::UrlList;
25510 /// use wkt::Timestamp;
25511 /// let x = UrlList::new().set_update_time(Timestamp::default()/* use setters */);
25512 /// ```
25513 pub fn set_update_time<T>(mut self, v: T) -> Self
25514 where
25515 T: std::convert::Into<wkt::Timestamp>,
25516 {
25517 self.update_time = std::option::Option::Some(v.into());
25518 self
25519 }
25520
25521 /// Sets or clears the value of [update_time][crate::model::UrlList::update_time].
25522 ///
25523 /// # Example
25524 /// ```ignore,no_run
25525 /// # use google_cloud_networksecurity_v1::model::UrlList;
25526 /// use wkt::Timestamp;
25527 /// let x = UrlList::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
25528 /// let x = UrlList::new().set_or_clear_update_time(None::<Timestamp>);
25529 /// ```
25530 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
25531 where
25532 T: std::convert::Into<wkt::Timestamp>,
25533 {
25534 self.update_time = v.map(|x| x.into());
25535 self
25536 }
25537
25538 /// Sets the value of [description][crate::model::UrlList::description].
25539 ///
25540 /// # Example
25541 /// ```ignore,no_run
25542 /// # use google_cloud_networksecurity_v1::model::UrlList;
25543 /// let x = UrlList::new().set_description("example");
25544 /// ```
25545 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25546 self.description = v.into();
25547 self
25548 }
25549
25550 /// Sets the value of [values][crate::model::UrlList::values].
25551 ///
25552 /// # Example
25553 /// ```ignore,no_run
25554 /// # use google_cloud_networksecurity_v1::model::UrlList;
25555 /// let x = UrlList::new().set_values(["a", "b", "c"]);
25556 /// ```
25557 pub fn set_values<T, V>(mut self, v: T) -> Self
25558 where
25559 T: std::iter::IntoIterator<Item = V>,
25560 V: std::convert::Into<std::string::String>,
25561 {
25562 use std::iter::Iterator;
25563 self.values = v.into_iter().map(|i| i.into()).collect();
25564 self
25565 }
25566}
25567
25568impl wkt::message::Message for UrlList {
25569 fn typename() -> &'static str {
25570 "type.googleapis.com/google.cloud.networksecurity.v1.UrlList"
25571 }
25572}
25573
25574/// Request used by the ListUrlList method.
25575#[derive(Clone, Default, PartialEq)]
25576#[non_exhaustive]
25577pub struct ListUrlListsRequest {
25578 /// Required. The project and location from which the UrlLists should
25579 /// be listed, specified in the format
25580 /// `projects/{project}/locations/{location}`.
25581 pub parent: std::string::String,
25582
25583 /// Maximum number of UrlLists to return per call.
25584 pub page_size: i32,
25585
25586 /// The value returned by the last `ListUrlListsResponse`
25587 /// Indicates that this is a continuation of a prior
25588 /// `ListUrlLists` call, and that the system
25589 /// should return the next page of data.
25590 pub page_token: std::string::String,
25591
25592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25593}
25594
25595impl ListUrlListsRequest {
25596 /// Creates a new default instance.
25597 pub fn new() -> Self {
25598 std::default::Default::default()
25599 }
25600
25601 /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
25602 ///
25603 /// # Example
25604 /// ```ignore,no_run
25605 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25606 /// let x = ListUrlListsRequest::new().set_parent("example");
25607 /// ```
25608 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25609 self.parent = v.into();
25610 self
25611 }
25612
25613 /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
25614 ///
25615 /// # Example
25616 /// ```ignore,no_run
25617 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25618 /// let x = ListUrlListsRequest::new().set_page_size(42);
25619 /// ```
25620 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25621 self.page_size = v.into();
25622 self
25623 }
25624
25625 /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
25626 ///
25627 /// # Example
25628 /// ```ignore,no_run
25629 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25630 /// let x = ListUrlListsRequest::new().set_page_token("example");
25631 /// ```
25632 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25633 self.page_token = v.into();
25634 self
25635 }
25636}
25637
25638impl wkt::message::Message for ListUrlListsRequest {
25639 fn typename() -> &'static str {
25640 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsRequest"
25641 }
25642}
25643
25644/// Response returned by the ListUrlLists method.
25645#[derive(Clone, Default, PartialEq)]
25646#[non_exhaustive]
25647pub struct ListUrlListsResponse {
25648 /// List of UrlList resources.
25649 pub url_lists: std::vec::Vec<crate::model::UrlList>,
25650
25651 /// If there might be more results than those appearing in this response, then
25652 /// `next_page_token` is included. To get the next set of results, call this
25653 /// method again using the value of `next_page_token` as `page_token`.
25654 pub next_page_token: std::string::String,
25655
25656 /// Locations that could not be reached.
25657 pub unreachable: std::vec::Vec<std::string::String>,
25658
25659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25660}
25661
25662impl ListUrlListsResponse {
25663 /// Creates a new default instance.
25664 pub fn new() -> Self {
25665 std::default::Default::default()
25666 }
25667
25668 /// Sets the value of [url_lists][crate::model::ListUrlListsResponse::url_lists].
25669 ///
25670 /// # Example
25671 /// ```ignore,no_run
25672 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25673 /// use google_cloud_networksecurity_v1::model::UrlList;
25674 /// let x = ListUrlListsResponse::new()
25675 /// .set_url_lists([
25676 /// UrlList::default()/* use setters */,
25677 /// UrlList::default()/* use (different) setters */,
25678 /// ]);
25679 /// ```
25680 pub fn set_url_lists<T, V>(mut self, v: T) -> Self
25681 where
25682 T: std::iter::IntoIterator<Item = V>,
25683 V: std::convert::Into<crate::model::UrlList>,
25684 {
25685 use std::iter::Iterator;
25686 self.url_lists = v.into_iter().map(|i| i.into()).collect();
25687 self
25688 }
25689
25690 /// Sets the value of [next_page_token][crate::model::ListUrlListsResponse::next_page_token].
25691 ///
25692 /// # Example
25693 /// ```ignore,no_run
25694 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25695 /// let x = ListUrlListsResponse::new().set_next_page_token("example");
25696 /// ```
25697 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25698 self.next_page_token = v.into();
25699 self
25700 }
25701
25702 /// Sets the value of [unreachable][crate::model::ListUrlListsResponse::unreachable].
25703 ///
25704 /// # Example
25705 /// ```ignore,no_run
25706 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25707 /// let x = ListUrlListsResponse::new().set_unreachable(["a", "b", "c"]);
25708 /// ```
25709 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25710 where
25711 T: std::iter::IntoIterator<Item = V>,
25712 V: std::convert::Into<std::string::String>,
25713 {
25714 use std::iter::Iterator;
25715 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25716 self
25717 }
25718}
25719
25720impl wkt::message::Message for ListUrlListsResponse {
25721 fn typename() -> &'static str {
25722 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsResponse"
25723 }
25724}
25725
25726#[doc(hidden)]
25727impl google_cloud_gax::paginator::internal::PageableResponse for ListUrlListsResponse {
25728 type PageItem = crate::model::UrlList;
25729
25730 fn items(self) -> std::vec::Vec<Self::PageItem> {
25731 self.url_lists
25732 }
25733
25734 fn next_page_token(&self) -> std::string::String {
25735 use std::clone::Clone;
25736 self.next_page_token.clone()
25737 }
25738}
25739
25740/// Request used by the GetUrlList method.
25741#[derive(Clone, Default, PartialEq)]
25742#[non_exhaustive]
25743pub struct GetUrlListRequest {
25744 /// Required. A name of the UrlList to get. Must be in the format
25745 /// `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 GetUrlListRequest {
25752 /// Creates a new default instance.
25753 pub fn new() -> Self {
25754 std::default::Default::default()
25755 }
25756
25757 /// Sets the value of [name][crate::model::GetUrlListRequest::name].
25758 ///
25759 /// # Example
25760 /// ```ignore,no_run
25761 /// # use google_cloud_networksecurity_v1::model::GetUrlListRequest;
25762 /// let x = GetUrlListRequest::new().set_name("example");
25763 /// ```
25764 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25765 self.name = v.into();
25766 self
25767 }
25768}
25769
25770impl wkt::message::Message for GetUrlListRequest {
25771 fn typename() -> &'static str {
25772 "type.googleapis.com/google.cloud.networksecurity.v1.GetUrlListRequest"
25773 }
25774}
25775
25776/// Request used by the CreateUrlList method.
25777#[derive(Clone, Default, PartialEq)]
25778#[non_exhaustive]
25779pub struct CreateUrlListRequest {
25780 /// Required. The parent resource of the UrlList. Must be in
25781 /// the format `projects/*/locations/{location}`.
25782 pub parent: std::string::String,
25783
25784 /// Required. Short name of the UrlList resource to be created. This value
25785 /// should be 1-63 characters long, containing only letters, numbers, hyphens,
25786 /// and underscores, and should not start with a number. E.g. "url_list".
25787 pub url_list_id: std::string::String,
25788
25789 /// Required. UrlList resource to be created.
25790 pub url_list: std::option::Option<crate::model::UrlList>,
25791
25792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25793}
25794
25795impl CreateUrlListRequest {
25796 /// Creates a new default instance.
25797 pub fn new() -> Self {
25798 std::default::Default::default()
25799 }
25800
25801 /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
25802 ///
25803 /// # Example
25804 /// ```ignore,no_run
25805 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25806 /// let x = CreateUrlListRequest::new().set_parent("example");
25807 /// ```
25808 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25809 self.parent = v.into();
25810 self
25811 }
25812
25813 /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
25814 ///
25815 /// # Example
25816 /// ```ignore,no_run
25817 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25818 /// let x = CreateUrlListRequest::new().set_url_list_id("example");
25819 /// ```
25820 pub fn set_url_list_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25821 self.url_list_id = v.into();
25822 self
25823 }
25824
25825 /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
25826 ///
25827 /// # Example
25828 /// ```ignore,no_run
25829 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25830 /// use google_cloud_networksecurity_v1::model::UrlList;
25831 /// let x = CreateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
25832 /// ```
25833 pub fn set_url_list<T>(mut self, v: T) -> Self
25834 where
25835 T: std::convert::Into<crate::model::UrlList>,
25836 {
25837 self.url_list = std::option::Option::Some(v.into());
25838 self
25839 }
25840
25841 /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
25842 ///
25843 /// # Example
25844 /// ```ignore,no_run
25845 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25846 /// use google_cloud_networksecurity_v1::model::UrlList;
25847 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
25848 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
25849 /// ```
25850 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
25851 where
25852 T: std::convert::Into<crate::model::UrlList>,
25853 {
25854 self.url_list = v.map(|x| x.into());
25855 self
25856 }
25857}
25858
25859impl wkt::message::Message for CreateUrlListRequest {
25860 fn typename() -> &'static str {
25861 "type.googleapis.com/google.cloud.networksecurity.v1.CreateUrlListRequest"
25862 }
25863}
25864
25865/// Request used by UpdateUrlList method.
25866#[derive(Clone, Default, PartialEq)]
25867#[non_exhaustive]
25868pub struct UpdateUrlListRequest {
25869 /// Optional. Field mask is used to specify the fields to be overwritten in the
25870 /// UrlList resource by the update. The fields
25871 /// specified in the update_mask are relative to the resource, not
25872 /// the full request. A field will be overwritten if it is in the
25873 /// mask. If the user does not provide a mask then all fields will be
25874 /// overwritten.
25875 pub update_mask: std::option::Option<wkt::FieldMask>,
25876
25877 /// Required. Updated UrlList resource.
25878 pub url_list: std::option::Option<crate::model::UrlList>,
25879
25880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25881}
25882
25883impl UpdateUrlListRequest {
25884 /// Creates a new default instance.
25885 pub fn new() -> Self {
25886 std::default::Default::default()
25887 }
25888
25889 /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
25890 ///
25891 /// # Example
25892 /// ```ignore,no_run
25893 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25894 /// use wkt::FieldMask;
25895 /// let x = UpdateUrlListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
25896 /// ```
25897 pub fn set_update_mask<T>(mut self, v: T) -> Self
25898 where
25899 T: std::convert::Into<wkt::FieldMask>,
25900 {
25901 self.update_mask = std::option::Option::Some(v.into());
25902 self
25903 }
25904
25905 /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
25906 ///
25907 /// # Example
25908 /// ```ignore,no_run
25909 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25910 /// use wkt::FieldMask;
25911 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
25912 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
25913 /// ```
25914 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25915 where
25916 T: std::convert::Into<wkt::FieldMask>,
25917 {
25918 self.update_mask = v.map(|x| x.into());
25919 self
25920 }
25921
25922 /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
25923 ///
25924 /// # Example
25925 /// ```ignore,no_run
25926 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25927 /// use google_cloud_networksecurity_v1::model::UrlList;
25928 /// let x = UpdateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
25929 /// ```
25930 pub fn set_url_list<T>(mut self, v: T) -> Self
25931 where
25932 T: std::convert::Into<crate::model::UrlList>,
25933 {
25934 self.url_list = std::option::Option::Some(v.into());
25935 self
25936 }
25937
25938 /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
25939 ///
25940 /// # Example
25941 /// ```ignore,no_run
25942 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25943 /// use google_cloud_networksecurity_v1::model::UrlList;
25944 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
25945 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
25946 /// ```
25947 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
25948 where
25949 T: std::convert::Into<crate::model::UrlList>,
25950 {
25951 self.url_list = v.map(|x| x.into());
25952 self
25953 }
25954}
25955
25956impl wkt::message::Message for UpdateUrlListRequest {
25957 fn typename() -> &'static str {
25958 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateUrlListRequest"
25959 }
25960}
25961
25962/// Request used by the DeleteUrlList method.
25963#[derive(Clone, Default, PartialEq)]
25964#[non_exhaustive]
25965pub struct DeleteUrlListRequest {
25966 /// Required. A name of the UrlList to delete. Must be in
25967 /// the format `projects/*/locations/{location}/urlLists/*`.
25968 pub name: std::string::String,
25969
25970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25971}
25972
25973impl DeleteUrlListRequest {
25974 /// Creates a new default instance.
25975 pub fn new() -> Self {
25976 std::default::Default::default()
25977 }
25978
25979 /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
25980 ///
25981 /// # Example
25982 /// ```ignore,no_run
25983 /// # use google_cloud_networksecurity_v1::model::DeleteUrlListRequest;
25984 /// let x = DeleteUrlListRequest::new().set_name("example");
25985 /// ```
25986 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25987 self.name = v.into();
25988 self
25989 }
25990}
25991
25992impl wkt::message::Message for DeleteUrlListRequest {
25993 fn typename() -> &'static str {
25994 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteUrlListRequest"
25995 }
25996}
25997
25998/// Severity level.
25999///
26000/// # Working with unknown values
26001///
26002/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26003/// additional enum variants at any time. Adding new variants is not considered
26004/// a breaking change. Applications should write their code in anticipation of:
26005///
26006/// - New values appearing in future releases of the client library, **and**
26007/// - New values received dynamically, without application changes.
26008///
26009/// Please consult the [Working with enums] section in the user guide for some
26010/// guidelines.
26011///
26012/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26013#[derive(Clone, Debug, PartialEq)]
26014#[non_exhaustive]
26015pub enum Severity {
26016 /// Severity level not specified.
26017 Unspecified,
26018 /// Suspicious events that do not pose an immediate threat, but that are
26019 /// reported to call attention to deeper problems that could possibly exist.
26020 Informational,
26021 /// Warning-level threats that have very little impact on an organization's
26022 /// infrastructure. They usually require local or physical system access and
26023 /// may often result in victim privacy issues and information leakage.
26024 Low,
26025 /// Minor threats in which impact is minimized, that do not compromise the
26026 /// target or exploits that require an attacker to reside on the same local
26027 /// network as the victim, affect only non-standard configurations or obscure
26028 /// applications, or provide very limited access.
26029 Medium,
26030 /// Threats that have the ability to become critical but have mitigating
26031 /// factors; for example, they may be difficult to exploit, do not result in
26032 /// elevated privileges, or do not have a large victim pool.
26033 High,
26034 /// Serious threats, such as those that affect default installations of widely
26035 /// deployed software, result in root compromise of servers, and the exploit
26036 /// code is widely available to attackers. The attacker usually does not need
26037 /// any special authentication credentials or knowledge about the individual
26038 /// victims and the target does not need to be manipulated into performing any
26039 /// special functions.
26040 Critical,
26041 /// If set, the enum was initialized with an unknown value.
26042 ///
26043 /// Applications can examine the value using [Severity::value] or
26044 /// [Severity::name].
26045 UnknownValue(severity::UnknownValue),
26046}
26047
26048#[doc(hidden)]
26049pub mod severity {
26050 #[allow(unused_imports)]
26051 use super::*;
26052 #[derive(Clone, Debug, PartialEq)]
26053 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26054}
26055
26056impl Severity {
26057 /// Gets the enum value.
26058 ///
26059 /// Returns `None` if the enum contains an unknown value deserialized from
26060 /// the string representation of enums.
26061 pub fn value(&self) -> std::option::Option<i32> {
26062 match self {
26063 Self::Unspecified => std::option::Option::Some(0),
26064 Self::Informational => std::option::Option::Some(1),
26065 Self::Low => std::option::Option::Some(2),
26066 Self::Medium => std::option::Option::Some(3),
26067 Self::High => std::option::Option::Some(4),
26068 Self::Critical => std::option::Option::Some(5),
26069 Self::UnknownValue(u) => u.0.value(),
26070 }
26071 }
26072
26073 /// Gets the enum value as a string.
26074 ///
26075 /// Returns `None` if the enum contains an unknown value deserialized from
26076 /// the integer representation of enums.
26077 pub fn name(&self) -> std::option::Option<&str> {
26078 match self {
26079 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
26080 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
26081 Self::Low => std::option::Option::Some("LOW"),
26082 Self::Medium => std::option::Option::Some("MEDIUM"),
26083 Self::High => std::option::Option::Some("HIGH"),
26084 Self::Critical => std::option::Option::Some("CRITICAL"),
26085 Self::UnknownValue(u) => u.0.name(),
26086 }
26087 }
26088}
26089
26090impl std::default::Default for Severity {
26091 fn default() -> Self {
26092 use std::convert::From;
26093 Self::from(0)
26094 }
26095}
26096
26097impl std::fmt::Display for Severity {
26098 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26099 wkt::internal::display_enum(f, self.name(), self.value())
26100 }
26101}
26102
26103impl std::convert::From<i32> for Severity {
26104 fn from(value: i32) -> Self {
26105 match value {
26106 0 => Self::Unspecified,
26107 1 => Self::Informational,
26108 2 => Self::Low,
26109 3 => Self::Medium,
26110 4 => Self::High,
26111 5 => Self::Critical,
26112 _ => Self::UnknownValue(severity::UnknownValue(
26113 wkt::internal::UnknownEnumValue::Integer(value),
26114 )),
26115 }
26116 }
26117}
26118
26119impl std::convert::From<&str> for Severity {
26120 fn from(value: &str) -> Self {
26121 use std::string::ToString;
26122 match value {
26123 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
26124 "INFORMATIONAL" => Self::Informational,
26125 "LOW" => Self::Low,
26126 "MEDIUM" => Self::Medium,
26127 "HIGH" => Self::High,
26128 "CRITICAL" => Self::Critical,
26129 _ => Self::UnknownValue(severity::UnknownValue(
26130 wkt::internal::UnknownEnumValue::String(value.to_string()),
26131 )),
26132 }
26133 }
26134}
26135
26136impl serde::ser::Serialize for Severity {
26137 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26138 where
26139 S: serde::Serializer,
26140 {
26141 match self {
26142 Self::Unspecified => serializer.serialize_i32(0),
26143 Self::Informational => serializer.serialize_i32(1),
26144 Self::Low => serializer.serialize_i32(2),
26145 Self::Medium => serializer.serialize_i32(3),
26146 Self::High => serializer.serialize_i32(4),
26147 Self::Critical => serializer.serialize_i32(5),
26148 Self::UnknownValue(u) => u.0.serialize(serializer),
26149 }
26150 }
26151}
26152
26153impl<'de> serde::de::Deserialize<'de> for Severity {
26154 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26155 where
26156 D: serde::Deserializer<'de>,
26157 {
26158 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
26159 ".google.cloud.networksecurity.v1.Severity",
26160 ))
26161 }
26162}
26163
26164/// Type of threat.
26165///
26166/// # Working with unknown values
26167///
26168/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26169/// additional enum variants at any time. Adding new variants is not considered
26170/// a breaking change. Applications should write their code in anticipation of:
26171///
26172/// - New values appearing in future releases of the client library, **and**
26173/// - New values received dynamically, without application changes.
26174///
26175/// Please consult the [Working with enums] section in the user guide for some
26176/// guidelines.
26177///
26178/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26179#[derive(Clone, Debug, PartialEq)]
26180#[non_exhaustive]
26181pub enum ThreatType {
26182 /// Type of threat not specified.
26183 Unspecified,
26184 /// Type of threat is not derivable from threat ID. An override will be
26185 /// created for all types. Firewall will ignore overridden signature ID's
26186 /// that don't exist in the specific type.
26187 Unknown,
26188 /// Threats related to system flaws that an attacker might otherwise attempt
26189 /// to exploit.
26190 Vulnerability,
26191 /// Threats related to viruses and malware found in executables and file
26192 /// types.
26193 Antivirus,
26194 /// Threats related to command-and-control (C2) activity, where spyware on an
26195 /// infected client is collecting data without the user's consent and/or
26196 /// communicating with a remote attacker.
26197 Spyware,
26198 /// Threats related to DNS.
26199 Dns,
26200 /// If set, the enum was initialized with an unknown value.
26201 ///
26202 /// Applications can examine the value using [ThreatType::value] or
26203 /// [ThreatType::name].
26204 UnknownValue(threat_type::UnknownValue),
26205}
26206
26207#[doc(hidden)]
26208pub mod threat_type {
26209 #[allow(unused_imports)]
26210 use super::*;
26211 #[derive(Clone, Debug, PartialEq)]
26212 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26213}
26214
26215impl ThreatType {
26216 /// Gets the enum value.
26217 ///
26218 /// Returns `None` if the enum contains an unknown value deserialized from
26219 /// the string representation of enums.
26220 pub fn value(&self) -> std::option::Option<i32> {
26221 match self {
26222 Self::Unspecified => std::option::Option::Some(0),
26223 Self::Unknown => std::option::Option::Some(1),
26224 Self::Vulnerability => std::option::Option::Some(2),
26225 Self::Antivirus => std::option::Option::Some(3),
26226 Self::Spyware => std::option::Option::Some(4),
26227 Self::Dns => std::option::Option::Some(5),
26228 Self::UnknownValue(u) => u.0.value(),
26229 }
26230 }
26231
26232 /// Gets the enum value as a string.
26233 ///
26234 /// Returns `None` if the enum contains an unknown value deserialized from
26235 /// the integer representation of enums.
26236 pub fn name(&self) -> std::option::Option<&str> {
26237 match self {
26238 Self::Unspecified => std::option::Option::Some("THREAT_TYPE_UNSPECIFIED"),
26239 Self::Unknown => std::option::Option::Some("UNKNOWN"),
26240 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
26241 Self::Antivirus => std::option::Option::Some("ANTIVIRUS"),
26242 Self::Spyware => std::option::Option::Some("SPYWARE"),
26243 Self::Dns => std::option::Option::Some("DNS"),
26244 Self::UnknownValue(u) => u.0.name(),
26245 }
26246 }
26247}
26248
26249impl std::default::Default for ThreatType {
26250 fn default() -> Self {
26251 use std::convert::From;
26252 Self::from(0)
26253 }
26254}
26255
26256impl std::fmt::Display for ThreatType {
26257 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26258 wkt::internal::display_enum(f, self.name(), self.value())
26259 }
26260}
26261
26262impl std::convert::From<i32> for ThreatType {
26263 fn from(value: i32) -> Self {
26264 match value {
26265 0 => Self::Unspecified,
26266 1 => Self::Unknown,
26267 2 => Self::Vulnerability,
26268 3 => Self::Antivirus,
26269 4 => Self::Spyware,
26270 5 => Self::Dns,
26271 _ => Self::UnknownValue(threat_type::UnknownValue(
26272 wkt::internal::UnknownEnumValue::Integer(value),
26273 )),
26274 }
26275 }
26276}
26277
26278impl std::convert::From<&str> for ThreatType {
26279 fn from(value: &str) -> Self {
26280 use std::string::ToString;
26281 match value {
26282 "THREAT_TYPE_UNSPECIFIED" => Self::Unspecified,
26283 "UNKNOWN" => Self::Unknown,
26284 "VULNERABILITY" => Self::Vulnerability,
26285 "ANTIVIRUS" => Self::Antivirus,
26286 "SPYWARE" => Self::Spyware,
26287 "DNS" => Self::Dns,
26288 _ => Self::UnknownValue(threat_type::UnknownValue(
26289 wkt::internal::UnknownEnumValue::String(value.to_string()),
26290 )),
26291 }
26292 }
26293}
26294
26295impl serde::ser::Serialize for ThreatType {
26296 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26297 where
26298 S: serde::Serializer,
26299 {
26300 match self {
26301 Self::Unspecified => serializer.serialize_i32(0),
26302 Self::Unknown => serializer.serialize_i32(1),
26303 Self::Vulnerability => serializer.serialize_i32(2),
26304 Self::Antivirus => serializer.serialize_i32(3),
26305 Self::Spyware => serializer.serialize_i32(4),
26306 Self::Dns => serializer.serialize_i32(5),
26307 Self::UnknownValue(u) => u.0.serialize(serializer),
26308 }
26309 }
26310}
26311
26312impl<'de> serde::de::Deserialize<'de> for ThreatType {
26313 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26314 where
26315 D: serde::Deserializer<'de>,
26316 {
26317 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatType>::new(
26318 ".google.cloud.networksecurity.v1.ThreatType",
26319 ))
26320 }
26321}
26322
26323/// Threat action override.
26324///
26325/// # Working with unknown values
26326///
26327/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26328/// additional enum variants at any time. Adding new variants is not considered
26329/// a breaking change. Applications should write their code in anticipation of:
26330///
26331/// - New values appearing in future releases of the client library, **and**
26332/// - New values received dynamically, without application changes.
26333///
26334/// Please consult the [Working with enums] section in the user guide for some
26335/// guidelines.
26336///
26337/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26338#[derive(Clone, Debug, PartialEq)]
26339#[non_exhaustive]
26340pub enum ThreatAction {
26341 /// Threat action not specified.
26342 Unspecified,
26343 /// The default action (as specified by the vendor) is taken.
26344 DefaultAction,
26345 /// The packet matching this rule will be allowed to transmit.
26346 Allow,
26347 /// The packet matching this rule will be allowed to transmit, but a threat_log
26348 /// entry will be sent to the consumer project.
26349 Alert,
26350 /// The packet matching this rule will be dropped, and a threat_log entry will
26351 /// be sent to the consumer project.
26352 Deny,
26353 /// If set, the enum was initialized with an unknown value.
26354 ///
26355 /// Applications can examine the value using [ThreatAction::value] or
26356 /// [ThreatAction::name].
26357 UnknownValue(threat_action::UnknownValue),
26358}
26359
26360#[doc(hidden)]
26361pub mod threat_action {
26362 #[allow(unused_imports)]
26363 use super::*;
26364 #[derive(Clone, Debug, PartialEq)]
26365 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26366}
26367
26368impl ThreatAction {
26369 /// Gets the enum value.
26370 ///
26371 /// Returns `None` if the enum contains an unknown value deserialized from
26372 /// the string representation of enums.
26373 pub fn value(&self) -> std::option::Option<i32> {
26374 match self {
26375 Self::Unspecified => std::option::Option::Some(0),
26376 Self::DefaultAction => std::option::Option::Some(4),
26377 Self::Allow => std::option::Option::Some(1),
26378 Self::Alert => std::option::Option::Some(2),
26379 Self::Deny => std::option::Option::Some(3),
26380 Self::UnknownValue(u) => u.0.value(),
26381 }
26382 }
26383
26384 /// Gets the enum value as a string.
26385 ///
26386 /// Returns `None` if the enum contains an unknown value deserialized from
26387 /// the integer representation of enums.
26388 pub fn name(&self) -> std::option::Option<&str> {
26389 match self {
26390 Self::Unspecified => std::option::Option::Some("THREAT_ACTION_UNSPECIFIED"),
26391 Self::DefaultAction => std::option::Option::Some("DEFAULT_ACTION"),
26392 Self::Allow => std::option::Option::Some("ALLOW"),
26393 Self::Alert => std::option::Option::Some("ALERT"),
26394 Self::Deny => std::option::Option::Some("DENY"),
26395 Self::UnknownValue(u) => u.0.name(),
26396 }
26397 }
26398}
26399
26400impl std::default::Default for ThreatAction {
26401 fn default() -> Self {
26402 use std::convert::From;
26403 Self::from(0)
26404 }
26405}
26406
26407impl std::fmt::Display for ThreatAction {
26408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26409 wkt::internal::display_enum(f, self.name(), self.value())
26410 }
26411}
26412
26413impl std::convert::From<i32> for ThreatAction {
26414 fn from(value: i32) -> Self {
26415 match value {
26416 0 => Self::Unspecified,
26417 1 => Self::Allow,
26418 2 => Self::Alert,
26419 3 => Self::Deny,
26420 4 => Self::DefaultAction,
26421 _ => Self::UnknownValue(threat_action::UnknownValue(
26422 wkt::internal::UnknownEnumValue::Integer(value),
26423 )),
26424 }
26425 }
26426}
26427
26428impl std::convert::From<&str> for ThreatAction {
26429 fn from(value: &str) -> Self {
26430 use std::string::ToString;
26431 match value {
26432 "THREAT_ACTION_UNSPECIFIED" => Self::Unspecified,
26433 "DEFAULT_ACTION" => Self::DefaultAction,
26434 "ALLOW" => Self::Allow,
26435 "ALERT" => Self::Alert,
26436 "DENY" => Self::Deny,
26437 _ => Self::UnknownValue(threat_action::UnknownValue(
26438 wkt::internal::UnknownEnumValue::String(value.to_string()),
26439 )),
26440 }
26441 }
26442}
26443
26444impl serde::ser::Serialize for ThreatAction {
26445 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26446 where
26447 S: serde::Serializer,
26448 {
26449 match self {
26450 Self::Unspecified => serializer.serialize_i32(0),
26451 Self::DefaultAction => serializer.serialize_i32(4),
26452 Self::Allow => serializer.serialize_i32(1),
26453 Self::Alert => serializer.serialize_i32(2),
26454 Self::Deny => serializer.serialize_i32(3),
26455 Self::UnknownValue(u) => u.0.serialize(serializer),
26456 }
26457 }
26458}
26459
26460impl<'de> serde::de::Deserialize<'de> for ThreatAction {
26461 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26462 where
26463 D: serde::Deserializer<'de>,
26464 {
26465 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatAction>::new(
26466 ".google.cloud.networksecurity.v1.ThreatAction",
26467 ))
26468 }
26469}
26470
26471/// Antivirus protocol.
26472///
26473/// # Working with unknown values
26474///
26475/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26476/// additional enum variants at any time. Adding new variants is not considered
26477/// a breaking change. Applications should write their code in anticipation of:
26478///
26479/// - New values appearing in future releases of the client library, **and**
26480/// - New values received dynamically, without application changes.
26481///
26482/// Please consult the [Working with enums] section in the user guide for some
26483/// guidelines.
26484///
26485/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26486#[derive(Clone, Debug, PartialEq)]
26487#[non_exhaustive]
26488pub enum Protocol {
26489 /// Protocol not specified.
26490 Unspecified,
26491 /// SMTP protocol
26492 Smtp,
26493 /// SMB protocol
26494 Smb,
26495 /// POP3 protocol
26496 Pop3,
26497 /// IMAP protocol
26498 Imap,
26499 /// HTTP2 protocol
26500 Http2,
26501 /// HTTP protocol
26502 Http,
26503 /// FTP protocol
26504 Ftp,
26505 /// If set, the enum was initialized with an unknown value.
26506 ///
26507 /// Applications can examine the value using [Protocol::value] or
26508 /// [Protocol::name].
26509 UnknownValue(protocol::UnknownValue),
26510}
26511
26512#[doc(hidden)]
26513pub mod protocol {
26514 #[allow(unused_imports)]
26515 use super::*;
26516 #[derive(Clone, Debug, PartialEq)]
26517 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26518}
26519
26520impl Protocol {
26521 /// Gets the enum value.
26522 ///
26523 /// Returns `None` if the enum contains an unknown value deserialized from
26524 /// the string representation of enums.
26525 pub fn value(&self) -> std::option::Option<i32> {
26526 match self {
26527 Self::Unspecified => std::option::Option::Some(0),
26528 Self::Smtp => std::option::Option::Some(1),
26529 Self::Smb => std::option::Option::Some(2),
26530 Self::Pop3 => std::option::Option::Some(3),
26531 Self::Imap => std::option::Option::Some(4),
26532 Self::Http2 => std::option::Option::Some(5),
26533 Self::Http => std::option::Option::Some(6),
26534 Self::Ftp => std::option::Option::Some(7),
26535 Self::UnknownValue(u) => u.0.value(),
26536 }
26537 }
26538
26539 /// Gets the enum value as a string.
26540 ///
26541 /// Returns `None` if the enum contains an unknown value deserialized from
26542 /// the integer representation of enums.
26543 pub fn name(&self) -> std::option::Option<&str> {
26544 match self {
26545 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
26546 Self::Smtp => std::option::Option::Some("SMTP"),
26547 Self::Smb => std::option::Option::Some("SMB"),
26548 Self::Pop3 => std::option::Option::Some("POP3"),
26549 Self::Imap => std::option::Option::Some("IMAP"),
26550 Self::Http2 => std::option::Option::Some("HTTP2"),
26551 Self::Http => std::option::Option::Some("HTTP"),
26552 Self::Ftp => std::option::Option::Some("FTP"),
26553 Self::UnknownValue(u) => u.0.name(),
26554 }
26555 }
26556}
26557
26558impl std::default::Default for Protocol {
26559 fn default() -> Self {
26560 use std::convert::From;
26561 Self::from(0)
26562 }
26563}
26564
26565impl std::fmt::Display for Protocol {
26566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26567 wkt::internal::display_enum(f, self.name(), self.value())
26568 }
26569}
26570
26571impl std::convert::From<i32> for Protocol {
26572 fn from(value: i32) -> Self {
26573 match value {
26574 0 => Self::Unspecified,
26575 1 => Self::Smtp,
26576 2 => Self::Smb,
26577 3 => Self::Pop3,
26578 4 => Self::Imap,
26579 5 => Self::Http2,
26580 6 => Self::Http,
26581 7 => Self::Ftp,
26582 _ => Self::UnknownValue(protocol::UnknownValue(
26583 wkt::internal::UnknownEnumValue::Integer(value),
26584 )),
26585 }
26586 }
26587}
26588
26589impl std::convert::From<&str> for Protocol {
26590 fn from(value: &str) -> Self {
26591 use std::string::ToString;
26592 match value {
26593 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
26594 "SMTP" => Self::Smtp,
26595 "SMB" => Self::Smb,
26596 "POP3" => Self::Pop3,
26597 "IMAP" => Self::Imap,
26598 "HTTP2" => Self::Http2,
26599 "HTTP" => Self::Http,
26600 "FTP" => Self::Ftp,
26601 _ => Self::UnknownValue(protocol::UnknownValue(
26602 wkt::internal::UnknownEnumValue::String(value.to_string()),
26603 )),
26604 }
26605 }
26606}
26607
26608impl serde::ser::Serialize for Protocol {
26609 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26610 where
26611 S: serde::Serializer,
26612 {
26613 match self {
26614 Self::Unspecified => serializer.serialize_i32(0),
26615 Self::Smtp => serializer.serialize_i32(1),
26616 Self::Smb => serializer.serialize_i32(2),
26617 Self::Pop3 => serializer.serialize_i32(3),
26618 Self::Imap => serializer.serialize_i32(4),
26619 Self::Http2 => serializer.serialize_i32(5),
26620 Self::Http => serializer.serialize_i32(6),
26621 Self::Ftp => serializer.serialize_i32(7),
26622 Self::UnknownValue(u) => u.0.serialize(serializer),
26623 }
26624 }
26625}
26626
26627impl<'de> serde::de::Deserialize<'de> for Protocol {
26628 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26629 where
26630 D: serde::Deserializer<'de>,
26631 {
26632 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
26633 ".google.cloud.networksecurity.v1.Protocol",
26634 ))
26635 }
26636}