Skip to main content

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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// AddressGroup is a resource that specifies how a collection of IP/DNS used
42/// in Firewall Policy.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct AddressGroup {
46    /// Required. Name of the AddressGroup resource. It matches pattern
47    /// `projects/*/locations/{location}/addressGroups/<address_group>`.
48    pub name: std::string::String,
49
50    /// Optional. Free-text description of the resource.
51    pub description: std::string::String,
52
53    /// Output only. The timestamp when the resource was created.
54    pub create_time: std::option::Option<wkt::Timestamp>,
55
56    /// Output only. The timestamp when the resource was updated.
57    pub update_time: std::option::Option<wkt::Timestamp>,
58
59    /// Optional. Set of label tags associated with the AddressGroup resource.
60    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
61
62    /// Required. The type of the Address Group. Possible values are "IPv4" or
63    /// "IPV6".
64    pub r#type: crate::model::address_group::Type,
65
66    /// Optional. List of items.
67    pub items: std::vec::Vec<std::string::String>,
68
69    /// Required. Capacity of the Address Group
70    pub capacity: i32,
71
72    /// Output only. Server-defined fully-qualified URL for this resource.
73    pub self_link: std::string::String,
74
75    /// Optional. List of supported purposes of the Address Group.
76    pub purpose: std::vec::Vec<crate::model::address_group::Purpose>,
77
78    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl AddressGroup {
82    /// Creates a new default instance.
83    pub fn new() -> Self {
84        std::default::Default::default()
85    }
86
87    /// Sets the value of [name][crate::model::AddressGroup::name].
88    ///
89    /// # Example
90    /// ```ignore,no_run
91    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
92    /// # let project_id = "project_id";
93    /// # let location_id = "location_id";
94    /// # let address_group_id = "address_group_id";
95    /// let x = AddressGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
96    /// ```
97    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98        self.name = v.into();
99        self
100    }
101
102    /// Sets the value of [description][crate::model::AddressGroup::description].
103    ///
104    /// # Example
105    /// ```ignore,no_run
106    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
107    /// let x = AddressGroup::new().set_description("example");
108    /// ```
109    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110        self.description = v.into();
111        self
112    }
113
114    /// Sets the value of [create_time][crate::model::AddressGroup::create_time].
115    ///
116    /// # Example
117    /// ```ignore,no_run
118    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
119    /// use wkt::Timestamp;
120    /// let x = AddressGroup::new().set_create_time(Timestamp::default()/* use setters */);
121    /// ```
122    pub fn set_create_time<T>(mut self, v: T) -> Self
123    where
124        T: std::convert::Into<wkt::Timestamp>,
125    {
126        self.create_time = std::option::Option::Some(v.into());
127        self
128    }
129
130    /// Sets or clears the value of [create_time][crate::model::AddressGroup::create_time].
131    ///
132    /// # Example
133    /// ```ignore,no_run
134    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
135    /// use wkt::Timestamp;
136    /// let x = AddressGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
137    /// let x = AddressGroup::new().set_or_clear_create_time(None::<Timestamp>);
138    /// ```
139    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
140    where
141        T: std::convert::Into<wkt::Timestamp>,
142    {
143        self.create_time = v.map(|x| x.into());
144        self
145    }
146
147    /// Sets the value of [update_time][crate::model::AddressGroup::update_time].
148    ///
149    /// # Example
150    /// ```ignore,no_run
151    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
152    /// use wkt::Timestamp;
153    /// let x = AddressGroup::new().set_update_time(Timestamp::default()/* use setters */);
154    /// ```
155    pub fn set_update_time<T>(mut self, v: T) -> Self
156    where
157        T: std::convert::Into<wkt::Timestamp>,
158    {
159        self.update_time = std::option::Option::Some(v.into());
160        self
161    }
162
163    /// Sets or clears the value of [update_time][crate::model::AddressGroup::update_time].
164    ///
165    /// # Example
166    /// ```ignore,no_run
167    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
168    /// use wkt::Timestamp;
169    /// let x = AddressGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
170    /// let x = AddressGroup::new().set_or_clear_update_time(None::<Timestamp>);
171    /// ```
172    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
173    where
174        T: std::convert::Into<wkt::Timestamp>,
175    {
176        self.update_time = v.map(|x| x.into());
177        self
178    }
179
180    /// Sets the value of [labels][crate::model::AddressGroup::labels].
181    ///
182    /// # Example
183    /// ```ignore,no_run
184    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
185    /// let x = AddressGroup::new().set_labels([
186    ///     ("key0", "abc"),
187    ///     ("key1", "xyz"),
188    /// ]);
189    /// ```
190    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
191    where
192        T: std::iter::IntoIterator<Item = (K, V)>,
193        K: std::convert::Into<std::string::String>,
194        V: std::convert::Into<std::string::String>,
195    {
196        use std::iter::Iterator;
197        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
198        self
199    }
200
201    /// Sets the value of [r#type][crate::model::AddressGroup::type].
202    ///
203    /// # Example
204    /// ```ignore,no_run
205    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
206    /// use google_cloud_networksecurity_v1::model::address_group::Type;
207    /// let x0 = AddressGroup::new().set_type(Type::Ipv4);
208    /// let x1 = AddressGroup::new().set_type(Type::Ipv6);
209    /// ```
210    pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
211        mut self,
212        v: T,
213    ) -> Self {
214        self.r#type = v.into();
215        self
216    }
217
218    /// Sets the value of [items][crate::model::AddressGroup::items].
219    ///
220    /// # Example
221    /// ```ignore,no_run
222    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
223    /// let x = AddressGroup::new().set_items(["a", "b", "c"]);
224    /// ```
225    pub fn set_items<T, V>(mut self, v: T) -> Self
226    where
227        T: std::iter::IntoIterator<Item = V>,
228        V: std::convert::Into<std::string::String>,
229    {
230        use std::iter::Iterator;
231        self.items = v.into_iter().map(|i| i.into()).collect();
232        self
233    }
234
235    /// Sets the value of [capacity][crate::model::AddressGroup::capacity].
236    ///
237    /// # Example
238    /// ```ignore,no_run
239    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
240    /// let x = AddressGroup::new().set_capacity(42);
241    /// ```
242    pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
243        self.capacity = v.into();
244        self
245    }
246
247    /// Sets the value of [self_link][crate::model::AddressGroup::self_link].
248    ///
249    /// # Example
250    /// ```ignore,no_run
251    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
252    /// let x = AddressGroup::new().set_self_link("example");
253    /// ```
254    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
255        self.self_link = v.into();
256        self
257    }
258
259    /// Sets the value of [purpose][crate::model::AddressGroup::purpose].
260    ///
261    /// # Example
262    /// ```ignore,no_run
263    /// # use google_cloud_networksecurity_v1::model::AddressGroup;
264    /// use google_cloud_networksecurity_v1::model::address_group::Purpose;
265    /// let x = AddressGroup::new().set_purpose([
266    ///     Purpose::Default,
267    ///     Purpose::CloudArmor,
268    /// ]);
269    /// ```
270    pub fn set_purpose<T, V>(mut self, v: T) -> Self
271    where
272        T: std::iter::IntoIterator<Item = V>,
273        V: std::convert::Into<crate::model::address_group::Purpose>,
274    {
275        use std::iter::Iterator;
276        self.purpose = v.into_iter().map(|i| i.into()).collect();
277        self
278    }
279}
280
281impl wkt::message::Message for AddressGroup {
282    fn typename() -> &'static str {
283        "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
284    }
285}
286
287/// Defines additional types related to [AddressGroup].
288pub mod address_group {
289    #[allow(unused_imports)]
290    use super::*;
291
292    /// Possible type of the Address Group.
293    ///
294    /// # Working with unknown values
295    ///
296    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
297    /// additional enum variants at any time. Adding new variants is not considered
298    /// a breaking change. Applications should write their code in anticipation of:
299    ///
300    /// - New values appearing in future releases of the client library, **and**
301    /// - New values received dynamically, without application changes.
302    ///
303    /// Please consult the [Working with enums] section in the user guide for some
304    /// guidelines.
305    ///
306    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
307    #[derive(Clone, Debug, PartialEq)]
308    #[non_exhaustive]
309    pub enum Type {
310        /// Default value.
311        Unspecified,
312        /// IP v4 ranges.
313        Ipv4,
314        /// IP v6 ranges.
315        Ipv6,
316        /// If set, the enum was initialized with an unknown value.
317        ///
318        /// Applications can examine the value using [Type::value] or
319        /// [Type::name].
320        UnknownValue(r#type::UnknownValue),
321    }
322
323    #[doc(hidden)]
324    pub mod r#type {
325        #[allow(unused_imports)]
326        use super::*;
327        #[derive(Clone, Debug, PartialEq)]
328        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
329    }
330
331    impl Type {
332        /// Gets the enum value.
333        ///
334        /// Returns `None` if the enum contains an unknown value deserialized from
335        /// the string representation of enums.
336        pub fn value(&self) -> std::option::Option<i32> {
337            match self {
338                Self::Unspecified => std::option::Option::Some(0),
339                Self::Ipv4 => std::option::Option::Some(1),
340                Self::Ipv6 => std::option::Option::Some(2),
341                Self::UnknownValue(u) => u.0.value(),
342            }
343        }
344
345        /// Gets the enum value as a string.
346        ///
347        /// Returns `None` if the enum contains an unknown value deserialized from
348        /// the integer representation of enums.
349        pub fn name(&self) -> std::option::Option<&str> {
350            match self {
351                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
352                Self::Ipv4 => std::option::Option::Some("IPV4"),
353                Self::Ipv6 => std::option::Option::Some("IPV6"),
354                Self::UnknownValue(u) => u.0.name(),
355            }
356        }
357    }
358
359    impl std::default::Default for Type {
360        fn default() -> Self {
361            use std::convert::From;
362            Self::from(0)
363        }
364    }
365
366    impl std::fmt::Display for Type {
367        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
368            wkt::internal::display_enum(f, self.name(), self.value())
369        }
370    }
371
372    impl std::convert::From<i32> for Type {
373        fn from(value: i32) -> Self {
374            match value {
375                0 => Self::Unspecified,
376                1 => Self::Ipv4,
377                2 => Self::Ipv6,
378                _ => Self::UnknownValue(r#type::UnknownValue(
379                    wkt::internal::UnknownEnumValue::Integer(value),
380                )),
381            }
382        }
383    }
384
385    impl std::convert::From<&str> for Type {
386        fn from(value: &str) -> Self {
387            use std::string::ToString;
388            match value {
389                "TYPE_UNSPECIFIED" => Self::Unspecified,
390                "IPV4" => Self::Ipv4,
391                "IPV6" => Self::Ipv6,
392                _ => Self::UnknownValue(r#type::UnknownValue(
393                    wkt::internal::UnknownEnumValue::String(value.to_string()),
394                )),
395            }
396        }
397    }
398
399    impl serde::ser::Serialize for Type {
400        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
401        where
402            S: serde::Serializer,
403        {
404            match self {
405                Self::Unspecified => serializer.serialize_i32(0),
406                Self::Ipv4 => serializer.serialize_i32(1),
407                Self::Ipv6 => serializer.serialize_i32(2),
408                Self::UnknownValue(u) => u.0.serialize(serializer),
409            }
410        }
411    }
412
413    impl<'de> serde::de::Deserialize<'de> for Type {
414        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
415        where
416            D: serde::Deserializer<'de>,
417        {
418            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
419                ".google.cloud.networksecurity.v1.AddressGroup.Type",
420            ))
421        }
422    }
423
424    /// Purpose of the Address Group.
425    ///
426    /// # Working with unknown values
427    ///
428    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
429    /// additional enum variants at any time. Adding new variants is not considered
430    /// a breaking change. Applications should write their code in anticipation of:
431    ///
432    /// - New values appearing in future releases of the client library, **and**
433    /// - New values received dynamically, without application changes.
434    ///
435    /// Please consult the [Working with enums] section in the user guide for some
436    /// guidelines.
437    ///
438    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
439    #[derive(Clone, Debug, PartialEq)]
440    #[non_exhaustive]
441    pub enum Purpose {
442        /// Default value. Should never happen.
443        Unspecified,
444        /// Address Group is distributed to VMC, and is usable in Firewall Policies
445        /// and other systems that rely on VMC.
446        Default,
447        /// Address Group is usable in Cloud Armor.
448        CloudArmor,
449        /// If set, the enum was initialized with an unknown value.
450        ///
451        /// Applications can examine the value using [Purpose::value] or
452        /// [Purpose::name].
453        UnknownValue(purpose::UnknownValue),
454    }
455
456    #[doc(hidden)]
457    pub mod purpose {
458        #[allow(unused_imports)]
459        use super::*;
460        #[derive(Clone, Debug, PartialEq)]
461        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
462    }
463
464    impl Purpose {
465        /// Gets the enum value.
466        ///
467        /// Returns `None` if the enum contains an unknown value deserialized from
468        /// the string representation of enums.
469        pub fn value(&self) -> std::option::Option<i32> {
470            match self {
471                Self::Unspecified => std::option::Option::Some(0),
472                Self::Default => std::option::Option::Some(1),
473                Self::CloudArmor => std::option::Option::Some(2),
474                Self::UnknownValue(u) => u.0.value(),
475            }
476        }
477
478        /// Gets the enum value as a string.
479        ///
480        /// Returns `None` if the enum contains an unknown value deserialized from
481        /// the integer representation of enums.
482        pub fn name(&self) -> std::option::Option<&str> {
483            match self {
484                Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
485                Self::Default => std::option::Option::Some("DEFAULT"),
486                Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
487                Self::UnknownValue(u) => u.0.name(),
488            }
489        }
490    }
491
492    impl std::default::Default for Purpose {
493        fn default() -> Self {
494            use std::convert::From;
495            Self::from(0)
496        }
497    }
498
499    impl std::fmt::Display for Purpose {
500        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
501            wkt::internal::display_enum(f, self.name(), self.value())
502        }
503    }
504
505    impl std::convert::From<i32> for Purpose {
506        fn from(value: i32) -> Self {
507            match value {
508                0 => Self::Unspecified,
509                1 => Self::Default,
510                2 => Self::CloudArmor,
511                _ => Self::UnknownValue(purpose::UnknownValue(
512                    wkt::internal::UnknownEnumValue::Integer(value),
513                )),
514            }
515        }
516    }
517
518    impl std::convert::From<&str> for Purpose {
519        fn from(value: &str) -> Self {
520            use std::string::ToString;
521            match value {
522                "PURPOSE_UNSPECIFIED" => Self::Unspecified,
523                "DEFAULT" => Self::Default,
524                "CLOUD_ARMOR" => Self::CloudArmor,
525                _ => Self::UnknownValue(purpose::UnknownValue(
526                    wkt::internal::UnknownEnumValue::String(value.to_string()),
527                )),
528            }
529        }
530    }
531
532    impl serde::ser::Serialize for Purpose {
533        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
534        where
535            S: serde::Serializer,
536        {
537            match self {
538                Self::Unspecified => serializer.serialize_i32(0),
539                Self::Default => serializer.serialize_i32(1),
540                Self::CloudArmor => serializer.serialize_i32(2),
541                Self::UnknownValue(u) => u.0.serialize(serializer),
542            }
543        }
544    }
545
546    impl<'de> serde::de::Deserialize<'de> for Purpose {
547        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
548        where
549            D: serde::Deserializer<'de>,
550        {
551            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
552                ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
553            ))
554        }
555    }
556}
557
558/// Request used with the ListAddressGroups method.
559#[derive(Clone, Default, PartialEq)]
560#[non_exhaustive]
561pub struct ListAddressGroupsRequest {
562    /// Required. The project and location from which the AddressGroups
563    /// should be listed, specified in the format
564    /// `projects/*/locations/{location}`.
565    pub parent: std::string::String,
566
567    /// Maximum number of AddressGroups to return per call.
568    pub page_size: i32,
569
570    /// The value returned by the last
571    /// `ListAddressGroupsResponse` Indicates that this is a
572    /// continuation of a prior `ListAddressGroups` call, and
573    /// that the system should return the next page of data.
574    pub page_token: std::string::String,
575
576    /// Optional. If true, allow partial responses for multi-regional Aggregated
577    /// List requests.
578    pub return_partial_success: bool,
579
580    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
581}
582
583impl ListAddressGroupsRequest {
584    /// Creates a new default instance.
585    pub fn new() -> Self {
586        std::default::Default::default()
587    }
588
589    /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
590    ///
591    /// # Example
592    /// ```ignore,no_run
593    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
594    /// let x = ListAddressGroupsRequest::new().set_parent("example");
595    /// ```
596    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597        self.parent = v.into();
598        self
599    }
600
601    /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
602    ///
603    /// # Example
604    /// ```ignore,no_run
605    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
606    /// let x = ListAddressGroupsRequest::new().set_page_size(42);
607    /// ```
608    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
609        self.page_size = v.into();
610        self
611    }
612
613    /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
614    ///
615    /// # Example
616    /// ```ignore,no_run
617    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
618    /// let x = ListAddressGroupsRequest::new().set_page_token("example");
619    /// ```
620    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
621        self.page_token = v.into();
622        self
623    }
624
625    /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
626    ///
627    /// # Example
628    /// ```ignore,no_run
629    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
630    /// let x = ListAddressGroupsRequest::new().set_return_partial_success(true);
631    /// ```
632    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
633        self.return_partial_success = v.into();
634        self
635    }
636}
637
638impl wkt::message::Message for ListAddressGroupsRequest {
639    fn typename() -> &'static str {
640        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
641    }
642}
643
644/// Response returned by the ListAddressGroups method.
645#[derive(Clone, Default, PartialEq)]
646#[non_exhaustive]
647pub struct ListAddressGroupsResponse {
648    /// List of AddressGroups resources.
649    pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
650
651    /// If there might be more results than those appearing in this response, then
652    /// `next_page_token` is included. To get the next set of results, call this
653    /// method again using the value of `next_page_token` as `page_token`.
654    pub next_page_token: std::string::String,
655
656    /// Locations that could not be reached.
657    pub unreachable: std::vec::Vec<std::string::String>,
658
659    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
660}
661
662impl ListAddressGroupsResponse {
663    /// Creates a new default instance.
664    pub fn new() -> Self {
665        std::default::Default::default()
666    }
667
668    /// Sets the value of [address_groups][crate::model::ListAddressGroupsResponse::address_groups].
669    ///
670    /// # Example
671    /// ```ignore,no_run
672    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
673    /// use google_cloud_networksecurity_v1::model::AddressGroup;
674    /// let x = ListAddressGroupsResponse::new()
675    ///     .set_address_groups([
676    ///         AddressGroup::default()/* use setters */,
677    ///         AddressGroup::default()/* use (different) setters */,
678    ///     ]);
679    /// ```
680    pub fn set_address_groups<T, V>(mut self, v: T) -> Self
681    where
682        T: std::iter::IntoIterator<Item = V>,
683        V: std::convert::Into<crate::model::AddressGroup>,
684    {
685        use std::iter::Iterator;
686        self.address_groups = v.into_iter().map(|i| i.into()).collect();
687        self
688    }
689
690    /// Sets the value of [next_page_token][crate::model::ListAddressGroupsResponse::next_page_token].
691    ///
692    /// # Example
693    /// ```ignore,no_run
694    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
695    /// let x = ListAddressGroupsResponse::new().set_next_page_token("example");
696    /// ```
697    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
698        self.next_page_token = v.into();
699        self
700    }
701
702    /// Sets the value of [unreachable][crate::model::ListAddressGroupsResponse::unreachable].
703    ///
704    /// # Example
705    /// ```ignore,no_run
706    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
707    /// let x = ListAddressGroupsResponse::new().set_unreachable(["a", "b", "c"]);
708    /// ```
709    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
710    where
711        T: std::iter::IntoIterator<Item = V>,
712        V: std::convert::Into<std::string::String>,
713    {
714        use std::iter::Iterator;
715        self.unreachable = v.into_iter().map(|i| i.into()).collect();
716        self
717    }
718}
719
720impl wkt::message::Message for ListAddressGroupsResponse {
721    fn typename() -> &'static str {
722        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
723    }
724}
725
726#[doc(hidden)]
727impl google_cloud_gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
728    type PageItem = crate::model::AddressGroup;
729
730    fn items(self) -> std::vec::Vec<Self::PageItem> {
731        self.address_groups
732    }
733
734    fn next_page_token(&self) -> std::string::String {
735        use std::clone::Clone;
736        self.next_page_token.clone()
737    }
738}
739
740/// Request used by the GetAddressGroup method.
741#[derive(Clone, Default, PartialEq)]
742#[non_exhaustive]
743pub struct GetAddressGroupRequest {
744    /// Required. A name of the AddressGroup to get. Must be in the format
745    /// `projects/*/locations/{location}/addressGroups/*`.
746    pub name: std::string::String,
747
748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
749}
750
751impl GetAddressGroupRequest {
752    /// Creates a new default instance.
753    pub fn new() -> Self {
754        std::default::Default::default()
755    }
756
757    /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
758    ///
759    /// # Example
760    /// ```ignore,no_run
761    /// # use google_cloud_networksecurity_v1::model::GetAddressGroupRequest;
762    /// # let project_id = "project_id";
763    /// # let location_id = "location_id";
764    /// # let address_group_id = "address_group_id";
765    /// let x = GetAddressGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
766    /// ```
767    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
768        self.name = v.into();
769        self
770    }
771}
772
773impl wkt::message::Message for GetAddressGroupRequest {
774    fn typename() -> &'static str {
775        "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
776    }
777}
778
779/// Request used by the CreateAddressGroup method.
780#[derive(Clone, Default, PartialEq)]
781#[non_exhaustive]
782pub struct CreateAddressGroupRequest {
783    /// Required. The parent resource of the AddressGroup. Must be in the
784    /// format `projects/*/locations/{location}`.
785    pub parent: std::string::String,
786
787    /// Required. Short name of the AddressGroup resource to be created.
788    /// This value should be 1-63 characters long, containing only
789    /// letters, numbers, hyphens, and underscores, and should not start
790    /// with a number. E.g. "authz_policy".
791    pub address_group_id: std::string::String,
792
793    /// Required. AddressGroup resource to be created.
794    pub address_group: std::option::Option<crate::model::AddressGroup>,
795
796    /// Optional. An optional request ID to identify requests. Specify a unique
797    /// request ID so that if you must retry your request, the server will know to
798    /// ignore the request if it has already been completed. The server will
799    /// guarantee that for at least 60 minutes since the first request.
800    ///
801    /// For example, consider a situation where you make an initial request and
802    /// the request times out. If you make the request again with the same request
803    /// ID, the server can check if original operation with the same request ID
804    /// was received, and if so, will ignore the second request. This prevents
805    /// clients from accidentally creating duplicate commitments.
806    ///
807    /// The request ID must be a valid UUID with the exception that zero UUID is
808    /// not supported (00000000-0000-0000-0000-000000000000).
809    pub request_id: std::string::String,
810
811    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
812}
813
814impl CreateAddressGroupRequest {
815    /// Creates a new default instance.
816    pub fn new() -> Self {
817        std::default::Default::default()
818    }
819
820    /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
821    ///
822    /// # Example
823    /// ```ignore,no_run
824    /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
825    /// # let project_id = "project_id";
826    /// # let location_id = "location_id";
827    /// let x = CreateAddressGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
828    /// ```
829    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
830        self.parent = v.into();
831        self
832    }
833
834    /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
835    ///
836    /// # Example
837    /// ```ignore,no_run
838    /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
839    /// let x = CreateAddressGroupRequest::new().set_address_group_id("example");
840    /// ```
841    pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
842        mut self,
843        v: T,
844    ) -> Self {
845        self.address_group_id = v.into();
846        self
847    }
848
849    /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
850    ///
851    /// # Example
852    /// ```ignore,no_run
853    /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
854    /// use google_cloud_networksecurity_v1::model::AddressGroup;
855    /// let x = CreateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
856    /// ```
857    pub fn set_address_group<T>(mut self, v: T) -> Self
858    where
859        T: std::convert::Into<crate::model::AddressGroup>,
860    {
861        self.address_group = std::option::Option::Some(v.into());
862        self
863    }
864
865    /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
866    ///
867    /// # Example
868    /// ```ignore,no_run
869    /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
870    /// use google_cloud_networksecurity_v1::model::AddressGroup;
871    /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
872    /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
873    /// ```
874    pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
875    where
876        T: std::convert::Into<crate::model::AddressGroup>,
877    {
878        self.address_group = v.map(|x| x.into());
879        self
880    }
881
882    /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
883    ///
884    /// # Example
885    /// ```ignore,no_run
886    /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
887    /// let x = CreateAddressGroupRequest::new().set_request_id("example");
888    /// ```
889    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
890        self.request_id = v.into();
891        self
892    }
893}
894
895impl wkt::message::Message for CreateAddressGroupRequest {
896    fn typename() -> &'static str {
897        "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
898    }
899}
900
901/// Request used by the UpdateAddressGroup method.
902#[derive(Clone, Default, PartialEq)]
903#[non_exhaustive]
904pub struct UpdateAddressGroupRequest {
905    /// Optional. Field mask is used to specify the fields to be overwritten in the
906    /// AddressGroup resource by the update.
907    /// The fields specified in the update_mask are relative to the resource, not
908    /// the full request. A field will be overwritten if it is in the mask. If the
909    /// user does not provide a mask then all fields will be overwritten.
910    pub update_mask: std::option::Option<wkt::FieldMask>,
911
912    /// Required. Updated AddressGroup resource.
913    pub address_group: std::option::Option<crate::model::AddressGroup>,
914
915    /// Optional. An optional request ID to identify requests. Specify a unique
916    /// request ID so that if you must retry your request, the server will know to
917    /// ignore the request if it has already been completed. The server will
918    /// guarantee that for at least 60 minutes since the first request.
919    ///
920    /// For example, consider a situation where you make an initial request and
921    /// the request times out. If you make the request again with the same request
922    /// ID, the server can check if original operation with the same request ID
923    /// was received, and if so, will ignore the second request. This prevents
924    /// clients from accidentally creating duplicate commitments.
925    ///
926    /// The request ID must be a valid UUID with the exception that zero UUID is
927    /// not supported (00000000-0000-0000-0000-000000000000).
928    pub request_id: std::string::String,
929
930    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
931}
932
933impl UpdateAddressGroupRequest {
934    /// Creates a new default instance.
935    pub fn new() -> Self {
936        std::default::Default::default()
937    }
938
939    /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
940    ///
941    /// # Example
942    /// ```ignore,no_run
943    /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
944    /// use wkt::FieldMask;
945    /// let x = UpdateAddressGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
946    /// ```
947    pub fn set_update_mask<T>(mut self, v: T) -> Self
948    where
949        T: std::convert::Into<wkt::FieldMask>,
950    {
951        self.update_mask = std::option::Option::Some(v.into());
952        self
953    }
954
955    /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
956    ///
957    /// # Example
958    /// ```ignore,no_run
959    /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
960    /// use wkt::FieldMask;
961    /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
962    /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
963    /// ```
964    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
965    where
966        T: std::convert::Into<wkt::FieldMask>,
967    {
968        self.update_mask = v.map(|x| x.into());
969        self
970    }
971
972    /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
973    ///
974    /// # Example
975    /// ```ignore,no_run
976    /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
977    /// use google_cloud_networksecurity_v1::model::AddressGroup;
978    /// let x = UpdateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
979    /// ```
980    pub fn set_address_group<T>(mut self, v: T) -> Self
981    where
982        T: std::convert::Into<crate::model::AddressGroup>,
983    {
984        self.address_group = std::option::Option::Some(v.into());
985        self
986    }
987
988    /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
989    ///
990    /// # Example
991    /// ```ignore,no_run
992    /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
993    /// use google_cloud_networksecurity_v1::model::AddressGroup;
994    /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
995    /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
996    /// ```
997    pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
998    where
999        T: std::convert::Into<crate::model::AddressGroup>,
1000    {
1001        self.address_group = v.map(|x| x.into());
1002        self
1003    }
1004
1005    /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
1006    ///
1007    /// # Example
1008    /// ```ignore,no_run
1009    /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
1010    /// let x = UpdateAddressGroupRequest::new().set_request_id("example");
1011    /// ```
1012    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1013        self.request_id = v.into();
1014        self
1015    }
1016}
1017
1018impl wkt::message::Message for UpdateAddressGroupRequest {
1019    fn typename() -> &'static str {
1020        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
1021    }
1022}
1023
1024/// Request used by the DeleteAddressGroup method.
1025#[derive(Clone, Default, PartialEq)]
1026#[non_exhaustive]
1027pub struct DeleteAddressGroupRequest {
1028    /// Required. A name of the AddressGroup to delete. Must be in the format
1029    /// `projects/*/locations/{location}/addressGroups/*`.
1030    pub name: std::string::String,
1031
1032    /// Optional. An optional request ID to identify requests. Specify a unique
1033    /// request ID so that if you must retry your request, the server will know to
1034    /// ignore the request if it has already been completed. The server will
1035    /// guarantee that for at least 60 minutes since the first request.
1036    ///
1037    /// For example, consider a situation where you make an initial request and
1038    /// the request times out. If you make the request again with the same request
1039    /// ID, the server can check if original operation with the same request ID
1040    /// was received, and if so, will ignore the second request. This prevents
1041    /// clients from accidentally creating duplicate commitments.
1042    ///
1043    /// The request ID must be a valid UUID with the exception that zero UUID is
1044    /// not supported (00000000-0000-0000-0000-000000000000).
1045    pub request_id: std::string::String,
1046
1047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1048}
1049
1050impl DeleteAddressGroupRequest {
1051    /// Creates a new default instance.
1052    pub fn new() -> Self {
1053        std::default::Default::default()
1054    }
1055
1056    /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1057    ///
1058    /// # Example
1059    /// ```ignore,no_run
1060    /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1061    /// # let project_id = "project_id";
1062    /// # let location_id = "location_id";
1063    /// # let address_group_id = "address_group_id";
1064    /// let x = DeleteAddressGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1065    /// ```
1066    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1067        self.name = v.into();
1068        self
1069    }
1070
1071    /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1072    ///
1073    /// # Example
1074    /// ```ignore,no_run
1075    /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1076    /// let x = DeleteAddressGroupRequest::new().set_request_id("example");
1077    /// ```
1078    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1079        self.request_id = v.into();
1080        self
1081    }
1082}
1083
1084impl wkt::message::Message for DeleteAddressGroupRequest {
1085    fn typename() -> &'static str {
1086        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
1087    }
1088}
1089
1090/// Request used by the AddAddressGroupItems method.
1091#[derive(Clone, Default, PartialEq)]
1092#[non_exhaustive]
1093pub struct AddAddressGroupItemsRequest {
1094    /// Required. A name of the AddressGroup to add items to. Must be in the format
1095    /// `projects|organization/*/locations/{location}/addressGroups/*`.
1096    pub address_group: std::string::String,
1097
1098    /// Required. List of items to add.
1099    pub items: std::vec::Vec<std::string::String>,
1100
1101    /// Optional. An optional request ID to identify requests. Specify a unique
1102    /// request ID so that if you must retry your request, the server will know to
1103    /// ignore the request if it has already been completed. The server will
1104    /// guarantee that for at least 60 minutes since the first request.
1105    ///
1106    /// For example, consider a situation where you make an initial request and
1107    /// the request times out. If you make the request again with the same request
1108    /// ID, the server can check if original operation with the same request ID
1109    /// was received, and if so, will ignore the second request. This prevents
1110    /// clients from accidentally creating duplicate commitments.
1111    ///
1112    /// The request ID must be a valid UUID with the exception that zero UUID is
1113    /// not supported (00000000-0000-0000-0000-000000000000).
1114    pub request_id: std::string::String,
1115
1116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1117}
1118
1119impl AddAddressGroupItemsRequest {
1120    /// Creates a new default instance.
1121    pub fn new() -> Self {
1122        std::default::Default::default()
1123    }
1124
1125    /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
1126    ///
1127    /// # Example
1128    /// ```ignore,no_run
1129    /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1130    /// # let project_id = "project_id";
1131    /// # let location_id = "location_id";
1132    /// # let address_group_id = "address_group_id";
1133    /// let x = AddAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1134    /// ```
1135    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1136        self.address_group = v.into();
1137        self
1138    }
1139
1140    /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
1141    ///
1142    /// # Example
1143    /// ```ignore,no_run
1144    /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1145    /// let x = AddAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1146    /// ```
1147    pub fn set_items<T, V>(mut self, v: T) -> Self
1148    where
1149        T: std::iter::IntoIterator<Item = V>,
1150        V: std::convert::Into<std::string::String>,
1151    {
1152        use std::iter::Iterator;
1153        self.items = v.into_iter().map(|i| i.into()).collect();
1154        self
1155    }
1156
1157    /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
1158    ///
1159    /// # Example
1160    /// ```ignore,no_run
1161    /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1162    /// let x = AddAddressGroupItemsRequest::new().set_request_id("example");
1163    /// ```
1164    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1165        self.request_id = v.into();
1166        self
1167    }
1168}
1169
1170impl wkt::message::Message for AddAddressGroupItemsRequest {
1171    fn typename() -> &'static str {
1172        "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
1173    }
1174}
1175
1176/// Request used by the RemoveAddressGroupItems method.
1177#[derive(Clone, Default, PartialEq)]
1178#[non_exhaustive]
1179pub struct RemoveAddressGroupItemsRequest {
1180    /// Required. A name of the AddressGroup to remove items from. Must be in the
1181    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1182    pub address_group: std::string::String,
1183
1184    /// Required. List of items to remove.
1185    pub items: std::vec::Vec<std::string::String>,
1186
1187    /// Optional. An optional request ID to identify requests. Specify a unique
1188    /// request ID so that if you must retry your request, the server will know to
1189    /// ignore the request if it has already been completed. The server will
1190    /// guarantee that for at least 60 minutes since the first request.
1191    ///
1192    /// For example, consider a situation where you make an initial request and
1193    /// the request times out. If you make the request again with the same request
1194    /// ID, the server can check if original operation with the same request ID
1195    /// was received, and if so, will ignore the second request. This prevents
1196    /// clients from accidentally creating duplicate commitments.
1197    ///
1198    /// The request ID must be a valid UUID with the exception that zero UUID is
1199    /// not supported (00000000-0000-0000-0000-000000000000).
1200    pub request_id: std::string::String,
1201
1202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1203}
1204
1205impl RemoveAddressGroupItemsRequest {
1206    /// Creates a new default instance.
1207    pub fn new() -> Self {
1208        std::default::Default::default()
1209    }
1210
1211    /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
1212    ///
1213    /// # Example
1214    /// ```ignore,no_run
1215    /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1216    /// # let project_id = "project_id";
1217    /// # let location_id = "location_id";
1218    /// # let address_group_id = "address_group_id";
1219    /// let x = RemoveAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1220    /// ```
1221    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1222        self.address_group = v.into();
1223        self
1224    }
1225
1226    /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
1227    ///
1228    /// # Example
1229    /// ```ignore,no_run
1230    /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1231    /// let x = RemoveAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1232    /// ```
1233    pub fn set_items<T, V>(mut self, v: T) -> Self
1234    where
1235        T: std::iter::IntoIterator<Item = V>,
1236        V: std::convert::Into<std::string::String>,
1237    {
1238        use std::iter::Iterator;
1239        self.items = v.into_iter().map(|i| i.into()).collect();
1240        self
1241    }
1242
1243    /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
1244    ///
1245    /// # Example
1246    /// ```ignore,no_run
1247    /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1248    /// let x = RemoveAddressGroupItemsRequest::new().set_request_id("example");
1249    /// ```
1250    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1251        self.request_id = v.into();
1252        self
1253    }
1254}
1255
1256impl wkt::message::Message for RemoveAddressGroupItemsRequest {
1257    fn typename() -> &'static str {
1258        "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
1259    }
1260}
1261
1262/// Request used by the CloneAddressGroupItems method.
1263#[derive(Clone, Default, PartialEq)]
1264#[non_exhaustive]
1265pub struct CloneAddressGroupItemsRequest {
1266    /// Required. A name of the AddressGroup to clone items to. Must be in the
1267    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1268    pub address_group: std::string::String,
1269
1270    /// Required. Source address group to clone items from.
1271    pub source_address_group: std::string::String,
1272
1273    /// Optional. An optional request ID to identify requests. Specify a unique
1274    /// request ID so that if you must retry your request, the server will know to
1275    /// ignore the request if it has already been completed. The server will
1276    /// guarantee that for at least 60 minutes since the first request.
1277    ///
1278    /// For example, consider a situation where you make an initial request and
1279    /// the request times out. If you make the request again with the same request
1280    /// ID, the server can check if original operation with the same request ID
1281    /// was received, and if so, will ignore the second request. This prevents
1282    /// clients from accidentally creating duplicate commitments.
1283    ///
1284    /// The request ID must be a valid UUID with the exception that zero UUID is
1285    /// not supported (00000000-0000-0000-0000-000000000000).
1286    pub request_id: std::string::String,
1287
1288    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1289}
1290
1291impl CloneAddressGroupItemsRequest {
1292    /// Creates a new default instance.
1293    pub fn new() -> Self {
1294        std::default::Default::default()
1295    }
1296
1297    /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
1298    ///
1299    /// # Example
1300    /// ```ignore,no_run
1301    /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1302    /// # let project_id = "project_id";
1303    /// # let location_id = "location_id";
1304    /// # let address_group_id = "address_group_id";
1305    /// let x = CloneAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1306    /// ```
1307    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1308        self.address_group = v.into();
1309        self
1310    }
1311
1312    /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
1313    ///
1314    /// # Example
1315    /// ```ignore,no_run
1316    /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1317    /// # let project_id = "project_id";
1318    /// # let location_id = "location_id";
1319    /// # let address_group_id = "address_group_id";
1320    /// let x = CloneAddressGroupItemsRequest::new().set_source_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1321    /// ```
1322    pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1323        mut self,
1324        v: T,
1325    ) -> Self {
1326        self.source_address_group = v.into();
1327        self
1328    }
1329
1330    /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
1331    ///
1332    /// # Example
1333    /// ```ignore,no_run
1334    /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1335    /// let x = CloneAddressGroupItemsRequest::new().set_request_id("example");
1336    /// ```
1337    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1338        self.request_id = v.into();
1339        self
1340    }
1341}
1342
1343impl wkt::message::Message for CloneAddressGroupItemsRequest {
1344    fn typename() -> &'static str {
1345        "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1346    }
1347}
1348
1349/// Request used by the ListAddressGroupReferences method.
1350#[derive(Clone, Default, PartialEq)]
1351#[non_exhaustive]
1352pub struct ListAddressGroupReferencesRequest {
1353    /// Required. A name of the AddressGroup to clone items to. Must be in the
1354    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1355    pub address_group: std::string::String,
1356
1357    /// The maximum number of references to return.  If unspecified, server
1358    /// will pick an appropriate default. Server may return fewer items than
1359    /// requested. A caller should only rely on response's
1360    /// [next_page_token][google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]
1361    /// to determine if there are more AddressGroupUsers left to be queried.
1362    ///
1363    /// [google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]: crate::model::ListAddressGroupReferencesResponse::next_page_token
1364    pub page_size: i32,
1365
1366    /// The next_page_token value returned from a previous List request,
1367    /// if any.
1368    pub page_token: std::string::String,
1369
1370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1371}
1372
1373impl ListAddressGroupReferencesRequest {
1374    /// Creates a new default instance.
1375    pub fn new() -> Self {
1376        std::default::Default::default()
1377    }
1378
1379    /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1380    ///
1381    /// # Example
1382    /// ```ignore,no_run
1383    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1384    /// # let project_id = "project_id";
1385    /// # let location_id = "location_id";
1386    /// # let address_group_id = "address_group_id";
1387    /// let x = ListAddressGroupReferencesRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1388    /// ```
1389    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1390        self.address_group = v.into();
1391        self
1392    }
1393
1394    /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1395    ///
1396    /// # Example
1397    /// ```ignore,no_run
1398    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1399    /// let x = ListAddressGroupReferencesRequest::new().set_page_size(42);
1400    /// ```
1401    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1402        self.page_size = v.into();
1403        self
1404    }
1405
1406    /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1407    ///
1408    /// # Example
1409    /// ```ignore,no_run
1410    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1411    /// let x = ListAddressGroupReferencesRequest::new().set_page_token("example");
1412    /// ```
1413    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1414        self.page_token = v.into();
1415        self
1416    }
1417}
1418
1419impl wkt::message::Message for ListAddressGroupReferencesRequest {
1420    fn typename() -> &'static str {
1421        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1422    }
1423}
1424
1425/// Response of the ListAddressGroupReferences method.
1426#[derive(Clone, Default, PartialEq)]
1427#[non_exhaustive]
1428pub struct ListAddressGroupReferencesResponse {
1429    /// A list of references that matches the specified filter in the request.
1430    pub address_group_references:
1431        std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1432
1433    /// If there might be more results than those appearing in this response, then
1434    /// `next_page_token` is included. To get the next set of results, call this
1435    /// method again using the value of `next_page_token` as `page_token`.
1436    pub next_page_token: std::string::String,
1437
1438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1439}
1440
1441impl ListAddressGroupReferencesResponse {
1442    /// Creates a new default instance.
1443    pub fn new() -> Self {
1444        std::default::Default::default()
1445    }
1446
1447    /// Sets the value of [address_group_references][crate::model::ListAddressGroupReferencesResponse::address_group_references].
1448    ///
1449    /// # Example
1450    /// ```ignore,no_run
1451    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1452    /// use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1453    /// let x = ListAddressGroupReferencesResponse::new()
1454    ///     .set_address_group_references([
1455    ///         AddressGroupReference::default()/* use setters */,
1456    ///         AddressGroupReference::default()/* use (different) setters */,
1457    ///     ]);
1458    /// ```
1459    pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1460    where
1461        T: std::iter::IntoIterator<Item = V>,
1462        V: std::convert::Into<
1463                crate::model::list_address_group_references_response::AddressGroupReference,
1464            >,
1465    {
1466        use std::iter::Iterator;
1467        self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1468        self
1469    }
1470
1471    /// Sets the value of [next_page_token][crate::model::ListAddressGroupReferencesResponse::next_page_token].
1472    ///
1473    /// # Example
1474    /// ```ignore,no_run
1475    /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1476    /// let x = ListAddressGroupReferencesResponse::new().set_next_page_token("example");
1477    /// ```
1478    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1479        self.next_page_token = v.into();
1480        self
1481    }
1482}
1483
1484impl wkt::message::Message for ListAddressGroupReferencesResponse {
1485    fn typename() -> &'static str {
1486        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1487    }
1488}
1489
1490#[doc(hidden)]
1491impl google_cloud_gax::paginator::internal::PageableResponse
1492    for ListAddressGroupReferencesResponse
1493{
1494    type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1495
1496    fn items(self) -> std::vec::Vec<Self::PageItem> {
1497        self.address_group_references
1498    }
1499
1500    fn next_page_token(&self) -> std::string::String {
1501        use std::clone::Clone;
1502        self.next_page_token.clone()
1503    }
1504}
1505
1506/// Defines additional types related to [ListAddressGroupReferencesResponse].
1507pub mod list_address_group_references_response {
1508    #[allow(unused_imports)]
1509    use super::*;
1510
1511    /// The Reference of AddressGroup.
1512    #[derive(Clone, Default, PartialEq)]
1513    #[non_exhaustive]
1514    pub struct AddressGroupReference {
1515        /// FirewallPolicy that is using the Address Group.
1516        pub firewall_policy: std::string::String,
1517
1518        /// Cloud Armor SecurityPolicy that is using the Address Group.
1519        pub security_policy: std::string::String,
1520
1521        /// Rule priority of the FirewallPolicy that is using the Address Group.
1522        pub rule_priority: i32,
1523
1524        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1525    }
1526
1527    impl AddressGroupReference {
1528        /// Creates a new default instance.
1529        pub fn new() -> Self {
1530            std::default::Default::default()
1531        }
1532
1533        /// Sets the value of [firewall_policy][crate::model::list_address_group_references_response::AddressGroupReference::firewall_policy].
1534        ///
1535        /// # Example
1536        /// ```ignore,no_run
1537        /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1538        /// let x = AddressGroupReference::new().set_firewall_policy("example");
1539        /// ```
1540        pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1541            mut self,
1542            v: T,
1543        ) -> Self {
1544            self.firewall_policy = v.into();
1545            self
1546        }
1547
1548        /// Sets the value of [security_policy][crate::model::list_address_group_references_response::AddressGroupReference::security_policy].
1549        ///
1550        /// # Example
1551        /// ```ignore,no_run
1552        /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1553        /// let x = AddressGroupReference::new().set_security_policy("example");
1554        /// ```
1555        pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1556            mut self,
1557            v: T,
1558        ) -> Self {
1559            self.security_policy = v.into();
1560            self
1561        }
1562
1563        /// Sets the value of [rule_priority][crate::model::list_address_group_references_response::AddressGroupReference::rule_priority].
1564        ///
1565        /// # Example
1566        /// ```ignore,no_run
1567        /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1568        /// let x = AddressGroupReference::new().set_rule_priority(42);
1569        /// ```
1570        pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1571            self.rule_priority = v.into();
1572            self
1573        }
1574    }
1575
1576    impl wkt::message::Message for AddressGroupReference {
1577        fn typename() -> &'static str {
1578            "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1579        }
1580    }
1581}
1582
1583/// AuthorizationPolicy is a resource that specifies how a server
1584/// should authorize incoming connections. This resource in itself does
1585/// not change the configuration unless it's attached to a target https
1586/// proxy or endpoint config selector resource.
1587#[derive(Clone, Default, PartialEq)]
1588#[non_exhaustive]
1589pub struct AuthorizationPolicy {
1590    /// Required. Name of the AuthorizationPolicy resource. It matches pattern
1591    /// `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
1592    pub name: std::string::String,
1593
1594    /// Optional. Free-text description of the resource.
1595    pub description: std::string::String,
1596
1597    /// Output only. The timestamp when the resource was created.
1598    pub create_time: std::option::Option<wkt::Timestamp>,
1599
1600    /// Output only. The timestamp when the resource was updated.
1601    pub update_time: std::option::Option<wkt::Timestamp>,
1602
1603    /// Optional. Set of label tags associated with the AuthorizationPolicy
1604    /// resource.
1605    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1606
1607    /// Required. The action to take when a rule match is found. Possible values
1608    /// are "ALLOW" or "DENY".
1609    pub action: crate::model::authorization_policy::Action,
1610
1611    /// Optional. List of rules to match. Note that at least one of the rules must
1612    /// match in order for the action specified in the 'action' field to be taken.
1613    /// A rule is a match if there is a matching source and destination. If left
1614    /// blank, the action specified in the `action` field will be applied on every
1615    /// request.
1616    pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1617
1618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1619}
1620
1621impl AuthorizationPolicy {
1622    /// Creates a new default instance.
1623    pub fn new() -> Self {
1624        std::default::Default::default()
1625    }
1626
1627    /// Sets the value of [name][crate::model::AuthorizationPolicy::name].
1628    ///
1629    /// # Example
1630    /// ```ignore,no_run
1631    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1632    /// # let project_id = "project_id";
1633    /// # let location_id = "location_id";
1634    /// # let authorization_policy_id = "authorization_policy_id";
1635    /// let x = AuthorizationPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
1636    /// ```
1637    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1638        self.name = v.into();
1639        self
1640    }
1641
1642    /// Sets the value of [description][crate::model::AuthorizationPolicy::description].
1643    ///
1644    /// # Example
1645    /// ```ignore,no_run
1646    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1647    /// let x = AuthorizationPolicy::new().set_description("example");
1648    /// ```
1649    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650        self.description = v.into();
1651        self
1652    }
1653
1654    /// Sets the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1655    ///
1656    /// # Example
1657    /// ```ignore,no_run
1658    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1659    /// use wkt::Timestamp;
1660    /// let x = AuthorizationPolicy::new().set_create_time(Timestamp::default()/* use setters */);
1661    /// ```
1662    pub fn set_create_time<T>(mut self, v: T) -> Self
1663    where
1664        T: std::convert::Into<wkt::Timestamp>,
1665    {
1666        self.create_time = std::option::Option::Some(v.into());
1667        self
1668    }
1669
1670    /// Sets or clears the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1671    ///
1672    /// # Example
1673    /// ```ignore,no_run
1674    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1675    /// use wkt::Timestamp;
1676    /// let x = AuthorizationPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1677    /// let x = AuthorizationPolicy::new().set_or_clear_create_time(None::<Timestamp>);
1678    /// ```
1679    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1680    where
1681        T: std::convert::Into<wkt::Timestamp>,
1682    {
1683        self.create_time = v.map(|x| x.into());
1684        self
1685    }
1686
1687    /// Sets the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1688    ///
1689    /// # Example
1690    /// ```ignore,no_run
1691    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1692    /// use wkt::Timestamp;
1693    /// let x = AuthorizationPolicy::new().set_update_time(Timestamp::default()/* use setters */);
1694    /// ```
1695    pub fn set_update_time<T>(mut self, v: T) -> Self
1696    where
1697        T: std::convert::Into<wkt::Timestamp>,
1698    {
1699        self.update_time = std::option::Option::Some(v.into());
1700        self
1701    }
1702
1703    /// Sets or clears the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1704    ///
1705    /// # Example
1706    /// ```ignore,no_run
1707    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1708    /// use wkt::Timestamp;
1709    /// let x = AuthorizationPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1710    /// let x = AuthorizationPolicy::new().set_or_clear_update_time(None::<Timestamp>);
1711    /// ```
1712    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1713    where
1714        T: std::convert::Into<wkt::Timestamp>,
1715    {
1716        self.update_time = v.map(|x| x.into());
1717        self
1718    }
1719
1720    /// Sets the value of [labels][crate::model::AuthorizationPolicy::labels].
1721    ///
1722    /// # Example
1723    /// ```ignore,no_run
1724    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1725    /// let x = AuthorizationPolicy::new().set_labels([
1726    ///     ("key0", "abc"),
1727    ///     ("key1", "xyz"),
1728    /// ]);
1729    /// ```
1730    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1731    where
1732        T: std::iter::IntoIterator<Item = (K, V)>,
1733        K: std::convert::Into<std::string::String>,
1734        V: std::convert::Into<std::string::String>,
1735    {
1736        use std::iter::Iterator;
1737        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1738        self
1739    }
1740
1741    /// Sets the value of [action][crate::model::AuthorizationPolicy::action].
1742    ///
1743    /// # Example
1744    /// ```ignore,no_run
1745    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1746    /// use google_cloud_networksecurity_v1::model::authorization_policy::Action;
1747    /// let x0 = AuthorizationPolicy::new().set_action(Action::Allow);
1748    /// let x1 = AuthorizationPolicy::new().set_action(Action::Deny);
1749    /// ```
1750    pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1751        mut self,
1752        v: T,
1753    ) -> Self {
1754        self.action = v.into();
1755        self
1756    }
1757
1758    /// Sets the value of [rules][crate::model::AuthorizationPolicy::rules].
1759    ///
1760    /// # Example
1761    /// ```ignore,no_run
1762    /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1763    /// use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1764    /// let x = AuthorizationPolicy::new()
1765    ///     .set_rules([
1766    ///         Rule::default()/* use setters */,
1767    ///         Rule::default()/* use (different) setters */,
1768    ///     ]);
1769    /// ```
1770    pub fn set_rules<T, V>(mut self, v: T) -> Self
1771    where
1772        T: std::iter::IntoIterator<Item = V>,
1773        V: std::convert::Into<crate::model::authorization_policy::Rule>,
1774    {
1775        use std::iter::Iterator;
1776        self.rules = v.into_iter().map(|i| i.into()).collect();
1777        self
1778    }
1779}
1780
1781impl wkt::message::Message for AuthorizationPolicy {
1782    fn typename() -> &'static str {
1783        "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1784    }
1785}
1786
1787/// Defines additional types related to [AuthorizationPolicy].
1788pub mod authorization_policy {
1789    #[allow(unused_imports)]
1790    use super::*;
1791
1792    /// Specification of rules.
1793    #[derive(Clone, Default, PartialEq)]
1794    #[non_exhaustive]
1795    pub struct Rule {
1796        /// Optional. List of attributes for the traffic source. All of the sources
1797        /// must match. A source is a match if both principals and ip_blocks match.
1798        /// If not set, the action specified in the 'action' field will be applied
1799        /// without any rule checks for the source.
1800        pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1801
1802        /// Optional. List of attributes for the traffic destination. All of the
1803        /// destinations must match. A destination is a match if a request matches
1804        /// all the specified hosts, ports, methods and headers. If not set, the
1805        /// action specified in the 'action' field will be applied without any rule
1806        /// checks for the destination.
1807        pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1808
1809        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1810    }
1811
1812    impl Rule {
1813        /// Creates a new default instance.
1814        pub fn new() -> Self {
1815            std::default::Default::default()
1816        }
1817
1818        /// Sets the value of [sources][crate::model::authorization_policy::Rule::sources].
1819        ///
1820        /// # Example
1821        /// ```ignore,no_run
1822        /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1823        /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1824        /// let x = Rule::new()
1825        ///     .set_sources([
1826        ///         Source::default()/* use setters */,
1827        ///         Source::default()/* use (different) setters */,
1828        ///     ]);
1829        /// ```
1830        pub fn set_sources<T, V>(mut self, v: T) -> Self
1831        where
1832            T: std::iter::IntoIterator<Item = V>,
1833            V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1834        {
1835            use std::iter::Iterator;
1836            self.sources = v.into_iter().map(|i| i.into()).collect();
1837            self
1838        }
1839
1840        /// Sets the value of [destinations][crate::model::authorization_policy::Rule::destinations].
1841        ///
1842        /// # Example
1843        /// ```ignore,no_run
1844        /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1845        /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1846        /// let x = Rule::new()
1847        ///     .set_destinations([
1848        ///         Destination::default()/* use setters */,
1849        ///         Destination::default()/* use (different) setters */,
1850        ///     ]);
1851        /// ```
1852        pub fn set_destinations<T, V>(mut self, v: T) -> Self
1853        where
1854            T: std::iter::IntoIterator<Item = V>,
1855            V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1856        {
1857            use std::iter::Iterator;
1858            self.destinations = v.into_iter().map(|i| i.into()).collect();
1859            self
1860        }
1861    }
1862
1863    impl wkt::message::Message for Rule {
1864        fn typename() -> &'static str {
1865            "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1866        }
1867    }
1868
1869    /// Defines additional types related to [Rule].
1870    pub mod rule {
1871        #[allow(unused_imports)]
1872        use super::*;
1873
1874        /// Specification of traffic source attributes.
1875        #[derive(Clone, Default, PartialEq)]
1876        #[non_exhaustive]
1877        pub struct Source {
1878            /// Optional. List of peer identities to match for authorization. At least
1879            /// one principal should match. Each peer can be an exact match, or a
1880            /// prefix match (example, "namespace/*") or a suffix match (example,
1881            /// "*/service-account") or a presence match "*". Authorization based on
1882            /// the principal name without certificate validation (configured by
1883            /// ServerTlsPolicy resource) is considered insecure.
1884            pub principals: std::vec::Vec<std::string::String>,
1885
1886            /// Optional. List of CIDR ranges to match based on source IP address. At
1887            /// least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
1888            /// (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
1889            /// alone should be avoided. The IP addresses of any load balancers or
1890            /// proxies should be considered untrusted.
1891            pub ip_blocks: std::vec::Vec<std::string::String>,
1892
1893            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1894        }
1895
1896        impl Source {
1897            /// Creates a new default instance.
1898            pub fn new() -> Self {
1899                std::default::Default::default()
1900            }
1901
1902            /// Sets the value of [principals][crate::model::authorization_policy::rule::Source::principals].
1903            ///
1904            /// # Example
1905            /// ```ignore,no_run
1906            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1907            /// let x = Source::new().set_principals(["a", "b", "c"]);
1908            /// ```
1909            pub fn set_principals<T, V>(mut self, v: T) -> Self
1910            where
1911                T: std::iter::IntoIterator<Item = V>,
1912                V: std::convert::Into<std::string::String>,
1913            {
1914                use std::iter::Iterator;
1915                self.principals = v.into_iter().map(|i| i.into()).collect();
1916                self
1917            }
1918
1919            /// Sets the value of [ip_blocks][crate::model::authorization_policy::rule::Source::ip_blocks].
1920            ///
1921            /// # Example
1922            /// ```ignore,no_run
1923            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1924            /// let x = Source::new().set_ip_blocks(["a", "b", "c"]);
1925            /// ```
1926            pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1927            where
1928                T: std::iter::IntoIterator<Item = V>,
1929                V: std::convert::Into<std::string::String>,
1930            {
1931                use std::iter::Iterator;
1932                self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1933                self
1934            }
1935        }
1936
1937        impl wkt::message::Message for Source {
1938            fn typename() -> &'static str {
1939                "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1940            }
1941        }
1942
1943        /// Specification of traffic destination attributes.
1944        #[derive(Clone, Default, PartialEq)]
1945        #[non_exhaustive]
1946        pub struct Destination {
1947            /// Required. List of host names to match. Matched against the ":authority"
1948            /// header in http requests. At least one host should match. Each host can
1949            /// be an exact match, or a prefix match (example "mydomain.*") or a suffix
1950            /// match (example "*.myorg.com") or a presence (any) match "*".
1951            pub hosts: std::vec::Vec<std::string::String>,
1952
1953            /// Required. List of destination ports to match. At least one port should
1954            /// match.
1955            pub ports: std::vec::Vec<u32>,
1956
1957            /// Optional. A list of HTTP methods to match. At least one method should
1958            /// match. Should not be set for gRPC services.
1959            pub methods: std::vec::Vec<std::string::String>,
1960
1961            /// Optional. Match against key:value pair in http header. Provides a
1962            /// flexible match based on HTTP headers, for potentially advanced use
1963            /// cases. At least one header should match. Avoid using header matches to
1964            /// make authorization decisions unless there is a strong guarantee that
1965            /// requests arrive through a trusted client or proxy.
1966            pub http_header_match: std::option::Option<
1967                crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1968            >,
1969
1970            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1971        }
1972
1973        impl Destination {
1974            /// Creates a new default instance.
1975            pub fn new() -> Self {
1976                std::default::Default::default()
1977            }
1978
1979            /// Sets the value of [hosts][crate::model::authorization_policy::rule::Destination::hosts].
1980            ///
1981            /// # Example
1982            /// ```ignore,no_run
1983            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1984            /// let x = Destination::new().set_hosts(["a", "b", "c"]);
1985            /// ```
1986            pub fn set_hosts<T, V>(mut self, v: T) -> Self
1987            where
1988                T: std::iter::IntoIterator<Item = V>,
1989                V: std::convert::Into<std::string::String>,
1990            {
1991                use std::iter::Iterator;
1992                self.hosts = v.into_iter().map(|i| i.into()).collect();
1993                self
1994            }
1995
1996            /// Sets the value of [ports][crate::model::authorization_policy::rule::Destination::ports].
1997            ///
1998            /// # Example
1999            /// ```ignore,no_run
2000            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2001            /// let x = Destination::new().set_ports([1_u32, 2_u32, 3_u32]);
2002            /// ```
2003            pub fn set_ports<T, V>(mut self, v: T) -> Self
2004            where
2005                T: std::iter::IntoIterator<Item = V>,
2006                V: std::convert::Into<u32>,
2007            {
2008                use std::iter::Iterator;
2009                self.ports = v.into_iter().map(|i| i.into()).collect();
2010                self
2011            }
2012
2013            /// Sets the value of [methods][crate::model::authorization_policy::rule::Destination::methods].
2014            ///
2015            /// # Example
2016            /// ```ignore,no_run
2017            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2018            /// let x = Destination::new().set_methods(["a", "b", "c"]);
2019            /// ```
2020            pub fn set_methods<T, V>(mut self, v: T) -> Self
2021            where
2022                T: std::iter::IntoIterator<Item = V>,
2023                V: std::convert::Into<std::string::String>,
2024            {
2025                use std::iter::Iterator;
2026                self.methods = v.into_iter().map(|i| i.into()).collect();
2027                self
2028            }
2029
2030            /// Sets the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2031            ///
2032            /// # Example
2033            /// ```ignore,no_run
2034            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2035            /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2036            /// let x = Destination::new().set_http_header_match(HttpHeaderMatch::default()/* use setters */);
2037            /// ```
2038            pub fn set_http_header_match<T>(mut self, v: T) -> Self
2039            where
2040                T: std::convert::Into<
2041                        crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2042                    >,
2043            {
2044                self.http_header_match = std::option::Option::Some(v.into());
2045                self
2046            }
2047
2048            /// Sets or clears the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2049            ///
2050            /// # Example
2051            /// ```ignore,no_run
2052            /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2053            /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2054            /// let x = Destination::new().set_or_clear_http_header_match(Some(HttpHeaderMatch::default()/* use setters */));
2055            /// let x = Destination::new().set_or_clear_http_header_match(None::<HttpHeaderMatch>);
2056            /// ```
2057            pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
2058            where
2059                T: std::convert::Into<
2060                        crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2061                    >,
2062            {
2063                self.http_header_match = v.map(|x| x.into());
2064                self
2065            }
2066        }
2067
2068        impl wkt::message::Message for Destination {
2069            fn typename() -> &'static str {
2070                "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
2071            }
2072        }
2073
2074        /// Defines additional types related to [Destination].
2075        pub mod destination {
2076            #[allow(unused_imports)]
2077            use super::*;
2078
2079            /// Specification of HTTP header match attributes.
2080            #[derive(Clone, Default, PartialEq)]
2081            #[non_exhaustive]
2082            pub struct HttpHeaderMatch {
2083                /// Required. The name of the HTTP header to match. For matching
2084                /// against the HTTP request's authority, use a headerMatch
2085                /// with the header name ":authority". For matching a
2086                /// request's method, use the headerName ":method".
2087                pub header_name: std::string::String,
2088
2089                #[allow(missing_docs)]
2090                pub r#type: std::option::Option<
2091                    crate::model::authorization_policy::rule::destination::http_header_match::Type,
2092                >,
2093
2094                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2095            }
2096
2097            impl HttpHeaderMatch {
2098                /// Creates a new default instance.
2099                pub fn new() -> Self {
2100                    std::default::Default::default()
2101                }
2102
2103                /// Sets the value of [header_name][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::header_name].
2104                ///
2105                /// # Example
2106                /// ```ignore,no_run
2107                /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2108                /// let x = HttpHeaderMatch::new().set_header_name("example");
2109                /// ```
2110                pub fn set_header_name<T: std::convert::Into<std::string::String>>(
2111                    mut self,
2112                    v: T,
2113                ) -> Self {
2114                    self.header_name = v.into();
2115                    self
2116                }
2117
2118                /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::type].
2119                ///
2120                /// Note that all the setters affecting `r#type` are mutually
2121                /// exclusive.
2122                ///
2123                /// # Example
2124                /// ```ignore,no_run
2125                /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2126                /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::http_header_match::Type;
2127                /// let x = HttpHeaderMatch::new().set_type(Some(Type::RegexMatch("example".to_string())));
2128                /// ```
2129                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
2130                {
2131                    self.r#type = v.into();
2132                    self
2133                }
2134
2135                /// The value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2136                /// if it holds a `RegexMatch`, `None` if the field is not set or
2137                /// holds a different branch.
2138                pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
2139                    #[allow(unreachable_patterns)]
2140                    self.r#type.as_ref().and_then(|v| match v {
2141                        crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
2142                        _ => std::option::Option::None,
2143                    })
2144                }
2145
2146                /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2147                /// to hold a `RegexMatch`.
2148                ///
2149                /// Note that all the setters affecting `r#type` are
2150                /// mutually exclusive.
2151                ///
2152                /// # Example
2153                /// ```ignore,no_run
2154                /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2155                /// let x = HttpHeaderMatch::new().set_regex_match("example");
2156                /// assert!(x.regex_match().is_some());
2157                /// ```
2158                pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
2159                    mut self,
2160                    v: T,
2161                ) -> Self {
2162                    self.r#type = std::option::Option::Some(
2163                        crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
2164                            v.into()
2165                        )
2166                    );
2167                    self
2168                }
2169            }
2170
2171            impl wkt::message::Message for HttpHeaderMatch {
2172                fn typename() -> &'static str {
2173                    "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
2174                }
2175            }
2176
2177            /// Defines additional types related to [HttpHeaderMatch].
2178            pub mod http_header_match {
2179                #[allow(unused_imports)]
2180                use super::*;
2181
2182                #[allow(missing_docs)]
2183                #[derive(Clone, Debug, PartialEq)]
2184                #[non_exhaustive]
2185                pub enum Type {
2186                    /// Required. The value of the header must match the regular expression
2187                    /// specified in regexMatch. For regular expression grammar,
2188                    /// please see: en.cppreference.com/w/cpp/regex/ecmascript
2189                    /// For matching against a port specified in the HTTP
2190                    /// request, use a headerMatch with headerName set to Host
2191                    /// and a regular expression that satisfies the RFC2616 Host
2192                    /// header's port specifier.
2193                    RegexMatch(std::string::String),
2194                }
2195            }
2196        }
2197    }
2198
2199    /// Possible values that define what action to take.
2200    ///
2201    /// # Working with unknown values
2202    ///
2203    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2204    /// additional enum variants at any time. Adding new variants is not considered
2205    /// a breaking change. Applications should write their code in anticipation of:
2206    ///
2207    /// - New values appearing in future releases of the client library, **and**
2208    /// - New values received dynamically, without application changes.
2209    ///
2210    /// Please consult the [Working with enums] section in the user guide for some
2211    /// guidelines.
2212    ///
2213    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2214    #[derive(Clone, Debug, PartialEq)]
2215    #[non_exhaustive]
2216    pub enum Action {
2217        /// Default value.
2218        Unspecified,
2219        /// Grant access.
2220        Allow,
2221        /// Deny access.
2222        /// Deny rules should be avoided unless they are used to provide a default
2223        /// "deny all" fallback.
2224        Deny,
2225        /// If set, the enum was initialized with an unknown value.
2226        ///
2227        /// Applications can examine the value using [Action::value] or
2228        /// [Action::name].
2229        UnknownValue(action::UnknownValue),
2230    }
2231
2232    #[doc(hidden)]
2233    pub mod action {
2234        #[allow(unused_imports)]
2235        use super::*;
2236        #[derive(Clone, Debug, PartialEq)]
2237        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2238    }
2239
2240    impl Action {
2241        /// Gets the enum value.
2242        ///
2243        /// Returns `None` if the enum contains an unknown value deserialized from
2244        /// the string representation of enums.
2245        pub fn value(&self) -> std::option::Option<i32> {
2246            match self {
2247                Self::Unspecified => std::option::Option::Some(0),
2248                Self::Allow => std::option::Option::Some(1),
2249                Self::Deny => std::option::Option::Some(2),
2250                Self::UnknownValue(u) => u.0.value(),
2251            }
2252        }
2253
2254        /// Gets the enum value as a string.
2255        ///
2256        /// Returns `None` if the enum contains an unknown value deserialized from
2257        /// the integer representation of enums.
2258        pub fn name(&self) -> std::option::Option<&str> {
2259            match self {
2260                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2261                Self::Allow => std::option::Option::Some("ALLOW"),
2262                Self::Deny => std::option::Option::Some("DENY"),
2263                Self::UnknownValue(u) => u.0.name(),
2264            }
2265        }
2266    }
2267
2268    impl std::default::Default for Action {
2269        fn default() -> Self {
2270            use std::convert::From;
2271            Self::from(0)
2272        }
2273    }
2274
2275    impl std::fmt::Display for Action {
2276        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2277            wkt::internal::display_enum(f, self.name(), self.value())
2278        }
2279    }
2280
2281    impl std::convert::From<i32> for Action {
2282        fn from(value: i32) -> Self {
2283            match value {
2284                0 => Self::Unspecified,
2285                1 => Self::Allow,
2286                2 => Self::Deny,
2287                _ => Self::UnknownValue(action::UnknownValue(
2288                    wkt::internal::UnknownEnumValue::Integer(value),
2289                )),
2290            }
2291        }
2292    }
2293
2294    impl std::convert::From<&str> for Action {
2295        fn from(value: &str) -> Self {
2296            use std::string::ToString;
2297            match value {
2298                "ACTION_UNSPECIFIED" => Self::Unspecified,
2299                "ALLOW" => Self::Allow,
2300                "DENY" => Self::Deny,
2301                _ => Self::UnknownValue(action::UnknownValue(
2302                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2303                )),
2304            }
2305        }
2306    }
2307
2308    impl serde::ser::Serialize for Action {
2309        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2310        where
2311            S: serde::Serializer,
2312        {
2313            match self {
2314                Self::Unspecified => serializer.serialize_i32(0),
2315                Self::Allow => serializer.serialize_i32(1),
2316                Self::Deny => serializer.serialize_i32(2),
2317                Self::UnknownValue(u) => u.0.serialize(serializer),
2318            }
2319        }
2320    }
2321
2322    impl<'de> serde::de::Deserialize<'de> for Action {
2323        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2324        where
2325            D: serde::Deserializer<'de>,
2326        {
2327            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
2328                ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
2329            ))
2330        }
2331    }
2332}
2333
2334/// Request used with the ListAuthorizationPolicies method.
2335#[derive(Clone, Default, PartialEq)]
2336#[non_exhaustive]
2337pub struct ListAuthorizationPoliciesRequest {
2338    /// Required. The project and location from which the AuthorizationPolicies
2339    /// should be listed, specified in the format
2340    /// `projects/{project}/locations/{location}`.
2341    pub parent: std::string::String,
2342
2343    /// Maximum number of AuthorizationPolicies to return per call.
2344    pub page_size: i32,
2345
2346    /// The value returned by the last
2347    /// `ListAuthorizationPoliciesResponse` Indicates that this is a
2348    /// continuation of a prior `ListAuthorizationPolicies` call, and
2349    /// that the system should return the next page of data.
2350    pub page_token: std::string::String,
2351
2352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2353}
2354
2355impl ListAuthorizationPoliciesRequest {
2356    /// Creates a new default instance.
2357    pub fn new() -> Self {
2358        std::default::Default::default()
2359    }
2360
2361    /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
2362    ///
2363    /// # Example
2364    /// ```ignore,no_run
2365    /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2366    /// let x = ListAuthorizationPoliciesRequest::new().set_parent("example");
2367    /// ```
2368    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2369        self.parent = v.into();
2370        self
2371    }
2372
2373    /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
2374    ///
2375    /// # Example
2376    /// ```ignore,no_run
2377    /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2378    /// let x = ListAuthorizationPoliciesRequest::new().set_page_size(42);
2379    /// ```
2380    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2381        self.page_size = v.into();
2382        self
2383    }
2384
2385    /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
2386    ///
2387    /// # Example
2388    /// ```ignore,no_run
2389    /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2390    /// let x = ListAuthorizationPoliciesRequest::new().set_page_token("example");
2391    /// ```
2392    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2393        self.page_token = v.into();
2394        self
2395    }
2396}
2397
2398impl wkt::message::Message for ListAuthorizationPoliciesRequest {
2399    fn typename() -> &'static str {
2400        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
2401    }
2402}
2403
2404/// Response returned by the ListAuthorizationPolicies method.
2405#[derive(Clone, Default, PartialEq)]
2406#[non_exhaustive]
2407pub struct ListAuthorizationPoliciesResponse {
2408    /// List of AuthorizationPolicies resources.
2409    pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
2410
2411    /// If there might be more results than those appearing in this response, then
2412    /// `next_page_token` is included. To get the next set of results, call this
2413    /// method again using the value of `next_page_token` as `page_token`.
2414    pub next_page_token: std::string::String,
2415
2416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2417}
2418
2419impl ListAuthorizationPoliciesResponse {
2420    /// Creates a new default instance.
2421    pub fn new() -> Self {
2422        std::default::Default::default()
2423    }
2424
2425    /// Sets the value of [authorization_policies][crate::model::ListAuthorizationPoliciesResponse::authorization_policies].
2426    ///
2427    /// # Example
2428    /// ```ignore,no_run
2429    /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2430    /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2431    /// let x = ListAuthorizationPoliciesResponse::new()
2432    ///     .set_authorization_policies([
2433    ///         AuthorizationPolicy::default()/* use setters */,
2434    ///         AuthorizationPolicy::default()/* use (different) setters */,
2435    ///     ]);
2436    /// ```
2437    pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
2438    where
2439        T: std::iter::IntoIterator<Item = V>,
2440        V: std::convert::Into<crate::model::AuthorizationPolicy>,
2441    {
2442        use std::iter::Iterator;
2443        self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
2444        self
2445    }
2446
2447    /// Sets the value of [next_page_token][crate::model::ListAuthorizationPoliciesResponse::next_page_token].
2448    ///
2449    /// # Example
2450    /// ```ignore,no_run
2451    /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2452    /// let x = ListAuthorizationPoliciesResponse::new().set_next_page_token("example");
2453    /// ```
2454    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2455        self.next_page_token = v.into();
2456        self
2457    }
2458}
2459
2460impl wkt::message::Message for ListAuthorizationPoliciesResponse {
2461    fn typename() -> &'static str {
2462        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
2463    }
2464}
2465
2466#[doc(hidden)]
2467impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
2468    type PageItem = crate::model::AuthorizationPolicy;
2469
2470    fn items(self) -> std::vec::Vec<Self::PageItem> {
2471        self.authorization_policies
2472    }
2473
2474    fn next_page_token(&self) -> std::string::String {
2475        use std::clone::Clone;
2476        self.next_page_token.clone()
2477    }
2478}
2479
2480/// Request used by the GetAuthorizationPolicy method.
2481#[derive(Clone, Default, PartialEq)]
2482#[non_exhaustive]
2483pub struct GetAuthorizationPolicyRequest {
2484    /// Required. A name of the AuthorizationPolicy to get. Must be in the format
2485    /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
2486    pub name: std::string::String,
2487
2488    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2489}
2490
2491impl GetAuthorizationPolicyRequest {
2492    /// Creates a new default instance.
2493    pub fn new() -> Self {
2494        std::default::Default::default()
2495    }
2496
2497    /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
2498    ///
2499    /// # Example
2500    /// ```ignore,no_run
2501    /// # use google_cloud_networksecurity_v1::model::GetAuthorizationPolicyRequest;
2502    /// # let project_id = "project_id";
2503    /// # let location_id = "location_id";
2504    /// # let authorization_policy_id = "authorization_policy_id";
2505    /// let x = GetAuthorizationPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
2506    /// ```
2507    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2508        self.name = v.into();
2509        self
2510    }
2511}
2512
2513impl wkt::message::Message for GetAuthorizationPolicyRequest {
2514    fn typename() -> &'static str {
2515        "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
2516    }
2517}
2518
2519/// Request used by the CreateAuthorizationPolicy method.
2520#[derive(Clone, Default, PartialEq)]
2521#[non_exhaustive]
2522pub struct CreateAuthorizationPolicyRequest {
2523    /// Required. The parent resource of the AuthorizationPolicy. Must be in the
2524    /// format `projects/{project}/locations/{location}`.
2525    pub parent: std::string::String,
2526
2527    /// Required. Short name of the AuthorizationPolicy resource to be created.
2528    /// This value should be 1-63 characters long, containing only
2529    /// letters, numbers, hyphens, and underscores, and should not start
2530    /// with a number. E.g. "authz_policy".
2531    pub authorization_policy_id: std::string::String,
2532
2533    /// Required. AuthorizationPolicy resource to be created.
2534    pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2535
2536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2537}
2538
2539impl CreateAuthorizationPolicyRequest {
2540    /// Creates a new default instance.
2541    pub fn new() -> Self {
2542        std::default::Default::default()
2543    }
2544
2545    /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
2546    ///
2547    /// # Example
2548    /// ```ignore,no_run
2549    /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2550    /// # let project_id = "project_id";
2551    /// # let location_id = "location_id";
2552    /// let x = CreateAuthorizationPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2553    /// ```
2554    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2555        self.parent = v.into();
2556        self
2557    }
2558
2559    /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
2560    ///
2561    /// # Example
2562    /// ```ignore,no_run
2563    /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2564    /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy_id("example");
2565    /// ```
2566    pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
2567        mut self,
2568        v: T,
2569    ) -> Self {
2570        self.authorization_policy_id = v.into();
2571        self
2572    }
2573
2574    /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2575    ///
2576    /// # Example
2577    /// ```ignore,no_run
2578    /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2579    /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2580    /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2581    /// ```
2582    pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2583    where
2584        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2585    {
2586        self.authorization_policy = std::option::Option::Some(v.into());
2587        self
2588    }
2589
2590    /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2591    ///
2592    /// # Example
2593    /// ```ignore,no_run
2594    /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2595    /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2596    /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2597    /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2598    /// ```
2599    pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2600    where
2601        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2602    {
2603        self.authorization_policy = v.map(|x| x.into());
2604        self
2605    }
2606}
2607
2608impl wkt::message::Message for CreateAuthorizationPolicyRequest {
2609    fn typename() -> &'static str {
2610        "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
2611    }
2612}
2613
2614/// Request used by the UpdateAuthorizationPolicy method.
2615#[derive(Clone, Default, PartialEq)]
2616#[non_exhaustive]
2617pub struct UpdateAuthorizationPolicyRequest {
2618    /// Optional. Field mask is used to specify the fields to be overwritten in the
2619    /// AuthorizationPolicy resource by the update.
2620    /// The fields specified in the update_mask are relative to the resource, not
2621    /// the full request. A field will be overwritten if it is in the mask. If the
2622    /// user does not provide a mask then all fields will be overwritten.
2623    pub update_mask: std::option::Option<wkt::FieldMask>,
2624
2625    /// Required. Updated AuthorizationPolicy resource.
2626    pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2627
2628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl UpdateAuthorizationPolicyRequest {
2632    /// Creates a new default instance.
2633    pub fn new() -> Self {
2634        std::default::Default::default()
2635    }
2636
2637    /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2638    ///
2639    /// # Example
2640    /// ```ignore,no_run
2641    /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2642    /// use wkt::FieldMask;
2643    /// let x = UpdateAuthorizationPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2644    /// ```
2645    pub fn set_update_mask<T>(mut self, v: T) -> Self
2646    where
2647        T: std::convert::Into<wkt::FieldMask>,
2648    {
2649        self.update_mask = std::option::Option::Some(v.into());
2650        self
2651    }
2652
2653    /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2654    ///
2655    /// # Example
2656    /// ```ignore,no_run
2657    /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2658    /// use wkt::FieldMask;
2659    /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2660    /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2661    /// ```
2662    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2663    where
2664        T: std::convert::Into<wkt::FieldMask>,
2665    {
2666        self.update_mask = v.map(|x| x.into());
2667        self
2668    }
2669
2670    /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2671    ///
2672    /// # Example
2673    /// ```ignore,no_run
2674    /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2675    /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2676    /// let x = UpdateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2677    /// ```
2678    pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2679    where
2680        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2681    {
2682        self.authorization_policy = std::option::Option::Some(v.into());
2683        self
2684    }
2685
2686    /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2687    ///
2688    /// # Example
2689    /// ```ignore,no_run
2690    /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2691    /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2692    /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2693    /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2694    /// ```
2695    pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2696    where
2697        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2698    {
2699        self.authorization_policy = v.map(|x| x.into());
2700        self
2701    }
2702}
2703
2704impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2705    fn typename() -> &'static str {
2706        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2707    }
2708}
2709
2710/// Request used by the DeleteAuthorizationPolicy method.
2711#[derive(Clone, Default, PartialEq)]
2712#[non_exhaustive]
2713pub struct DeleteAuthorizationPolicyRequest {
2714    /// Required. A name of the AuthorizationPolicy to delete. Must be in the
2715    /// format `projects/{project}/locations/{location}/authorizationPolicies/*`.
2716    pub name: std::string::String,
2717
2718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2719}
2720
2721impl DeleteAuthorizationPolicyRequest {
2722    /// Creates a new default instance.
2723    pub fn new() -> Self {
2724        std::default::Default::default()
2725    }
2726
2727    /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
2728    ///
2729    /// # Example
2730    /// ```ignore,no_run
2731    /// # use google_cloud_networksecurity_v1::model::DeleteAuthorizationPolicyRequest;
2732    /// # let project_id = "project_id";
2733    /// # let location_id = "location_id";
2734    /// # let authorization_policy_id = "authorization_policy_id";
2735    /// let x = DeleteAuthorizationPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
2736    /// ```
2737    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2738        self.name = v.into();
2739        self
2740    }
2741}
2742
2743impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2744    fn typename() -> &'static str {
2745        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2746    }
2747}
2748
2749/// `AuthzPolicy` is a resource that allows to forward traffic to a
2750/// callout backend designed to scan the traffic for security purposes.
2751#[derive(Clone, Default, PartialEq)]
2752#[non_exhaustive]
2753pub struct AuthzPolicy {
2754    /// Required. Identifier. Name of the `AuthzPolicy` resource in the following
2755    /// format:
2756    /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
2757    pub name: std::string::String,
2758
2759    /// Output only. The timestamp when the resource was created.
2760    pub create_time: std::option::Option<wkt::Timestamp>,
2761
2762    /// Output only. The timestamp when the resource was updated.
2763    pub update_time: std::option::Option<wkt::Timestamp>,
2764
2765    /// Optional. A human-readable description of the resource.
2766    pub description: std::string::String,
2767
2768    /// Optional. Set of labels associated with the `AuthzPolicy` resource.
2769    ///
2770    /// The format must comply with [the following
2771    /// requirements](/compute/docs/labeling-resources#requirements).
2772    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2773
2774    /// Required. Specifies the set of resources to which this policy should be
2775    /// applied to.
2776    pub target: std::option::Option<crate::model::authz_policy::Target>,
2777
2778    /// Optional. A list of authorization HTTP rules to match against the incoming
2779    /// request. A policy match occurs when at least one HTTP rule matches the
2780    /// request or when no HTTP rules are specified in the policy.
2781    /// At least one HTTP Rule is required for Allow or Deny Action. Limited
2782    /// to 5 rules.
2783    pub http_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2784
2785    /// Optional. A list of authorization network rules to match against the
2786    /// incoming request. A policy match occurs when at least one network rule
2787    /// matches the request.
2788    /// At least one network rule is required for Allow or Deny Action if no HTTP
2789    /// rules are provided. Network rules are mutually exclusive with HTTP rules.
2790    /// Limited to 5 rules.
2791    pub network_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2792
2793    /// Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
2794    ///
2795    /// When the action is `CUSTOM`, `customProvider` must be specified.
2796    ///
2797    /// When the action is `ALLOW`, only requests matching the policy will
2798    /// be allowed.
2799    ///
2800    /// When the action is `DENY`, only requests matching the policy will be
2801    /// denied.
2802    ///
2803    /// When a request arrives, the policies are evaluated in the following order:
2804    ///
2805    /// 1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
2806    ///    policy is evaluated using the custom authorization providers and the
2807    ///    request is denied if the provider rejects the request.
2808    ///
2809    /// 1. If there are any `DENY` policies that match the request, the request
2810    ///    is denied.
2811    ///
2812    /// 1. If there are no `ALLOW` policies for the resource or if any of the
2813    ///    `ALLOW` policies match the request, the request is allowed.
2814    ///
2815    /// 1. Else the request is denied by default if none of the configured
2816    ///    AuthzPolicies with `ALLOW` action match the request.
2817    ///
2818    pub action: crate::model::authz_policy::AuthzAction,
2819
2820    /// Optional. Required if the action is `CUSTOM`. Allows delegating
2821    /// authorization decisions to Cloud IAP or to Service Extensions. One of
2822    /// `cloudIap` or `authzExtension` must be specified.
2823    pub custom_provider: std::option::Option<crate::model::authz_policy::CustomProvider>,
2824
2825    /// Optional. Immutable. Defines the type of authorization being performed.
2826    /// If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
2827    /// once AuthzPolicy is created.
2828    pub policy_profile: crate::model::authz_policy::PolicyProfile,
2829
2830    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2831}
2832
2833impl AuthzPolicy {
2834    /// Creates a new default instance.
2835    pub fn new() -> Self {
2836        std::default::Default::default()
2837    }
2838
2839    /// Sets the value of [name][crate::model::AuthzPolicy::name].
2840    ///
2841    /// # Example
2842    /// ```ignore,no_run
2843    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2844    /// # let project_id = "project_id";
2845    /// # let location_id = "location_id";
2846    /// # let authz_policy_id = "authz_policy_id";
2847    /// let x = AuthzPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
2848    /// ```
2849    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2850        self.name = v.into();
2851        self
2852    }
2853
2854    /// Sets the value of [create_time][crate::model::AuthzPolicy::create_time].
2855    ///
2856    /// # Example
2857    /// ```ignore,no_run
2858    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2859    /// use wkt::Timestamp;
2860    /// let x = AuthzPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2861    /// ```
2862    pub fn set_create_time<T>(mut self, v: T) -> Self
2863    where
2864        T: std::convert::Into<wkt::Timestamp>,
2865    {
2866        self.create_time = std::option::Option::Some(v.into());
2867        self
2868    }
2869
2870    /// Sets or clears the value of [create_time][crate::model::AuthzPolicy::create_time].
2871    ///
2872    /// # Example
2873    /// ```ignore,no_run
2874    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2875    /// use wkt::Timestamp;
2876    /// let x = AuthzPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2877    /// let x = AuthzPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2878    /// ```
2879    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2880    where
2881        T: std::convert::Into<wkt::Timestamp>,
2882    {
2883        self.create_time = v.map(|x| x.into());
2884        self
2885    }
2886
2887    /// Sets the value of [update_time][crate::model::AuthzPolicy::update_time].
2888    ///
2889    /// # Example
2890    /// ```ignore,no_run
2891    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2892    /// use wkt::Timestamp;
2893    /// let x = AuthzPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2894    /// ```
2895    pub fn set_update_time<T>(mut self, v: T) -> Self
2896    where
2897        T: std::convert::Into<wkt::Timestamp>,
2898    {
2899        self.update_time = std::option::Option::Some(v.into());
2900        self
2901    }
2902
2903    /// Sets or clears the value of [update_time][crate::model::AuthzPolicy::update_time].
2904    ///
2905    /// # Example
2906    /// ```ignore,no_run
2907    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2908    /// use wkt::Timestamp;
2909    /// let x = AuthzPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2910    /// let x = AuthzPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2911    /// ```
2912    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2913    where
2914        T: std::convert::Into<wkt::Timestamp>,
2915    {
2916        self.update_time = v.map(|x| x.into());
2917        self
2918    }
2919
2920    /// Sets the value of [description][crate::model::AuthzPolicy::description].
2921    ///
2922    /// # Example
2923    /// ```ignore,no_run
2924    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2925    /// let x = AuthzPolicy::new().set_description("example");
2926    /// ```
2927    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2928        self.description = v.into();
2929        self
2930    }
2931
2932    /// Sets the value of [labels][crate::model::AuthzPolicy::labels].
2933    ///
2934    /// # Example
2935    /// ```ignore,no_run
2936    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2937    /// let x = AuthzPolicy::new().set_labels([
2938    ///     ("key0", "abc"),
2939    ///     ("key1", "xyz"),
2940    /// ]);
2941    /// ```
2942    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2943    where
2944        T: std::iter::IntoIterator<Item = (K, V)>,
2945        K: std::convert::Into<std::string::String>,
2946        V: std::convert::Into<std::string::String>,
2947    {
2948        use std::iter::Iterator;
2949        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2950        self
2951    }
2952
2953    /// Sets the value of [target][crate::model::AuthzPolicy::target].
2954    ///
2955    /// # Example
2956    /// ```ignore,no_run
2957    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2958    /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2959    /// let x = AuthzPolicy::new().set_target(Target::default()/* use setters */);
2960    /// ```
2961    pub fn set_target<T>(mut self, v: T) -> Self
2962    where
2963        T: std::convert::Into<crate::model::authz_policy::Target>,
2964    {
2965        self.target = std::option::Option::Some(v.into());
2966        self
2967    }
2968
2969    /// Sets or clears the value of [target][crate::model::AuthzPolicy::target].
2970    ///
2971    /// # Example
2972    /// ```ignore,no_run
2973    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2974    /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2975    /// let x = AuthzPolicy::new().set_or_clear_target(Some(Target::default()/* use setters */));
2976    /// let x = AuthzPolicy::new().set_or_clear_target(None::<Target>);
2977    /// ```
2978    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
2979    where
2980        T: std::convert::Into<crate::model::authz_policy::Target>,
2981    {
2982        self.target = v.map(|x| x.into());
2983        self
2984    }
2985
2986    /// Sets the value of [http_rules][crate::model::AuthzPolicy::http_rules].
2987    ///
2988    /// # Example
2989    /// ```ignore,no_run
2990    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2991    /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
2992    /// let x = AuthzPolicy::new()
2993    ///     .set_http_rules([
2994    ///         AuthzRule::default()/* use setters */,
2995    ///         AuthzRule::default()/* use (different) setters */,
2996    ///     ]);
2997    /// ```
2998    pub fn set_http_rules<T, V>(mut self, v: T) -> Self
2999    where
3000        T: std::iter::IntoIterator<Item = V>,
3001        V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
3002    {
3003        use std::iter::Iterator;
3004        self.http_rules = v.into_iter().map(|i| i.into()).collect();
3005        self
3006    }
3007
3008    /// Sets the value of [network_rules][crate::model::AuthzPolicy::network_rules].
3009    ///
3010    /// # Example
3011    /// ```ignore,no_run
3012    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3013    /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3014    /// let x = AuthzPolicy::new()
3015    ///     .set_network_rules([
3016    ///         AuthzRule::default()/* use setters */,
3017    ///         AuthzRule::default()/* use (different) setters */,
3018    ///     ]);
3019    /// ```
3020    pub fn set_network_rules<T, V>(mut self, v: T) -> Self
3021    where
3022        T: std::iter::IntoIterator<Item = V>,
3023        V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
3024    {
3025        use std::iter::Iterator;
3026        self.network_rules = v.into_iter().map(|i| i.into()).collect();
3027        self
3028    }
3029
3030    /// Sets the value of [action][crate::model::AuthzPolicy::action].
3031    ///
3032    /// # Example
3033    /// ```ignore,no_run
3034    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3035    /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzAction;
3036    /// let x0 = AuthzPolicy::new().set_action(AuthzAction::Allow);
3037    /// let x1 = AuthzPolicy::new().set_action(AuthzAction::Deny);
3038    /// let x2 = AuthzPolicy::new().set_action(AuthzAction::Custom);
3039    /// ```
3040    pub fn set_action<T: std::convert::Into<crate::model::authz_policy::AuthzAction>>(
3041        mut self,
3042        v: T,
3043    ) -> Self {
3044        self.action = v.into();
3045        self
3046    }
3047
3048    /// Sets the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
3049    ///
3050    /// # Example
3051    /// ```ignore,no_run
3052    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3053    /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
3054    /// let x = AuthzPolicy::new().set_custom_provider(CustomProvider::default()/* use setters */);
3055    /// ```
3056    pub fn set_custom_provider<T>(mut self, v: T) -> Self
3057    where
3058        T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
3059    {
3060        self.custom_provider = std::option::Option::Some(v.into());
3061        self
3062    }
3063
3064    /// Sets or clears the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
3065    ///
3066    /// # Example
3067    /// ```ignore,no_run
3068    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3069    /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
3070    /// let x = AuthzPolicy::new().set_or_clear_custom_provider(Some(CustomProvider::default()/* use setters */));
3071    /// let x = AuthzPolicy::new().set_or_clear_custom_provider(None::<CustomProvider>);
3072    /// ```
3073    pub fn set_or_clear_custom_provider<T>(mut self, v: std::option::Option<T>) -> Self
3074    where
3075        T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
3076    {
3077        self.custom_provider = v.map(|x| x.into());
3078        self
3079    }
3080
3081    /// Sets the value of [policy_profile][crate::model::AuthzPolicy::policy_profile].
3082    ///
3083    /// # Example
3084    /// ```ignore,no_run
3085    /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3086    /// use google_cloud_networksecurity_v1::model::authz_policy::PolicyProfile;
3087    /// let x0 = AuthzPolicy::new().set_policy_profile(PolicyProfile::RequestAuthz);
3088    /// let x1 = AuthzPolicy::new().set_policy_profile(PolicyProfile::ContentAuthz);
3089    /// ```
3090    pub fn set_policy_profile<T: std::convert::Into<crate::model::authz_policy::PolicyProfile>>(
3091        mut self,
3092        v: T,
3093    ) -> Self {
3094        self.policy_profile = v.into();
3095        self
3096    }
3097}
3098
3099impl wkt::message::Message for AuthzPolicy {
3100    fn typename() -> &'static str {
3101        "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy"
3102    }
3103}
3104
3105/// Defines additional types related to [AuthzPolicy].
3106pub mod authz_policy {
3107    #[allow(unused_imports)]
3108    use super::*;
3109
3110    /// Specifies the set of targets to which this policy should be applied to.
3111    #[derive(Clone, Default, PartialEq)]
3112    #[non_exhaustive]
3113    pub struct Target {
3114        /// Optional. All gateways and forwarding rules referenced by this policy and
3115        /// extensions must share the same load balancing scheme. Required only when
3116        /// targeting forwarding rules. If targeting Secure Web Proxy, this field
3117        /// must be `INTERNAL_MANAGED` or not specified. Must not be specified
3118        /// when targeting Agent Gateway. Supported values:
3119        /// `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer
3120        /// to [Backend services
3121        /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
3122        pub load_balancing_scheme: crate::model::authz_policy::LoadBalancingScheme,
3123
3124        /// Required. A list of references to the Forwarding Rules, Secure Web Proxy
3125        /// Gateways, or Agent Gateways on which this policy will be applied.
3126        pub resources: std::vec::Vec<std::string::String>,
3127
3128        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3129    }
3130
3131    impl Target {
3132        /// Creates a new default instance.
3133        pub fn new() -> Self {
3134            std::default::Default::default()
3135        }
3136
3137        /// Sets the value of [load_balancing_scheme][crate::model::authz_policy::Target::load_balancing_scheme].
3138        ///
3139        /// # Example
3140        /// ```ignore,no_run
3141        /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3142        /// use google_cloud_networksecurity_v1::model::authz_policy::LoadBalancingScheme;
3143        /// let x0 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalManaged);
3144        /// let x1 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::ExternalManaged);
3145        /// let x2 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalSelfManaged);
3146        /// ```
3147        pub fn set_load_balancing_scheme<
3148            T: std::convert::Into<crate::model::authz_policy::LoadBalancingScheme>,
3149        >(
3150            mut self,
3151            v: T,
3152        ) -> Self {
3153            self.load_balancing_scheme = v.into();
3154            self
3155        }
3156
3157        /// Sets the value of [resources][crate::model::authz_policy::Target::resources].
3158        ///
3159        /// # Example
3160        /// ```ignore,no_run
3161        /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3162        /// let x = Target::new().set_resources(["a", "b", "c"]);
3163        /// ```
3164        pub fn set_resources<T, V>(mut self, v: T) -> Self
3165        where
3166            T: std::iter::IntoIterator<Item = V>,
3167            V: std::convert::Into<std::string::String>,
3168        {
3169            use std::iter::Iterator;
3170            self.resources = v.into_iter().map(|i| i.into()).collect();
3171            self
3172        }
3173    }
3174
3175    impl wkt::message::Message for Target {
3176        fn typename() -> &'static str {
3177            "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.Target"
3178        }
3179    }
3180
3181    /// Conditions to match against the incoming request.
3182    #[derive(Clone, Default, PartialEq)]
3183    #[non_exhaustive]
3184    pub struct AuthzRule {
3185        /// Optional. Describes properties of a source of a request.
3186        pub from: std::option::Option<crate::model::authz_policy::authz_rule::From>,
3187
3188        /// Optional. Describes properties of a target of a request.
3189        pub to: std::option::Option<crate::model::authz_policy::authz_rule::To>,
3190
3191        /// Optional. CEL expression that describes the conditions to be satisfied
3192        /// for the action. The result of the CEL expression is ANDed with the from
3193        /// and to. Refer to the CEL language reference for a list of available
3194        /// attributes.
3195        pub when: std::string::String,
3196
3197        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3198    }
3199
3200    impl AuthzRule {
3201        /// Creates a new default instance.
3202        pub fn new() -> Self {
3203            std::default::Default::default()
3204        }
3205
3206        /// Sets the value of [from][crate::model::authz_policy::AuthzRule::from].
3207        ///
3208        /// # Example
3209        /// ```ignore,no_run
3210        /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3211        /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3212        /// let x = AuthzRule::new().set_from(From::default()/* use setters */);
3213        /// ```
3214        pub fn set_from<T>(mut self, v: T) -> Self
3215        where
3216            T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3217        {
3218            self.from = std::option::Option::Some(v.into());
3219            self
3220        }
3221
3222        /// Sets or clears the value of [from][crate::model::authz_policy::AuthzRule::from].
3223        ///
3224        /// # Example
3225        /// ```ignore,no_run
3226        /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3227        /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3228        /// let x = AuthzRule::new().set_or_clear_from(Some(From::default()/* use setters */));
3229        /// let x = AuthzRule::new().set_or_clear_from(None::<From>);
3230        /// ```
3231        pub fn set_or_clear_from<T>(mut self, v: std::option::Option<T>) -> Self
3232        where
3233            T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3234        {
3235            self.from = v.map(|x| x.into());
3236            self
3237        }
3238
3239        /// Sets the value of [to][crate::model::authz_policy::AuthzRule::to].
3240        ///
3241        /// # Example
3242        /// ```ignore,no_run
3243        /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3244        /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3245        /// let x = AuthzRule::new().set_to(To::default()/* use setters */);
3246        /// ```
3247        pub fn set_to<T>(mut self, v: T) -> Self
3248        where
3249            T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3250        {
3251            self.to = std::option::Option::Some(v.into());
3252            self
3253        }
3254
3255        /// Sets or clears the value of [to][crate::model::authz_policy::AuthzRule::to].
3256        ///
3257        /// # Example
3258        /// ```ignore,no_run
3259        /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3260        /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3261        /// let x = AuthzRule::new().set_or_clear_to(Some(To::default()/* use setters */));
3262        /// let x = AuthzRule::new().set_or_clear_to(None::<To>);
3263        /// ```
3264        pub fn set_or_clear_to<T>(mut self, v: std::option::Option<T>) -> Self
3265        where
3266            T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3267        {
3268            self.to = v.map(|x| x.into());
3269            self
3270        }
3271
3272        /// Sets the value of [when][crate::model::authz_policy::AuthzRule::when].
3273        ///
3274        /// # Example
3275        /// ```ignore,no_run
3276        /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3277        /// let x = AuthzRule::new().set_when("example");
3278        /// ```
3279        pub fn set_when<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3280            self.when = v.into();
3281            self
3282        }
3283    }
3284
3285    impl wkt::message::Message for AuthzRule {
3286        fn typename() -> &'static str {
3287            "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule"
3288        }
3289    }
3290
3291    /// Defines additional types related to [AuthzRule].
3292    pub mod authz_rule {
3293        #[allow(unused_imports)]
3294        use super::*;
3295
3296        /// Determines how a string value should be matched.
3297        #[derive(Clone, Default, PartialEq)]
3298        #[non_exhaustive]
3299        pub struct StringMatch {
3300            /// If true, indicates the exact/prefix/suffix/contains matching should be
3301            /// case insensitive. For example, the matcher ``data`` will match both
3302            /// input string ``Data`` and ``data`` if set to true.
3303            pub ignore_case: bool,
3304
3305            #[allow(missing_docs)]
3306            pub match_pattern: std::option::Option<
3307                crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3308            >,
3309
3310            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3311        }
3312
3313        impl StringMatch {
3314            /// Creates a new default instance.
3315            pub fn new() -> Self {
3316                std::default::Default::default()
3317            }
3318
3319            /// Sets the value of [ignore_case][crate::model::authz_policy::authz_rule::StringMatch::ignore_case].
3320            ///
3321            /// # Example
3322            /// ```ignore,no_run
3323            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3324            /// let x = StringMatch::new().set_ignore_case(true);
3325            /// ```
3326            pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3327                self.ignore_case = v.into();
3328                self
3329            }
3330
3331            /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern].
3332            ///
3333            /// Note that all the setters affecting `match_pattern` are mutually
3334            /// exclusive.
3335            ///
3336            /// # Example
3337            /// ```ignore,no_run
3338            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3339            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::string_match::MatchPattern;
3340            /// let x = StringMatch::new().set_match_pattern(Some(MatchPattern::Exact("example".to_string())));
3341            /// ```
3342            pub fn set_match_pattern<
3343                T: std::convert::Into<
3344                        std::option::Option<
3345                            crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3346                        >,
3347                    >,
3348            >(
3349                mut self,
3350                v: T,
3351            ) -> Self {
3352                self.match_pattern = v.into();
3353                self
3354            }
3355
3356            /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3357            /// if it holds a `Exact`, `None` if the field is not set or
3358            /// holds a different branch.
3359            pub fn exact(&self) -> std::option::Option<&std::string::String> {
3360                #[allow(unreachable_patterns)]
3361                self.match_pattern.as_ref().and_then(|v| match v {
3362                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3363                        v,
3364                    ) => std::option::Option::Some(v),
3365                    _ => std::option::Option::None,
3366                })
3367            }
3368
3369            /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3370            /// to hold a `Exact`.
3371            ///
3372            /// Note that all the setters affecting `match_pattern` are
3373            /// mutually exclusive.
3374            ///
3375            /// # Example
3376            /// ```ignore,no_run
3377            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3378            /// let x = StringMatch::new().set_exact("example");
3379            /// assert!(x.exact().is_some());
3380            /// assert!(x.prefix().is_none());
3381            /// assert!(x.suffix().is_none());
3382            /// assert!(x.contains().is_none());
3383            /// ```
3384            pub fn set_exact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3385                self.match_pattern = std::option::Option::Some(
3386                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3387                        v.into(),
3388                    ),
3389                );
3390                self
3391            }
3392
3393            /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3394            /// if it holds a `Prefix`, `None` if the field is not set or
3395            /// holds a different branch.
3396            pub fn prefix(&self) -> std::option::Option<&std::string::String> {
3397                #[allow(unreachable_patterns)]
3398                self.match_pattern.as_ref().and_then(|v| match v {
3399                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3400                        v,
3401                    ) => std::option::Option::Some(v),
3402                    _ => std::option::Option::None,
3403                })
3404            }
3405
3406            /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3407            /// to hold a `Prefix`.
3408            ///
3409            /// Note that all the setters affecting `match_pattern` are
3410            /// mutually exclusive.
3411            ///
3412            /// # Example
3413            /// ```ignore,no_run
3414            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3415            /// let x = StringMatch::new().set_prefix("example");
3416            /// assert!(x.prefix().is_some());
3417            /// assert!(x.exact().is_none());
3418            /// assert!(x.suffix().is_none());
3419            /// assert!(x.contains().is_none());
3420            /// ```
3421            pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3422                self.match_pattern = std::option::Option::Some(
3423                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3424                        v.into(),
3425                    ),
3426                );
3427                self
3428            }
3429
3430            /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3431            /// if it holds a `Suffix`, `None` if the field is not set or
3432            /// holds a different branch.
3433            pub fn suffix(&self) -> std::option::Option<&std::string::String> {
3434                #[allow(unreachable_patterns)]
3435                self.match_pattern.as_ref().and_then(|v| match v {
3436                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3437                        v,
3438                    ) => std::option::Option::Some(v),
3439                    _ => std::option::Option::None,
3440                })
3441            }
3442
3443            /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3444            /// to hold a `Suffix`.
3445            ///
3446            /// Note that all the setters affecting `match_pattern` are
3447            /// mutually exclusive.
3448            ///
3449            /// # Example
3450            /// ```ignore,no_run
3451            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3452            /// let x = StringMatch::new().set_suffix("example");
3453            /// assert!(x.suffix().is_some());
3454            /// assert!(x.exact().is_none());
3455            /// assert!(x.prefix().is_none());
3456            /// assert!(x.contains().is_none());
3457            /// ```
3458            pub fn set_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459                self.match_pattern = std::option::Option::Some(
3460                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3461                        v.into(),
3462                    ),
3463                );
3464                self
3465            }
3466
3467            /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3468            /// if it holds a `Contains`, `None` if the field is not set or
3469            /// holds a different branch.
3470            pub fn contains(&self) -> std::option::Option<&std::string::String> {
3471                #[allow(unreachable_patterns)]
3472                self.match_pattern.as_ref().and_then(|v| match v {
3473                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(v) => std::option::Option::Some(v),
3474                    _ => std::option::Option::None,
3475                })
3476            }
3477
3478            /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3479            /// to hold a `Contains`.
3480            ///
3481            /// Note that all the setters affecting `match_pattern` are
3482            /// mutually exclusive.
3483            ///
3484            /// # Example
3485            /// ```ignore,no_run
3486            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3487            /// let x = StringMatch::new().set_contains("example");
3488            /// assert!(x.contains().is_some());
3489            /// assert!(x.exact().is_none());
3490            /// assert!(x.prefix().is_none());
3491            /// assert!(x.suffix().is_none());
3492            /// ```
3493            pub fn set_contains<T: std::convert::Into<std::string::String>>(
3494                mut self,
3495                v: T,
3496            ) -> Self {
3497                self.match_pattern = std::option::Option::Some(
3498                    crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(
3499                        v.into(),
3500                    ),
3501                );
3502                self
3503            }
3504        }
3505
3506        impl wkt::message::Message for StringMatch {
3507            fn typename() -> &'static str {
3508                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch"
3509            }
3510        }
3511
3512        /// Defines additional types related to [StringMatch].
3513        pub mod string_match {
3514            #[allow(unused_imports)]
3515            use super::*;
3516
3517            #[allow(missing_docs)]
3518            #[derive(Clone, Debug, PartialEq)]
3519            #[non_exhaustive]
3520            pub enum MatchPattern {
3521                /// The input string must match exactly the string specified here.
3522                ///
3523                /// Examples:
3524                ///
3525                /// * ``abc`` only matches the value ``abc``.
3526                Exact(std::string::String),
3527                /// The input string must have the prefix specified here.
3528                /// Note: empty prefix is not allowed, please use regex instead.
3529                ///
3530                /// Examples:
3531                ///
3532                /// * ``abc`` matches the value ``abc.xyz``
3533                Prefix(std::string::String),
3534                /// The input string must have the suffix specified here.
3535                /// Note: empty prefix is not allowed, please use regex instead.
3536                ///
3537                /// Examples:
3538                ///
3539                /// * ``abc`` matches the value ``xyz.abc``
3540                Suffix(std::string::String),
3541                /// The input string must have the substring specified here.
3542                /// Note: empty contains match is not allowed, please use regex instead.
3543                ///
3544                /// Examples:
3545                ///
3546                /// * ``abc`` matches the value ``xyz.abc.def``
3547                Contains(std::string::String),
3548            }
3549        }
3550
3551        /// Represents a range of IP Addresses.
3552        #[derive(Clone, Default, PartialEq)]
3553        #[non_exhaustive]
3554        pub struct IpBlock {
3555            /// Required. The address prefix.
3556            pub prefix: std::string::String,
3557
3558            /// Required. The length of the address range.
3559            pub length: i32,
3560
3561            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3562        }
3563
3564        impl IpBlock {
3565            /// Creates a new default instance.
3566            pub fn new() -> Self {
3567                std::default::Default::default()
3568            }
3569
3570            /// Sets the value of [prefix][crate::model::authz_policy::authz_rule::IpBlock::prefix].
3571            ///
3572            /// # Example
3573            /// ```ignore,no_run
3574            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3575            /// let x = IpBlock::new().set_prefix("example");
3576            /// ```
3577            pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3578                self.prefix = v.into();
3579                self
3580            }
3581
3582            /// Sets the value of [length][crate::model::authz_policy::authz_rule::IpBlock::length].
3583            ///
3584            /// # Example
3585            /// ```ignore,no_run
3586            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3587            /// let x = IpBlock::new().set_length(42);
3588            /// ```
3589            pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3590                self.length = v.into();
3591                self
3592            }
3593        }
3594
3595        impl wkt::message::Message for IpBlock {
3596            fn typename() -> &'static str {
3597                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock"
3598            }
3599        }
3600
3601        /// Describes the properties of a client VM resource accessing the internal
3602        /// application load balancers.
3603        #[derive(Clone, Default, PartialEq)]
3604        #[non_exhaustive]
3605        pub struct RequestResource {
3606            /// Optional. A list of resource tag value permanent IDs to match against
3607            /// the resource manager tags value associated with the source VM of a
3608            /// request.
3609            pub tag_value_id_set: std::option::Option<
3610                crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3611            >,
3612
3613            /// Optional. An IAM service account to match against the source
3614            /// service account of the VM sending the request.
3615            pub iam_service_account:
3616                std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3617
3618            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3619        }
3620
3621        impl RequestResource {
3622            /// Creates a new default instance.
3623            pub fn new() -> Self {
3624                std::default::Default::default()
3625            }
3626
3627            /// Sets the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3628            ///
3629            /// # Example
3630            /// ```ignore,no_run
3631            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3632            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3633            /// let x = RequestResource::new().set_tag_value_id_set(TagValueIdSet::default()/* use setters */);
3634            /// ```
3635            pub fn set_tag_value_id_set<T>(mut self, v: T) -> Self
3636            where
3637                T: std::convert::Into<
3638                        crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3639                    >,
3640            {
3641                self.tag_value_id_set = std::option::Option::Some(v.into());
3642                self
3643            }
3644
3645            /// Sets or clears the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3646            ///
3647            /// # Example
3648            /// ```ignore,no_run
3649            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3650            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3651            /// let x = RequestResource::new().set_or_clear_tag_value_id_set(Some(TagValueIdSet::default()/* use setters */));
3652            /// let x = RequestResource::new().set_or_clear_tag_value_id_set(None::<TagValueIdSet>);
3653            /// ```
3654            pub fn set_or_clear_tag_value_id_set<T>(mut self, v: std::option::Option<T>) -> Self
3655            where
3656                T: std::convert::Into<
3657                        crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3658                    >,
3659            {
3660                self.tag_value_id_set = v.map(|x| x.into());
3661                self
3662            }
3663
3664            /// Sets the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3665            ///
3666            /// # Example
3667            /// ```ignore,no_run
3668            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3669            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3670            /// let x = RequestResource::new().set_iam_service_account(StringMatch::default()/* use setters */);
3671            /// ```
3672            pub fn set_iam_service_account<T>(mut self, v: T) -> Self
3673            where
3674                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3675            {
3676                self.iam_service_account = std::option::Option::Some(v.into());
3677                self
3678            }
3679
3680            /// Sets or clears the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3681            ///
3682            /// # Example
3683            /// ```ignore,no_run
3684            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3685            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3686            /// let x = RequestResource::new().set_or_clear_iam_service_account(Some(StringMatch::default()/* use setters */));
3687            /// let x = RequestResource::new().set_or_clear_iam_service_account(None::<StringMatch>);
3688            /// ```
3689            pub fn set_or_clear_iam_service_account<T>(mut self, v: std::option::Option<T>) -> Self
3690            where
3691                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3692            {
3693                self.iam_service_account = v.map(|x| x.into());
3694                self
3695            }
3696        }
3697
3698        impl wkt::message::Message for RequestResource {
3699            fn typename() -> &'static str {
3700                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource"
3701            }
3702        }
3703
3704        /// Defines additional types related to [RequestResource].
3705        pub mod request_resource {
3706            #[allow(unused_imports)]
3707            use super::*;
3708
3709            /// Describes a set of resource tag value permanent IDs to match against
3710            /// the resource manager tags value associated with the source VM of a
3711            /// request.
3712            #[derive(Clone, Default, PartialEq)]
3713            #[non_exhaustive]
3714            pub struct TagValueIdSet {
3715                /// Required. A list of resource tag value permanent IDs to match against
3716                /// the resource manager tags value associated with the source VM of a
3717                /// request. The match follows AND semantics which means all
3718                /// the ids must match. Limited to 5 ids in the Tag value id set.
3719                pub ids: std::vec::Vec<i64>,
3720
3721                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3722            }
3723
3724            impl TagValueIdSet {
3725                /// Creates a new default instance.
3726                pub fn new() -> Self {
3727                    std::default::Default::default()
3728                }
3729
3730                /// Sets the value of [ids][crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet::ids].
3731                ///
3732                /// # Example
3733                /// ```ignore,no_run
3734                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3735                /// let x = TagValueIdSet::new().set_ids([1, 2, 3]);
3736                /// ```
3737                pub fn set_ids<T, V>(mut self, v: T) -> Self
3738                where
3739                    T: std::iter::IntoIterator<Item = V>,
3740                    V: std::convert::Into<i64>,
3741                {
3742                    use std::iter::Iterator;
3743                    self.ids = v.into_iter().map(|i| i.into()).collect();
3744                    self
3745                }
3746            }
3747
3748            impl wkt::message::Message for TagValueIdSet {
3749                fn typename() -> &'static str {
3750                    "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet"
3751                }
3752            }
3753        }
3754
3755        /// Determines how a HTTP header should be matched.
3756        #[derive(Clone, Default, PartialEq)]
3757        #[non_exhaustive]
3758        pub struct HeaderMatch {
3759            /// Optional. Specifies the name of the header in the request.
3760            pub name: std::string::String,
3761
3762            /// Optional. Specifies how the header match will be performed.
3763            pub value: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3764
3765            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3766        }
3767
3768        impl HeaderMatch {
3769            /// Creates a new default instance.
3770            pub fn new() -> Self {
3771                std::default::Default::default()
3772            }
3773
3774            /// Sets the value of [name][crate::model::authz_policy::authz_rule::HeaderMatch::name].
3775            ///
3776            /// # Example
3777            /// ```ignore,no_run
3778            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3779            /// let x = HeaderMatch::new().set_name("example");
3780            /// ```
3781            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3782                self.name = v.into();
3783                self
3784            }
3785
3786            /// Sets the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3787            ///
3788            /// # Example
3789            /// ```ignore,no_run
3790            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3791            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3792            /// let x = HeaderMatch::new().set_value(StringMatch::default()/* use setters */);
3793            /// ```
3794            pub fn set_value<T>(mut self, v: T) -> Self
3795            where
3796                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3797            {
3798                self.value = std::option::Option::Some(v.into());
3799                self
3800            }
3801
3802            /// Sets or clears the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3803            ///
3804            /// # Example
3805            /// ```ignore,no_run
3806            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3807            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3808            /// let x = HeaderMatch::new().set_or_clear_value(Some(StringMatch::default()/* use setters */));
3809            /// let x = HeaderMatch::new().set_or_clear_value(None::<StringMatch>);
3810            /// ```
3811            pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
3812            where
3813                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3814            {
3815                self.value = v.map(|x| x.into());
3816                self
3817            }
3818        }
3819
3820        impl wkt::message::Message for HeaderMatch {
3821            fn typename() -> &'static str {
3822                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch"
3823            }
3824        }
3825
3826        /// Describes the properties of a principal to be matched against.
3827        #[derive(Clone, Default, PartialEq)]
3828        #[non_exhaustive]
3829        pub struct Principal {
3830            /// Optional. An enum to decide what principal value the principal rule
3831            /// will match against. If not specified, the PrincipalSelector is
3832            /// CLIENT_CERT_URI_SAN.
3833            pub principal_selector:
3834                crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3835
3836            /// Required. A non-empty string whose value is matched against the
3837            /// principal value based on the principal_selector. Only exact match can
3838            /// be applied for CLIENT_CERT_URI_SAN, CLIENT_CERT_DNS_NAME_SAN,
3839            /// CLIENT_CERT_COMMON_NAME selectors.
3840            pub principal: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3841
3842            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3843        }
3844
3845        impl Principal {
3846            /// Creates a new default instance.
3847            pub fn new() -> Self {
3848                std::default::Default::default()
3849            }
3850
3851            /// Sets the value of [principal_selector][crate::model::authz_policy::authz_rule::Principal::principal_selector].
3852            ///
3853            /// # Example
3854            /// ```ignore,no_run
3855            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3856            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::principal::PrincipalSelector;
3857            /// let x0 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertUriSan);
3858            /// let x1 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertDnsNameSan);
3859            /// let x2 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertCommonName);
3860            /// ```
3861            pub fn set_principal_selector<
3862                T: std::convert::Into<
3863                        crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3864                    >,
3865            >(
3866                mut self,
3867                v: T,
3868            ) -> Self {
3869                self.principal_selector = v.into();
3870                self
3871            }
3872
3873            /// Sets the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3874            ///
3875            /// # Example
3876            /// ```ignore,no_run
3877            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3878            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3879            /// let x = Principal::new().set_principal(StringMatch::default()/* use setters */);
3880            /// ```
3881            pub fn set_principal<T>(mut self, v: T) -> Self
3882            where
3883                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3884            {
3885                self.principal = std::option::Option::Some(v.into());
3886                self
3887            }
3888
3889            /// Sets or clears the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3890            ///
3891            /// # Example
3892            /// ```ignore,no_run
3893            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3894            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3895            /// let x = Principal::new().set_or_clear_principal(Some(StringMatch::default()/* use setters */));
3896            /// let x = Principal::new().set_or_clear_principal(None::<StringMatch>);
3897            /// ```
3898            pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
3899            where
3900                T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3901            {
3902                self.principal = v.map(|x| x.into());
3903                self
3904            }
3905        }
3906
3907        impl wkt::message::Message for Principal {
3908            fn typename() -> &'static str {
3909                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal"
3910            }
3911        }
3912
3913        /// Defines additional types related to [Principal].
3914        pub mod principal {
3915            #[allow(unused_imports)]
3916            use super::*;
3917
3918            /// The principal value the principal rule will match against.
3919            ///
3920            /// # Working with unknown values
3921            ///
3922            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3923            /// additional enum variants at any time. Adding new variants is not considered
3924            /// a breaking change. Applications should write their code in anticipation of:
3925            ///
3926            /// - New values appearing in future releases of the client library, **and**
3927            /// - New values received dynamically, without application changes.
3928            ///
3929            /// Please consult the [Working with enums] section in the user guide for some
3930            /// guidelines.
3931            ///
3932            /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3933            #[derive(Clone, Debug, PartialEq)]
3934            #[non_exhaustive]
3935            pub enum PrincipalSelector {
3936                /// Unspecified principal selector. It will be treated as
3937                /// CLIENT_CERT_URI_SAN by default.
3938                Unspecified,
3939                /// The principal rule is matched against a list of URI SANs in the
3940                /// validated client's certificate. A match happens when there is any
3941                /// exact URI SAN value match. This is the default principal selector.
3942                ClientCertUriSan,
3943                /// The principal rule is matched against a list of DNS Name SANs in the
3944                /// validated client's certificate. A match happens when there is any
3945                /// exact DNS Name SAN value match.
3946                /// This is only applicable for Application Load Balancers
3947                /// except for classic Global External Application load balancer.
3948                /// CLIENT_CERT_DNS_NAME_SAN is not supported for INTERNAL_SELF_MANAGED
3949                /// load balancing scheme.
3950                ClientCertDnsNameSan,
3951                /// The principal rule is matched against the common name in the client's
3952                /// certificate. Authorization against multiple common names in the
3953                /// client certificate is not supported. Requests with multiple common
3954                /// names in the client certificate will be rejected if
3955                /// CLIENT_CERT_COMMON_NAME is set as the principal selector. A match
3956                /// happens when there is an exact common name value match.
3957                /// This is only applicable for Application Load Balancers
3958                /// except for global external Application Load Balancer and
3959                /// classic Application Load Balancer.
3960                /// CLIENT_CERT_COMMON_NAME is not supported for INTERNAL_SELF_MANAGED
3961                /// load balancing scheme.
3962                ClientCertCommonName,
3963                /// If set, the enum was initialized with an unknown value.
3964                ///
3965                /// Applications can examine the value using [PrincipalSelector::value] or
3966                /// [PrincipalSelector::name].
3967                UnknownValue(principal_selector::UnknownValue),
3968            }
3969
3970            #[doc(hidden)]
3971            pub mod principal_selector {
3972                #[allow(unused_imports)]
3973                use super::*;
3974                #[derive(Clone, Debug, PartialEq)]
3975                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3976            }
3977
3978            impl PrincipalSelector {
3979                /// Gets the enum value.
3980                ///
3981                /// Returns `None` if the enum contains an unknown value deserialized from
3982                /// the string representation of enums.
3983                pub fn value(&self) -> std::option::Option<i32> {
3984                    match self {
3985                        Self::Unspecified => std::option::Option::Some(0),
3986                        Self::ClientCertUriSan => std::option::Option::Some(1),
3987                        Self::ClientCertDnsNameSan => std::option::Option::Some(2),
3988                        Self::ClientCertCommonName => std::option::Option::Some(3),
3989                        Self::UnknownValue(u) => u.0.value(),
3990                    }
3991                }
3992
3993                /// Gets the enum value as a string.
3994                ///
3995                /// Returns `None` if the enum contains an unknown value deserialized from
3996                /// the integer representation of enums.
3997                pub fn name(&self) -> std::option::Option<&str> {
3998                    match self {
3999                        Self::Unspecified => {
4000                            std::option::Option::Some("PRINCIPAL_SELECTOR_UNSPECIFIED")
4001                        }
4002                        Self::ClientCertUriSan => std::option::Option::Some("CLIENT_CERT_URI_SAN"),
4003                        Self::ClientCertDnsNameSan => {
4004                            std::option::Option::Some("CLIENT_CERT_DNS_NAME_SAN")
4005                        }
4006                        Self::ClientCertCommonName => {
4007                            std::option::Option::Some("CLIENT_CERT_COMMON_NAME")
4008                        }
4009                        Self::UnknownValue(u) => u.0.name(),
4010                    }
4011                }
4012            }
4013
4014            impl std::default::Default for PrincipalSelector {
4015                fn default() -> Self {
4016                    use std::convert::From;
4017                    Self::from(0)
4018                }
4019            }
4020
4021            impl std::fmt::Display for PrincipalSelector {
4022                fn fmt(
4023                    &self,
4024                    f: &mut std::fmt::Formatter<'_>,
4025                ) -> std::result::Result<(), std::fmt::Error> {
4026                    wkt::internal::display_enum(f, self.name(), self.value())
4027                }
4028            }
4029
4030            impl std::convert::From<i32> for PrincipalSelector {
4031                fn from(value: i32) -> Self {
4032                    match value {
4033                        0 => Self::Unspecified,
4034                        1 => Self::ClientCertUriSan,
4035                        2 => Self::ClientCertDnsNameSan,
4036                        3 => Self::ClientCertCommonName,
4037                        _ => Self::UnknownValue(principal_selector::UnknownValue(
4038                            wkt::internal::UnknownEnumValue::Integer(value),
4039                        )),
4040                    }
4041                }
4042            }
4043
4044            impl std::convert::From<&str> for PrincipalSelector {
4045                fn from(value: &str) -> Self {
4046                    use std::string::ToString;
4047                    match value {
4048                        "PRINCIPAL_SELECTOR_UNSPECIFIED" => Self::Unspecified,
4049                        "CLIENT_CERT_URI_SAN" => Self::ClientCertUriSan,
4050                        "CLIENT_CERT_DNS_NAME_SAN" => Self::ClientCertDnsNameSan,
4051                        "CLIENT_CERT_COMMON_NAME" => Self::ClientCertCommonName,
4052                        _ => Self::UnknownValue(principal_selector::UnknownValue(
4053                            wkt::internal::UnknownEnumValue::String(value.to_string()),
4054                        )),
4055                    }
4056                }
4057            }
4058
4059            impl serde::ser::Serialize for PrincipalSelector {
4060                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4061                where
4062                    S: serde::Serializer,
4063                {
4064                    match self {
4065                        Self::Unspecified => serializer.serialize_i32(0),
4066                        Self::ClientCertUriSan => serializer.serialize_i32(1),
4067                        Self::ClientCertDnsNameSan => serializer.serialize_i32(2),
4068                        Self::ClientCertCommonName => serializer.serialize_i32(3),
4069                        Self::UnknownValue(u) => u.0.serialize(serializer),
4070                    }
4071                }
4072            }
4073
4074            impl<'de> serde::de::Deserialize<'de> for PrincipalSelector {
4075                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4076                where
4077                    D: serde::Deserializer<'de>,
4078                {
4079                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrincipalSelector>::new(
4080                        ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector"))
4081                }
4082            }
4083        }
4084
4085        /// Describes properties of one or more sources of a request.
4086        #[derive(Clone, Default, PartialEq)]
4087        #[non_exhaustive]
4088        pub struct From {
4089            /// Optional. Describes the properties of a request's sources. At least one
4090            /// of sources or notSources must be specified. Limited to 1 source.
4091            /// A match occurs when ANY source (in sources or notSources) matches the
4092            /// request. Within a single source, the match follows AND semantics
4093            /// across fields and OR semantics within a single field, i.e. a match
4094            /// occurs when ANY principal matches AND ANY ipBlocks match.
4095            pub sources: std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4096
4097            /// Optional. Describes the negated properties of request sources. Matches
4098            /// requests from sources that do not match the criteria specified in this
4099            /// field. At least one of sources or notSources must be specified.
4100            pub not_sources:
4101                std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4102
4103            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4104        }
4105
4106        impl From {
4107            /// Creates a new default instance.
4108            pub fn new() -> Self {
4109                std::default::Default::default()
4110            }
4111
4112            /// Sets the value of [sources][crate::model::authz_policy::authz_rule::From::sources].
4113            ///
4114            /// # Example
4115            /// ```ignore,no_run
4116            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4117            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4118            /// let x = From::new()
4119            ///     .set_sources([
4120            ///         RequestSource::default()/* use setters */,
4121            ///         RequestSource::default()/* use (different) setters */,
4122            ///     ]);
4123            /// ```
4124            pub fn set_sources<T, V>(mut self, v: T) -> Self
4125            where
4126                T: std::iter::IntoIterator<Item = V>,
4127                V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4128            {
4129                use std::iter::Iterator;
4130                self.sources = v.into_iter().map(|i| i.into()).collect();
4131                self
4132            }
4133
4134            /// Sets the value of [not_sources][crate::model::authz_policy::authz_rule::From::not_sources].
4135            ///
4136            /// # Example
4137            /// ```ignore,no_run
4138            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4139            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4140            /// let x = From::new()
4141            ///     .set_not_sources([
4142            ///         RequestSource::default()/* use setters */,
4143            ///         RequestSource::default()/* use (different) setters */,
4144            ///     ]);
4145            /// ```
4146            pub fn set_not_sources<T, V>(mut self, v: T) -> Self
4147            where
4148                T: std::iter::IntoIterator<Item = V>,
4149                V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4150            {
4151                use std::iter::Iterator;
4152                self.not_sources = v.into_iter().map(|i| i.into()).collect();
4153                self
4154            }
4155        }
4156
4157        impl wkt::message::Message for From {
4158            fn typename() -> &'static str {
4159                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From"
4160            }
4161        }
4162
4163        /// Defines additional types related to [From].
4164        pub mod from {
4165            #[allow(unused_imports)]
4166            use super::*;
4167
4168            /// Describes the properties of a single source.
4169            #[derive(Clone, Default, PartialEq)]
4170            #[non_exhaustive]
4171            pub struct RequestSource {
4172                /// Optional. A list of identities derived from the client's certificate.
4173                /// This field will not match on a request unless frontend mutual TLS is
4174                /// enabled for the forwarding rule or Gateway and the client certificate
4175                /// has been successfully validated by mTLS.
4176                /// Each identity is a string whose value is matched against a list of
4177                /// URI SANs, DNS Name SANs, or the common name in the client's
4178                /// certificate. A match happens when any principal matches with the
4179                /// rule. Limited to 50 principals per Authorization Policy for regional
4180                /// internal Application Load Balancers, regional external Application
4181                /// Load Balancers, cross-region internal Application Load Balancers, and
4182                /// Cloud Service Mesh. This field is not supported for global external
4183                /// Application Load Balancers.
4184                pub principals: std::vec::Vec<crate::model::authz_policy::authz_rule::Principal>,
4185
4186                /// Optional. A list of IP addresses or IP address ranges to match
4187                /// against the source IP address of the request. Limited to 10 ip_blocks
4188                /// per Authorization Policy
4189                pub ip_blocks: std::vec::Vec<crate::model::authz_policy::authz_rule::IpBlock>,
4190
4191                /// Optional. A list of resources to match against the resource of the
4192                /// source VM of a request. Limited to 10 resources per Authorization
4193                /// Policy.
4194                pub resources:
4195                    std::vec::Vec<crate::model::authz_policy::authz_rule::RequestResource>,
4196
4197                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4198            }
4199
4200            impl RequestSource {
4201                /// Creates a new default instance.
4202                pub fn new() -> Self {
4203                    std::default::Default::default()
4204                }
4205
4206                /// Sets the value of [principals][crate::model::authz_policy::authz_rule::from::RequestSource::principals].
4207                ///
4208                /// # Example
4209                /// ```ignore,no_run
4210                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4211                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
4212                /// let x = RequestSource::new()
4213                ///     .set_principals([
4214                ///         Principal::default()/* use setters */,
4215                ///         Principal::default()/* use (different) setters */,
4216                ///     ]);
4217                /// ```
4218                pub fn set_principals<T, V>(mut self, v: T) -> Self
4219                where
4220                    T: std::iter::IntoIterator<Item = V>,
4221                    V: std::convert::Into<crate::model::authz_policy::authz_rule::Principal>,
4222                {
4223                    use std::iter::Iterator;
4224                    self.principals = v.into_iter().map(|i| i.into()).collect();
4225                    self
4226                }
4227
4228                /// Sets the value of [ip_blocks][crate::model::authz_policy::authz_rule::from::RequestSource::ip_blocks].
4229                ///
4230                /// # Example
4231                /// ```ignore,no_run
4232                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4233                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
4234                /// let x = RequestSource::new()
4235                ///     .set_ip_blocks([
4236                ///         IpBlock::default()/* use setters */,
4237                ///         IpBlock::default()/* use (different) setters */,
4238                ///     ]);
4239                /// ```
4240                pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
4241                where
4242                    T: std::iter::IntoIterator<Item = V>,
4243                    V: std::convert::Into<crate::model::authz_policy::authz_rule::IpBlock>,
4244                {
4245                    use std::iter::Iterator;
4246                    self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
4247                    self
4248                }
4249
4250                /// Sets the value of [resources][crate::model::authz_policy::authz_rule::from::RequestSource::resources].
4251                ///
4252                /// # Example
4253                /// ```ignore,no_run
4254                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4255                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
4256                /// let x = RequestSource::new()
4257                ///     .set_resources([
4258                ///         RequestResource::default()/* use setters */,
4259                ///         RequestResource::default()/* use (different) setters */,
4260                ///     ]);
4261                /// ```
4262                pub fn set_resources<T, V>(mut self, v: T) -> Self
4263                where
4264                    T: std::iter::IntoIterator<Item = V>,
4265                    V: std::convert::Into<crate::model::authz_policy::authz_rule::RequestResource>,
4266                {
4267                    use std::iter::Iterator;
4268                    self.resources = v.into_iter().map(|i| i.into()).collect();
4269                    self
4270                }
4271            }
4272
4273            impl wkt::message::Message for RequestSource {
4274                fn typename() -> &'static str {
4275                    "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource"
4276                }
4277            }
4278        }
4279
4280        /// Describes properties of one or more targets of a request.
4281        #[derive(Clone, Default, PartialEq)]
4282        #[non_exhaustive]
4283        pub struct To {
4284            /// Optional. Describes properties of one or more targets of a request. At
4285            /// least one of operations or notOperations must be specified. Limited to
4286            /// 1 operation. A match occurs when ANY operation (in operations or
4287            /// notOperations) matches. Within an operation, the match follows AND
4288            /// semantics across fields and OR semantics within a field, i.e. a match
4289            /// occurs when ANY path matches AND ANY header matches and ANY method
4290            /// matches.
4291            pub operations:
4292                std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4293
4294            /// Optional. Describes the negated properties of the targets of a request.
4295            /// Matches requests for operations that do not match the criteria
4296            /// specified in this field. At least one of operations or notOperations
4297            /// must be specified.
4298            pub not_operations:
4299                std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4300
4301            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4302        }
4303
4304        impl To {
4305            /// Creates a new default instance.
4306            pub fn new() -> Self {
4307                std::default::Default::default()
4308            }
4309
4310            /// Sets the value of [operations][crate::model::authz_policy::authz_rule::To::operations].
4311            ///
4312            /// # Example
4313            /// ```ignore,no_run
4314            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4315            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4316            /// let x = To::new()
4317            ///     .set_operations([
4318            ///         RequestOperation::default()/* use setters */,
4319            ///         RequestOperation::default()/* use (different) setters */,
4320            ///     ]);
4321            /// ```
4322            pub fn set_operations<T, V>(mut self, v: T) -> Self
4323            where
4324                T: std::iter::IntoIterator<Item = V>,
4325                V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4326            {
4327                use std::iter::Iterator;
4328                self.operations = v.into_iter().map(|i| i.into()).collect();
4329                self
4330            }
4331
4332            /// Sets the value of [not_operations][crate::model::authz_policy::authz_rule::To::not_operations].
4333            ///
4334            /// # Example
4335            /// ```ignore,no_run
4336            /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4337            /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4338            /// let x = To::new()
4339            ///     .set_not_operations([
4340            ///         RequestOperation::default()/* use setters */,
4341            ///         RequestOperation::default()/* use (different) setters */,
4342            ///     ]);
4343            /// ```
4344            pub fn set_not_operations<T, V>(mut self, v: T) -> Self
4345            where
4346                T: std::iter::IntoIterator<Item = V>,
4347                V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4348            {
4349                use std::iter::Iterator;
4350                self.not_operations = v.into_iter().map(|i| i.into()).collect();
4351                self
4352            }
4353        }
4354
4355        impl wkt::message::Message for To {
4356            fn typename() -> &'static str {
4357                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To"
4358            }
4359        }
4360
4361        /// Defines additional types related to [To].
4362        pub mod to {
4363            #[allow(unused_imports)]
4364            use super::*;
4365
4366            /// Describes properties of one or more targets of a request.
4367            #[derive(Clone, Default, PartialEq)]
4368            #[non_exhaustive]
4369            pub struct RequestOperation {
4370                /// Optional. A list of headers to match against in http header.
4371                pub header_set: std::option::Option<
4372                    crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet,
4373                >,
4374
4375                /// Optional. A list of HTTP Hosts to match against. The match can be one
4376                /// of exact, prefix, suffix, or contains (substring match). Matches are
4377                /// always case sensitive unless the ignoreCase is set. Limited to 10
4378                /// hosts per Authorization Policy.
4379                pub hosts: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4380
4381                /// Optional. A list of paths to match against. The match can be one of
4382                /// exact, prefix, suffix, or contains (substring match). Matches are
4383                /// always case sensitive unless the ignoreCase is set. Limited to 10
4384                /// paths per Authorization Policy.
4385                /// Note that this path match includes the query parameters. For gRPC
4386                /// services, this should be a fully-qualified name of the form
4387                /// /package.service/method.
4388                pub paths: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4389
4390                /// Optional. A list of HTTP methods to match against. Each entry must be
4391                /// a valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE,
4392                /// OPTIONS). It only allows exact match and is always case sensitive.
4393                /// Limited to 10 methods per Authorization Policy.
4394                pub methods: std::vec::Vec<std::string::String>,
4395
4396                /// Optional. Defines the MCP protocol attributes to match on. If the MCP
4397                /// payload in the request body cannot be successfully parsed, the
4398                /// request will be denied. This field can be set only for AuthzPolicies
4399                /// targeting AgentGateway resources.
4400                pub mcp: std::option::Option<
4401                    crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4402                >,
4403
4404                /// Optional. A list of SNIs to match against. The match can be one of
4405                /// exact, prefix, suffix, or contains (substring match). If there is no
4406                /// SNI (i.e. plaintext HTTP traffic), the request will be denied.
4407                /// Matches are always case sensitive unless the ignoreCase is set.
4408                /// Limited to 10 SNIs per Authorization Policy.
4409                pub snis: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4410
4411                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4412            }
4413
4414            impl RequestOperation {
4415                /// Creates a new default instance.
4416                pub fn new() -> Self {
4417                    std::default::Default::default()
4418                }
4419
4420                /// Sets the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4421                ///
4422                /// # Example
4423                /// ```ignore,no_run
4424                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4425                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4426                /// let x = RequestOperation::new().set_header_set(HeaderSet::default()/* use setters */);
4427                /// ```
4428                pub fn set_header_set<T>(mut self, v: T) -> Self
4429                where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4430                {
4431                    self.header_set = std::option::Option::Some(v.into());
4432                    self
4433                }
4434
4435                /// Sets or clears the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4436                ///
4437                /// # Example
4438                /// ```ignore,no_run
4439                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4440                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4441                /// let x = RequestOperation::new().set_or_clear_header_set(Some(HeaderSet::default()/* use setters */));
4442                /// let x = RequestOperation::new().set_or_clear_header_set(None::<HeaderSet>);
4443                /// ```
4444                pub fn set_or_clear_header_set<T>(mut self, v: std::option::Option<T>) -> Self
4445                where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4446                {
4447                    self.header_set = v.map(|x| x.into());
4448                    self
4449                }
4450
4451                /// Sets the value of [hosts][crate::model::authz_policy::authz_rule::to::RequestOperation::hosts].
4452                ///
4453                /// # Example
4454                /// ```ignore,no_run
4455                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4456                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4457                /// let x = RequestOperation::new()
4458                ///     .set_hosts([
4459                ///         StringMatch::default()/* use setters */,
4460                ///         StringMatch::default()/* use (different) setters */,
4461                ///     ]);
4462                /// ```
4463                pub fn set_hosts<T, V>(mut self, v: T) -> Self
4464                where
4465                    T: std::iter::IntoIterator<Item = V>,
4466                    V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4467                {
4468                    use std::iter::Iterator;
4469                    self.hosts = v.into_iter().map(|i| i.into()).collect();
4470                    self
4471                }
4472
4473                /// Sets the value of [paths][crate::model::authz_policy::authz_rule::to::RequestOperation::paths].
4474                ///
4475                /// # Example
4476                /// ```ignore,no_run
4477                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4478                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4479                /// let x = RequestOperation::new()
4480                ///     .set_paths([
4481                ///         StringMatch::default()/* use setters */,
4482                ///         StringMatch::default()/* use (different) setters */,
4483                ///     ]);
4484                /// ```
4485                pub fn set_paths<T, V>(mut self, v: T) -> Self
4486                where
4487                    T: std::iter::IntoIterator<Item = V>,
4488                    V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4489                {
4490                    use std::iter::Iterator;
4491                    self.paths = v.into_iter().map(|i| i.into()).collect();
4492                    self
4493                }
4494
4495                /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::RequestOperation::methods].
4496                ///
4497                /// # Example
4498                /// ```ignore,no_run
4499                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4500                /// let x = RequestOperation::new().set_methods(["a", "b", "c"]);
4501                /// ```
4502                pub fn set_methods<T, V>(mut self, v: T) -> Self
4503                where
4504                    T: std::iter::IntoIterator<Item = V>,
4505                    V: std::convert::Into<std::string::String>,
4506                {
4507                    use std::iter::Iterator;
4508                    self.methods = v.into_iter().map(|i| i.into()).collect();
4509                    self
4510                }
4511
4512                /// Sets the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4513                ///
4514                /// # Example
4515                /// ```ignore,no_run
4516                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4517                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4518                /// let x = RequestOperation::new().set_mcp(Mcp::default()/* use setters */);
4519                /// ```
4520                pub fn set_mcp<T>(mut self, v: T) -> Self
4521                where
4522                    T: std::convert::Into<
4523                            crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4524                        >,
4525                {
4526                    self.mcp = std::option::Option::Some(v.into());
4527                    self
4528                }
4529
4530                /// Sets or clears the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4531                ///
4532                /// # Example
4533                /// ```ignore,no_run
4534                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4535                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4536                /// let x = RequestOperation::new().set_or_clear_mcp(Some(Mcp::default()/* use setters */));
4537                /// let x = RequestOperation::new().set_or_clear_mcp(None::<Mcp>);
4538                /// ```
4539                pub fn set_or_clear_mcp<T>(mut self, v: std::option::Option<T>) -> Self
4540                where
4541                    T: std::convert::Into<
4542                            crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4543                        >,
4544                {
4545                    self.mcp = v.map(|x| x.into());
4546                    self
4547                }
4548
4549                /// Sets the value of [snis][crate::model::authz_policy::authz_rule::to::RequestOperation::snis].
4550                ///
4551                /// # Example
4552                /// ```ignore,no_run
4553                /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4554                /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4555                /// let x = RequestOperation::new()
4556                ///     .set_snis([
4557                ///         StringMatch::default()/* use setters */,
4558                ///         StringMatch::default()/* use (different) setters */,
4559                ///     ]);
4560                /// ```
4561                pub fn set_snis<T, V>(mut self, v: T) -> Self
4562                where
4563                    T: std::iter::IntoIterator<Item = V>,
4564                    V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4565                {
4566                    use std::iter::Iterator;
4567                    self.snis = v.into_iter().map(|i| i.into()).collect();
4568                    self
4569                }
4570            }
4571
4572            impl wkt::message::Message for RequestOperation {
4573                fn typename() -> &'static str {
4574                    "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation"
4575                }
4576            }
4577
4578            /// Defines additional types related to [RequestOperation].
4579            pub mod request_operation {
4580                #[allow(unused_imports)]
4581                use super::*;
4582
4583                /// Describes a set of HTTP headers to match against.
4584                #[derive(Clone, Default, PartialEq)]
4585                #[non_exhaustive]
4586                pub struct HeaderSet {
4587                    /// Required. A list of headers to match against in http header.
4588                    /// The match can be one of exact, prefix, suffix, or contains
4589                    /// (substring match). The match follows AND semantics which means all
4590                    /// the headers must match. Matches are always case sensitive unless
4591                    /// the ignoreCase is set. Limited to 10 headers per Authorization
4592                    /// Policy.
4593                    pub headers: std::vec::Vec<crate::model::authz_policy::authz_rule::HeaderMatch>,
4594
4595                    pub(crate) _unknown_fields:
4596                        serde_json::Map<std::string::String, serde_json::Value>,
4597                }
4598
4599                impl HeaderSet {
4600                    /// Creates a new default instance.
4601                    pub fn new() -> Self {
4602                        std::default::Default::default()
4603                    }
4604
4605                    /// Sets the value of [headers][crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet::headers].
4606                    ///
4607                    /// # Example
4608                    /// ```ignore,no_run
4609                    /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4610                    /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
4611                    /// let x = HeaderSet::new()
4612                    ///     .set_headers([
4613                    ///         HeaderMatch::default()/* use setters */,
4614                    ///         HeaderMatch::default()/* use (different) setters */,
4615                    ///     ]);
4616                    /// ```
4617                    pub fn set_headers<T, V>(mut self, v: T) -> Self
4618                    where
4619                        T: std::iter::IntoIterator<Item = V>,
4620                        V: std::convert::Into<crate::model::authz_policy::authz_rule::HeaderMatch>,
4621                    {
4622                        use std::iter::Iterator;
4623                        self.headers = v.into_iter().map(|i| i.into()).collect();
4624                        self
4625                    }
4626                }
4627
4628                impl wkt::message::Message for HeaderSet {
4629                    fn typename() -> &'static str {
4630                        "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet"
4631                    }
4632                }
4633
4634                /// Describes a set of MCP methods to match against.
4635                #[derive(Clone, Default, PartialEq)]
4636                #[non_exhaustive]
4637                pub struct MCPMethod {
4638                    /// Required. The MCP method to match against. Allowed values are as
4639                    /// follows:
4640                    ///
4641                    /// 1. `tools`, `prompts`, `resources` - these will match against all
4642                    ///    sub methods under the respective methods.
4643                    /// 1. `prompts/list`, `tools/list`, `resources/list`,
4644                    ///    `resources/templates/list`
4645                    /// 1. `prompts/get`, `tools/call`, `resources/subscribe`,
4646                    ///    `resources/unsubscribe`, `resources/read`
4647                    ///    Params cannot be specified for categories 1 and 2.
4648                    pub name: std::string::String,
4649
4650                    /// Optional. A list of MCP method parameters to match against. The
4651                    /// match can be one of exact, prefix, suffix, or contains (substring
4652                    /// match). Matches are always case sensitive unless the ignoreCase is
4653                    /// set. Limited to 10 MCP method parameters per Authorization Policy.
4654                    pub params: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4655
4656                    pub(crate) _unknown_fields:
4657                        serde_json::Map<std::string::String, serde_json::Value>,
4658                }
4659
4660                impl MCPMethod {
4661                    /// Creates a new default instance.
4662                    pub fn new() -> Self {
4663                        std::default::Default::default()
4664                    }
4665
4666                    /// Sets the value of [name][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::name].
4667                    ///
4668                    /// # Example
4669                    /// ```ignore,no_run
4670                    /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4671                    /// let x = MCPMethod::new().set_name("example");
4672                    /// ```
4673                    pub fn set_name<T: std::convert::Into<std::string::String>>(
4674                        mut self,
4675                        v: T,
4676                    ) -> Self {
4677                        self.name = v.into();
4678                        self
4679                    }
4680
4681                    /// Sets the value of [params][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::params].
4682                    ///
4683                    /// # Example
4684                    /// ```ignore,no_run
4685                    /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4686                    /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4687                    /// let x = MCPMethod::new()
4688                    ///     .set_params([
4689                    ///         StringMatch::default()/* use setters */,
4690                    ///         StringMatch::default()/* use (different) setters */,
4691                    ///     ]);
4692                    /// ```
4693                    pub fn set_params<T, V>(mut self, v: T) -> Self
4694                    where
4695                        T: std::iter::IntoIterator<Item = V>,
4696                        V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4697                    {
4698                        use std::iter::Iterator;
4699                        self.params = v.into_iter().map(|i| i.into()).collect();
4700                        self
4701                    }
4702                }
4703
4704                impl wkt::message::Message for MCPMethod {
4705                    fn typename() -> &'static str {
4706                        "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod"
4707                    }
4708                }
4709
4710                /// Describes a set of MCP protocol attributes to match against for a
4711                /// given MCP request.
4712                #[derive(Clone, Default, PartialEq)]
4713                #[non_exhaustive]
4714                pub struct Mcp {
4715
4716                    /// Optional. If specified, matches on the MCP protocol’s non-access
4717                    /// specific methods namely:
4718                    ///
4719                    /// * initialize
4720                    /// * completion/
4721                    /// * logging/
4722                    /// * notifications/
4723                    /// * ping
4724                    ///   Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
4725                    pub base_protocol_methods_option: crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption,
4726
4727                    /// Optional. A list of MCP methods and associated parameters to match
4728                    /// on. It is recommended to use this field to match on tools, prompts
4729                    /// and resource accesses while setting the baseProtocolMethodsOption
4730                    /// to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
4731                    /// protocol methods.
4732                    /// Limited to 10 MCP methods per Authorization Policy.
4733                    pub methods: std::vec::Vec<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>,
4734
4735                    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4736                }
4737
4738                impl Mcp {
4739                    /// Creates a new default instance.
4740                    pub fn new() -> Self {
4741                        std::default::Default::default()
4742                    }
4743
4744                    /// Sets the value of [base_protocol_methods_option][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::base_protocol_methods_option].
4745                    ///
4746                    /// # Example
4747                    /// ```ignore,no_run
4748                    /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4749                    /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption;
4750                    /// let x0 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::SkipBaseProtocolMethods);
4751                    /// let x1 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::MatchBaseProtocolMethods);
4752                    /// ```
4753                    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{
4754                        self.base_protocol_methods_option = v.into();
4755                        self
4756                    }
4757
4758                    /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::methods].
4759                    ///
4760                    /// # Example
4761                    /// ```ignore,no_run
4762                    /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4763                    /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4764                    /// let x = Mcp::new()
4765                    ///     .set_methods([
4766                    ///         MCPMethod::default()/* use setters */,
4767                    ///         MCPMethod::default()/* use (different) setters */,
4768                    ///     ]);
4769                    /// ```
4770                    pub fn set_methods<T, V>(mut self, v: T) -> Self
4771                    where
4772                        T: std::iter::IntoIterator<Item = V>,
4773                        V: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>
4774                    {
4775                        use std::iter::Iterator;
4776                        self.methods = v.into_iter().map(|i| i.into()).collect();
4777                        self
4778                    }
4779                }
4780
4781                impl wkt::message::Message for Mcp {
4782                    fn typename() -> &'static str {
4783                        "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP"
4784                    }
4785                }
4786
4787                /// Describes the option to match against the base MCP protocol methods.
4788                ///
4789                /// # Working with unknown values
4790                ///
4791                /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4792                /// additional enum variants at any time. Adding new variants is not considered
4793                /// a breaking change. Applications should write their code in anticipation of:
4794                ///
4795                /// - New values appearing in future releases of the client library, **and**
4796                /// - New values received dynamically, without application changes.
4797                ///
4798                /// Please consult the [Working with enums] section in the user guide for some
4799                /// guidelines.
4800                ///
4801                /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4802                #[derive(Clone, Debug, PartialEq)]
4803                #[non_exhaustive]
4804                pub enum BaseProtocolMethodsOption {
4805                    /// Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS.
4806                    Unspecified,
4807                    /// Skip matching on the base MCP protocol methods.
4808                    SkipBaseProtocolMethods,
4809                    /// Match on the base MCP protocol methods.
4810                    MatchBaseProtocolMethods,
4811                    /// If set, the enum was initialized with an unknown value.
4812                    ///
4813                    /// Applications can examine the value using [BaseProtocolMethodsOption::value] or
4814                    /// [BaseProtocolMethodsOption::name].
4815                    UnknownValue(base_protocol_methods_option::UnknownValue),
4816                }
4817
4818                #[doc(hidden)]
4819                pub mod base_protocol_methods_option {
4820                    #[allow(unused_imports)]
4821                    use super::*;
4822                    #[derive(Clone, Debug, PartialEq)]
4823                    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4824                }
4825
4826                impl BaseProtocolMethodsOption {
4827                    /// Gets the enum value.
4828                    ///
4829                    /// Returns `None` if the enum contains an unknown value deserialized from
4830                    /// the string representation of enums.
4831                    pub fn value(&self) -> std::option::Option<i32> {
4832                        match self {
4833                            Self::Unspecified => std::option::Option::Some(0),
4834                            Self::SkipBaseProtocolMethods => std::option::Option::Some(1),
4835                            Self::MatchBaseProtocolMethods => std::option::Option::Some(2),
4836                            Self::UnknownValue(u) => u.0.value(),
4837                        }
4838                    }
4839
4840                    /// Gets the enum value as a string.
4841                    ///
4842                    /// Returns `None` if the enum contains an unknown value deserialized from
4843                    /// the integer representation of enums.
4844                    pub fn name(&self) -> std::option::Option<&str> {
4845                        match self {
4846                            Self::Unspecified => std::option::Option::Some(
4847                                "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED",
4848                            ),
4849                            Self::SkipBaseProtocolMethods => {
4850                                std::option::Option::Some("SKIP_BASE_PROTOCOL_METHODS")
4851                            }
4852                            Self::MatchBaseProtocolMethods => {
4853                                std::option::Option::Some("MATCH_BASE_PROTOCOL_METHODS")
4854                            }
4855                            Self::UnknownValue(u) => u.0.name(),
4856                        }
4857                    }
4858                }
4859
4860                impl std::default::Default for BaseProtocolMethodsOption {
4861                    fn default() -> Self {
4862                        use std::convert::From;
4863                        Self::from(0)
4864                    }
4865                }
4866
4867                impl std::fmt::Display for BaseProtocolMethodsOption {
4868                    fn fmt(
4869                        &self,
4870                        f: &mut std::fmt::Formatter<'_>,
4871                    ) -> std::result::Result<(), std::fmt::Error> {
4872                        wkt::internal::display_enum(f, self.name(), self.value())
4873                    }
4874                }
4875
4876                impl std::convert::From<i32> for BaseProtocolMethodsOption {
4877                    fn from(value: i32) -> Self {
4878                        match value {
4879                            0 => Self::Unspecified,
4880                            1 => Self::SkipBaseProtocolMethods,
4881                            2 => Self::MatchBaseProtocolMethods,
4882                            _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4883                                wkt::internal::UnknownEnumValue::Integer(value),
4884                            )),
4885                        }
4886                    }
4887                }
4888
4889                impl std::convert::From<&str> for BaseProtocolMethodsOption {
4890                    fn from(value: &str) -> Self {
4891                        use std::string::ToString;
4892                        match value {
4893                            "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED" => Self::Unspecified,
4894                            "SKIP_BASE_PROTOCOL_METHODS" => Self::SkipBaseProtocolMethods,
4895                            "MATCH_BASE_PROTOCOL_METHODS" => Self::MatchBaseProtocolMethods,
4896                            _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4897                                wkt::internal::UnknownEnumValue::String(value.to_string()),
4898                            )),
4899                        }
4900                    }
4901                }
4902
4903                impl serde::ser::Serialize for BaseProtocolMethodsOption {
4904                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4905                    where
4906                        S: serde::Serializer,
4907                    {
4908                        match self {
4909                            Self::Unspecified => serializer.serialize_i32(0),
4910                            Self::SkipBaseProtocolMethods => serializer.serialize_i32(1),
4911                            Self::MatchBaseProtocolMethods => serializer.serialize_i32(2),
4912                            Self::UnknownValue(u) => u.0.serialize(serializer),
4913                        }
4914                    }
4915                }
4916
4917                impl<'de> serde::de::Deserialize<'de> for BaseProtocolMethodsOption {
4918                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4919                    where
4920                        D: serde::Deserializer<'de>,
4921                    {
4922                        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BaseProtocolMethodsOption>::new(
4923                            ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption"))
4924                    }
4925                }
4926            }
4927        }
4928    }
4929
4930    /// Allows delegating authorization decisions to Cloud IAP or to
4931    /// Service Extensions.
4932    #[derive(Clone, Default, PartialEq)]
4933    #[non_exhaustive]
4934    pub struct CustomProvider {
4935        /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4936        /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4937        /// level is not compatible with Cloud IAP settings in the BackendService.
4938        /// Enabling IAP in both places will result in request failure. Ensure that
4939        /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4940        /// both places.
4941        pub cloud_iap: std::option::Option<crate::model::authz_policy::custom_provider::CloudIap>,
4942
4943        /// Optional. Delegate authorization decision to user authored Service
4944        /// Extension. Only one of cloudIap or authzExtension can be specified.
4945        pub authz_extension:
4946            std::option::Option<crate::model::authz_policy::custom_provider::AuthzExtension>,
4947
4948        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4949    }
4950
4951    impl CustomProvider {
4952        /// Creates a new default instance.
4953        pub fn new() -> Self {
4954            std::default::Default::default()
4955        }
4956
4957        /// Sets the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4958        ///
4959        /// # Example
4960        /// ```ignore,no_run
4961        /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4962        /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4963        /// let x = CustomProvider::new().set_cloud_iap(CloudIap::default()/* use setters */);
4964        /// ```
4965        pub fn set_cloud_iap<T>(mut self, v: T) -> Self
4966        where
4967            T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4968        {
4969            self.cloud_iap = std::option::Option::Some(v.into());
4970            self
4971        }
4972
4973        /// Sets or clears the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4974        ///
4975        /// # Example
4976        /// ```ignore,no_run
4977        /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4978        /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4979        /// let x = CustomProvider::new().set_or_clear_cloud_iap(Some(CloudIap::default()/* use setters */));
4980        /// let x = CustomProvider::new().set_or_clear_cloud_iap(None::<CloudIap>);
4981        /// ```
4982        pub fn set_or_clear_cloud_iap<T>(mut self, v: std::option::Option<T>) -> Self
4983        where
4984            T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4985        {
4986            self.cloud_iap = v.map(|x| x.into());
4987            self
4988        }
4989
4990        /// Sets the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4991        ///
4992        /// # Example
4993        /// ```ignore,no_run
4994        /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4995        /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4996        /// let x = CustomProvider::new().set_authz_extension(AuthzExtension::default()/* use setters */);
4997        /// ```
4998        pub fn set_authz_extension<T>(mut self, v: T) -> Self
4999        where
5000            T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
5001        {
5002            self.authz_extension = std::option::Option::Some(v.into());
5003            self
5004        }
5005
5006        /// Sets or clears the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
5007        ///
5008        /// # Example
5009        /// ```ignore,no_run
5010        /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
5011        /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
5012        /// let x = CustomProvider::new().set_or_clear_authz_extension(Some(AuthzExtension::default()/* use setters */));
5013        /// let x = CustomProvider::new().set_or_clear_authz_extension(None::<AuthzExtension>);
5014        /// ```
5015        pub fn set_or_clear_authz_extension<T>(mut self, v: std::option::Option<T>) -> Self
5016        where
5017            T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
5018        {
5019            self.authz_extension = v.map(|x| x.into());
5020            self
5021        }
5022    }
5023
5024    impl wkt::message::Message for CustomProvider {
5025        fn typename() -> &'static str {
5026            "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider"
5027        }
5028    }
5029
5030    /// Defines additional types related to [CustomProvider].
5031    pub mod custom_provider {
5032        #[allow(unused_imports)]
5033        use super::*;
5034
5035        /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
5036        /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
5037        /// level is not compatible with Cloud IAP settings in the BackendService.
5038        /// Enabling IAP in both places will result in request failure. Ensure that
5039        /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
5040        /// both places.
5041        #[derive(Clone, Default, PartialEq)]
5042        #[non_exhaustive]
5043        pub struct CloudIap {
5044            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5045        }
5046
5047        impl CloudIap {
5048            /// Creates a new default instance.
5049            pub fn new() -> Self {
5050                std::default::Default::default()
5051            }
5052        }
5053
5054        impl wkt::message::Message for CloudIap {
5055            fn typename() -> &'static str {
5056                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap"
5057            }
5058        }
5059
5060        /// Optional. Delegate authorization decision to user authored extension.
5061        /// Only one of cloudIap or authzExtension can be specified.
5062        #[derive(Clone, Default, PartialEq)]
5063        #[non_exhaustive]
5064        pub struct AuthzExtension {
5065            /// Required. A list of references to authorization
5066            /// extensions that will be invoked for requests matching this policy.
5067            /// Limited to 1 custom provider.
5068            pub resources: std::vec::Vec<std::string::String>,
5069
5070            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5071        }
5072
5073        impl AuthzExtension {
5074            /// Creates a new default instance.
5075            pub fn new() -> Self {
5076                std::default::Default::default()
5077            }
5078
5079            /// Sets the value of [resources][crate::model::authz_policy::custom_provider::AuthzExtension::resources].
5080            ///
5081            /// # Example
5082            /// ```ignore,no_run
5083            /// # use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
5084            /// let x = AuthzExtension::new().set_resources(["a", "b", "c"]);
5085            /// ```
5086            pub fn set_resources<T, V>(mut self, v: T) -> Self
5087            where
5088                T: std::iter::IntoIterator<Item = V>,
5089                V: std::convert::Into<std::string::String>,
5090            {
5091                use std::iter::Iterator;
5092                self.resources = v.into_iter().map(|i| i.into()).collect();
5093                self
5094            }
5095        }
5096
5097        impl wkt::message::Message for AuthzExtension {
5098            fn typename() -> &'static str {
5099                "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension"
5100            }
5101        }
5102    }
5103
5104    /// Load balancing schemes supported by the `AuthzPolicy` resource. The valid
5105    /// values are `INTERNAL_MANAGED` and
5106    /// `EXTERNAL_MANAGED`. For more information, refer to [Backend services
5107    /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
5108    ///
5109    /// # Working with unknown values
5110    ///
5111    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5112    /// additional enum variants at any time. Adding new variants is not considered
5113    /// a breaking change. Applications should write their code in anticipation of:
5114    ///
5115    /// - New values appearing in future releases of the client library, **and**
5116    /// - New values received dynamically, without application changes.
5117    ///
5118    /// Please consult the [Working with enums] section in the user guide for some
5119    /// guidelines.
5120    ///
5121    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5122    #[derive(Clone, Debug, PartialEq)]
5123    #[non_exhaustive]
5124    pub enum LoadBalancingScheme {
5125        /// Default value. Do not use.
5126        Unspecified,
5127        /// Signifies that this is used for Regional internal or Cross-region
5128        /// internal Application Load Balancing.
5129        InternalManaged,
5130        /// Signifies that this is used for Global external or Regional external
5131        /// Application Load Balancing.
5132        ExternalManaged,
5133        /// Signifies that this is used for Cloud Service Mesh. Meant for use by
5134        /// CSM GKE controller only.
5135        InternalSelfManaged,
5136        /// If set, the enum was initialized with an unknown value.
5137        ///
5138        /// Applications can examine the value using [LoadBalancingScheme::value] or
5139        /// [LoadBalancingScheme::name].
5140        UnknownValue(load_balancing_scheme::UnknownValue),
5141    }
5142
5143    #[doc(hidden)]
5144    pub mod load_balancing_scheme {
5145        #[allow(unused_imports)]
5146        use super::*;
5147        #[derive(Clone, Debug, PartialEq)]
5148        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5149    }
5150
5151    impl LoadBalancingScheme {
5152        /// Gets the enum value.
5153        ///
5154        /// Returns `None` if the enum contains an unknown value deserialized from
5155        /// the string representation of enums.
5156        pub fn value(&self) -> std::option::Option<i32> {
5157            match self {
5158                Self::Unspecified => std::option::Option::Some(0),
5159                Self::InternalManaged => std::option::Option::Some(1),
5160                Self::ExternalManaged => std::option::Option::Some(2),
5161                Self::InternalSelfManaged => std::option::Option::Some(3),
5162                Self::UnknownValue(u) => u.0.value(),
5163            }
5164        }
5165
5166        /// Gets the enum value as a string.
5167        ///
5168        /// Returns `None` if the enum contains an unknown value deserialized from
5169        /// the integer representation of enums.
5170        pub fn name(&self) -> std::option::Option<&str> {
5171            match self {
5172                Self::Unspecified => std::option::Option::Some("LOAD_BALANCING_SCHEME_UNSPECIFIED"),
5173                Self::InternalManaged => std::option::Option::Some("INTERNAL_MANAGED"),
5174                Self::ExternalManaged => std::option::Option::Some("EXTERNAL_MANAGED"),
5175                Self::InternalSelfManaged => std::option::Option::Some("INTERNAL_SELF_MANAGED"),
5176                Self::UnknownValue(u) => u.0.name(),
5177            }
5178        }
5179    }
5180
5181    impl std::default::Default for LoadBalancingScheme {
5182        fn default() -> Self {
5183            use std::convert::From;
5184            Self::from(0)
5185        }
5186    }
5187
5188    impl std::fmt::Display for LoadBalancingScheme {
5189        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5190            wkt::internal::display_enum(f, self.name(), self.value())
5191        }
5192    }
5193
5194    impl std::convert::From<i32> for LoadBalancingScheme {
5195        fn from(value: i32) -> Self {
5196            match value {
5197                0 => Self::Unspecified,
5198                1 => Self::InternalManaged,
5199                2 => Self::ExternalManaged,
5200                3 => Self::InternalSelfManaged,
5201                _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5202                    wkt::internal::UnknownEnumValue::Integer(value),
5203                )),
5204            }
5205        }
5206    }
5207
5208    impl std::convert::From<&str> for LoadBalancingScheme {
5209        fn from(value: &str) -> Self {
5210            use std::string::ToString;
5211            match value {
5212                "LOAD_BALANCING_SCHEME_UNSPECIFIED" => Self::Unspecified,
5213                "INTERNAL_MANAGED" => Self::InternalManaged,
5214                "EXTERNAL_MANAGED" => Self::ExternalManaged,
5215                "INTERNAL_SELF_MANAGED" => Self::InternalSelfManaged,
5216                _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5217                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5218                )),
5219            }
5220        }
5221    }
5222
5223    impl serde::ser::Serialize for LoadBalancingScheme {
5224        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5225        where
5226            S: serde::Serializer,
5227        {
5228            match self {
5229                Self::Unspecified => serializer.serialize_i32(0),
5230                Self::InternalManaged => serializer.serialize_i32(1),
5231                Self::ExternalManaged => serializer.serialize_i32(2),
5232                Self::InternalSelfManaged => serializer.serialize_i32(3),
5233                Self::UnknownValue(u) => u.0.serialize(serializer),
5234            }
5235        }
5236    }
5237
5238    impl<'de> serde::de::Deserialize<'de> for LoadBalancingScheme {
5239        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5240        where
5241            D: serde::Deserializer<'de>,
5242        {
5243            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancingScheme>::new(
5244                ".google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme",
5245            ))
5246        }
5247    }
5248
5249    /// The action to be applied to this policy. Valid values are
5250    /// `ALLOW`, `DENY`, `CUSTOM`.
5251    ///
5252    /// # Working with unknown values
5253    ///
5254    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5255    /// additional enum variants at any time. Adding new variants is not considered
5256    /// a breaking change. Applications should write their code in anticipation of:
5257    ///
5258    /// - New values appearing in future releases of the client library, **and**
5259    /// - New values received dynamically, without application changes.
5260    ///
5261    /// Please consult the [Working with enums] section in the user guide for some
5262    /// guidelines.
5263    ///
5264    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5265    #[derive(Clone, Debug, PartialEq)]
5266    #[non_exhaustive]
5267    pub enum AuthzAction {
5268        /// Unspecified action.
5269        Unspecified,
5270        /// Allow request to pass through to the backend.
5271        Allow,
5272        /// Deny the request and return a HTTP 404 to the client.
5273        Deny,
5274        /// Delegate the authorization decision to an external authorization engine.
5275        Custom,
5276        /// If set, the enum was initialized with an unknown value.
5277        ///
5278        /// Applications can examine the value using [AuthzAction::value] or
5279        /// [AuthzAction::name].
5280        UnknownValue(authz_action::UnknownValue),
5281    }
5282
5283    #[doc(hidden)]
5284    pub mod authz_action {
5285        #[allow(unused_imports)]
5286        use super::*;
5287        #[derive(Clone, Debug, PartialEq)]
5288        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5289    }
5290
5291    impl AuthzAction {
5292        /// Gets the enum value.
5293        ///
5294        /// Returns `None` if the enum contains an unknown value deserialized from
5295        /// the string representation of enums.
5296        pub fn value(&self) -> std::option::Option<i32> {
5297            match self {
5298                Self::Unspecified => std::option::Option::Some(0),
5299                Self::Allow => std::option::Option::Some(1),
5300                Self::Deny => std::option::Option::Some(2),
5301                Self::Custom => std::option::Option::Some(3),
5302                Self::UnknownValue(u) => u.0.value(),
5303            }
5304        }
5305
5306        /// Gets the enum value as a string.
5307        ///
5308        /// Returns `None` if the enum contains an unknown value deserialized from
5309        /// the integer representation of enums.
5310        pub fn name(&self) -> std::option::Option<&str> {
5311            match self {
5312                Self::Unspecified => std::option::Option::Some("AUTHZ_ACTION_UNSPECIFIED"),
5313                Self::Allow => std::option::Option::Some("ALLOW"),
5314                Self::Deny => std::option::Option::Some("DENY"),
5315                Self::Custom => std::option::Option::Some("CUSTOM"),
5316                Self::UnknownValue(u) => u.0.name(),
5317            }
5318        }
5319    }
5320
5321    impl std::default::Default for AuthzAction {
5322        fn default() -> Self {
5323            use std::convert::From;
5324            Self::from(0)
5325        }
5326    }
5327
5328    impl std::fmt::Display for AuthzAction {
5329        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5330            wkt::internal::display_enum(f, self.name(), self.value())
5331        }
5332    }
5333
5334    impl std::convert::From<i32> for AuthzAction {
5335        fn from(value: i32) -> Self {
5336            match value {
5337                0 => Self::Unspecified,
5338                1 => Self::Allow,
5339                2 => Self::Deny,
5340                3 => Self::Custom,
5341                _ => Self::UnknownValue(authz_action::UnknownValue(
5342                    wkt::internal::UnknownEnumValue::Integer(value),
5343                )),
5344            }
5345        }
5346    }
5347
5348    impl std::convert::From<&str> for AuthzAction {
5349        fn from(value: &str) -> Self {
5350            use std::string::ToString;
5351            match value {
5352                "AUTHZ_ACTION_UNSPECIFIED" => Self::Unspecified,
5353                "ALLOW" => Self::Allow,
5354                "DENY" => Self::Deny,
5355                "CUSTOM" => Self::Custom,
5356                _ => Self::UnknownValue(authz_action::UnknownValue(
5357                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5358                )),
5359            }
5360        }
5361    }
5362
5363    impl serde::ser::Serialize for AuthzAction {
5364        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5365        where
5366            S: serde::Serializer,
5367        {
5368            match self {
5369                Self::Unspecified => serializer.serialize_i32(0),
5370                Self::Allow => serializer.serialize_i32(1),
5371                Self::Deny => serializer.serialize_i32(2),
5372                Self::Custom => serializer.serialize_i32(3),
5373                Self::UnknownValue(u) => u.0.serialize(serializer),
5374            }
5375        }
5376    }
5377
5378    impl<'de> serde::de::Deserialize<'de> for AuthzAction {
5379        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5380        where
5381            D: serde::Deserializer<'de>,
5382        {
5383            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthzAction>::new(
5384                ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction",
5385            ))
5386        }
5387    }
5388
5389    /// The type of authorization being performed.
5390    /// New values may be added in the future.
5391    ///
5392    /// # Working with unknown values
5393    ///
5394    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5395    /// additional enum variants at any time. Adding new variants is not considered
5396    /// a breaking change. Applications should write their code in anticipation of:
5397    ///
5398    /// - New values appearing in future releases of the client library, **and**
5399    /// - New values received dynamically, without application changes.
5400    ///
5401    /// Please consult the [Working with enums] section in the user guide for some
5402    /// guidelines.
5403    ///
5404    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5405    #[derive(Clone, Debug, PartialEq)]
5406    #[non_exhaustive]
5407    pub enum PolicyProfile {
5408        /// Unspecified policy profile.
5409        Unspecified,
5410        /// Applies to request authorization. `CUSTOM` authorization
5411        /// policies with Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or
5412        /// `EXT_PROC_GRPC` protocols. Extensions are invoked only for request header
5413        /// events.
5414        RequestAuthz,
5415        /// Applies to content security, sanitization, etc. Only
5416        /// `CUSTOM` action is allowed in this policy profile. AuthzExtensions in the
5417        /// custom provider must support `EXT_PROC_GRPC` protocol only and be capable
5418        /// of receiving all `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY,
5419        /// REQUEST_TRAILERS, RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS)
5420        /// with `FULL_DUPLEX_STREAMED` body send mode.
5421        ContentAuthz,
5422        /// If set, the enum was initialized with an unknown value.
5423        ///
5424        /// Applications can examine the value using [PolicyProfile::value] or
5425        /// [PolicyProfile::name].
5426        UnknownValue(policy_profile::UnknownValue),
5427    }
5428
5429    #[doc(hidden)]
5430    pub mod policy_profile {
5431        #[allow(unused_imports)]
5432        use super::*;
5433        #[derive(Clone, Debug, PartialEq)]
5434        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5435    }
5436
5437    impl PolicyProfile {
5438        /// Gets the enum value.
5439        ///
5440        /// Returns `None` if the enum contains an unknown value deserialized from
5441        /// the string representation of enums.
5442        pub fn value(&self) -> std::option::Option<i32> {
5443            match self {
5444                Self::Unspecified => std::option::Option::Some(0),
5445                Self::RequestAuthz => std::option::Option::Some(1),
5446                Self::ContentAuthz => std::option::Option::Some(2),
5447                Self::UnknownValue(u) => u.0.value(),
5448            }
5449        }
5450
5451        /// Gets the enum value as a string.
5452        ///
5453        /// Returns `None` if the enum contains an unknown value deserialized from
5454        /// the integer representation of enums.
5455        pub fn name(&self) -> std::option::Option<&str> {
5456            match self {
5457                Self::Unspecified => std::option::Option::Some("POLICY_PROFILE_UNSPECIFIED"),
5458                Self::RequestAuthz => std::option::Option::Some("REQUEST_AUTHZ"),
5459                Self::ContentAuthz => std::option::Option::Some("CONTENT_AUTHZ"),
5460                Self::UnknownValue(u) => u.0.name(),
5461            }
5462        }
5463    }
5464
5465    impl std::default::Default for PolicyProfile {
5466        fn default() -> Self {
5467            use std::convert::From;
5468            Self::from(0)
5469        }
5470    }
5471
5472    impl std::fmt::Display for PolicyProfile {
5473        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5474            wkt::internal::display_enum(f, self.name(), self.value())
5475        }
5476    }
5477
5478    impl std::convert::From<i32> for PolicyProfile {
5479        fn from(value: i32) -> Self {
5480            match value {
5481                0 => Self::Unspecified,
5482                1 => Self::RequestAuthz,
5483                2 => Self::ContentAuthz,
5484                _ => Self::UnknownValue(policy_profile::UnknownValue(
5485                    wkt::internal::UnknownEnumValue::Integer(value),
5486                )),
5487            }
5488        }
5489    }
5490
5491    impl std::convert::From<&str> for PolicyProfile {
5492        fn from(value: &str) -> Self {
5493            use std::string::ToString;
5494            match value {
5495                "POLICY_PROFILE_UNSPECIFIED" => Self::Unspecified,
5496                "REQUEST_AUTHZ" => Self::RequestAuthz,
5497                "CONTENT_AUTHZ" => Self::ContentAuthz,
5498                _ => Self::UnknownValue(policy_profile::UnknownValue(
5499                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5500                )),
5501            }
5502        }
5503    }
5504
5505    impl serde::ser::Serialize for PolicyProfile {
5506        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5507        where
5508            S: serde::Serializer,
5509        {
5510            match self {
5511                Self::Unspecified => serializer.serialize_i32(0),
5512                Self::RequestAuthz => serializer.serialize_i32(1),
5513                Self::ContentAuthz => serializer.serialize_i32(2),
5514                Self::UnknownValue(u) => u.0.serialize(serializer),
5515            }
5516        }
5517    }
5518
5519    impl<'de> serde::de::Deserialize<'de> for PolicyProfile {
5520        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5521        where
5522            D: serde::Deserializer<'de>,
5523        {
5524            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyProfile>::new(
5525                ".google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile",
5526            ))
5527        }
5528    }
5529}
5530
5531/// Message for creating an `AuthzPolicy` resource.
5532#[derive(Clone, Default, PartialEq)]
5533#[non_exhaustive]
5534pub struct CreateAuthzPolicyRequest {
5535    /// Required. The parent resource of the `AuthzPolicy` resource. Must be in
5536    /// the format `projects/{project}/locations/{location}`.
5537    pub parent: std::string::String,
5538
5539    /// Required. User-provided ID of the `AuthzPolicy` resource to be created.
5540    pub authz_policy_id: std::string::String,
5541
5542    /// Required. `AuthzPolicy` resource to be created.
5543    pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5544
5545    /// Optional. An optional request ID to identify requests. Specify a unique
5546    /// request ID so that if you must retry your request, the server can ignore
5547    /// the request if it has already been completed. The server guarantees
5548    /// that for at least 60 minutes since the first request.
5549    ///
5550    /// For example, consider a situation where you make an initial request and the
5551    /// request times out. If you make the request again with the same request
5552    /// ID, the server can check if original operation with the same request ID
5553    /// was received, and if so, ignores the second request. This prevents
5554    /// clients from accidentally creating duplicate commitments.
5555    ///
5556    /// The request ID must be a valid UUID with the exception that zero UUID is
5557    /// not supported (00000000-0000-0000-0000-000000000000).
5558    pub request_id: std::string::String,
5559
5560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5561}
5562
5563impl CreateAuthzPolicyRequest {
5564    /// Creates a new default instance.
5565    pub fn new() -> Self {
5566        std::default::Default::default()
5567    }
5568
5569    /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
5570    ///
5571    /// # Example
5572    /// ```ignore,no_run
5573    /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5574    /// # let project_id = "project_id";
5575    /// # let location_id = "location_id";
5576    /// let x = CreateAuthzPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5577    /// ```
5578    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579        self.parent = v.into();
5580        self
5581    }
5582
5583    /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
5584    ///
5585    /// # Example
5586    /// ```ignore,no_run
5587    /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5588    /// let x = CreateAuthzPolicyRequest::new().set_authz_policy_id("example");
5589    /// ```
5590    pub fn set_authz_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5591        self.authz_policy_id = v.into();
5592        self
5593    }
5594
5595    /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5596    ///
5597    /// # Example
5598    /// ```ignore,no_run
5599    /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5600    /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5601    /// let x = CreateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5602    /// ```
5603    pub fn set_authz_policy<T>(mut self, v: T) -> Self
5604    where
5605        T: std::convert::Into<crate::model::AuthzPolicy>,
5606    {
5607        self.authz_policy = std::option::Option::Some(v.into());
5608        self
5609    }
5610
5611    /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5612    ///
5613    /// # Example
5614    /// ```ignore,no_run
5615    /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5616    /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5617    /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5618    /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5619    /// ```
5620    pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5621    where
5622        T: std::convert::Into<crate::model::AuthzPolicy>,
5623    {
5624        self.authz_policy = v.map(|x| x.into());
5625        self
5626    }
5627
5628    /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
5629    ///
5630    /// # Example
5631    /// ```ignore,no_run
5632    /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5633    /// let x = CreateAuthzPolicyRequest::new().set_request_id("example");
5634    /// ```
5635    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5636        self.request_id = v.into();
5637        self
5638    }
5639}
5640
5641impl wkt::message::Message for CreateAuthzPolicyRequest {
5642    fn typename() -> &'static str {
5643        "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthzPolicyRequest"
5644    }
5645}
5646
5647/// Message for requesting list of `AuthzPolicy` resources.
5648#[derive(Clone, Default, PartialEq)]
5649#[non_exhaustive]
5650pub struct ListAuthzPoliciesRequest {
5651    /// Required. The project and location from which the `AuthzPolicy` resources
5652    /// are listed, specified in the following format:
5653    /// `projects/{project}/locations/{location}`.
5654    pub parent: std::string::String,
5655
5656    /// Optional. Requested page size. The server might return fewer items than
5657    /// requested. If unspecified, the server picks an appropriate default.
5658    pub page_size: i32,
5659
5660    /// Optional. A token identifying a page of results that the server returns.
5661    pub page_token: std::string::String,
5662
5663    /// Optional. Filtering results.
5664    pub filter: std::string::String,
5665
5666    /// Optional. Hint for how to order the results.
5667    pub order_by: std::string::String,
5668
5669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5670}
5671
5672impl ListAuthzPoliciesRequest {
5673    /// Creates a new default instance.
5674    pub fn new() -> Self {
5675        std::default::Default::default()
5676    }
5677
5678    /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
5679    ///
5680    /// # Example
5681    /// ```ignore,no_run
5682    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5683    /// # let project_id = "project_id";
5684    /// # let location_id = "location_id";
5685    /// let x = ListAuthzPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5686    /// ```
5687    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688        self.parent = v.into();
5689        self
5690    }
5691
5692    /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
5693    ///
5694    /// # Example
5695    /// ```ignore,no_run
5696    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5697    /// let x = ListAuthzPoliciesRequest::new().set_page_size(42);
5698    /// ```
5699    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5700        self.page_size = v.into();
5701        self
5702    }
5703
5704    /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
5705    ///
5706    /// # Example
5707    /// ```ignore,no_run
5708    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5709    /// let x = ListAuthzPoliciesRequest::new().set_page_token("example");
5710    /// ```
5711    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5712        self.page_token = v.into();
5713        self
5714    }
5715
5716    /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
5717    ///
5718    /// # Example
5719    /// ```ignore,no_run
5720    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5721    /// let x = ListAuthzPoliciesRequest::new().set_filter("example");
5722    /// ```
5723    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5724        self.filter = v.into();
5725        self
5726    }
5727
5728    /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
5729    ///
5730    /// # Example
5731    /// ```ignore,no_run
5732    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5733    /// let x = ListAuthzPoliciesRequest::new().set_order_by("example");
5734    /// ```
5735    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5736        self.order_by = v.into();
5737        self
5738    }
5739}
5740
5741impl wkt::message::Message for ListAuthzPoliciesRequest {
5742    fn typename() -> &'static str {
5743        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesRequest"
5744    }
5745}
5746
5747/// Message for response to listing `AuthzPolicy` resources.
5748#[derive(Clone, Default, PartialEq)]
5749#[non_exhaustive]
5750pub struct ListAuthzPoliciesResponse {
5751    /// The list of `AuthzPolicy` resources.
5752    pub authz_policies: std::vec::Vec<crate::model::AuthzPolicy>,
5753
5754    /// A token identifying a page of results that the server returns.
5755    pub next_page_token: std::string::String,
5756
5757    /// Locations that could not be reached.
5758    pub unreachable: std::vec::Vec<std::string::String>,
5759
5760    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5761}
5762
5763impl ListAuthzPoliciesResponse {
5764    /// Creates a new default instance.
5765    pub fn new() -> Self {
5766        std::default::Default::default()
5767    }
5768
5769    /// Sets the value of [authz_policies][crate::model::ListAuthzPoliciesResponse::authz_policies].
5770    ///
5771    /// # Example
5772    /// ```ignore,no_run
5773    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5774    /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5775    /// let x = ListAuthzPoliciesResponse::new()
5776    ///     .set_authz_policies([
5777    ///         AuthzPolicy::default()/* use setters */,
5778    ///         AuthzPolicy::default()/* use (different) setters */,
5779    ///     ]);
5780    /// ```
5781    pub fn set_authz_policies<T, V>(mut self, v: T) -> Self
5782    where
5783        T: std::iter::IntoIterator<Item = V>,
5784        V: std::convert::Into<crate::model::AuthzPolicy>,
5785    {
5786        use std::iter::Iterator;
5787        self.authz_policies = v.into_iter().map(|i| i.into()).collect();
5788        self
5789    }
5790
5791    /// Sets the value of [next_page_token][crate::model::ListAuthzPoliciesResponse::next_page_token].
5792    ///
5793    /// # Example
5794    /// ```ignore,no_run
5795    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5796    /// let x = ListAuthzPoliciesResponse::new().set_next_page_token("example");
5797    /// ```
5798    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5799        self.next_page_token = v.into();
5800        self
5801    }
5802
5803    /// Sets the value of [unreachable][crate::model::ListAuthzPoliciesResponse::unreachable].
5804    ///
5805    /// # Example
5806    /// ```ignore,no_run
5807    /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5808    /// let x = ListAuthzPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
5809    /// ```
5810    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5811    where
5812        T: std::iter::IntoIterator<Item = V>,
5813        V: std::convert::Into<std::string::String>,
5814    {
5815        use std::iter::Iterator;
5816        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5817        self
5818    }
5819}
5820
5821impl wkt::message::Message for ListAuthzPoliciesResponse {
5822    fn typename() -> &'static str {
5823        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesResponse"
5824    }
5825}
5826
5827#[doc(hidden)]
5828impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthzPoliciesResponse {
5829    type PageItem = crate::model::AuthzPolicy;
5830
5831    fn items(self) -> std::vec::Vec<Self::PageItem> {
5832        self.authz_policies
5833    }
5834
5835    fn next_page_token(&self) -> std::string::String {
5836        use std::clone::Clone;
5837        self.next_page_token.clone()
5838    }
5839}
5840
5841/// Message for getting a `AuthzPolicy` resource.
5842#[derive(Clone, Default, PartialEq)]
5843#[non_exhaustive]
5844pub struct GetAuthzPolicyRequest {
5845    /// Required. A name of the `AuthzPolicy` resource to get. Must be in the
5846    /// format
5847    /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5848    pub name: std::string::String,
5849
5850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5851}
5852
5853impl GetAuthzPolicyRequest {
5854    /// Creates a new default instance.
5855    pub fn new() -> Self {
5856        std::default::Default::default()
5857    }
5858
5859    /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
5860    ///
5861    /// # Example
5862    /// ```ignore,no_run
5863    /// # use google_cloud_networksecurity_v1::model::GetAuthzPolicyRequest;
5864    /// # let project_id = "project_id";
5865    /// # let location_id = "location_id";
5866    /// # let authz_policy_id = "authz_policy_id";
5867    /// let x = GetAuthzPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
5868    /// ```
5869    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5870        self.name = v.into();
5871        self
5872    }
5873}
5874
5875impl wkt::message::Message for GetAuthzPolicyRequest {
5876    fn typename() -> &'static str {
5877        "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthzPolicyRequest"
5878    }
5879}
5880
5881/// Message for updating an `AuthzPolicy` resource.
5882#[derive(Clone, Default, PartialEq)]
5883#[non_exhaustive]
5884pub struct UpdateAuthzPolicyRequest {
5885    /// Required. Used to specify the fields to be overwritten in the
5886    /// `AuthzPolicy` resource by the update.
5887    /// The fields specified in the `update_mask` are relative to the resource, not
5888    /// the full request. A field is overwritten if it is in the mask. If the
5889    /// user does not specify a mask, then all fields are overwritten.
5890    pub update_mask: std::option::Option<wkt::FieldMask>,
5891
5892    /// Required. `AuthzPolicy` resource being updated.
5893    pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5894
5895    /// Optional. An optional request ID to identify requests. Specify a unique
5896    /// request ID so that if you must retry your request, the server can ignore
5897    /// the request if it has already been completed. The server guarantees
5898    /// that for at least 60 minutes since the first request.
5899    ///
5900    /// For example, consider a situation where you make an initial request and the
5901    /// request times out. If you make the request again with the same request
5902    /// ID, the server can check if original operation with the same request ID
5903    /// was received, and if so, ignores the second request. This prevents
5904    /// clients from accidentally creating duplicate commitments.
5905    ///
5906    /// The request ID must be a valid UUID with the exception that zero UUID is
5907    /// not supported (00000000-0000-0000-0000-000000000000).
5908    pub request_id: std::string::String,
5909
5910    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5911}
5912
5913impl UpdateAuthzPolicyRequest {
5914    /// Creates a new default instance.
5915    pub fn new() -> Self {
5916        std::default::Default::default()
5917    }
5918
5919    /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5920    ///
5921    /// # Example
5922    /// ```ignore,no_run
5923    /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5924    /// use wkt::FieldMask;
5925    /// let x = UpdateAuthzPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5926    /// ```
5927    pub fn set_update_mask<T>(mut self, v: T) -> Self
5928    where
5929        T: std::convert::Into<wkt::FieldMask>,
5930    {
5931        self.update_mask = std::option::Option::Some(v.into());
5932        self
5933    }
5934
5935    /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5936    ///
5937    /// # Example
5938    /// ```ignore,no_run
5939    /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5940    /// use wkt::FieldMask;
5941    /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5942    /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5943    /// ```
5944    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5945    where
5946        T: std::convert::Into<wkt::FieldMask>,
5947    {
5948        self.update_mask = v.map(|x| x.into());
5949        self
5950    }
5951
5952    /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5953    ///
5954    /// # Example
5955    /// ```ignore,no_run
5956    /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5957    /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5958    /// let x = UpdateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5959    /// ```
5960    pub fn set_authz_policy<T>(mut self, v: T) -> Self
5961    where
5962        T: std::convert::Into<crate::model::AuthzPolicy>,
5963    {
5964        self.authz_policy = std::option::Option::Some(v.into());
5965        self
5966    }
5967
5968    /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5969    ///
5970    /// # Example
5971    /// ```ignore,no_run
5972    /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5973    /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5974    /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5975    /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5976    /// ```
5977    pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5978    where
5979        T: std::convert::Into<crate::model::AuthzPolicy>,
5980    {
5981        self.authz_policy = v.map(|x| x.into());
5982        self
5983    }
5984
5985    /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
5986    ///
5987    /// # Example
5988    /// ```ignore,no_run
5989    /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5990    /// let x = UpdateAuthzPolicyRequest::new().set_request_id("example");
5991    /// ```
5992    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5993        self.request_id = v.into();
5994        self
5995    }
5996}
5997
5998impl wkt::message::Message for UpdateAuthzPolicyRequest {
5999    fn typename() -> &'static str {
6000        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest"
6001    }
6002}
6003
6004/// Message for deleting an `AuthzPolicy` resource.
6005#[derive(Clone, Default, PartialEq)]
6006#[non_exhaustive]
6007pub struct DeleteAuthzPolicyRequest {
6008    /// Required. The name of the `AuthzPolicy` resource to delete. Must be in
6009    /// the format
6010    /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
6011    pub name: std::string::String,
6012
6013    /// Optional. An optional request ID to identify requests. Specify a unique
6014    /// request ID so that if you must retry your request, the server can ignore
6015    /// the request if it has already been completed. The server guarantees
6016    /// that for at least 60 minutes after the first request.
6017    ///
6018    /// For example, consider a situation where you make an initial request and the
6019    /// request times out. If you make the request again with the same request
6020    /// ID, the server can check if original operation with the same request ID
6021    /// was received, and if so, ignores the second request. This prevents
6022    /// clients from accidentally creating duplicate commitments.
6023    ///
6024    /// The request ID must be a valid UUID with the exception that zero UUID is
6025    /// not supported (00000000-0000-0000-0000-000000000000).
6026    pub request_id: std::string::String,
6027
6028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6029}
6030
6031impl DeleteAuthzPolicyRequest {
6032    /// Creates a new default instance.
6033    pub fn new() -> Self {
6034        std::default::Default::default()
6035    }
6036
6037    /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
6038    ///
6039    /// # Example
6040    /// ```ignore,no_run
6041    /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
6042    /// # let project_id = "project_id";
6043    /// # let location_id = "location_id";
6044    /// # let authz_policy_id = "authz_policy_id";
6045    /// let x = DeleteAuthzPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
6046    /// ```
6047    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6048        self.name = v.into();
6049        self
6050    }
6051
6052    /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
6053    ///
6054    /// # Example
6055    /// ```ignore,no_run
6056    /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
6057    /// let x = DeleteAuthzPolicyRequest::new().set_request_id("example");
6058    /// ```
6059    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6060        self.request_id = v.into();
6061        self
6062    }
6063}
6064
6065impl wkt::message::Message for DeleteAuthzPolicyRequest {
6066    fn typename() -> &'static str {
6067        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest"
6068    }
6069}
6070
6071/// BackendAuthenticationConfig message groups the TrustConfig together with
6072/// other settings that control how the load balancer authenticates, and
6073/// expresses its identity to, the backend:
6074///
6075/// * `trustConfig` is the attached TrustConfig.
6076///
6077/// * `wellKnownRoots` indicates whether the load balance should trust backend
6078///   server certificates that are issued by public certificate authorities, in
6079///   addition to certificates trusted by the TrustConfig.
6080///
6081/// * `clientCertificate` is a client certificate that the load balancer uses to
6082///   express its identity to the backend, if the connection to the backend uses
6083///   mTLS.
6084///
6085///
6086/// You can attach the BackendAuthenticationConfig to the load balancer's
6087/// BackendService directly determining how that BackendService negotiates TLS.
6088#[derive(Clone, Default, PartialEq)]
6089#[non_exhaustive]
6090pub struct BackendAuthenticationConfig {
6091    /// Required. Name of the BackendAuthenticationConfig resource. It matches the
6092    /// pattern
6093    /// `projects/*/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}`
6094    pub name: std::string::String,
6095
6096    /// Optional. Free-text description of the resource.
6097    pub description: std::string::String,
6098
6099    /// Output only. The timestamp when the resource was created.
6100    pub create_time: std::option::Option<wkt::Timestamp>,
6101
6102    /// Output only. The timestamp when the resource was updated.
6103    pub update_time: std::option::Option<wkt::Timestamp>,
6104
6105    /// Set of label tags associated with the resource.
6106    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6107
6108    /// Optional. A reference to a certificatemanager.googleapis.com.Certificate
6109    /// resource. This is a relative resource path following the form
6110    /// "projects/{project}/locations/{location}/certificates/{certificate}".
6111    ///
6112    /// Used by a BackendService to negotiate mTLS when the backend connection uses
6113    /// TLS and the backend requests a client certificate. Must have a CLIENT_AUTH
6114    /// scope.
6115    pub client_certificate: std::string::String,
6116
6117    /// Optional. A reference to a TrustConfig resource from the
6118    /// certificatemanager.googleapis.com namespace. This is a relative resource
6119    /// path following the form
6120    /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}".
6121    ///
6122    /// A BackendService uses the chain of trust represented by this TrustConfig,
6123    /// if specified, to validate the server certificates presented by the backend.
6124    /// Required unless wellKnownRoots is set to PUBLIC_ROOTS.
6125    pub trust_config: std::string::String,
6126
6127    /// Well known roots to use for server certificate validation.
6128    pub well_known_roots: crate::model::backend_authentication_config::WellKnownRoots,
6129
6130    /// Output only. Etag of the resource.
6131    pub etag: std::string::String,
6132
6133    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6134}
6135
6136impl BackendAuthenticationConfig {
6137    /// Creates a new default instance.
6138    pub fn new() -> Self {
6139        std::default::Default::default()
6140    }
6141
6142    /// Sets the value of [name][crate::model::BackendAuthenticationConfig::name].
6143    ///
6144    /// # Example
6145    /// ```ignore,no_run
6146    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6147    /// # let project_id = "project_id";
6148    /// # let location_id = "location_id";
6149    /// # let backend_authentication_config_id = "backend_authentication_config_id";
6150    /// let x = BackendAuthenticationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6151    /// ```
6152    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6153        self.name = v.into();
6154        self
6155    }
6156
6157    /// Sets the value of [description][crate::model::BackendAuthenticationConfig::description].
6158    ///
6159    /// # Example
6160    /// ```ignore,no_run
6161    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6162    /// let x = BackendAuthenticationConfig::new().set_description("example");
6163    /// ```
6164    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6165        self.description = v.into();
6166        self
6167    }
6168
6169    /// Sets the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6170    ///
6171    /// # Example
6172    /// ```ignore,no_run
6173    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6174    /// use wkt::Timestamp;
6175    /// let x = BackendAuthenticationConfig::new().set_create_time(Timestamp::default()/* use setters */);
6176    /// ```
6177    pub fn set_create_time<T>(mut self, v: T) -> Self
6178    where
6179        T: std::convert::Into<wkt::Timestamp>,
6180    {
6181        self.create_time = std::option::Option::Some(v.into());
6182        self
6183    }
6184
6185    /// Sets or clears the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6186    ///
6187    /// # Example
6188    /// ```ignore,no_run
6189    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6190    /// use wkt::Timestamp;
6191    /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6192    /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(None::<Timestamp>);
6193    /// ```
6194    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6195    where
6196        T: std::convert::Into<wkt::Timestamp>,
6197    {
6198        self.create_time = v.map(|x| x.into());
6199        self
6200    }
6201
6202    /// Sets the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6203    ///
6204    /// # Example
6205    /// ```ignore,no_run
6206    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6207    /// use wkt::Timestamp;
6208    /// let x = BackendAuthenticationConfig::new().set_update_time(Timestamp::default()/* use setters */);
6209    /// ```
6210    pub fn set_update_time<T>(mut self, v: T) -> Self
6211    where
6212        T: std::convert::Into<wkt::Timestamp>,
6213    {
6214        self.update_time = std::option::Option::Some(v.into());
6215        self
6216    }
6217
6218    /// Sets or clears the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6219    ///
6220    /// # Example
6221    /// ```ignore,no_run
6222    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6223    /// use wkt::Timestamp;
6224    /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6225    /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(None::<Timestamp>);
6226    /// ```
6227    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6228    where
6229        T: std::convert::Into<wkt::Timestamp>,
6230    {
6231        self.update_time = v.map(|x| x.into());
6232        self
6233    }
6234
6235    /// Sets the value of [labels][crate::model::BackendAuthenticationConfig::labels].
6236    ///
6237    /// # Example
6238    /// ```ignore,no_run
6239    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6240    /// let x = BackendAuthenticationConfig::new().set_labels([
6241    ///     ("key0", "abc"),
6242    ///     ("key1", "xyz"),
6243    /// ]);
6244    /// ```
6245    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6246    where
6247        T: std::iter::IntoIterator<Item = (K, V)>,
6248        K: std::convert::Into<std::string::String>,
6249        V: std::convert::Into<std::string::String>,
6250    {
6251        use std::iter::Iterator;
6252        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6253        self
6254    }
6255
6256    /// Sets the value of [client_certificate][crate::model::BackendAuthenticationConfig::client_certificate].
6257    ///
6258    /// # Example
6259    /// ```ignore,no_run
6260    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6261    /// let x = BackendAuthenticationConfig::new().set_client_certificate("example");
6262    /// ```
6263    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6264        mut self,
6265        v: T,
6266    ) -> Self {
6267        self.client_certificate = v.into();
6268        self
6269    }
6270
6271    /// Sets the value of [trust_config][crate::model::BackendAuthenticationConfig::trust_config].
6272    ///
6273    /// # Example
6274    /// ```ignore,no_run
6275    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6276    /// let x = BackendAuthenticationConfig::new().set_trust_config("example");
6277    /// ```
6278    pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6279        self.trust_config = v.into();
6280        self
6281    }
6282
6283    /// Sets the value of [well_known_roots][crate::model::BackendAuthenticationConfig::well_known_roots].
6284    ///
6285    /// # Example
6286    /// ```ignore,no_run
6287    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6288    /// use google_cloud_networksecurity_v1::model::backend_authentication_config::WellKnownRoots;
6289    /// let x0 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::None);
6290    /// let x1 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::PublicRoots);
6291    /// ```
6292    pub fn set_well_known_roots<
6293        T: std::convert::Into<crate::model::backend_authentication_config::WellKnownRoots>,
6294    >(
6295        mut self,
6296        v: T,
6297    ) -> Self {
6298        self.well_known_roots = v.into();
6299        self
6300    }
6301
6302    /// Sets the value of [etag][crate::model::BackendAuthenticationConfig::etag].
6303    ///
6304    /// # Example
6305    /// ```ignore,no_run
6306    /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6307    /// let x = BackendAuthenticationConfig::new().set_etag("example");
6308    /// ```
6309    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6310        self.etag = v.into();
6311        self
6312    }
6313}
6314
6315impl wkt::message::Message for BackendAuthenticationConfig {
6316    fn typename() -> &'static str {
6317        "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig"
6318    }
6319}
6320
6321/// Defines additional types related to [BackendAuthenticationConfig].
6322pub mod backend_authentication_config {
6323    #[allow(unused_imports)]
6324    use super::*;
6325
6326    /// Enum to specify the well known roots to use for server certificate
6327    /// validation.
6328    ///
6329    /// # Working with unknown values
6330    ///
6331    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6332    /// additional enum variants at any time. Adding new variants is not considered
6333    /// a breaking change. Applications should write their code in anticipation of:
6334    ///
6335    /// - New values appearing in future releases of the client library, **and**
6336    /// - New values received dynamically, without application changes.
6337    ///
6338    /// Please consult the [Working with enums] section in the user guide for some
6339    /// guidelines.
6340    ///
6341    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6342    #[derive(Clone, Debug, PartialEq)]
6343    #[non_exhaustive]
6344    pub enum WellKnownRoots {
6345        /// Equivalent to NONE.
6346        Unspecified,
6347        /// The BackendService will only validate server certificates against roots
6348        /// specified in TrustConfig.
6349        None,
6350        /// The BackendService uses a set of well-known public roots, in addition to
6351        /// any roots specified in the trustConfig field, when validating the server
6352        /// certificates presented by the backend. Validation with these roots is
6353        /// only considered when the TlsSettings.sni field in the BackendService is
6354        /// set.
6355        ///
6356        /// The well-known roots are a set of root CAs managed by Google. CAs in this
6357        /// set can be added or removed without notice.
6358        PublicRoots,
6359        /// If set, the enum was initialized with an unknown value.
6360        ///
6361        /// Applications can examine the value using [WellKnownRoots::value] or
6362        /// [WellKnownRoots::name].
6363        UnknownValue(well_known_roots::UnknownValue),
6364    }
6365
6366    #[doc(hidden)]
6367    pub mod well_known_roots {
6368        #[allow(unused_imports)]
6369        use super::*;
6370        #[derive(Clone, Debug, PartialEq)]
6371        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6372    }
6373
6374    impl WellKnownRoots {
6375        /// Gets the enum value.
6376        ///
6377        /// Returns `None` if the enum contains an unknown value deserialized from
6378        /// the string representation of enums.
6379        pub fn value(&self) -> std::option::Option<i32> {
6380            match self {
6381                Self::Unspecified => std::option::Option::Some(0),
6382                Self::None => std::option::Option::Some(1),
6383                Self::PublicRoots => std::option::Option::Some(2),
6384                Self::UnknownValue(u) => u.0.value(),
6385            }
6386        }
6387
6388        /// Gets the enum value as a string.
6389        ///
6390        /// Returns `None` if the enum contains an unknown value deserialized from
6391        /// the integer representation of enums.
6392        pub fn name(&self) -> std::option::Option<&str> {
6393            match self {
6394                Self::Unspecified => std::option::Option::Some("WELL_KNOWN_ROOTS_UNSPECIFIED"),
6395                Self::None => std::option::Option::Some("NONE"),
6396                Self::PublicRoots => std::option::Option::Some("PUBLIC_ROOTS"),
6397                Self::UnknownValue(u) => u.0.name(),
6398            }
6399        }
6400    }
6401
6402    impl std::default::Default for WellKnownRoots {
6403        fn default() -> Self {
6404            use std::convert::From;
6405            Self::from(0)
6406        }
6407    }
6408
6409    impl std::fmt::Display for WellKnownRoots {
6410        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6411            wkt::internal::display_enum(f, self.name(), self.value())
6412        }
6413    }
6414
6415    impl std::convert::From<i32> for WellKnownRoots {
6416        fn from(value: i32) -> Self {
6417            match value {
6418                0 => Self::Unspecified,
6419                1 => Self::None,
6420                2 => Self::PublicRoots,
6421                _ => Self::UnknownValue(well_known_roots::UnknownValue(
6422                    wkt::internal::UnknownEnumValue::Integer(value),
6423                )),
6424            }
6425        }
6426    }
6427
6428    impl std::convert::From<&str> for WellKnownRoots {
6429        fn from(value: &str) -> Self {
6430            use std::string::ToString;
6431            match value {
6432                "WELL_KNOWN_ROOTS_UNSPECIFIED" => Self::Unspecified,
6433                "NONE" => Self::None,
6434                "PUBLIC_ROOTS" => Self::PublicRoots,
6435                _ => Self::UnknownValue(well_known_roots::UnknownValue(
6436                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6437                )),
6438            }
6439        }
6440    }
6441
6442    impl serde::ser::Serialize for WellKnownRoots {
6443        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6444        where
6445            S: serde::Serializer,
6446        {
6447            match self {
6448                Self::Unspecified => serializer.serialize_i32(0),
6449                Self::None => serializer.serialize_i32(1),
6450                Self::PublicRoots => serializer.serialize_i32(2),
6451                Self::UnknownValue(u) => u.0.serialize(serializer),
6452            }
6453        }
6454    }
6455
6456    impl<'de> serde::de::Deserialize<'de> for WellKnownRoots {
6457        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6458        where
6459            D: serde::Deserializer<'de>,
6460        {
6461            deserializer.deserialize_any(wkt::internal::EnumVisitor::<WellKnownRoots>::new(
6462                ".google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots",
6463            ))
6464        }
6465    }
6466}
6467
6468/// Request used by the ListBackendAuthenticationConfigs method.
6469#[derive(Clone, Default, PartialEq)]
6470#[non_exhaustive]
6471pub struct ListBackendAuthenticationConfigsRequest {
6472    /// Required. The project and location from which the
6473    /// BackendAuthenticationConfigs should be listed, specified in the format
6474    /// `projects/*/locations/{location}`.
6475    pub parent: std::string::String,
6476
6477    /// Maximum number of BackendAuthenticationConfigs to return per call.
6478    pub page_size: i32,
6479
6480    /// The value returned by the last `ListBackendAuthenticationConfigsResponse`
6481    /// Indicates that this is a continuation of a prior
6482    /// `ListBackendAuthenticationConfigs` call, and that the system
6483    /// should return the next page of data.
6484    pub page_token: std::string::String,
6485
6486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6487}
6488
6489impl ListBackendAuthenticationConfigsRequest {
6490    /// Creates a new default instance.
6491    pub fn new() -> Self {
6492        std::default::Default::default()
6493    }
6494
6495    /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
6496    ///
6497    /// # Example
6498    /// ```ignore,no_run
6499    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6500    /// let x = ListBackendAuthenticationConfigsRequest::new().set_parent("example");
6501    /// ```
6502    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6503        self.parent = v.into();
6504        self
6505    }
6506
6507    /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
6508    ///
6509    /// # Example
6510    /// ```ignore,no_run
6511    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6512    /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_size(42);
6513    /// ```
6514    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6515        self.page_size = v.into();
6516        self
6517    }
6518
6519    /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
6520    ///
6521    /// # Example
6522    /// ```ignore,no_run
6523    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6524    /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_token("example");
6525    /// ```
6526    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6527        self.page_token = v.into();
6528        self
6529    }
6530}
6531
6532impl wkt::message::Message for ListBackendAuthenticationConfigsRequest {
6533    fn typename() -> &'static str {
6534        "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest"
6535    }
6536}
6537
6538/// Response returned by the ListBackendAuthenticationConfigs method.
6539#[derive(Clone, Default, PartialEq)]
6540#[non_exhaustive]
6541pub struct ListBackendAuthenticationConfigsResponse {
6542    /// List of BackendAuthenticationConfig resources.
6543    pub backend_authentication_configs: std::vec::Vec<crate::model::BackendAuthenticationConfig>,
6544
6545    /// If there might be more results than those appearing in this response, then
6546    /// `next_page_token` is included. To get the next set of results, call this
6547    /// method again using the value of `next_page_token` as `page_token`.
6548    pub next_page_token: std::string::String,
6549
6550    /// Locations that could not be reached.
6551    pub unreachable: std::vec::Vec<std::string::String>,
6552
6553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6554}
6555
6556impl ListBackendAuthenticationConfigsResponse {
6557    /// Creates a new default instance.
6558    pub fn new() -> Self {
6559        std::default::Default::default()
6560    }
6561
6562    /// Sets the value of [backend_authentication_configs][crate::model::ListBackendAuthenticationConfigsResponse::backend_authentication_configs].
6563    ///
6564    /// # Example
6565    /// ```ignore,no_run
6566    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6567    /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6568    /// let x = ListBackendAuthenticationConfigsResponse::new()
6569    ///     .set_backend_authentication_configs([
6570    ///         BackendAuthenticationConfig::default()/* use setters */,
6571    ///         BackendAuthenticationConfig::default()/* use (different) setters */,
6572    ///     ]);
6573    /// ```
6574    pub fn set_backend_authentication_configs<T, V>(mut self, v: T) -> Self
6575    where
6576        T: std::iter::IntoIterator<Item = V>,
6577        V: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6578    {
6579        use std::iter::Iterator;
6580        self.backend_authentication_configs = v.into_iter().map(|i| i.into()).collect();
6581        self
6582    }
6583
6584    /// Sets the value of [next_page_token][crate::model::ListBackendAuthenticationConfigsResponse::next_page_token].
6585    ///
6586    /// # Example
6587    /// ```ignore,no_run
6588    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6589    /// let x = ListBackendAuthenticationConfigsResponse::new().set_next_page_token("example");
6590    /// ```
6591    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6592        self.next_page_token = v.into();
6593        self
6594    }
6595
6596    /// Sets the value of [unreachable][crate::model::ListBackendAuthenticationConfigsResponse::unreachable].
6597    ///
6598    /// # Example
6599    /// ```ignore,no_run
6600    /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6601    /// let x = ListBackendAuthenticationConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6602    /// ```
6603    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6604    where
6605        T: std::iter::IntoIterator<Item = V>,
6606        V: std::convert::Into<std::string::String>,
6607    {
6608        use std::iter::Iterator;
6609        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6610        self
6611    }
6612}
6613
6614impl wkt::message::Message for ListBackendAuthenticationConfigsResponse {
6615    fn typename() -> &'static str {
6616        "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse"
6617    }
6618}
6619
6620#[doc(hidden)]
6621impl google_cloud_gax::paginator::internal::PageableResponse
6622    for ListBackendAuthenticationConfigsResponse
6623{
6624    type PageItem = crate::model::BackendAuthenticationConfig;
6625
6626    fn items(self) -> std::vec::Vec<Self::PageItem> {
6627        self.backend_authentication_configs
6628    }
6629
6630    fn next_page_token(&self) -> std::string::String {
6631        use std::clone::Clone;
6632        self.next_page_token.clone()
6633    }
6634}
6635
6636/// Request used by the GetBackendAuthenticationConfig method.
6637#[derive(Clone, Default, PartialEq)]
6638#[non_exhaustive]
6639pub struct GetBackendAuthenticationConfigRequest {
6640    /// Required. A name of the BackendAuthenticationConfig to get. Must be in the
6641    /// format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6642    pub name: std::string::String,
6643
6644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6645}
6646
6647impl GetBackendAuthenticationConfigRequest {
6648    /// Creates a new default instance.
6649    pub fn new() -> Self {
6650        std::default::Default::default()
6651    }
6652
6653    /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
6654    ///
6655    /// # Example
6656    /// ```ignore,no_run
6657    /// # use google_cloud_networksecurity_v1::model::GetBackendAuthenticationConfigRequest;
6658    /// # let project_id = "project_id";
6659    /// # let location_id = "location_id";
6660    /// # let backend_authentication_config_id = "backend_authentication_config_id";
6661    /// let x = GetBackendAuthenticationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6662    /// ```
6663    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6664        self.name = v.into();
6665        self
6666    }
6667}
6668
6669impl wkt::message::Message for GetBackendAuthenticationConfigRequest {
6670    fn typename() -> &'static str {
6671        "type.googleapis.com/google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest"
6672    }
6673}
6674
6675/// Request used by the CreateBackendAuthenticationConfig method.
6676#[derive(Clone, Default, PartialEq)]
6677#[non_exhaustive]
6678pub struct CreateBackendAuthenticationConfigRequest {
6679    /// Required. The parent resource of the BackendAuthenticationConfig. Must be
6680    /// in the format `projects/*/locations/{location}`.
6681    pub parent: std::string::String,
6682
6683    /// Required. Short name of the BackendAuthenticationConfig resource to be
6684    /// created. This value should be 1-63 characters long, containing only
6685    /// letters, numbers, hyphens, and underscores, and should not start with a
6686    /// number. E.g. "backend-auth-config".
6687    pub backend_authentication_config_id: std::string::String,
6688
6689    /// Required. BackendAuthenticationConfig resource to be created.
6690    pub backend_authentication_config:
6691        std::option::Option<crate::model::BackendAuthenticationConfig>,
6692
6693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6694}
6695
6696impl CreateBackendAuthenticationConfigRequest {
6697    /// Creates a new default instance.
6698    pub fn new() -> Self {
6699        std::default::Default::default()
6700    }
6701
6702    /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
6703    ///
6704    /// # Example
6705    /// ```ignore,no_run
6706    /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6707    /// # let project_id = "project_id";
6708    /// # let location_id = "location_id";
6709    /// let x = CreateBackendAuthenticationConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6710    /// ```
6711    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6712        self.parent = v.into();
6713        self
6714    }
6715
6716    /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
6717    ///
6718    /// # Example
6719    /// ```ignore,no_run
6720    /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6721    /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config_id("example");
6722    /// ```
6723    pub fn set_backend_authentication_config_id<T: std::convert::Into<std::string::String>>(
6724        mut self,
6725        v: T,
6726    ) -> Self {
6727        self.backend_authentication_config_id = v.into();
6728        self
6729    }
6730
6731    /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6732    ///
6733    /// # Example
6734    /// ```ignore,no_run
6735    /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6736    /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6737    /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6738    /// ```
6739    pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6740    where
6741        T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6742    {
6743        self.backend_authentication_config = std::option::Option::Some(v.into());
6744        self
6745    }
6746
6747    /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6748    ///
6749    /// # Example
6750    /// ```ignore,no_run
6751    /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6752    /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6753    /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6754    /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6755    /// ```
6756    pub fn set_or_clear_backend_authentication_config<T>(
6757        mut self,
6758        v: std::option::Option<T>,
6759    ) -> Self
6760    where
6761        T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6762    {
6763        self.backend_authentication_config = v.map(|x| x.into());
6764        self
6765    }
6766}
6767
6768impl wkt::message::Message for CreateBackendAuthenticationConfigRequest {
6769    fn typename() -> &'static str {
6770        "type.googleapis.com/google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest"
6771    }
6772}
6773
6774/// Request used by UpdateBackendAuthenticationConfig method.
6775#[derive(Clone, Default, PartialEq)]
6776#[non_exhaustive]
6777pub struct UpdateBackendAuthenticationConfigRequest {
6778    /// Optional. Field mask is used to specify the fields to be overwritten in the
6779    /// BackendAuthenticationConfig resource by the update.  The fields
6780    /// specified in the update_mask are relative to the resource, not
6781    /// the full request. A field will be overwritten if it is in the
6782    /// mask. If the user does not provide a mask then all fields will be
6783    /// overwritten.
6784    pub update_mask: std::option::Option<wkt::FieldMask>,
6785
6786    /// Required. Updated BackendAuthenticationConfig resource.
6787    pub backend_authentication_config:
6788        std::option::Option<crate::model::BackendAuthenticationConfig>,
6789
6790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6791}
6792
6793impl UpdateBackendAuthenticationConfigRequest {
6794    /// Creates a new default instance.
6795    pub fn new() -> Self {
6796        std::default::Default::default()
6797    }
6798
6799    /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6800    ///
6801    /// # Example
6802    /// ```ignore,no_run
6803    /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6804    /// use wkt::FieldMask;
6805    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6806    /// ```
6807    pub fn set_update_mask<T>(mut self, v: T) -> Self
6808    where
6809        T: std::convert::Into<wkt::FieldMask>,
6810    {
6811        self.update_mask = std::option::Option::Some(v.into());
6812        self
6813    }
6814
6815    /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6816    ///
6817    /// # Example
6818    /// ```ignore,no_run
6819    /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6820    /// use wkt::FieldMask;
6821    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6822    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6823    /// ```
6824    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6825    where
6826        T: std::convert::Into<wkt::FieldMask>,
6827    {
6828        self.update_mask = v.map(|x| x.into());
6829        self
6830    }
6831
6832    /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6833    ///
6834    /// # Example
6835    /// ```ignore,no_run
6836    /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6837    /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6838    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6839    /// ```
6840    pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6841    where
6842        T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6843    {
6844        self.backend_authentication_config = std::option::Option::Some(v.into());
6845        self
6846    }
6847
6848    /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6849    ///
6850    /// # Example
6851    /// ```ignore,no_run
6852    /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6853    /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6854    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6855    /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6856    /// ```
6857    pub fn set_or_clear_backend_authentication_config<T>(
6858        mut self,
6859        v: std::option::Option<T>,
6860    ) -> Self
6861    where
6862        T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6863    {
6864        self.backend_authentication_config = v.map(|x| x.into());
6865        self
6866    }
6867}
6868
6869impl wkt::message::Message for UpdateBackendAuthenticationConfigRequest {
6870    fn typename() -> &'static str {
6871        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest"
6872    }
6873}
6874
6875/// Request used by the DeleteBackendAuthenticationConfig method.
6876#[derive(Clone, Default, PartialEq)]
6877#[non_exhaustive]
6878pub struct DeleteBackendAuthenticationConfigRequest {
6879    /// Required. A name of the BackendAuthenticationConfig to delete. Must be in
6880    /// the format
6881    /// `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6882    pub name: std::string::String,
6883
6884    /// Optional. Etag of the resource.
6885    /// If this is provided, it must match the server's etag.
6886    pub etag: std::string::String,
6887
6888    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6889}
6890
6891impl DeleteBackendAuthenticationConfigRequest {
6892    /// Creates a new default instance.
6893    pub fn new() -> Self {
6894        std::default::Default::default()
6895    }
6896
6897    /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
6898    ///
6899    /// # Example
6900    /// ```ignore,no_run
6901    /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6902    /// # let project_id = "project_id";
6903    /// # let location_id = "location_id";
6904    /// # let backend_authentication_config_id = "backend_authentication_config_id";
6905    /// let x = DeleteBackendAuthenticationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6906    /// ```
6907    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6908        self.name = v.into();
6909        self
6910    }
6911
6912    /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
6913    ///
6914    /// # Example
6915    /// ```ignore,no_run
6916    /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6917    /// let x = DeleteBackendAuthenticationConfigRequest::new().set_etag("example");
6918    /// ```
6919    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6920        self.etag = v.into();
6921        self
6922    }
6923}
6924
6925impl wkt::message::Message for DeleteBackendAuthenticationConfigRequest {
6926    fn typename() -> &'static str {
6927        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest"
6928    }
6929}
6930
6931/// ClientTlsPolicy is a resource that specifies how a client should authenticate
6932/// connections to backends of a service. This resource itself does not affect
6933/// configuration unless it is attached to a backend service resource.
6934#[derive(Clone, Default, PartialEq)]
6935#[non_exhaustive]
6936pub struct ClientTlsPolicy {
6937    /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
6938    /// `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}`
6939    pub name: std::string::String,
6940
6941    /// Optional. Free-text description of the resource.
6942    pub description: std::string::String,
6943
6944    /// Output only. The timestamp when the resource was created.
6945    pub create_time: std::option::Option<wkt::Timestamp>,
6946
6947    /// Output only. The timestamp when the resource was updated.
6948    pub update_time: std::option::Option<wkt::Timestamp>,
6949
6950    /// Optional. Set of label tags associated with the resource.
6951    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6952
6953    /// Optional. Server Name Indication string to present to the server during TLS
6954    /// handshake. E.g: "secure.example.com".
6955    pub sni: std::string::String,
6956
6957    /// Optional. Defines a mechanism to provision client identity (public and
6958    /// private keys) for peer to peer authentication. The presence of this
6959    /// dictates mTLS.
6960    pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
6961
6962    /// Optional. Defines the mechanism to obtain the Certificate Authority
6963    /// certificate to validate the server certificate. If empty, client does not
6964    /// validate the server certificate.
6965    pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
6966
6967    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6968}
6969
6970impl ClientTlsPolicy {
6971    /// Creates a new default instance.
6972    pub fn new() -> Self {
6973        std::default::Default::default()
6974    }
6975
6976    /// Sets the value of [name][crate::model::ClientTlsPolicy::name].
6977    ///
6978    /// # Example
6979    /// ```ignore,no_run
6980    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6981    /// # let project_id = "project_id";
6982    /// # let location_id = "location_id";
6983    /// # let client_tls_policy_id = "client_tls_policy_id";
6984    /// let x = ClientTlsPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
6985    /// ```
6986    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6987        self.name = v.into();
6988        self
6989    }
6990
6991    /// Sets the value of [description][crate::model::ClientTlsPolicy::description].
6992    ///
6993    /// # Example
6994    /// ```ignore,no_run
6995    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6996    /// let x = ClientTlsPolicy::new().set_description("example");
6997    /// ```
6998    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6999        self.description = v.into();
7000        self
7001    }
7002
7003    /// Sets the value of [create_time][crate::model::ClientTlsPolicy::create_time].
7004    ///
7005    /// # Example
7006    /// ```ignore,no_run
7007    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7008    /// use wkt::Timestamp;
7009    /// let x = ClientTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7010    /// ```
7011    pub fn set_create_time<T>(mut self, v: T) -> Self
7012    where
7013        T: std::convert::Into<wkt::Timestamp>,
7014    {
7015        self.create_time = std::option::Option::Some(v.into());
7016        self
7017    }
7018
7019    /// Sets or clears the value of [create_time][crate::model::ClientTlsPolicy::create_time].
7020    ///
7021    /// # Example
7022    /// ```ignore,no_run
7023    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7024    /// use wkt::Timestamp;
7025    /// let x = ClientTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7026    /// let x = ClientTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7027    /// ```
7028    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7029    where
7030        T: std::convert::Into<wkt::Timestamp>,
7031    {
7032        self.create_time = v.map(|x| x.into());
7033        self
7034    }
7035
7036    /// Sets the value of [update_time][crate::model::ClientTlsPolicy::update_time].
7037    ///
7038    /// # Example
7039    /// ```ignore,no_run
7040    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7041    /// use wkt::Timestamp;
7042    /// let x = ClientTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7043    /// ```
7044    pub fn set_update_time<T>(mut self, v: T) -> Self
7045    where
7046        T: std::convert::Into<wkt::Timestamp>,
7047    {
7048        self.update_time = std::option::Option::Some(v.into());
7049        self
7050    }
7051
7052    /// Sets or clears the value of [update_time][crate::model::ClientTlsPolicy::update_time].
7053    ///
7054    /// # Example
7055    /// ```ignore,no_run
7056    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7057    /// use wkt::Timestamp;
7058    /// let x = ClientTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7059    /// let x = ClientTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7060    /// ```
7061    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7062    where
7063        T: std::convert::Into<wkt::Timestamp>,
7064    {
7065        self.update_time = v.map(|x| x.into());
7066        self
7067    }
7068
7069    /// Sets the value of [labels][crate::model::ClientTlsPolicy::labels].
7070    ///
7071    /// # Example
7072    /// ```ignore,no_run
7073    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7074    /// let x = ClientTlsPolicy::new().set_labels([
7075    ///     ("key0", "abc"),
7076    ///     ("key1", "xyz"),
7077    /// ]);
7078    /// ```
7079    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7080    where
7081        T: std::iter::IntoIterator<Item = (K, V)>,
7082        K: std::convert::Into<std::string::String>,
7083        V: std::convert::Into<std::string::String>,
7084    {
7085        use std::iter::Iterator;
7086        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7087        self
7088    }
7089
7090    /// Sets the value of [sni][crate::model::ClientTlsPolicy::sni].
7091    ///
7092    /// # Example
7093    /// ```ignore,no_run
7094    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7095    /// let x = ClientTlsPolicy::new().set_sni("example");
7096    /// ```
7097    pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7098        self.sni = v.into();
7099        self
7100    }
7101
7102    /// Sets the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
7103    ///
7104    /// # Example
7105    /// ```ignore,no_run
7106    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7107    /// use google_cloud_networksecurity_v1::model::CertificateProvider;
7108    /// let x = ClientTlsPolicy::new().set_client_certificate(CertificateProvider::default()/* use setters */);
7109    /// ```
7110    pub fn set_client_certificate<T>(mut self, v: T) -> Self
7111    where
7112        T: std::convert::Into<crate::model::CertificateProvider>,
7113    {
7114        self.client_certificate = std::option::Option::Some(v.into());
7115        self
7116    }
7117
7118    /// Sets or clears the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
7119    ///
7120    /// # Example
7121    /// ```ignore,no_run
7122    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7123    /// use google_cloud_networksecurity_v1::model::CertificateProvider;
7124    /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(Some(CertificateProvider::default()/* use setters */));
7125    /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(None::<CertificateProvider>);
7126    /// ```
7127    pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7128    where
7129        T: std::convert::Into<crate::model::CertificateProvider>,
7130    {
7131        self.client_certificate = v.map(|x| x.into());
7132        self
7133    }
7134
7135    /// Sets the value of [server_validation_ca][crate::model::ClientTlsPolicy::server_validation_ca].
7136    ///
7137    /// # Example
7138    /// ```ignore,no_run
7139    /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7140    /// use google_cloud_networksecurity_v1::model::ValidationCA;
7141    /// let x = ClientTlsPolicy::new()
7142    ///     .set_server_validation_ca([
7143    ///         ValidationCA::default()/* use setters */,
7144    ///         ValidationCA::default()/* use (different) setters */,
7145    ///     ]);
7146    /// ```
7147    pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
7148    where
7149        T: std::iter::IntoIterator<Item = V>,
7150        V: std::convert::Into<crate::model::ValidationCA>,
7151    {
7152        use std::iter::Iterator;
7153        self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
7154        self
7155    }
7156}
7157
7158impl wkt::message::Message for ClientTlsPolicy {
7159    fn typename() -> &'static str {
7160        "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
7161    }
7162}
7163
7164/// Request used by the ListClientTlsPolicies method.
7165#[derive(Clone, Default, PartialEq)]
7166#[non_exhaustive]
7167pub struct ListClientTlsPoliciesRequest {
7168    /// Required. The project and location from which the ClientTlsPolicies should
7169    /// be listed, specified in the format `projects/*/locations/{location}`.
7170    pub parent: std::string::String,
7171
7172    /// Maximum number of ClientTlsPolicies to return per call.
7173    pub page_size: i32,
7174
7175    /// The value returned by the last `ListClientTlsPoliciesResponse`
7176    /// Indicates that this is a continuation of a prior
7177    /// `ListClientTlsPolicies` call, and that the system
7178    /// should return the next page of data.
7179    pub page_token: std::string::String,
7180
7181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7182}
7183
7184impl ListClientTlsPoliciesRequest {
7185    /// Creates a new default instance.
7186    pub fn new() -> Self {
7187        std::default::Default::default()
7188    }
7189
7190    /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
7191    ///
7192    /// # Example
7193    /// ```ignore,no_run
7194    /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7195    /// let x = ListClientTlsPoliciesRequest::new().set_parent("example");
7196    /// ```
7197    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7198        self.parent = v.into();
7199        self
7200    }
7201
7202    /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
7203    ///
7204    /// # Example
7205    /// ```ignore,no_run
7206    /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7207    /// let x = ListClientTlsPoliciesRequest::new().set_page_size(42);
7208    /// ```
7209    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7210        self.page_size = v.into();
7211        self
7212    }
7213
7214    /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
7215    ///
7216    /// # Example
7217    /// ```ignore,no_run
7218    /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7219    /// let x = ListClientTlsPoliciesRequest::new().set_page_token("example");
7220    /// ```
7221    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7222        self.page_token = v.into();
7223        self
7224    }
7225}
7226
7227impl wkt::message::Message for ListClientTlsPoliciesRequest {
7228    fn typename() -> &'static str {
7229        "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
7230    }
7231}
7232
7233/// Response returned by the ListClientTlsPolicies method.
7234#[derive(Clone, Default, PartialEq)]
7235#[non_exhaustive]
7236pub struct ListClientTlsPoliciesResponse {
7237    /// List of ClientTlsPolicy resources.
7238    pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
7239
7240    /// If there might be more results than those appearing in this response, then
7241    /// `next_page_token` is included. To get the next set of results, call this
7242    /// method again using the value of `next_page_token` as `page_token`.
7243    pub next_page_token: std::string::String,
7244
7245    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7246}
7247
7248impl ListClientTlsPoliciesResponse {
7249    /// Creates a new default instance.
7250    pub fn new() -> Self {
7251        std::default::Default::default()
7252    }
7253
7254    /// Sets the value of [client_tls_policies][crate::model::ListClientTlsPoliciesResponse::client_tls_policies].
7255    ///
7256    /// # Example
7257    /// ```ignore,no_run
7258    /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7259    /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7260    /// let x = ListClientTlsPoliciesResponse::new()
7261    ///     .set_client_tls_policies([
7262    ///         ClientTlsPolicy::default()/* use setters */,
7263    ///         ClientTlsPolicy::default()/* use (different) setters */,
7264    ///     ]);
7265    /// ```
7266    pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
7267    where
7268        T: std::iter::IntoIterator<Item = V>,
7269        V: std::convert::Into<crate::model::ClientTlsPolicy>,
7270    {
7271        use std::iter::Iterator;
7272        self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
7273        self
7274    }
7275
7276    /// Sets the value of [next_page_token][crate::model::ListClientTlsPoliciesResponse::next_page_token].
7277    ///
7278    /// # Example
7279    /// ```ignore,no_run
7280    /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7281    /// let x = ListClientTlsPoliciesResponse::new().set_next_page_token("example");
7282    /// ```
7283    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7284        self.next_page_token = v.into();
7285        self
7286    }
7287}
7288
7289impl wkt::message::Message for ListClientTlsPoliciesResponse {
7290    fn typename() -> &'static str {
7291        "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
7292    }
7293}
7294
7295#[doc(hidden)]
7296impl google_cloud_gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
7297    type PageItem = crate::model::ClientTlsPolicy;
7298
7299    fn items(self) -> std::vec::Vec<Self::PageItem> {
7300        self.client_tls_policies
7301    }
7302
7303    fn next_page_token(&self) -> std::string::String {
7304        use std::clone::Clone;
7305        self.next_page_token.clone()
7306    }
7307}
7308
7309/// Request used by the GetClientTlsPolicy method.
7310#[derive(Clone, Default, PartialEq)]
7311#[non_exhaustive]
7312pub struct GetClientTlsPolicyRequest {
7313    /// Required. A name of the ClientTlsPolicy to get. Must be in the format
7314    /// `projects/*/locations/{location}/clientTlsPolicies/*`.
7315    pub name: std::string::String,
7316
7317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7318}
7319
7320impl GetClientTlsPolicyRequest {
7321    /// Creates a new default instance.
7322    pub fn new() -> Self {
7323        std::default::Default::default()
7324    }
7325
7326    /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
7327    ///
7328    /// # Example
7329    /// ```ignore,no_run
7330    /// # use google_cloud_networksecurity_v1::model::GetClientTlsPolicyRequest;
7331    /// # let project_id = "project_id";
7332    /// # let location_id = "location_id";
7333    /// # let client_tls_policy_id = "client_tls_policy_id";
7334    /// let x = GetClientTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
7335    /// ```
7336    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7337        self.name = v.into();
7338        self
7339    }
7340}
7341
7342impl wkt::message::Message for GetClientTlsPolicyRequest {
7343    fn typename() -> &'static str {
7344        "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
7345    }
7346}
7347
7348/// Request used by the CreateClientTlsPolicy method.
7349#[derive(Clone, Default, PartialEq)]
7350#[non_exhaustive]
7351pub struct CreateClientTlsPolicyRequest {
7352    /// Required. The parent resource of the ClientTlsPolicy. Must be in
7353    /// the format `projects/*/locations/{location}`.
7354    pub parent: std::string::String,
7355
7356    /// Required. Short name of the ClientTlsPolicy resource to be created. This
7357    /// value should be 1-63 characters long, containing only letters, numbers,
7358    /// hyphens, and underscores, and should not start with a number. E.g.
7359    /// "client_mtls_policy".
7360    pub client_tls_policy_id: std::string::String,
7361
7362    /// Required. ClientTlsPolicy resource to be created.
7363    pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7364
7365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7366}
7367
7368impl CreateClientTlsPolicyRequest {
7369    /// Creates a new default instance.
7370    pub fn new() -> Self {
7371        std::default::Default::default()
7372    }
7373
7374    /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
7375    ///
7376    /// # Example
7377    /// ```ignore,no_run
7378    /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7379    /// # let project_id = "project_id";
7380    /// # let location_id = "location_id";
7381    /// let x = CreateClientTlsPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7382    /// ```
7383    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7384        self.parent = v.into();
7385        self
7386    }
7387
7388    /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
7389    ///
7390    /// # Example
7391    /// ```ignore,no_run
7392    /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7393    /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy_id("example");
7394    /// ```
7395    pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
7396        mut self,
7397        v: T,
7398    ) -> Self {
7399        self.client_tls_policy_id = v.into();
7400        self
7401    }
7402
7403    /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7404    ///
7405    /// # Example
7406    /// ```ignore,no_run
7407    /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7408    /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7409    /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7410    /// ```
7411    pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7412    where
7413        T: std::convert::Into<crate::model::ClientTlsPolicy>,
7414    {
7415        self.client_tls_policy = std::option::Option::Some(v.into());
7416        self
7417    }
7418
7419    /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7420    ///
7421    /// # Example
7422    /// ```ignore,no_run
7423    /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7424    /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7425    /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7426    /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7427    /// ```
7428    pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7429    where
7430        T: std::convert::Into<crate::model::ClientTlsPolicy>,
7431    {
7432        self.client_tls_policy = v.map(|x| x.into());
7433        self
7434    }
7435}
7436
7437impl wkt::message::Message for CreateClientTlsPolicyRequest {
7438    fn typename() -> &'static str {
7439        "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
7440    }
7441}
7442
7443/// Request used by UpdateClientTlsPolicy method.
7444#[derive(Clone, Default, PartialEq)]
7445#[non_exhaustive]
7446pub struct UpdateClientTlsPolicyRequest {
7447    /// Optional. Field mask is used to specify the fields to be overwritten in the
7448    /// ClientTlsPolicy resource by the update.  The fields
7449    /// specified in the update_mask are relative to the resource, not
7450    /// the full request. A field will be overwritten if it is in the
7451    /// mask. If the user does not provide a mask then all fields will be
7452    /// overwritten.
7453    pub update_mask: std::option::Option<wkt::FieldMask>,
7454
7455    /// Required. Updated ClientTlsPolicy resource.
7456    pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7457
7458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7459}
7460
7461impl UpdateClientTlsPolicyRequest {
7462    /// Creates a new default instance.
7463    pub fn new() -> Self {
7464        std::default::Default::default()
7465    }
7466
7467    /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7468    ///
7469    /// # Example
7470    /// ```ignore,no_run
7471    /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7472    /// use wkt::FieldMask;
7473    /// let x = UpdateClientTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7474    /// ```
7475    pub fn set_update_mask<T>(mut self, v: T) -> Self
7476    where
7477        T: std::convert::Into<wkt::FieldMask>,
7478    {
7479        self.update_mask = std::option::Option::Some(v.into());
7480        self
7481    }
7482
7483    /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7484    ///
7485    /// # Example
7486    /// ```ignore,no_run
7487    /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7488    /// use wkt::FieldMask;
7489    /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7490    /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7491    /// ```
7492    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7493    where
7494        T: std::convert::Into<wkt::FieldMask>,
7495    {
7496        self.update_mask = v.map(|x| x.into());
7497        self
7498    }
7499
7500    /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7501    ///
7502    /// # Example
7503    /// ```ignore,no_run
7504    /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7505    /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7506    /// let x = UpdateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7507    /// ```
7508    pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7509    where
7510        T: std::convert::Into<crate::model::ClientTlsPolicy>,
7511    {
7512        self.client_tls_policy = std::option::Option::Some(v.into());
7513        self
7514    }
7515
7516    /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7517    ///
7518    /// # Example
7519    /// ```ignore,no_run
7520    /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7521    /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7522    /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7523    /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7524    /// ```
7525    pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7526    where
7527        T: std::convert::Into<crate::model::ClientTlsPolicy>,
7528    {
7529        self.client_tls_policy = v.map(|x| x.into());
7530        self
7531    }
7532}
7533
7534impl wkt::message::Message for UpdateClientTlsPolicyRequest {
7535    fn typename() -> &'static str {
7536        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
7537    }
7538}
7539
7540/// Request used by the DeleteClientTlsPolicy method.
7541#[derive(Clone, Default, PartialEq)]
7542#[non_exhaustive]
7543pub struct DeleteClientTlsPolicyRequest {
7544    /// Required. A name of the ClientTlsPolicy to delete. Must be in
7545    /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
7546    pub name: std::string::String,
7547
7548    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7549}
7550
7551impl DeleteClientTlsPolicyRequest {
7552    /// Creates a new default instance.
7553    pub fn new() -> Self {
7554        std::default::Default::default()
7555    }
7556
7557    /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
7558    ///
7559    /// # Example
7560    /// ```ignore,no_run
7561    /// # use google_cloud_networksecurity_v1::model::DeleteClientTlsPolicyRequest;
7562    /// # let project_id = "project_id";
7563    /// # let location_id = "location_id";
7564    /// # let client_tls_policy_id = "client_tls_policy_id";
7565    /// let x = DeleteClientTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
7566    /// ```
7567    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7568        self.name = v.into();
7569        self
7570    }
7571}
7572
7573impl wkt::message::Message for DeleteClientTlsPolicyRequest {
7574    fn typename() -> &'static str {
7575        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
7576    }
7577}
7578
7579/// Represents the metadata of the long-running operation.
7580#[derive(Clone, Default, PartialEq)]
7581#[non_exhaustive]
7582pub struct OperationMetadata {
7583    /// Output only. The time the operation was created.
7584    pub create_time: std::option::Option<wkt::Timestamp>,
7585
7586    /// Output only. The time the operation finished running.
7587    pub end_time: std::option::Option<wkt::Timestamp>,
7588
7589    /// Output only. Server-defined resource path for the target of the operation.
7590    pub target: std::string::String,
7591
7592    /// Output only. Name of the verb executed by the operation.
7593    pub verb: std::string::String,
7594
7595    /// Output only. Human-readable status of the operation, if any.
7596    pub status_message: std::string::String,
7597
7598    /// Output only. Identifies whether the user has requested cancellation
7599    /// of the operation. Operations that have successfully been cancelled
7600    /// have [Operation.error][] value with a
7601    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7602    /// `Code.CANCELLED`.
7603    pub requested_cancellation: bool,
7604
7605    /// Output only. API version used to start the operation.
7606    pub api_version: std::string::String,
7607
7608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7609}
7610
7611impl OperationMetadata {
7612    /// Creates a new default instance.
7613    pub fn new() -> Self {
7614        std::default::Default::default()
7615    }
7616
7617    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7618    ///
7619    /// # Example
7620    /// ```ignore,no_run
7621    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7622    /// use wkt::Timestamp;
7623    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7624    /// ```
7625    pub fn set_create_time<T>(mut self, v: T) -> Self
7626    where
7627        T: std::convert::Into<wkt::Timestamp>,
7628    {
7629        self.create_time = std::option::Option::Some(v.into());
7630        self
7631    }
7632
7633    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7634    ///
7635    /// # Example
7636    /// ```ignore,no_run
7637    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7638    /// use wkt::Timestamp;
7639    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7640    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7641    /// ```
7642    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7643    where
7644        T: std::convert::Into<wkt::Timestamp>,
7645    {
7646        self.create_time = v.map(|x| x.into());
7647        self
7648    }
7649
7650    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7651    ///
7652    /// # Example
7653    /// ```ignore,no_run
7654    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7655    /// use wkt::Timestamp;
7656    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7657    /// ```
7658    pub fn set_end_time<T>(mut self, v: T) -> Self
7659    where
7660        T: std::convert::Into<wkt::Timestamp>,
7661    {
7662        self.end_time = std::option::Option::Some(v.into());
7663        self
7664    }
7665
7666    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7667    ///
7668    /// # Example
7669    /// ```ignore,no_run
7670    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7671    /// use wkt::Timestamp;
7672    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7673    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7674    /// ```
7675    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7676    where
7677        T: std::convert::Into<wkt::Timestamp>,
7678    {
7679        self.end_time = v.map(|x| x.into());
7680        self
7681    }
7682
7683    /// Sets the value of [target][crate::model::OperationMetadata::target].
7684    ///
7685    /// # Example
7686    /// ```ignore,no_run
7687    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7688    /// let x = OperationMetadata::new().set_target("example");
7689    /// ```
7690    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7691        self.target = v.into();
7692        self
7693    }
7694
7695    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7696    ///
7697    /// # Example
7698    /// ```ignore,no_run
7699    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7700    /// let x = OperationMetadata::new().set_verb("example");
7701    /// ```
7702    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7703        self.verb = v.into();
7704        self
7705    }
7706
7707    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7708    ///
7709    /// # Example
7710    /// ```ignore,no_run
7711    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7712    /// let x = OperationMetadata::new().set_status_message("example");
7713    /// ```
7714    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7715        self.status_message = v.into();
7716        self
7717    }
7718
7719    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7720    ///
7721    /// # Example
7722    /// ```ignore,no_run
7723    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7724    /// let x = OperationMetadata::new().set_requested_cancellation(true);
7725    /// ```
7726    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7727        self.requested_cancellation = v.into();
7728        self
7729    }
7730
7731    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7732    ///
7733    /// # Example
7734    /// ```ignore,no_run
7735    /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7736    /// let x = OperationMetadata::new().set_api_version("example");
7737    /// ```
7738    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7739        self.api_version = v.into();
7740        self
7741    }
7742}
7743
7744impl wkt::message::Message for OperationMetadata {
7745    fn typename() -> &'static str {
7746        "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
7747    }
7748}
7749
7750/// A DNS threat detector sends DNS query logs to a _provider_ that then
7751/// analyzes the logs to identify threat events in the DNS queries.
7752/// By default, all VPC networks in your projects are included. You can exclude
7753/// specific networks by supplying `excluded_networks`.
7754#[derive(Clone, Default, PartialEq)]
7755#[non_exhaustive]
7756pub struct DnsThreatDetector {
7757    /// Immutable. Identifier. Name of the DnsThreatDetector resource.
7758    pub name: std::string::String,
7759
7760    /// Output only. Create time stamp.
7761    pub create_time: std::option::Option<wkt::Timestamp>,
7762
7763    /// Output only. Update time stamp.
7764    pub update_time: std::option::Option<wkt::Timestamp>,
7765
7766    /// Optional. Any labels associated with the DnsThreatDetector, listed as key
7767    /// value pairs.
7768    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7769
7770    /// Optional. A list of network resource names which aren't monitored by this
7771    /// DnsThreatDetector.
7772    ///
7773    /// Example:
7774    /// `projects/PROJECT_ID/global/networks/NETWORK_NAME`.
7775    pub excluded_networks: std::vec::Vec<std::string::String>,
7776
7777    /// Required. The provider used for DNS threat analysis.
7778    pub provider: crate::model::dns_threat_detector::Provider,
7779
7780    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7781}
7782
7783impl DnsThreatDetector {
7784    /// Creates a new default instance.
7785    pub fn new() -> Self {
7786        std::default::Default::default()
7787    }
7788
7789    /// Sets the value of [name][crate::model::DnsThreatDetector::name].
7790    ///
7791    /// # Example
7792    /// ```ignore,no_run
7793    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7794    /// # let project_id = "project_id";
7795    /// # let location_id = "location_id";
7796    /// # let dns_threat_detector_id = "dns_threat_detector_id";
7797    /// let x = DnsThreatDetector::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
7798    /// ```
7799    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7800        self.name = v.into();
7801        self
7802    }
7803
7804    /// Sets the value of [create_time][crate::model::DnsThreatDetector::create_time].
7805    ///
7806    /// # Example
7807    /// ```ignore,no_run
7808    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7809    /// use wkt::Timestamp;
7810    /// let x = DnsThreatDetector::new().set_create_time(Timestamp::default()/* use setters */);
7811    /// ```
7812    pub fn set_create_time<T>(mut self, v: T) -> Self
7813    where
7814        T: std::convert::Into<wkt::Timestamp>,
7815    {
7816        self.create_time = std::option::Option::Some(v.into());
7817        self
7818    }
7819
7820    /// Sets or clears the value of [create_time][crate::model::DnsThreatDetector::create_time].
7821    ///
7822    /// # Example
7823    /// ```ignore,no_run
7824    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7825    /// use wkt::Timestamp;
7826    /// let x = DnsThreatDetector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7827    /// let x = DnsThreatDetector::new().set_or_clear_create_time(None::<Timestamp>);
7828    /// ```
7829    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7830    where
7831        T: std::convert::Into<wkt::Timestamp>,
7832    {
7833        self.create_time = v.map(|x| x.into());
7834        self
7835    }
7836
7837    /// Sets the value of [update_time][crate::model::DnsThreatDetector::update_time].
7838    ///
7839    /// # Example
7840    /// ```ignore,no_run
7841    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7842    /// use wkt::Timestamp;
7843    /// let x = DnsThreatDetector::new().set_update_time(Timestamp::default()/* use setters */);
7844    /// ```
7845    pub fn set_update_time<T>(mut self, v: T) -> Self
7846    where
7847        T: std::convert::Into<wkt::Timestamp>,
7848    {
7849        self.update_time = std::option::Option::Some(v.into());
7850        self
7851    }
7852
7853    /// Sets or clears the value of [update_time][crate::model::DnsThreatDetector::update_time].
7854    ///
7855    /// # Example
7856    /// ```ignore,no_run
7857    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7858    /// use wkt::Timestamp;
7859    /// let x = DnsThreatDetector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7860    /// let x = DnsThreatDetector::new().set_or_clear_update_time(None::<Timestamp>);
7861    /// ```
7862    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7863    where
7864        T: std::convert::Into<wkt::Timestamp>,
7865    {
7866        self.update_time = v.map(|x| x.into());
7867        self
7868    }
7869
7870    /// Sets the value of [labels][crate::model::DnsThreatDetector::labels].
7871    ///
7872    /// # Example
7873    /// ```ignore,no_run
7874    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7875    /// let x = DnsThreatDetector::new().set_labels([
7876    ///     ("key0", "abc"),
7877    ///     ("key1", "xyz"),
7878    /// ]);
7879    /// ```
7880    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7881    where
7882        T: std::iter::IntoIterator<Item = (K, V)>,
7883        K: std::convert::Into<std::string::String>,
7884        V: std::convert::Into<std::string::String>,
7885    {
7886        use std::iter::Iterator;
7887        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7888        self
7889    }
7890
7891    /// Sets the value of [excluded_networks][crate::model::DnsThreatDetector::excluded_networks].
7892    ///
7893    /// # Example
7894    /// ```ignore,no_run
7895    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7896    /// let x = DnsThreatDetector::new().set_excluded_networks(["a", "b", "c"]);
7897    /// ```
7898    pub fn set_excluded_networks<T, V>(mut self, v: T) -> Self
7899    where
7900        T: std::iter::IntoIterator<Item = V>,
7901        V: std::convert::Into<std::string::String>,
7902    {
7903        use std::iter::Iterator;
7904        self.excluded_networks = v.into_iter().map(|i| i.into()).collect();
7905        self
7906    }
7907
7908    /// Sets the value of [provider][crate::model::DnsThreatDetector::provider].
7909    ///
7910    /// # Example
7911    /// ```ignore,no_run
7912    /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7913    /// use google_cloud_networksecurity_v1::model::dns_threat_detector::Provider;
7914    /// let x0 = DnsThreatDetector::new().set_provider(Provider::Infoblox);
7915    /// ```
7916    pub fn set_provider<T: std::convert::Into<crate::model::dns_threat_detector::Provider>>(
7917        mut self,
7918        v: T,
7919    ) -> Self {
7920        self.provider = v.into();
7921        self
7922    }
7923}
7924
7925impl wkt::message::Message for DnsThreatDetector {
7926    fn typename() -> &'static str {
7927        "type.googleapis.com/google.cloud.networksecurity.v1.DnsThreatDetector"
7928    }
7929}
7930
7931/// Defines additional types related to [DnsThreatDetector].
7932pub mod dns_threat_detector {
7933    #[allow(unused_imports)]
7934    use super::*;
7935
7936    /// Name of the provider used for DNS threat analysis.
7937    ///
7938    /// # Working with unknown values
7939    ///
7940    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7941    /// additional enum variants at any time. Adding new variants is not considered
7942    /// a breaking change. Applications should write their code in anticipation of:
7943    ///
7944    /// - New values appearing in future releases of the client library, **and**
7945    /// - New values received dynamically, without application changes.
7946    ///
7947    /// Please consult the [Working with enums] section in the user guide for some
7948    /// guidelines.
7949    ///
7950    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7951    #[derive(Clone, Debug, PartialEq)]
7952    #[non_exhaustive]
7953    pub enum Provider {
7954        /// An unspecified provider.
7955        Unspecified,
7956        /// The Infoblox DNS threat detector provider.
7957        Infoblox,
7958        /// If set, the enum was initialized with an unknown value.
7959        ///
7960        /// Applications can examine the value using [Provider::value] or
7961        /// [Provider::name].
7962        UnknownValue(provider::UnknownValue),
7963    }
7964
7965    #[doc(hidden)]
7966    pub mod provider {
7967        #[allow(unused_imports)]
7968        use super::*;
7969        #[derive(Clone, Debug, PartialEq)]
7970        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7971    }
7972
7973    impl Provider {
7974        /// Gets the enum value.
7975        ///
7976        /// Returns `None` if the enum contains an unknown value deserialized from
7977        /// the string representation of enums.
7978        pub fn value(&self) -> std::option::Option<i32> {
7979            match self {
7980                Self::Unspecified => std::option::Option::Some(0),
7981                Self::Infoblox => std::option::Option::Some(1),
7982                Self::UnknownValue(u) => u.0.value(),
7983            }
7984        }
7985
7986        /// Gets the enum value as a string.
7987        ///
7988        /// Returns `None` if the enum contains an unknown value deserialized from
7989        /// the integer representation of enums.
7990        pub fn name(&self) -> std::option::Option<&str> {
7991            match self {
7992                Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
7993                Self::Infoblox => std::option::Option::Some("INFOBLOX"),
7994                Self::UnknownValue(u) => u.0.name(),
7995            }
7996        }
7997    }
7998
7999    impl std::default::Default for Provider {
8000        fn default() -> Self {
8001            use std::convert::From;
8002            Self::from(0)
8003        }
8004    }
8005
8006    impl std::fmt::Display for Provider {
8007        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8008            wkt::internal::display_enum(f, self.name(), self.value())
8009        }
8010    }
8011
8012    impl std::convert::From<i32> for Provider {
8013        fn from(value: i32) -> Self {
8014            match value {
8015                0 => Self::Unspecified,
8016                1 => Self::Infoblox,
8017                _ => Self::UnknownValue(provider::UnknownValue(
8018                    wkt::internal::UnknownEnumValue::Integer(value),
8019                )),
8020            }
8021        }
8022    }
8023
8024    impl std::convert::From<&str> for Provider {
8025        fn from(value: &str) -> Self {
8026            use std::string::ToString;
8027            match value {
8028                "PROVIDER_UNSPECIFIED" => Self::Unspecified,
8029                "INFOBLOX" => Self::Infoblox,
8030                _ => Self::UnknownValue(provider::UnknownValue(
8031                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8032                )),
8033            }
8034        }
8035    }
8036
8037    impl serde::ser::Serialize for Provider {
8038        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8039        where
8040            S: serde::Serializer,
8041        {
8042            match self {
8043                Self::Unspecified => serializer.serialize_i32(0),
8044                Self::Infoblox => serializer.serialize_i32(1),
8045                Self::UnknownValue(u) => u.0.serialize(serializer),
8046            }
8047        }
8048    }
8049
8050    impl<'de> serde::de::Deserialize<'de> for Provider {
8051        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8052        where
8053            D: serde::Deserializer<'de>,
8054        {
8055            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
8056                ".google.cloud.networksecurity.v1.DnsThreatDetector.Provider",
8057            ))
8058        }
8059    }
8060}
8061
8062/// The message for requesting a list of DnsThreatDetectors in the project.
8063#[derive(Clone, Default, PartialEq)]
8064#[non_exhaustive]
8065pub struct ListDnsThreatDetectorsRequest {
8066    /// Required. The parent value for `ListDnsThreatDetectorsRequest`.
8067    pub parent: std::string::String,
8068
8069    /// Optional. The requested page size. The server may return fewer items than
8070    /// requested. If unspecified, the server picks an appropriate default.
8071    pub page_size: i32,
8072
8073    /// Optional. A page token received from a previous
8074    /// `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the
8075    /// subsequent page.
8076    pub page_token: std::string::String,
8077
8078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8079}
8080
8081impl ListDnsThreatDetectorsRequest {
8082    /// Creates a new default instance.
8083    pub fn new() -> Self {
8084        std::default::Default::default()
8085    }
8086
8087    /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
8088    ///
8089    /// # Example
8090    /// ```ignore,no_run
8091    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8092    /// # let project_id = "project_id";
8093    /// # let location_id = "location_id";
8094    /// let x = ListDnsThreatDetectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8095    /// ```
8096    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8097        self.parent = v.into();
8098        self
8099    }
8100
8101    /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
8102    ///
8103    /// # Example
8104    /// ```ignore,no_run
8105    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8106    /// let x = ListDnsThreatDetectorsRequest::new().set_page_size(42);
8107    /// ```
8108    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8109        self.page_size = v.into();
8110        self
8111    }
8112
8113    /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
8114    ///
8115    /// # Example
8116    /// ```ignore,no_run
8117    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8118    /// let x = ListDnsThreatDetectorsRequest::new().set_page_token("example");
8119    /// ```
8120    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8121        self.page_token = v.into();
8122        self
8123    }
8124}
8125
8126impl wkt::message::Message for ListDnsThreatDetectorsRequest {
8127    fn typename() -> &'static str {
8128        "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest"
8129    }
8130}
8131
8132/// The response message to requesting a list of DnsThreatDetectors.
8133#[derive(Clone, Default, PartialEq)]
8134#[non_exhaustive]
8135pub struct ListDnsThreatDetectorsResponse {
8136    /// The list of DnsThreatDetector resources.
8137    pub dns_threat_detectors: std::vec::Vec<crate::model::DnsThreatDetector>,
8138
8139    /// A token, which can be sent as `page_token`, to retrieve the next page.
8140    pub next_page_token: std::string::String,
8141
8142    /// Unordered list. Unreachable `DnsThreatDetector` resources.
8143    pub unreachable: std::vec::Vec<std::string::String>,
8144
8145    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8146}
8147
8148impl ListDnsThreatDetectorsResponse {
8149    /// Creates a new default instance.
8150    pub fn new() -> Self {
8151        std::default::Default::default()
8152    }
8153
8154    /// Sets the value of [dns_threat_detectors][crate::model::ListDnsThreatDetectorsResponse::dns_threat_detectors].
8155    ///
8156    /// # Example
8157    /// ```ignore,no_run
8158    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8159    /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8160    /// let x = ListDnsThreatDetectorsResponse::new()
8161    ///     .set_dns_threat_detectors([
8162    ///         DnsThreatDetector::default()/* use setters */,
8163    ///         DnsThreatDetector::default()/* use (different) setters */,
8164    ///     ]);
8165    /// ```
8166    pub fn set_dns_threat_detectors<T, V>(mut self, v: T) -> Self
8167    where
8168        T: std::iter::IntoIterator<Item = V>,
8169        V: std::convert::Into<crate::model::DnsThreatDetector>,
8170    {
8171        use std::iter::Iterator;
8172        self.dns_threat_detectors = v.into_iter().map(|i| i.into()).collect();
8173        self
8174    }
8175
8176    /// Sets the value of [next_page_token][crate::model::ListDnsThreatDetectorsResponse::next_page_token].
8177    ///
8178    /// # Example
8179    /// ```ignore,no_run
8180    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8181    /// let x = ListDnsThreatDetectorsResponse::new().set_next_page_token("example");
8182    /// ```
8183    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8184        self.next_page_token = v.into();
8185        self
8186    }
8187
8188    /// Sets the value of [unreachable][crate::model::ListDnsThreatDetectorsResponse::unreachable].
8189    ///
8190    /// # Example
8191    /// ```ignore,no_run
8192    /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8193    /// let x = ListDnsThreatDetectorsResponse::new().set_unreachable(["a", "b", "c"]);
8194    /// ```
8195    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8196    where
8197        T: std::iter::IntoIterator<Item = V>,
8198        V: std::convert::Into<std::string::String>,
8199    {
8200        use std::iter::Iterator;
8201        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8202        self
8203    }
8204}
8205
8206impl wkt::message::Message for ListDnsThreatDetectorsResponse {
8207    fn typename() -> &'static str {
8208        "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse"
8209    }
8210}
8211
8212#[doc(hidden)]
8213impl google_cloud_gax::paginator::internal::PageableResponse for ListDnsThreatDetectorsResponse {
8214    type PageItem = crate::model::DnsThreatDetector;
8215
8216    fn items(self) -> std::vec::Vec<Self::PageItem> {
8217        self.dns_threat_detectors
8218    }
8219
8220    fn next_page_token(&self) -> std::string::String {
8221        use std::clone::Clone;
8222        self.next_page_token.clone()
8223    }
8224}
8225
8226/// The message sent to get a DnsThreatDetector.
8227#[derive(Clone, Default, PartialEq)]
8228#[non_exhaustive]
8229pub struct GetDnsThreatDetectorRequest {
8230    /// Required. Name of the DnsThreatDetector resource.
8231    pub name: std::string::String,
8232
8233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8234}
8235
8236impl GetDnsThreatDetectorRequest {
8237    /// Creates a new default instance.
8238    pub fn new() -> Self {
8239        std::default::Default::default()
8240    }
8241
8242    /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
8243    ///
8244    /// # Example
8245    /// ```ignore,no_run
8246    /// # use google_cloud_networksecurity_v1::model::GetDnsThreatDetectorRequest;
8247    /// # let project_id = "project_id";
8248    /// # let location_id = "location_id";
8249    /// # let dns_threat_detector_id = "dns_threat_detector_id";
8250    /// let x = GetDnsThreatDetectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
8251    /// ```
8252    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8253        self.name = v.into();
8254        self
8255    }
8256}
8257
8258impl wkt::message::Message for GetDnsThreatDetectorRequest {
8259    fn typename() -> &'static str {
8260        "type.googleapis.com/google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest"
8261    }
8262}
8263
8264/// The message to create a DnsThreatDetector.
8265#[derive(Clone, Default, PartialEq)]
8266#[non_exhaustive]
8267pub struct CreateDnsThreatDetectorRequest {
8268    /// Required. The value for the parent of the DnsThreatDetector resource.
8269    pub parent: std::string::String,
8270
8271    /// Optional. The ID of the requesting DnsThreatDetector object.
8272    /// If this field is not supplied, the service generates an identifier.
8273    pub dns_threat_detector_id: std::string::String,
8274
8275    /// Required. The `DnsThreatDetector` resource to create.
8276    pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8277
8278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8279}
8280
8281impl CreateDnsThreatDetectorRequest {
8282    /// Creates a new default instance.
8283    pub fn new() -> Self {
8284        std::default::Default::default()
8285    }
8286
8287    /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
8288    ///
8289    /// # Example
8290    /// ```ignore,no_run
8291    /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8292    /// # let project_id = "project_id";
8293    /// # let location_id = "location_id";
8294    /// let x = CreateDnsThreatDetectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8295    /// ```
8296    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297        self.parent = v.into();
8298        self
8299    }
8300
8301    /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
8302    ///
8303    /// # Example
8304    /// ```ignore,no_run
8305    /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8306    /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector_id("example");
8307    /// ```
8308    pub fn set_dns_threat_detector_id<T: std::convert::Into<std::string::String>>(
8309        mut self,
8310        v: T,
8311    ) -> Self {
8312        self.dns_threat_detector_id = v.into();
8313        self
8314    }
8315
8316    /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8317    ///
8318    /// # Example
8319    /// ```ignore,no_run
8320    /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8321    /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8322    /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8323    /// ```
8324    pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8325    where
8326        T: std::convert::Into<crate::model::DnsThreatDetector>,
8327    {
8328        self.dns_threat_detector = std::option::Option::Some(v.into());
8329        self
8330    }
8331
8332    /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8333    ///
8334    /// # Example
8335    /// ```ignore,no_run
8336    /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8337    /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8338    /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8339    /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8340    /// ```
8341    pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8342    where
8343        T: std::convert::Into<crate::model::DnsThreatDetector>,
8344    {
8345        self.dns_threat_detector = v.map(|x| x.into());
8346        self
8347    }
8348}
8349
8350impl wkt::message::Message for CreateDnsThreatDetectorRequest {
8351    fn typename() -> &'static str {
8352        "type.googleapis.com/google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest"
8353    }
8354}
8355
8356/// The message for updating a DnsThreatDetector.
8357#[derive(Clone, Default, PartialEq)]
8358#[non_exhaustive]
8359pub struct UpdateDnsThreatDetectorRequest {
8360    /// Optional. The field mask is used to specify the fields to be overwritten in
8361    /// the DnsThreatDetector resource by the update. The fields specified in the
8362    /// update_mask are relative to the resource, not the full request. A field
8363    /// will be overwritten if it is in the mask. If the mask is not provided then
8364    /// all fields present in the request will be overwritten.
8365    pub update_mask: std::option::Option<wkt::FieldMask>,
8366
8367    /// Required. The DnsThreatDetector resource being updated.
8368    pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8369
8370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8371}
8372
8373impl UpdateDnsThreatDetectorRequest {
8374    /// Creates a new default instance.
8375    pub fn new() -> Self {
8376        std::default::Default::default()
8377    }
8378
8379    /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8380    ///
8381    /// # Example
8382    /// ```ignore,no_run
8383    /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8384    /// use wkt::FieldMask;
8385    /// let x = UpdateDnsThreatDetectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8386    /// ```
8387    pub fn set_update_mask<T>(mut self, v: T) -> Self
8388    where
8389        T: std::convert::Into<wkt::FieldMask>,
8390    {
8391        self.update_mask = std::option::Option::Some(v.into());
8392        self
8393    }
8394
8395    /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8396    ///
8397    /// # Example
8398    /// ```ignore,no_run
8399    /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8400    /// use wkt::FieldMask;
8401    /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8402    /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8403    /// ```
8404    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8405    where
8406        T: std::convert::Into<wkt::FieldMask>,
8407    {
8408        self.update_mask = v.map(|x| x.into());
8409        self
8410    }
8411
8412    /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8413    ///
8414    /// # Example
8415    /// ```ignore,no_run
8416    /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8417    /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8418    /// let x = UpdateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8419    /// ```
8420    pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8421    where
8422        T: std::convert::Into<crate::model::DnsThreatDetector>,
8423    {
8424        self.dns_threat_detector = std::option::Option::Some(v.into());
8425        self
8426    }
8427
8428    /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8429    ///
8430    /// # Example
8431    /// ```ignore,no_run
8432    /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8433    /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8434    /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8435    /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8436    /// ```
8437    pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8438    where
8439        T: std::convert::Into<crate::model::DnsThreatDetector>,
8440    {
8441        self.dns_threat_detector = v.map(|x| x.into());
8442        self
8443    }
8444}
8445
8446impl wkt::message::Message for UpdateDnsThreatDetectorRequest {
8447    fn typename() -> &'static str {
8448        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest"
8449    }
8450}
8451
8452/// The message for deleting a DnsThreatDetector.
8453#[derive(Clone, Default, PartialEq)]
8454#[non_exhaustive]
8455pub struct DeleteDnsThreatDetectorRequest {
8456    /// Required. Name of the DnsThreatDetector resource.
8457    pub name: std::string::String,
8458
8459    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8460}
8461
8462impl DeleteDnsThreatDetectorRequest {
8463    /// Creates a new default instance.
8464    pub fn new() -> Self {
8465        std::default::Default::default()
8466    }
8467
8468    /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
8469    ///
8470    /// # Example
8471    /// ```ignore,no_run
8472    /// # use google_cloud_networksecurity_v1::model::DeleteDnsThreatDetectorRequest;
8473    /// # let project_id = "project_id";
8474    /// # let location_id = "location_id";
8475    /// # let dns_threat_detector_id = "dns_threat_detector_id";
8476    /// let x = DeleteDnsThreatDetectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
8477    /// ```
8478    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8479        self.name = v.into();
8480        self
8481    }
8482}
8483
8484impl wkt::message::Message for DeleteDnsThreatDetectorRequest {
8485    fn typename() -> &'static str {
8486        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest"
8487    }
8488}
8489
8490/// Message describing Endpoint object.
8491#[derive(Clone, Default, PartialEq)]
8492#[non_exhaustive]
8493pub struct FirewallEndpoint {
8494    /// Immutable. Identifier. Name of resource.
8495    pub name: std::string::String,
8496
8497    /// Optional. Description of the firewall endpoint. Max length 2048
8498    /// characters.
8499    pub description: std::string::String,
8500
8501    /// Output only. Create time stamp.
8502    pub create_time: std::option::Option<wkt::Timestamp>,
8503
8504    /// Output only. Update time stamp
8505    pub update_time: std::option::Option<wkt::Timestamp>,
8506
8507    /// Optional. Labels as key value pairs
8508    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8509
8510    /// Output only. Current state of the endpoint.
8511    pub state: crate::model::firewall_endpoint::State,
8512
8513    /// Output only. Whether reconciling is in progress, recommended per
8514    /// <https://google.aip.dev/128>.
8515    pub reconciling: bool,
8516
8517    /// Output only. Deprecated: List of networks that are associated with this
8518    /// endpoint in the local zone. This is a projection of the
8519    /// FirewallEndpointAssociations pointing at this endpoint. A network will only
8520    /// appear in this list after traffic routing is fully configured. Format:
8521    /// projects/{project}/global/networks/{name}.
8522    #[deprecated]
8523    pub associated_networks: std::vec::Vec<std::string::String>,
8524
8525    /// Output only. List of FirewallEndpointAssociations that are associated to
8526    /// this endpoint. An association will only appear in this list after traffic
8527    /// routing is fully configured.
8528    pub associations: std::vec::Vec<crate::model::firewall_endpoint::AssociationReference>,
8529
8530    /// Output only. [Output Only] Reserved for future use.
8531    pub satisfies_pzs: std::option::Option<bool>,
8532
8533    /// Output only. [Output Only] Reserved for future use.
8534    pub satisfies_pzi: std::option::Option<bool>,
8535
8536    /// Optional. Project to charge for the deployed firewall endpoint.
8537    /// This field must be specified when creating the endpoint in the organization
8538    /// scope, and should be omitted otherwise.
8539    pub billing_project_id: std::string::String,
8540
8541    /// Optional. Settings for the endpoint.
8542    pub endpoint_settings: std::option::Option<crate::model::firewall_endpoint::EndpointSettings>,
8543
8544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8545}
8546
8547impl FirewallEndpoint {
8548    /// Creates a new default instance.
8549    pub fn new() -> Self {
8550        std::default::Default::default()
8551    }
8552
8553    /// Sets the value of [name][crate::model::FirewallEndpoint::name].
8554    ///
8555    /// # Example
8556    /// ```ignore,no_run
8557    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8558    /// # let organization_id = "organization_id";
8559    /// # let location_id = "location_id";
8560    /// # let firewall_endpoint_id = "firewall_endpoint_id";
8561    /// let x = FirewallEndpoint::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
8562    /// ```
8563    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8564        self.name = v.into();
8565        self
8566    }
8567
8568    /// Sets the value of [description][crate::model::FirewallEndpoint::description].
8569    ///
8570    /// # Example
8571    /// ```ignore,no_run
8572    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8573    /// let x = FirewallEndpoint::new().set_description("example");
8574    /// ```
8575    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8576        self.description = v.into();
8577        self
8578    }
8579
8580    /// Sets the value of [create_time][crate::model::FirewallEndpoint::create_time].
8581    ///
8582    /// # Example
8583    /// ```ignore,no_run
8584    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8585    /// use wkt::Timestamp;
8586    /// let x = FirewallEndpoint::new().set_create_time(Timestamp::default()/* use setters */);
8587    /// ```
8588    pub fn set_create_time<T>(mut self, v: T) -> Self
8589    where
8590        T: std::convert::Into<wkt::Timestamp>,
8591    {
8592        self.create_time = std::option::Option::Some(v.into());
8593        self
8594    }
8595
8596    /// Sets or clears the value of [create_time][crate::model::FirewallEndpoint::create_time].
8597    ///
8598    /// # Example
8599    /// ```ignore,no_run
8600    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8601    /// use wkt::Timestamp;
8602    /// let x = FirewallEndpoint::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8603    /// let x = FirewallEndpoint::new().set_or_clear_create_time(None::<Timestamp>);
8604    /// ```
8605    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8606    where
8607        T: std::convert::Into<wkt::Timestamp>,
8608    {
8609        self.create_time = v.map(|x| x.into());
8610        self
8611    }
8612
8613    /// Sets the value of [update_time][crate::model::FirewallEndpoint::update_time].
8614    ///
8615    /// # Example
8616    /// ```ignore,no_run
8617    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8618    /// use wkt::Timestamp;
8619    /// let x = FirewallEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
8620    /// ```
8621    pub fn set_update_time<T>(mut self, v: T) -> Self
8622    where
8623        T: std::convert::Into<wkt::Timestamp>,
8624    {
8625        self.update_time = std::option::Option::Some(v.into());
8626        self
8627    }
8628
8629    /// Sets or clears the value of [update_time][crate::model::FirewallEndpoint::update_time].
8630    ///
8631    /// # Example
8632    /// ```ignore,no_run
8633    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8634    /// use wkt::Timestamp;
8635    /// let x = FirewallEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8636    /// let x = FirewallEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
8637    /// ```
8638    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8639    where
8640        T: std::convert::Into<wkt::Timestamp>,
8641    {
8642        self.update_time = v.map(|x| x.into());
8643        self
8644    }
8645
8646    /// Sets the value of [labels][crate::model::FirewallEndpoint::labels].
8647    ///
8648    /// # Example
8649    /// ```ignore,no_run
8650    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8651    /// let x = FirewallEndpoint::new().set_labels([
8652    ///     ("key0", "abc"),
8653    ///     ("key1", "xyz"),
8654    /// ]);
8655    /// ```
8656    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8657    where
8658        T: std::iter::IntoIterator<Item = (K, V)>,
8659        K: std::convert::Into<std::string::String>,
8660        V: std::convert::Into<std::string::String>,
8661    {
8662        use std::iter::Iterator;
8663        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8664        self
8665    }
8666
8667    /// Sets the value of [state][crate::model::FirewallEndpoint::state].
8668    ///
8669    /// # Example
8670    /// ```ignore,no_run
8671    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8672    /// use google_cloud_networksecurity_v1::model::firewall_endpoint::State;
8673    /// let x0 = FirewallEndpoint::new().set_state(State::Creating);
8674    /// let x1 = FirewallEndpoint::new().set_state(State::Active);
8675    /// let x2 = FirewallEndpoint::new().set_state(State::Deleting);
8676    /// ```
8677    pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint::State>>(
8678        mut self,
8679        v: T,
8680    ) -> Self {
8681        self.state = v.into();
8682        self
8683    }
8684
8685    /// Sets the value of [reconciling][crate::model::FirewallEndpoint::reconciling].
8686    ///
8687    /// # Example
8688    /// ```ignore,no_run
8689    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8690    /// let x = FirewallEndpoint::new().set_reconciling(true);
8691    /// ```
8692    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8693        self.reconciling = v.into();
8694        self
8695    }
8696
8697    /// Sets the value of [associated_networks][crate::model::FirewallEndpoint::associated_networks].
8698    ///
8699    /// # Example
8700    /// ```ignore,no_run
8701    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8702    /// let x = FirewallEndpoint::new().set_associated_networks(["a", "b", "c"]);
8703    /// ```
8704    #[deprecated]
8705    pub fn set_associated_networks<T, V>(mut self, v: T) -> Self
8706    where
8707        T: std::iter::IntoIterator<Item = V>,
8708        V: std::convert::Into<std::string::String>,
8709    {
8710        use std::iter::Iterator;
8711        self.associated_networks = v.into_iter().map(|i| i.into()).collect();
8712        self
8713    }
8714
8715    /// Sets the value of [associations][crate::model::FirewallEndpoint::associations].
8716    ///
8717    /// # Example
8718    /// ```ignore,no_run
8719    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8720    /// use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8721    /// let x = FirewallEndpoint::new()
8722    ///     .set_associations([
8723    ///         AssociationReference::default()/* use setters */,
8724    ///         AssociationReference::default()/* use (different) setters */,
8725    ///     ]);
8726    /// ```
8727    pub fn set_associations<T, V>(mut self, v: T) -> Self
8728    where
8729        T: std::iter::IntoIterator<Item = V>,
8730        V: std::convert::Into<crate::model::firewall_endpoint::AssociationReference>,
8731    {
8732        use std::iter::Iterator;
8733        self.associations = v.into_iter().map(|i| i.into()).collect();
8734        self
8735    }
8736
8737    /// Sets the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8738    ///
8739    /// # Example
8740    /// ```ignore,no_run
8741    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8742    /// let x = FirewallEndpoint::new().set_satisfies_pzs(true);
8743    /// ```
8744    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
8745    where
8746        T: std::convert::Into<bool>,
8747    {
8748        self.satisfies_pzs = std::option::Option::Some(v.into());
8749        self
8750    }
8751
8752    /// Sets or clears the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8753    ///
8754    /// # Example
8755    /// ```ignore,no_run
8756    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8757    /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(Some(false));
8758    /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(None::<bool>);
8759    /// ```
8760    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
8761    where
8762        T: std::convert::Into<bool>,
8763    {
8764        self.satisfies_pzs = v.map(|x| x.into());
8765        self
8766    }
8767
8768    /// Sets the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8769    ///
8770    /// # Example
8771    /// ```ignore,no_run
8772    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8773    /// let x = FirewallEndpoint::new().set_satisfies_pzi(true);
8774    /// ```
8775    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8776    where
8777        T: std::convert::Into<bool>,
8778    {
8779        self.satisfies_pzi = std::option::Option::Some(v.into());
8780        self
8781    }
8782
8783    /// Sets or clears the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8784    ///
8785    /// # Example
8786    /// ```ignore,no_run
8787    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8788    /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(Some(false));
8789    /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(None::<bool>);
8790    /// ```
8791    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8792    where
8793        T: std::convert::Into<bool>,
8794    {
8795        self.satisfies_pzi = v.map(|x| x.into());
8796        self
8797    }
8798
8799    /// Sets the value of [billing_project_id][crate::model::FirewallEndpoint::billing_project_id].
8800    ///
8801    /// # Example
8802    /// ```ignore,no_run
8803    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8804    /// let x = FirewallEndpoint::new().set_billing_project_id("example");
8805    /// ```
8806    pub fn set_billing_project_id<T: std::convert::Into<std::string::String>>(
8807        mut self,
8808        v: T,
8809    ) -> Self {
8810        self.billing_project_id = v.into();
8811        self
8812    }
8813
8814    /// Sets the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8815    ///
8816    /// # Example
8817    /// ```ignore,no_run
8818    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8819    /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8820    /// let x = FirewallEndpoint::new().set_endpoint_settings(EndpointSettings::default()/* use setters */);
8821    /// ```
8822    pub fn set_endpoint_settings<T>(mut self, v: T) -> Self
8823    where
8824        T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8825    {
8826        self.endpoint_settings = std::option::Option::Some(v.into());
8827        self
8828    }
8829
8830    /// Sets or clears the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8831    ///
8832    /// # Example
8833    /// ```ignore,no_run
8834    /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8835    /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8836    /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(Some(EndpointSettings::default()/* use setters */));
8837    /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(None::<EndpointSettings>);
8838    /// ```
8839    pub fn set_or_clear_endpoint_settings<T>(mut self, v: std::option::Option<T>) -> Self
8840    where
8841        T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8842    {
8843        self.endpoint_settings = v.map(|x| x.into());
8844        self
8845    }
8846}
8847
8848impl wkt::message::Message for FirewallEndpoint {
8849    fn typename() -> &'static str {
8850        "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint"
8851    }
8852}
8853
8854/// Defines additional types related to [FirewallEndpoint].
8855pub mod firewall_endpoint {
8856    #[allow(unused_imports)]
8857    use super::*;
8858
8859    /// This is a subset of the FirewallEndpointAssociation message, containing
8860    /// fields to be used by the consumer.
8861    #[derive(Clone, Default, PartialEq)]
8862    #[non_exhaustive]
8863    pub struct AssociationReference {
8864        /// Output only. The resource name of the FirewallEndpointAssociation.
8865        /// Format:
8866        /// projects/{project}/locations/{location}/firewallEndpointAssociations/{id}
8867        pub name: std::string::String,
8868
8869        /// Output only. The VPC network associated. Format:
8870        /// projects/{project}/global/networks/{name}.
8871        pub network: std::string::String,
8872
8873        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8874    }
8875
8876    impl AssociationReference {
8877        /// Creates a new default instance.
8878        pub fn new() -> Self {
8879            std::default::Default::default()
8880        }
8881
8882        /// Sets the value of [name][crate::model::firewall_endpoint::AssociationReference::name].
8883        ///
8884        /// # Example
8885        /// ```ignore,no_run
8886        /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8887        /// # let project_id = "project_id";
8888        /// # let location_id = "location_id";
8889        /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
8890        /// let x = AssociationReference::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
8891        /// ```
8892        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8893            self.name = v.into();
8894            self
8895        }
8896
8897        /// Sets the value of [network][crate::model::firewall_endpoint::AssociationReference::network].
8898        ///
8899        /// # Example
8900        /// ```ignore,no_run
8901        /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8902        /// let x = AssociationReference::new().set_network("example");
8903        /// ```
8904        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8905            self.network = v.into();
8906            self
8907        }
8908    }
8909
8910    impl wkt::message::Message for AssociationReference {
8911        fn typename() -> &'static str {
8912            "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference"
8913        }
8914    }
8915
8916    /// Settings for the endpoint.
8917    #[derive(Clone, Default, PartialEq)]
8918    #[non_exhaustive]
8919    pub struct EndpointSettings {
8920        /// Optional. Immutable. Indicates whether Jumbo Frames are enabled.
8921        /// Default value is false.
8922        pub jumbo_frames_enabled: bool,
8923
8924        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8925    }
8926
8927    impl EndpointSettings {
8928        /// Creates a new default instance.
8929        pub fn new() -> Self {
8930            std::default::Default::default()
8931        }
8932
8933        /// Sets the value of [jumbo_frames_enabled][crate::model::firewall_endpoint::EndpointSettings::jumbo_frames_enabled].
8934        ///
8935        /// # Example
8936        /// ```ignore,no_run
8937        /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8938        /// let x = EndpointSettings::new().set_jumbo_frames_enabled(true);
8939        /// ```
8940        pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8941            self.jumbo_frames_enabled = v.into();
8942            self
8943        }
8944    }
8945
8946    impl wkt::message::Message for EndpointSettings {
8947        fn typename() -> &'static str {
8948            "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings"
8949        }
8950    }
8951
8952    /// Endpoint state.
8953    ///
8954    /// # Working with unknown values
8955    ///
8956    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8957    /// additional enum variants at any time. Adding new variants is not considered
8958    /// a breaking change. Applications should write their code in anticipation of:
8959    ///
8960    /// - New values appearing in future releases of the client library, **and**
8961    /// - New values received dynamically, without application changes.
8962    ///
8963    /// Please consult the [Working with enums] section in the user guide for some
8964    /// guidelines.
8965    ///
8966    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8967    #[derive(Clone, Debug, PartialEq)]
8968    #[non_exhaustive]
8969    pub enum State {
8970        /// Not set.
8971        Unspecified,
8972        /// Being created.
8973        Creating,
8974        /// Processing configuration updates.
8975        Active,
8976        /// Being deleted.
8977        Deleting,
8978        /// Down or in an error state.
8979        Inactive,
8980        /// If set, the enum was initialized with an unknown value.
8981        ///
8982        /// Applications can examine the value using [State::value] or
8983        /// [State::name].
8984        UnknownValue(state::UnknownValue),
8985    }
8986
8987    #[doc(hidden)]
8988    pub mod state {
8989        #[allow(unused_imports)]
8990        use super::*;
8991        #[derive(Clone, Debug, PartialEq)]
8992        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8993    }
8994
8995    impl State {
8996        /// Gets the enum value.
8997        ///
8998        /// Returns `None` if the enum contains an unknown value deserialized from
8999        /// the string representation of enums.
9000        pub fn value(&self) -> std::option::Option<i32> {
9001            match self {
9002                Self::Unspecified => std::option::Option::Some(0),
9003                Self::Creating => std::option::Option::Some(1),
9004                Self::Active => std::option::Option::Some(2),
9005                Self::Deleting => std::option::Option::Some(3),
9006                Self::Inactive => std::option::Option::Some(4),
9007                Self::UnknownValue(u) => u.0.value(),
9008            }
9009        }
9010
9011        /// Gets the enum value as a string.
9012        ///
9013        /// Returns `None` if the enum contains an unknown value deserialized from
9014        /// the integer representation of enums.
9015        pub fn name(&self) -> std::option::Option<&str> {
9016            match self {
9017                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9018                Self::Creating => std::option::Option::Some("CREATING"),
9019                Self::Active => std::option::Option::Some("ACTIVE"),
9020                Self::Deleting => std::option::Option::Some("DELETING"),
9021                Self::Inactive => std::option::Option::Some("INACTIVE"),
9022                Self::UnknownValue(u) => u.0.name(),
9023            }
9024        }
9025    }
9026
9027    impl std::default::Default for State {
9028        fn default() -> Self {
9029            use std::convert::From;
9030            Self::from(0)
9031        }
9032    }
9033
9034    impl std::fmt::Display for State {
9035        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9036            wkt::internal::display_enum(f, self.name(), self.value())
9037        }
9038    }
9039
9040    impl std::convert::From<i32> for State {
9041        fn from(value: i32) -> Self {
9042            match value {
9043                0 => Self::Unspecified,
9044                1 => Self::Creating,
9045                2 => Self::Active,
9046                3 => Self::Deleting,
9047                4 => Self::Inactive,
9048                _ => Self::UnknownValue(state::UnknownValue(
9049                    wkt::internal::UnknownEnumValue::Integer(value),
9050                )),
9051            }
9052        }
9053    }
9054
9055    impl std::convert::From<&str> for State {
9056        fn from(value: &str) -> Self {
9057            use std::string::ToString;
9058            match value {
9059                "STATE_UNSPECIFIED" => Self::Unspecified,
9060                "CREATING" => Self::Creating,
9061                "ACTIVE" => Self::Active,
9062                "DELETING" => Self::Deleting,
9063                "INACTIVE" => Self::Inactive,
9064                _ => Self::UnknownValue(state::UnknownValue(
9065                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9066                )),
9067            }
9068        }
9069    }
9070
9071    impl serde::ser::Serialize for State {
9072        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9073        where
9074            S: serde::Serializer,
9075        {
9076            match self {
9077                Self::Unspecified => serializer.serialize_i32(0),
9078                Self::Creating => serializer.serialize_i32(1),
9079                Self::Active => serializer.serialize_i32(2),
9080                Self::Deleting => serializer.serialize_i32(3),
9081                Self::Inactive => serializer.serialize_i32(4),
9082                Self::UnknownValue(u) => u.0.serialize(serializer),
9083            }
9084        }
9085    }
9086
9087    impl<'de> serde::de::Deserialize<'de> for State {
9088        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9089        where
9090            D: serde::Deserializer<'de>,
9091        {
9092            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9093                ".google.cloud.networksecurity.v1.FirewallEndpoint.State",
9094            ))
9095        }
9096    }
9097}
9098
9099/// Message for requesting list of Endpoints
9100#[derive(Clone, Default, PartialEq)]
9101#[non_exhaustive]
9102pub struct ListFirewallEndpointsRequest {
9103    /// Required. Parent value for ListEndpointsRequest
9104    pub parent: std::string::String,
9105
9106    /// Optional. Requested page size. Server may return fewer items than
9107    /// requested. If unspecified, server will pick an appropriate default.
9108    pub page_size: i32,
9109
9110    /// A token identifying a page of results the server should return.
9111    pub page_token: std::string::String,
9112
9113    /// Optional. Filtering results
9114    pub filter: std::string::String,
9115
9116    /// Hint for how to order the results
9117    pub order_by: std::string::String,
9118
9119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9120}
9121
9122impl ListFirewallEndpointsRequest {
9123    /// Creates a new default instance.
9124    pub fn new() -> Self {
9125        std::default::Default::default()
9126    }
9127
9128    /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
9129    ///
9130    /// # Example
9131    /// ```ignore,no_run
9132    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9133    /// # let organization_id = "organization_id";
9134    /// # let location_id = "location_id";
9135    /// let x = ListFirewallEndpointsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
9136    /// ```
9137    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9138        self.parent = v.into();
9139        self
9140    }
9141
9142    /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
9143    ///
9144    /// # Example
9145    /// ```ignore,no_run
9146    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9147    /// let x = ListFirewallEndpointsRequest::new().set_page_size(42);
9148    /// ```
9149    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9150        self.page_size = v.into();
9151        self
9152    }
9153
9154    /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
9155    ///
9156    /// # Example
9157    /// ```ignore,no_run
9158    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9159    /// let x = ListFirewallEndpointsRequest::new().set_page_token("example");
9160    /// ```
9161    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9162        self.page_token = v.into();
9163        self
9164    }
9165
9166    /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
9167    ///
9168    /// # Example
9169    /// ```ignore,no_run
9170    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9171    /// let x = ListFirewallEndpointsRequest::new().set_filter("example");
9172    /// ```
9173    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9174        self.filter = v.into();
9175        self
9176    }
9177
9178    /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
9179    ///
9180    /// # Example
9181    /// ```ignore,no_run
9182    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9183    /// let x = ListFirewallEndpointsRequest::new().set_order_by("example");
9184    /// ```
9185    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9186        self.order_by = v.into();
9187        self
9188    }
9189}
9190
9191impl wkt::message::Message for ListFirewallEndpointsRequest {
9192    fn typename() -> &'static str {
9193        "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsRequest"
9194    }
9195}
9196
9197/// Message for response to listing Endpoints
9198#[derive(Clone, Default, PartialEq)]
9199#[non_exhaustive]
9200pub struct ListFirewallEndpointsResponse {
9201    /// The list of Endpoint
9202    pub firewall_endpoints: std::vec::Vec<crate::model::FirewallEndpoint>,
9203
9204    /// A token identifying a page of results the server should return.
9205    pub next_page_token: std::string::String,
9206
9207    /// Locations that could not be reached.
9208    pub unreachable: std::vec::Vec<std::string::String>,
9209
9210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9211}
9212
9213impl ListFirewallEndpointsResponse {
9214    /// Creates a new default instance.
9215    pub fn new() -> Self {
9216        std::default::Default::default()
9217    }
9218
9219    /// Sets the value of [firewall_endpoints][crate::model::ListFirewallEndpointsResponse::firewall_endpoints].
9220    ///
9221    /// # Example
9222    /// ```ignore,no_run
9223    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9224    /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9225    /// let x = ListFirewallEndpointsResponse::new()
9226    ///     .set_firewall_endpoints([
9227    ///         FirewallEndpoint::default()/* use setters */,
9228    ///         FirewallEndpoint::default()/* use (different) setters */,
9229    ///     ]);
9230    /// ```
9231    pub fn set_firewall_endpoints<T, V>(mut self, v: T) -> Self
9232    where
9233        T: std::iter::IntoIterator<Item = V>,
9234        V: std::convert::Into<crate::model::FirewallEndpoint>,
9235    {
9236        use std::iter::Iterator;
9237        self.firewall_endpoints = v.into_iter().map(|i| i.into()).collect();
9238        self
9239    }
9240
9241    /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointsResponse::next_page_token].
9242    ///
9243    /// # Example
9244    /// ```ignore,no_run
9245    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9246    /// let x = ListFirewallEndpointsResponse::new().set_next_page_token("example");
9247    /// ```
9248    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9249        self.next_page_token = v.into();
9250        self
9251    }
9252
9253    /// Sets the value of [unreachable][crate::model::ListFirewallEndpointsResponse::unreachable].
9254    ///
9255    /// # Example
9256    /// ```ignore,no_run
9257    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9258    /// let x = ListFirewallEndpointsResponse::new().set_unreachable(["a", "b", "c"]);
9259    /// ```
9260    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9261    where
9262        T: std::iter::IntoIterator<Item = V>,
9263        V: std::convert::Into<std::string::String>,
9264    {
9265        use std::iter::Iterator;
9266        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9267        self
9268    }
9269}
9270
9271impl wkt::message::Message for ListFirewallEndpointsResponse {
9272    fn typename() -> &'static str {
9273        "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsResponse"
9274    }
9275}
9276
9277#[doc(hidden)]
9278impl google_cloud_gax::paginator::internal::PageableResponse for ListFirewallEndpointsResponse {
9279    type PageItem = crate::model::FirewallEndpoint;
9280
9281    fn items(self) -> std::vec::Vec<Self::PageItem> {
9282        self.firewall_endpoints
9283    }
9284
9285    fn next_page_token(&self) -> std::string::String {
9286        use std::clone::Clone;
9287        self.next_page_token.clone()
9288    }
9289}
9290
9291/// Message for getting a Endpoint
9292#[derive(Clone, Default, PartialEq)]
9293#[non_exhaustive]
9294pub struct GetFirewallEndpointRequest {
9295    /// Required. Name of the resource
9296    pub name: std::string::String,
9297
9298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9299}
9300
9301impl GetFirewallEndpointRequest {
9302    /// Creates a new default instance.
9303    pub fn new() -> Self {
9304        std::default::Default::default()
9305    }
9306
9307    /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
9308    ///
9309    /// # Example
9310    /// ```ignore,no_run
9311    /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointRequest;
9312    /// # let organization_id = "organization_id";
9313    /// # let location_id = "location_id";
9314    /// # let firewall_endpoint_id = "firewall_endpoint_id";
9315    /// let x = GetFirewallEndpointRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
9316    /// ```
9317    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318        self.name = v.into();
9319        self
9320    }
9321}
9322
9323impl wkt::message::Message for GetFirewallEndpointRequest {
9324    fn typename() -> &'static str {
9325        "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointRequest"
9326    }
9327}
9328
9329/// Message for creating a Endpoint
9330#[derive(Clone, Default, PartialEq)]
9331#[non_exhaustive]
9332pub struct CreateFirewallEndpointRequest {
9333    /// Required. Value for parent.
9334    pub parent: std::string::String,
9335
9336    /// Required. Id of the requesting object.
9337    /// If auto-generating Id server-side, remove this field and
9338    /// firewall_endpoint_id from the method_signature of Create RPC.
9339    pub firewall_endpoint_id: std::string::String,
9340
9341    /// Required. The resource being created
9342    pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9343
9344    /// Optional. An optional request ID to identify requests. Specify a unique
9345    /// request ID so that if you must retry your request, the server will know to
9346    /// ignore the request if it has already been completed. The server will
9347    /// guarantee that for at least 60 minutes since the first request.
9348    ///
9349    /// For example, consider a situation where you make an initial request and
9350    /// the request times out. If you make the request again with the same request
9351    /// ID, the server can check if original operation with the same request ID
9352    /// was received, and if so, will ignore the second request. This prevents
9353    /// clients from accidentally creating duplicate commitments.
9354    ///
9355    /// The request ID must be a valid UUID with the exception that zero UUID is
9356    /// not supported (00000000-0000-0000-0000-000000000000).
9357    pub request_id: std::string::String,
9358
9359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9360}
9361
9362impl CreateFirewallEndpointRequest {
9363    /// Creates a new default instance.
9364    pub fn new() -> Self {
9365        std::default::Default::default()
9366    }
9367
9368    /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
9369    ///
9370    /// # Example
9371    /// ```ignore,no_run
9372    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9373    /// # let organization_id = "organization_id";
9374    /// # let location_id = "location_id";
9375    /// let x = CreateFirewallEndpointRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
9376    /// ```
9377    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9378        self.parent = v.into();
9379        self
9380    }
9381
9382    /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
9383    ///
9384    /// # Example
9385    /// ```ignore,no_run
9386    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9387    /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint_id("example");
9388    /// ```
9389    pub fn set_firewall_endpoint_id<T: std::convert::Into<std::string::String>>(
9390        mut self,
9391        v: T,
9392    ) -> Self {
9393        self.firewall_endpoint_id = v.into();
9394        self
9395    }
9396
9397    /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9398    ///
9399    /// # Example
9400    /// ```ignore,no_run
9401    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9402    /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9403    /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9404    /// ```
9405    pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9406    where
9407        T: std::convert::Into<crate::model::FirewallEndpoint>,
9408    {
9409        self.firewall_endpoint = std::option::Option::Some(v.into());
9410        self
9411    }
9412
9413    /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9414    ///
9415    /// # Example
9416    /// ```ignore,no_run
9417    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9418    /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9419    /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9420    /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9421    /// ```
9422    pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9423    where
9424        T: std::convert::Into<crate::model::FirewallEndpoint>,
9425    {
9426        self.firewall_endpoint = v.map(|x| x.into());
9427        self
9428    }
9429
9430    /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
9431    ///
9432    /// # Example
9433    /// ```ignore,no_run
9434    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9435    /// let x = CreateFirewallEndpointRequest::new().set_request_id("example");
9436    /// ```
9437    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9438        self.request_id = v.into();
9439        self
9440    }
9441}
9442
9443impl wkt::message::Message for CreateFirewallEndpointRequest {
9444    fn typename() -> &'static str {
9445        "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointRequest"
9446    }
9447}
9448
9449/// Message for updating a Endpoint
9450#[derive(Clone, Default, PartialEq)]
9451#[non_exhaustive]
9452pub struct UpdateFirewallEndpointRequest {
9453    /// Required. Field mask is used to specify the fields to be overwritten in the
9454    /// Endpoint resource by the update.
9455    /// The fields specified in the update_mask are relative to the resource, not
9456    /// the full request. A field will be overwritten if it is in the mask. If the
9457    /// user does not provide a mask then all fields will be overwritten.
9458    pub update_mask: std::option::Option<wkt::FieldMask>,
9459
9460    /// Required. The resource being updated
9461    pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9462
9463    /// Optional. An optional request ID to identify requests. Specify a unique
9464    /// request ID so that if you must retry your request, the server will know to
9465    /// ignore the request if it has already been completed. The server will
9466    /// guarantee that for at least 60 minutes since the first request.
9467    ///
9468    /// For example, consider a situation where you make an initial request and
9469    /// the request times out. If you make the request again with the same request
9470    /// ID, the server can check if original operation with the same request ID
9471    /// was received, and if so, will ignore the second request. This prevents
9472    /// clients from accidentally creating duplicate commitments.
9473    ///
9474    /// The request ID must be a valid UUID with the exception that zero UUID is
9475    /// not supported (00000000-0000-0000-0000-000000000000).
9476    pub request_id: std::string::String,
9477
9478    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9479}
9480
9481impl UpdateFirewallEndpointRequest {
9482    /// Creates a new default instance.
9483    pub fn new() -> Self {
9484        std::default::Default::default()
9485    }
9486
9487    /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9488    ///
9489    /// # Example
9490    /// ```ignore,no_run
9491    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9492    /// use wkt::FieldMask;
9493    /// let x = UpdateFirewallEndpointRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9494    /// ```
9495    pub fn set_update_mask<T>(mut self, v: T) -> Self
9496    where
9497        T: std::convert::Into<wkt::FieldMask>,
9498    {
9499        self.update_mask = std::option::Option::Some(v.into());
9500        self
9501    }
9502
9503    /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9504    ///
9505    /// # Example
9506    /// ```ignore,no_run
9507    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9508    /// use wkt::FieldMask;
9509    /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9510    /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9511    /// ```
9512    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9513    where
9514        T: std::convert::Into<wkt::FieldMask>,
9515    {
9516        self.update_mask = v.map(|x| x.into());
9517        self
9518    }
9519
9520    /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9521    ///
9522    /// # Example
9523    /// ```ignore,no_run
9524    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9525    /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9526    /// let x = UpdateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9527    /// ```
9528    pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9529    where
9530        T: std::convert::Into<crate::model::FirewallEndpoint>,
9531    {
9532        self.firewall_endpoint = std::option::Option::Some(v.into());
9533        self
9534    }
9535
9536    /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9537    ///
9538    /// # Example
9539    /// ```ignore,no_run
9540    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9541    /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9542    /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9543    /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9544    /// ```
9545    pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9546    where
9547        T: std::convert::Into<crate::model::FirewallEndpoint>,
9548    {
9549        self.firewall_endpoint = v.map(|x| x.into());
9550        self
9551    }
9552
9553    /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
9554    ///
9555    /// # Example
9556    /// ```ignore,no_run
9557    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9558    /// let x = UpdateFirewallEndpointRequest::new().set_request_id("example");
9559    /// ```
9560    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9561        self.request_id = v.into();
9562        self
9563    }
9564}
9565
9566impl wkt::message::Message for UpdateFirewallEndpointRequest {
9567    fn typename() -> &'static str {
9568        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest"
9569    }
9570}
9571
9572/// Message for deleting a Endpoint
9573#[derive(Clone, Default, PartialEq)]
9574#[non_exhaustive]
9575pub struct DeleteFirewallEndpointRequest {
9576    /// Required. Name of the resource
9577    pub name: std::string::String,
9578
9579    /// Optional. An optional request ID to identify requests. Specify a unique
9580    /// request ID so that if you must retry your request, the server will know to
9581    /// ignore the request if it has already been completed. The server will
9582    /// guarantee that for at least 60 minutes after the first request.
9583    ///
9584    /// For example, consider a situation where you make an initial request and
9585    /// the request times out. If you make the request again with the same request
9586    /// ID, the server can check if original operation with the same request ID
9587    /// was received, and if so, will ignore the second request. This prevents
9588    /// clients from accidentally creating duplicate commitments.
9589    ///
9590    /// The request ID must be a valid UUID with the exception that zero UUID is
9591    /// not supported (00000000-0000-0000-0000-000000000000).
9592    pub request_id: std::string::String,
9593
9594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9595}
9596
9597impl DeleteFirewallEndpointRequest {
9598    /// Creates a new default instance.
9599    pub fn new() -> Self {
9600        std::default::Default::default()
9601    }
9602
9603    /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
9604    ///
9605    /// # Example
9606    /// ```ignore,no_run
9607    /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9608    /// # let organization_id = "organization_id";
9609    /// # let location_id = "location_id";
9610    /// # let firewall_endpoint_id = "firewall_endpoint_id";
9611    /// let x = DeleteFirewallEndpointRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
9612    /// ```
9613    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9614        self.name = v.into();
9615        self
9616    }
9617
9618    /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
9619    ///
9620    /// # Example
9621    /// ```ignore,no_run
9622    /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9623    /// let x = DeleteFirewallEndpointRequest::new().set_request_id("example");
9624    /// ```
9625    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9626        self.request_id = v.into();
9627        self
9628    }
9629}
9630
9631impl wkt::message::Message for DeleteFirewallEndpointRequest {
9632    fn typename() -> &'static str {
9633        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest"
9634    }
9635}
9636
9637/// Message describing Association object
9638#[derive(Clone, Default, PartialEq)]
9639#[non_exhaustive]
9640pub struct FirewallEndpointAssociation {
9641    /// Immutable. Identifier. name of resource
9642    pub name: std::string::String,
9643
9644    /// Output only. Create time stamp
9645    pub create_time: std::option::Option<wkt::Timestamp>,
9646
9647    /// Output only. Update time stamp
9648    pub update_time: std::option::Option<wkt::Timestamp>,
9649
9650    /// Optional. Labels as key value pairs
9651    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9652
9653    /// Output only. Current state of the association.
9654    pub state: crate::model::firewall_endpoint_association::State,
9655
9656    /// Required. The URL of the network that is being associated.
9657    pub network: std::string::String,
9658
9659    /// Required. The URL of the FirewallEndpoint that is being associated.
9660    pub firewall_endpoint: std::string::String,
9661
9662    /// Optional. The URL of the TlsInspectionPolicy that is being associated.
9663    pub tls_inspection_policy: std::string::String,
9664
9665    /// Output only. Whether reconciling is in progress, recommended per
9666    /// <https://google.aip.dev/128>.
9667    pub reconciling: bool,
9668
9669    /// Optional. Whether the association is disabled.
9670    /// True indicates that traffic won't be intercepted
9671    pub disabled: bool,
9672
9673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9674}
9675
9676impl FirewallEndpointAssociation {
9677    /// Creates a new default instance.
9678    pub fn new() -> Self {
9679        std::default::Default::default()
9680    }
9681
9682    /// Sets the value of [name][crate::model::FirewallEndpointAssociation::name].
9683    ///
9684    /// # Example
9685    /// ```ignore,no_run
9686    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9687    /// # let project_id = "project_id";
9688    /// # let location_id = "location_id";
9689    /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
9690    /// let x = FirewallEndpointAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
9691    /// ```
9692    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9693        self.name = v.into();
9694        self
9695    }
9696
9697    /// Sets the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9698    ///
9699    /// # Example
9700    /// ```ignore,no_run
9701    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9702    /// use wkt::Timestamp;
9703    /// let x = FirewallEndpointAssociation::new().set_create_time(Timestamp::default()/* use setters */);
9704    /// ```
9705    pub fn set_create_time<T>(mut self, v: T) -> Self
9706    where
9707        T: std::convert::Into<wkt::Timestamp>,
9708    {
9709        self.create_time = std::option::Option::Some(v.into());
9710        self
9711    }
9712
9713    /// Sets or clears the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9714    ///
9715    /// # Example
9716    /// ```ignore,no_run
9717    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9718    /// use wkt::Timestamp;
9719    /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9720    /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(None::<Timestamp>);
9721    /// ```
9722    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9723    where
9724        T: std::convert::Into<wkt::Timestamp>,
9725    {
9726        self.create_time = v.map(|x| x.into());
9727        self
9728    }
9729
9730    /// Sets the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9731    ///
9732    /// # Example
9733    /// ```ignore,no_run
9734    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9735    /// use wkt::Timestamp;
9736    /// let x = FirewallEndpointAssociation::new().set_update_time(Timestamp::default()/* use setters */);
9737    /// ```
9738    pub fn set_update_time<T>(mut self, v: T) -> Self
9739    where
9740        T: std::convert::Into<wkt::Timestamp>,
9741    {
9742        self.update_time = std::option::Option::Some(v.into());
9743        self
9744    }
9745
9746    /// Sets or clears the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9747    ///
9748    /// # Example
9749    /// ```ignore,no_run
9750    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9751    /// use wkt::Timestamp;
9752    /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9753    /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(None::<Timestamp>);
9754    /// ```
9755    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9756    where
9757        T: std::convert::Into<wkt::Timestamp>,
9758    {
9759        self.update_time = v.map(|x| x.into());
9760        self
9761    }
9762
9763    /// Sets the value of [labels][crate::model::FirewallEndpointAssociation::labels].
9764    ///
9765    /// # Example
9766    /// ```ignore,no_run
9767    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9768    /// let x = FirewallEndpointAssociation::new().set_labels([
9769    ///     ("key0", "abc"),
9770    ///     ("key1", "xyz"),
9771    /// ]);
9772    /// ```
9773    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9774    where
9775        T: std::iter::IntoIterator<Item = (K, V)>,
9776        K: std::convert::Into<std::string::String>,
9777        V: std::convert::Into<std::string::String>,
9778    {
9779        use std::iter::Iterator;
9780        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9781        self
9782    }
9783
9784    /// Sets the value of [state][crate::model::FirewallEndpointAssociation::state].
9785    ///
9786    /// # Example
9787    /// ```ignore,no_run
9788    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9789    /// use google_cloud_networksecurity_v1::model::firewall_endpoint_association::State;
9790    /// let x0 = FirewallEndpointAssociation::new().set_state(State::Creating);
9791    /// let x1 = FirewallEndpointAssociation::new().set_state(State::Active);
9792    /// let x2 = FirewallEndpointAssociation::new().set_state(State::Deleting);
9793    /// ```
9794    pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint_association::State>>(
9795        mut self,
9796        v: T,
9797    ) -> Self {
9798        self.state = v.into();
9799        self
9800    }
9801
9802    /// Sets the value of [network][crate::model::FirewallEndpointAssociation::network].
9803    ///
9804    /// # Example
9805    /// ```ignore,no_run
9806    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9807    /// let x = FirewallEndpointAssociation::new().set_network("example");
9808    /// ```
9809    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9810        self.network = v.into();
9811        self
9812    }
9813
9814    /// Sets the value of [firewall_endpoint][crate::model::FirewallEndpointAssociation::firewall_endpoint].
9815    ///
9816    /// # Example
9817    /// ```ignore,no_run
9818    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9819    /// let x = FirewallEndpointAssociation::new().set_firewall_endpoint("example");
9820    /// ```
9821    pub fn set_firewall_endpoint<T: std::convert::Into<std::string::String>>(
9822        mut self,
9823        v: T,
9824    ) -> Self {
9825        self.firewall_endpoint = v.into();
9826        self
9827    }
9828
9829    /// Sets the value of [tls_inspection_policy][crate::model::FirewallEndpointAssociation::tls_inspection_policy].
9830    ///
9831    /// # Example
9832    /// ```ignore,no_run
9833    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9834    /// # let project_id = "project_id";
9835    /// # let location_id = "location_id";
9836    /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
9837    /// let x = FirewallEndpointAssociation::new().set_tls_inspection_policy(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
9838    /// ```
9839    pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
9840        mut self,
9841        v: T,
9842    ) -> Self {
9843        self.tls_inspection_policy = v.into();
9844        self
9845    }
9846
9847    /// Sets the value of [reconciling][crate::model::FirewallEndpointAssociation::reconciling].
9848    ///
9849    /// # Example
9850    /// ```ignore,no_run
9851    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9852    /// let x = FirewallEndpointAssociation::new().set_reconciling(true);
9853    /// ```
9854    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9855        self.reconciling = v.into();
9856        self
9857    }
9858
9859    /// Sets the value of [disabled][crate::model::FirewallEndpointAssociation::disabled].
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9864    /// let x = FirewallEndpointAssociation::new().set_disabled(true);
9865    /// ```
9866    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9867        self.disabled = v.into();
9868        self
9869    }
9870}
9871
9872impl wkt::message::Message for FirewallEndpointAssociation {
9873    fn typename() -> &'static str {
9874        "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpointAssociation"
9875    }
9876}
9877
9878/// Defines additional types related to [FirewallEndpointAssociation].
9879pub mod firewall_endpoint_association {
9880    #[allow(unused_imports)]
9881    use super::*;
9882
9883    /// Association state.
9884    ///
9885    /// # Working with unknown values
9886    ///
9887    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9888    /// additional enum variants at any time. Adding new variants is not considered
9889    /// a breaking change. Applications should write their code in anticipation of:
9890    ///
9891    /// - New values appearing in future releases of the client library, **and**
9892    /// - New values received dynamically, without application changes.
9893    ///
9894    /// Please consult the [Working with enums] section in the user guide for some
9895    /// guidelines.
9896    ///
9897    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9898    #[derive(Clone, Debug, PartialEq)]
9899    #[non_exhaustive]
9900    pub enum State {
9901        /// Not set.
9902        Unspecified,
9903        /// Being created.
9904        Creating,
9905        /// Active and ready for traffic.
9906        Active,
9907        /// Being deleted.
9908        Deleting,
9909        /// Down or in an error state.
9910        Inactive,
9911        /// The project that housed the association has been deleted.
9912        Orphan,
9913        /// If set, the enum was initialized with an unknown value.
9914        ///
9915        /// Applications can examine the value using [State::value] or
9916        /// [State::name].
9917        UnknownValue(state::UnknownValue),
9918    }
9919
9920    #[doc(hidden)]
9921    pub mod state {
9922        #[allow(unused_imports)]
9923        use super::*;
9924        #[derive(Clone, Debug, PartialEq)]
9925        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9926    }
9927
9928    impl State {
9929        /// Gets the enum value.
9930        ///
9931        /// Returns `None` if the enum contains an unknown value deserialized from
9932        /// the string representation of enums.
9933        pub fn value(&self) -> std::option::Option<i32> {
9934            match self {
9935                Self::Unspecified => std::option::Option::Some(0),
9936                Self::Creating => std::option::Option::Some(1),
9937                Self::Active => std::option::Option::Some(2),
9938                Self::Deleting => std::option::Option::Some(3),
9939                Self::Inactive => std::option::Option::Some(4),
9940                Self::Orphan => std::option::Option::Some(5),
9941                Self::UnknownValue(u) => u.0.value(),
9942            }
9943        }
9944
9945        /// Gets the enum value as a string.
9946        ///
9947        /// Returns `None` if the enum contains an unknown value deserialized from
9948        /// the integer representation of enums.
9949        pub fn name(&self) -> std::option::Option<&str> {
9950            match self {
9951                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9952                Self::Creating => std::option::Option::Some("CREATING"),
9953                Self::Active => std::option::Option::Some("ACTIVE"),
9954                Self::Deleting => std::option::Option::Some("DELETING"),
9955                Self::Inactive => std::option::Option::Some("INACTIVE"),
9956                Self::Orphan => std::option::Option::Some("ORPHAN"),
9957                Self::UnknownValue(u) => u.0.name(),
9958            }
9959        }
9960    }
9961
9962    impl std::default::Default for State {
9963        fn default() -> Self {
9964            use std::convert::From;
9965            Self::from(0)
9966        }
9967    }
9968
9969    impl std::fmt::Display for State {
9970        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9971            wkt::internal::display_enum(f, self.name(), self.value())
9972        }
9973    }
9974
9975    impl std::convert::From<i32> for State {
9976        fn from(value: i32) -> Self {
9977            match value {
9978                0 => Self::Unspecified,
9979                1 => Self::Creating,
9980                2 => Self::Active,
9981                3 => Self::Deleting,
9982                4 => Self::Inactive,
9983                5 => Self::Orphan,
9984                _ => Self::UnknownValue(state::UnknownValue(
9985                    wkt::internal::UnknownEnumValue::Integer(value),
9986                )),
9987            }
9988        }
9989    }
9990
9991    impl std::convert::From<&str> for State {
9992        fn from(value: &str) -> Self {
9993            use std::string::ToString;
9994            match value {
9995                "STATE_UNSPECIFIED" => Self::Unspecified,
9996                "CREATING" => Self::Creating,
9997                "ACTIVE" => Self::Active,
9998                "DELETING" => Self::Deleting,
9999                "INACTIVE" => Self::Inactive,
10000                "ORPHAN" => Self::Orphan,
10001                _ => Self::UnknownValue(state::UnknownValue(
10002                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10003                )),
10004            }
10005        }
10006    }
10007
10008    impl serde::ser::Serialize for State {
10009        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10010        where
10011            S: serde::Serializer,
10012        {
10013            match self {
10014                Self::Unspecified => serializer.serialize_i32(0),
10015                Self::Creating => serializer.serialize_i32(1),
10016                Self::Active => serializer.serialize_i32(2),
10017                Self::Deleting => serializer.serialize_i32(3),
10018                Self::Inactive => serializer.serialize_i32(4),
10019                Self::Orphan => serializer.serialize_i32(5),
10020                Self::UnknownValue(u) => u.0.serialize(serializer),
10021            }
10022        }
10023    }
10024
10025    impl<'de> serde::de::Deserialize<'de> for State {
10026        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10027        where
10028            D: serde::Deserializer<'de>,
10029        {
10030            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10031                ".google.cloud.networksecurity.v1.FirewallEndpointAssociation.State",
10032            ))
10033        }
10034    }
10035}
10036
10037/// Message for requesting list of Associations
10038#[derive(Clone, Default, PartialEq)]
10039#[non_exhaustive]
10040pub struct ListFirewallEndpointAssociationsRequest {
10041    /// Required. Parent value for ListAssociationsRequest
10042    pub parent: std::string::String,
10043
10044    /// Optional. Requested page size. Server may return fewer items than
10045    /// requested. If unspecified, server will pick an appropriate default.
10046    pub page_size: i32,
10047
10048    /// A token identifying a page of results the server should return.
10049    pub page_token: std::string::String,
10050
10051    /// Optional. Filtering results
10052    pub filter: std::string::String,
10053
10054    /// Hint for how to order the results
10055    pub order_by: std::string::String,
10056
10057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10058}
10059
10060impl ListFirewallEndpointAssociationsRequest {
10061    /// Creates a new default instance.
10062    pub fn new() -> Self {
10063        std::default::Default::default()
10064    }
10065
10066    /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
10067    ///
10068    /// # Example
10069    /// ```ignore,no_run
10070    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10071    /// # let project_id = "project_id";
10072    /// # let location_id = "location_id";
10073    /// let x = ListFirewallEndpointAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10074    /// ```
10075    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10076        self.parent = v.into();
10077        self
10078    }
10079
10080    /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
10081    ///
10082    /// # Example
10083    /// ```ignore,no_run
10084    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10085    /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_size(42);
10086    /// ```
10087    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10088        self.page_size = v.into();
10089        self
10090    }
10091
10092    /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
10093    ///
10094    /// # Example
10095    /// ```ignore,no_run
10096    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10097    /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_token("example");
10098    /// ```
10099    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10100        self.page_token = v.into();
10101        self
10102    }
10103
10104    /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
10105    ///
10106    /// # Example
10107    /// ```ignore,no_run
10108    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10109    /// let x = ListFirewallEndpointAssociationsRequest::new().set_filter("example");
10110    /// ```
10111    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10112        self.filter = v.into();
10113        self
10114    }
10115
10116    /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
10117    ///
10118    /// # Example
10119    /// ```ignore,no_run
10120    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10121    /// let x = ListFirewallEndpointAssociationsRequest::new().set_order_by("example");
10122    /// ```
10123    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10124        self.order_by = v.into();
10125        self
10126    }
10127}
10128
10129impl wkt::message::Message for ListFirewallEndpointAssociationsRequest {
10130    fn typename() -> &'static str {
10131        "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest"
10132    }
10133}
10134
10135/// Message for response to listing Associations
10136#[derive(Clone, Default, PartialEq)]
10137#[non_exhaustive]
10138pub struct ListFirewallEndpointAssociationsResponse {
10139    /// The list of Association
10140    pub firewall_endpoint_associations: std::vec::Vec<crate::model::FirewallEndpointAssociation>,
10141
10142    /// A token identifying a page of results the server should return.
10143    pub next_page_token: std::string::String,
10144
10145    /// Locations that could not be reached.
10146    pub unreachable: std::vec::Vec<std::string::String>,
10147
10148    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10149}
10150
10151impl ListFirewallEndpointAssociationsResponse {
10152    /// Creates a new default instance.
10153    pub fn new() -> Self {
10154        std::default::Default::default()
10155    }
10156
10157    /// Sets the value of [firewall_endpoint_associations][crate::model::ListFirewallEndpointAssociationsResponse::firewall_endpoint_associations].
10158    ///
10159    /// # Example
10160    /// ```ignore,no_run
10161    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10162    /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10163    /// let x = ListFirewallEndpointAssociationsResponse::new()
10164    ///     .set_firewall_endpoint_associations([
10165    ///         FirewallEndpointAssociation::default()/* use setters */,
10166    ///         FirewallEndpointAssociation::default()/* use (different) setters */,
10167    ///     ]);
10168    /// ```
10169    pub fn set_firewall_endpoint_associations<T, V>(mut self, v: T) -> Self
10170    where
10171        T: std::iter::IntoIterator<Item = V>,
10172        V: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10173    {
10174        use std::iter::Iterator;
10175        self.firewall_endpoint_associations = v.into_iter().map(|i| i.into()).collect();
10176        self
10177    }
10178
10179    /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointAssociationsResponse::next_page_token].
10180    ///
10181    /// # Example
10182    /// ```ignore,no_run
10183    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10184    /// let x = ListFirewallEndpointAssociationsResponse::new().set_next_page_token("example");
10185    /// ```
10186    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10187        self.next_page_token = v.into();
10188        self
10189    }
10190
10191    /// Sets the value of [unreachable][crate::model::ListFirewallEndpointAssociationsResponse::unreachable].
10192    ///
10193    /// # Example
10194    /// ```ignore,no_run
10195    /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10196    /// let x = ListFirewallEndpointAssociationsResponse::new().set_unreachable(["a", "b", "c"]);
10197    /// ```
10198    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10199    where
10200        T: std::iter::IntoIterator<Item = V>,
10201        V: std::convert::Into<std::string::String>,
10202    {
10203        use std::iter::Iterator;
10204        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10205        self
10206    }
10207}
10208
10209impl wkt::message::Message for ListFirewallEndpointAssociationsResponse {
10210    fn typename() -> &'static str {
10211        "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse"
10212    }
10213}
10214
10215#[doc(hidden)]
10216impl google_cloud_gax::paginator::internal::PageableResponse
10217    for ListFirewallEndpointAssociationsResponse
10218{
10219    type PageItem = crate::model::FirewallEndpointAssociation;
10220
10221    fn items(self) -> std::vec::Vec<Self::PageItem> {
10222        self.firewall_endpoint_associations
10223    }
10224
10225    fn next_page_token(&self) -> std::string::String {
10226        use std::clone::Clone;
10227        self.next_page_token.clone()
10228    }
10229}
10230
10231/// Message for getting a Association
10232#[derive(Clone, Default, PartialEq)]
10233#[non_exhaustive]
10234pub struct GetFirewallEndpointAssociationRequest {
10235    /// Required. Name of the resource
10236    pub name: std::string::String,
10237
10238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10239}
10240
10241impl GetFirewallEndpointAssociationRequest {
10242    /// Creates a new default instance.
10243    pub fn new() -> Self {
10244        std::default::Default::default()
10245    }
10246
10247    /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
10248    ///
10249    /// # Example
10250    /// ```ignore,no_run
10251    /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointAssociationRequest;
10252    /// # let project_id = "project_id";
10253    /// # let location_id = "location_id";
10254    /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
10255    /// let x = GetFirewallEndpointAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
10256    /// ```
10257    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10258        self.name = v.into();
10259        self
10260    }
10261}
10262
10263impl wkt::message::Message for GetFirewallEndpointAssociationRequest {
10264    fn typename() -> &'static str {
10265        "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest"
10266    }
10267}
10268
10269/// Message for creating a Association
10270#[derive(Clone, Default, PartialEq)]
10271#[non_exhaustive]
10272pub struct CreateFirewallEndpointAssociationRequest {
10273    /// Required. Value for parent.
10274    pub parent: std::string::String,
10275
10276    /// Optional. Id of the requesting object.
10277    /// If auto-generating Id server-side, remove this field and
10278    /// firewall_endpoint_association_id from the method_signature of Create RPC.
10279    pub firewall_endpoint_association_id: std::string::String,
10280
10281    /// Required. The resource being created
10282    pub firewall_endpoint_association:
10283        std::option::Option<crate::model::FirewallEndpointAssociation>,
10284
10285    /// Optional. An optional request ID to identify requests. Specify a unique
10286    /// request ID so that if you must retry your request, the server will know to
10287    /// ignore the request if it has already been completed. The server will
10288    /// guarantee that for at least 60 minutes since the first request.
10289    ///
10290    /// For example, consider a situation where you make an initial request and
10291    /// the request times out. If you make the request again with the same request
10292    /// ID, the server can check if original operation with the same request ID
10293    /// was received, and if so, will ignore the second request. This prevents
10294    /// clients from accidentally creating duplicate commitments.
10295    ///
10296    /// The request ID must be a valid UUID with the exception that zero UUID is
10297    /// not supported (00000000-0000-0000-0000-000000000000).
10298    pub request_id: std::string::String,
10299
10300    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10301}
10302
10303impl CreateFirewallEndpointAssociationRequest {
10304    /// Creates a new default instance.
10305    pub fn new() -> Self {
10306        std::default::Default::default()
10307    }
10308
10309    /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
10310    ///
10311    /// # Example
10312    /// ```ignore,no_run
10313    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10314    /// # let project_id = "project_id";
10315    /// # let location_id = "location_id";
10316    /// let x = CreateFirewallEndpointAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10317    /// ```
10318    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10319        self.parent = v.into();
10320        self
10321    }
10322
10323    /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
10324    ///
10325    /// # Example
10326    /// ```ignore,no_run
10327    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10328    /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association_id("example");
10329    /// ```
10330    pub fn set_firewall_endpoint_association_id<T: std::convert::Into<std::string::String>>(
10331        mut self,
10332        v: T,
10333    ) -> Self {
10334        self.firewall_endpoint_association_id = v.into();
10335        self
10336    }
10337
10338    /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10339    ///
10340    /// # Example
10341    /// ```ignore,no_run
10342    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10343    /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10344    /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10345    /// ```
10346    pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10347    where
10348        T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10349    {
10350        self.firewall_endpoint_association = std::option::Option::Some(v.into());
10351        self
10352    }
10353
10354    /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10355    ///
10356    /// # Example
10357    /// ```ignore,no_run
10358    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10359    /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10360    /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10361    /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10362    /// ```
10363    pub fn set_or_clear_firewall_endpoint_association<T>(
10364        mut self,
10365        v: std::option::Option<T>,
10366    ) -> Self
10367    where
10368        T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10369    {
10370        self.firewall_endpoint_association = v.map(|x| x.into());
10371        self
10372    }
10373
10374    /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
10375    ///
10376    /// # Example
10377    /// ```ignore,no_run
10378    /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10379    /// let x = CreateFirewallEndpointAssociationRequest::new().set_request_id("example");
10380    /// ```
10381    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10382        self.request_id = v.into();
10383        self
10384    }
10385}
10386
10387impl wkt::message::Message for CreateFirewallEndpointAssociationRequest {
10388    fn typename() -> &'static str {
10389        "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest"
10390    }
10391}
10392
10393/// Message for deleting a Association
10394#[derive(Clone, Default, PartialEq)]
10395#[non_exhaustive]
10396pub struct DeleteFirewallEndpointAssociationRequest {
10397    /// Required. Name of the resource
10398    pub name: std::string::String,
10399
10400    /// Optional. An optional request ID to identify requests. Specify a unique
10401    /// request ID so that if you must retry your request, the server will know to
10402    /// ignore the request if it has already been completed. The server will
10403    /// guarantee that for at least 60 minutes after the first request.
10404    ///
10405    /// For example, consider a situation where you make an initial request and
10406    /// the request times out. If you make the request again with the same request
10407    /// ID, the server can check if original operation with the same request ID
10408    /// was received, and if so, will ignore the second request. This prevents
10409    /// clients from accidentally creating duplicate commitments.
10410    ///
10411    /// The request ID must be a valid UUID with the exception that zero UUID is
10412    /// not supported (00000000-0000-0000-0000-000000000000).
10413    pub request_id: std::string::String,
10414
10415    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10416}
10417
10418impl DeleteFirewallEndpointAssociationRequest {
10419    /// Creates a new default instance.
10420    pub fn new() -> Self {
10421        std::default::Default::default()
10422    }
10423
10424    /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
10425    ///
10426    /// # Example
10427    /// ```ignore,no_run
10428    /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10429    /// # let project_id = "project_id";
10430    /// # let location_id = "location_id";
10431    /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
10432    /// let x = DeleteFirewallEndpointAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
10433    /// ```
10434    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10435        self.name = v.into();
10436        self
10437    }
10438
10439    /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
10440    ///
10441    /// # Example
10442    /// ```ignore,no_run
10443    /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10444    /// let x = DeleteFirewallEndpointAssociationRequest::new().set_request_id("example");
10445    /// ```
10446    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10447        self.request_id = v.into();
10448        self
10449    }
10450}
10451
10452impl wkt::message::Message for DeleteFirewallEndpointAssociationRequest {
10453    fn typename() -> &'static str {
10454        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest"
10455    }
10456}
10457
10458/// Message for updating an Association
10459#[derive(Clone, Default, PartialEq)]
10460#[non_exhaustive]
10461pub struct UpdateFirewallEndpointAssociationRequest {
10462    /// Required. Field mask is used to specify the fields to be overwritten in the
10463    /// Association resource by the update.
10464    /// The fields specified in the update_mask are relative to the resource, not
10465    /// the full request. A field will be overwritten if it is in the mask. If the
10466    /// user does not provide a mask then all fields will be overwritten.
10467    pub update_mask: std::option::Option<wkt::FieldMask>,
10468
10469    /// Required. The resource being updated
10470    pub firewall_endpoint_association:
10471        std::option::Option<crate::model::FirewallEndpointAssociation>,
10472
10473    /// Optional. An optional request ID to identify requests. Specify a unique
10474    /// request ID so that if you must retry your request, the server will know to
10475    /// ignore the request if it has already been completed. The server will
10476    /// guarantee that for at least 60 minutes since the first request.
10477    ///
10478    /// For example, consider a situation where you make an initial request and
10479    /// the request times out. If you make the request again with the same request
10480    /// ID, the server can check if original operation with the same request ID
10481    /// was received, and if so, will ignore the second request. This prevents
10482    /// clients from accidentally creating duplicate commitments.
10483    ///
10484    /// The request ID must be a valid UUID with the exception that zero UUID is
10485    /// not supported (00000000-0000-0000-0000-000000000000).
10486    pub request_id: std::string::String,
10487
10488    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10489}
10490
10491impl UpdateFirewallEndpointAssociationRequest {
10492    /// Creates a new default instance.
10493    pub fn new() -> Self {
10494        std::default::Default::default()
10495    }
10496
10497    /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10498    ///
10499    /// # Example
10500    /// ```ignore,no_run
10501    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10502    /// use wkt::FieldMask;
10503    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10504    /// ```
10505    pub fn set_update_mask<T>(mut self, v: T) -> Self
10506    where
10507        T: std::convert::Into<wkt::FieldMask>,
10508    {
10509        self.update_mask = std::option::Option::Some(v.into());
10510        self
10511    }
10512
10513    /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10514    ///
10515    /// # Example
10516    /// ```ignore,no_run
10517    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10518    /// use wkt::FieldMask;
10519    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10520    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10521    /// ```
10522    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10523    where
10524        T: std::convert::Into<wkt::FieldMask>,
10525    {
10526        self.update_mask = v.map(|x| x.into());
10527        self
10528    }
10529
10530    /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10531    ///
10532    /// # Example
10533    /// ```ignore,no_run
10534    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10535    /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10536    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10537    /// ```
10538    pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10539    where
10540        T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10541    {
10542        self.firewall_endpoint_association = std::option::Option::Some(v.into());
10543        self
10544    }
10545
10546    /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10547    ///
10548    /// # Example
10549    /// ```ignore,no_run
10550    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10551    /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10552    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10553    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10554    /// ```
10555    pub fn set_or_clear_firewall_endpoint_association<T>(
10556        mut self,
10557        v: std::option::Option<T>,
10558    ) -> Self
10559    where
10560        T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10561    {
10562        self.firewall_endpoint_association = v.map(|x| x.into());
10563        self
10564    }
10565
10566    /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
10567    ///
10568    /// # Example
10569    /// ```ignore,no_run
10570    /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10571    /// let x = UpdateFirewallEndpointAssociationRequest::new().set_request_id("example");
10572    /// ```
10573    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10574        self.request_id = v.into();
10575        self
10576    }
10577}
10578
10579impl wkt::message::Message for UpdateFirewallEndpointAssociationRequest {
10580    fn typename() -> &'static str {
10581        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest"
10582    }
10583}
10584
10585/// The GatewaySecurityPolicy resource contains a collection of
10586/// GatewaySecurityPolicyRules and associated metadata.
10587#[derive(Clone, Default, PartialEq)]
10588#[non_exhaustive]
10589pub struct GatewaySecurityPolicy {
10590    /// Required. Name of the resource. Name is of the form
10591    /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}
10592    /// gateway_security_policy should match the
10593    /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10594    pub name: std::string::String,
10595
10596    /// Output only. The timestamp when the resource was created.
10597    pub create_time: std::option::Option<wkt::Timestamp>,
10598
10599    /// Output only. The timestamp when the resource was updated.
10600    pub update_time: std::option::Option<wkt::Timestamp>,
10601
10602    /// Optional. Free-text description of the resource.
10603    pub description: std::string::String,
10604
10605    /// Optional. Name of a TLS Inspection Policy resource that defines how TLS
10606    /// inspection will be performed for any rule(s) which enables it.
10607    pub tls_inspection_policy: std::string::String,
10608
10609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10610}
10611
10612impl GatewaySecurityPolicy {
10613    /// Creates a new default instance.
10614    pub fn new() -> Self {
10615        std::default::Default::default()
10616    }
10617
10618    /// Sets the value of [name][crate::model::GatewaySecurityPolicy::name].
10619    ///
10620    /// # Example
10621    /// ```ignore,no_run
10622    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10623    /// # let project_id = "project_id";
10624    /// # let location_id = "location_id";
10625    /// # let gateway_security_policy_id = "gateway_security_policy_id";
10626    /// let x = GatewaySecurityPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
10627    /// ```
10628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10629        self.name = v.into();
10630        self
10631    }
10632
10633    /// Sets the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10634    ///
10635    /// # Example
10636    /// ```ignore,no_run
10637    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10638    /// use wkt::Timestamp;
10639    /// let x = GatewaySecurityPolicy::new().set_create_time(Timestamp::default()/* use setters */);
10640    /// ```
10641    pub fn set_create_time<T>(mut self, v: T) -> Self
10642    where
10643        T: std::convert::Into<wkt::Timestamp>,
10644    {
10645        self.create_time = std::option::Option::Some(v.into());
10646        self
10647    }
10648
10649    /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10650    ///
10651    /// # Example
10652    /// ```ignore,no_run
10653    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10654    /// use wkt::Timestamp;
10655    /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10656    /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(None::<Timestamp>);
10657    /// ```
10658    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10659    where
10660        T: std::convert::Into<wkt::Timestamp>,
10661    {
10662        self.create_time = v.map(|x| x.into());
10663        self
10664    }
10665
10666    /// Sets the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10667    ///
10668    /// # Example
10669    /// ```ignore,no_run
10670    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10671    /// use wkt::Timestamp;
10672    /// let x = GatewaySecurityPolicy::new().set_update_time(Timestamp::default()/* use setters */);
10673    /// ```
10674    pub fn set_update_time<T>(mut self, v: T) -> Self
10675    where
10676        T: std::convert::Into<wkt::Timestamp>,
10677    {
10678        self.update_time = std::option::Option::Some(v.into());
10679        self
10680    }
10681
10682    /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10683    ///
10684    /// # Example
10685    /// ```ignore,no_run
10686    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10687    /// use wkt::Timestamp;
10688    /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10689    /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(None::<Timestamp>);
10690    /// ```
10691    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10692    where
10693        T: std::convert::Into<wkt::Timestamp>,
10694    {
10695        self.update_time = v.map(|x| x.into());
10696        self
10697    }
10698
10699    /// Sets the value of [description][crate::model::GatewaySecurityPolicy::description].
10700    ///
10701    /// # Example
10702    /// ```ignore,no_run
10703    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10704    /// let x = GatewaySecurityPolicy::new().set_description("example");
10705    /// ```
10706    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10707        self.description = v.into();
10708        self
10709    }
10710
10711    /// Sets the value of [tls_inspection_policy][crate::model::GatewaySecurityPolicy::tls_inspection_policy].
10712    ///
10713    /// # Example
10714    /// ```ignore,no_run
10715    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10716    /// # let project_id = "project_id";
10717    /// # let location_id = "location_id";
10718    /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
10719    /// let x = GatewaySecurityPolicy::new().set_tls_inspection_policy(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
10720    /// ```
10721    pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
10722        mut self,
10723        v: T,
10724    ) -> Self {
10725        self.tls_inspection_policy = v.into();
10726        self
10727    }
10728}
10729
10730impl wkt::message::Message for GatewaySecurityPolicy {
10731    fn typename() -> &'static str {
10732        "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicy"
10733    }
10734}
10735
10736/// Request used by the CreateGatewaySecurityPolicy method.
10737#[derive(Clone, Default, PartialEq)]
10738#[non_exhaustive]
10739pub struct CreateGatewaySecurityPolicyRequest {
10740    /// Required. The parent resource of the GatewaySecurityPolicy. Must be in the
10741    /// format `projects/{project}/locations/{location}`.
10742    pub parent: std::string::String,
10743
10744    /// Required. Short name of the GatewaySecurityPolicy resource to be created.
10745    /// This value should be 1-63 characters long, containing only
10746    /// letters, numbers, hyphens, and underscores, and should not start
10747    /// with a number. E.g. "gateway_security_policy1".
10748    pub gateway_security_policy_id: std::string::String,
10749
10750    /// Required. GatewaySecurityPolicy resource to be created.
10751    pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10752
10753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10754}
10755
10756impl CreateGatewaySecurityPolicyRequest {
10757    /// Creates a new default instance.
10758    pub fn new() -> Self {
10759        std::default::Default::default()
10760    }
10761
10762    /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
10763    ///
10764    /// # Example
10765    /// ```ignore,no_run
10766    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10767    /// # let project_id = "project_id";
10768    /// # let location_id = "location_id";
10769    /// let x = CreateGatewaySecurityPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10770    /// ```
10771    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10772        self.parent = v.into();
10773        self
10774    }
10775
10776    /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
10777    ///
10778    /// # Example
10779    /// ```ignore,no_run
10780    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10781    /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy_id("example");
10782    /// ```
10783    pub fn set_gateway_security_policy_id<T: std::convert::Into<std::string::String>>(
10784        mut self,
10785        v: T,
10786    ) -> Self {
10787        self.gateway_security_policy_id = v.into();
10788        self
10789    }
10790
10791    /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10792    ///
10793    /// # Example
10794    /// ```ignore,no_run
10795    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10796    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10797    /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10798    /// ```
10799    pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10800    where
10801        T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10802    {
10803        self.gateway_security_policy = std::option::Option::Some(v.into());
10804        self
10805    }
10806
10807    /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10808    ///
10809    /// # Example
10810    /// ```ignore,no_run
10811    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10812    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10813    /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10814    /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10815    /// ```
10816    pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10817    where
10818        T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10819    {
10820        self.gateway_security_policy = v.map(|x| x.into());
10821        self
10822    }
10823}
10824
10825impl wkt::message::Message for CreateGatewaySecurityPolicyRequest {
10826    fn typename() -> &'static str {
10827        "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest"
10828    }
10829}
10830
10831/// Request used with the ListGatewaySecurityPolicies method.
10832#[derive(Clone, Default, PartialEq)]
10833#[non_exhaustive]
10834pub struct ListGatewaySecurityPoliciesRequest {
10835    /// Required. The project and location from which the GatewaySecurityPolicies
10836    /// should be listed, specified in the format
10837    /// `projects/{project}/locations/{location}`.
10838    pub parent: std::string::String,
10839
10840    /// Maximum number of GatewaySecurityPolicies to return per call.
10841    pub page_size: i32,
10842
10843    /// The value returned by the last
10844    /// 'ListGatewaySecurityPoliciesResponse' Indicates that this is a
10845    /// continuation of a prior 'ListGatewaySecurityPolicies' call, and
10846    /// that the system should return the next page of data.
10847    pub page_token: std::string::String,
10848
10849    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10850}
10851
10852impl ListGatewaySecurityPoliciesRequest {
10853    /// Creates a new default instance.
10854    pub fn new() -> Self {
10855        std::default::Default::default()
10856    }
10857
10858    /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
10859    ///
10860    /// # Example
10861    /// ```ignore,no_run
10862    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10863    /// let x = ListGatewaySecurityPoliciesRequest::new().set_parent("example");
10864    /// ```
10865    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10866        self.parent = v.into();
10867        self
10868    }
10869
10870    /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
10871    ///
10872    /// # Example
10873    /// ```ignore,no_run
10874    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10875    /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_size(42);
10876    /// ```
10877    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10878        self.page_size = v.into();
10879        self
10880    }
10881
10882    /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
10883    ///
10884    /// # Example
10885    /// ```ignore,no_run
10886    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10887    /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_token("example");
10888    /// ```
10889    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10890        self.page_token = v.into();
10891        self
10892    }
10893}
10894
10895impl wkt::message::Message for ListGatewaySecurityPoliciesRequest {
10896    fn typename() -> &'static str {
10897        "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest"
10898    }
10899}
10900
10901/// Response returned by the ListGatewaySecurityPolicies method.
10902#[derive(Clone, Default, PartialEq)]
10903#[non_exhaustive]
10904pub struct ListGatewaySecurityPoliciesResponse {
10905    /// List of GatewaySecurityPolicies resources.
10906    pub gateway_security_policies: std::vec::Vec<crate::model::GatewaySecurityPolicy>,
10907
10908    /// If there might be more results than those appearing in this response, then
10909    /// 'next_page_token' is included. To get the next set of results, call this
10910    /// method again using the value of 'next_page_token' as 'page_token'.
10911    pub next_page_token: std::string::String,
10912
10913    /// Locations that could not be reached.
10914    pub unreachable: std::vec::Vec<std::string::String>,
10915
10916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10917}
10918
10919impl ListGatewaySecurityPoliciesResponse {
10920    /// Creates a new default instance.
10921    pub fn new() -> Self {
10922        std::default::Default::default()
10923    }
10924
10925    /// Sets the value of [gateway_security_policies][crate::model::ListGatewaySecurityPoliciesResponse::gateway_security_policies].
10926    ///
10927    /// # Example
10928    /// ```ignore,no_run
10929    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10930    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10931    /// let x = ListGatewaySecurityPoliciesResponse::new()
10932    ///     .set_gateway_security_policies([
10933    ///         GatewaySecurityPolicy::default()/* use setters */,
10934    ///         GatewaySecurityPolicy::default()/* use (different) setters */,
10935    ///     ]);
10936    /// ```
10937    pub fn set_gateway_security_policies<T, V>(mut self, v: T) -> Self
10938    where
10939        T: std::iter::IntoIterator<Item = V>,
10940        V: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10941    {
10942        use std::iter::Iterator;
10943        self.gateway_security_policies = v.into_iter().map(|i| i.into()).collect();
10944        self
10945    }
10946
10947    /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPoliciesResponse::next_page_token].
10948    ///
10949    /// # Example
10950    /// ```ignore,no_run
10951    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10952    /// let x = ListGatewaySecurityPoliciesResponse::new().set_next_page_token("example");
10953    /// ```
10954    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10955        self.next_page_token = v.into();
10956        self
10957    }
10958
10959    /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPoliciesResponse::unreachable].
10960    ///
10961    /// # Example
10962    /// ```ignore,no_run
10963    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10964    /// let x = ListGatewaySecurityPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10965    /// ```
10966    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10967    where
10968        T: std::iter::IntoIterator<Item = V>,
10969        V: std::convert::Into<std::string::String>,
10970    {
10971        use std::iter::Iterator;
10972        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10973        self
10974    }
10975}
10976
10977impl wkt::message::Message for ListGatewaySecurityPoliciesResponse {
10978    fn typename() -> &'static str {
10979        "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse"
10980    }
10981}
10982
10983#[doc(hidden)]
10984impl google_cloud_gax::paginator::internal::PageableResponse
10985    for ListGatewaySecurityPoliciesResponse
10986{
10987    type PageItem = crate::model::GatewaySecurityPolicy;
10988
10989    fn items(self) -> std::vec::Vec<Self::PageItem> {
10990        self.gateway_security_policies
10991    }
10992
10993    fn next_page_token(&self) -> std::string::String {
10994        use std::clone::Clone;
10995        self.next_page_token.clone()
10996    }
10997}
10998
10999/// Request used by the GetGatewaySecurityPolicy method.
11000#[derive(Clone, Default, PartialEq)]
11001#[non_exhaustive]
11002pub struct GetGatewaySecurityPolicyRequest {
11003    /// Required. A name of the GatewaySecurityPolicy to get. Must be in the format
11004    /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
11005    pub name: std::string::String,
11006
11007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11008}
11009
11010impl GetGatewaySecurityPolicyRequest {
11011    /// Creates a new default instance.
11012    pub fn new() -> Self {
11013        std::default::Default::default()
11014    }
11015
11016    /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
11017    ///
11018    /// # Example
11019    /// ```ignore,no_run
11020    /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRequest;
11021    /// # let project_id = "project_id";
11022    /// # let location_id = "location_id";
11023    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11024    /// let x = GetGatewaySecurityPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11025    /// ```
11026    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11027        self.name = v.into();
11028        self
11029    }
11030}
11031
11032impl wkt::message::Message for GetGatewaySecurityPolicyRequest {
11033    fn typename() -> &'static str {
11034        "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest"
11035    }
11036}
11037
11038/// Request used by the DeleteGatewaySecurityPolicy method.
11039#[derive(Clone, Default, PartialEq)]
11040#[non_exhaustive]
11041pub struct DeleteGatewaySecurityPolicyRequest {
11042    /// Required. A name of the GatewaySecurityPolicy to delete. Must be in the
11043    /// format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
11044    pub name: std::string::String,
11045
11046    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11047}
11048
11049impl DeleteGatewaySecurityPolicyRequest {
11050    /// Creates a new default instance.
11051    pub fn new() -> Self {
11052        std::default::Default::default()
11053    }
11054
11055    /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
11056    ///
11057    /// # Example
11058    /// ```ignore,no_run
11059    /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRequest;
11060    /// # let project_id = "project_id";
11061    /// # let location_id = "location_id";
11062    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11063    /// let x = DeleteGatewaySecurityPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11064    /// ```
11065    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11066        self.name = v.into();
11067        self
11068    }
11069}
11070
11071impl wkt::message::Message for DeleteGatewaySecurityPolicyRequest {
11072    fn typename() -> &'static str {
11073        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest"
11074    }
11075}
11076
11077/// Request used by the UpdateGatewaySecurityPolicy method.
11078#[derive(Clone, Default, PartialEq)]
11079#[non_exhaustive]
11080pub struct UpdateGatewaySecurityPolicyRequest {
11081    /// Optional. Field mask is used to specify the fields to be overwritten in the
11082    /// GatewaySecurityPolicy resource by the update.
11083    /// The fields specified in the update_mask are relative to the resource, not
11084    /// the full request. A field will be overwritten if it is in the mask. If the
11085    /// user does not provide a mask then all fields will be overwritten.
11086    pub update_mask: std::option::Option<wkt::FieldMask>,
11087
11088    /// Required. Updated GatewaySecurityPolicy resource.
11089    pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
11090
11091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11092}
11093
11094impl UpdateGatewaySecurityPolicyRequest {
11095    /// Creates a new default instance.
11096    pub fn new() -> Self {
11097        std::default::Default::default()
11098    }
11099
11100    /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
11101    ///
11102    /// # Example
11103    /// ```ignore,no_run
11104    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11105    /// use wkt::FieldMask;
11106    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11107    /// ```
11108    pub fn set_update_mask<T>(mut self, v: T) -> Self
11109    where
11110        T: std::convert::Into<wkt::FieldMask>,
11111    {
11112        self.update_mask = std::option::Option::Some(v.into());
11113        self
11114    }
11115
11116    /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
11117    ///
11118    /// # Example
11119    /// ```ignore,no_run
11120    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11121    /// use wkt::FieldMask;
11122    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11123    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11124    /// ```
11125    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11126    where
11127        T: std::convert::Into<wkt::FieldMask>,
11128    {
11129        self.update_mask = v.map(|x| x.into());
11130        self
11131    }
11132
11133    /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
11134    ///
11135    /// # Example
11136    /// ```ignore,no_run
11137    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11138    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
11139    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
11140    /// ```
11141    pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
11142    where
11143        T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
11144    {
11145        self.gateway_security_policy = std::option::Option::Some(v.into());
11146        self
11147    }
11148
11149    /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
11150    ///
11151    /// # Example
11152    /// ```ignore,no_run
11153    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11154    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
11155    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
11156    /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
11157    /// ```
11158    pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
11159    where
11160        T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
11161    {
11162        self.gateway_security_policy = v.map(|x| x.into());
11163        self
11164    }
11165}
11166
11167impl wkt::message::Message for UpdateGatewaySecurityPolicyRequest {
11168    fn typename() -> &'static str {
11169        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest"
11170    }
11171}
11172
11173/// The GatewaySecurityPolicyRule resource is in a nested collection within a
11174/// GatewaySecurityPolicy and represents a traffic matching condition and
11175/// associated action to perform.
11176#[derive(Clone, Default, PartialEq)]
11177#[non_exhaustive]
11178pub struct GatewaySecurityPolicyRule {
11179    /// Required. Immutable. Name of the resource. ame is the full resource name so
11180    /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}
11181    /// rule should match the
11182    /// pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
11183    pub name: std::string::String,
11184
11185    /// Output only. Time when the rule was created.
11186    pub create_time: std::option::Option<wkt::Timestamp>,
11187
11188    /// Output only. Time when the rule was updated.
11189    pub update_time: std::option::Option<wkt::Timestamp>,
11190
11191    /// Required. Whether the rule is enforced.
11192    pub enabled: bool,
11193
11194    /// Required. Priority of the rule.
11195    /// Lower number corresponds to higher precedence.
11196    pub priority: i32,
11197
11198    /// Optional. Free-text description of the resource.
11199    pub description: std::string::String,
11200
11201    /// Required. CEL expression for matching on session criteria.
11202    pub session_matcher: std::string::String,
11203
11204    /// Optional. CEL expression for matching on L7/application level criteria.
11205    pub application_matcher: std::string::String,
11206
11207    /// Optional. Flag to enable TLS inspection of traffic matching on
11208    /// <session_matcher>, can only be true if the parent GatewaySecurityPolicy
11209    /// references a TLSInspectionConfig.
11210    pub tls_inspection_enabled: bool,
11211
11212    #[allow(missing_docs)]
11213    pub profile: std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11214
11215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11216}
11217
11218impl GatewaySecurityPolicyRule {
11219    /// Creates a new default instance.
11220    pub fn new() -> Self {
11221        std::default::Default::default()
11222    }
11223
11224    /// Sets the value of [name][crate::model::GatewaySecurityPolicyRule::name].
11225    ///
11226    /// # Example
11227    /// ```ignore,no_run
11228    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11229    /// # let project_id = "project_id";
11230    /// # let location_id = "location_id";
11231    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11232    /// # let rule_id = "rule_id";
11233    /// let x = GatewaySecurityPolicyRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
11234    /// ```
11235    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11236        self.name = v.into();
11237        self
11238    }
11239
11240    /// Sets the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11241    ///
11242    /// # Example
11243    /// ```ignore,no_run
11244    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11245    /// use wkt::Timestamp;
11246    /// let x = GatewaySecurityPolicyRule::new().set_create_time(Timestamp::default()/* use setters */);
11247    /// ```
11248    pub fn set_create_time<T>(mut self, v: T) -> Self
11249    where
11250        T: std::convert::Into<wkt::Timestamp>,
11251    {
11252        self.create_time = std::option::Option::Some(v.into());
11253        self
11254    }
11255
11256    /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11257    ///
11258    /// # Example
11259    /// ```ignore,no_run
11260    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11261    /// use wkt::Timestamp;
11262    /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11263    /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(None::<Timestamp>);
11264    /// ```
11265    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11266    where
11267        T: std::convert::Into<wkt::Timestamp>,
11268    {
11269        self.create_time = v.map(|x| x.into());
11270        self
11271    }
11272
11273    /// Sets the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11274    ///
11275    /// # Example
11276    /// ```ignore,no_run
11277    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11278    /// use wkt::Timestamp;
11279    /// let x = GatewaySecurityPolicyRule::new().set_update_time(Timestamp::default()/* use setters */);
11280    /// ```
11281    pub fn set_update_time<T>(mut self, v: T) -> Self
11282    where
11283        T: std::convert::Into<wkt::Timestamp>,
11284    {
11285        self.update_time = std::option::Option::Some(v.into());
11286        self
11287    }
11288
11289    /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11290    ///
11291    /// # Example
11292    /// ```ignore,no_run
11293    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11294    /// use wkt::Timestamp;
11295    /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11296    /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(None::<Timestamp>);
11297    /// ```
11298    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11299    where
11300        T: std::convert::Into<wkt::Timestamp>,
11301    {
11302        self.update_time = v.map(|x| x.into());
11303        self
11304    }
11305
11306    /// Sets the value of [enabled][crate::model::GatewaySecurityPolicyRule::enabled].
11307    ///
11308    /// # Example
11309    /// ```ignore,no_run
11310    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11311    /// let x = GatewaySecurityPolicyRule::new().set_enabled(true);
11312    /// ```
11313    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11314        self.enabled = v.into();
11315        self
11316    }
11317
11318    /// Sets the value of [priority][crate::model::GatewaySecurityPolicyRule::priority].
11319    ///
11320    /// # Example
11321    /// ```ignore,no_run
11322    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11323    /// let x = GatewaySecurityPolicyRule::new().set_priority(42);
11324    /// ```
11325    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11326        self.priority = v.into();
11327        self
11328    }
11329
11330    /// Sets the value of [description][crate::model::GatewaySecurityPolicyRule::description].
11331    ///
11332    /// # Example
11333    /// ```ignore,no_run
11334    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11335    /// let x = GatewaySecurityPolicyRule::new().set_description("example");
11336    /// ```
11337    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11338        self.description = v.into();
11339        self
11340    }
11341
11342    /// Sets the value of [session_matcher][crate::model::GatewaySecurityPolicyRule::session_matcher].
11343    ///
11344    /// # Example
11345    /// ```ignore,no_run
11346    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11347    /// let x = GatewaySecurityPolicyRule::new().set_session_matcher("example");
11348    /// ```
11349    pub fn set_session_matcher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11350        self.session_matcher = v.into();
11351        self
11352    }
11353
11354    /// Sets the value of [application_matcher][crate::model::GatewaySecurityPolicyRule::application_matcher].
11355    ///
11356    /// # Example
11357    /// ```ignore,no_run
11358    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11359    /// let x = GatewaySecurityPolicyRule::new().set_application_matcher("example");
11360    /// ```
11361    pub fn set_application_matcher<T: std::convert::Into<std::string::String>>(
11362        mut self,
11363        v: T,
11364    ) -> Self {
11365        self.application_matcher = v.into();
11366        self
11367    }
11368
11369    /// Sets the value of [tls_inspection_enabled][crate::model::GatewaySecurityPolicyRule::tls_inspection_enabled].
11370    ///
11371    /// # Example
11372    /// ```ignore,no_run
11373    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11374    /// let x = GatewaySecurityPolicyRule::new().set_tls_inspection_enabled(true);
11375    /// ```
11376    pub fn set_tls_inspection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11377        self.tls_inspection_enabled = v.into();
11378        self
11379    }
11380
11381    /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile].
11382    ///
11383    /// Note that all the setters affecting `profile` are mutually
11384    /// exclusive.
11385    ///
11386    /// # Example
11387    /// ```ignore,no_run
11388    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11389    /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11390    /// let x0 = GatewaySecurityPolicyRule::new().set_profile(Some(
11391    ///     google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Allow)));
11392    /// let x1 = GatewaySecurityPolicyRule::new().set_profile(Some(
11393    ///     google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Deny)));
11394    /// ```
11395    pub fn set_profile<
11396        T: std::convert::Into<
11397                std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11398            >,
11399    >(
11400        mut self,
11401        v: T,
11402    ) -> Self {
11403        self.profile = v.into();
11404        self
11405    }
11406
11407    /// The value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11408    /// if it holds a `BasicProfile`, `None` if the field is not set or
11409    /// holds a different branch.
11410    pub fn basic_profile(
11411        &self,
11412    ) -> std::option::Option<&crate::model::gateway_security_policy_rule::BasicProfile> {
11413        #[allow(unreachable_patterns)]
11414        self.profile.as_ref().and_then(|v| match v {
11415            crate::model::gateway_security_policy_rule::Profile::BasicProfile(v) => {
11416                std::option::Option::Some(v)
11417            }
11418            _ => std::option::Option::None,
11419        })
11420    }
11421
11422    /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11423    /// to hold a `BasicProfile`.
11424    ///
11425    /// Note that all the setters affecting `profile` are
11426    /// mutually exclusive.
11427    ///
11428    /// # Example
11429    /// ```ignore,no_run
11430    /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11431    /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11432    /// let x0 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Allow);
11433    /// let x1 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Deny);
11434    /// assert!(x0.basic_profile().is_some());
11435    /// assert!(x1.basic_profile().is_some());
11436    /// ```
11437    pub fn set_basic_profile<
11438        T: std::convert::Into<crate::model::gateway_security_policy_rule::BasicProfile>,
11439    >(
11440        mut self,
11441        v: T,
11442    ) -> Self {
11443        self.profile = std::option::Option::Some(
11444            crate::model::gateway_security_policy_rule::Profile::BasicProfile(v.into()),
11445        );
11446        self
11447    }
11448}
11449
11450impl wkt::message::Message for GatewaySecurityPolicyRule {
11451    fn typename() -> &'static str {
11452        "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicyRule"
11453    }
11454}
11455
11456/// Defines additional types related to [GatewaySecurityPolicyRule].
11457pub mod gateway_security_policy_rule {
11458    #[allow(unused_imports)]
11459    use super::*;
11460
11461    /// enum to define the primitive action.
11462    ///
11463    /// # Working with unknown values
11464    ///
11465    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11466    /// additional enum variants at any time. Adding new variants is not considered
11467    /// a breaking change. Applications should write their code in anticipation of:
11468    ///
11469    /// - New values appearing in future releases of the client library, **and**
11470    /// - New values received dynamically, without application changes.
11471    ///
11472    /// Please consult the [Working with enums] section in the user guide for some
11473    /// guidelines.
11474    ///
11475    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11476    #[derive(Clone, Debug, PartialEq)]
11477    #[non_exhaustive]
11478    pub enum BasicProfile {
11479        /// If there is not a mentioned action for the target.
11480        Unspecified,
11481        /// Allow the matched traffic.
11482        Allow,
11483        /// Deny the matched traffic.
11484        Deny,
11485        /// If set, the enum was initialized with an unknown value.
11486        ///
11487        /// Applications can examine the value using [BasicProfile::value] or
11488        /// [BasicProfile::name].
11489        UnknownValue(basic_profile::UnknownValue),
11490    }
11491
11492    #[doc(hidden)]
11493    pub mod basic_profile {
11494        #[allow(unused_imports)]
11495        use super::*;
11496        #[derive(Clone, Debug, PartialEq)]
11497        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11498    }
11499
11500    impl BasicProfile {
11501        /// Gets the enum value.
11502        ///
11503        /// Returns `None` if the enum contains an unknown value deserialized from
11504        /// the string representation of enums.
11505        pub fn value(&self) -> std::option::Option<i32> {
11506            match self {
11507                Self::Unspecified => std::option::Option::Some(0),
11508                Self::Allow => std::option::Option::Some(1),
11509                Self::Deny => std::option::Option::Some(2),
11510                Self::UnknownValue(u) => u.0.value(),
11511            }
11512        }
11513
11514        /// Gets the enum value as a string.
11515        ///
11516        /// Returns `None` if the enum contains an unknown value deserialized from
11517        /// the integer representation of enums.
11518        pub fn name(&self) -> std::option::Option<&str> {
11519            match self {
11520                Self::Unspecified => std::option::Option::Some("BASIC_PROFILE_UNSPECIFIED"),
11521                Self::Allow => std::option::Option::Some("ALLOW"),
11522                Self::Deny => std::option::Option::Some("DENY"),
11523                Self::UnknownValue(u) => u.0.name(),
11524            }
11525        }
11526    }
11527
11528    impl std::default::Default for BasicProfile {
11529        fn default() -> Self {
11530            use std::convert::From;
11531            Self::from(0)
11532        }
11533    }
11534
11535    impl std::fmt::Display for BasicProfile {
11536        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11537            wkt::internal::display_enum(f, self.name(), self.value())
11538        }
11539    }
11540
11541    impl std::convert::From<i32> for BasicProfile {
11542        fn from(value: i32) -> Self {
11543            match value {
11544                0 => Self::Unspecified,
11545                1 => Self::Allow,
11546                2 => Self::Deny,
11547                _ => Self::UnknownValue(basic_profile::UnknownValue(
11548                    wkt::internal::UnknownEnumValue::Integer(value),
11549                )),
11550            }
11551        }
11552    }
11553
11554    impl std::convert::From<&str> for BasicProfile {
11555        fn from(value: &str) -> Self {
11556            use std::string::ToString;
11557            match value {
11558                "BASIC_PROFILE_UNSPECIFIED" => Self::Unspecified,
11559                "ALLOW" => Self::Allow,
11560                "DENY" => Self::Deny,
11561                _ => Self::UnknownValue(basic_profile::UnknownValue(
11562                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11563                )),
11564            }
11565        }
11566    }
11567
11568    impl serde::ser::Serialize for BasicProfile {
11569        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11570        where
11571            S: serde::Serializer,
11572        {
11573            match self {
11574                Self::Unspecified => serializer.serialize_i32(0),
11575                Self::Allow => serializer.serialize_i32(1),
11576                Self::Deny => serializer.serialize_i32(2),
11577                Self::UnknownValue(u) => u.0.serialize(serializer),
11578            }
11579        }
11580    }
11581
11582    impl<'de> serde::de::Deserialize<'de> for BasicProfile {
11583        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11584        where
11585            D: serde::Deserializer<'de>,
11586        {
11587            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BasicProfile>::new(
11588                ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile",
11589            ))
11590        }
11591    }
11592
11593    #[allow(missing_docs)]
11594    #[derive(Clone, Debug, PartialEq)]
11595    #[non_exhaustive]
11596    pub enum Profile {
11597        /// Required. Profile which tells what the primitive action should be.
11598        BasicProfile(crate::model::gateway_security_policy_rule::BasicProfile),
11599    }
11600}
11601
11602/// Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules.
11603/// Request used by the CreateGatewaySecurityPolicyRule method.
11604#[derive(Clone, Default, PartialEq)]
11605#[non_exhaustive]
11606pub struct CreateGatewaySecurityPolicyRuleRequest {
11607    /// Required. The parent where this rule will be created.
11608    /// Format :
11609    /// projects/{project}/location/{location}/gatewaySecurityPolicies/*
11610    pub parent: std::string::String,
11611
11612    /// Required. The rule to be created.
11613    pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11614
11615    /// The ID to use for the rule, which will become the final component of
11616    /// the rule's resource name.
11617    /// This value should be 4-63 characters, and valid characters
11618    /// are /[a-z][0-9]-/.
11619    pub gateway_security_policy_rule_id: std::string::String,
11620
11621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11622}
11623
11624impl CreateGatewaySecurityPolicyRuleRequest {
11625    /// Creates a new default instance.
11626    pub fn new() -> Self {
11627        std::default::Default::default()
11628    }
11629
11630    /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
11631    ///
11632    /// # Example
11633    /// ```ignore,no_run
11634    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11635    /// # let project_id = "project_id";
11636    /// # let location_id = "location_id";
11637    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11638    /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11639    /// ```
11640    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11641        self.parent = v.into();
11642        self
11643    }
11644
11645    /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11646    ///
11647    /// # Example
11648    /// ```ignore,no_run
11649    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11650    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11651    /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11652    /// ```
11653    pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11654    where
11655        T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11656    {
11657        self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11658        self
11659    }
11660
11661    /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11662    ///
11663    /// # Example
11664    /// ```ignore,no_run
11665    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11666    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11667    /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11668    /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11669    /// ```
11670    pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11671    where
11672        T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11673    {
11674        self.gateway_security_policy_rule = v.map(|x| x.into());
11675        self
11676    }
11677
11678    /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
11679    ///
11680    /// # Example
11681    /// ```ignore,no_run
11682    /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11683    /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule_id("example");
11684    /// ```
11685    pub fn set_gateway_security_policy_rule_id<T: std::convert::Into<std::string::String>>(
11686        mut self,
11687        v: T,
11688    ) -> Self {
11689        self.gateway_security_policy_rule_id = v.into();
11690        self
11691    }
11692}
11693
11694impl wkt::message::Message for CreateGatewaySecurityPolicyRuleRequest {
11695    fn typename() -> &'static str {
11696        "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest"
11697    }
11698}
11699
11700/// Request used by the GetGatewaySecurityPolicyRule method.
11701#[derive(Clone, Default, PartialEq)]
11702#[non_exhaustive]
11703pub struct GetGatewaySecurityPolicyRuleRequest {
11704    /// Required. The name of the GatewaySecurityPolicyRule to retrieve.
11705    /// Format:
11706    /// projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
11707    pub name: std::string::String,
11708
11709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11710}
11711
11712impl GetGatewaySecurityPolicyRuleRequest {
11713    /// Creates a new default instance.
11714    pub fn new() -> Self {
11715        std::default::Default::default()
11716    }
11717
11718    /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
11719    ///
11720    /// # Example
11721    /// ```ignore,no_run
11722    /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRuleRequest;
11723    /// # let project_id = "project_id";
11724    /// # let location_id = "location_id";
11725    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11726    /// # let rule_id = "rule_id";
11727    /// let x = GetGatewaySecurityPolicyRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
11728    /// ```
11729    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11730        self.name = v.into();
11731        self
11732    }
11733}
11734
11735impl wkt::message::Message for GetGatewaySecurityPolicyRuleRequest {
11736    fn typename() -> &'static str {
11737        "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest"
11738    }
11739}
11740
11741/// Request used by the UpdateGatewaySecurityPolicyRule method.
11742#[derive(Clone, Default, PartialEq)]
11743#[non_exhaustive]
11744pub struct UpdateGatewaySecurityPolicyRuleRequest {
11745    /// Optional. Field mask is used to specify the fields to be overwritten in the
11746    /// GatewaySecurityPolicy resource by the update.
11747    /// The fields specified in the update_mask are relative to the resource, not
11748    /// the full request. A field will be overwritten if it is in the mask. If the
11749    /// user does not provide a mask then all fields will be overwritten.
11750    pub update_mask: std::option::Option<wkt::FieldMask>,
11751
11752    /// Required. Updated GatewaySecurityPolicyRule resource.
11753    pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11754
11755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11756}
11757
11758impl UpdateGatewaySecurityPolicyRuleRequest {
11759    /// Creates a new default instance.
11760    pub fn new() -> Self {
11761        std::default::Default::default()
11762    }
11763
11764    /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11765    ///
11766    /// # Example
11767    /// ```ignore,no_run
11768    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11769    /// use wkt::FieldMask;
11770    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11771    /// ```
11772    pub fn set_update_mask<T>(mut self, v: T) -> Self
11773    where
11774        T: std::convert::Into<wkt::FieldMask>,
11775    {
11776        self.update_mask = std::option::Option::Some(v.into());
11777        self
11778    }
11779
11780    /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11781    ///
11782    /// # Example
11783    /// ```ignore,no_run
11784    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11785    /// use wkt::FieldMask;
11786    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11787    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11788    /// ```
11789    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11790    where
11791        T: std::convert::Into<wkt::FieldMask>,
11792    {
11793        self.update_mask = v.map(|x| x.into());
11794        self
11795    }
11796
11797    /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11798    ///
11799    /// # Example
11800    /// ```ignore,no_run
11801    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11802    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11803    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11804    /// ```
11805    pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11806    where
11807        T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11808    {
11809        self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11810        self
11811    }
11812
11813    /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11814    ///
11815    /// # Example
11816    /// ```ignore,no_run
11817    /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11818    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11819    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11820    /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11821    /// ```
11822    pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11823    where
11824        T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11825    {
11826        self.gateway_security_policy_rule = v.map(|x| x.into());
11827        self
11828    }
11829}
11830
11831impl wkt::message::Message for UpdateGatewaySecurityPolicyRuleRequest {
11832    fn typename() -> &'static str {
11833        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest"
11834    }
11835}
11836
11837/// Request used with the ListGatewaySecurityPolicyRules method.
11838#[derive(Clone, Default, PartialEq)]
11839#[non_exhaustive]
11840pub struct ListGatewaySecurityPolicyRulesRequest {
11841    /// Required. The project, location and GatewaySecurityPolicy from which the
11842    /// GatewaySecurityPolicyRules should be listed, specified in the format
11843    /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
11844    pub parent: std::string::String,
11845
11846    /// Maximum number of GatewaySecurityPolicyRules to return per call.
11847    pub page_size: i32,
11848
11849    /// The value returned by the last
11850    /// 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a
11851    /// continuation of a prior 'ListGatewaySecurityPolicyRules' call, and
11852    /// that the system should return the next page of data.
11853    pub page_token: std::string::String,
11854
11855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11856}
11857
11858impl ListGatewaySecurityPolicyRulesRequest {
11859    /// Creates a new default instance.
11860    pub fn new() -> Self {
11861        std::default::Default::default()
11862    }
11863
11864    /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
11865    ///
11866    /// # Example
11867    /// ```ignore,no_run
11868    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11869    /// # let project_id = "project_id";
11870    /// # let location_id = "location_id";
11871    /// # let gateway_security_policy_id = "gateway_security_policy_id";
11872    /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11873    /// ```
11874    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11875        self.parent = v.into();
11876        self
11877    }
11878
11879    /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
11880    ///
11881    /// # Example
11882    /// ```ignore,no_run
11883    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11884    /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_size(42);
11885    /// ```
11886    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11887        self.page_size = v.into();
11888        self
11889    }
11890
11891    /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
11892    ///
11893    /// # Example
11894    /// ```ignore,no_run
11895    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11896    /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_token("example");
11897    /// ```
11898    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11899        self.page_token = v.into();
11900        self
11901    }
11902}
11903
11904impl wkt::message::Message for ListGatewaySecurityPolicyRulesRequest {
11905    fn typename() -> &'static str {
11906        "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest"
11907    }
11908}
11909
11910/// Response returned by the ListGatewaySecurityPolicyRules method.
11911#[derive(Clone, Default, PartialEq)]
11912#[non_exhaustive]
11913pub struct ListGatewaySecurityPolicyRulesResponse {
11914    /// List of GatewaySecurityPolicyRule resources.
11915    pub gateway_security_policy_rules: std::vec::Vec<crate::model::GatewaySecurityPolicyRule>,
11916
11917    /// If there might be more results than those appearing in this response, then
11918    /// 'next_page_token' is included. To get the next set of results, call this
11919    /// method again using the value of 'next_page_token' as 'page_token'.
11920    pub next_page_token: std::string::String,
11921
11922    /// Locations that could not be reached.
11923    pub unreachable: std::vec::Vec<std::string::String>,
11924
11925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11926}
11927
11928impl ListGatewaySecurityPolicyRulesResponse {
11929    /// Creates a new default instance.
11930    pub fn new() -> Self {
11931        std::default::Default::default()
11932    }
11933
11934    /// Sets the value of [gateway_security_policy_rules][crate::model::ListGatewaySecurityPolicyRulesResponse::gateway_security_policy_rules].
11935    ///
11936    /// # Example
11937    /// ```ignore,no_run
11938    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11939    /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11940    /// let x = ListGatewaySecurityPolicyRulesResponse::new()
11941    ///     .set_gateway_security_policy_rules([
11942    ///         GatewaySecurityPolicyRule::default()/* use setters */,
11943    ///         GatewaySecurityPolicyRule::default()/* use (different) setters */,
11944    ///     ]);
11945    /// ```
11946    pub fn set_gateway_security_policy_rules<T, V>(mut self, v: T) -> Self
11947    where
11948        T: std::iter::IntoIterator<Item = V>,
11949        V: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11950    {
11951        use std::iter::Iterator;
11952        self.gateway_security_policy_rules = v.into_iter().map(|i| i.into()).collect();
11953        self
11954    }
11955
11956    /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPolicyRulesResponse::next_page_token].
11957    ///
11958    /// # Example
11959    /// ```ignore,no_run
11960    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11961    /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_next_page_token("example");
11962    /// ```
11963    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11964        self.next_page_token = v.into();
11965        self
11966    }
11967
11968    /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPolicyRulesResponse::unreachable].
11969    ///
11970    /// # Example
11971    /// ```ignore,no_run
11972    /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11973    /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_unreachable(["a", "b", "c"]);
11974    /// ```
11975    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11976    where
11977        T: std::iter::IntoIterator<Item = V>,
11978        V: std::convert::Into<std::string::String>,
11979    {
11980        use std::iter::Iterator;
11981        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11982        self
11983    }
11984}
11985
11986impl wkt::message::Message for ListGatewaySecurityPolicyRulesResponse {
11987    fn typename() -> &'static str {
11988        "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse"
11989    }
11990}
11991
11992#[doc(hidden)]
11993impl google_cloud_gax::paginator::internal::PageableResponse
11994    for ListGatewaySecurityPolicyRulesResponse
11995{
11996    type PageItem = crate::model::GatewaySecurityPolicyRule;
11997
11998    fn items(self) -> std::vec::Vec<Self::PageItem> {
11999        self.gateway_security_policy_rules
12000    }
12001
12002    fn next_page_token(&self) -> std::string::String {
12003        use std::clone::Clone;
12004        self.next_page_token.clone()
12005    }
12006}
12007
12008/// Request used by the DeleteGatewaySecurityPolicyRule method.
12009#[derive(Clone, Default, PartialEq)]
12010#[non_exhaustive]
12011pub struct DeleteGatewaySecurityPolicyRuleRequest {
12012    /// Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the
12013    /// format
12014    /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
12015    pub name: std::string::String,
12016
12017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12018}
12019
12020impl DeleteGatewaySecurityPolicyRuleRequest {
12021    /// Creates a new default instance.
12022    pub fn new() -> Self {
12023        std::default::Default::default()
12024    }
12025
12026    /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
12027    ///
12028    /// # Example
12029    /// ```ignore,no_run
12030    /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRuleRequest;
12031    /// # let project_id = "project_id";
12032    /// # let location_id = "location_id";
12033    /// # let gateway_security_policy_id = "gateway_security_policy_id";
12034    /// # let rule_id = "rule_id";
12035    /// let x = DeleteGatewaySecurityPolicyRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
12036    /// ```
12037    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12038        self.name = v.into();
12039        self
12040    }
12041}
12042
12043impl wkt::message::Message for DeleteGatewaySecurityPolicyRuleRequest {
12044    fn typename() -> &'static str {
12045        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest"
12046    }
12047}
12048
12049/// An endpoint group is a consumer frontend for a deployment group (backend).
12050/// In order to configure intercept for a network, consumers must create:
12051///
12052/// - An association between their network and the endpoint group.
12053/// - A security profile that points to the endpoint group.
12054/// - A firewall rule that references the security profile (group).
12055#[derive(Clone, Default, PartialEq)]
12056#[non_exhaustive]
12057pub struct InterceptEndpointGroup {
12058    /// Immutable. Identifier. The resource name of this endpoint group, for
12059    /// example:
12060    /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
12061    /// See <https://google.aip.dev/122> for more details.
12062    pub name: std::string::String,
12063
12064    /// Output only. The timestamp when the resource was created.
12065    /// See <https://google.aip.dev/148#timestamps>.
12066    pub create_time: std::option::Option<wkt::Timestamp>,
12067
12068    /// Output only. The timestamp when the resource was most recently updated.
12069    /// See <https://google.aip.dev/148#timestamps>.
12070    pub update_time: std::option::Option<wkt::Timestamp>,
12071
12072    /// Optional. Labels are key/value pairs that help to organize and filter
12073    /// resources.
12074    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12075
12076    /// Required. Immutable. The deployment group that this endpoint group is
12077    /// connected to, for example:
12078    /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12079    /// See <https://google.aip.dev/124>.
12080    pub intercept_deployment_group: std::string::String,
12081
12082    /// Output only. Details about the connected deployment group to this endpoint
12083    /// group.
12084    pub connected_deployment_group:
12085        std::option::Option<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12086
12087    /// Output only. The current state of the endpoint group.
12088    /// See <https://google.aip.dev/216>.
12089    pub state: crate::model::intercept_endpoint_group::State,
12090
12091    /// Output only. The current state of the resource does not match the user's
12092    /// intended state, and the system is working to reconcile them. This is part
12093    /// of the normal operation (e.g. adding a new association to the group). See
12094    /// <https://google.aip.dev/128>.
12095    pub reconciling: bool,
12096
12097    /// Output only. List of associations to this endpoint group.
12098    pub associations: std::vec::Vec<crate::model::intercept_endpoint_group::AssociationDetails>,
12099
12100    /// Optional. User-provided description of the endpoint group.
12101    /// Used as additional context for the endpoint group.
12102    pub description: std::string::String,
12103
12104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12105}
12106
12107impl InterceptEndpointGroup {
12108    /// Creates a new default instance.
12109    pub fn new() -> Self {
12110        std::default::Default::default()
12111    }
12112
12113    /// Sets the value of [name][crate::model::InterceptEndpointGroup::name].
12114    ///
12115    /// # Example
12116    /// ```ignore,no_run
12117    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12118    /// # let project_id = "project_id";
12119    /// # let location_id = "location_id";
12120    /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
12121    /// let x = InterceptEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
12122    /// ```
12123    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12124        self.name = v.into();
12125        self
12126    }
12127
12128    /// Sets the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
12129    ///
12130    /// # Example
12131    /// ```ignore,no_run
12132    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12133    /// use wkt::Timestamp;
12134    /// let x = InterceptEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
12135    /// ```
12136    pub fn set_create_time<T>(mut self, v: T) -> Self
12137    where
12138        T: std::convert::Into<wkt::Timestamp>,
12139    {
12140        self.create_time = std::option::Option::Some(v.into());
12141        self
12142    }
12143
12144    /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
12145    ///
12146    /// # Example
12147    /// ```ignore,no_run
12148    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12149    /// use wkt::Timestamp;
12150    /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12151    /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
12152    /// ```
12153    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12154    where
12155        T: std::convert::Into<wkt::Timestamp>,
12156    {
12157        self.create_time = v.map(|x| x.into());
12158        self
12159    }
12160
12161    /// Sets the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
12162    ///
12163    /// # Example
12164    /// ```ignore,no_run
12165    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12166    /// use wkt::Timestamp;
12167    /// let x = InterceptEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
12168    /// ```
12169    pub fn set_update_time<T>(mut self, v: T) -> Self
12170    where
12171        T: std::convert::Into<wkt::Timestamp>,
12172    {
12173        self.update_time = std::option::Option::Some(v.into());
12174        self
12175    }
12176
12177    /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
12178    ///
12179    /// # Example
12180    /// ```ignore,no_run
12181    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12182    /// use wkt::Timestamp;
12183    /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12184    /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
12185    /// ```
12186    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12187    where
12188        T: std::convert::Into<wkt::Timestamp>,
12189    {
12190        self.update_time = v.map(|x| x.into());
12191        self
12192    }
12193
12194    /// Sets the value of [labels][crate::model::InterceptEndpointGroup::labels].
12195    ///
12196    /// # Example
12197    /// ```ignore,no_run
12198    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12199    /// let x = InterceptEndpointGroup::new().set_labels([
12200    ///     ("key0", "abc"),
12201    ///     ("key1", "xyz"),
12202    /// ]);
12203    /// ```
12204    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12205    where
12206        T: std::iter::IntoIterator<Item = (K, V)>,
12207        K: std::convert::Into<std::string::String>,
12208        V: std::convert::Into<std::string::String>,
12209    {
12210        use std::iter::Iterator;
12211        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12212        self
12213    }
12214
12215    /// Sets the value of [intercept_deployment_group][crate::model::InterceptEndpointGroup::intercept_deployment_group].
12216    ///
12217    /// # Example
12218    /// ```ignore,no_run
12219    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12220    /// # let project_id = "project_id";
12221    /// # let location_id = "location_id";
12222    /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
12223    /// let x = InterceptEndpointGroup::new().set_intercept_deployment_group(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
12224    /// ```
12225    pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
12226        mut self,
12227        v: T,
12228    ) -> Self {
12229        self.intercept_deployment_group = v.into();
12230        self
12231    }
12232
12233    /// Sets the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12234    ///
12235    /// # Example
12236    /// ```ignore,no_run
12237    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12238    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12239    /// let x = InterceptEndpointGroup::new().set_connected_deployment_group(ConnectedDeploymentGroup::default()/* use setters */);
12240    /// ```
12241    pub fn set_connected_deployment_group<T>(mut self, v: T) -> Self
12242    where
12243        T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12244    {
12245        self.connected_deployment_group = std::option::Option::Some(v.into());
12246        self
12247    }
12248
12249    /// Sets or clears the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12250    ///
12251    /// # Example
12252    /// ```ignore,no_run
12253    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12254    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12255    /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(Some(ConnectedDeploymentGroup::default()/* use setters */));
12256    /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(None::<ConnectedDeploymentGroup>);
12257    /// ```
12258    pub fn set_or_clear_connected_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
12259    where
12260        T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12261    {
12262        self.connected_deployment_group = v.map(|x| x.into());
12263        self
12264    }
12265
12266    /// Sets the value of [state][crate::model::InterceptEndpointGroup::state].
12267    ///
12268    /// # Example
12269    /// ```ignore,no_run
12270    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12271    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::State;
12272    /// let x0 = InterceptEndpointGroup::new().set_state(State::Active);
12273    /// let x1 = InterceptEndpointGroup::new().set_state(State::Closed);
12274    /// let x2 = InterceptEndpointGroup::new().set_state(State::Creating);
12275    /// ```
12276    pub fn set_state<T: std::convert::Into<crate::model::intercept_endpoint_group::State>>(
12277        mut self,
12278        v: T,
12279    ) -> Self {
12280        self.state = v.into();
12281        self
12282    }
12283
12284    /// Sets the value of [reconciling][crate::model::InterceptEndpointGroup::reconciling].
12285    ///
12286    /// # Example
12287    /// ```ignore,no_run
12288    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12289    /// let x = InterceptEndpointGroup::new().set_reconciling(true);
12290    /// ```
12291    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12292        self.reconciling = v.into();
12293        self
12294    }
12295
12296    /// Sets the value of [associations][crate::model::InterceptEndpointGroup::associations].
12297    ///
12298    /// # Example
12299    /// ```ignore,no_run
12300    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12301    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12302    /// let x = InterceptEndpointGroup::new()
12303    ///     .set_associations([
12304    ///         AssociationDetails::default()/* use setters */,
12305    ///         AssociationDetails::default()/* use (different) setters */,
12306    ///     ]);
12307    /// ```
12308    pub fn set_associations<T, V>(mut self, v: T) -> Self
12309    where
12310        T: std::iter::IntoIterator<Item = V>,
12311        V: std::convert::Into<crate::model::intercept_endpoint_group::AssociationDetails>,
12312    {
12313        use std::iter::Iterator;
12314        self.associations = v.into_iter().map(|i| i.into()).collect();
12315        self
12316    }
12317
12318    /// Sets the value of [description][crate::model::InterceptEndpointGroup::description].
12319    ///
12320    /// # Example
12321    /// ```ignore,no_run
12322    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12323    /// let x = InterceptEndpointGroup::new().set_description("example");
12324    /// ```
12325    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12326        self.description = v.into();
12327        self
12328    }
12329}
12330
12331impl wkt::message::Message for InterceptEndpointGroup {
12332    fn typename() -> &'static str {
12333        "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup"
12334    }
12335}
12336
12337/// Defines additional types related to [InterceptEndpointGroup].
12338pub mod intercept_endpoint_group {
12339    #[allow(unused_imports)]
12340    use super::*;
12341
12342    /// The endpoint group's view of a connected deployment group.
12343    #[derive(Clone, Default, PartialEq)]
12344    #[non_exhaustive]
12345    pub struct ConnectedDeploymentGroup {
12346        /// Output only. The connected deployment group's resource name, for example:
12347        /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12348        /// See <https://google.aip.dev/124>.
12349        pub name: std::string::String,
12350
12351        /// Output only. The list of locations where the deployment group is present.
12352        pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12353
12354        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12355    }
12356
12357    impl ConnectedDeploymentGroup {
12358        /// Creates a new default instance.
12359        pub fn new() -> Self {
12360            std::default::Default::default()
12361        }
12362
12363        /// Sets the value of [name][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::name].
12364        ///
12365        /// # Example
12366        /// ```ignore,no_run
12367        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12368        /// # let project_id = "project_id";
12369        /// # let location_id = "location_id";
12370        /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
12371        /// let x = ConnectedDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
12372        /// ```
12373        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12374            self.name = v.into();
12375            self
12376        }
12377
12378        /// Sets the value of [locations][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::locations].
12379        ///
12380        /// # Example
12381        /// ```ignore,no_run
12382        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12383        /// use google_cloud_networksecurity_v1::model::InterceptLocation;
12384        /// let x = ConnectedDeploymentGroup::new()
12385        ///     .set_locations([
12386        ///         InterceptLocation::default()/* use setters */,
12387        ///         InterceptLocation::default()/* use (different) setters */,
12388        ///     ]);
12389        /// ```
12390        pub fn set_locations<T, V>(mut self, v: T) -> Self
12391        where
12392            T: std::iter::IntoIterator<Item = V>,
12393            V: std::convert::Into<crate::model::InterceptLocation>,
12394        {
12395            use std::iter::Iterator;
12396            self.locations = v.into_iter().map(|i| i.into()).collect();
12397            self
12398        }
12399    }
12400
12401    impl wkt::message::Message for ConnectedDeploymentGroup {
12402        fn typename() -> &'static str {
12403            "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup"
12404        }
12405    }
12406
12407    /// The endpoint group's view of a connected association.
12408    #[derive(Clone, Default, PartialEq)]
12409    #[non_exhaustive]
12410    pub struct AssociationDetails {
12411        /// Output only. The connected association's resource name, for example:
12412        /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-ega`.
12413        /// See <https://google.aip.dev/124>.
12414        pub name: std::string::String,
12415
12416        /// Output only. The associated network, for example:
12417        /// projects/123456789/global/networks/my-network.
12418        /// See <https://google.aip.dev/124>.
12419        pub network: std::string::String,
12420
12421        /// Output only. Most recent known state of the association.
12422        pub state: crate::model::intercept_endpoint_group_association::State,
12423
12424        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12425    }
12426
12427    impl AssociationDetails {
12428        /// Creates a new default instance.
12429        pub fn new() -> Self {
12430            std::default::Default::default()
12431        }
12432
12433        /// Sets the value of [name][crate::model::intercept_endpoint_group::AssociationDetails::name].
12434        ///
12435        /// # Example
12436        /// ```ignore,no_run
12437        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12438        /// # let project_id = "project_id";
12439        /// # let location_id = "location_id";
12440        /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
12441        /// let x = AssociationDetails::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
12442        /// ```
12443        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12444            self.name = v.into();
12445            self
12446        }
12447
12448        /// Sets the value of [network][crate::model::intercept_endpoint_group::AssociationDetails::network].
12449        ///
12450        /// # Example
12451        /// ```ignore,no_run
12452        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12453        /// let x = AssociationDetails::new().set_network("example");
12454        /// ```
12455        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12456            self.network = v.into();
12457            self
12458        }
12459
12460        /// Sets the value of [state][crate::model::intercept_endpoint_group::AssociationDetails::state].
12461        ///
12462        /// # Example
12463        /// ```ignore,no_run
12464        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12465        /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
12466        /// let x0 = AssociationDetails::new().set_state(State::Active);
12467        /// let x1 = AssociationDetails::new().set_state(State::Creating);
12468        /// let x2 = AssociationDetails::new().set_state(State::Deleting);
12469        /// ```
12470        pub fn set_state<
12471            T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
12472        >(
12473            mut self,
12474            v: T,
12475        ) -> Self {
12476            self.state = v.into();
12477            self
12478        }
12479    }
12480
12481    impl wkt::message::Message for AssociationDetails {
12482        fn typename() -> &'static str {
12483            "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails"
12484        }
12485    }
12486
12487    /// Endpoint group state.
12488    ///
12489    /// # Working with unknown values
12490    ///
12491    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12492    /// additional enum variants at any time. Adding new variants is not considered
12493    /// a breaking change. Applications should write their code in anticipation of:
12494    ///
12495    /// - New values appearing in future releases of the client library, **and**
12496    /// - New values received dynamically, without application changes.
12497    ///
12498    /// Please consult the [Working with enums] section in the user guide for some
12499    /// guidelines.
12500    ///
12501    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12502    #[derive(Clone, Debug, PartialEq)]
12503    #[non_exhaustive]
12504    pub enum State {
12505        /// State not set (this is not a valid state).
12506        Unspecified,
12507        /// The endpoint group is ready and in sync with the target deployment group.
12508        Active,
12509        /// The deployment group backing this endpoint group has been force-deleted.
12510        /// This endpoint group cannot be used and interception is effectively
12511        /// disabled.
12512        Closed,
12513        /// The endpoint group is being created.
12514        Creating,
12515        /// The endpoint group is being deleted.
12516        Deleting,
12517        /// The endpoint group is out of sync with the backing deployment group.
12518        /// In most cases, this is a result of a transient issue within the system
12519        /// (e.g. an inaccessible location) and the system is expected to recover
12520        /// automatically. See the associations field for details per network and
12521        /// location.
12522        OutOfSync,
12523        /// An attempt to delete the endpoint group has failed. This is a terminal
12524        /// state and the endpoint group is not expected to recover.
12525        /// The only permitted operation is to retry deleting the endpoint group.
12526        DeleteFailed,
12527        /// If set, the enum was initialized with an unknown value.
12528        ///
12529        /// Applications can examine the value using [State::value] or
12530        /// [State::name].
12531        UnknownValue(state::UnknownValue),
12532    }
12533
12534    #[doc(hidden)]
12535    pub mod state {
12536        #[allow(unused_imports)]
12537        use super::*;
12538        #[derive(Clone, Debug, PartialEq)]
12539        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12540    }
12541
12542    impl State {
12543        /// Gets the enum value.
12544        ///
12545        /// Returns `None` if the enum contains an unknown value deserialized from
12546        /// the string representation of enums.
12547        pub fn value(&self) -> std::option::Option<i32> {
12548            match self {
12549                Self::Unspecified => std::option::Option::Some(0),
12550                Self::Active => std::option::Option::Some(1),
12551                Self::Closed => std::option::Option::Some(2),
12552                Self::Creating => std::option::Option::Some(3),
12553                Self::Deleting => std::option::Option::Some(4),
12554                Self::OutOfSync => std::option::Option::Some(5),
12555                Self::DeleteFailed => std::option::Option::Some(6),
12556                Self::UnknownValue(u) => u.0.value(),
12557            }
12558        }
12559
12560        /// Gets the enum value as a string.
12561        ///
12562        /// Returns `None` if the enum contains an unknown value deserialized from
12563        /// the integer representation of enums.
12564        pub fn name(&self) -> std::option::Option<&str> {
12565            match self {
12566                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12567                Self::Active => std::option::Option::Some("ACTIVE"),
12568                Self::Closed => std::option::Option::Some("CLOSED"),
12569                Self::Creating => std::option::Option::Some("CREATING"),
12570                Self::Deleting => std::option::Option::Some("DELETING"),
12571                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
12572                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
12573                Self::UnknownValue(u) => u.0.name(),
12574            }
12575        }
12576    }
12577
12578    impl std::default::Default for State {
12579        fn default() -> Self {
12580            use std::convert::From;
12581            Self::from(0)
12582        }
12583    }
12584
12585    impl std::fmt::Display for State {
12586        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12587            wkt::internal::display_enum(f, self.name(), self.value())
12588        }
12589    }
12590
12591    impl std::convert::From<i32> for State {
12592        fn from(value: i32) -> Self {
12593            match value {
12594                0 => Self::Unspecified,
12595                1 => Self::Active,
12596                2 => Self::Closed,
12597                3 => Self::Creating,
12598                4 => Self::Deleting,
12599                5 => Self::OutOfSync,
12600                6 => Self::DeleteFailed,
12601                _ => Self::UnknownValue(state::UnknownValue(
12602                    wkt::internal::UnknownEnumValue::Integer(value),
12603                )),
12604            }
12605        }
12606    }
12607
12608    impl std::convert::From<&str> for State {
12609        fn from(value: &str) -> Self {
12610            use std::string::ToString;
12611            match value {
12612                "STATE_UNSPECIFIED" => Self::Unspecified,
12613                "ACTIVE" => Self::Active,
12614                "CLOSED" => Self::Closed,
12615                "CREATING" => Self::Creating,
12616                "DELETING" => Self::Deleting,
12617                "OUT_OF_SYNC" => Self::OutOfSync,
12618                "DELETE_FAILED" => Self::DeleteFailed,
12619                _ => Self::UnknownValue(state::UnknownValue(
12620                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12621                )),
12622            }
12623        }
12624    }
12625
12626    impl serde::ser::Serialize for State {
12627        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12628        where
12629            S: serde::Serializer,
12630        {
12631            match self {
12632                Self::Unspecified => serializer.serialize_i32(0),
12633                Self::Active => serializer.serialize_i32(1),
12634                Self::Closed => serializer.serialize_i32(2),
12635                Self::Creating => serializer.serialize_i32(3),
12636                Self::Deleting => serializer.serialize_i32(4),
12637                Self::OutOfSync => serializer.serialize_i32(5),
12638                Self::DeleteFailed => serializer.serialize_i32(6),
12639                Self::UnknownValue(u) => u.0.serialize(serializer),
12640            }
12641        }
12642    }
12643
12644    impl<'de> serde::de::Deserialize<'de> for State {
12645        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12646        where
12647            D: serde::Deserializer<'de>,
12648        {
12649            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12650                ".google.cloud.networksecurity.v1.InterceptEndpointGroup.State",
12651            ))
12652        }
12653    }
12654}
12655
12656/// Request message for ListInterceptEndpointGroups.
12657#[derive(Clone, Default, PartialEq)]
12658#[non_exhaustive]
12659pub struct ListInterceptEndpointGroupsRequest {
12660    /// Required. The parent, which owns this collection of endpoint groups.
12661    /// Example: `projects/123456789/locations/global`.
12662    /// See <https://google.aip.dev/132> for more details.
12663    pub parent: std::string::String,
12664
12665    /// Optional. Requested page size. Server may return fewer items than
12666    /// requested. If unspecified, server will pick an appropriate default. See
12667    /// <https://google.aip.dev/158> for more details.
12668    pub page_size: i32,
12669
12670    /// Optional. A page token, received from a previous
12671    /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
12672    /// page. When paginating, all other parameters provided to
12673    /// `ListInterceptEndpointGroups` must match the call that provided the page
12674    /// token.
12675    /// See <https://google.aip.dev/158> for more details.
12676    pub page_token: std::string::String,
12677
12678    /// Optional. Filter expression.
12679    /// See <https://google.aip.dev/160#filtering> for more details.
12680    pub filter: std::string::String,
12681
12682    /// Optional. Sort expression.
12683    /// See <https://google.aip.dev/132#ordering> for more details.
12684    pub order_by: std::string::String,
12685
12686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12687}
12688
12689impl ListInterceptEndpointGroupsRequest {
12690    /// Creates a new default instance.
12691    pub fn new() -> Self {
12692        std::default::Default::default()
12693    }
12694
12695    /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
12696    ///
12697    /// # Example
12698    /// ```ignore,no_run
12699    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12700    /// # let project_id = "project_id";
12701    /// # let location_id = "location_id";
12702    /// let x = ListInterceptEndpointGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
12703    /// ```
12704    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12705        self.parent = v.into();
12706        self
12707    }
12708
12709    /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
12710    ///
12711    /// # Example
12712    /// ```ignore,no_run
12713    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12714    /// let x = ListInterceptEndpointGroupsRequest::new().set_page_size(42);
12715    /// ```
12716    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12717        self.page_size = v.into();
12718        self
12719    }
12720
12721    /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
12722    ///
12723    /// # Example
12724    /// ```ignore,no_run
12725    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12726    /// let x = ListInterceptEndpointGroupsRequest::new().set_page_token("example");
12727    /// ```
12728    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12729        self.page_token = v.into();
12730        self
12731    }
12732
12733    /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
12734    ///
12735    /// # Example
12736    /// ```ignore,no_run
12737    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12738    /// let x = ListInterceptEndpointGroupsRequest::new().set_filter("example");
12739    /// ```
12740    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12741        self.filter = v.into();
12742        self
12743    }
12744
12745    /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
12746    ///
12747    /// # Example
12748    /// ```ignore,no_run
12749    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12750    /// let x = ListInterceptEndpointGroupsRequest::new().set_order_by("example");
12751    /// ```
12752    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12753        self.order_by = v.into();
12754        self
12755    }
12756}
12757
12758impl wkt::message::Message for ListInterceptEndpointGroupsRequest {
12759    fn typename() -> &'static str {
12760        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest"
12761    }
12762}
12763
12764/// Response message for ListInterceptEndpointGroups.
12765#[derive(Clone, Default, PartialEq)]
12766#[non_exhaustive]
12767pub struct ListInterceptEndpointGroupsResponse {
12768    /// The endpoint groups from the specified parent.
12769    pub intercept_endpoint_groups: std::vec::Vec<crate::model::InterceptEndpointGroup>,
12770
12771    /// A token that can be sent as `page_token` to retrieve the next page.
12772    /// If this field is omitted, there are no subsequent pages.
12773    /// See <https://google.aip.dev/158> for more details.
12774    pub next_page_token: std::string::String,
12775
12776    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12777}
12778
12779impl ListInterceptEndpointGroupsResponse {
12780    /// Creates a new default instance.
12781    pub fn new() -> Self {
12782        std::default::Default::default()
12783    }
12784
12785    /// Sets the value of [intercept_endpoint_groups][crate::model::ListInterceptEndpointGroupsResponse::intercept_endpoint_groups].
12786    ///
12787    /// # Example
12788    /// ```ignore,no_run
12789    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12790    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12791    /// let x = ListInterceptEndpointGroupsResponse::new()
12792    ///     .set_intercept_endpoint_groups([
12793    ///         InterceptEndpointGroup::default()/* use setters */,
12794    ///         InterceptEndpointGroup::default()/* use (different) setters */,
12795    ///     ]);
12796    /// ```
12797    pub fn set_intercept_endpoint_groups<T, V>(mut self, v: T) -> Self
12798    where
12799        T: std::iter::IntoIterator<Item = V>,
12800        V: std::convert::Into<crate::model::InterceptEndpointGroup>,
12801    {
12802        use std::iter::Iterator;
12803        self.intercept_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
12804        self
12805    }
12806
12807    /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupsResponse::next_page_token].
12808    ///
12809    /// # Example
12810    /// ```ignore,no_run
12811    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12812    /// let x = ListInterceptEndpointGroupsResponse::new().set_next_page_token("example");
12813    /// ```
12814    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12815        self.next_page_token = v.into();
12816        self
12817    }
12818}
12819
12820impl wkt::message::Message for ListInterceptEndpointGroupsResponse {
12821    fn typename() -> &'static str {
12822        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse"
12823    }
12824}
12825
12826#[doc(hidden)]
12827impl google_cloud_gax::paginator::internal::PageableResponse
12828    for ListInterceptEndpointGroupsResponse
12829{
12830    type PageItem = crate::model::InterceptEndpointGroup;
12831
12832    fn items(self) -> std::vec::Vec<Self::PageItem> {
12833        self.intercept_endpoint_groups
12834    }
12835
12836    fn next_page_token(&self) -> std::string::String {
12837        use std::clone::Clone;
12838        self.next_page_token.clone()
12839    }
12840}
12841
12842/// Request message for GetInterceptEndpointGroup.
12843#[derive(Clone, Default, PartialEq)]
12844#[non_exhaustive]
12845pub struct GetInterceptEndpointGroupRequest {
12846    /// Required. The name of the endpoint group to retrieve.
12847    /// Format:
12848    /// projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}
12849    pub name: std::string::String,
12850
12851    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12852}
12853
12854impl GetInterceptEndpointGroupRequest {
12855    /// Creates a new default instance.
12856    pub fn new() -> Self {
12857        std::default::Default::default()
12858    }
12859
12860    /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
12861    ///
12862    /// # Example
12863    /// ```ignore,no_run
12864    /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupRequest;
12865    /// # let project_id = "project_id";
12866    /// # let location_id = "location_id";
12867    /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
12868    /// let x = GetInterceptEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
12869    /// ```
12870    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12871        self.name = v.into();
12872        self
12873    }
12874}
12875
12876impl wkt::message::Message for GetInterceptEndpointGroupRequest {
12877    fn typename() -> &'static str {
12878        "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest"
12879    }
12880}
12881
12882/// Request message for CreateInterceptEndpointGroup.
12883#[derive(Clone, Default, PartialEq)]
12884#[non_exhaustive]
12885pub struct CreateInterceptEndpointGroupRequest {
12886    /// Required. The parent resource where this endpoint group will be created.
12887    /// Format: projects/{project}/locations/{location}
12888    pub parent: std::string::String,
12889
12890    /// Required. The ID to use for the endpoint group, which will become the final
12891    /// component of the endpoint group's resource name.
12892    pub intercept_endpoint_group_id: std::string::String,
12893
12894    /// Required. The endpoint group to create.
12895    pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12896
12897    /// Optional. A unique identifier for this request. Must be a UUID4.
12898    /// This request is only idempotent if a `request_id` is provided.
12899    /// See <https://google.aip.dev/155> for more details.
12900    pub request_id: std::string::String,
12901
12902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12903}
12904
12905impl CreateInterceptEndpointGroupRequest {
12906    /// Creates a new default instance.
12907    pub fn new() -> Self {
12908        std::default::Default::default()
12909    }
12910
12911    /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
12912    ///
12913    /// # Example
12914    /// ```ignore,no_run
12915    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12916    /// # let project_id = "project_id";
12917    /// # let location_id = "location_id";
12918    /// let x = CreateInterceptEndpointGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
12919    /// ```
12920    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12921        self.parent = v.into();
12922        self
12923    }
12924
12925    /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
12926    ///
12927    /// # Example
12928    /// ```ignore,no_run
12929    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12930    /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group_id("example");
12931    /// ```
12932    pub fn set_intercept_endpoint_group_id<T: std::convert::Into<std::string::String>>(
12933        mut self,
12934        v: T,
12935    ) -> Self {
12936        self.intercept_endpoint_group_id = v.into();
12937        self
12938    }
12939
12940    /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12941    ///
12942    /// # Example
12943    /// ```ignore,no_run
12944    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12945    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12946    /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12947    /// ```
12948    pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12949    where
12950        T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12951    {
12952        self.intercept_endpoint_group = std::option::Option::Some(v.into());
12953        self
12954    }
12955
12956    /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12957    ///
12958    /// # Example
12959    /// ```ignore,no_run
12960    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12961    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12962    /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12963    /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12964    /// ```
12965    pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12966    where
12967        T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12968    {
12969        self.intercept_endpoint_group = v.map(|x| x.into());
12970        self
12971    }
12972
12973    /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
12974    ///
12975    /// # Example
12976    /// ```ignore,no_run
12977    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12978    /// let x = CreateInterceptEndpointGroupRequest::new().set_request_id("example");
12979    /// ```
12980    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12981        self.request_id = v.into();
12982        self
12983    }
12984}
12985
12986impl wkt::message::Message for CreateInterceptEndpointGroupRequest {
12987    fn typename() -> &'static str {
12988        "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest"
12989    }
12990}
12991
12992/// Request message for UpdateInterceptEndpointGroup.
12993#[derive(Clone, Default, PartialEq)]
12994#[non_exhaustive]
12995pub struct UpdateInterceptEndpointGroupRequest {
12996    /// Optional. The list of fields to update.
12997    /// Fields are specified relative to the endpoint group
12998    /// (e.g. `description`; *not* `intercept_endpoint_group.description`).
12999    /// See <https://google.aip.dev/161> for more details.
13000    pub update_mask: std::option::Option<wkt::FieldMask>,
13001
13002    /// Required. The endpoint group to update.
13003    pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
13004
13005    /// Optional. A unique identifier for this request. Must be a UUID4.
13006    /// This request is only idempotent if a `request_id` is provided.
13007    /// See <https://google.aip.dev/155> for more details.
13008    pub request_id: std::string::String,
13009
13010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13011}
13012
13013impl UpdateInterceptEndpointGroupRequest {
13014    /// Creates a new default instance.
13015    pub fn new() -> Self {
13016        std::default::Default::default()
13017    }
13018
13019    /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
13020    ///
13021    /// # Example
13022    /// ```ignore,no_run
13023    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13024    /// use wkt::FieldMask;
13025    /// let x = UpdateInterceptEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13026    /// ```
13027    pub fn set_update_mask<T>(mut self, v: T) -> Self
13028    where
13029        T: std::convert::Into<wkt::FieldMask>,
13030    {
13031        self.update_mask = std::option::Option::Some(v.into());
13032        self
13033    }
13034
13035    /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
13036    ///
13037    /// # Example
13038    /// ```ignore,no_run
13039    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13040    /// use wkt::FieldMask;
13041    /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13042    /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13043    /// ```
13044    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13045    where
13046        T: std::convert::Into<wkt::FieldMask>,
13047    {
13048        self.update_mask = v.map(|x| x.into());
13049        self
13050    }
13051
13052    /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
13053    ///
13054    /// # Example
13055    /// ```ignore,no_run
13056    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13057    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
13058    /// let x = UpdateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
13059    /// ```
13060    pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
13061    where
13062        T: std::convert::Into<crate::model::InterceptEndpointGroup>,
13063    {
13064        self.intercept_endpoint_group = std::option::Option::Some(v.into());
13065        self
13066    }
13067
13068    /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
13069    ///
13070    /// # Example
13071    /// ```ignore,no_run
13072    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13073    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
13074    /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
13075    /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
13076    /// ```
13077    pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
13078    where
13079        T: std::convert::Into<crate::model::InterceptEndpointGroup>,
13080    {
13081        self.intercept_endpoint_group = v.map(|x| x.into());
13082        self
13083    }
13084
13085    /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
13086    ///
13087    /// # Example
13088    /// ```ignore,no_run
13089    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13090    /// let x = UpdateInterceptEndpointGroupRequest::new().set_request_id("example");
13091    /// ```
13092    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13093        self.request_id = v.into();
13094        self
13095    }
13096}
13097
13098impl wkt::message::Message for UpdateInterceptEndpointGroupRequest {
13099    fn typename() -> &'static str {
13100        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest"
13101    }
13102}
13103
13104/// Request message for DeleteInterceptEndpointGroup.
13105#[derive(Clone, Default, PartialEq)]
13106#[non_exhaustive]
13107pub struct DeleteInterceptEndpointGroupRequest {
13108    /// Required. The endpoint group to delete.
13109    pub name: std::string::String,
13110
13111    /// Optional. A unique identifier for this request. Must be a UUID4.
13112    /// This request is only idempotent if a `request_id` is provided.
13113    /// See <https://google.aip.dev/155> for more details.
13114    pub request_id: std::string::String,
13115
13116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13117}
13118
13119impl DeleteInterceptEndpointGroupRequest {
13120    /// Creates a new default instance.
13121    pub fn new() -> Self {
13122        std::default::Default::default()
13123    }
13124
13125    /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
13126    ///
13127    /// # Example
13128    /// ```ignore,no_run
13129    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
13130    /// # let project_id = "project_id";
13131    /// # let location_id = "location_id";
13132    /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
13133    /// let x = DeleteInterceptEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
13134    /// ```
13135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13136        self.name = v.into();
13137        self
13138    }
13139
13140    /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
13141    ///
13142    /// # Example
13143    /// ```ignore,no_run
13144    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
13145    /// let x = DeleteInterceptEndpointGroupRequest::new().set_request_id("example");
13146    /// ```
13147    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13148        self.request_id = v.into();
13149        self
13150    }
13151}
13152
13153impl wkt::message::Message for DeleteInterceptEndpointGroupRequest {
13154    fn typename() -> &'static str {
13155        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest"
13156    }
13157}
13158
13159/// An endpoint group association represents a link between a network and an
13160/// endpoint group in the organization.
13161///
13162/// Creating an association creates the networking infrastructure linking the
13163/// network to the endpoint group, but does not enable intercept by itself.
13164/// To enable intercept, the user must also create a network firewall policy
13165/// containing intercept rules and associate it with the network.
13166#[derive(Clone, Default, PartialEq)]
13167#[non_exhaustive]
13168pub struct InterceptEndpointGroupAssociation {
13169    /// Immutable. Identifier. The resource name of this endpoint group
13170    /// association, for example:
13171    /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association`.
13172    /// See <https://google.aip.dev/122> for more details.
13173    pub name: std::string::String,
13174
13175    /// Output only. The timestamp when the resource was created.
13176    /// See <https://google.aip.dev/148#timestamps>.
13177    pub create_time: std::option::Option<wkt::Timestamp>,
13178
13179    /// Output only. The timestamp when the resource was most recently updated.
13180    /// See <https://google.aip.dev/148#timestamps>.
13181    pub update_time: std::option::Option<wkt::Timestamp>,
13182
13183    /// Optional. Labels are key/value pairs that help to organize and filter
13184    /// resources.
13185    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13186
13187    /// Required. Immutable. The endpoint group that this association is connected
13188    /// to, for example:
13189    /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
13190    /// See <https://google.aip.dev/124>.
13191    pub intercept_endpoint_group: std::string::String,
13192
13193    /// Required. Immutable. The VPC network that is associated. for example:
13194    /// `projects/123456789/global/networks/my-network`.
13195    /// See <https://google.aip.dev/124>.
13196    pub network: std::string::String,
13197
13198    /// Output only. The list of locations where the association is present. This
13199    /// information is retrieved from the linked endpoint group, and not configured
13200    /// as part of the association itself.
13201    #[deprecated]
13202    pub locations_details:
13203        std::vec::Vec<crate::model::intercept_endpoint_group_association::LocationDetails>,
13204
13205    /// Output only. Current state of the endpoint group association.
13206    pub state: crate::model::intercept_endpoint_group_association::State,
13207
13208    /// Output only. The current state of the resource does not match the user's
13209    /// intended state, and the system is working to reconcile them. This part of
13210    /// the normal operation (e.g. adding a new location to the target deployment
13211    /// group). See <https://google.aip.dev/128>.
13212    pub reconciling: bool,
13213
13214    /// Output only. The list of locations where the association is configured.
13215    /// This information is retrieved from the linked endpoint group.
13216    pub locations: std::vec::Vec<crate::model::InterceptLocation>,
13217
13218    /// Output only. Identifier used by the data-path.
13219    /// See the NSI GENEVE format for more details:
13220    /// <https://docs.cloud.google.com/network-security-integration/docs/understand-geneve#network_id>
13221    pub network_cookie: u32,
13222
13223    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13224}
13225
13226impl InterceptEndpointGroupAssociation {
13227    /// Creates a new default instance.
13228    pub fn new() -> Self {
13229        std::default::Default::default()
13230    }
13231
13232    /// Sets the value of [name][crate::model::InterceptEndpointGroupAssociation::name].
13233    ///
13234    /// # Example
13235    /// ```ignore,no_run
13236    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13237    /// # let project_id = "project_id";
13238    /// # let location_id = "location_id";
13239    /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
13240    /// let x = InterceptEndpointGroupAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
13241    /// ```
13242    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13243        self.name = v.into();
13244        self
13245    }
13246
13247    /// Sets the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13248    ///
13249    /// # Example
13250    /// ```ignore,no_run
13251    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13252    /// use wkt::Timestamp;
13253    /// let x = InterceptEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
13254    /// ```
13255    pub fn set_create_time<T>(mut self, v: T) -> Self
13256    where
13257        T: std::convert::Into<wkt::Timestamp>,
13258    {
13259        self.create_time = std::option::Option::Some(v.into());
13260        self
13261    }
13262
13263    /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13264    ///
13265    /// # Example
13266    /// ```ignore,no_run
13267    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13268    /// use wkt::Timestamp;
13269    /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13270    /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
13271    /// ```
13272    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13273    where
13274        T: std::convert::Into<wkt::Timestamp>,
13275    {
13276        self.create_time = v.map(|x| x.into());
13277        self
13278    }
13279
13280    /// Sets the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13281    ///
13282    /// # Example
13283    /// ```ignore,no_run
13284    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13285    /// use wkt::Timestamp;
13286    /// let x = InterceptEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
13287    /// ```
13288    pub fn set_update_time<T>(mut self, v: T) -> Self
13289    where
13290        T: std::convert::Into<wkt::Timestamp>,
13291    {
13292        self.update_time = std::option::Option::Some(v.into());
13293        self
13294    }
13295
13296    /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13297    ///
13298    /// # Example
13299    /// ```ignore,no_run
13300    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13301    /// use wkt::Timestamp;
13302    /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13303    /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
13304    /// ```
13305    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13306    where
13307        T: std::convert::Into<wkt::Timestamp>,
13308    {
13309        self.update_time = v.map(|x| x.into());
13310        self
13311    }
13312
13313    /// Sets the value of [labels][crate::model::InterceptEndpointGroupAssociation::labels].
13314    ///
13315    /// # Example
13316    /// ```ignore,no_run
13317    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13318    /// let x = InterceptEndpointGroupAssociation::new().set_labels([
13319    ///     ("key0", "abc"),
13320    ///     ("key1", "xyz"),
13321    /// ]);
13322    /// ```
13323    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13324    where
13325        T: std::iter::IntoIterator<Item = (K, V)>,
13326        K: std::convert::Into<std::string::String>,
13327        V: std::convert::Into<std::string::String>,
13328    {
13329        use std::iter::Iterator;
13330        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13331        self
13332    }
13333
13334    /// Sets the value of [intercept_endpoint_group][crate::model::InterceptEndpointGroupAssociation::intercept_endpoint_group].
13335    ///
13336    /// # Example
13337    /// ```ignore,no_run
13338    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13339    /// # let project_id = "project_id";
13340    /// # let location_id = "location_id";
13341    /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
13342    /// let x = InterceptEndpointGroupAssociation::new().set_intercept_endpoint_group(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
13343    /// ```
13344    pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
13345        mut self,
13346        v: T,
13347    ) -> Self {
13348        self.intercept_endpoint_group = v.into();
13349        self
13350    }
13351
13352    /// Sets the value of [network][crate::model::InterceptEndpointGroupAssociation::network].
13353    ///
13354    /// # Example
13355    /// ```ignore,no_run
13356    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13357    /// let x = InterceptEndpointGroupAssociation::new().set_network("example");
13358    /// ```
13359    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13360        self.network = v.into();
13361        self
13362    }
13363
13364    /// Sets the value of [locations_details][crate::model::InterceptEndpointGroupAssociation::locations_details].
13365    ///
13366    /// # Example
13367    /// ```ignore,no_run
13368    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13369    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13370    /// let x = InterceptEndpointGroupAssociation::new()
13371    ///     .set_locations_details([
13372    ///         LocationDetails::default()/* use setters */,
13373    ///         LocationDetails::default()/* use (different) setters */,
13374    ///     ]);
13375    /// ```
13376    #[deprecated]
13377    pub fn set_locations_details<T, V>(mut self, v: T) -> Self
13378    where
13379        T: std::iter::IntoIterator<Item = V>,
13380        V: std::convert::Into<crate::model::intercept_endpoint_group_association::LocationDetails>,
13381    {
13382        use std::iter::Iterator;
13383        self.locations_details = v.into_iter().map(|i| i.into()).collect();
13384        self
13385    }
13386
13387    /// Sets the value of [state][crate::model::InterceptEndpointGroupAssociation::state].
13388    ///
13389    /// # Example
13390    /// ```ignore,no_run
13391    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13392    /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
13393    /// let x0 = InterceptEndpointGroupAssociation::new().set_state(State::Active);
13394    /// let x1 = InterceptEndpointGroupAssociation::new().set_state(State::Creating);
13395    /// let x2 = InterceptEndpointGroupAssociation::new().set_state(State::Deleting);
13396    /// ```
13397    pub fn set_state<
13398        T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
13399    >(
13400        mut self,
13401        v: T,
13402    ) -> Self {
13403        self.state = v.into();
13404        self
13405    }
13406
13407    /// Sets the value of [reconciling][crate::model::InterceptEndpointGroupAssociation::reconciling].
13408    ///
13409    /// # Example
13410    /// ```ignore,no_run
13411    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13412    /// let x = InterceptEndpointGroupAssociation::new().set_reconciling(true);
13413    /// ```
13414    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13415        self.reconciling = v.into();
13416        self
13417    }
13418
13419    /// Sets the value of [locations][crate::model::InterceptEndpointGroupAssociation::locations].
13420    ///
13421    /// # Example
13422    /// ```ignore,no_run
13423    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13424    /// use google_cloud_networksecurity_v1::model::InterceptLocation;
13425    /// let x = InterceptEndpointGroupAssociation::new()
13426    ///     .set_locations([
13427    ///         InterceptLocation::default()/* use setters */,
13428    ///         InterceptLocation::default()/* use (different) setters */,
13429    ///     ]);
13430    /// ```
13431    pub fn set_locations<T, V>(mut self, v: T) -> Self
13432    where
13433        T: std::iter::IntoIterator<Item = V>,
13434        V: std::convert::Into<crate::model::InterceptLocation>,
13435    {
13436        use std::iter::Iterator;
13437        self.locations = v.into_iter().map(|i| i.into()).collect();
13438        self
13439    }
13440
13441    /// Sets the value of [network_cookie][crate::model::InterceptEndpointGroupAssociation::network_cookie].
13442    ///
13443    /// # Example
13444    /// ```ignore,no_run
13445    /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13446    /// let x = InterceptEndpointGroupAssociation::new().set_network_cookie(42_u32);
13447    /// ```
13448    pub fn set_network_cookie<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
13449        self.network_cookie = v.into();
13450        self
13451    }
13452}
13453
13454impl wkt::message::Message for InterceptEndpointGroupAssociation {
13455    fn typename() -> &'static str {
13456        "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation"
13457    }
13458}
13459
13460/// Defines additional types related to [InterceptEndpointGroupAssociation].
13461pub mod intercept_endpoint_group_association {
13462    #[allow(unused_imports)]
13463    use super::*;
13464
13465    /// Contains details about the state of an association in a specific cloud
13466    /// location.
13467    #[derive(Clone, Default, PartialEq)]
13468    #[non_exhaustive]
13469    pub struct LocationDetails {
13470        /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
13471        pub location: std::string::String,
13472
13473        /// Output only. The current state of the association in this location.
13474        pub state: crate::model::intercept_endpoint_group_association::location_details::State,
13475
13476        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13477    }
13478
13479    impl LocationDetails {
13480        /// Creates a new default instance.
13481        pub fn new() -> Self {
13482            std::default::Default::default()
13483        }
13484
13485        /// Sets the value of [location][crate::model::intercept_endpoint_group_association::LocationDetails::location].
13486        ///
13487        /// # Example
13488        /// ```ignore,no_run
13489        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13490        /// let x = LocationDetails::new().set_location("example");
13491        /// ```
13492        pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13493            self.location = v.into();
13494            self
13495        }
13496
13497        /// Sets the value of [state][crate::model::intercept_endpoint_group_association::LocationDetails::state].
13498        ///
13499        /// # Example
13500        /// ```ignore,no_run
13501        /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13502        /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::location_details::State;
13503        /// let x0 = LocationDetails::new().set_state(State::Active);
13504        /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
13505        /// ```
13506        pub fn set_state<
13507            T: std::convert::Into<
13508                    crate::model::intercept_endpoint_group_association::location_details::State,
13509                >,
13510        >(
13511            mut self,
13512            v: T,
13513        ) -> Self {
13514            self.state = v.into();
13515            self
13516        }
13517    }
13518
13519    impl wkt::message::Message for LocationDetails {
13520        fn typename() -> &'static str {
13521            "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails"
13522        }
13523    }
13524
13525    /// Defines additional types related to [LocationDetails].
13526    pub mod location_details {
13527        #[allow(unused_imports)]
13528        use super::*;
13529
13530        /// The state of association.
13531        ///
13532        /// # Working with unknown values
13533        ///
13534        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13535        /// additional enum variants at any time. Adding new variants is not considered
13536        /// a breaking change. Applications should write their code in anticipation of:
13537        ///
13538        /// - New values appearing in future releases of the client library, **and**
13539        /// - New values received dynamically, without application changes.
13540        ///
13541        /// Please consult the [Working with enums] section in the user guide for some
13542        /// guidelines.
13543        ///
13544        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13545        #[derive(Clone, Debug, PartialEq)]
13546        #[non_exhaustive]
13547        pub enum State {
13548            /// Not set.
13549            Unspecified,
13550            /// The association is ready and in sync with the linked endpoint group.
13551            Active,
13552            /// The association is out of sync with the linked endpoint group.
13553            /// In most cases, this is a result of a transient issue within the system
13554            /// (e.g. an inaccessible location) and the system is expected to recover
13555            /// automatically.
13556            OutOfSync,
13557            /// If set, the enum was initialized with an unknown value.
13558            ///
13559            /// Applications can examine the value using [State::value] or
13560            /// [State::name].
13561            UnknownValue(state::UnknownValue),
13562        }
13563
13564        #[doc(hidden)]
13565        pub mod state {
13566            #[allow(unused_imports)]
13567            use super::*;
13568            #[derive(Clone, Debug, PartialEq)]
13569            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13570        }
13571
13572        impl State {
13573            /// Gets the enum value.
13574            ///
13575            /// Returns `None` if the enum contains an unknown value deserialized from
13576            /// the string representation of enums.
13577            pub fn value(&self) -> std::option::Option<i32> {
13578                match self {
13579                    Self::Unspecified => std::option::Option::Some(0),
13580                    Self::Active => std::option::Option::Some(1),
13581                    Self::OutOfSync => std::option::Option::Some(2),
13582                    Self::UnknownValue(u) => u.0.value(),
13583                }
13584            }
13585
13586            /// Gets the enum value as a string.
13587            ///
13588            /// Returns `None` if the enum contains an unknown value deserialized from
13589            /// the integer representation of enums.
13590            pub fn name(&self) -> std::option::Option<&str> {
13591                match self {
13592                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13593                    Self::Active => std::option::Option::Some("ACTIVE"),
13594                    Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13595                    Self::UnknownValue(u) => u.0.name(),
13596                }
13597            }
13598        }
13599
13600        impl std::default::Default for State {
13601            fn default() -> Self {
13602                use std::convert::From;
13603                Self::from(0)
13604            }
13605        }
13606
13607        impl std::fmt::Display for State {
13608            fn fmt(
13609                &self,
13610                f: &mut std::fmt::Formatter<'_>,
13611            ) -> std::result::Result<(), std::fmt::Error> {
13612                wkt::internal::display_enum(f, self.name(), self.value())
13613            }
13614        }
13615
13616        impl std::convert::From<i32> for State {
13617            fn from(value: i32) -> Self {
13618                match value {
13619                    0 => Self::Unspecified,
13620                    1 => Self::Active,
13621                    2 => Self::OutOfSync,
13622                    _ => Self::UnknownValue(state::UnknownValue(
13623                        wkt::internal::UnknownEnumValue::Integer(value),
13624                    )),
13625                }
13626            }
13627        }
13628
13629        impl std::convert::From<&str> for State {
13630            fn from(value: &str) -> Self {
13631                use std::string::ToString;
13632                match value {
13633                    "STATE_UNSPECIFIED" => Self::Unspecified,
13634                    "ACTIVE" => Self::Active,
13635                    "OUT_OF_SYNC" => Self::OutOfSync,
13636                    _ => Self::UnknownValue(state::UnknownValue(
13637                        wkt::internal::UnknownEnumValue::String(value.to_string()),
13638                    )),
13639                }
13640            }
13641        }
13642
13643        impl serde::ser::Serialize for State {
13644            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13645            where
13646                S: serde::Serializer,
13647            {
13648                match self {
13649                    Self::Unspecified => serializer.serialize_i32(0),
13650                    Self::Active => serializer.serialize_i32(1),
13651                    Self::OutOfSync => serializer.serialize_i32(2),
13652                    Self::UnknownValue(u) => u.0.serialize(serializer),
13653                }
13654            }
13655        }
13656
13657        impl<'de> serde::de::Deserialize<'de> for State {
13658            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13659            where
13660                D: serde::Deserializer<'de>,
13661            {
13662                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13663                    ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State"))
13664            }
13665        }
13666    }
13667
13668    /// The state of the association.
13669    ///
13670    /// # Working with unknown values
13671    ///
13672    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13673    /// additional enum variants at any time. Adding new variants is not considered
13674    /// a breaking change. Applications should write their code in anticipation of:
13675    ///
13676    /// - New values appearing in future releases of the client library, **and**
13677    /// - New values received dynamically, without application changes.
13678    ///
13679    /// Please consult the [Working with enums] section in the user guide for some
13680    /// guidelines.
13681    ///
13682    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13683    #[derive(Clone, Debug, PartialEq)]
13684    #[non_exhaustive]
13685    pub enum State {
13686        /// Not set.
13687        Unspecified,
13688        /// The association is ready and in sync with the linked endpoint group.
13689        Active,
13690        /// The association is being created.
13691        Creating,
13692        /// The association is being deleted.
13693        Deleting,
13694        /// The association is disabled due to a breaking change in another resource.
13695        Closed,
13696        /// The association is out of sync with the linked endpoint group.
13697        /// In most cases, this is a result of a transient issue within the system
13698        /// (e.g. an inaccessible location) and the system is expected to recover
13699        /// automatically. Check the `locations_details` field for more details.
13700        OutOfSync,
13701        /// An attempt to delete the association has failed. This is a terminal state
13702        /// and the association is not expected to be usable as some of its resources
13703        /// have been deleted.
13704        /// The only permitted operation is to retry deleting the association.
13705        DeleteFailed,
13706        /// If set, the enum was initialized with an unknown value.
13707        ///
13708        /// Applications can examine the value using [State::value] or
13709        /// [State::name].
13710        UnknownValue(state::UnknownValue),
13711    }
13712
13713    #[doc(hidden)]
13714    pub mod state {
13715        #[allow(unused_imports)]
13716        use super::*;
13717        #[derive(Clone, Debug, PartialEq)]
13718        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13719    }
13720
13721    impl State {
13722        /// Gets the enum value.
13723        ///
13724        /// Returns `None` if the enum contains an unknown value deserialized from
13725        /// the string representation of enums.
13726        pub fn value(&self) -> std::option::Option<i32> {
13727            match self {
13728                Self::Unspecified => std::option::Option::Some(0),
13729                Self::Active => std::option::Option::Some(1),
13730                Self::Creating => std::option::Option::Some(2),
13731                Self::Deleting => std::option::Option::Some(3),
13732                Self::Closed => std::option::Option::Some(4),
13733                Self::OutOfSync => std::option::Option::Some(5),
13734                Self::DeleteFailed => std::option::Option::Some(6),
13735                Self::UnknownValue(u) => u.0.value(),
13736            }
13737        }
13738
13739        /// Gets the enum value as a string.
13740        ///
13741        /// Returns `None` if the enum contains an unknown value deserialized from
13742        /// the integer representation of enums.
13743        pub fn name(&self) -> std::option::Option<&str> {
13744            match self {
13745                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13746                Self::Active => std::option::Option::Some("ACTIVE"),
13747                Self::Creating => std::option::Option::Some("CREATING"),
13748                Self::Deleting => std::option::Option::Some("DELETING"),
13749                Self::Closed => std::option::Option::Some("CLOSED"),
13750                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13751                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
13752                Self::UnknownValue(u) => u.0.name(),
13753            }
13754        }
13755    }
13756
13757    impl std::default::Default for State {
13758        fn default() -> Self {
13759            use std::convert::From;
13760            Self::from(0)
13761        }
13762    }
13763
13764    impl std::fmt::Display for State {
13765        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13766            wkt::internal::display_enum(f, self.name(), self.value())
13767        }
13768    }
13769
13770    impl std::convert::From<i32> for State {
13771        fn from(value: i32) -> Self {
13772            match value {
13773                0 => Self::Unspecified,
13774                1 => Self::Active,
13775                2 => Self::Creating,
13776                3 => Self::Deleting,
13777                4 => Self::Closed,
13778                5 => Self::OutOfSync,
13779                6 => Self::DeleteFailed,
13780                _ => Self::UnknownValue(state::UnknownValue(
13781                    wkt::internal::UnknownEnumValue::Integer(value),
13782                )),
13783            }
13784        }
13785    }
13786
13787    impl std::convert::From<&str> for State {
13788        fn from(value: &str) -> Self {
13789            use std::string::ToString;
13790            match value {
13791                "STATE_UNSPECIFIED" => Self::Unspecified,
13792                "ACTIVE" => Self::Active,
13793                "CREATING" => Self::Creating,
13794                "DELETING" => Self::Deleting,
13795                "CLOSED" => Self::Closed,
13796                "OUT_OF_SYNC" => Self::OutOfSync,
13797                "DELETE_FAILED" => Self::DeleteFailed,
13798                _ => Self::UnknownValue(state::UnknownValue(
13799                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13800                )),
13801            }
13802        }
13803    }
13804
13805    impl serde::ser::Serialize for State {
13806        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13807        where
13808            S: serde::Serializer,
13809        {
13810            match self {
13811                Self::Unspecified => serializer.serialize_i32(0),
13812                Self::Active => serializer.serialize_i32(1),
13813                Self::Creating => serializer.serialize_i32(2),
13814                Self::Deleting => serializer.serialize_i32(3),
13815                Self::Closed => serializer.serialize_i32(4),
13816                Self::OutOfSync => serializer.serialize_i32(5),
13817                Self::DeleteFailed => serializer.serialize_i32(6),
13818                Self::UnknownValue(u) => u.0.serialize(serializer),
13819            }
13820        }
13821    }
13822
13823    impl<'de> serde::de::Deserialize<'de> for State {
13824        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13825        where
13826            D: serde::Deserializer<'de>,
13827        {
13828            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13829                ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State",
13830            ))
13831        }
13832    }
13833}
13834
13835/// Request message for ListInterceptEndpointGroupAssociations.
13836#[derive(Clone, Default, PartialEq)]
13837#[non_exhaustive]
13838pub struct ListInterceptEndpointGroupAssociationsRequest {
13839    /// Required. The parent, which owns this collection of associations.
13840    /// Example: `projects/123456789/locations/global`.
13841    /// See <https://google.aip.dev/132> for more details.
13842    pub parent: std::string::String,
13843
13844    /// Optional. Requested page size. Server may return fewer items than
13845    /// requested. If unspecified, server will pick an appropriate default. See
13846    /// <https://google.aip.dev/158> for more details.
13847    pub page_size: i32,
13848
13849    /// Optional. A page token, received from a previous
13850    /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
13851    /// page. When paginating, all other parameters provided to
13852    /// `ListInterceptEndpointGroups` must match the call that provided the page
13853    /// token. See <https://google.aip.dev/158> for more details.
13854    pub page_token: std::string::String,
13855
13856    /// Optional. Filter expression.
13857    /// See <https://google.aip.dev/160#filtering> for more details.
13858    pub filter: std::string::String,
13859
13860    /// Optional. Sort expression.
13861    /// See <https://google.aip.dev/132#ordering> for more details.
13862    pub order_by: std::string::String,
13863
13864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13865}
13866
13867impl ListInterceptEndpointGroupAssociationsRequest {
13868    /// Creates a new default instance.
13869    pub fn new() -> Self {
13870        std::default::Default::default()
13871    }
13872
13873    /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
13874    ///
13875    /// # Example
13876    /// ```ignore,no_run
13877    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13878    /// # let project_id = "project_id";
13879    /// # let location_id = "location_id";
13880    /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13881    /// ```
13882    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13883        self.parent = v.into();
13884        self
13885    }
13886
13887    /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
13888    ///
13889    /// # Example
13890    /// ```ignore,no_run
13891    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13892    /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_size(42);
13893    /// ```
13894    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13895        self.page_size = v.into();
13896        self
13897    }
13898
13899    /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
13900    ///
13901    /// # Example
13902    /// ```ignore,no_run
13903    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13904    /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_token("example");
13905    /// ```
13906    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13907        self.page_token = v.into();
13908        self
13909    }
13910
13911    /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
13912    ///
13913    /// # Example
13914    /// ```ignore,no_run
13915    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13916    /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_filter("example");
13917    /// ```
13918    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13919        self.filter = v.into();
13920        self
13921    }
13922
13923    /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
13924    ///
13925    /// # Example
13926    /// ```ignore,no_run
13927    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13928    /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_order_by("example");
13929    /// ```
13930    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13931        self.order_by = v.into();
13932        self
13933    }
13934}
13935
13936impl wkt::message::Message for ListInterceptEndpointGroupAssociationsRequest {
13937    fn typename() -> &'static str {
13938        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest"
13939    }
13940}
13941
13942/// Response message for ListInterceptEndpointGroupAssociations.
13943#[derive(Clone, Default, PartialEq)]
13944#[non_exhaustive]
13945pub struct ListInterceptEndpointGroupAssociationsResponse {
13946    /// The associations from the specified parent.
13947    pub intercept_endpoint_group_associations:
13948        std::vec::Vec<crate::model::InterceptEndpointGroupAssociation>,
13949
13950    /// A token that can be sent as `page_token` to retrieve the next page.
13951    /// If this field is omitted, there are no subsequent pages.
13952    /// See <https://google.aip.dev/158> for more details.
13953    pub next_page_token: std::string::String,
13954
13955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13956}
13957
13958impl ListInterceptEndpointGroupAssociationsResponse {
13959    /// Creates a new default instance.
13960    pub fn new() -> Self {
13961        std::default::Default::default()
13962    }
13963
13964    /// Sets the value of [intercept_endpoint_group_associations][crate::model::ListInterceptEndpointGroupAssociationsResponse::intercept_endpoint_group_associations].
13965    ///
13966    /// # Example
13967    /// ```ignore,no_run
13968    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13969    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13970    /// let x = ListInterceptEndpointGroupAssociationsResponse::new()
13971    ///     .set_intercept_endpoint_group_associations([
13972    ///         InterceptEndpointGroupAssociation::default()/* use setters */,
13973    ///         InterceptEndpointGroupAssociation::default()/* use (different) setters */,
13974    ///     ]);
13975    /// ```
13976    pub fn set_intercept_endpoint_group_associations<T, V>(mut self, v: T) -> Self
13977    where
13978        T: std::iter::IntoIterator<Item = V>,
13979        V: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13980    {
13981        use std::iter::Iterator;
13982        self.intercept_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
13983        self
13984    }
13985
13986    /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupAssociationsResponse::next_page_token].
13987    ///
13988    /// # Example
13989    /// ```ignore,no_run
13990    /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13991    /// let x = ListInterceptEndpointGroupAssociationsResponse::new().set_next_page_token("example");
13992    /// ```
13993    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13994        self.next_page_token = v.into();
13995        self
13996    }
13997}
13998
13999impl wkt::message::Message for ListInterceptEndpointGroupAssociationsResponse {
14000    fn typename() -> &'static str {
14001        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse"
14002    }
14003}
14004
14005#[doc(hidden)]
14006impl google_cloud_gax::paginator::internal::PageableResponse
14007    for ListInterceptEndpointGroupAssociationsResponse
14008{
14009    type PageItem = crate::model::InterceptEndpointGroupAssociation;
14010
14011    fn items(self) -> std::vec::Vec<Self::PageItem> {
14012        self.intercept_endpoint_group_associations
14013    }
14014
14015    fn next_page_token(&self) -> std::string::String {
14016        use std::clone::Clone;
14017        self.next_page_token.clone()
14018    }
14019}
14020
14021/// Request message for GetInterceptEndpointGroupAssociation.
14022#[derive(Clone, Default, PartialEq)]
14023#[non_exhaustive]
14024pub struct GetInterceptEndpointGroupAssociationRequest {
14025    /// Required. The name of the association to retrieve.
14026    /// Format:
14027    /// projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}
14028    pub name: std::string::String,
14029
14030    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14031}
14032
14033impl GetInterceptEndpointGroupAssociationRequest {
14034    /// Creates a new default instance.
14035    pub fn new() -> Self {
14036        std::default::Default::default()
14037    }
14038
14039    /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
14040    ///
14041    /// # Example
14042    /// ```ignore,no_run
14043    /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupAssociationRequest;
14044    /// # let project_id = "project_id";
14045    /// # let location_id = "location_id";
14046    /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
14047    /// let x = GetInterceptEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
14048    /// ```
14049    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14050        self.name = v.into();
14051        self
14052    }
14053}
14054
14055impl wkt::message::Message for GetInterceptEndpointGroupAssociationRequest {
14056    fn typename() -> &'static str {
14057        "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest"
14058    }
14059}
14060
14061/// Request message for CreateInterceptEndpointGroupAssociation.
14062#[derive(Clone, Default, PartialEq)]
14063#[non_exhaustive]
14064pub struct CreateInterceptEndpointGroupAssociationRequest {
14065    /// Required. The parent resource where this association will be created.
14066    /// Format: projects/{project}/locations/{location}
14067    pub parent: std::string::String,
14068
14069    /// Optional. The ID to use for the new association, which will become the
14070    /// final component of the endpoint group's resource name. If not provided, the
14071    /// server will generate a unique ID.
14072    pub intercept_endpoint_group_association_id: std::string::String,
14073
14074    /// Required. The association to create.
14075    pub intercept_endpoint_group_association:
14076        std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
14077
14078    /// Optional. A unique identifier for this request. Must be a UUID4.
14079    /// This request is only idempotent if a `request_id` is provided.
14080    /// See <https://google.aip.dev/155> for more details.
14081    pub request_id: std::string::String,
14082
14083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14084}
14085
14086impl CreateInterceptEndpointGroupAssociationRequest {
14087    /// Creates a new default instance.
14088    pub fn new() -> Self {
14089        std::default::Default::default()
14090    }
14091
14092    /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
14093    ///
14094    /// # Example
14095    /// ```ignore,no_run
14096    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14097    /// # let project_id = "project_id";
14098    /// # let location_id = "location_id";
14099    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
14100    /// ```
14101    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14102        self.parent = v.into();
14103        self
14104    }
14105
14106    /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
14107    ///
14108    /// # Example
14109    /// ```ignore,no_run
14110    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14111    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association_id("example");
14112    /// ```
14113    pub fn set_intercept_endpoint_group_association_id<
14114        T: std::convert::Into<std::string::String>,
14115    >(
14116        mut self,
14117        v: T,
14118    ) -> Self {
14119        self.intercept_endpoint_group_association_id = v.into();
14120        self
14121    }
14122
14123    /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14124    ///
14125    /// # Example
14126    /// ```ignore,no_run
14127    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14128    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14129    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
14130    /// ```
14131    pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
14132    where
14133        T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14134    {
14135        self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
14136        self
14137    }
14138
14139    /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14140    ///
14141    /// # Example
14142    /// ```ignore,no_run
14143    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14144    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14145    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
14146    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
14147    /// ```
14148    pub fn set_or_clear_intercept_endpoint_group_association<T>(
14149        mut self,
14150        v: std::option::Option<T>,
14151    ) -> Self
14152    where
14153        T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14154    {
14155        self.intercept_endpoint_group_association = v.map(|x| x.into());
14156        self
14157    }
14158
14159    /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
14160    ///
14161    /// # Example
14162    /// ```ignore,no_run
14163    /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14164    /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14165    /// ```
14166    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14167        self.request_id = v.into();
14168        self
14169    }
14170}
14171
14172impl wkt::message::Message for CreateInterceptEndpointGroupAssociationRequest {
14173    fn typename() -> &'static str {
14174        "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest"
14175    }
14176}
14177
14178/// Request message for UpdateInterceptEndpointGroupAssociation.
14179#[derive(Clone, Default, PartialEq)]
14180#[non_exhaustive]
14181pub struct UpdateInterceptEndpointGroupAssociationRequest {
14182    /// Optional. The list of fields to update.
14183    /// Fields are specified relative to the association
14184    /// (e.g. `description`; *not*
14185    /// `intercept_endpoint_group_association.description`). See
14186    /// <https://google.aip.dev/161> for more details.
14187    pub update_mask: std::option::Option<wkt::FieldMask>,
14188
14189    /// Required. The association to update.
14190    pub intercept_endpoint_group_association:
14191        std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
14192
14193    /// Optional. A unique identifier for this request. Must be a UUID4.
14194    /// This request is only idempotent if a `request_id` is provided.
14195    /// See <https://google.aip.dev/155> for more details.
14196    pub request_id: std::string::String,
14197
14198    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14199}
14200
14201impl UpdateInterceptEndpointGroupAssociationRequest {
14202    /// Creates a new default instance.
14203    pub fn new() -> Self {
14204        std::default::Default::default()
14205    }
14206
14207    /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
14208    ///
14209    /// # Example
14210    /// ```ignore,no_run
14211    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14212    /// use wkt::FieldMask;
14213    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14214    /// ```
14215    pub fn set_update_mask<T>(mut self, v: T) -> Self
14216    where
14217        T: std::convert::Into<wkt::FieldMask>,
14218    {
14219        self.update_mask = std::option::Option::Some(v.into());
14220        self
14221    }
14222
14223    /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
14224    ///
14225    /// # Example
14226    /// ```ignore,no_run
14227    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14228    /// use wkt::FieldMask;
14229    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14230    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14231    /// ```
14232    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14233    where
14234        T: std::convert::Into<wkt::FieldMask>,
14235    {
14236        self.update_mask = v.map(|x| x.into());
14237        self
14238    }
14239
14240    /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14241    ///
14242    /// # Example
14243    /// ```ignore,no_run
14244    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14245    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14246    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
14247    /// ```
14248    pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
14249    where
14250        T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14251    {
14252        self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
14253        self
14254    }
14255
14256    /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14257    ///
14258    /// # Example
14259    /// ```ignore,no_run
14260    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14261    /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14262    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
14263    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
14264    /// ```
14265    pub fn set_or_clear_intercept_endpoint_group_association<T>(
14266        mut self,
14267        v: std::option::Option<T>,
14268    ) -> Self
14269    where
14270        T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14271    {
14272        self.intercept_endpoint_group_association = v.map(|x| x.into());
14273        self
14274    }
14275
14276    /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
14277    ///
14278    /// # Example
14279    /// ```ignore,no_run
14280    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14281    /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14282    /// ```
14283    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14284        self.request_id = v.into();
14285        self
14286    }
14287}
14288
14289impl wkt::message::Message for UpdateInterceptEndpointGroupAssociationRequest {
14290    fn typename() -> &'static str {
14291        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest"
14292    }
14293}
14294
14295/// Request message for DeleteInterceptEndpointGroupAssociation.
14296#[derive(Clone, Default, PartialEq)]
14297#[non_exhaustive]
14298pub struct DeleteInterceptEndpointGroupAssociationRequest {
14299    /// Required. The association to delete.
14300    pub name: std::string::String,
14301
14302    /// Optional. A unique identifier for this request. Must be a UUID4.
14303    /// This request is only idempotent if a `request_id` is provided.
14304    /// See <https://google.aip.dev/155> for more details.
14305    pub request_id: std::string::String,
14306
14307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14308}
14309
14310impl DeleteInterceptEndpointGroupAssociationRequest {
14311    /// Creates a new default instance.
14312    pub fn new() -> Self {
14313        std::default::Default::default()
14314    }
14315
14316    /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
14317    ///
14318    /// # Example
14319    /// ```ignore,no_run
14320    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14321    /// # let project_id = "project_id";
14322    /// # let location_id = "location_id";
14323    /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
14324    /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
14325    /// ```
14326    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14327        self.name = v.into();
14328        self
14329    }
14330
14331    /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
14332    ///
14333    /// # Example
14334    /// ```ignore,no_run
14335    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14336    /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14337    /// ```
14338    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14339        self.request_id = v.into();
14340        self
14341    }
14342}
14343
14344impl wkt::message::Message for DeleteInterceptEndpointGroupAssociationRequest {
14345    fn typename() -> &'static str {
14346        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest"
14347    }
14348}
14349
14350/// A deployment group aggregates many zonal intercept backends (deployments)
14351/// into a single global intercept service. Consumers can connect this service
14352/// using an endpoint group.
14353#[derive(Clone, Default, PartialEq)]
14354#[non_exhaustive]
14355pub struct InterceptDeploymentGroup {
14356    /// Immutable. Identifier. The resource name of this deployment group, for
14357    /// example:
14358    /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
14359    /// See <https://google.aip.dev/122> for more details.
14360    pub name: std::string::String,
14361
14362    /// Output only. The timestamp when the resource was created.
14363    /// See <https://google.aip.dev/148#timestamps>.
14364    pub create_time: std::option::Option<wkt::Timestamp>,
14365
14366    /// Output only. The timestamp when the resource was most recently updated.
14367    /// See <https://google.aip.dev/148#timestamps>.
14368    pub update_time: std::option::Option<wkt::Timestamp>,
14369
14370    /// Optional. Labels are key/value pairs that help to organize and filter
14371    /// resources.
14372    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14373
14374    /// Required. Immutable. The network that will be used for all child
14375    /// deployments, for example: `projects/{project}/global/networks/{network}`.
14376    /// See <https://google.aip.dev/124>.
14377    pub network: std::string::String,
14378
14379    /// Output only. The list of endpoint groups that are connected to this
14380    /// resource.
14381    pub connected_endpoint_groups:
14382        std::vec::Vec<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14383
14384    /// Output only. The list of Intercept Deployments that belong to this group.
14385    #[deprecated]
14386    pub nested_deployments: std::vec::Vec<crate::model::intercept_deployment_group::Deployment>,
14387
14388    /// Output only. The current state of the deployment group.
14389    /// See <https://google.aip.dev/216>.
14390    pub state: crate::model::intercept_deployment_group::State,
14391
14392    /// Output only. The current state of the resource does not match the user's
14393    /// intended state, and the system is working to reconcile them. This is part
14394    /// of the normal operation (e.g. adding a new deployment to the group) See
14395    /// <https://google.aip.dev/128>.
14396    pub reconciling: bool,
14397
14398    /// Optional. User-provided description of the deployment group.
14399    /// Used as additional context for the deployment group.
14400    pub description: std::string::String,
14401
14402    /// Output only. The list of locations where the deployment group is present.
14403    pub locations: std::vec::Vec<crate::model::InterceptLocation>,
14404
14405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14406}
14407
14408impl InterceptDeploymentGroup {
14409    /// Creates a new default instance.
14410    pub fn new() -> Self {
14411        std::default::Default::default()
14412    }
14413
14414    /// Sets the value of [name][crate::model::InterceptDeploymentGroup::name].
14415    ///
14416    /// # Example
14417    /// ```ignore,no_run
14418    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14419    /// # let project_id = "project_id";
14420    /// # let location_id = "location_id";
14421    /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
14422    /// let x = InterceptDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
14423    /// ```
14424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14425        self.name = v.into();
14426        self
14427    }
14428
14429    /// Sets the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14430    ///
14431    /// # Example
14432    /// ```ignore,no_run
14433    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14434    /// use wkt::Timestamp;
14435    /// let x = InterceptDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
14436    /// ```
14437    pub fn set_create_time<T>(mut self, v: T) -> Self
14438    where
14439        T: std::convert::Into<wkt::Timestamp>,
14440    {
14441        self.create_time = std::option::Option::Some(v.into());
14442        self
14443    }
14444
14445    /// Sets or clears the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14446    ///
14447    /// # Example
14448    /// ```ignore,no_run
14449    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14450    /// use wkt::Timestamp;
14451    /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14452    /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
14453    /// ```
14454    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14455    where
14456        T: std::convert::Into<wkt::Timestamp>,
14457    {
14458        self.create_time = v.map(|x| x.into());
14459        self
14460    }
14461
14462    /// Sets the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14463    ///
14464    /// # Example
14465    /// ```ignore,no_run
14466    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14467    /// use wkt::Timestamp;
14468    /// let x = InterceptDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
14469    /// ```
14470    pub fn set_update_time<T>(mut self, v: T) -> Self
14471    where
14472        T: std::convert::Into<wkt::Timestamp>,
14473    {
14474        self.update_time = std::option::Option::Some(v.into());
14475        self
14476    }
14477
14478    /// Sets or clears the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14479    ///
14480    /// # Example
14481    /// ```ignore,no_run
14482    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14483    /// use wkt::Timestamp;
14484    /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14485    /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
14486    /// ```
14487    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14488    where
14489        T: std::convert::Into<wkt::Timestamp>,
14490    {
14491        self.update_time = v.map(|x| x.into());
14492        self
14493    }
14494
14495    /// Sets the value of [labels][crate::model::InterceptDeploymentGroup::labels].
14496    ///
14497    /// # Example
14498    /// ```ignore,no_run
14499    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14500    /// let x = InterceptDeploymentGroup::new().set_labels([
14501    ///     ("key0", "abc"),
14502    ///     ("key1", "xyz"),
14503    /// ]);
14504    /// ```
14505    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14506    where
14507        T: std::iter::IntoIterator<Item = (K, V)>,
14508        K: std::convert::Into<std::string::String>,
14509        V: std::convert::Into<std::string::String>,
14510    {
14511        use std::iter::Iterator;
14512        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14513        self
14514    }
14515
14516    /// Sets the value of [network][crate::model::InterceptDeploymentGroup::network].
14517    ///
14518    /// # Example
14519    /// ```ignore,no_run
14520    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14521    /// let x = InterceptDeploymentGroup::new().set_network("example");
14522    /// ```
14523    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14524        self.network = v.into();
14525        self
14526    }
14527
14528    /// Sets the value of [connected_endpoint_groups][crate::model::InterceptDeploymentGroup::connected_endpoint_groups].
14529    ///
14530    /// # Example
14531    /// ```ignore,no_run
14532    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14533    /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14534    /// let x = InterceptDeploymentGroup::new()
14535    ///     .set_connected_endpoint_groups([
14536    ///         ConnectedEndpointGroup::default()/* use setters */,
14537    ///         ConnectedEndpointGroup::default()/* use (different) setters */,
14538    ///     ]);
14539    /// ```
14540    pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
14541    where
14542        T: std::iter::IntoIterator<Item = V>,
14543        V: std::convert::Into<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14544    {
14545        use std::iter::Iterator;
14546        self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
14547        self
14548    }
14549
14550    /// Sets the value of [nested_deployments][crate::model::InterceptDeploymentGroup::nested_deployments].
14551    ///
14552    /// # Example
14553    /// ```ignore,no_run
14554    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14555    /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14556    /// let x = InterceptDeploymentGroup::new()
14557    ///     .set_nested_deployments([
14558    ///         Deployment::default()/* use setters */,
14559    ///         Deployment::default()/* use (different) setters */,
14560    ///     ]);
14561    /// ```
14562    #[deprecated]
14563    pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
14564    where
14565        T: std::iter::IntoIterator<Item = V>,
14566        V: std::convert::Into<crate::model::intercept_deployment_group::Deployment>,
14567    {
14568        use std::iter::Iterator;
14569        self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
14570        self
14571    }
14572
14573    /// Sets the value of [state][crate::model::InterceptDeploymentGroup::state].
14574    ///
14575    /// # Example
14576    /// ```ignore,no_run
14577    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14578    /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::State;
14579    /// let x0 = InterceptDeploymentGroup::new().set_state(State::Active);
14580    /// let x1 = InterceptDeploymentGroup::new().set_state(State::Creating);
14581    /// let x2 = InterceptDeploymentGroup::new().set_state(State::Deleting);
14582    /// ```
14583    pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment_group::State>>(
14584        mut self,
14585        v: T,
14586    ) -> Self {
14587        self.state = v.into();
14588        self
14589    }
14590
14591    /// Sets the value of [reconciling][crate::model::InterceptDeploymentGroup::reconciling].
14592    ///
14593    /// # Example
14594    /// ```ignore,no_run
14595    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14596    /// let x = InterceptDeploymentGroup::new().set_reconciling(true);
14597    /// ```
14598    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14599        self.reconciling = v.into();
14600        self
14601    }
14602
14603    /// Sets the value of [description][crate::model::InterceptDeploymentGroup::description].
14604    ///
14605    /// # Example
14606    /// ```ignore,no_run
14607    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14608    /// let x = InterceptDeploymentGroup::new().set_description("example");
14609    /// ```
14610    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14611        self.description = v.into();
14612        self
14613    }
14614
14615    /// Sets the value of [locations][crate::model::InterceptDeploymentGroup::locations].
14616    ///
14617    /// # Example
14618    /// ```ignore,no_run
14619    /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14620    /// use google_cloud_networksecurity_v1::model::InterceptLocation;
14621    /// let x = InterceptDeploymentGroup::new()
14622    ///     .set_locations([
14623    ///         InterceptLocation::default()/* use setters */,
14624    ///         InterceptLocation::default()/* use (different) setters */,
14625    ///     ]);
14626    /// ```
14627    pub fn set_locations<T, V>(mut self, v: T) -> Self
14628    where
14629        T: std::iter::IntoIterator<Item = V>,
14630        V: std::convert::Into<crate::model::InterceptLocation>,
14631    {
14632        use std::iter::Iterator;
14633        self.locations = v.into_iter().map(|i| i.into()).collect();
14634        self
14635    }
14636}
14637
14638impl wkt::message::Message for InterceptDeploymentGroup {
14639    fn typename() -> &'static str {
14640        "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup"
14641    }
14642}
14643
14644/// Defines additional types related to [InterceptDeploymentGroup].
14645pub mod intercept_deployment_group {
14646    #[allow(unused_imports)]
14647    use super::*;
14648
14649    /// An endpoint group connected to this deployment group.
14650    #[derive(Clone, Default, PartialEq)]
14651    #[non_exhaustive]
14652    pub struct ConnectedEndpointGroup {
14653        /// Output only. The connected endpoint group's resource name, for example:
14654        /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
14655        /// See <https://google.aip.dev/124>.
14656        pub name: std::string::String,
14657
14658        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14659    }
14660
14661    impl ConnectedEndpointGroup {
14662        /// Creates a new default instance.
14663        pub fn new() -> Self {
14664            std::default::Default::default()
14665        }
14666
14667        /// Sets the value of [name][crate::model::intercept_deployment_group::ConnectedEndpointGroup::name].
14668        ///
14669        /// # Example
14670        /// ```ignore,no_run
14671        /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14672        /// # let project_id = "project_id";
14673        /// # let location_id = "location_id";
14674        /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
14675        /// let x = ConnectedEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
14676        /// ```
14677        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14678            self.name = v.into();
14679            self
14680        }
14681    }
14682
14683    impl wkt::message::Message for ConnectedEndpointGroup {
14684        fn typename() -> &'static str {
14685            "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup"
14686        }
14687    }
14688
14689    /// A deployment belonging to this deployment group.
14690    #[derive(Clone, Default, PartialEq)]
14691    #[non_exhaustive]
14692    pub struct Deployment {
14693        /// Output only. The name of the Intercept Deployment, in the format:
14694        /// `projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}`.
14695        pub name: std::string::String,
14696
14697        /// Output only. Most recent known state of the deployment.
14698        pub state: crate::model::intercept_deployment::State,
14699
14700        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14701    }
14702
14703    impl Deployment {
14704        /// Creates a new default instance.
14705        pub fn new() -> Self {
14706            std::default::Default::default()
14707        }
14708
14709        /// Sets the value of [name][crate::model::intercept_deployment_group::Deployment::name].
14710        ///
14711        /// # Example
14712        /// ```ignore,no_run
14713        /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14714        /// # let project_id = "project_id";
14715        /// # let location_id = "location_id";
14716        /// # let intercept_deployment_id = "intercept_deployment_id";
14717        /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
14718        /// ```
14719        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14720            self.name = v.into();
14721            self
14722        }
14723
14724        /// Sets the value of [state][crate::model::intercept_deployment_group::Deployment::state].
14725        ///
14726        /// # Example
14727        /// ```ignore,no_run
14728        /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14729        /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
14730        /// let x0 = Deployment::new().set_state(State::Active);
14731        /// let x1 = Deployment::new().set_state(State::Creating);
14732        /// let x2 = Deployment::new().set_state(State::Deleting);
14733        /// ```
14734        pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
14735            mut self,
14736            v: T,
14737        ) -> Self {
14738            self.state = v.into();
14739            self
14740        }
14741    }
14742
14743    impl wkt::message::Message for Deployment {
14744        fn typename() -> &'static str {
14745            "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment"
14746        }
14747    }
14748
14749    /// The current state of the deployment group.
14750    ///
14751    /// # Working with unknown values
14752    ///
14753    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14754    /// additional enum variants at any time. Adding new variants is not considered
14755    /// a breaking change. Applications should write their code in anticipation of:
14756    ///
14757    /// - New values appearing in future releases of the client library, **and**
14758    /// - New values received dynamically, without application changes.
14759    ///
14760    /// Please consult the [Working with enums] section in the user guide for some
14761    /// guidelines.
14762    ///
14763    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14764    #[derive(Clone, Debug, PartialEq)]
14765    #[non_exhaustive]
14766    pub enum State {
14767        /// State not set (this is not a valid state).
14768        Unspecified,
14769        /// The deployment group is ready.
14770        Active,
14771        /// The deployment group is being created.
14772        Creating,
14773        /// The deployment group is being deleted.
14774        Deleting,
14775        /// If set, the enum was initialized with an unknown value.
14776        ///
14777        /// Applications can examine the value using [State::value] or
14778        /// [State::name].
14779        UnknownValue(state::UnknownValue),
14780    }
14781
14782    #[doc(hidden)]
14783    pub mod state {
14784        #[allow(unused_imports)]
14785        use super::*;
14786        #[derive(Clone, Debug, PartialEq)]
14787        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14788    }
14789
14790    impl State {
14791        /// Gets the enum value.
14792        ///
14793        /// Returns `None` if the enum contains an unknown value deserialized from
14794        /// the string representation of enums.
14795        pub fn value(&self) -> std::option::Option<i32> {
14796            match self {
14797                Self::Unspecified => std::option::Option::Some(0),
14798                Self::Active => std::option::Option::Some(1),
14799                Self::Creating => std::option::Option::Some(2),
14800                Self::Deleting => std::option::Option::Some(3),
14801                Self::UnknownValue(u) => u.0.value(),
14802            }
14803        }
14804
14805        /// Gets the enum value as a string.
14806        ///
14807        /// Returns `None` if the enum contains an unknown value deserialized from
14808        /// the integer representation of enums.
14809        pub fn name(&self) -> std::option::Option<&str> {
14810            match self {
14811                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14812                Self::Active => std::option::Option::Some("ACTIVE"),
14813                Self::Creating => std::option::Option::Some("CREATING"),
14814                Self::Deleting => std::option::Option::Some("DELETING"),
14815                Self::UnknownValue(u) => u.0.name(),
14816            }
14817        }
14818    }
14819
14820    impl std::default::Default for State {
14821        fn default() -> Self {
14822            use std::convert::From;
14823            Self::from(0)
14824        }
14825    }
14826
14827    impl std::fmt::Display for State {
14828        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14829            wkt::internal::display_enum(f, self.name(), self.value())
14830        }
14831    }
14832
14833    impl std::convert::From<i32> for State {
14834        fn from(value: i32) -> Self {
14835            match value {
14836                0 => Self::Unspecified,
14837                1 => Self::Active,
14838                2 => Self::Creating,
14839                3 => Self::Deleting,
14840                _ => Self::UnknownValue(state::UnknownValue(
14841                    wkt::internal::UnknownEnumValue::Integer(value),
14842                )),
14843            }
14844        }
14845    }
14846
14847    impl std::convert::From<&str> for State {
14848        fn from(value: &str) -> Self {
14849            use std::string::ToString;
14850            match value {
14851                "STATE_UNSPECIFIED" => Self::Unspecified,
14852                "ACTIVE" => Self::Active,
14853                "CREATING" => Self::Creating,
14854                "DELETING" => Self::Deleting,
14855                _ => Self::UnknownValue(state::UnknownValue(
14856                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14857                )),
14858            }
14859        }
14860    }
14861
14862    impl serde::ser::Serialize for State {
14863        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14864        where
14865            S: serde::Serializer,
14866        {
14867            match self {
14868                Self::Unspecified => serializer.serialize_i32(0),
14869                Self::Active => serializer.serialize_i32(1),
14870                Self::Creating => serializer.serialize_i32(2),
14871                Self::Deleting => serializer.serialize_i32(3),
14872                Self::UnknownValue(u) => u.0.serialize(serializer),
14873            }
14874        }
14875    }
14876
14877    impl<'de> serde::de::Deserialize<'de> for State {
14878        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14879        where
14880            D: serde::Deserializer<'de>,
14881        {
14882            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14883                ".google.cloud.networksecurity.v1.InterceptDeploymentGroup.State",
14884            ))
14885        }
14886    }
14887}
14888
14889/// Request message for ListInterceptDeploymentGroups.
14890#[derive(Clone, Default, PartialEq)]
14891#[non_exhaustive]
14892pub struct ListInterceptDeploymentGroupsRequest {
14893    /// Required. The parent, which owns this collection of deployment groups.
14894    /// Example: `projects/123456789/locations/global`.
14895    /// See <https://google.aip.dev/132> for more details.
14896    pub parent: std::string::String,
14897
14898    /// Optional. Requested page size. Server may return fewer items than
14899    /// requested. If unspecified, server will pick an appropriate default. See
14900    /// <https://google.aip.dev/158> for more details.
14901    pub page_size: i32,
14902
14903    /// Optional. A page token, received from a previous
14904    /// `ListInterceptDeploymentGroups` call. Provide this to retrieve the
14905    /// subsequent page. When paginating, all other parameters provided to
14906    /// `ListInterceptDeploymentGroups` must match the call that provided the page
14907    /// token. See <https://google.aip.dev/158> for more details.
14908    pub page_token: std::string::String,
14909
14910    /// Optional. Filter expression.
14911    /// See <https://google.aip.dev/160#filtering> for more details.
14912    pub filter: std::string::String,
14913
14914    /// Optional. Sort expression.
14915    /// See <https://google.aip.dev/132#ordering> for more details.
14916    pub order_by: std::string::String,
14917
14918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14919}
14920
14921impl ListInterceptDeploymentGroupsRequest {
14922    /// Creates a new default instance.
14923    pub fn new() -> Self {
14924        std::default::Default::default()
14925    }
14926
14927    /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
14928    ///
14929    /// # Example
14930    /// ```ignore,no_run
14931    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14932    /// # let project_id = "project_id";
14933    /// # let location_id = "location_id";
14934    /// let x = ListInterceptDeploymentGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
14935    /// ```
14936    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14937        self.parent = v.into();
14938        self
14939    }
14940
14941    /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
14942    ///
14943    /// # Example
14944    /// ```ignore,no_run
14945    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14946    /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_size(42);
14947    /// ```
14948    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14949        self.page_size = v.into();
14950        self
14951    }
14952
14953    /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
14954    ///
14955    /// # Example
14956    /// ```ignore,no_run
14957    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14958    /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_token("example");
14959    /// ```
14960    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14961        self.page_token = v.into();
14962        self
14963    }
14964
14965    /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
14966    ///
14967    /// # Example
14968    /// ```ignore,no_run
14969    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14970    /// let x = ListInterceptDeploymentGroupsRequest::new().set_filter("example");
14971    /// ```
14972    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14973        self.filter = v.into();
14974        self
14975    }
14976
14977    /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
14978    ///
14979    /// # Example
14980    /// ```ignore,no_run
14981    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14982    /// let x = ListInterceptDeploymentGroupsRequest::new().set_order_by("example");
14983    /// ```
14984    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14985        self.order_by = v.into();
14986        self
14987    }
14988}
14989
14990impl wkt::message::Message for ListInterceptDeploymentGroupsRequest {
14991    fn typename() -> &'static str {
14992        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest"
14993    }
14994}
14995
14996/// Response message for ListInterceptDeploymentGroups.
14997#[derive(Clone, Default, PartialEq)]
14998#[non_exhaustive]
14999pub struct ListInterceptDeploymentGroupsResponse {
15000    /// The deployment groups from the specified parent.
15001    pub intercept_deployment_groups: std::vec::Vec<crate::model::InterceptDeploymentGroup>,
15002
15003    /// A token that can be sent as `page_token` to retrieve the next page.
15004    /// If this field is omitted, there are no subsequent pages.
15005    /// See <https://google.aip.dev/158> for more details.
15006    pub next_page_token: std::string::String,
15007
15008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15009}
15010
15011impl ListInterceptDeploymentGroupsResponse {
15012    /// Creates a new default instance.
15013    pub fn new() -> Self {
15014        std::default::Default::default()
15015    }
15016
15017    /// Sets the value of [intercept_deployment_groups][crate::model::ListInterceptDeploymentGroupsResponse::intercept_deployment_groups].
15018    ///
15019    /// # Example
15020    /// ```ignore,no_run
15021    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
15022    /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15023    /// let x = ListInterceptDeploymentGroupsResponse::new()
15024    ///     .set_intercept_deployment_groups([
15025    ///         InterceptDeploymentGroup::default()/* use setters */,
15026    ///         InterceptDeploymentGroup::default()/* use (different) setters */,
15027    ///     ]);
15028    /// ```
15029    pub fn set_intercept_deployment_groups<T, V>(mut self, v: T) -> Self
15030    where
15031        T: std::iter::IntoIterator<Item = V>,
15032        V: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15033    {
15034        use std::iter::Iterator;
15035        self.intercept_deployment_groups = v.into_iter().map(|i| i.into()).collect();
15036        self
15037    }
15038
15039    /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentGroupsResponse::next_page_token].
15040    ///
15041    /// # Example
15042    /// ```ignore,no_run
15043    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
15044    /// let x = ListInterceptDeploymentGroupsResponse::new().set_next_page_token("example");
15045    /// ```
15046    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15047        self.next_page_token = v.into();
15048        self
15049    }
15050}
15051
15052impl wkt::message::Message for ListInterceptDeploymentGroupsResponse {
15053    fn typename() -> &'static str {
15054        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse"
15055    }
15056}
15057
15058#[doc(hidden)]
15059impl google_cloud_gax::paginator::internal::PageableResponse
15060    for ListInterceptDeploymentGroupsResponse
15061{
15062    type PageItem = crate::model::InterceptDeploymentGroup;
15063
15064    fn items(self) -> std::vec::Vec<Self::PageItem> {
15065        self.intercept_deployment_groups
15066    }
15067
15068    fn next_page_token(&self) -> std::string::String {
15069        use std::clone::Clone;
15070        self.next_page_token.clone()
15071    }
15072}
15073
15074/// Request message for GetInterceptDeploymentGroup.
15075#[derive(Clone, Default, PartialEq)]
15076#[non_exhaustive]
15077pub struct GetInterceptDeploymentGroupRequest {
15078    /// Required. The name of the deployment group to retrieve.
15079    /// Format:
15080    /// projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}
15081    pub name: std::string::String,
15082
15083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15084}
15085
15086impl GetInterceptDeploymentGroupRequest {
15087    /// Creates a new default instance.
15088    pub fn new() -> Self {
15089        std::default::Default::default()
15090    }
15091
15092    /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
15093    ///
15094    /// # Example
15095    /// ```ignore,no_run
15096    /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentGroupRequest;
15097    /// # let project_id = "project_id";
15098    /// # let location_id = "location_id";
15099    /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15100    /// let x = GetInterceptDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15101    /// ```
15102    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15103        self.name = v.into();
15104        self
15105    }
15106}
15107
15108impl wkt::message::Message for GetInterceptDeploymentGroupRequest {
15109    fn typename() -> &'static str {
15110        "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest"
15111    }
15112}
15113
15114/// Request message for CreateInterceptDeploymentGroup.
15115#[derive(Clone, Default, PartialEq)]
15116#[non_exhaustive]
15117pub struct CreateInterceptDeploymentGroupRequest {
15118    /// Required. The parent resource where this deployment group will be created.
15119    /// Format: projects/{project}/locations/{location}
15120    pub parent: std::string::String,
15121
15122    /// Required. The ID to use for the new deployment group, which will become the
15123    /// final component of the deployment group's resource name.
15124    pub intercept_deployment_group_id: std::string::String,
15125
15126    /// Required. The deployment group to create.
15127    pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
15128
15129    /// Optional. A unique identifier for this request. Must be a UUID4.
15130    /// This request is only idempotent if a `request_id` is provided.
15131    /// See <https://google.aip.dev/155> for more details.
15132    pub request_id: std::string::String,
15133
15134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15135}
15136
15137impl CreateInterceptDeploymentGroupRequest {
15138    /// Creates a new default instance.
15139    pub fn new() -> Self {
15140        std::default::Default::default()
15141    }
15142
15143    /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
15144    ///
15145    /// # Example
15146    /// ```ignore,no_run
15147    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15148    /// # let project_id = "project_id";
15149    /// # let location_id = "location_id";
15150    /// let x = CreateInterceptDeploymentGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
15151    /// ```
15152    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15153        self.parent = v.into();
15154        self
15155    }
15156
15157    /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
15158    ///
15159    /// # Example
15160    /// ```ignore,no_run
15161    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15162    /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group_id("example");
15163    /// ```
15164    pub fn set_intercept_deployment_group_id<T: std::convert::Into<std::string::String>>(
15165        mut self,
15166        v: T,
15167    ) -> Self {
15168        self.intercept_deployment_group_id = v.into();
15169        self
15170    }
15171
15172    /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
15173    ///
15174    /// # Example
15175    /// ```ignore,no_run
15176    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15177    /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15178    /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
15179    /// ```
15180    pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
15181    where
15182        T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15183    {
15184        self.intercept_deployment_group = std::option::Option::Some(v.into());
15185        self
15186    }
15187
15188    /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
15189    ///
15190    /// # Example
15191    /// ```ignore,no_run
15192    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15193    /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15194    /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
15195    /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
15196    /// ```
15197    pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
15198    where
15199        T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15200    {
15201        self.intercept_deployment_group = v.map(|x| x.into());
15202        self
15203    }
15204
15205    /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
15206    ///
15207    /// # Example
15208    /// ```ignore,no_run
15209    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15210    /// let x = CreateInterceptDeploymentGroupRequest::new().set_request_id("example");
15211    /// ```
15212    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15213        self.request_id = v.into();
15214        self
15215    }
15216}
15217
15218impl wkt::message::Message for CreateInterceptDeploymentGroupRequest {
15219    fn typename() -> &'static str {
15220        "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest"
15221    }
15222}
15223
15224/// Request message for UpdateInterceptDeploymentGroup.
15225#[derive(Clone, Default, PartialEq)]
15226#[non_exhaustive]
15227pub struct UpdateInterceptDeploymentGroupRequest {
15228    /// Optional. The list of fields to update.
15229    /// Fields are specified relative to the deployment group
15230    /// (e.g. `description`; *not*
15231    /// `intercept_deployment_group.description`). See
15232    /// <https://google.aip.dev/161> for more details.
15233    pub update_mask: std::option::Option<wkt::FieldMask>,
15234
15235    /// Required. The deployment group to update.
15236    pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
15237
15238    /// Optional. A unique identifier for this request. Must be a UUID4.
15239    /// This request is only idempotent if a `request_id` is provided.
15240    /// See <https://google.aip.dev/155> for more details.
15241    pub request_id: std::string::String,
15242
15243    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15244}
15245
15246impl UpdateInterceptDeploymentGroupRequest {
15247    /// Creates a new default instance.
15248    pub fn new() -> Self {
15249        std::default::Default::default()
15250    }
15251
15252    /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
15253    ///
15254    /// # Example
15255    /// ```ignore,no_run
15256    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15257    /// use wkt::FieldMask;
15258    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15259    /// ```
15260    pub fn set_update_mask<T>(mut self, v: T) -> Self
15261    where
15262        T: std::convert::Into<wkt::FieldMask>,
15263    {
15264        self.update_mask = std::option::Option::Some(v.into());
15265        self
15266    }
15267
15268    /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
15269    ///
15270    /// # Example
15271    /// ```ignore,no_run
15272    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15273    /// use wkt::FieldMask;
15274    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15275    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15276    /// ```
15277    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15278    where
15279        T: std::convert::Into<wkt::FieldMask>,
15280    {
15281        self.update_mask = v.map(|x| x.into());
15282        self
15283    }
15284
15285    /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15286    ///
15287    /// # Example
15288    /// ```ignore,no_run
15289    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15290    /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15291    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
15292    /// ```
15293    pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
15294    where
15295        T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15296    {
15297        self.intercept_deployment_group = std::option::Option::Some(v.into());
15298        self
15299    }
15300
15301    /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15302    ///
15303    /// # Example
15304    /// ```ignore,no_run
15305    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15306    /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15307    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
15308    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
15309    /// ```
15310    pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
15311    where
15312        T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15313    {
15314        self.intercept_deployment_group = v.map(|x| x.into());
15315        self
15316    }
15317
15318    /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
15319    ///
15320    /// # Example
15321    /// ```ignore,no_run
15322    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15323    /// let x = UpdateInterceptDeploymentGroupRequest::new().set_request_id("example");
15324    /// ```
15325    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15326        self.request_id = v.into();
15327        self
15328    }
15329}
15330
15331impl wkt::message::Message for UpdateInterceptDeploymentGroupRequest {
15332    fn typename() -> &'static str {
15333        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest"
15334    }
15335}
15336
15337/// Request message for DeleteInterceptDeploymentGroup.
15338#[derive(Clone, Default, PartialEq)]
15339#[non_exhaustive]
15340pub struct DeleteInterceptDeploymentGroupRequest {
15341    /// Required. The deployment group to delete.
15342    pub name: std::string::String,
15343
15344    /// Optional. A unique identifier for this request. Must be a UUID4.
15345    /// This request is only idempotent if a `request_id` is provided.
15346    /// See <https://google.aip.dev/155> for more details.
15347    pub request_id: std::string::String,
15348
15349    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15350}
15351
15352impl DeleteInterceptDeploymentGroupRequest {
15353    /// Creates a new default instance.
15354    pub fn new() -> Self {
15355        std::default::Default::default()
15356    }
15357
15358    /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
15359    ///
15360    /// # Example
15361    /// ```ignore,no_run
15362    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15363    /// # let project_id = "project_id";
15364    /// # let location_id = "location_id";
15365    /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15366    /// let x = DeleteInterceptDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15367    /// ```
15368    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15369        self.name = v.into();
15370        self
15371    }
15372
15373    /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
15374    ///
15375    /// # Example
15376    /// ```ignore,no_run
15377    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15378    /// let x = DeleteInterceptDeploymentGroupRequest::new().set_request_id("example");
15379    /// ```
15380    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15381        self.request_id = v.into();
15382        self
15383    }
15384}
15385
15386impl wkt::message::Message for DeleteInterceptDeploymentGroupRequest {
15387    fn typename() -> &'static str {
15388        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest"
15389    }
15390}
15391
15392/// A deployment represents a zonal intercept backend ready to accept
15393/// GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an
15394/// internal passthrough load balancer. Deployments are always part of a
15395/// global deployment group which represents a global intercept service.
15396#[derive(Clone, Default, PartialEq)]
15397#[non_exhaustive]
15398pub struct InterceptDeployment {
15399    /// Immutable. Identifier. The resource name of this deployment, for example:
15400    /// `projects/123456789/locations/us-central1-a/interceptDeployments/my-dep`.
15401    /// See <https://google.aip.dev/122> for more details.
15402    pub name: std::string::String,
15403
15404    /// Output only. The timestamp when the resource was created.
15405    /// See <https://google.aip.dev/148#timestamps>.
15406    pub create_time: std::option::Option<wkt::Timestamp>,
15407
15408    /// Output only. The timestamp when the resource was most recently updated.
15409    /// See <https://google.aip.dev/148#timestamps>.
15410    pub update_time: std::option::Option<wkt::Timestamp>,
15411
15412    /// Optional. Labels are key/value pairs that help to organize and filter
15413    /// resources.
15414    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15415
15416    /// Required. Immutable. The regional forwarding rule that fronts the
15417    /// interceptors, for example:
15418    /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`.
15419    /// See <https://google.aip.dev/124>.
15420    pub forwarding_rule: std::string::String,
15421
15422    /// Required. Immutable. The deployment group that this deployment is a part
15423    /// of, for example:
15424    /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
15425    /// See <https://google.aip.dev/124>.
15426    pub intercept_deployment_group: std::string::String,
15427
15428    /// Output only. The current state of the deployment.
15429    /// See <https://google.aip.dev/216>.
15430    pub state: crate::model::intercept_deployment::State,
15431
15432    /// Output only. The current state of the resource does not match the user's
15433    /// intended state, and the system is working to reconcile them. This part of
15434    /// the normal operation (e.g. linking a new association to the parent group).
15435    /// See <https://google.aip.dev/128>.
15436    pub reconciling: bool,
15437
15438    /// Optional. User-provided description of the deployment.
15439    /// Used as additional context for the deployment.
15440    pub description: std::string::String,
15441
15442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15443}
15444
15445impl InterceptDeployment {
15446    /// Creates a new default instance.
15447    pub fn new() -> Self {
15448        std::default::Default::default()
15449    }
15450
15451    /// Sets the value of [name][crate::model::InterceptDeployment::name].
15452    ///
15453    /// # Example
15454    /// ```ignore,no_run
15455    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15456    /// # let project_id = "project_id";
15457    /// # let location_id = "location_id";
15458    /// # let intercept_deployment_id = "intercept_deployment_id";
15459    /// let x = InterceptDeployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
15460    /// ```
15461    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15462        self.name = v.into();
15463        self
15464    }
15465
15466    /// Sets the value of [create_time][crate::model::InterceptDeployment::create_time].
15467    ///
15468    /// # Example
15469    /// ```ignore,no_run
15470    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15471    /// use wkt::Timestamp;
15472    /// let x = InterceptDeployment::new().set_create_time(Timestamp::default()/* use setters */);
15473    /// ```
15474    pub fn set_create_time<T>(mut self, v: T) -> Self
15475    where
15476        T: std::convert::Into<wkt::Timestamp>,
15477    {
15478        self.create_time = std::option::Option::Some(v.into());
15479        self
15480    }
15481
15482    /// Sets or clears the value of [create_time][crate::model::InterceptDeployment::create_time].
15483    ///
15484    /// # Example
15485    /// ```ignore,no_run
15486    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15487    /// use wkt::Timestamp;
15488    /// let x = InterceptDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15489    /// let x = InterceptDeployment::new().set_or_clear_create_time(None::<Timestamp>);
15490    /// ```
15491    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15492    where
15493        T: std::convert::Into<wkt::Timestamp>,
15494    {
15495        self.create_time = v.map(|x| x.into());
15496        self
15497    }
15498
15499    /// Sets the value of [update_time][crate::model::InterceptDeployment::update_time].
15500    ///
15501    /// # Example
15502    /// ```ignore,no_run
15503    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15504    /// use wkt::Timestamp;
15505    /// let x = InterceptDeployment::new().set_update_time(Timestamp::default()/* use setters */);
15506    /// ```
15507    pub fn set_update_time<T>(mut self, v: T) -> Self
15508    where
15509        T: std::convert::Into<wkt::Timestamp>,
15510    {
15511        self.update_time = std::option::Option::Some(v.into());
15512        self
15513    }
15514
15515    /// Sets or clears the value of [update_time][crate::model::InterceptDeployment::update_time].
15516    ///
15517    /// # Example
15518    /// ```ignore,no_run
15519    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15520    /// use wkt::Timestamp;
15521    /// let x = InterceptDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15522    /// let x = InterceptDeployment::new().set_or_clear_update_time(None::<Timestamp>);
15523    /// ```
15524    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15525    where
15526        T: std::convert::Into<wkt::Timestamp>,
15527    {
15528        self.update_time = v.map(|x| x.into());
15529        self
15530    }
15531
15532    /// Sets the value of [labels][crate::model::InterceptDeployment::labels].
15533    ///
15534    /// # Example
15535    /// ```ignore,no_run
15536    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15537    /// let x = InterceptDeployment::new().set_labels([
15538    ///     ("key0", "abc"),
15539    ///     ("key1", "xyz"),
15540    /// ]);
15541    /// ```
15542    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15543    where
15544        T: std::iter::IntoIterator<Item = (K, V)>,
15545        K: std::convert::Into<std::string::String>,
15546        V: std::convert::Into<std::string::String>,
15547    {
15548        use std::iter::Iterator;
15549        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15550        self
15551    }
15552
15553    /// Sets the value of [forwarding_rule][crate::model::InterceptDeployment::forwarding_rule].
15554    ///
15555    /// # Example
15556    /// ```ignore,no_run
15557    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15558    /// let x = InterceptDeployment::new().set_forwarding_rule("example");
15559    /// ```
15560    pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15561        self.forwarding_rule = v.into();
15562        self
15563    }
15564
15565    /// Sets the value of [intercept_deployment_group][crate::model::InterceptDeployment::intercept_deployment_group].
15566    ///
15567    /// # Example
15568    /// ```ignore,no_run
15569    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15570    /// # let project_id = "project_id";
15571    /// # let location_id = "location_id";
15572    /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15573    /// let x = InterceptDeployment::new().set_intercept_deployment_group(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15574    /// ```
15575    pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
15576        mut self,
15577        v: T,
15578    ) -> Self {
15579        self.intercept_deployment_group = v.into();
15580        self
15581    }
15582
15583    /// Sets the value of [state][crate::model::InterceptDeployment::state].
15584    ///
15585    /// # Example
15586    /// ```ignore,no_run
15587    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15588    /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
15589    /// let x0 = InterceptDeployment::new().set_state(State::Active);
15590    /// let x1 = InterceptDeployment::new().set_state(State::Creating);
15591    /// let x2 = InterceptDeployment::new().set_state(State::Deleting);
15592    /// ```
15593    pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
15594        mut self,
15595        v: T,
15596    ) -> Self {
15597        self.state = v.into();
15598        self
15599    }
15600
15601    /// Sets the value of [reconciling][crate::model::InterceptDeployment::reconciling].
15602    ///
15603    /// # Example
15604    /// ```ignore,no_run
15605    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15606    /// let x = InterceptDeployment::new().set_reconciling(true);
15607    /// ```
15608    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15609        self.reconciling = v.into();
15610        self
15611    }
15612
15613    /// Sets the value of [description][crate::model::InterceptDeployment::description].
15614    ///
15615    /// # Example
15616    /// ```ignore,no_run
15617    /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15618    /// let x = InterceptDeployment::new().set_description("example");
15619    /// ```
15620    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15621        self.description = v.into();
15622        self
15623    }
15624}
15625
15626impl wkt::message::Message for InterceptDeployment {
15627    fn typename() -> &'static str {
15628        "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeployment"
15629    }
15630}
15631
15632/// Defines additional types related to [InterceptDeployment].
15633pub mod intercept_deployment {
15634    #[allow(unused_imports)]
15635    use super::*;
15636
15637    /// The current state of the deployment.
15638    ///
15639    /// # Working with unknown values
15640    ///
15641    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15642    /// additional enum variants at any time. Adding new variants is not considered
15643    /// a breaking change. Applications should write their code in anticipation of:
15644    ///
15645    /// - New values appearing in future releases of the client library, **and**
15646    /// - New values received dynamically, without application changes.
15647    ///
15648    /// Please consult the [Working with enums] section in the user guide for some
15649    /// guidelines.
15650    ///
15651    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15652    #[derive(Clone, Debug, PartialEq)]
15653    #[non_exhaustive]
15654    pub enum State {
15655        /// State not set (this is not a valid state).
15656        Unspecified,
15657        /// The deployment is ready and in sync with the parent group.
15658        Active,
15659        /// The deployment is being created.
15660        Creating,
15661        /// The deployment is being deleted.
15662        Deleting,
15663        /// The deployment is out of sync with the parent group.
15664        /// In most cases, this is a result of a transient issue within the system
15665        /// (e.g. a delayed data-path config) and the system is expected to recover
15666        /// automatically. See the parent deployment group's state for more details.
15667        OutOfSync,
15668        /// An attempt to delete the deployment has failed. This is a terminal state
15669        /// and the deployment is not expected to recover. The only permitted
15670        /// operation is to retry deleting the deployment.
15671        DeleteFailed,
15672        /// If set, the enum was initialized with an unknown value.
15673        ///
15674        /// Applications can examine the value using [State::value] or
15675        /// [State::name].
15676        UnknownValue(state::UnknownValue),
15677    }
15678
15679    #[doc(hidden)]
15680    pub mod state {
15681        #[allow(unused_imports)]
15682        use super::*;
15683        #[derive(Clone, Debug, PartialEq)]
15684        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15685    }
15686
15687    impl State {
15688        /// Gets the enum value.
15689        ///
15690        /// Returns `None` if the enum contains an unknown value deserialized from
15691        /// the string representation of enums.
15692        pub fn value(&self) -> std::option::Option<i32> {
15693            match self {
15694                Self::Unspecified => std::option::Option::Some(0),
15695                Self::Active => std::option::Option::Some(1),
15696                Self::Creating => std::option::Option::Some(2),
15697                Self::Deleting => std::option::Option::Some(3),
15698                Self::OutOfSync => std::option::Option::Some(4),
15699                Self::DeleteFailed => std::option::Option::Some(5),
15700                Self::UnknownValue(u) => u.0.value(),
15701            }
15702        }
15703
15704        /// Gets the enum value as a string.
15705        ///
15706        /// Returns `None` if the enum contains an unknown value deserialized from
15707        /// the integer representation of enums.
15708        pub fn name(&self) -> std::option::Option<&str> {
15709            match self {
15710                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15711                Self::Active => std::option::Option::Some("ACTIVE"),
15712                Self::Creating => std::option::Option::Some("CREATING"),
15713                Self::Deleting => std::option::Option::Some("DELETING"),
15714                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
15715                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
15716                Self::UnknownValue(u) => u.0.name(),
15717            }
15718        }
15719    }
15720
15721    impl std::default::Default for State {
15722        fn default() -> Self {
15723            use std::convert::From;
15724            Self::from(0)
15725        }
15726    }
15727
15728    impl std::fmt::Display for State {
15729        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15730            wkt::internal::display_enum(f, self.name(), self.value())
15731        }
15732    }
15733
15734    impl std::convert::From<i32> for State {
15735        fn from(value: i32) -> Self {
15736            match value {
15737                0 => Self::Unspecified,
15738                1 => Self::Active,
15739                2 => Self::Creating,
15740                3 => Self::Deleting,
15741                4 => Self::OutOfSync,
15742                5 => Self::DeleteFailed,
15743                _ => Self::UnknownValue(state::UnknownValue(
15744                    wkt::internal::UnknownEnumValue::Integer(value),
15745                )),
15746            }
15747        }
15748    }
15749
15750    impl std::convert::From<&str> for State {
15751        fn from(value: &str) -> Self {
15752            use std::string::ToString;
15753            match value {
15754                "STATE_UNSPECIFIED" => Self::Unspecified,
15755                "ACTIVE" => Self::Active,
15756                "CREATING" => Self::Creating,
15757                "DELETING" => Self::Deleting,
15758                "OUT_OF_SYNC" => Self::OutOfSync,
15759                "DELETE_FAILED" => Self::DeleteFailed,
15760                _ => Self::UnknownValue(state::UnknownValue(
15761                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15762                )),
15763            }
15764        }
15765    }
15766
15767    impl serde::ser::Serialize for State {
15768        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15769        where
15770            S: serde::Serializer,
15771        {
15772            match self {
15773                Self::Unspecified => serializer.serialize_i32(0),
15774                Self::Active => serializer.serialize_i32(1),
15775                Self::Creating => serializer.serialize_i32(2),
15776                Self::Deleting => serializer.serialize_i32(3),
15777                Self::OutOfSync => serializer.serialize_i32(4),
15778                Self::DeleteFailed => serializer.serialize_i32(5),
15779                Self::UnknownValue(u) => u.0.serialize(serializer),
15780            }
15781        }
15782    }
15783
15784    impl<'de> serde::de::Deserialize<'de> for State {
15785        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15786        where
15787            D: serde::Deserializer<'de>,
15788        {
15789            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15790                ".google.cloud.networksecurity.v1.InterceptDeployment.State",
15791            ))
15792        }
15793    }
15794}
15795
15796/// Request message for ListInterceptDeployments.
15797#[derive(Clone, Default, PartialEq)]
15798#[non_exhaustive]
15799pub struct ListInterceptDeploymentsRequest {
15800    /// Required. The parent, which owns this collection of deployments.
15801    /// Example: `projects/123456789/locations/us-central1-a`.
15802    /// See <https://google.aip.dev/132> for more details.
15803    pub parent: std::string::String,
15804
15805    /// Optional. Requested page size. Server may return fewer items than
15806    /// requested. If unspecified, server will pick an appropriate default. See
15807    /// <https://google.aip.dev/158> for more details.
15808    pub page_size: i32,
15809
15810    /// Optional. A page token, received from a previous `ListInterceptDeployments`
15811    /// call. Provide this to retrieve the subsequent page. When paginating, all
15812    /// other parameters provided to `ListInterceptDeployments` must match the call
15813    /// that provided the page token. See <https://google.aip.dev/158> for more
15814    /// details.
15815    pub page_token: std::string::String,
15816
15817    /// Optional. Filter expression.
15818    /// See <https://google.aip.dev/160#filtering> for more details.
15819    pub filter: std::string::String,
15820
15821    /// Optional. Sort expression.
15822    /// See <https://google.aip.dev/132#ordering> for more details.
15823    pub order_by: std::string::String,
15824
15825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15826}
15827
15828impl ListInterceptDeploymentsRequest {
15829    /// Creates a new default instance.
15830    pub fn new() -> Self {
15831        std::default::Default::default()
15832    }
15833
15834    /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
15835    ///
15836    /// # Example
15837    /// ```ignore,no_run
15838    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15839    /// # let project_id = "project_id";
15840    /// # let location_id = "location_id";
15841    /// let x = ListInterceptDeploymentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
15842    /// ```
15843    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15844        self.parent = v.into();
15845        self
15846    }
15847
15848    /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
15849    ///
15850    /// # Example
15851    /// ```ignore,no_run
15852    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15853    /// let x = ListInterceptDeploymentsRequest::new().set_page_size(42);
15854    /// ```
15855    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15856        self.page_size = v.into();
15857        self
15858    }
15859
15860    /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
15861    ///
15862    /// # Example
15863    /// ```ignore,no_run
15864    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15865    /// let x = ListInterceptDeploymentsRequest::new().set_page_token("example");
15866    /// ```
15867    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15868        self.page_token = v.into();
15869        self
15870    }
15871
15872    /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
15873    ///
15874    /// # Example
15875    /// ```ignore,no_run
15876    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15877    /// let x = ListInterceptDeploymentsRequest::new().set_filter("example");
15878    /// ```
15879    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15880        self.filter = v.into();
15881        self
15882    }
15883
15884    /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
15885    ///
15886    /// # Example
15887    /// ```ignore,no_run
15888    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15889    /// let x = ListInterceptDeploymentsRequest::new().set_order_by("example");
15890    /// ```
15891    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15892        self.order_by = v.into();
15893        self
15894    }
15895}
15896
15897impl wkt::message::Message for ListInterceptDeploymentsRequest {
15898    fn typename() -> &'static str {
15899        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest"
15900    }
15901}
15902
15903/// Response message for ListInterceptDeployments.
15904#[derive(Clone, Default, PartialEq)]
15905#[non_exhaustive]
15906pub struct ListInterceptDeploymentsResponse {
15907    /// The deployments from the specified parent.
15908    pub intercept_deployments: std::vec::Vec<crate::model::InterceptDeployment>,
15909
15910    /// A token that can be sent as `page_token` to retrieve the next page.
15911    /// If this field is omitted, there are no subsequent pages.
15912    /// See <https://google.aip.dev/158> for more details.
15913    pub next_page_token: std::string::String,
15914
15915    /// Locations that could not be reached.
15916    pub unreachable: std::vec::Vec<std::string::String>,
15917
15918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15919}
15920
15921impl ListInterceptDeploymentsResponse {
15922    /// Creates a new default instance.
15923    pub fn new() -> Self {
15924        std::default::Default::default()
15925    }
15926
15927    /// Sets the value of [intercept_deployments][crate::model::ListInterceptDeploymentsResponse::intercept_deployments].
15928    ///
15929    /// # Example
15930    /// ```ignore,no_run
15931    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15932    /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15933    /// let x = ListInterceptDeploymentsResponse::new()
15934    ///     .set_intercept_deployments([
15935    ///         InterceptDeployment::default()/* use setters */,
15936    ///         InterceptDeployment::default()/* use (different) setters */,
15937    ///     ]);
15938    /// ```
15939    pub fn set_intercept_deployments<T, V>(mut self, v: T) -> Self
15940    where
15941        T: std::iter::IntoIterator<Item = V>,
15942        V: std::convert::Into<crate::model::InterceptDeployment>,
15943    {
15944        use std::iter::Iterator;
15945        self.intercept_deployments = v.into_iter().map(|i| i.into()).collect();
15946        self
15947    }
15948
15949    /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentsResponse::next_page_token].
15950    ///
15951    /// # Example
15952    /// ```ignore,no_run
15953    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15954    /// let x = ListInterceptDeploymentsResponse::new().set_next_page_token("example");
15955    /// ```
15956    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15957        self.next_page_token = v.into();
15958        self
15959    }
15960
15961    /// Sets the value of [unreachable][crate::model::ListInterceptDeploymentsResponse::unreachable].
15962    ///
15963    /// # Example
15964    /// ```ignore,no_run
15965    /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15966    /// let x = ListInterceptDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
15967    /// ```
15968    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15969    where
15970        T: std::iter::IntoIterator<Item = V>,
15971        V: std::convert::Into<std::string::String>,
15972    {
15973        use std::iter::Iterator;
15974        self.unreachable = v.into_iter().map(|i| i.into()).collect();
15975        self
15976    }
15977}
15978
15979impl wkt::message::Message for ListInterceptDeploymentsResponse {
15980    fn typename() -> &'static str {
15981        "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse"
15982    }
15983}
15984
15985#[doc(hidden)]
15986impl google_cloud_gax::paginator::internal::PageableResponse for ListInterceptDeploymentsResponse {
15987    type PageItem = crate::model::InterceptDeployment;
15988
15989    fn items(self) -> std::vec::Vec<Self::PageItem> {
15990        self.intercept_deployments
15991    }
15992
15993    fn next_page_token(&self) -> std::string::String {
15994        use std::clone::Clone;
15995        self.next_page_token.clone()
15996    }
15997}
15998
15999/// Request message for GetInterceptDeployment.
16000#[derive(Clone, Default, PartialEq)]
16001#[non_exhaustive]
16002pub struct GetInterceptDeploymentRequest {
16003    /// Required. The name of the deployment to retrieve.
16004    /// Format:
16005    /// projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}
16006    pub name: std::string::String,
16007
16008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16009}
16010
16011impl GetInterceptDeploymentRequest {
16012    /// Creates a new default instance.
16013    pub fn new() -> Self {
16014        std::default::Default::default()
16015    }
16016
16017    /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
16018    ///
16019    /// # Example
16020    /// ```ignore,no_run
16021    /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentRequest;
16022    /// # let project_id = "project_id";
16023    /// # let location_id = "location_id";
16024    /// # let intercept_deployment_id = "intercept_deployment_id";
16025    /// let x = GetInterceptDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
16026    /// ```
16027    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16028        self.name = v.into();
16029        self
16030    }
16031}
16032
16033impl wkt::message::Message for GetInterceptDeploymentRequest {
16034    fn typename() -> &'static str {
16035        "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentRequest"
16036    }
16037}
16038
16039/// Request message for CreateInterceptDeployment.
16040#[derive(Clone, Default, PartialEq)]
16041#[non_exhaustive]
16042pub struct CreateInterceptDeploymentRequest {
16043    /// Required. The parent resource where this deployment will be created.
16044    /// Format: projects/{project}/locations/{location}
16045    pub parent: std::string::String,
16046
16047    /// Required. The ID to use for the new deployment, which will become the final
16048    /// component of the deployment's resource name.
16049    pub intercept_deployment_id: std::string::String,
16050
16051    /// Required. The deployment to create.
16052    pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
16053
16054    /// Optional. A unique identifier for this request. Must be a UUID4.
16055    /// This request is only idempotent if a `request_id` is provided.
16056    /// See <https://google.aip.dev/155> for more details.
16057    pub request_id: std::string::String,
16058
16059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16060}
16061
16062impl CreateInterceptDeploymentRequest {
16063    /// Creates a new default instance.
16064    pub fn new() -> Self {
16065        std::default::Default::default()
16066    }
16067
16068    /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
16069    ///
16070    /// # Example
16071    /// ```ignore,no_run
16072    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16073    /// # let project_id = "project_id";
16074    /// # let location_id = "location_id";
16075    /// let x = CreateInterceptDeploymentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16076    /// ```
16077    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16078        self.parent = v.into();
16079        self
16080    }
16081
16082    /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
16083    ///
16084    /// # Example
16085    /// ```ignore,no_run
16086    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16087    /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment_id("example");
16088    /// ```
16089    pub fn set_intercept_deployment_id<T: std::convert::Into<std::string::String>>(
16090        mut self,
16091        v: T,
16092    ) -> Self {
16093        self.intercept_deployment_id = v.into();
16094        self
16095    }
16096
16097    /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
16098    ///
16099    /// # Example
16100    /// ```ignore,no_run
16101    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16102    /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16103    /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
16104    /// ```
16105    pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
16106    where
16107        T: std::convert::Into<crate::model::InterceptDeployment>,
16108    {
16109        self.intercept_deployment = std::option::Option::Some(v.into());
16110        self
16111    }
16112
16113    /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
16114    ///
16115    /// # Example
16116    /// ```ignore,no_run
16117    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16118    /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16119    /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
16120    /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
16121    /// ```
16122    pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
16123    where
16124        T: std::convert::Into<crate::model::InterceptDeployment>,
16125    {
16126        self.intercept_deployment = v.map(|x| x.into());
16127        self
16128    }
16129
16130    /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
16131    ///
16132    /// # Example
16133    /// ```ignore,no_run
16134    /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16135    /// let x = CreateInterceptDeploymentRequest::new().set_request_id("example");
16136    /// ```
16137    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16138        self.request_id = v.into();
16139        self
16140    }
16141}
16142
16143impl wkt::message::Message for CreateInterceptDeploymentRequest {
16144    fn typename() -> &'static str {
16145        "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest"
16146    }
16147}
16148
16149/// Request message for UpdateInterceptDeployment.
16150#[derive(Clone, Default, PartialEq)]
16151#[non_exhaustive]
16152pub struct UpdateInterceptDeploymentRequest {
16153    /// Optional. The list of fields to update.
16154    /// Fields are specified relative to the deployment
16155    /// (e.g. `description`; *not* `intercept_deployment.description`).
16156    /// See <https://google.aip.dev/161> for more details.
16157    pub update_mask: std::option::Option<wkt::FieldMask>,
16158
16159    /// Required. The deployment to update.
16160    pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
16161
16162    /// Optional. A unique identifier for this request. Must be a UUID4.
16163    /// This request is only idempotent if a `request_id` is provided.
16164    /// See <https://google.aip.dev/155> for more details.
16165    pub request_id: std::string::String,
16166
16167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16168}
16169
16170impl UpdateInterceptDeploymentRequest {
16171    /// Creates a new default instance.
16172    pub fn new() -> Self {
16173        std::default::Default::default()
16174    }
16175
16176    /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
16177    ///
16178    /// # Example
16179    /// ```ignore,no_run
16180    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16181    /// use wkt::FieldMask;
16182    /// let x = UpdateInterceptDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16183    /// ```
16184    pub fn set_update_mask<T>(mut self, v: T) -> Self
16185    where
16186        T: std::convert::Into<wkt::FieldMask>,
16187    {
16188        self.update_mask = std::option::Option::Some(v.into());
16189        self
16190    }
16191
16192    /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
16193    ///
16194    /// # Example
16195    /// ```ignore,no_run
16196    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16197    /// use wkt::FieldMask;
16198    /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16199    /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16200    /// ```
16201    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16202    where
16203        T: std::convert::Into<wkt::FieldMask>,
16204    {
16205        self.update_mask = v.map(|x| x.into());
16206        self
16207    }
16208
16209    /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
16210    ///
16211    /// # Example
16212    /// ```ignore,no_run
16213    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16214    /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16215    /// let x = UpdateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
16216    /// ```
16217    pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
16218    where
16219        T: std::convert::Into<crate::model::InterceptDeployment>,
16220    {
16221        self.intercept_deployment = std::option::Option::Some(v.into());
16222        self
16223    }
16224
16225    /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
16226    ///
16227    /// # Example
16228    /// ```ignore,no_run
16229    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16230    /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16231    /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
16232    /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
16233    /// ```
16234    pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
16235    where
16236        T: std::convert::Into<crate::model::InterceptDeployment>,
16237    {
16238        self.intercept_deployment = v.map(|x| x.into());
16239        self
16240    }
16241
16242    /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
16243    ///
16244    /// # Example
16245    /// ```ignore,no_run
16246    /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16247    /// let x = UpdateInterceptDeploymentRequest::new().set_request_id("example");
16248    /// ```
16249    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16250        self.request_id = v.into();
16251        self
16252    }
16253}
16254
16255impl wkt::message::Message for UpdateInterceptDeploymentRequest {
16256    fn typename() -> &'static str {
16257        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest"
16258    }
16259}
16260
16261/// Request message for DeleteInterceptDeployment.
16262#[derive(Clone, Default, PartialEq)]
16263#[non_exhaustive]
16264pub struct DeleteInterceptDeploymentRequest {
16265    /// Required. Name of the resource
16266    pub name: std::string::String,
16267
16268    /// Optional. A unique identifier for this request. Must be a UUID4.
16269    /// This request is only idempotent if a `request_id` is provided.
16270    /// See <https://google.aip.dev/155> for more details.
16271    pub request_id: std::string::String,
16272
16273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16274}
16275
16276impl DeleteInterceptDeploymentRequest {
16277    /// Creates a new default instance.
16278    pub fn new() -> Self {
16279        std::default::Default::default()
16280    }
16281
16282    /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
16283    ///
16284    /// # Example
16285    /// ```ignore,no_run
16286    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16287    /// # let project_id = "project_id";
16288    /// # let location_id = "location_id";
16289    /// # let intercept_deployment_id = "intercept_deployment_id";
16290    /// let x = DeleteInterceptDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
16291    /// ```
16292    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16293        self.name = v.into();
16294        self
16295    }
16296
16297    /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
16298    ///
16299    /// # Example
16300    /// ```ignore,no_run
16301    /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16302    /// let x = DeleteInterceptDeploymentRequest::new().set_request_id("example");
16303    /// ```
16304    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16305        self.request_id = v.into();
16306        self
16307    }
16308}
16309
16310impl wkt::message::Message for DeleteInterceptDeploymentRequest {
16311    fn typename() -> &'static str {
16312        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest"
16313    }
16314}
16315
16316/// Details about intercept in a specific cloud location.
16317#[derive(Clone, Default, PartialEq)]
16318#[non_exhaustive]
16319pub struct InterceptLocation {
16320    /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
16321    pub location: std::string::String,
16322
16323    /// Output only. The current state of the association in this location.
16324    pub state: crate::model::intercept_location::State,
16325
16326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16327}
16328
16329impl InterceptLocation {
16330    /// Creates a new default instance.
16331    pub fn new() -> Self {
16332        std::default::Default::default()
16333    }
16334
16335    /// Sets the value of [location][crate::model::InterceptLocation::location].
16336    ///
16337    /// # Example
16338    /// ```ignore,no_run
16339    /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16340    /// let x = InterceptLocation::new().set_location("example");
16341    /// ```
16342    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16343        self.location = v.into();
16344        self
16345    }
16346
16347    /// Sets the value of [state][crate::model::InterceptLocation::state].
16348    ///
16349    /// # Example
16350    /// ```ignore,no_run
16351    /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16352    /// use google_cloud_networksecurity_v1::model::intercept_location::State;
16353    /// let x0 = InterceptLocation::new().set_state(State::Active);
16354    /// let x1 = InterceptLocation::new().set_state(State::OutOfSync);
16355    /// ```
16356    pub fn set_state<T: std::convert::Into<crate::model::intercept_location::State>>(
16357        mut self,
16358        v: T,
16359    ) -> Self {
16360        self.state = v.into();
16361        self
16362    }
16363}
16364
16365impl wkt::message::Message for InterceptLocation {
16366    fn typename() -> &'static str {
16367        "type.googleapis.com/google.cloud.networksecurity.v1.InterceptLocation"
16368    }
16369}
16370
16371/// Defines additional types related to [InterceptLocation].
16372pub mod intercept_location {
16373    #[allow(unused_imports)]
16374    use super::*;
16375
16376    /// The current state of a resource in the location.
16377    ///
16378    /// # Working with unknown values
16379    ///
16380    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16381    /// additional enum variants at any time. Adding new variants is not considered
16382    /// a breaking change. Applications should write their code in anticipation of:
16383    ///
16384    /// - New values appearing in future releases of the client library, **and**
16385    /// - New values received dynamically, without application changes.
16386    ///
16387    /// Please consult the [Working with enums] section in the user guide for some
16388    /// guidelines.
16389    ///
16390    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16391    #[derive(Clone, Debug, PartialEq)]
16392    #[non_exhaustive]
16393    pub enum State {
16394        /// State not set (this is not a valid state).
16395        Unspecified,
16396        /// The resource is ready and in sync in the location.
16397        Active,
16398        /// The resource is out of sync in the location.
16399        /// In most cases, this is a result of a transient issue within the system
16400        /// (e.g. an inaccessible location) and the system is expected to recover
16401        /// automatically.
16402        OutOfSync,
16403        /// If set, the enum was initialized with an unknown value.
16404        ///
16405        /// Applications can examine the value using [State::value] or
16406        /// [State::name].
16407        UnknownValue(state::UnknownValue),
16408    }
16409
16410    #[doc(hidden)]
16411    pub mod state {
16412        #[allow(unused_imports)]
16413        use super::*;
16414        #[derive(Clone, Debug, PartialEq)]
16415        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16416    }
16417
16418    impl State {
16419        /// Gets the enum value.
16420        ///
16421        /// Returns `None` if the enum contains an unknown value deserialized from
16422        /// the string representation of enums.
16423        pub fn value(&self) -> std::option::Option<i32> {
16424            match self {
16425                Self::Unspecified => std::option::Option::Some(0),
16426                Self::Active => std::option::Option::Some(1),
16427                Self::OutOfSync => std::option::Option::Some(2),
16428                Self::UnknownValue(u) => u.0.value(),
16429            }
16430        }
16431
16432        /// Gets the enum value as a string.
16433        ///
16434        /// Returns `None` if the enum contains an unknown value deserialized from
16435        /// the integer representation of enums.
16436        pub fn name(&self) -> std::option::Option<&str> {
16437            match self {
16438                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16439                Self::Active => std::option::Option::Some("ACTIVE"),
16440                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16441                Self::UnknownValue(u) => u.0.name(),
16442            }
16443        }
16444    }
16445
16446    impl std::default::Default for State {
16447        fn default() -> Self {
16448            use std::convert::From;
16449            Self::from(0)
16450        }
16451    }
16452
16453    impl std::fmt::Display for State {
16454        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16455            wkt::internal::display_enum(f, self.name(), self.value())
16456        }
16457    }
16458
16459    impl std::convert::From<i32> for State {
16460        fn from(value: i32) -> Self {
16461            match value {
16462                0 => Self::Unspecified,
16463                1 => Self::Active,
16464                2 => Self::OutOfSync,
16465                _ => Self::UnknownValue(state::UnknownValue(
16466                    wkt::internal::UnknownEnumValue::Integer(value),
16467                )),
16468            }
16469        }
16470    }
16471
16472    impl std::convert::From<&str> for State {
16473        fn from(value: &str) -> Self {
16474            use std::string::ToString;
16475            match value {
16476                "STATE_UNSPECIFIED" => Self::Unspecified,
16477                "ACTIVE" => Self::Active,
16478                "OUT_OF_SYNC" => Self::OutOfSync,
16479                _ => Self::UnknownValue(state::UnknownValue(
16480                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16481                )),
16482            }
16483        }
16484    }
16485
16486    impl serde::ser::Serialize for State {
16487        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16488        where
16489            S: serde::Serializer,
16490        {
16491            match self {
16492                Self::Unspecified => serializer.serialize_i32(0),
16493                Self::Active => serializer.serialize_i32(1),
16494                Self::OutOfSync => serializer.serialize_i32(2),
16495                Self::UnknownValue(u) => u.0.serialize(serializer),
16496            }
16497        }
16498    }
16499
16500    impl<'de> serde::de::Deserialize<'de> for State {
16501        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16502        where
16503            D: serde::Deserializer<'de>,
16504        {
16505            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16506                ".google.cloud.networksecurity.v1.InterceptLocation.State",
16507            ))
16508        }
16509    }
16510}
16511
16512/// An endpoint group is a consumer frontend for a deployment group (backend).
16513/// In order to configure mirroring for a network, consumers must create:
16514///
16515/// - An association between their network and the endpoint group.
16516/// - A security profile that points to the endpoint group.
16517/// - A mirroring rule that references the security profile (group).
16518#[derive(Clone, Default, PartialEq)]
16519#[non_exhaustive]
16520pub struct MirroringEndpointGroup {
16521    /// Immutable. Identifier. The resource name of this endpoint group, for
16522    /// example:
16523    /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
16524    /// See <https://google.aip.dev/122> for more details.
16525    pub name: std::string::String,
16526
16527    /// Output only. The timestamp when the resource was created.
16528    /// See <https://google.aip.dev/148#timestamps>.
16529    pub create_time: std::option::Option<wkt::Timestamp>,
16530
16531    /// Output only. The timestamp when the resource was most recently updated.
16532    /// See <https://google.aip.dev/148#timestamps>.
16533    pub update_time: std::option::Option<wkt::Timestamp>,
16534
16535    /// Optional. Labels are key/value pairs that help to organize and filter
16536    /// resources.
16537    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16538
16539    /// Immutable. The deployment group that this DIRECT endpoint group is
16540    /// connected to, for example:
16541    /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16542    /// See <https://google.aip.dev/124>.
16543    pub mirroring_deployment_group: std::string::String,
16544
16545    /// Output only. List of details about the connected deployment groups to this
16546    /// endpoint group.
16547    pub connected_deployment_groups:
16548        std::vec::Vec<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16549
16550    /// Output only. The current state of the endpoint group.
16551    /// See <https://google.aip.dev/216>.
16552    pub state: crate::model::mirroring_endpoint_group::State,
16553
16554    /// Output only. The current state of the resource does not match the user's
16555    /// intended state, and the system is working to reconcile them. This is part
16556    /// of the normal operation (e.g. adding a new association to the group). See
16557    /// <https://google.aip.dev/128>.
16558    pub reconciling: bool,
16559
16560    /// Immutable. The type of the endpoint group.
16561    /// If left unspecified, defaults to DIRECT.
16562    pub r#type: crate::model::mirroring_endpoint_group::Type,
16563
16564    /// Output only. List of associations to this endpoint group.
16565    pub associations: std::vec::Vec<crate::model::mirroring_endpoint_group::AssociationDetails>,
16566
16567    /// Optional. User-provided description of the endpoint group.
16568    /// Used as additional context for the endpoint group.
16569    pub description: std::string::String,
16570
16571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16572}
16573
16574impl MirroringEndpointGroup {
16575    /// Creates a new default instance.
16576    pub fn new() -> Self {
16577        std::default::Default::default()
16578    }
16579
16580    /// Sets the value of [name][crate::model::MirroringEndpointGroup::name].
16581    ///
16582    /// # Example
16583    /// ```ignore,no_run
16584    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16585    /// # let project_id = "project_id";
16586    /// # let location_id = "location_id";
16587    /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
16588    /// let x = MirroringEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
16589    /// ```
16590    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16591        self.name = v.into();
16592        self
16593    }
16594
16595    /// Sets the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16596    ///
16597    /// # Example
16598    /// ```ignore,no_run
16599    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16600    /// use wkt::Timestamp;
16601    /// let x = MirroringEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
16602    /// ```
16603    pub fn set_create_time<T>(mut self, v: T) -> Self
16604    where
16605        T: std::convert::Into<wkt::Timestamp>,
16606    {
16607        self.create_time = std::option::Option::Some(v.into());
16608        self
16609    }
16610
16611    /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16612    ///
16613    /// # Example
16614    /// ```ignore,no_run
16615    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16616    /// use wkt::Timestamp;
16617    /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16618    /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
16619    /// ```
16620    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16621    where
16622        T: std::convert::Into<wkt::Timestamp>,
16623    {
16624        self.create_time = v.map(|x| x.into());
16625        self
16626    }
16627
16628    /// Sets the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16629    ///
16630    /// # Example
16631    /// ```ignore,no_run
16632    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16633    /// use wkt::Timestamp;
16634    /// let x = MirroringEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
16635    /// ```
16636    pub fn set_update_time<T>(mut self, v: T) -> Self
16637    where
16638        T: std::convert::Into<wkt::Timestamp>,
16639    {
16640        self.update_time = std::option::Option::Some(v.into());
16641        self
16642    }
16643
16644    /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16645    ///
16646    /// # Example
16647    /// ```ignore,no_run
16648    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16649    /// use wkt::Timestamp;
16650    /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16651    /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
16652    /// ```
16653    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16654    where
16655        T: std::convert::Into<wkt::Timestamp>,
16656    {
16657        self.update_time = v.map(|x| x.into());
16658        self
16659    }
16660
16661    /// Sets the value of [labels][crate::model::MirroringEndpointGroup::labels].
16662    ///
16663    /// # Example
16664    /// ```ignore,no_run
16665    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16666    /// let x = MirroringEndpointGroup::new().set_labels([
16667    ///     ("key0", "abc"),
16668    ///     ("key1", "xyz"),
16669    /// ]);
16670    /// ```
16671    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16672    where
16673        T: std::iter::IntoIterator<Item = (K, V)>,
16674        K: std::convert::Into<std::string::String>,
16675        V: std::convert::Into<std::string::String>,
16676    {
16677        use std::iter::Iterator;
16678        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16679        self
16680    }
16681
16682    /// Sets the value of [mirroring_deployment_group][crate::model::MirroringEndpointGroup::mirroring_deployment_group].
16683    ///
16684    /// # Example
16685    /// ```ignore,no_run
16686    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16687    /// # let project_id = "project_id";
16688    /// # let location_id = "location_id";
16689    /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
16690    /// let x = MirroringEndpointGroup::new().set_mirroring_deployment_group(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
16691    /// ```
16692    pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
16693        mut self,
16694        v: T,
16695    ) -> Self {
16696        self.mirroring_deployment_group = v.into();
16697        self
16698    }
16699
16700    /// Sets the value of [connected_deployment_groups][crate::model::MirroringEndpointGroup::connected_deployment_groups].
16701    ///
16702    /// # Example
16703    /// ```ignore,no_run
16704    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16705    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16706    /// let x = MirroringEndpointGroup::new()
16707    ///     .set_connected_deployment_groups([
16708    ///         ConnectedDeploymentGroup::default()/* use setters */,
16709    ///         ConnectedDeploymentGroup::default()/* use (different) setters */,
16710    ///     ]);
16711    /// ```
16712    pub fn set_connected_deployment_groups<T, V>(mut self, v: T) -> Self
16713    where
16714        T: std::iter::IntoIterator<Item = V>,
16715        V: std::convert::Into<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16716    {
16717        use std::iter::Iterator;
16718        self.connected_deployment_groups = v.into_iter().map(|i| i.into()).collect();
16719        self
16720    }
16721
16722    /// Sets the value of [state][crate::model::MirroringEndpointGroup::state].
16723    ///
16724    /// # Example
16725    /// ```ignore,no_run
16726    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16727    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::State;
16728    /// let x0 = MirroringEndpointGroup::new().set_state(State::Active);
16729    /// let x1 = MirroringEndpointGroup::new().set_state(State::Closed);
16730    /// let x2 = MirroringEndpointGroup::new().set_state(State::Creating);
16731    /// ```
16732    pub fn set_state<T: std::convert::Into<crate::model::mirroring_endpoint_group::State>>(
16733        mut self,
16734        v: T,
16735    ) -> Self {
16736        self.state = v.into();
16737        self
16738    }
16739
16740    /// Sets the value of [reconciling][crate::model::MirroringEndpointGroup::reconciling].
16741    ///
16742    /// # Example
16743    /// ```ignore,no_run
16744    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16745    /// let x = MirroringEndpointGroup::new().set_reconciling(true);
16746    /// ```
16747    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16748        self.reconciling = v.into();
16749        self
16750    }
16751
16752    /// Sets the value of [r#type][crate::model::MirroringEndpointGroup::type].
16753    ///
16754    /// # Example
16755    /// ```ignore,no_run
16756    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16757    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::Type;
16758    /// let x0 = MirroringEndpointGroup::new().set_type(Type::Direct);
16759    /// ```
16760    pub fn set_type<T: std::convert::Into<crate::model::mirroring_endpoint_group::Type>>(
16761        mut self,
16762        v: T,
16763    ) -> Self {
16764        self.r#type = v.into();
16765        self
16766    }
16767
16768    /// Sets the value of [associations][crate::model::MirroringEndpointGroup::associations].
16769    ///
16770    /// # Example
16771    /// ```ignore,no_run
16772    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16773    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16774    /// let x = MirroringEndpointGroup::new()
16775    ///     .set_associations([
16776    ///         AssociationDetails::default()/* use setters */,
16777    ///         AssociationDetails::default()/* use (different) setters */,
16778    ///     ]);
16779    /// ```
16780    pub fn set_associations<T, V>(mut self, v: T) -> Self
16781    where
16782        T: std::iter::IntoIterator<Item = V>,
16783        V: std::convert::Into<crate::model::mirroring_endpoint_group::AssociationDetails>,
16784    {
16785        use std::iter::Iterator;
16786        self.associations = v.into_iter().map(|i| i.into()).collect();
16787        self
16788    }
16789
16790    /// Sets the value of [description][crate::model::MirroringEndpointGroup::description].
16791    ///
16792    /// # Example
16793    /// ```ignore,no_run
16794    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16795    /// let x = MirroringEndpointGroup::new().set_description("example");
16796    /// ```
16797    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16798        self.description = v.into();
16799        self
16800    }
16801}
16802
16803impl wkt::message::Message for MirroringEndpointGroup {
16804    fn typename() -> &'static str {
16805        "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup"
16806    }
16807}
16808
16809/// Defines additional types related to [MirroringEndpointGroup].
16810pub mod mirroring_endpoint_group {
16811    #[allow(unused_imports)]
16812    use super::*;
16813
16814    /// The endpoint group's view of a connected deployment group.
16815    #[derive(Clone, Default, PartialEq)]
16816    #[non_exhaustive]
16817    pub struct ConnectedDeploymentGroup {
16818        /// Output only. The connected deployment group's resource name, for example:
16819        /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16820        /// See <https://google.aip.dev/124>.
16821        pub name: std::string::String,
16822
16823        /// Output only. The list of locations where the deployment group is present.
16824        pub locations: std::vec::Vec<crate::model::MirroringLocation>,
16825
16826        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16827    }
16828
16829    impl ConnectedDeploymentGroup {
16830        /// Creates a new default instance.
16831        pub fn new() -> Self {
16832            std::default::Default::default()
16833        }
16834
16835        /// Sets the value of [name][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::name].
16836        ///
16837        /// # Example
16838        /// ```ignore,no_run
16839        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16840        /// # let project_id = "project_id";
16841        /// # let location_id = "location_id";
16842        /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
16843        /// let x = ConnectedDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
16844        /// ```
16845        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16846            self.name = v.into();
16847            self
16848        }
16849
16850        /// Sets the value of [locations][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::locations].
16851        ///
16852        /// # Example
16853        /// ```ignore,no_run
16854        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16855        /// use google_cloud_networksecurity_v1::model::MirroringLocation;
16856        /// let x = ConnectedDeploymentGroup::new()
16857        ///     .set_locations([
16858        ///         MirroringLocation::default()/* use setters */,
16859        ///         MirroringLocation::default()/* use (different) setters */,
16860        ///     ]);
16861        /// ```
16862        pub fn set_locations<T, V>(mut self, v: T) -> Self
16863        where
16864            T: std::iter::IntoIterator<Item = V>,
16865            V: std::convert::Into<crate::model::MirroringLocation>,
16866        {
16867            use std::iter::Iterator;
16868            self.locations = v.into_iter().map(|i| i.into()).collect();
16869            self
16870        }
16871    }
16872
16873    impl wkt::message::Message for ConnectedDeploymentGroup {
16874        fn typename() -> &'static str {
16875            "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup"
16876        }
16877    }
16878
16879    /// The endpoint group's view of a connected association.
16880    #[derive(Clone, Default, PartialEq)]
16881    #[non_exhaustive]
16882    pub struct AssociationDetails {
16883        /// Output only. The connected association's resource name, for example:
16884        /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-ega`.
16885        /// See <https://google.aip.dev/124>.
16886        pub name: std::string::String,
16887
16888        /// Output only. The associated network, for example:
16889        /// projects/123456789/global/networks/my-network.
16890        /// See <https://google.aip.dev/124>.
16891        pub network: std::string::String,
16892
16893        /// Output only. Most recent known state of the association.
16894        pub state: crate::model::mirroring_endpoint_group_association::State,
16895
16896        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16897    }
16898
16899    impl AssociationDetails {
16900        /// Creates a new default instance.
16901        pub fn new() -> Self {
16902            std::default::Default::default()
16903        }
16904
16905        /// Sets the value of [name][crate::model::mirroring_endpoint_group::AssociationDetails::name].
16906        ///
16907        /// # Example
16908        /// ```ignore,no_run
16909        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16910        /// # let project_id = "project_id";
16911        /// # let location_id = "location_id";
16912        /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
16913        /// let x = AssociationDetails::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
16914        /// ```
16915        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16916            self.name = v.into();
16917            self
16918        }
16919
16920        /// Sets the value of [network][crate::model::mirroring_endpoint_group::AssociationDetails::network].
16921        ///
16922        /// # Example
16923        /// ```ignore,no_run
16924        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16925        /// let x = AssociationDetails::new().set_network("example");
16926        /// ```
16927        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16928            self.network = v.into();
16929            self
16930        }
16931
16932        /// Sets the value of [state][crate::model::mirroring_endpoint_group::AssociationDetails::state].
16933        ///
16934        /// # Example
16935        /// ```ignore,no_run
16936        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16937        /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
16938        /// let x0 = AssociationDetails::new().set_state(State::Active);
16939        /// let x1 = AssociationDetails::new().set_state(State::Creating);
16940        /// let x2 = AssociationDetails::new().set_state(State::Deleting);
16941        /// ```
16942        pub fn set_state<
16943            T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
16944        >(
16945            mut self,
16946            v: T,
16947        ) -> Self {
16948            self.state = v.into();
16949            self
16950        }
16951    }
16952
16953    impl wkt::message::Message for AssociationDetails {
16954        fn typename() -> &'static str {
16955            "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails"
16956        }
16957    }
16958
16959    /// The current state of the endpoint group.
16960    ///
16961    /// # Working with unknown values
16962    ///
16963    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16964    /// additional enum variants at any time. Adding new variants is not considered
16965    /// a breaking change. Applications should write their code in anticipation of:
16966    ///
16967    /// - New values appearing in future releases of the client library, **and**
16968    /// - New values received dynamically, without application changes.
16969    ///
16970    /// Please consult the [Working with enums] section in the user guide for some
16971    /// guidelines.
16972    ///
16973    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16974    #[derive(Clone, Debug, PartialEq)]
16975    #[non_exhaustive]
16976    pub enum State {
16977        /// State not set (this is not a valid state).
16978        Unspecified,
16979        /// The endpoint group is ready and in sync with the target deployment group.
16980        Active,
16981        /// The deployment group backing this endpoint group has been force-deleted.
16982        /// This endpoint group cannot be used and mirroring is effectively disabled.
16983        Closed,
16984        /// The endpoint group is being created.
16985        Creating,
16986        /// The endpoint group is being deleted.
16987        Deleting,
16988        /// The endpoint group is out of sync with the backing deployment group.
16989        /// In most cases, this is a result of a transient issue within the system
16990        /// (e.g. an inaccessible location) and the system is expected to recover
16991        /// automatically. See the associations field for details per network and
16992        /// location.
16993        OutOfSync,
16994        /// An attempt to delete the endpoint group has failed. This is a terminal
16995        /// state and the endpoint group is not expected to recover.
16996        /// The only permitted operation is to retry deleting the endpoint group.
16997        DeleteFailed,
16998        /// If set, the enum was initialized with an unknown value.
16999        ///
17000        /// Applications can examine the value using [State::value] or
17001        /// [State::name].
17002        UnknownValue(state::UnknownValue),
17003    }
17004
17005    #[doc(hidden)]
17006    pub mod state {
17007        #[allow(unused_imports)]
17008        use super::*;
17009        #[derive(Clone, Debug, PartialEq)]
17010        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17011    }
17012
17013    impl State {
17014        /// Gets the enum value.
17015        ///
17016        /// Returns `None` if the enum contains an unknown value deserialized from
17017        /// the string representation of enums.
17018        pub fn value(&self) -> std::option::Option<i32> {
17019            match self {
17020                Self::Unspecified => std::option::Option::Some(0),
17021                Self::Active => std::option::Option::Some(1),
17022                Self::Closed => std::option::Option::Some(2),
17023                Self::Creating => std::option::Option::Some(3),
17024                Self::Deleting => std::option::Option::Some(4),
17025                Self::OutOfSync => std::option::Option::Some(5),
17026                Self::DeleteFailed => std::option::Option::Some(6),
17027                Self::UnknownValue(u) => u.0.value(),
17028            }
17029        }
17030
17031        /// Gets the enum value as a string.
17032        ///
17033        /// Returns `None` if the enum contains an unknown value deserialized from
17034        /// the integer representation of enums.
17035        pub fn name(&self) -> std::option::Option<&str> {
17036            match self {
17037                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17038                Self::Active => std::option::Option::Some("ACTIVE"),
17039                Self::Closed => std::option::Option::Some("CLOSED"),
17040                Self::Creating => std::option::Option::Some("CREATING"),
17041                Self::Deleting => std::option::Option::Some("DELETING"),
17042                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
17043                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
17044                Self::UnknownValue(u) => u.0.name(),
17045            }
17046        }
17047    }
17048
17049    impl std::default::Default for State {
17050        fn default() -> Self {
17051            use std::convert::From;
17052            Self::from(0)
17053        }
17054    }
17055
17056    impl std::fmt::Display for State {
17057        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17058            wkt::internal::display_enum(f, self.name(), self.value())
17059        }
17060    }
17061
17062    impl std::convert::From<i32> for State {
17063        fn from(value: i32) -> Self {
17064            match value {
17065                0 => Self::Unspecified,
17066                1 => Self::Active,
17067                2 => Self::Closed,
17068                3 => Self::Creating,
17069                4 => Self::Deleting,
17070                5 => Self::OutOfSync,
17071                6 => Self::DeleteFailed,
17072                _ => Self::UnknownValue(state::UnknownValue(
17073                    wkt::internal::UnknownEnumValue::Integer(value),
17074                )),
17075            }
17076        }
17077    }
17078
17079    impl std::convert::From<&str> for State {
17080        fn from(value: &str) -> Self {
17081            use std::string::ToString;
17082            match value {
17083                "STATE_UNSPECIFIED" => Self::Unspecified,
17084                "ACTIVE" => Self::Active,
17085                "CLOSED" => Self::Closed,
17086                "CREATING" => Self::Creating,
17087                "DELETING" => Self::Deleting,
17088                "OUT_OF_SYNC" => Self::OutOfSync,
17089                "DELETE_FAILED" => Self::DeleteFailed,
17090                _ => Self::UnknownValue(state::UnknownValue(
17091                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17092                )),
17093            }
17094        }
17095    }
17096
17097    impl serde::ser::Serialize for State {
17098        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17099        where
17100            S: serde::Serializer,
17101        {
17102            match self {
17103                Self::Unspecified => serializer.serialize_i32(0),
17104                Self::Active => serializer.serialize_i32(1),
17105                Self::Closed => serializer.serialize_i32(2),
17106                Self::Creating => serializer.serialize_i32(3),
17107                Self::Deleting => serializer.serialize_i32(4),
17108                Self::OutOfSync => serializer.serialize_i32(5),
17109                Self::DeleteFailed => serializer.serialize_i32(6),
17110                Self::UnknownValue(u) => u.0.serialize(serializer),
17111            }
17112        }
17113    }
17114
17115    impl<'de> serde::de::Deserialize<'de> for State {
17116        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17117        where
17118            D: serde::Deserializer<'de>,
17119        {
17120            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17121                ".google.cloud.networksecurity.v1.MirroringEndpointGroup.State",
17122            ))
17123        }
17124    }
17125
17126    /// The type of the endpoint group.
17127    ///
17128    /// # Working with unknown values
17129    ///
17130    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17131    /// additional enum variants at any time. Adding new variants is not considered
17132    /// a breaking change. Applications should write their code in anticipation of:
17133    ///
17134    /// - New values appearing in future releases of the client library, **and**
17135    /// - New values received dynamically, without application changes.
17136    ///
17137    /// Please consult the [Working with enums] section in the user guide for some
17138    /// guidelines.
17139    ///
17140    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17141    #[derive(Clone, Debug, PartialEq)]
17142    #[non_exhaustive]
17143    pub enum Type {
17144        /// Not set.
17145        Unspecified,
17146        /// An endpoint group that sends packets to a single deployment group.
17147        Direct,
17148        /// If set, the enum was initialized with an unknown value.
17149        ///
17150        /// Applications can examine the value using [Type::value] or
17151        /// [Type::name].
17152        UnknownValue(r#type::UnknownValue),
17153    }
17154
17155    #[doc(hidden)]
17156    pub mod r#type {
17157        #[allow(unused_imports)]
17158        use super::*;
17159        #[derive(Clone, Debug, PartialEq)]
17160        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17161    }
17162
17163    impl Type {
17164        /// Gets the enum value.
17165        ///
17166        /// Returns `None` if the enum contains an unknown value deserialized from
17167        /// the string representation of enums.
17168        pub fn value(&self) -> std::option::Option<i32> {
17169            match self {
17170                Self::Unspecified => std::option::Option::Some(0),
17171                Self::Direct => std::option::Option::Some(1),
17172                Self::UnknownValue(u) => u.0.value(),
17173            }
17174        }
17175
17176        /// Gets the enum value as a string.
17177        ///
17178        /// Returns `None` if the enum contains an unknown value deserialized from
17179        /// the integer representation of enums.
17180        pub fn name(&self) -> std::option::Option<&str> {
17181            match self {
17182                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17183                Self::Direct => std::option::Option::Some("DIRECT"),
17184                Self::UnknownValue(u) => u.0.name(),
17185            }
17186        }
17187    }
17188
17189    impl std::default::Default for Type {
17190        fn default() -> Self {
17191            use std::convert::From;
17192            Self::from(0)
17193        }
17194    }
17195
17196    impl std::fmt::Display for Type {
17197        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17198            wkt::internal::display_enum(f, self.name(), self.value())
17199        }
17200    }
17201
17202    impl std::convert::From<i32> for Type {
17203        fn from(value: i32) -> Self {
17204            match value {
17205                0 => Self::Unspecified,
17206                1 => Self::Direct,
17207                _ => Self::UnknownValue(r#type::UnknownValue(
17208                    wkt::internal::UnknownEnumValue::Integer(value),
17209                )),
17210            }
17211        }
17212    }
17213
17214    impl std::convert::From<&str> for Type {
17215        fn from(value: &str) -> Self {
17216            use std::string::ToString;
17217            match value {
17218                "TYPE_UNSPECIFIED" => Self::Unspecified,
17219                "DIRECT" => Self::Direct,
17220                _ => Self::UnknownValue(r#type::UnknownValue(
17221                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17222                )),
17223            }
17224        }
17225    }
17226
17227    impl serde::ser::Serialize for Type {
17228        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17229        where
17230            S: serde::Serializer,
17231        {
17232            match self {
17233                Self::Unspecified => serializer.serialize_i32(0),
17234                Self::Direct => serializer.serialize_i32(1),
17235                Self::UnknownValue(u) => u.0.serialize(serializer),
17236            }
17237        }
17238    }
17239
17240    impl<'de> serde::de::Deserialize<'de> for Type {
17241        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17242        where
17243            D: serde::Deserializer<'de>,
17244        {
17245            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17246                ".google.cloud.networksecurity.v1.MirroringEndpointGroup.Type",
17247            ))
17248        }
17249    }
17250}
17251
17252/// Request message for ListMirroringEndpointGroups.
17253#[derive(Clone, Default, PartialEq)]
17254#[non_exhaustive]
17255pub struct ListMirroringEndpointGroupsRequest {
17256    /// Required. The parent, which owns this collection of endpoint groups.
17257    /// Example: `projects/123456789/locations/global`.
17258    /// See <https://google.aip.dev/132> for more details.
17259    pub parent: std::string::String,
17260
17261    /// Optional. Requested page size. Server may return fewer items than
17262    /// requested. If unspecified, server will pick an appropriate default. See
17263    /// <https://google.aip.dev/158> for more details.
17264    pub page_size: i32,
17265
17266    /// Optional. A page token, received from a previous
17267    /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
17268    /// page. When paginating, all other parameters provided to
17269    /// `ListMirroringEndpointGroups` must match the call that provided the page
17270    /// token.
17271    /// See <https://google.aip.dev/158> for more details.
17272    pub page_token: std::string::String,
17273
17274    /// Optional. Filter expression.
17275    /// See <https://google.aip.dev/160#filtering> for more details.
17276    pub filter: std::string::String,
17277
17278    /// Optional. Sort expression.
17279    /// See <https://google.aip.dev/132#ordering> for more details.
17280    pub order_by: std::string::String,
17281
17282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17283}
17284
17285impl ListMirroringEndpointGroupsRequest {
17286    /// Creates a new default instance.
17287    pub fn new() -> Self {
17288        std::default::Default::default()
17289    }
17290
17291    /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
17292    ///
17293    /// # Example
17294    /// ```ignore,no_run
17295    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17296    /// # let project_id = "project_id";
17297    /// # let location_id = "location_id";
17298    /// let x = ListMirroringEndpointGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17299    /// ```
17300    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17301        self.parent = v.into();
17302        self
17303    }
17304
17305    /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
17306    ///
17307    /// # Example
17308    /// ```ignore,no_run
17309    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17310    /// let x = ListMirroringEndpointGroupsRequest::new().set_page_size(42);
17311    /// ```
17312    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17313        self.page_size = v.into();
17314        self
17315    }
17316
17317    /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
17318    ///
17319    /// # Example
17320    /// ```ignore,no_run
17321    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17322    /// let x = ListMirroringEndpointGroupsRequest::new().set_page_token("example");
17323    /// ```
17324    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17325        self.page_token = v.into();
17326        self
17327    }
17328
17329    /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
17330    ///
17331    /// # Example
17332    /// ```ignore,no_run
17333    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17334    /// let x = ListMirroringEndpointGroupsRequest::new().set_filter("example");
17335    /// ```
17336    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17337        self.filter = v.into();
17338        self
17339    }
17340
17341    /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
17342    ///
17343    /// # Example
17344    /// ```ignore,no_run
17345    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17346    /// let x = ListMirroringEndpointGroupsRequest::new().set_order_by("example");
17347    /// ```
17348    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17349        self.order_by = v.into();
17350        self
17351    }
17352}
17353
17354impl wkt::message::Message for ListMirroringEndpointGroupsRequest {
17355    fn typename() -> &'static str {
17356        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest"
17357    }
17358}
17359
17360/// Response message for ListMirroringEndpointGroups.
17361#[derive(Clone, Default, PartialEq)]
17362#[non_exhaustive]
17363pub struct ListMirroringEndpointGroupsResponse {
17364    /// The endpoint groups from the specified parent.
17365    pub mirroring_endpoint_groups: std::vec::Vec<crate::model::MirroringEndpointGroup>,
17366
17367    /// A token that can be sent as `page_token` to retrieve the next page.
17368    /// If this field is omitted, there are no subsequent pages.
17369    /// See <https://google.aip.dev/158> for more details.
17370    pub next_page_token: std::string::String,
17371
17372    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17373}
17374
17375impl ListMirroringEndpointGroupsResponse {
17376    /// Creates a new default instance.
17377    pub fn new() -> Self {
17378        std::default::Default::default()
17379    }
17380
17381    /// Sets the value of [mirroring_endpoint_groups][crate::model::ListMirroringEndpointGroupsResponse::mirroring_endpoint_groups].
17382    ///
17383    /// # Example
17384    /// ```ignore,no_run
17385    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17386    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17387    /// let x = ListMirroringEndpointGroupsResponse::new()
17388    ///     .set_mirroring_endpoint_groups([
17389    ///         MirroringEndpointGroup::default()/* use setters */,
17390    ///         MirroringEndpointGroup::default()/* use (different) setters */,
17391    ///     ]);
17392    /// ```
17393    pub fn set_mirroring_endpoint_groups<T, V>(mut self, v: T) -> Self
17394    where
17395        T: std::iter::IntoIterator<Item = V>,
17396        V: std::convert::Into<crate::model::MirroringEndpointGroup>,
17397    {
17398        use std::iter::Iterator;
17399        self.mirroring_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
17400        self
17401    }
17402
17403    /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupsResponse::next_page_token].
17404    ///
17405    /// # Example
17406    /// ```ignore,no_run
17407    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17408    /// let x = ListMirroringEndpointGroupsResponse::new().set_next_page_token("example");
17409    /// ```
17410    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17411        self.next_page_token = v.into();
17412        self
17413    }
17414}
17415
17416impl wkt::message::Message for ListMirroringEndpointGroupsResponse {
17417    fn typename() -> &'static str {
17418        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse"
17419    }
17420}
17421
17422#[doc(hidden)]
17423impl google_cloud_gax::paginator::internal::PageableResponse
17424    for ListMirroringEndpointGroupsResponse
17425{
17426    type PageItem = crate::model::MirroringEndpointGroup;
17427
17428    fn items(self) -> std::vec::Vec<Self::PageItem> {
17429        self.mirroring_endpoint_groups
17430    }
17431
17432    fn next_page_token(&self) -> std::string::String {
17433        use std::clone::Clone;
17434        self.next_page_token.clone()
17435    }
17436}
17437
17438/// Request message for GetMirroringEndpointGroup.
17439#[derive(Clone, Default, PartialEq)]
17440#[non_exhaustive]
17441pub struct GetMirroringEndpointGroupRequest {
17442    /// Required. The name of the endpoint group to retrieve.
17443    /// Format:
17444    /// projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}
17445    pub name: std::string::String,
17446
17447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17448}
17449
17450impl GetMirroringEndpointGroupRequest {
17451    /// Creates a new default instance.
17452    pub fn new() -> Self {
17453        std::default::Default::default()
17454    }
17455
17456    /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
17457    ///
17458    /// # Example
17459    /// ```ignore,no_run
17460    /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupRequest;
17461    /// # let project_id = "project_id";
17462    /// # let location_id = "location_id";
17463    /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17464    /// let x = GetMirroringEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17465    /// ```
17466    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17467        self.name = v.into();
17468        self
17469    }
17470}
17471
17472impl wkt::message::Message for GetMirroringEndpointGroupRequest {
17473    fn typename() -> &'static str {
17474        "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest"
17475    }
17476}
17477
17478/// Request message for CreateMirroringEndpointGroup.
17479#[derive(Clone, Default, PartialEq)]
17480#[non_exhaustive]
17481pub struct CreateMirroringEndpointGroupRequest {
17482    /// Required. The parent resource where this endpoint group will be created.
17483    /// Format: projects/{project}/locations/{location}
17484    pub parent: std::string::String,
17485
17486    /// Required. The ID to use for the endpoint group, which will become the final
17487    /// component of the endpoint group's resource name.
17488    pub mirroring_endpoint_group_id: std::string::String,
17489
17490    /// Required. The endpoint group to create.
17491    pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17492
17493    /// Optional. A unique identifier for this request. Must be a UUID4.
17494    /// This request is only idempotent if a `request_id` is provided.
17495    /// See <https://google.aip.dev/155> for more details.
17496    pub request_id: std::string::String,
17497
17498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17499}
17500
17501impl CreateMirroringEndpointGroupRequest {
17502    /// Creates a new default instance.
17503    pub fn new() -> Self {
17504        std::default::Default::default()
17505    }
17506
17507    /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
17508    ///
17509    /// # Example
17510    /// ```ignore,no_run
17511    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17512    /// # let project_id = "project_id";
17513    /// # let location_id = "location_id";
17514    /// let x = CreateMirroringEndpointGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17515    /// ```
17516    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17517        self.parent = v.into();
17518        self
17519    }
17520
17521    /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
17522    ///
17523    /// # Example
17524    /// ```ignore,no_run
17525    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17526    /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group_id("example");
17527    /// ```
17528    pub fn set_mirroring_endpoint_group_id<T: std::convert::Into<std::string::String>>(
17529        mut self,
17530        v: T,
17531    ) -> Self {
17532        self.mirroring_endpoint_group_id = v.into();
17533        self
17534    }
17535
17536    /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17537    ///
17538    /// # Example
17539    /// ```ignore,no_run
17540    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17541    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17542    /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17543    /// ```
17544    pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17545    where
17546        T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17547    {
17548        self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17549        self
17550    }
17551
17552    /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17553    ///
17554    /// # Example
17555    /// ```ignore,no_run
17556    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17557    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17558    /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17559    /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17560    /// ```
17561    pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17562    where
17563        T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17564    {
17565        self.mirroring_endpoint_group = v.map(|x| x.into());
17566        self
17567    }
17568
17569    /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
17570    ///
17571    /// # Example
17572    /// ```ignore,no_run
17573    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17574    /// let x = CreateMirroringEndpointGroupRequest::new().set_request_id("example");
17575    /// ```
17576    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17577        self.request_id = v.into();
17578        self
17579    }
17580}
17581
17582impl wkt::message::Message for CreateMirroringEndpointGroupRequest {
17583    fn typename() -> &'static str {
17584        "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest"
17585    }
17586}
17587
17588/// Request message for UpdateMirroringEndpointGroup.
17589#[derive(Clone, Default, PartialEq)]
17590#[non_exhaustive]
17591pub struct UpdateMirroringEndpointGroupRequest {
17592    /// Optional. The list of fields to update.
17593    /// Fields are specified relative to the endpoint group
17594    /// (e.g. `description`; *not* `mirroring_endpoint_group.description`).
17595    /// See <https://google.aip.dev/161> for more details.
17596    pub update_mask: std::option::Option<wkt::FieldMask>,
17597
17598    /// Required. The endpoint group to update.
17599    pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17600
17601    /// Optional. A unique identifier for this request. Must be a UUID4.
17602    /// This request is only idempotent if a `request_id` is provided.
17603    /// See <https://google.aip.dev/155> for more details.
17604    pub request_id: std::string::String,
17605
17606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17607}
17608
17609impl UpdateMirroringEndpointGroupRequest {
17610    /// Creates a new default instance.
17611    pub fn new() -> Self {
17612        std::default::Default::default()
17613    }
17614
17615    /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17616    ///
17617    /// # Example
17618    /// ```ignore,no_run
17619    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17620    /// use wkt::FieldMask;
17621    /// let x = UpdateMirroringEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17622    /// ```
17623    pub fn set_update_mask<T>(mut self, v: T) -> Self
17624    where
17625        T: std::convert::Into<wkt::FieldMask>,
17626    {
17627        self.update_mask = std::option::Option::Some(v.into());
17628        self
17629    }
17630
17631    /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17632    ///
17633    /// # Example
17634    /// ```ignore,no_run
17635    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17636    /// use wkt::FieldMask;
17637    /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17638    /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17639    /// ```
17640    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17641    where
17642        T: std::convert::Into<wkt::FieldMask>,
17643    {
17644        self.update_mask = v.map(|x| x.into());
17645        self
17646    }
17647
17648    /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17649    ///
17650    /// # Example
17651    /// ```ignore,no_run
17652    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17653    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17654    /// let x = UpdateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17655    /// ```
17656    pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17657    where
17658        T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17659    {
17660        self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17661        self
17662    }
17663
17664    /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17665    ///
17666    /// # Example
17667    /// ```ignore,no_run
17668    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17669    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17670    /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17671    /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17672    /// ```
17673    pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17674    where
17675        T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17676    {
17677        self.mirroring_endpoint_group = v.map(|x| x.into());
17678        self
17679    }
17680
17681    /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
17682    ///
17683    /// # Example
17684    /// ```ignore,no_run
17685    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17686    /// let x = UpdateMirroringEndpointGroupRequest::new().set_request_id("example");
17687    /// ```
17688    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17689        self.request_id = v.into();
17690        self
17691    }
17692}
17693
17694impl wkt::message::Message for UpdateMirroringEndpointGroupRequest {
17695    fn typename() -> &'static str {
17696        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest"
17697    }
17698}
17699
17700/// Request message for DeleteMirroringEndpointGroup.
17701#[derive(Clone, Default, PartialEq)]
17702#[non_exhaustive]
17703pub struct DeleteMirroringEndpointGroupRequest {
17704    /// Required. The endpoint group to delete.
17705    pub name: std::string::String,
17706
17707    /// Optional. A unique identifier for this request. Must be a UUID4.
17708    /// This request is only idempotent if a `request_id` is provided.
17709    /// See <https://google.aip.dev/155> for more details.
17710    pub request_id: std::string::String,
17711
17712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17713}
17714
17715impl DeleteMirroringEndpointGroupRequest {
17716    /// Creates a new default instance.
17717    pub fn new() -> Self {
17718        std::default::Default::default()
17719    }
17720
17721    /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
17722    ///
17723    /// # Example
17724    /// ```ignore,no_run
17725    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17726    /// # let project_id = "project_id";
17727    /// # let location_id = "location_id";
17728    /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17729    /// let x = DeleteMirroringEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17730    /// ```
17731    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17732        self.name = v.into();
17733        self
17734    }
17735
17736    /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
17737    ///
17738    /// # Example
17739    /// ```ignore,no_run
17740    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17741    /// let x = DeleteMirroringEndpointGroupRequest::new().set_request_id("example");
17742    /// ```
17743    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17744        self.request_id = v.into();
17745        self
17746    }
17747}
17748
17749impl wkt::message::Message for DeleteMirroringEndpointGroupRequest {
17750    fn typename() -> &'static str {
17751        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest"
17752    }
17753}
17754
17755/// An endpoint group association represents a link between a network and an
17756/// endpoint group in the organization.
17757///
17758/// Creating an association creates the networking infrastructure linking the
17759/// network to the endpoint group, but does not enable mirroring by itself.
17760/// To enable mirroring, the user must also create a network firewall policy
17761/// containing mirroring rules and associate it with the network.
17762#[derive(Clone, Default, PartialEq)]
17763#[non_exhaustive]
17764pub struct MirroringEndpointGroupAssociation {
17765    /// Immutable. Identifier. The resource name of this endpoint group
17766    /// association, for example:
17767    /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-eg-association`.
17768    /// See <https://google.aip.dev/122> for more details.
17769    pub name: std::string::String,
17770
17771    /// Output only. The timestamp when the resource was created.
17772    /// See <https://google.aip.dev/148#timestamps>.
17773    pub create_time: std::option::Option<wkt::Timestamp>,
17774
17775    /// Output only. The timestamp when the resource was most recently updated.
17776    /// See <https://google.aip.dev/148#timestamps>.
17777    pub update_time: std::option::Option<wkt::Timestamp>,
17778
17779    /// Optional. Labels are key/value pairs that help to organize and filter
17780    /// resources.
17781    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17782
17783    /// Immutable. The endpoint group that this association is connected to, for
17784    /// example:
17785    /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
17786    /// See <https://google.aip.dev/124>.
17787    pub mirroring_endpoint_group: std::string::String,
17788
17789    /// Immutable. The VPC network that is associated. for example:
17790    /// `projects/123456789/global/networks/my-network`.
17791    /// See <https://google.aip.dev/124>.
17792    pub network: std::string::String,
17793
17794    /// Output only. The list of locations where the association is present. This
17795    /// information is retrieved from the linked endpoint group, and not configured
17796    /// as part of the association itself.
17797    #[deprecated]
17798    pub locations_details:
17799        std::vec::Vec<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17800
17801    /// Output only. Current state of the endpoint group association.
17802    pub state: crate::model::mirroring_endpoint_group_association::State,
17803
17804    /// Output only. The current state of the resource does not match the user's
17805    /// intended state, and the system is working to reconcile them. This part of
17806    /// the normal operation (e.g. adding a new location to the target deployment
17807    /// group). See <https://google.aip.dev/128>.
17808    pub reconciling: bool,
17809
17810    /// Output only. The list of locations where the association is configured.
17811    /// This information is retrieved from the linked endpoint group.
17812    pub locations: std::vec::Vec<crate::model::MirroringLocation>,
17813
17814    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17815}
17816
17817impl MirroringEndpointGroupAssociation {
17818    /// Creates a new default instance.
17819    pub fn new() -> Self {
17820        std::default::Default::default()
17821    }
17822
17823    /// Sets the value of [name][crate::model::MirroringEndpointGroupAssociation::name].
17824    ///
17825    /// # Example
17826    /// ```ignore,no_run
17827    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17828    /// # let project_id = "project_id";
17829    /// # let location_id = "location_id";
17830    /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
17831    /// let x = MirroringEndpointGroupAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
17832    /// ```
17833    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17834        self.name = v.into();
17835        self
17836    }
17837
17838    /// Sets the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17839    ///
17840    /// # Example
17841    /// ```ignore,no_run
17842    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17843    /// use wkt::Timestamp;
17844    /// let x = MirroringEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
17845    /// ```
17846    pub fn set_create_time<T>(mut self, v: T) -> Self
17847    where
17848        T: std::convert::Into<wkt::Timestamp>,
17849    {
17850        self.create_time = std::option::Option::Some(v.into());
17851        self
17852    }
17853
17854    /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17855    ///
17856    /// # Example
17857    /// ```ignore,no_run
17858    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17859    /// use wkt::Timestamp;
17860    /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17861    /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
17862    /// ```
17863    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17864    where
17865        T: std::convert::Into<wkt::Timestamp>,
17866    {
17867        self.create_time = v.map(|x| x.into());
17868        self
17869    }
17870
17871    /// Sets the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17872    ///
17873    /// # Example
17874    /// ```ignore,no_run
17875    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17876    /// use wkt::Timestamp;
17877    /// let x = MirroringEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
17878    /// ```
17879    pub fn set_update_time<T>(mut self, v: T) -> Self
17880    where
17881        T: std::convert::Into<wkt::Timestamp>,
17882    {
17883        self.update_time = std::option::Option::Some(v.into());
17884        self
17885    }
17886
17887    /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17888    ///
17889    /// # Example
17890    /// ```ignore,no_run
17891    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17892    /// use wkt::Timestamp;
17893    /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17894    /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
17895    /// ```
17896    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17897    where
17898        T: std::convert::Into<wkt::Timestamp>,
17899    {
17900        self.update_time = v.map(|x| x.into());
17901        self
17902    }
17903
17904    /// Sets the value of [labels][crate::model::MirroringEndpointGroupAssociation::labels].
17905    ///
17906    /// # Example
17907    /// ```ignore,no_run
17908    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17909    /// let x = MirroringEndpointGroupAssociation::new().set_labels([
17910    ///     ("key0", "abc"),
17911    ///     ("key1", "xyz"),
17912    /// ]);
17913    /// ```
17914    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17915    where
17916        T: std::iter::IntoIterator<Item = (K, V)>,
17917        K: std::convert::Into<std::string::String>,
17918        V: std::convert::Into<std::string::String>,
17919    {
17920        use std::iter::Iterator;
17921        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17922        self
17923    }
17924
17925    /// Sets the value of [mirroring_endpoint_group][crate::model::MirroringEndpointGroupAssociation::mirroring_endpoint_group].
17926    ///
17927    /// # Example
17928    /// ```ignore,no_run
17929    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17930    /// # let project_id = "project_id";
17931    /// # let location_id = "location_id";
17932    /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17933    /// let x = MirroringEndpointGroupAssociation::new().set_mirroring_endpoint_group(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17934    /// ```
17935    pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
17936        mut self,
17937        v: T,
17938    ) -> Self {
17939        self.mirroring_endpoint_group = v.into();
17940        self
17941    }
17942
17943    /// Sets the value of [network][crate::model::MirroringEndpointGroupAssociation::network].
17944    ///
17945    /// # Example
17946    /// ```ignore,no_run
17947    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17948    /// let x = MirroringEndpointGroupAssociation::new().set_network("example");
17949    /// ```
17950    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17951        self.network = v.into();
17952        self
17953    }
17954
17955    /// Sets the value of [locations_details][crate::model::MirroringEndpointGroupAssociation::locations_details].
17956    ///
17957    /// # Example
17958    /// ```ignore,no_run
17959    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17960    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17961    /// let x = MirroringEndpointGroupAssociation::new()
17962    ///     .set_locations_details([
17963    ///         LocationDetails::default()/* use setters */,
17964    ///         LocationDetails::default()/* use (different) setters */,
17965    ///     ]);
17966    /// ```
17967    #[deprecated]
17968    pub fn set_locations_details<T, V>(mut self, v: T) -> Self
17969    where
17970        T: std::iter::IntoIterator<Item = V>,
17971        V: std::convert::Into<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17972    {
17973        use std::iter::Iterator;
17974        self.locations_details = v.into_iter().map(|i| i.into()).collect();
17975        self
17976    }
17977
17978    /// Sets the value of [state][crate::model::MirroringEndpointGroupAssociation::state].
17979    ///
17980    /// # Example
17981    /// ```ignore,no_run
17982    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17983    /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
17984    /// let x0 = MirroringEndpointGroupAssociation::new().set_state(State::Active);
17985    /// let x1 = MirroringEndpointGroupAssociation::new().set_state(State::Creating);
17986    /// let x2 = MirroringEndpointGroupAssociation::new().set_state(State::Deleting);
17987    /// ```
17988    pub fn set_state<
17989        T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
17990    >(
17991        mut self,
17992        v: T,
17993    ) -> Self {
17994        self.state = v.into();
17995        self
17996    }
17997
17998    /// Sets the value of [reconciling][crate::model::MirroringEndpointGroupAssociation::reconciling].
17999    ///
18000    /// # Example
18001    /// ```ignore,no_run
18002    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18003    /// let x = MirroringEndpointGroupAssociation::new().set_reconciling(true);
18004    /// ```
18005    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18006        self.reconciling = v.into();
18007        self
18008    }
18009
18010    /// Sets the value of [locations][crate::model::MirroringEndpointGroupAssociation::locations].
18011    ///
18012    /// # Example
18013    /// ```ignore,no_run
18014    /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18015    /// use google_cloud_networksecurity_v1::model::MirroringLocation;
18016    /// let x = MirroringEndpointGroupAssociation::new()
18017    ///     .set_locations([
18018    ///         MirroringLocation::default()/* use setters */,
18019    ///         MirroringLocation::default()/* use (different) setters */,
18020    ///     ]);
18021    /// ```
18022    pub fn set_locations<T, V>(mut self, v: T) -> Self
18023    where
18024        T: std::iter::IntoIterator<Item = V>,
18025        V: std::convert::Into<crate::model::MirroringLocation>,
18026    {
18027        use std::iter::Iterator;
18028        self.locations = v.into_iter().map(|i| i.into()).collect();
18029        self
18030    }
18031}
18032
18033impl wkt::message::Message for MirroringEndpointGroupAssociation {
18034    fn typename() -> &'static str {
18035        "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation"
18036    }
18037}
18038
18039/// Defines additional types related to [MirroringEndpointGroupAssociation].
18040pub mod mirroring_endpoint_group_association {
18041    #[allow(unused_imports)]
18042    use super::*;
18043
18044    /// Contains details about the state of an association in a specific cloud
18045    /// location.
18046    #[derive(Clone, Default, PartialEq)]
18047    #[non_exhaustive]
18048    pub struct LocationDetails {
18049        /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
18050        pub location: std::string::String,
18051
18052        /// Output only. The current state of the association in this location.
18053        pub state: crate::model::mirroring_endpoint_group_association::location_details::State,
18054
18055        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18056    }
18057
18058    impl LocationDetails {
18059        /// Creates a new default instance.
18060        pub fn new() -> Self {
18061            std::default::Default::default()
18062        }
18063
18064        /// Sets the value of [location][crate::model::mirroring_endpoint_group_association::LocationDetails::location].
18065        ///
18066        /// # Example
18067        /// ```ignore,no_run
18068        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
18069        /// let x = LocationDetails::new().set_location("example");
18070        /// ```
18071        pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18072            self.location = v.into();
18073            self
18074        }
18075
18076        /// Sets the value of [state][crate::model::mirroring_endpoint_group_association::LocationDetails::state].
18077        ///
18078        /// # Example
18079        /// ```ignore,no_run
18080        /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
18081        /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::location_details::State;
18082        /// let x0 = LocationDetails::new().set_state(State::Active);
18083        /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
18084        /// ```
18085        pub fn set_state<
18086            T: std::convert::Into<
18087                    crate::model::mirroring_endpoint_group_association::location_details::State,
18088                >,
18089        >(
18090            mut self,
18091            v: T,
18092        ) -> Self {
18093            self.state = v.into();
18094            self
18095        }
18096    }
18097
18098    impl wkt::message::Message for LocationDetails {
18099        fn typename() -> &'static str {
18100            "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails"
18101        }
18102    }
18103
18104    /// Defines additional types related to [LocationDetails].
18105    pub mod location_details {
18106        #[allow(unused_imports)]
18107        use super::*;
18108
18109        /// The state of association.
18110        ///
18111        /// # Working with unknown values
18112        ///
18113        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18114        /// additional enum variants at any time. Adding new variants is not considered
18115        /// a breaking change. Applications should write their code in anticipation of:
18116        ///
18117        /// - New values appearing in future releases of the client library, **and**
18118        /// - New values received dynamically, without application changes.
18119        ///
18120        /// Please consult the [Working with enums] section in the user guide for some
18121        /// guidelines.
18122        ///
18123        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18124        #[derive(Clone, Debug, PartialEq)]
18125        #[non_exhaustive]
18126        pub enum State {
18127            /// Not set.
18128            Unspecified,
18129            /// The association is ready and in sync with the linked endpoint group.
18130            Active,
18131            /// The association is out of sync with the linked endpoint group.
18132            /// In most cases, this is a result of a transient issue within the system
18133            /// (e.g. an inaccessible location) and the system is expected to recover
18134            /// automatically.
18135            OutOfSync,
18136            /// If set, the enum was initialized with an unknown value.
18137            ///
18138            /// Applications can examine the value using [State::value] or
18139            /// [State::name].
18140            UnknownValue(state::UnknownValue),
18141        }
18142
18143        #[doc(hidden)]
18144        pub mod state {
18145            #[allow(unused_imports)]
18146            use super::*;
18147            #[derive(Clone, Debug, PartialEq)]
18148            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18149        }
18150
18151        impl State {
18152            /// Gets the enum value.
18153            ///
18154            /// Returns `None` if the enum contains an unknown value deserialized from
18155            /// the string representation of enums.
18156            pub fn value(&self) -> std::option::Option<i32> {
18157                match self {
18158                    Self::Unspecified => std::option::Option::Some(0),
18159                    Self::Active => std::option::Option::Some(1),
18160                    Self::OutOfSync => std::option::Option::Some(2),
18161                    Self::UnknownValue(u) => u.0.value(),
18162                }
18163            }
18164
18165            /// Gets the enum value as a string.
18166            ///
18167            /// Returns `None` if the enum contains an unknown value deserialized from
18168            /// the integer representation of enums.
18169            pub fn name(&self) -> std::option::Option<&str> {
18170                match self {
18171                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18172                    Self::Active => std::option::Option::Some("ACTIVE"),
18173                    Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
18174                    Self::UnknownValue(u) => u.0.name(),
18175                }
18176            }
18177        }
18178
18179        impl std::default::Default for State {
18180            fn default() -> Self {
18181                use std::convert::From;
18182                Self::from(0)
18183            }
18184        }
18185
18186        impl std::fmt::Display for State {
18187            fn fmt(
18188                &self,
18189                f: &mut std::fmt::Formatter<'_>,
18190            ) -> std::result::Result<(), std::fmt::Error> {
18191                wkt::internal::display_enum(f, self.name(), self.value())
18192            }
18193        }
18194
18195        impl std::convert::From<i32> for State {
18196            fn from(value: i32) -> Self {
18197                match value {
18198                    0 => Self::Unspecified,
18199                    1 => Self::Active,
18200                    2 => Self::OutOfSync,
18201                    _ => Self::UnknownValue(state::UnknownValue(
18202                        wkt::internal::UnknownEnumValue::Integer(value),
18203                    )),
18204                }
18205            }
18206        }
18207
18208        impl std::convert::From<&str> for State {
18209            fn from(value: &str) -> Self {
18210                use std::string::ToString;
18211                match value {
18212                    "STATE_UNSPECIFIED" => Self::Unspecified,
18213                    "ACTIVE" => Self::Active,
18214                    "OUT_OF_SYNC" => Self::OutOfSync,
18215                    _ => Self::UnknownValue(state::UnknownValue(
18216                        wkt::internal::UnknownEnumValue::String(value.to_string()),
18217                    )),
18218                }
18219            }
18220        }
18221
18222        impl serde::ser::Serialize for State {
18223            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18224            where
18225                S: serde::Serializer,
18226            {
18227                match self {
18228                    Self::Unspecified => serializer.serialize_i32(0),
18229                    Self::Active => serializer.serialize_i32(1),
18230                    Self::OutOfSync => serializer.serialize_i32(2),
18231                    Self::UnknownValue(u) => u.0.serialize(serializer),
18232                }
18233            }
18234        }
18235
18236        impl<'de> serde::de::Deserialize<'de> for State {
18237            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18238            where
18239                D: serde::Deserializer<'de>,
18240            {
18241                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18242                    ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State"))
18243            }
18244        }
18245    }
18246
18247    /// The state of the association.
18248    ///
18249    /// # Working with unknown values
18250    ///
18251    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18252    /// additional enum variants at any time. Adding new variants is not considered
18253    /// a breaking change. Applications should write their code in anticipation of:
18254    ///
18255    /// - New values appearing in future releases of the client library, **and**
18256    /// - New values received dynamically, without application changes.
18257    ///
18258    /// Please consult the [Working with enums] section in the user guide for some
18259    /// guidelines.
18260    ///
18261    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18262    #[derive(Clone, Debug, PartialEq)]
18263    #[non_exhaustive]
18264    pub enum State {
18265        /// Not set.
18266        Unspecified,
18267        /// The association is ready and in sync with the linked endpoint group.
18268        Active,
18269        /// The association is being created.
18270        Creating,
18271        /// The association is being deleted.
18272        Deleting,
18273        /// The association is disabled due to a breaking change in another resource.
18274        Closed,
18275        /// The association is out of sync with the linked endpoint group.
18276        /// In most cases, this is a result of a transient issue within the system
18277        /// (e.g. an inaccessible location) and the system is expected to recover
18278        /// automatically. Check the `locations_details` field for more details.
18279        OutOfSync,
18280        /// An attempt to delete the association has failed. This is a terminal state
18281        /// and the association is not expected to be usable as some of its resources
18282        /// have been deleted.
18283        /// The only permitted operation is to retry deleting the association.
18284        DeleteFailed,
18285        /// If set, the enum was initialized with an unknown value.
18286        ///
18287        /// Applications can examine the value using [State::value] or
18288        /// [State::name].
18289        UnknownValue(state::UnknownValue),
18290    }
18291
18292    #[doc(hidden)]
18293    pub mod state {
18294        #[allow(unused_imports)]
18295        use super::*;
18296        #[derive(Clone, Debug, PartialEq)]
18297        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18298    }
18299
18300    impl State {
18301        /// Gets the enum value.
18302        ///
18303        /// Returns `None` if the enum contains an unknown value deserialized from
18304        /// the string representation of enums.
18305        pub fn value(&self) -> std::option::Option<i32> {
18306            match self {
18307                Self::Unspecified => std::option::Option::Some(0),
18308                Self::Active => std::option::Option::Some(1),
18309                Self::Creating => std::option::Option::Some(3),
18310                Self::Deleting => std::option::Option::Some(4),
18311                Self::Closed => std::option::Option::Some(5),
18312                Self::OutOfSync => std::option::Option::Some(6),
18313                Self::DeleteFailed => std::option::Option::Some(7),
18314                Self::UnknownValue(u) => u.0.value(),
18315            }
18316        }
18317
18318        /// Gets the enum value as a string.
18319        ///
18320        /// Returns `None` if the enum contains an unknown value deserialized from
18321        /// the integer representation of enums.
18322        pub fn name(&self) -> std::option::Option<&str> {
18323            match self {
18324                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18325                Self::Active => std::option::Option::Some("ACTIVE"),
18326                Self::Creating => std::option::Option::Some("CREATING"),
18327                Self::Deleting => std::option::Option::Some("DELETING"),
18328                Self::Closed => std::option::Option::Some("CLOSED"),
18329                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
18330                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
18331                Self::UnknownValue(u) => u.0.name(),
18332            }
18333        }
18334    }
18335
18336    impl std::default::Default for State {
18337        fn default() -> Self {
18338            use std::convert::From;
18339            Self::from(0)
18340        }
18341    }
18342
18343    impl std::fmt::Display for State {
18344        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18345            wkt::internal::display_enum(f, self.name(), self.value())
18346        }
18347    }
18348
18349    impl std::convert::From<i32> for State {
18350        fn from(value: i32) -> Self {
18351            match value {
18352                0 => Self::Unspecified,
18353                1 => Self::Active,
18354                3 => Self::Creating,
18355                4 => Self::Deleting,
18356                5 => Self::Closed,
18357                6 => Self::OutOfSync,
18358                7 => Self::DeleteFailed,
18359                _ => Self::UnknownValue(state::UnknownValue(
18360                    wkt::internal::UnknownEnumValue::Integer(value),
18361                )),
18362            }
18363        }
18364    }
18365
18366    impl std::convert::From<&str> for State {
18367        fn from(value: &str) -> Self {
18368            use std::string::ToString;
18369            match value {
18370                "STATE_UNSPECIFIED" => Self::Unspecified,
18371                "ACTIVE" => Self::Active,
18372                "CREATING" => Self::Creating,
18373                "DELETING" => Self::Deleting,
18374                "CLOSED" => Self::Closed,
18375                "OUT_OF_SYNC" => Self::OutOfSync,
18376                "DELETE_FAILED" => Self::DeleteFailed,
18377                _ => Self::UnknownValue(state::UnknownValue(
18378                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18379                )),
18380            }
18381        }
18382    }
18383
18384    impl serde::ser::Serialize for State {
18385        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18386        where
18387            S: serde::Serializer,
18388        {
18389            match self {
18390                Self::Unspecified => serializer.serialize_i32(0),
18391                Self::Active => serializer.serialize_i32(1),
18392                Self::Creating => serializer.serialize_i32(3),
18393                Self::Deleting => serializer.serialize_i32(4),
18394                Self::Closed => serializer.serialize_i32(5),
18395                Self::OutOfSync => serializer.serialize_i32(6),
18396                Self::DeleteFailed => serializer.serialize_i32(7),
18397                Self::UnknownValue(u) => u.0.serialize(serializer),
18398            }
18399        }
18400    }
18401
18402    impl<'de> serde::de::Deserialize<'de> for State {
18403        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18404        where
18405            D: serde::Deserializer<'de>,
18406        {
18407            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18408                ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State",
18409            ))
18410        }
18411    }
18412}
18413
18414/// Request message for ListMirroringEndpointGroupAssociations.
18415#[derive(Clone, Default, PartialEq)]
18416#[non_exhaustive]
18417pub struct ListMirroringEndpointGroupAssociationsRequest {
18418    /// Required. The parent, which owns this collection of associations.
18419    /// Example: `projects/123456789/locations/global`.
18420    /// See <https://google.aip.dev/132> for more details.
18421    pub parent: std::string::String,
18422
18423    /// Optional. Requested page size. Server may return fewer items than
18424    /// requested. If unspecified, server will pick an appropriate default. See
18425    /// <https://google.aip.dev/158> for more details.
18426    pub page_size: i32,
18427
18428    /// Optional. A page token, received from a previous
18429    /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
18430    /// page. When paginating, all other parameters provided to
18431    /// `ListMirroringEndpointGroups` must match the call that provided the page
18432    /// token. See <https://google.aip.dev/158> for more details.
18433    pub page_token: std::string::String,
18434
18435    /// Optional. Filter expression.
18436    /// See <https://google.aip.dev/160#filtering> for more details.
18437    pub filter: std::string::String,
18438
18439    /// Optional. Sort expression.
18440    /// See <https://google.aip.dev/132#ordering> for more details.
18441    pub order_by: std::string::String,
18442
18443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18444}
18445
18446impl ListMirroringEndpointGroupAssociationsRequest {
18447    /// Creates a new default instance.
18448    pub fn new() -> Self {
18449        std::default::Default::default()
18450    }
18451
18452    /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
18453    ///
18454    /// # Example
18455    /// ```ignore,no_run
18456    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18457    /// # let project_id = "project_id";
18458    /// # let location_id = "location_id";
18459    /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18460    /// ```
18461    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18462        self.parent = v.into();
18463        self
18464    }
18465
18466    /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
18467    ///
18468    /// # Example
18469    /// ```ignore,no_run
18470    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18471    /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_size(42);
18472    /// ```
18473    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18474        self.page_size = v.into();
18475        self
18476    }
18477
18478    /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
18479    ///
18480    /// # Example
18481    /// ```ignore,no_run
18482    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18483    /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_token("example");
18484    /// ```
18485    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18486        self.page_token = v.into();
18487        self
18488    }
18489
18490    /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
18491    ///
18492    /// # Example
18493    /// ```ignore,no_run
18494    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18495    /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_filter("example");
18496    /// ```
18497    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18498        self.filter = v.into();
18499        self
18500    }
18501
18502    /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
18503    ///
18504    /// # Example
18505    /// ```ignore,no_run
18506    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18507    /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_order_by("example");
18508    /// ```
18509    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18510        self.order_by = v.into();
18511        self
18512    }
18513}
18514
18515impl wkt::message::Message for ListMirroringEndpointGroupAssociationsRequest {
18516    fn typename() -> &'static str {
18517        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest"
18518    }
18519}
18520
18521/// Response message for ListMirroringEndpointGroupAssociations.
18522#[derive(Clone, Default, PartialEq)]
18523#[non_exhaustive]
18524pub struct ListMirroringEndpointGroupAssociationsResponse {
18525    /// The associations from the specified parent.
18526    pub mirroring_endpoint_group_associations:
18527        std::vec::Vec<crate::model::MirroringEndpointGroupAssociation>,
18528
18529    /// A token that can be sent as `page_token` to retrieve the next page.
18530    /// If this field is omitted, there are no subsequent pages.
18531    /// See <https://google.aip.dev/158> for more details.
18532    pub next_page_token: std::string::String,
18533
18534    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18535}
18536
18537impl ListMirroringEndpointGroupAssociationsResponse {
18538    /// Creates a new default instance.
18539    pub fn new() -> Self {
18540        std::default::Default::default()
18541    }
18542
18543    /// Sets the value of [mirroring_endpoint_group_associations][crate::model::ListMirroringEndpointGroupAssociationsResponse::mirroring_endpoint_group_associations].
18544    ///
18545    /// # Example
18546    /// ```ignore,no_run
18547    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18548    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18549    /// let x = ListMirroringEndpointGroupAssociationsResponse::new()
18550    ///     .set_mirroring_endpoint_group_associations([
18551    ///         MirroringEndpointGroupAssociation::default()/* use setters */,
18552    ///         MirroringEndpointGroupAssociation::default()/* use (different) setters */,
18553    ///     ]);
18554    /// ```
18555    pub fn set_mirroring_endpoint_group_associations<T, V>(mut self, v: T) -> Self
18556    where
18557        T: std::iter::IntoIterator<Item = V>,
18558        V: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18559    {
18560        use std::iter::Iterator;
18561        self.mirroring_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
18562        self
18563    }
18564
18565    /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupAssociationsResponse::next_page_token].
18566    ///
18567    /// # Example
18568    /// ```ignore,no_run
18569    /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18570    /// let x = ListMirroringEndpointGroupAssociationsResponse::new().set_next_page_token("example");
18571    /// ```
18572    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18573        self.next_page_token = v.into();
18574        self
18575    }
18576}
18577
18578impl wkt::message::Message for ListMirroringEndpointGroupAssociationsResponse {
18579    fn typename() -> &'static str {
18580        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse"
18581    }
18582}
18583
18584#[doc(hidden)]
18585impl google_cloud_gax::paginator::internal::PageableResponse
18586    for ListMirroringEndpointGroupAssociationsResponse
18587{
18588    type PageItem = crate::model::MirroringEndpointGroupAssociation;
18589
18590    fn items(self) -> std::vec::Vec<Self::PageItem> {
18591        self.mirroring_endpoint_group_associations
18592    }
18593
18594    fn next_page_token(&self) -> std::string::String {
18595        use std::clone::Clone;
18596        self.next_page_token.clone()
18597    }
18598}
18599
18600/// Request message for GetMirroringEndpointGroupAssociation.
18601#[derive(Clone, Default, PartialEq)]
18602#[non_exhaustive]
18603pub struct GetMirroringEndpointGroupAssociationRequest {
18604    /// Required. The name of the association to retrieve.
18605    /// Format:
18606    /// projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}
18607    pub name: std::string::String,
18608
18609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18610}
18611
18612impl GetMirroringEndpointGroupAssociationRequest {
18613    /// Creates a new default instance.
18614    pub fn new() -> Self {
18615        std::default::Default::default()
18616    }
18617
18618    /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
18619    ///
18620    /// # Example
18621    /// ```ignore,no_run
18622    /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupAssociationRequest;
18623    /// # let project_id = "project_id";
18624    /// # let location_id = "location_id";
18625    /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
18626    /// let x = GetMirroringEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
18627    /// ```
18628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18629        self.name = v.into();
18630        self
18631    }
18632}
18633
18634impl wkt::message::Message for GetMirroringEndpointGroupAssociationRequest {
18635    fn typename() -> &'static str {
18636        "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest"
18637    }
18638}
18639
18640/// Request message for CreateMirroringEndpointGroupAssociation.
18641#[derive(Clone, Default, PartialEq)]
18642#[non_exhaustive]
18643pub struct CreateMirroringEndpointGroupAssociationRequest {
18644    /// Required. The parent resource where this association will be created.
18645    /// Format: projects/{project}/locations/{location}
18646    pub parent: std::string::String,
18647
18648    /// Optional. The ID to use for the new association, which will become the
18649    /// final component of the endpoint group's resource name. If not provided, the
18650    /// server will generate a unique ID.
18651    pub mirroring_endpoint_group_association_id: std::string::String,
18652
18653    /// Required. The association to create.
18654    pub mirroring_endpoint_group_association:
18655        std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18656
18657    /// Optional. A unique identifier for this request. Must be a UUID4.
18658    /// This request is only idempotent if a `request_id` is provided.
18659    /// See <https://google.aip.dev/155> for more details.
18660    pub request_id: std::string::String,
18661
18662    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18663}
18664
18665impl CreateMirroringEndpointGroupAssociationRequest {
18666    /// Creates a new default instance.
18667    pub fn new() -> Self {
18668        std::default::Default::default()
18669    }
18670
18671    /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
18672    ///
18673    /// # Example
18674    /// ```ignore,no_run
18675    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18676    /// # let project_id = "project_id";
18677    /// # let location_id = "location_id";
18678    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18679    /// ```
18680    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18681        self.parent = v.into();
18682        self
18683    }
18684
18685    /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
18686    ///
18687    /// # Example
18688    /// ```ignore,no_run
18689    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18690    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association_id("example");
18691    /// ```
18692    pub fn set_mirroring_endpoint_group_association_id<
18693        T: std::convert::Into<std::string::String>,
18694    >(
18695        mut self,
18696        v: T,
18697    ) -> Self {
18698        self.mirroring_endpoint_group_association_id = v.into();
18699        self
18700    }
18701
18702    /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18703    ///
18704    /// # Example
18705    /// ```ignore,no_run
18706    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18707    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18708    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18709    /// ```
18710    pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18711    where
18712        T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18713    {
18714        self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18715        self
18716    }
18717
18718    /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18719    ///
18720    /// # Example
18721    /// ```ignore,no_run
18722    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18723    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18724    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18725    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18726    /// ```
18727    pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18728        mut self,
18729        v: std::option::Option<T>,
18730    ) -> Self
18731    where
18732        T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18733    {
18734        self.mirroring_endpoint_group_association = v.map(|x| x.into());
18735        self
18736    }
18737
18738    /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
18739    ///
18740    /// # Example
18741    /// ```ignore,no_run
18742    /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18743    /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18744    /// ```
18745    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18746        self.request_id = v.into();
18747        self
18748    }
18749}
18750
18751impl wkt::message::Message for CreateMirroringEndpointGroupAssociationRequest {
18752    fn typename() -> &'static str {
18753        "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest"
18754    }
18755}
18756
18757/// Request message for UpdateMirroringEndpointGroupAssociation.
18758#[derive(Clone, Default, PartialEq)]
18759#[non_exhaustive]
18760pub struct UpdateMirroringEndpointGroupAssociationRequest {
18761    /// Optional. The list of fields to update.
18762    /// Fields are specified relative to the association
18763    /// (e.g. `description`; *not*
18764    /// `mirroring_endpoint_group_association.description`). See
18765    /// <https://google.aip.dev/161> for more details.
18766    pub update_mask: std::option::Option<wkt::FieldMask>,
18767
18768    /// Required. The association to update.
18769    pub mirroring_endpoint_group_association:
18770        std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18771
18772    /// Optional. A unique identifier for this request. Must be a UUID4.
18773    /// This request is only idempotent if a `request_id` is provided.
18774    /// See <https://google.aip.dev/155> for more details.
18775    pub request_id: std::string::String,
18776
18777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18778}
18779
18780impl UpdateMirroringEndpointGroupAssociationRequest {
18781    /// Creates a new default instance.
18782    pub fn new() -> Self {
18783        std::default::Default::default()
18784    }
18785
18786    /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18787    ///
18788    /// # Example
18789    /// ```ignore,no_run
18790    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18791    /// use wkt::FieldMask;
18792    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
18793    /// ```
18794    pub fn set_update_mask<T>(mut self, v: T) -> Self
18795    where
18796        T: std::convert::Into<wkt::FieldMask>,
18797    {
18798        self.update_mask = std::option::Option::Some(v.into());
18799        self
18800    }
18801
18802    /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18803    ///
18804    /// # Example
18805    /// ```ignore,no_run
18806    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18807    /// use wkt::FieldMask;
18808    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
18809    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
18810    /// ```
18811    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18812    where
18813        T: std::convert::Into<wkt::FieldMask>,
18814    {
18815        self.update_mask = v.map(|x| x.into());
18816        self
18817    }
18818
18819    /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18820    ///
18821    /// # Example
18822    /// ```ignore,no_run
18823    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18824    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18825    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18826    /// ```
18827    pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18828    where
18829        T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18830    {
18831        self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18832        self
18833    }
18834
18835    /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18836    ///
18837    /// # Example
18838    /// ```ignore,no_run
18839    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18840    /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18841    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18842    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18843    /// ```
18844    pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18845        mut self,
18846        v: std::option::Option<T>,
18847    ) -> Self
18848    where
18849        T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18850    {
18851        self.mirroring_endpoint_group_association = v.map(|x| x.into());
18852        self
18853    }
18854
18855    /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
18856    ///
18857    /// # Example
18858    /// ```ignore,no_run
18859    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18860    /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18861    /// ```
18862    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18863        self.request_id = v.into();
18864        self
18865    }
18866}
18867
18868impl wkt::message::Message for UpdateMirroringEndpointGroupAssociationRequest {
18869    fn typename() -> &'static str {
18870        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest"
18871    }
18872}
18873
18874/// Request message for DeleteMirroringEndpointGroupAssociation.
18875#[derive(Clone, Default, PartialEq)]
18876#[non_exhaustive]
18877pub struct DeleteMirroringEndpointGroupAssociationRequest {
18878    /// Required. The association to delete.
18879    pub name: std::string::String,
18880
18881    /// Optional. A unique identifier for this request. Must be a UUID4.
18882    /// This request is only idempotent if a `request_id` is provided.
18883    /// See <https://google.aip.dev/155> for more details.
18884    pub request_id: std::string::String,
18885
18886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18887}
18888
18889impl DeleteMirroringEndpointGroupAssociationRequest {
18890    /// Creates a new default instance.
18891    pub fn new() -> Self {
18892        std::default::Default::default()
18893    }
18894
18895    /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
18896    ///
18897    /// # Example
18898    /// ```ignore,no_run
18899    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18900    /// # let project_id = "project_id";
18901    /// # let location_id = "location_id";
18902    /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
18903    /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
18904    /// ```
18905    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18906        self.name = v.into();
18907        self
18908    }
18909
18910    /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
18911    ///
18912    /// # Example
18913    /// ```ignore,no_run
18914    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18915    /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18916    /// ```
18917    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18918        self.request_id = v.into();
18919        self
18920    }
18921}
18922
18923impl wkt::message::Message for DeleteMirroringEndpointGroupAssociationRequest {
18924    fn typename() -> &'static str {
18925        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest"
18926    }
18927}
18928
18929/// A deployment group aggregates many zonal mirroring backends (deployments)
18930/// into a single global mirroring service. Consumers can connect this service
18931/// using an endpoint group.
18932#[derive(Clone, Default, PartialEq)]
18933#[non_exhaustive]
18934pub struct MirroringDeploymentGroup {
18935    /// Immutable. Identifier. The resource name of this deployment group, for
18936    /// example:
18937    /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
18938    /// See <https://google.aip.dev/122> for more details.
18939    pub name: std::string::String,
18940
18941    /// Output only. The timestamp when the resource was created.
18942    /// See <https://google.aip.dev/148#timestamps>.
18943    pub create_time: std::option::Option<wkt::Timestamp>,
18944
18945    /// Output only. The timestamp when the resource was most recently updated.
18946    /// See <https://google.aip.dev/148#timestamps>.
18947    pub update_time: std::option::Option<wkt::Timestamp>,
18948
18949    /// Optional. Labels are key/value pairs that help to organize and filter
18950    /// resources.
18951    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18952
18953    /// Required. Immutable. The network that will be used for all child
18954    /// deployments, for example: `projects/{project}/global/networks/{network}`.
18955    /// See <https://google.aip.dev/124>.
18956    pub network: std::string::String,
18957
18958    /// Output only. The list of endpoint groups that are connected to this
18959    /// resource.
18960    pub connected_endpoint_groups:
18961        std::vec::Vec<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18962
18963    /// Output only. The list of Mirroring Deployments that belong to this group.
18964    #[deprecated]
18965    pub nested_deployments: std::vec::Vec<crate::model::mirroring_deployment_group::Deployment>,
18966
18967    /// Output only. The current state of the deployment group.
18968    /// See <https://google.aip.dev/216>.
18969    pub state: crate::model::mirroring_deployment_group::State,
18970
18971    /// Output only. The current state of the resource does not match the user's
18972    /// intended state, and the system is working to reconcile them. This is part
18973    /// of the normal operation (e.g. adding a new deployment to the group) See
18974    /// <https://google.aip.dev/128>.
18975    pub reconciling: bool,
18976
18977    /// Optional. User-provided description of the deployment group.
18978    /// Used as additional context for the deployment group.
18979    pub description: std::string::String,
18980
18981    /// Output only. The list of locations where the deployment group is present.
18982    pub locations: std::vec::Vec<crate::model::MirroringLocation>,
18983
18984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18985}
18986
18987impl MirroringDeploymentGroup {
18988    /// Creates a new default instance.
18989    pub fn new() -> Self {
18990        std::default::Default::default()
18991    }
18992
18993    /// Sets the value of [name][crate::model::MirroringDeploymentGroup::name].
18994    ///
18995    /// # Example
18996    /// ```ignore,no_run
18997    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18998    /// # let project_id = "project_id";
18999    /// # let location_id = "location_id";
19000    /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
19001    /// let x = MirroringDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19002    /// ```
19003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19004        self.name = v.into();
19005        self
19006    }
19007
19008    /// Sets the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
19009    ///
19010    /// # Example
19011    /// ```ignore,no_run
19012    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19013    /// use wkt::Timestamp;
19014    /// let x = MirroringDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
19015    /// ```
19016    pub fn set_create_time<T>(mut self, v: T) -> Self
19017    where
19018        T: std::convert::Into<wkt::Timestamp>,
19019    {
19020        self.create_time = std::option::Option::Some(v.into());
19021        self
19022    }
19023
19024    /// Sets or clears the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
19025    ///
19026    /// # Example
19027    /// ```ignore,no_run
19028    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19029    /// use wkt::Timestamp;
19030    /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
19031    /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
19032    /// ```
19033    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
19034    where
19035        T: std::convert::Into<wkt::Timestamp>,
19036    {
19037        self.create_time = v.map(|x| x.into());
19038        self
19039    }
19040
19041    /// Sets the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
19042    ///
19043    /// # Example
19044    /// ```ignore,no_run
19045    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19046    /// use wkt::Timestamp;
19047    /// let x = MirroringDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
19048    /// ```
19049    pub fn set_update_time<T>(mut self, v: T) -> Self
19050    where
19051        T: std::convert::Into<wkt::Timestamp>,
19052    {
19053        self.update_time = std::option::Option::Some(v.into());
19054        self
19055    }
19056
19057    /// Sets or clears the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
19058    ///
19059    /// # Example
19060    /// ```ignore,no_run
19061    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19062    /// use wkt::Timestamp;
19063    /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
19064    /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
19065    /// ```
19066    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
19067    where
19068        T: std::convert::Into<wkt::Timestamp>,
19069    {
19070        self.update_time = v.map(|x| x.into());
19071        self
19072    }
19073
19074    /// Sets the value of [labels][crate::model::MirroringDeploymentGroup::labels].
19075    ///
19076    /// # Example
19077    /// ```ignore,no_run
19078    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19079    /// let x = MirroringDeploymentGroup::new().set_labels([
19080    ///     ("key0", "abc"),
19081    ///     ("key1", "xyz"),
19082    /// ]);
19083    /// ```
19084    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
19085    where
19086        T: std::iter::IntoIterator<Item = (K, V)>,
19087        K: std::convert::Into<std::string::String>,
19088        V: std::convert::Into<std::string::String>,
19089    {
19090        use std::iter::Iterator;
19091        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
19092        self
19093    }
19094
19095    /// Sets the value of [network][crate::model::MirroringDeploymentGroup::network].
19096    ///
19097    /// # Example
19098    /// ```ignore,no_run
19099    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19100    /// let x = MirroringDeploymentGroup::new().set_network("example");
19101    /// ```
19102    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19103        self.network = v.into();
19104        self
19105    }
19106
19107    /// Sets the value of [connected_endpoint_groups][crate::model::MirroringDeploymentGroup::connected_endpoint_groups].
19108    ///
19109    /// # Example
19110    /// ```ignore,no_run
19111    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19112    /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
19113    /// let x = MirroringDeploymentGroup::new()
19114    ///     .set_connected_endpoint_groups([
19115    ///         ConnectedEndpointGroup::default()/* use setters */,
19116    ///         ConnectedEndpointGroup::default()/* use (different) setters */,
19117    ///     ]);
19118    /// ```
19119    pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
19120    where
19121        T: std::iter::IntoIterator<Item = V>,
19122        V: std::convert::Into<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
19123    {
19124        use std::iter::Iterator;
19125        self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
19126        self
19127    }
19128
19129    /// Sets the value of [nested_deployments][crate::model::MirroringDeploymentGroup::nested_deployments].
19130    ///
19131    /// # Example
19132    /// ```ignore,no_run
19133    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19134    /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19135    /// let x = MirroringDeploymentGroup::new()
19136    ///     .set_nested_deployments([
19137    ///         Deployment::default()/* use setters */,
19138    ///         Deployment::default()/* use (different) setters */,
19139    ///     ]);
19140    /// ```
19141    #[deprecated]
19142    pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
19143    where
19144        T: std::iter::IntoIterator<Item = V>,
19145        V: std::convert::Into<crate::model::mirroring_deployment_group::Deployment>,
19146    {
19147        use std::iter::Iterator;
19148        self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
19149        self
19150    }
19151
19152    /// Sets the value of [state][crate::model::MirroringDeploymentGroup::state].
19153    ///
19154    /// # Example
19155    /// ```ignore,no_run
19156    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19157    /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::State;
19158    /// let x0 = MirroringDeploymentGroup::new().set_state(State::Active);
19159    /// let x1 = MirroringDeploymentGroup::new().set_state(State::Creating);
19160    /// let x2 = MirroringDeploymentGroup::new().set_state(State::Deleting);
19161    /// ```
19162    pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment_group::State>>(
19163        mut self,
19164        v: T,
19165    ) -> Self {
19166        self.state = v.into();
19167        self
19168    }
19169
19170    /// Sets the value of [reconciling][crate::model::MirroringDeploymentGroup::reconciling].
19171    ///
19172    /// # Example
19173    /// ```ignore,no_run
19174    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19175    /// let x = MirroringDeploymentGroup::new().set_reconciling(true);
19176    /// ```
19177    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19178        self.reconciling = v.into();
19179        self
19180    }
19181
19182    /// Sets the value of [description][crate::model::MirroringDeploymentGroup::description].
19183    ///
19184    /// # Example
19185    /// ```ignore,no_run
19186    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19187    /// let x = MirroringDeploymentGroup::new().set_description("example");
19188    /// ```
19189    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19190        self.description = v.into();
19191        self
19192    }
19193
19194    /// Sets the value of [locations][crate::model::MirroringDeploymentGroup::locations].
19195    ///
19196    /// # Example
19197    /// ```ignore,no_run
19198    /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19199    /// use google_cloud_networksecurity_v1::model::MirroringLocation;
19200    /// let x = MirroringDeploymentGroup::new()
19201    ///     .set_locations([
19202    ///         MirroringLocation::default()/* use setters */,
19203    ///         MirroringLocation::default()/* use (different) setters */,
19204    ///     ]);
19205    /// ```
19206    pub fn set_locations<T, V>(mut self, v: T) -> Self
19207    where
19208        T: std::iter::IntoIterator<Item = V>,
19209        V: std::convert::Into<crate::model::MirroringLocation>,
19210    {
19211        use std::iter::Iterator;
19212        self.locations = v.into_iter().map(|i| i.into()).collect();
19213        self
19214    }
19215}
19216
19217impl wkt::message::Message for MirroringDeploymentGroup {
19218    fn typename() -> &'static str {
19219        "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup"
19220    }
19221}
19222
19223/// Defines additional types related to [MirroringDeploymentGroup].
19224pub mod mirroring_deployment_group {
19225    #[allow(unused_imports)]
19226    use super::*;
19227
19228    /// An endpoint group connected to this deployment group.
19229    #[derive(Clone, Default, PartialEq)]
19230    #[non_exhaustive]
19231    pub struct ConnectedEndpointGroup {
19232        /// Output only. The connected endpoint group's resource name, for example:
19233        /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
19234        /// See <https://google.aip.dev/124>.
19235        pub name: std::string::String,
19236
19237        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19238    }
19239
19240    impl ConnectedEndpointGroup {
19241        /// Creates a new default instance.
19242        pub fn new() -> Self {
19243            std::default::Default::default()
19244        }
19245
19246        /// Sets the value of [name][crate::model::mirroring_deployment_group::ConnectedEndpointGroup::name].
19247        ///
19248        /// # Example
19249        /// ```ignore,no_run
19250        /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
19251        /// # let project_id = "project_id";
19252        /// # let location_id = "location_id";
19253        /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
19254        /// let x = ConnectedEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
19255        /// ```
19256        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19257            self.name = v.into();
19258            self
19259        }
19260    }
19261
19262    impl wkt::message::Message for ConnectedEndpointGroup {
19263        fn typename() -> &'static str {
19264            "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup"
19265        }
19266    }
19267
19268    /// A deployment belonging to this deployment group.
19269    #[derive(Clone, Default, PartialEq)]
19270    #[non_exhaustive]
19271    pub struct Deployment {
19272        /// Output only. The name of the Mirroring Deployment, in the format:
19273        /// `projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}`.
19274        pub name: std::string::String,
19275
19276        /// Output only. Most recent known state of the deployment.
19277        pub state: crate::model::mirroring_deployment::State,
19278
19279        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19280    }
19281
19282    impl Deployment {
19283        /// Creates a new default instance.
19284        pub fn new() -> Self {
19285            std::default::Default::default()
19286        }
19287
19288        /// Sets the value of [name][crate::model::mirroring_deployment_group::Deployment::name].
19289        ///
19290        /// # Example
19291        /// ```ignore,no_run
19292        /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19293        /// # let project_id = "project_id";
19294        /// # let location_id = "location_id";
19295        /// # let mirroring_deployment_id = "mirroring_deployment_id";
19296        /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
19297        /// ```
19298        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19299            self.name = v.into();
19300            self
19301        }
19302
19303        /// Sets the value of [state][crate::model::mirroring_deployment_group::Deployment::state].
19304        ///
19305        /// # Example
19306        /// ```ignore,no_run
19307        /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19308        /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
19309        /// let x0 = Deployment::new().set_state(State::Active);
19310        /// let x1 = Deployment::new().set_state(State::Creating);
19311        /// let x2 = Deployment::new().set_state(State::Deleting);
19312        /// ```
19313        pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
19314            mut self,
19315            v: T,
19316        ) -> Self {
19317            self.state = v.into();
19318            self
19319        }
19320    }
19321
19322    impl wkt::message::Message for Deployment {
19323        fn typename() -> &'static str {
19324            "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment"
19325        }
19326    }
19327
19328    /// The current state of the deployment group.
19329    ///
19330    /// # Working with unknown values
19331    ///
19332    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19333    /// additional enum variants at any time. Adding new variants is not considered
19334    /// a breaking change. Applications should write their code in anticipation of:
19335    ///
19336    /// - New values appearing in future releases of the client library, **and**
19337    /// - New values received dynamically, without application changes.
19338    ///
19339    /// Please consult the [Working with enums] section in the user guide for some
19340    /// guidelines.
19341    ///
19342    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19343    #[derive(Clone, Debug, PartialEq)]
19344    #[non_exhaustive]
19345    pub enum State {
19346        /// State not set (this is not a valid state).
19347        Unspecified,
19348        /// The deployment group is ready.
19349        Active,
19350        /// The deployment group is being created.
19351        Creating,
19352        /// The deployment group is being deleted.
19353        Deleting,
19354        /// The deployment group is being wiped out (project deleted).
19355        Closed,
19356        /// If set, the enum was initialized with an unknown value.
19357        ///
19358        /// Applications can examine the value using [State::value] or
19359        /// [State::name].
19360        UnknownValue(state::UnknownValue),
19361    }
19362
19363    #[doc(hidden)]
19364    pub mod state {
19365        #[allow(unused_imports)]
19366        use super::*;
19367        #[derive(Clone, Debug, PartialEq)]
19368        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19369    }
19370
19371    impl State {
19372        /// Gets the enum value.
19373        ///
19374        /// Returns `None` if the enum contains an unknown value deserialized from
19375        /// the string representation of enums.
19376        pub fn value(&self) -> std::option::Option<i32> {
19377            match self {
19378                Self::Unspecified => std::option::Option::Some(0),
19379                Self::Active => std::option::Option::Some(1),
19380                Self::Creating => std::option::Option::Some(2),
19381                Self::Deleting => std::option::Option::Some(3),
19382                Self::Closed => std::option::Option::Some(4),
19383                Self::UnknownValue(u) => u.0.value(),
19384            }
19385        }
19386
19387        /// Gets the enum value as a string.
19388        ///
19389        /// Returns `None` if the enum contains an unknown value deserialized from
19390        /// the integer representation of enums.
19391        pub fn name(&self) -> std::option::Option<&str> {
19392            match self {
19393                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
19394                Self::Active => std::option::Option::Some("ACTIVE"),
19395                Self::Creating => std::option::Option::Some("CREATING"),
19396                Self::Deleting => std::option::Option::Some("DELETING"),
19397                Self::Closed => std::option::Option::Some("CLOSED"),
19398                Self::UnknownValue(u) => u.0.name(),
19399            }
19400        }
19401    }
19402
19403    impl std::default::Default for State {
19404        fn default() -> Self {
19405            use std::convert::From;
19406            Self::from(0)
19407        }
19408    }
19409
19410    impl std::fmt::Display for State {
19411        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19412            wkt::internal::display_enum(f, self.name(), self.value())
19413        }
19414    }
19415
19416    impl std::convert::From<i32> for State {
19417        fn from(value: i32) -> Self {
19418            match value {
19419                0 => Self::Unspecified,
19420                1 => Self::Active,
19421                2 => Self::Creating,
19422                3 => Self::Deleting,
19423                4 => Self::Closed,
19424                _ => Self::UnknownValue(state::UnknownValue(
19425                    wkt::internal::UnknownEnumValue::Integer(value),
19426                )),
19427            }
19428        }
19429    }
19430
19431    impl std::convert::From<&str> for State {
19432        fn from(value: &str) -> Self {
19433            use std::string::ToString;
19434            match value {
19435                "STATE_UNSPECIFIED" => Self::Unspecified,
19436                "ACTIVE" => Self::Active,
19437                "CREATING" => Self::Creating,
19438                "DELETING" => Self::Deleting,
19439                "CLOSED" => Self::Closed,
19440                _ => Self::UnknownValue(state::UnknownValue(
19441                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19442                )),
19443            }
19444        }
19445    }
19446
19447    impl serde::ser::Serialize for State {
19448        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19449        where
19450            S: serde::Serializer,
19451        {
19452            match self {
19453                Self::Unspecified => serializer.serialize_i32(0),
19454                Self::Active => serializer.serialize_i32(1),
19455                Self::Creating => serializer.serialize_i32(2),
19456                Self::Deleting => serializer.serialize_i32(3),
19457                Self::Closed => serializer.serialize_i32(4),
19458                Self::UnknownValue(u) => u.0.serialize(serializer),
19459            }
19460        }
19461    }
19462
19463    impl<'de> serde::de::Deserialize<'de> for State {
19464        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19465        where
19466            D: serde::Deserializer<'de>,
19467        {
19468            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19469                ".google.cloud.networksecurity.v1.MirroringDeploymentGroup.State",
19470            ))
19471        }
19472    }
19473}
19474
19475/// Request message for ListMirroringDeploymentGroups.
19476#[derive(Clone, Default, PartialEq)]
19477#[non_exhaustive]
19478pub struct ListMirroringDeploymentGroupsRequest {
19479    /// Required. The parent, which owns this collection of deployment groups.
19480    /// Example: `projects/123456789/locations/global`.
19481    /// See <https://google.aip.dev/132> for more details.
19482    pub parent: std::string::String,
19483
19484    /// Optional. Requested page size. Server may return fewer items than
19485    /// requested. If unspecified, server will pick an appropriate default. See
19486    /// <https://google.aip.dev/158> for more details.
19487    pub page_size: i32,
19488
19489    /// Optional. A page token, received from a previous
19490    /// `ListMirroringDeploymentGroups` call. Provide this to retrieve the
19491    /// subsequent page. When paginating, all other parameters provided to
19492    /// `ListMirroringDeploymentGroups` must match the call that provided the page
19493    /// token. See <https://google.aip.dev/158> for more details.
19494    pub page_token: std::string::String,
19495
19496    /// Optional. Filter expression.
19497    /// See <https://google.aip.dev/160#filtering> for more details.
19498    pub filter: std::string::String,
19499
19500    /// Optional. Sort expression.
19501    /// See <https://google.aip.dev/132#ordering> for more details.
19502    pub order_by: std::string::String,
19503
19504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19505}
19506
19507impl ListMirroringDeploymentGroupsRequest {
19508    /// Creates a new default instance.
19509    pub fn new() -> Self {
19510        std::default::Default::default()
19511    }
19512
19513    /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
19514    ///
19515    /// # Example
19516    /// ```ignore,no_run
19517    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19518    /// # let project_id = "project_id";
19519    /// # let location_id = "location_id";
19520    /// let x = ListMirroringDeploymentGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
19521    /// ```
19522    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19523        self.parent = v.into();
19524        self
19525    }
19526
19527    /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
19528    ///
19529    /// # Example
19530    /// ```ignore,no_run
19531    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19532    /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_size(42);
19533    /// ```
19534    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19535        self.page_size = v.into();
19536        self
19537    }
19538
19539    /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
19540    ///
19541    /// # Example
19542    /// ```ignore,no_run
19543    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19544    /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_token("example");
19545    /// ```
19546    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19547        self.page_token = v.into();
19548        self
19549    }
19550
19551    /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
19552    ///
19553    /// # Example
19554    /// ```ignore,no_run
19555    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19556    /// let x = ListMirroringDeploymentGroupsRequest::new().set_filter("example");
19557    /// ```
19558    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19559        self.filter = v.into();
19560        self
19561    }
19562
19563    /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
19564    ///
19565    /// # Example
19566    /// ```ignore,no_run
19567    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19568    /// let x = ListMirroringDeploymentGroupsRequest::new().set_order_by("example");
19569    /// ```
19570    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19571        self.order_by = v.into();
19572        self
19573    }
19574}
19575
19576impl wkt::message::Message for ListMirroringDeploymentGroupsRequest {
19577    fn typename() -> &'static str {
19578        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest"
19579    }
19580}
19581
19582/// Response message for ListMirroringDeploymentGroups.
19583#[derive(Clone, Default, PartialEq)]
19584#[non_exhaustive]
19585pub struct ListMirroringDeploymentGroupsResponse {
19586    /// The deployment groups from the specified parent.
19587    pub mirroring_deployment_groups: std::vec::Vec<crate::model::MirroringDeploymentGroup>,
19588
19589    /// A token that can be sent as `page_token` to retrieve the next page.
19590    /// If this field is omitted, there are no subsequent pages.
19591    /// See <https://google.aip.dev/158> for more details.
19592    pub next_page_token: std::string::String,
19593
19594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19595}
19596
19597impl ListMirroringDeploymentGroupsResponse {
19598    /// Creates a new default instance.
19599    pub fn new() -> Self {
19600        std::default::Default::default()
19601    }
19602
19603    /// Sets the value of [mirroring_deployment_groups][crate::model::ListMirroringDeploymentGroupsResponse::mirroring_deployment_groups].
19604    ///
19605    /// # Example
19606    /// ```ignore,no_run
19607    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19608    /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19609    /// let x = ListMirroringDeploymentGroupsResponse::new()
19610    ///     .set_mirroring_deployment_groups([
19611    ///         MirroringDeploymentGroup::default()/* use setters */,
19612    ///         MirroringDeploymentGroup::default()/* use (different) setters */,
19613    ///     ]);
19614    /// ```
19615    pub fn set_mirroring_deployment_groups<T, V>(mut self, v: T) -> Self
19616    where
19617        T: std::iter::IntoIterator<Item = V>,
19618        V: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19619    {
19620        use std::iter::Iterator;
19621        self.mirroring_deployment_groups = v.into_iter().map(|i| i.into()).collect();
19622        self
19623    }
19624
19625    /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentGroupsResponse::next_page_token].
19626    ///
19627    /// # Example
19628    /// ```ignore,no_run
19629    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19630    /// let x = ListMirroringDeploymentGroupsResponse::new().set_next_page_token("example");
19631    /// ```
19632    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19633        self.next_page_token = v.into();
19634        self
19635    }
19636}
19637
19638impl wkt::message::Message for ListMirroringDeploymentGroupsResponse {
19639    fn typename() -> &'static str {
19640        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse"
19641    }
19642}
19643
19644#[doc(hidden)]
19645impl google_cloud_gax::paginator::internal::PageableResponse
19646    for ListMirroringDeploymentGroupsResponse
19647{
19648    type PageItem = crate::model::MirroringDeploymentGroup;
19649
19650    fn items(self) -> std::vec::Vec<Self::PageItem> {
19651        self.mirroring_deployment_groups
19652    }
19653
19654    fn next_page_token(&self) -> std::string::String {
19655        use std::clone::Clone;
19656        self.next_page_token.clone()
19657    }
19658}
19659
19660/// Request message for GetMirroringDeploymentGroup.
19661#[derive(Clone, Default, PartialEq)]
19662#[non_exhaustive]
19663pub struct GetMirroringDeploymentGroupRequest {
19664    /// Required. The name of the deployment group to retrieve.
19665    /// Format:
19666    /// projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}
19667    pub name: std::string::String,
19668
19669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19670}
19671
19672impl GetMirroringDeploymentGroupRequest {
19673    /// Creates a new default instance.
19674    pub fn new() -> Self {
19675        std::default::Default::default()
19676    }
19677
19678    /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
19679    ///
19680    /// # Example
19681    /// ```ignore,no_run
19682    /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentGroupRequest;
19683    /// # let project_id = "project_id";
19684    /// # let location_id = "location_id";
19685    /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
19686    /// let x = GetMirroringDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19687    /// ```
19688    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19689        self.name = v.into();
19690        self
19691    }
19692}
19693
19694impl wkt::message::Message for GetMirroringDeploymentGroupRequest {
19695    fn typename() -> &'static str {
19696        "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest"
19697    }
19698}
19699
19700/// Request message for CreateMirroringDeploymentGroup.
19701#[derive(Clone, Default, PartialEq)]
19702#[non_exhaustive]
19703pub struct CreateMirroringDeploymentGroupRequest {
19704    /// Required. The parent resource where this deployment group will be created.
19705    /// Format: projects/{project}/locations/{location}
19706    pub parent: std::string::String,
19707
19708    /// Required. The ID to use for the new deployment group, which will become the
19709    /// final component of the deployment group's resource name.
19710    pub mirroring_deployment_group_id: std::string::String,
19711
19712    /// Required. The deployment group to create.
19713    pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19714
19715    /// Optional. A unique identifier for this request. Must be a UUID4.
19716    /// This request is only idempotent if a `request_id` is provided.
19717    /// See <https://google.aip.dev/155> for more details.
19718    pub request_id: std::string::String,
19719
19720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19721}
19722
19723impl CreateMirroringDeploymentGroupRequest {
19724    /// Creates a new default instance.
19725    pub fn new() -> Self {
19726        std::default::Default::default()
19727    }
19728
19729    /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
19730    ///
19731    /// # Example
19732    /// ```ignore,no_run
19733    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19734    /// # let project_id = "project_id";
19735    /// # let location_id = "location_id";
19736    /// let x = CreateMirroringDeploymentGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
19737    /// ```
19738    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19739        self.parent = v.into();
19740        self
19741    }
19742
19743    /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
19744    ///
19745    /// # Example
19746    /// ```ignore,no_run
19747    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19748    /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group_id("example");
19749    /// ```
19750    pub fn set_mirroring_deployment_group_id<T: std::convert::Into<std::string::String>>(
19751        mut self,
19752        v: T,
19753    ) -> Self {
19754        self.mirroring_deployment_group_id = v.into();
19755        self
19756    }
19757
19758    /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19759    ///
19760    /// # Example
19761    /// ```ignore,no_run
19762    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19763    /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19764    /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19765    /// ```
19766    pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19767    where
19768        T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19769    {
19770        self.mirroring_deployment_group = std::option::Option::Some(v.into());
19771        self
19772    }
19773
19774    /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19775    ///
19776    /// # Example
19777    /// ```ignore,no_run
19778    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19779    /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19780    /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19781    /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19782    /// ```
19783    pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19784    where
19785        T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19786    {
19787        self.mirroring_deployment_group = v.map(|x| x.into());
19788        self
19789    }
19790
19791    /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
19792    ///
19793    /// # Example
19794    /// ```ignore,no_run
19795    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19796    /// let x = CreateMirroringDeploymentGroupRequest::new().set_request_id("example");
19797    /// ```
19798    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19799        self.request_id = v.into();
19800        self
19801    }
19802}
19803
19804impl wkt::message::Message for CreateMirroringDeploymentGroupRequest {
19805    fn typename() -> &'static str {
19806        "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest"
19807    }
19808}
19809
19810/// Request message for UpdateMirroringDeploymentGroup.
19811#[derive(Clone, Default, PartialEq)]
19812#[non_exhaustive]
19813pub struct UpdateMirroringDeploymentGroupRequest {
19814    /// Optional. The list of fields to update.
19815    /// Fields are specified relative to the deployment group
19816    /// (e.g. `description`; *not*
19817    /// `mirroring_deployment_group.description`). See
19818    /// <https://google.aip.dev/161> for more details.
19819    pub update_mask: std::option::Option<wkt::FieldMask>,
19820
19821    /// Required. The deployment group to update.
19822    pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19823
19824    /// Optional. A unique identifier for this request. Must be a UUID4.
19825    /// This request is only idempotent if a `request_id` is provided.
19826    /// See <https://google.aip.dev/155> for more details.
19827    pub request_id: std::string::String,
19828
19829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19830}
19831
19832impl UpdateMirroringDeploymentGroupRequest {
19833    /// Creates a new default instance.
19834    pub fn new() -> Self {
19835        std::default::Default::default()
19836    }
19837
19838    /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19839    ///
19840    /// # Example
19841    /// ```ignore,no_run
19842    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19843    /// use wkt::FieldMask;
19844    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
19845    /// ```
19846    pub fn set_update_mask<T>(mut self, v: T) -> Self
19847    where
19848        T: std::convert::Into<wkt::FieldMask>,
19849    {
19850        self.update_mask = std::option::Option::Some(v.into());
19851        self
19852    }
19853
19854    /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19855    ///
19856    /// # Example
19857    /// ```ignore,no_run
19858    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19859    /// use wkt::FieldMask;
19860    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
19861    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
19862    /// ```
19863    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19864    where
19865        T: std::convert::Into<wkt::FieldMask>,
19866    {
19867        self.update_mask = v.map(|x| x.into());
19868        self
19869    }
19870
19871    /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19872    ///
19873    /// # Example
19874    /// ```ignore,no_run
19875    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19876    /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19877    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19878    /// ```
19879    pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19880    where
19881        T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19882    {
19883        self.mirroring_deployment_group = std::option::Option::Some(v.into());
19884        self
19885    }
19886
19887    /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19888    ///
19889    /// # Example
19890    /// ```ignore,no_run
19891    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19892    /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19893    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19894    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19895    /// ```
19896    pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19897    where
19898        T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19899    {
19900        self.mirroring_deployment_group = v.map(|x| x.into());
19901        self
19902    }
19903
19904    /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
19905    ///
19906    /// # Example
19907    /// ```ignore,no_run
19908    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19909    /// let x = UpdateMirroringDeploymentGroupRequest::new().set_request_id("example");
19910    /// ```
19911    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19912        self.request_id = v.into();
19913        self
19914    }
19915}
19916
19917impl wkt::message::Message for UpdateMirroringDeploymentGroupRequest {
19918    fn typename() -> &'static str {
19919        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest"
19920    }
19921}
19922
19923/// Request message for DeleteMirroringDeploymentGroup.
19924#[derive(Clone, Default, PartialEq)]
19925#[non_exhaustive]
19926pub struct DeleteMirroringDeploymentGroupRequest {
19927    /// Required. The deployment group to delete.
19928    pub name: std::string::String,
19929
19930    /// Optional. A unique identifier for this request. Must be a UUID4.
19931    /// This request is only idempotent if a `request_id` is provided.
19932    /// See <https://google.aip.dev/155> for more details.
19933    pub request_id: std::string::String,
19934
19935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19936}
19937
19938impl DeleteMirroringDeploymentGroupRequest {
19939    /// Creates a new default instance.
19940    pub fn new() -> Self {
19941        std::default::Default::default()
19942    }
19943
19944    /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
19945    ///
19946    /// # Example
19947    /// ```ignore,no_run
19948    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19949    /// # let project_id = "project_id";
19950    /// # let location_id = "location_id";
19951    /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
19952    /// let x = DeleteMirroringDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19953    /// ```
19954    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19955        self.name = v.into();
19956        self
19957    }
19958
19959    /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
19960    ///
19961    /// # Example
19962    /// ```ignore,no_run
19963    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19964    /// let x = DeleteMirroringDeploymentGroupRequest::new().set_request_id("example");
19965    /// ```
19966    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19967        self.request_id = v.into();
19968        self
19969    }
19970}
19971
19972impl wkt::message::Message for DeleteMirroringDeploymentGroupRequest {
19973    fn typename() -> &'static str {
19974        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest"
19975    }
19976}
19977
19978/// A deployment represents a zonal mirroring backend ready to accept
19979/// GENEVE-encapsulated replica traffic, e.g. a zonal instance group fronted by
19980/// an internal passthrough load balancer. Deployments are always part of a
19981/// global deployment group which represents a global mirroring service.
19982#[derive(Clone, Default, PartialEq)]
19983#[non_exhaustive]
19984pub struct MirroringDeployment {
19985    /// Immutable. Identifier. The resource name of this deployment, for example:
19986    /// `projects/123456789/locations/us-central1-a/mirroringDeployments/my-dep`.
19987    /// See <https://google.aip.dev/122> for more details.
19988    pub name: std::string::String,
19989
19990    /// Output only. The timestamp when the resource was created.
19991    /// See <https://google.aip.dev/148#timestamps>.
19992    pub create_time: std::option::Option<wkt::Timestamp>,
19993
19994    /// Output only. The timestamp when the resource was most recently updated.
19995    /// See <https://google.aip.dev/148#timestamps>.
19996    pub update_time: std::option::Option<wkt::Timestamp>,
19997
19998    /// Optional. Labels are key/value pairs that help to organize and filter
19999    /// resources.
20000    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
20001
20002    /// Required. Immutable. The regional forwarding rule that fronts the mirroring
20003    /// collectors, for example:
20004    /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`. See
20005    /// <https://google.aip.dev/124>.
20006    pub forwarding_rule: std::string::String,
20007
20008    /// Required. Immutable. The deployment group that this deployment is a part
20009    /// of, for example:
20010    /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
20011    /// See <https://google.aip.dev/124>.
20012    pub mirroring_deployment_group: std::string::String,
20013
20014    /// Output only. The current state of the deployment.
20015    /// See <https://google.aip.dev/216>.
20016    pub state: crate::model::mirroring_deployment::State,
20017
20018    /// Output only. The current state of the resource does not match the user's
20019    /// intended state, and the system is working to reconcile them. This part of
20020    /// the normal operation (e.g. linking a new association to the parent group).
20021    /// See <https://google.aip.dev/128>.
20022    pub reconciling: bool,
20023
20024    /// Optional. User-provided description of the deployment.
20025    /// Used as additional context for the deployment.
20026    pub description: std::string::String,
20027
20028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20029}
20030
20031impl MirroringDeployment {
20032    /// Creates a new default instance.
20033    pub fn new() -> Self {
20034        std::default::Default::default()
20035    }
20036
20037    /// Sets the value of [name][crate::model::MirroringDeployment::name].
20038    ///
20039    /// # Example
20040    /// ```ignore,no_run
20041    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20042    /// # let project_id = "project_id";
20043    /// # let location_id = "location_id";
20044    /// # let mirroring_deployment_id = "mirroring_deployment_id";
20045    /// let x = MirroringDeployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20046    /// ```
20047    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20048        self.name = v.into();
20049        self
20050    }
20051
20052    /// Sets the value of [create_time][crate::model::MirroringDeployment::create_time].
20053    ///
20054    /// # Example
20055    /// ```ignore,no_run
20056    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20057    /// use wkt::Timestamp;
20058    /// let x = MirroringDeployment::new().set_create_time(Timestamp::default()/* use setters */);
20059    /// ```
20060    pub fn set_create_time<T>(mut self, v: T) -> Self
20061    where
20062        T: std::convert::Into<wkt::Timestamp>,
20063    {
20064        self.create_time = std::option::Option::Some(v.into());
20065        self
20066    }
20067
20068    /// Sets or clears the value of [create_time][crate::model::MirroringDeployment::create_time].
20069    ///
20070    /// # Example
20071    /// ```ignore,no_run
20072    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20073    /// use wkt::Timestamp;
20074    /// let x = MirroringDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20075    /// let x = MirroringDeployment::new().set_or_clear_create_time(None::<Timestamp>);
20076    /// ```
20077    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20078    where
20079        T: std::convert::Into<wkt::Timestamp>,
20080    {
20081        self.create_time = v.map(|x| x.into());
20082        self
20083    }
20084
20085    /// Sets the value of [update_time][crate::model::MirroringDeployment::update_time].
20086    ///
20087    /// # Example
20088    /// ```ignore,no_run
20089    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20090    /// use wkt::Timestamp;
20091    /// let x = MirroringDeployment::new().set_update_time(Timestamp::default()/* use setters */);
20092    /// ```
20093    pub fn set_update_time<T>(mut self, v: T) -> Self
20094    where
20095        T: std::convert::Into<wkt::Timestamp>,
20096    {
20097        self.update_time = std::option::Option::Some(v.into());
20098        self
20099    }
20100
20101    /// Sets or clears the value of [update_time][crate::model::MirroringDeployment::update_time].
20102    ///
20103    /// # Example
20104    /// ```ignore,no_run
20105    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20106    /// use wkt::Timestamp;
20107    /// let x = MirroringDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20108    /// let x = MirroringDeployment::new().set_or_clear_update_time(None::<Timestamp>);
20109    /// ```
20110    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20111    where
20112        T: std::convert::Into<wkt::Timestamp>,
20113    {
20114        self.update_time = v.map(|x| x.into());
20115        self
20116    }
20117
20118    /// Sets the value of [labels][crate::model::MirroringDeployment::labels].
20119    ///
20120    /// # Example
20121    /// ```ignore,no_run
20122    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20123    /// let x = MirroringDeployment::new().set_labels([
20124    ///     ("key0", "abc"),
20125    ///     ("key1", "xyz"),
20126    /// ]);
20127    /// ```
20128    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20129    where
20130        T: std::iter::IntoIterator<Item = (K, V)>,
20131        K: std::convert::Into<std::string::String>,
20132        V: std::convert::Into<std::string::String>,
20133    {
20134        use std::iter::Iterator;
20135        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20136        self
20137    }
20138
20139    /// Sets the value of [forwarding_rule][crate::model::MirroringDeployment::forwarding_rule].
20140    ///
20141    /// # Example
20142    /// ```ignore,no_run
20143    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20144    /// let x = MirroringDeployment::new().set_forwarding_rule("example");
20145    /// ```
20146    pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20147        self.forwarding_rule = v.into();
20148        self
20149    }
20150
20151    /// Sets the value of [mirroring_deployment_group][crate::model::MirroringDeployment::mirroring_deployment_group].
20152    ///
20153    /// # Example
20154    /// ```ignore,no_run
20155    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20156    /// # let project_id = "project_id";
20157    /// # let location_id = "location_id";
20158    /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
20159    /// let x = MirroringDeployment::new().set_mirroring_deployment_group(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
20160    /// ```
20161    pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
20162        mut self,
20163        v: T,
20164    ) -> Self {
20165        self.mirroring_deployment_group = v.into();
20166        self
20167    }
20168
20169    /// Sets the value of [state][crate::model::MirroringDeployment::state].
20170    ///
20171    /// # Example
20172    /// ```ignore,no_run
20173    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20174    /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
20175    /// let x0 = MirroringDeployment::new().set_state(State::Active);
20176    /// let x1 = MirroringDeployment::new().set_state(State::Creating);
20177    /// let x2 = MirroringDeployment::new().set_state(State::Deleting);
20178    /// ```
20179    pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
20180        mut self,
20181        v: T,
20182    ) -> Self {
20183        self.state = v.into();
20184        self
20185    }
20186
20187    /// Sets the value of [reconciling][crate::model::MirroringDeployment::reconciling].
20188    ///
20189    /// # Example
20190    /// ```ignore,no_run
20191    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20192    /// let x = MirroringDeployment::new().set_reconciling(true);
20193    /// ```
20194    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20195        self.reconciling = v.into();
20196        self
20197    }
20198
20199    /// Sets the value of [description][crate::model::MirroringDeployment::description].
20200    ///
20201    /// # Example
20202    /// ```ignore,no_run
20203    /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20204    /// let x = MirroringDeployment::new().set_description("example");
20205    /// ```
20206    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20207        self.description = v.into();
20208        self
20209    }
20210}
20211
20212impl wkt::message::Message for MirroringDeployment {
20213    fn typename() -> &'static str {
20214        "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeployment"
20215    }
20216}
20217
20218/// Defines additional types related to [MirroringDeployment].
20219pub mod mirroring_deployment {
20220    #[allow(unused_imports)]
20221    use super::*;
20222
20223    /// The current state of the deployment.
20224    ///
20225    /// # Working with unknown values
20226    ///
20227    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20228    /// additional enum variants at any time. Adding new variants is not considered
20229    /// a breaking change. Applications should write their code in anticipation of:
20230    ///
20231    /// - New values appearing in future releases of the client library, **and**
20232    /// - New values received dynamically, without application changes.
20233    ///
20234    /// Please consult the [Working with enums] section in the user guide for some
20235    /// guidelines.
20236    ///
20237    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20238    #[derive(Clone, Debug, PartialEq)]
20239    #[non_exhaustive]
20240    pub enum State {
20241        /// State not set (this is not a valid state).
20242        Unspecified,
20243        /// The deployment is ready and in sync with the parent group.
20244        Active,
20245        /// The deployment is being created.
20246        Creating,
20247        /// The deployment is being deleted.
20248        Deleting,
20249        /// The deployment is out of sync with the parent group.
20250        /// In most cases, this is a result of a transient issue within the system
20251        /// (e.g. a delayed data-path config) and the system is expected to recover
20252        /// automatically. See the parent deployment group's state for more details.
20253        OutOfSync,
20254        /// An attempt to delete the deployment has failed. This is a terminal state
20255        /// and the deployment is not expected to recover. The only permitted
20256        /// operation is to retry deleting the deployment.
20257        DeleteFailed,
20258        /// If set, the enum was initialized with an unknown value.
20259        ///
20260        /// Applications can examine the value using [State::value] or
20261        /// [State::name].
20262        UnknownValue(state::UnknownValue),
20263    }
20264
20265    #[doc(hidden)]
20266    pub mod state {
20267        #[allow(unused_imports)]
20268        use super::*;
20269        #[derive(Clone, Debug, PartialEq)]
20270        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20271    }
20272
20273    impl State {
20274        /// Gets the enum value.
20275        ///
20276        /// Returns `None` if the enum contains an unknown value deserialized from
20277        /// the string representation of enums.
20278        pub fn value(&self) -> std::option::Option<i32> {
20279            match self {
20280                Self::Unspecified => std::option::Option::Some(0),
20281                Self::Active => std::option::Option::Some(1),
20282                Self::Creating => std::option::Option::Some(2),
20283                Self::Deleting => std::option::Option::Some(3),
20284                Self::OutOfSync => std::option::Option::Some(4),
20285                Self::DeleteFailed => std::option::Option::Some(5),
20286                Self::UnknownValue(u) => u.0.value(),
20287            }
20288        }
20289
20290        /// Gets the enum value as a string.
20291        ///
20292        /// Returns `None` if the enum contains an unknown value deserialized from
20293        /// the integer representation of enums.
20294        pub fn name(&self) -> std::option::Option<&str> {
20295            match self {
20296                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
20297                Self::Active => std::option::Option::Some("ACTIVE"),
20298                Self::Creating => std::option::Option::Some("CREATING"),
20299                Self::Deleting => std::option::Option::Some("DELETING"),
20300                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
20301                Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
20302                Self::UnknownValue(u) => u.0.name(),
20303            }
20304        }
20305    }
20306
20307    impl std::default::Default for State {
20308        fn default() -> Self {
20309            use std::convert::From;
20310            Self::from(0)
20311        }
20312    }
20313
20314    impl std::fmt::Display for State {
20315        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20316            wkt::internal::display_enum(f, self.name(), self.value())
20317        }
20318    }
20319
20320    impl std::convert::From<i32> for State {
20321        fn from(value: i32) -> Self {
20322            match value {
20323                0 => Self::Unspecified,
20324                1 => Self::Active,
20325                2 => Self::Creating,
20326                3 => Self::Deleting,
20327                4 => Self::OutOfSync,
20328                5 => Self::DeleteFailed,
20329                _ => Self::UnknownValue(state::UnknownValue(
20330                    wkt::internal::UnknownEnumValue::Integer(value),
20331                )),
20332            }
20333        }
20334    }
20335
20336    impl std::convert::From<&str> for State {
20337        fn from(value: &str) -> Self {
20338            use std::string::ToString;
20339            match value {
20340                "STATE_UNSPECIFIED" => Self::Unspecified,
20341                "ACTIVE" => Self::Active,
20342                "CREATING" => Self::Creating,
20343                "DELETING" => Self::Deleting,
20344                "OUT_OF_SYNC" => Self::OutOfSync,
20345                "DELETE_FAILED" => Self::DeleteFailed,
20346                _ => Self::UnknownValue(state::UnknownValue(
20347                    wkt::internal::UnknownEnumValue::String(value.to_string()),
20348                )),
20349            }
20350        }
20351    }
20352
20353    impl serde::ser::Serialize for State {
20354        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20355        where
20356            S: serde::Serializer,
20357        {
20358            match self {
20359                Self::Unspecified => serializer.serialize_i32(0),
20360                Self::Active => serializer.serialize_i32(1),
20361                Self::Creating => serializer.serialize_i32(2),
20362                Self::Deleting => serializer.serialize_i32(3),
20363                Self::OutOfSync => serializer.serialize_i32(4),
20364                Self::DeleteFailed => serializer.serialize_i32(5),
20365                Self::UnknownValue(u) => u.0.serialize(serializer),
20366            }
20367        }
20368    }
20369
20370    impl<'de> serde::de::Deserialize<'de> for State {
20371        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20372        where
20373            D: serde::Deserializer<'de>,
20374        {
20375            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
20376                ".google.cloud.networksecurity.v1.MirroringDeployment.State",
20377            ))
20378        }
20379    }
20380}
20381
20382/// Request message for ListMirroringDeployments.
20383#[derive(Clone, Default, PartialEq)]
20384#[non_exhaustive]
20385pub struct ListMirroringDeploymentsRequest {
20386    /// Required. The parent, which owns this collection of deployments.
20387    /// Example: `projects/123456789/locations/us-central1-a`.
20388    /// See <https://google.aip.dev/132> for more details.
20389    pub parent: std::string::String,
20390
20391    /// Optional. Requested page size. Server may return fewer items than
20392    /// requested. If unspecified, server will pick an appropriate default. See
20393    /// <https://google.aip.dev/158> for more details.
20394    pub page_size: i32,
20395
20396    /// Optional. A page token, received from a previous `ListMirroringDeployments`
20397    /// call. Provide this to retrieve the subsequent page. When paginating, all
20398    /// other parameters provided to `ListMirroringDeployments` must match the call
20399    /// that provided the page token. See <https://google.aip.dev/158> for more
20400    /// details.
20401    pub page_token: std::string::String,
20402
20403    /// Optional. Filter expression.
20404    /// See <https://google.aip.dev/160#filtering> for more details.
20405    pub filter: std::string::String,
20406
20407    /// Optional. Sort expression.
20408    /// See <https://google.aip.dev/132#ordering> for more details.
20409    pub order_by: std::string::String,
20410
20411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20412}
20413
20414impl ListMirroringDeploymentsRequest {
20415    /// Creates a new default instance.
20416    pub fn new() -> Self {
20417        std::default::Default::default()
20418    }
20419
20420    /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
20421    ///
20422    /// # Example
20423    /// ```ignore,no_run
20424    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20425    /// # let project_id = "project_id";
20426    /// # let location_id = "location_id";
20427    /// let x = ListMirroringDeploymentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
20428    /// ```
20429    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20430        self.parent = v.into();
20431        self
20432    }
20433
20434    /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
20435    ///
20436    /// # Example
20437    /// ```ignore,no_run
20438    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20439    /// let x = ListMirroringDeploymentsRequest::new().set_page_size(42);
20440    /// ```
20441    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20442        self.page_size = v.into();
20443        self
20444    }
20445
20446    /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
20447    ///
20448    /// # Example
20449    /// ```ignore,no_run
20450    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20451    /// let x = ListMirroringDeploymentsRequest::new().set_page_token("example");
20452    /// ```
20453    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20454        self.page_token = v.into();
20455        self
20456    }
20457
20458    /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
20459    ///
20460    /// # Example
20461    /// ```ignore,no_run
20462    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20463    /// let x = ListMirroringDeploymentsRequest::new().set_filter("example");
20464    /// ```
20465    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20466        self.filter = v.into();
20467        self
20468    }
20469
20470    /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
20471    ///
20472    /// # Example
20473    /// ```ignore,no_run
20474    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20475    /// let x = ListMirroringDeploymentsRequest::new().set_order_by("example");
20476    /// ```
20477    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20478        self.order_by = v.into();
20479        self
20480    }
20481}
20482
20483impl wkt::message::Message for ListMirroringDeploymentsRequest {
20484    fn typename() -> &'static str {
20485        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest"
20486    }
20487}
20488
20489/// Response message for ListMirroringDeployments.
20490#[derive(Clone, Default, PartialEq)]
20491#[non_exhaustive]
20492pub struct ListMirroringDeploymentsResponse {
20493    /// The deployments from the specified parent.
20494    pub mirroring_deployments: std::vec::Vec<crate::model::MirroringDeployment>,
20495
20496    /// A token that can be sent as `page_token` to retrieve the next page.
20497    /// If this field is omitted, there are no subsequent pages.
20498    /// See <https://google.aip.dev/158> for more details.
20499    pub next_page_token: std::string::String,
20500
20501    /// Locations that could not be reached.
20502    pub unreachable: std::vec::Vec<std::string::String>,
20503
20504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20505}
20506
20507impl ListMirroringDeploymentsResponse {
20508    /// Creates a new default instance.
20509    pub fn new() -> Self {
20510        std::default::Default::default()
20511    }
20512
20513    /// Sets the value of [mirroring_deployments][crate::model::ListMirroringDeploymentsResponse::mirroring_deployments].
20514    ///
20515    /// # Example
20516    /// ```ignore,no_run
20517    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20518    /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20519    /// let x = ListMirroringDeploymentsResponse::new()
20520    ///     .set_mirroring_deployments([
20521    ///         MirroringDeployment::default()/* use setters */,
20522    ///         MirroringDeployment::default()/* use (different) setters */,
20523    ///     ]);
20524    /// ```
20525    pub fn set_mirroring_deployments<T, V>(mut self, v: T) -> Self
20526    where
20527        T: std::iter::IntoIterator<Item = V>,
20528        V: std::convert::Into<crate::model::MirroringDeployment>,
20529    {
20530        use std::iter::Iterator;
20531        self.mirroring_deployments = v.into_iter().map(|i| i.into()).collect();
20532        self
20533    }
20534
20535    /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentsResponse::next_page_token].
20536    ///
20537    /// # Example
20538    /// ```ignore,no_run
20539    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20540    /// let x = ListMirroringDeploymentsResponse::new().set_next_page_token("example");
20541    /// ```
20542    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20543        self.next_page_token = v.into();
20544        self
20545    }
20546
20547    /// Sets the value of [unreachable][crate::model::ListMirroringDeploymentsResponse::unreachable].
20548    ///
20549    /// # Example
20550    /// ```ignore,no_run
20551    /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20552    /// let x = ListMirroringDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
20553    /// ```
20554    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20555    where
20556        T: std::iter::IntoIterator<Item = V>,
20557        V: std::convert::Into<std::string::String>,
20558    {
20559        use std::iter::Iterator;
20560        self.unreachable = v.into_iter().map(|i| i.into()).collect();
20561        self
20562    }
20563}
20564
20565impl wkt::message::Message for ListMirroringDeploymentsResponse {
20566    fn typename() -> &'static str {
20567        "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse"
20568    }
20569}
20570
20571#[doc(hidden)]
20572impl google_cloud_gax::paginator::internal::PageableResponse for ListMirroringDeploymentsResponse {
20573    type PageItem = crate::model::MirroringDeployment;
20574
20575    fn items(self) -> std::vec::Vec<Self::PageItem> {
20576        self.mirroring_deployments
20577    }
20578
20579    fn next_page_token(&self) -> std::string::String {
20580        use std::clone::Clone;
20581        self.next_page_token.clone()
20582    }
20583}
20584
20585/// Request message for GetMirroringDeployment.
20586#[derive(Clone, Default, PartialEq)]
20587#[non_exhaustive]
20588pub struct GetMirroringDeploymentRequest {
20589    /// Required. The name of the deployment to retrieve.
20590    /// Format:
20591    /// projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}
20592    pub name: std::string::String,
20593
20594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20595}
20596
20597impl GetMirroringDeploymentRequest {
20598    /// Creates a new default instance.
20599    pub fn new() -> Self {
20600        std::default::Default::default()
20601    }
20602
20603    /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
20604    ///
20605    /// # Example
20606    /// ```ignore,no_run
20607    /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentRequest;
20608    /// # let project_id = "project_id";
20609    /// # let location_id = "location_id";
20610    /// # let mirroring_deployment_id = "mirroring_deployment_id";
20611    /// let x = GetMirroringDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20612    /// ```
20613    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20614        self.name = v.into();
20615        self
20616    }
20617}
20618
20619impl wkt::message::Message for GetMirroringDeploymentRequest {
20620    fn typename() -> &'static str {
20621        "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentRequest"
20622    }
20623}
20624
20625/// Request message for CreateMirroringDeployment.
20626#[derive(Clone, Default, PartialEq)]
20627#[non_exhaustive]
20628pub struct CreateMirroringDeploymentRequest {
20629    /// Required. The parent resource where this deployment will be created.
20630    /// Format: projects/{project}/locations/{location}
20631    pub parent: std::string::String,
20632
20633    /// Required. The ID to use for the new deployment, which will become the final
20634    /// component of the deployment's resource name.
20635    pub mirroring_deployment_id: std::string::String,
20636
20637    /// Required. The deployment to create.
20638    pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20639
20640    /// Optional. A unique identifier for this request. Must be a UUID4.
20641    /// This request is only idempotent if a `request_id` is provided.
20642    /// See <https://google.aip.dev/155> for more details.
20643    pub request_id: std::string::String,
20644
20645    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20646}
20647
20648impl CreateMirroringDeploymentRequest {
20649    /// Creates a new default instance.
20650    pub fn new() -> Self {
20651        std::default::Default::default()
20652    }
20653
20654    /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
20655    ///
20656    /// # Example
20657    /// ```ignore,no_run
20658    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20659    /// # let project_id = "project_id";
20660    /// # let location_id = "location_id";
20661    /// let x = CreateMirroringDeploymentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
20662    /// ```
20663    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20664        self.parent = v.into();
20665        self
20666    }
20667
20668    /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
20669    ///
20670    /// # Example
20671    /// ```ignore,no_run
20672    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20673    /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment_id("example");
20674    /// ```
20675    pub fn set_mirroring_deployment_id<T: std::convert::Into<std::string::String>>(
20676        mut self,
20677        v: T,
20678    ) -> Self {
20679        self.mirroring_deployment_id = v.into();
20680        self
20681    }
20682
20683    /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20684    ///
20685    /// # Example
20686    /// ```ignore,no_run
20687    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20688    /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20689    /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20690    /// ```
20691    pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20692    where
20693        T: std::convert::Into<crate::model::MirroringDeployment>,
20694    {
20695        self.mirroring_deployment = std::option::Option::Some(v.into());
20696        self
20697    }
20698
20699    /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20700    ///
20701    /// # Example
20702    /// ```ignore,no_run
20703    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20704    /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20705    /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20706    /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20707    /// ```
20708    pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20709    where
20710        T: std::convert::Into<crate::model::MirroringDeployment>,
20711    {
20712        self.mirroring_deployment = v.map(|x| x.into());
20713        self
20714    }
20715
20716    /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
20717    ///
20718    /// # Example
20719    /// ```ignore,no_run
20720    /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20721    /// let x = CreateMirroringDeploymentRequest::new().set_request_id("example");
20722    /// ```
20723    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20724        self.request_id = v.into();
20725        self
20726    }
20727}
20728
20729impl wkt::message::Message for CreateMirroringDeploymentRequest {
20730    fn typename() -> &'static str {
20731        "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest"
20732    }
20733}
20734
20735/// Request message for UpdateMirroringDeployment.
20736#[derive(Clone, Default, PartialEq)]
20737#[non_exhaustive]
20738pub struct UpdateMirroringDeploymentRequest {
20739    /// Optional. The list of fields to update.
20740    /// Fields are specified relative to the deployment
20741    /// (e.g. `description`; *not* `mirroring_deployment.description`).
20742    /// See <https://google.aip.dev/161> for more details.
20743    pub update_mask: std::option::Option<wkt::FieldMask>,
20744
20745    /// Required. The deployment to update.
20746    pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20747
20748    /// Optional. A unique identifier for this request. Must be a UUID4.
20749    /// This request is only idempotent if a `request_id` is provided.
20750    /// See <https://google.aip.dev/155> for more details.
20751    pub request_id: std::string::String,
20752
20753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20754}
20755
20756impl UpdateMirroringDeploymentRequest {
20757    /// Creates a new default instance.
20758    pub fn new() -> Self {
20759        std::default::Default::default()
20760    }
20761
20762    /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20763    ///
20764    /// # Example
20765    /// ```ignore,no_run
20766    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20767    /// use wkt::FieldMask;
20768    /// let x = UpdateMirroringDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20769    /// ```
20770    pub fn set_update_mask<T>(mut self, v: T) -> Self
20771    where
20772        T: std::convert::Into<wkt::FieldMask>,
20773    {
20774        self.update_mask = std::option::Option::Some(v.into());
20775        self
20776    }
20777
20778    /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20779    ///
20780    /// # Example
20781    /// ```ignore,no_run
20782    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20783    /// use wkt::FieldMask;
20784    /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20785    /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20786    /// ```
20787    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20788    where
20789        T: std::convert::Into<wkt::FieldMask>,
20790    {
20791        self.update_mask = v.map(|x| x.into());
20792        self
20793    }
20794
20795    /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20796    ///
20797    /// # Example
20798    /// ```ignore,no_run
20799    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20800    /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20801    /// let x = UpdateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20802    /// ```
20803    pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20804    where
20805        T: std::convert::Into<crate::model::MirroringDeployment>,
20806    {
20807        self.mirroring_deployment = std::option::Option::Some(v.into());
20808        self
20809    }
20810
20811    /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20812    ///
20813    /// # Example
20814    /// ```ignore,no_run
20815    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20816    /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20817    /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20818    /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20819    /// ```
20820    pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20821    where
20822        T: std::convert::Into<crate::model::MirroringDeployment>,
20823    {
20824        self.mirroring_deployment = v.map(|x| x.into());
20825        self
20826    }
20827
20828    /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
20829    ///
20830    /// # Example
20831    /// ```ignore,no_run
20832    /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20833    /// let x = UpdateMirroringDeploymentRequest::new().set_request_id("example");
20834    /// ```
20835    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20836        self.request_id = v.into();
20837        self
20838    }
20839}
20840
20841impl wkt::message::Message for UpdateMirroringDeploymentRequest {
20842    fn typename() -> &'static str {
20843        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest"
20844    }
20845}
20846
20847/// Request message for DeleteMirroringDeployment.
20848#[derive(Clone, Default, PartialEq)]
20849#[non_exhaustive]
20850pub struct DeleteMirroringDeploymentRequest {
20851    /// Required. Name of the resource
20852    pub name: std::string::String,
20853
20854    /// Optional. A unique identifier for this request. Must be a UUID4.
20855    /// This request is only idempotent if a `request_id` is provided.
20856    /// See <https://google.aip.dev/155> for more details.
20857    pub request_id: std::string::String,
20858
20859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20860}
20861
20862impl DeleteMirroringDeploymentRequest {
20863    /// Creates a new default instance.
20864    pub fn new() -> Self {
20865        std::default::Default::default()
20866    }
20867
20868    /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
20869    ///
20870    /// # Example
20871    /// ```ignore,no_run
20872    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20873    /// # let project_id = "project_id";
20874    /// # let location_id = "location_id";
20875    /// # let mirroring_deployment_id = "mirroring_deployment_id";
20876    /// let x = DeleteMirroringDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20877    /// ```
20878    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20879        self.name = v.into();
20880        self
20881    }
20882
20883    /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
20884    ///
20885    /// # Example
20886    /// ```ignore,no_run
20887    /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20888    /// let x = DeleteMirroringDeploymentRequest::new().set_request_id("example");
20889    /// ```
20890    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20891        self.request_id = v.into();
20892        self
20893    }
20894}
20895
20896impl wkt::message::Message for DeleteMirroringDeploymentRequest {
20897    fn typename() -> &'static str {
20898        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest"
20899    }
20900}
20901
20902/// Details about mirroring in a specific cloud location.
20903#[derive(Clone, Default, PartialEq)]
20904#[non_exhaustive]
20905pub struct MirroringLocation {
20906    /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
20907    pub location: std::string::String,
20908
20909    /// Output only. The current state of the association in this location.
20910    pub state: crate::model::mirroring_location::State,
20911
20912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20913}
20914
20915impl MirroringLocation {
20916    /// Creates a new default instance.
20917    pub fn new() -> Self {
20918        std::default::Default::default()
20919    }
20920
20921    /// Sets the value of [location][crate::model::MirroringLocation::location].
20922    ///
20923    /// # Example
20924    /// ```ignore,no_run
20925    /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20926    /// let x = MirroringLocation::new().set_location("example");
20927    /// ```
20928    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20929        self.location = v.into();
20930        self
20931    }
20932
20933    /// Sets the value of [state][crate::model::MirroringLocation::state].
20934    ///
20935    /// # Example
20936    /// ```ignore,no_run
20937    /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20938    /// use google_cloud_networksecurity_v1::model::mirroring_location::State;
20939    /// let x0 = MirroringLocation::new().set_state(State::Active);
20940    /// let x1 = MirroringLocation::new().set_state(State::OutOfSync);
20941    /// ```
20942    pub fn set_state<T: std::convert::Into<crate::model::mirroring_location::State>>(
20943        mut self,
20944        v: T,
20945    ) -> Self {
20946        self.state = v.into();
20947        self
20948    }
20949}
20950
20951impl wkt::message::Message for MirroringLocation {
20952    fn typename() -> &'static str {
20953        "type.googleapis.com/google.cloud.networksecurity.v1.MirroringLocation"
20954    }
20955}
20956
20957/// Defines additional types related to [MirroringLocation].
20958pub mod mirroring_location {
20959    #[allow(unused_imports)]
20960    use super::*;
20961
20962    /// The current state of a resource in the location.
20963    ///
20964    /// # Working with unknown values
20965    ///
20966    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20967    /// additional enum variants at any time. Adding new variants is not considered
20968    /// a breaking change. Applications should write their code in anticipation of:
20969    ///
20970    /// - New values appearing in future releases of the client library, **and**
20971    /// - New values received dynamically, without application changes.
20972    ///
20973    /// Please consult the [Working with enums] section in the user guide for some
20974    /// guidelines.
20975    ///
20976    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20977    #[derive(Clone, Debug, PartialEq)]
20978    #[non_exhaustive]
20979    pub enum State {
20980        /// State not set (this is not a valid state).
20981        Unspecified,
20982        /// The resource is ready and in sync in the location.
20983        Active,
20984        /// The resource is out of sync in the location.
20985        /// In most cases, this is a result of a transient issue within the system
20986        /// (e.g. an inaccessible location) and the system is expected to recover
20987        /// automatically.
20988        OutOfSync,
20989        /// If set, the enum was initialized with an unknown value.
20990        ///
20991        /// Applications can examine the value using [State::value] or
20992        /// [State::name].
20993        UnknownValue(state::UnknownValue),
20994    }
20995
20996    #[doc(hidden)]
20997    pub mod state {
20998        #[allow(unused_imports)]
20999        use super::*;
21000        #[derive(Clone, Debug, PartialEq)]
21001        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21002    }
21003
21004    impl State {
21005        /// Gets the enum value.
21006        ///
21007        /// Returns `None` if the enum contains an unknown value deserialized from
21008        /// the string representation of enums.
21009        pub fn value(&self) -> std::option::Option<i32> {
21010            match self {
21011                Self::Unspecified => std::option::Option::Some(0),
21012                Self::Active => std::option::Option::Some(1),
21013                Self::OutOfSync => std::option::Option::Some(2),
21014                Self::UnknownValue(u) => u.0.value(),
21015            }
21016        }
21017
21018        /// Gets the enum value as a string.
21019        ///
21020        /// Returns `None` if the enum contains an unknown value deserialized from
21021        /// the integer representation of enums.
21022        pub fn name(&self) -> std::option::Option<&str> {
21023            match self {
21024                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21025                Self::Active => std::option::Option::Some("ACTIVE"),
21026                Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
21027                Self::UnknownValue(u) => u.0.name(),
21028            }
21029        }
21030    }
21031
21032    impl std::default::Default for State {
21033        fn default() -> Self {
21034            use std::convert::From;
21035            Self::from(0)
21036        }
21037    }
21038
21039    impl std::fmt::Display for State {
21040        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21041            wkt::internal::display_enum(f, self.name(), self.value())
21042        }
21043    }
21044
21045    impl std::convert::From<i32> for State {
21046        fn from(value: i32) -> Self {
21047            match value {
21048                0 => Self::Unspecified,
21049                1 => Self::Active,
21050                2 => Self::OutOfSync,
21051                _ => Self::UnknownValue(state::UnknownValue(
21052                    wkt::internal::UnknownEnumValue::Integer(value),
21053                )),
21054            }
21055        }
21056    }
21057
21058    impl std::convert::From<&str> for State {
21059        fn from(value: &str) -> Self {
21060            use std::string::ToString;
21061            match value {
21062                "STATE_UNSPECIFIED" => Self::Unspecified,
21063                "ACTIVE" => Self::Active,
21064                "OUT_OF_SYNC" => Self::OutOfSync,
21065                _ => Self::UnknownValue(state::UnknownValue(
21066                    wkt::internal::UnknownEnumValue::String(value.to_string()),
21067                )),
21068            }
21069        }
21070    }
21071
21072    impl serde::ser::Serialize for State {
21073        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21074        where
21075            S: serde::Serializer,
21076        {
21077            match self {
21078                Self::Unspecified => serializer.serialize_i32(0),
21079                Self::Active => serializer.serialize_i32(1),
21080                Self::OutOfSync => serializer.serialize_i32(2),
21081                Self::UnknownValue(u) => u.0.serialize(serializer),
21082            }
21083        }
21084    }
21085
21086    impl<'de> serde::de::Deserialize<'de> for State {
21087        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21088        where
21089            D: serde::Deserializer<'de>,
21090        {
21091            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21092                ".google.cloud.networksecurity.v1.MirroringLocation.State",
21093            ))
21094        }
21095    }
21096}
21097
21098/// SecurityProfileGroup is a resource that defines the behavior for various
21099/// ProfileTypes.
21100#[derive(Clone, Default, PartialEq)]
21101#[non_exhaustive]
21102pub struct SecurityProfileGroup {
21103    /// Immutable. Identifier. Name of the SecurityProfileGroup resource. It
21104    /// matches pattern
21105    /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
21106    pub name: std::string::String,
21107
21108    /// Optional. An optional description of the profile group. Max length 2048
21109    /// characters.
21110    pub description: std::string::String,
21111
21112    /// Output only. Resource creation timestamp.
21113    pub create_time: std::option::Option<wkt::Timestamp>,
21114
21115    /// Output only. Last resource update timestamp.
21116    pub update_time: std::option::Option<wkt::Timestamp>,
21117
21118    /// Output only. This checksum is computed by the server based on the value of
21119    /// other fields, and may be sent on update and delete requests to ensure the
21120    /// client has an up-to-date value before proceeding.
21121    pub etag: std::string::String,
21122
21123    /// Output only. Identifier used by the data-path. Unique within `{container,
21124    /// location}`.
21125    pub data_path_id: u64,
21126
21127    /// Optional. Labels as key value pairs.
21128    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
21129
21130    /// Optional. Reference to a SecurityProfile with the ThreatPrevention
21131    /// configuration.
21132    pub threat_prevention_profile: std::string::String,
21133
21134    /// Optional. Reference to a SecurityProfile with the CustomMirroring
21135    /// configuration.
21136    pub custom_mirroring_profile: std::string::String,
21137
21138    /// Optional. Reference to a SecurityProfile with the CustomIntercept
21139    /// configuration.
21140    pub custom_intercept_profile: std::string::String,
21141
21142    /// Optional. Reference to a SecurityProfile with the UrlFiltering
21143    /// configuration.
21144    pub url_filtering_profile: std::string::String,
21145
21146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21147}
21148
21149impl SecurityProfileGroup {
21150    /// Creates a new default instance.
21151    pub fn new() -> Self {
21152        std::default::Default::default()
21153    }
21154
21155    /// Sets the value of [name][crate::model::SecurityProfileGroup::name].
21156    ///
21157    /// # Example
21158    /// ```ignore,no_run
21159    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21160    /// # let organization_id = "organization_id";
21161    /// # let location_id = "location_id";
21162    /// # let security_profile_group_id = "security_profile_group_id";
21163    /// let x = SecurityProfileGroup::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
21164    /// ```
21165    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21166        self.name = v.into();
21167        self
21168    }
21169
21170    /// Sets the value of [description][crate::model::SecurityProfileGroup::description].
21171    ///
21172    /// # Example
21173    /// ```ignore,no_run
21174    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21175    /// let x = SecurityProfileGroup::new().set_description("example");
21176    /// ```
21177    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21178        self.description = v.into();
21179        self
21180    }
21181
21182    /// Sets the value of [create_time][crate::model::SecurityProfileGroup::create_time].
21183    ///
21184    /// # Example
21185    /// ```ignore,no_run
21186    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21187    /// use wkt::Timestamp;
21188    /// let x = SecurityProfileGroup::new().set_create_time(Timestamp::default()/* use setters */);
21189    /// ```
21190    pub fn set_create_time<T>(mut self, v: T) -> Self
21191    where
21192        T: std::convert::Into<wkt::Timestamp>,
21193    {
21194        self.create_time = std::option::Option::Some(v.into());
21195        self
21196    }
21197
21198    /// Sets or clears the value of [create_time][crate::model::SecurityProfileGroup::create_time].
21199    ///
21200    /// # Example
21201    /// ```ignore,no_run
21202    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21203    /// use wkt::Timestamp;
21204    /// let x = SecurityProfileGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21205    /// let x = SecurityProfileGroup::new().set_or_clear_create_time(None::<Timestamp>);
21206    /// ```
21207    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21208    where
21209        T: std::convert::Into<wkt::Timestamp>,
21210    {
21211        self.create_time = v.map(|x| x.into());
21212        self
21213    }
21214
21215    /// Sets the value of [update_time][crate::model::SecurityProfileGroup::update_time].
21216    ///
21217    /// # Example
21218    /// ```ignore,no_run
21219    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21220    /// use wkt::Timestamp;
21221    /// let x = SecurityProfileGroup::new().set_update_time(Timestamp::default()/* use setters */);
21222    /// ```
21223    pub fn set_update_time<T>(mut self, v: T) -> Self
21224    where
21225        T: std::convert::Into<wkt::Timestamp>,
21226    {
21227        self.update_time = std::option::Option::Some(v.into());
21228        self
21229    }
21230
21231    /// Sets or clears the value of [update_time][crate::model::SecurityProfileGroup::update_time].
21232    ///
21233    /// # Example
21234    /// ```ignore,no_run
21235    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21236    /// use wkt::Timestamp;
21237    /// let x = SecurityProfileGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
21238    /// let x = SecurityProfileGroup::new().set_or_clear_update_time(None::<Timestamp>);
21239    /// ```
21240    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21241    where
21242        T: std::convert::Into<wkt::Timestamp>,
21243    {
21244        self.update_time = v.map(|x| x.into());
21245        self
21246    }
21247
21248    /// Sets the value of [etag][crate::model::SecurityProfileGroup::etag].
21249    ///
21250    /// # Example
21251    /// ```ignore,no_run
21252    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21253    /// let x = SecurityProfileGroup::new().set_etag("example");
21254    /// ```
21255    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21256        self.etag = v.into();
21257        self
21258    }
21259
21260    /// Sets the value of [data_path_id][crate::model::SecurityProfileGroup::data_path_id].
21261    ///
21262    /// # Example
21263    /// ```ignore,no_run
21264    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21265    /// let x = SecurityProfileGroup::new().set_data_path_id(42_u32);
21266    /// ```
21267    pub fn set_data_path_id<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
21268        self.data_path_id = v.into();
21269        self
21270    }
21271
21272    /// Sets the value of [labels][crate::model::SecurityProfileGroup::labels].
21273    ///
21274    /// # Example
21275    /// ```ignore,no_run
21276    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21277    /// let x = SecurityProfileGroup::new().set_labels([
21278    ///     ("key0", "abc"),
21279    ///     ("key1", "xyz"),
21280    /// ]);
21281    /// ```
21282    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
21283    where
21284        T: std::iter::IntoIterator<Item = (K, V)>,
21285        K: std::convert::Into<std::string::String>,
21286        V: std::convert::Into<std::string::String>,
21287    {
21288        use std::iter::Iterator;
21289        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21290        self
21291    }
21292
21293    /// Sets the value of [threat_prevention_profile][crate::model::SecurityProfileGroup::threat_prevention_profile].
21294    ///
21295    /// # Example
21296    /// ```ignore,no_run
21297    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21298    /// # let organization_id = "organization_id";
21299    /// # let location_id = "location_id";
21300    /// # let security_profile_id = "security_profile_id";
21301    /// let x = SecurityProfileGroup::new().set_threat_prevention_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21302    /// ```
21303    pub fn set_threat_prevention_profile<T: std::convert::Into<std::string::String>>(
21304        mut self,
21305        v: T,
21306    ) -> Self {
21307        self.threat_prevention_profile = v.into();
21308        self
21309    }
21310
21311    /// Sets the value of [custom_mirroring_profile][crate::model::SecurityProfileGroup::custom_mirroring_profile].
21312    ///
21313    /// # Example
21314    /// ```ignore,no_run
21315    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21316    /// # let organization_id = "organization_id";
21317    /// # let location_id = "location_id";
21318    /// # let security_profile_id = "security_profile_id";
21319    /// let x = SecurityProfileGroup::new().set_custom_mirroring_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21320    /// ```
21321    pub fn set_custom_mirroring_profile<T: std::convert::Into<std::string::String>>(
21322        mut self,
21323        v: T,
21324    ) -> Self {
21325        self.custom_mirroring_profile = v.into();
21326        self
21327    }
21328
21329    /// Sets the value of [custom_intercept_profile][crate::model::SecurityProfileGroup::custom_intercept_profile].
21330    ///
21331    /// # Example
21332    /// ```ignore,no_run
21333    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21334    /// # let organization_id = "organization_id";
21335    /// # let location_id = "location_id";
21336    /// # let security_profile_id = "security_profile_id";
21337    /// let x = SecurityProfileGroup::new().set_custom_intercept_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21338    /// ```
21339    pub fn set_custom_intercept_profile<T: std::convert::Into<std::string::String>>(
21340        mut self,
21341        v: T,
21342    ) -> Self {
21343        self.custom_intercept_profile = v.into();
21344        self
21345    }
21346
21347    /// Sets the value of [url_filtering_profile][crate::model::SecurityProfileGroup::url_filtering_profile].
21348    ///
21349    /// # Example
21350    /// ```ignore,no_run
21351    /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21352    /// # let organization_id = "organization_id";
21353    /// # let location_id = "location_id";
21354    /// # let security_profile_id = "security_profile_id";
21355    /// let x = SecurityProfileGroup::new().set_url_filtering_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21356    /// ```
21357    pub fn set_url_filtering_profile<T: std::convert::Into<std::string::String>>(
21358        mut self,
21359        v: T,
21360    ) -> Self {
21361        self.url_filtering_profile = v.into();
21362        self
21363    }
21364}
21365
21366impl wkt::message::Message for SecurityProfileGroup {
21367    fn typename() -> &'static str {
21368        "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfileGroup"
21369    }
21370}
21371
21372/// SecurityProfile is a resource that defines the behavior for one of many
21373/// ProfileTypes.
21374#[derive(Clone, Default, PartialEq)]
21375#[non_exhaustive]
21376pub struct SecurityProfile {
21377    /// Immutable. Identifier. Name of the SecurityProfile resource. It matches
21378    /// pattern
21379    /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile}`.
21380    pub name: std::string::String,
21381
21382    /// Optional. An optional description of the profile. Max length 512
21383    /// characters.
21384    pub description: std::string::String,
21385
21386    /// Output only. Resource creation timestamp.
21387    pub create_time: std::option::Option<wkt::Timestamp>,
21388
21389    /// Output only. Last resource update timestamp.
21390    pub update_time: std::option::Option<wkt::Timestamp>,
21391
21392    /// Output only. This checksum is computed by the server based on the value of
21393    /// other fields, and may be sent on update and delete requests to ensure the
21394    /// client has an up-to-date value before proceeding.
21395    pub etag: std::string::String,
21396
21397    /// Optional. Labels as key value pairs.
21398    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
21399
21400    /// Immutable. The single ProfileType that the SecurityProfile resource
21401    /// configures.
21402    pub r#type: crate::model::security_profile::ProfileType,
21403
21404    /// The behavior for the ProfileType that the SecurityProfile resource is meant
21405    /// to configure. This field must correspond to the ProfileType of the
21406    /// SecurityProfile.
21407    pub profile: std::option::Option<crate::model::security_profile::Profile>,
21408
21409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21410}
21411
21412impl SecurityProfile {
21413    /// Creates a new default instance.
21414    pub fn new() -> Self {
21415        std::default::Default::default()
21416    }
21417
21418    /// Sets the value of [name][crate::model::SecurityProfile::name].
21419    ///
21420    /// # Example
21421    /// ```ignore,no_run
21422    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21423    /// # let organization_id = "organization_id";
21424    /// # let location_id = "location_id";
21425    /// # let security_profile_id = "security_profile_id";
21426    /// let x = SecurityProfile::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21427    /// ```
21428    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21429        self.name = v.into();
21430        self
21431    }
21432
21433    /// Sets the value of [description][crate::model::SecurityProfile::description].
21434    ///
21435    /// # Example
21436    /// ```ignore,no_run
21437    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21438    /// let x = SecurityProfile::new().set_description("example");
21439    /// ```
21440    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21441        self.description = v.into();
21442        self
21443    }
21444
21445    /// Sets the value of [create_time][crate::model::SecurityProfile::create_time].
21446    ///
21447    /// # Example
21448    /// ```ignore,no_run
21449    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21450    /// use wkt::Timestamp;
21451    /// let x = SecurityProfile::new().set_create_time(Timestamp::default()/* use setters */);
21452    /// ```
21453    pub fn set_create_time<T>(mut self, v: T) -> Self
21454    where
21455        T: std::convert::Into<wkt::Timestamp>,
21456    {
21457        self.create_time = std::option::Option::Some(v.into());
21458        self
21459    }
21460
21461    /// Sets or clears the value of [create_time][crate::model::SecurityProfile::create_time].
21462    ///
21463    /// # Example
21464    /// ```ignore,no_run
21465    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21466    /// use wkt::Timestamp;
21467    /// let x = SecurityProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21468    /// let x = SecurityProfile::new().set_or_clear_create_time(None::<Timestamp>);
21469    /// ```
21470    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21471    where
21472        T: std::convert::Into<wkt::Timestamp>,
21473    {
21474        self.create_time = v.map(|x| x.into());
21475        self
21476    }
21477
21478    /// Sets the value of [update_time][crate::model::SecurityProfile::update_time].
21479    ///
21480    /// # Example
21481    /// ```ignore,no_run
21482    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21483    /// use wkt::Timestamp;
21484    /// let x = SecurityProfile::new().set_update_time(Timestamp::default()/* use setters */);
21485    /// ```
21486    pub fn set_update_time<T>(mut self, v: T) -> Self
21487    where
21488        T: std::convert::Into<wkt::Timestamp>,
21489    {
21490        self.update_time = std::option::Option::Some(v.into());
21491        self
21492    }
21493
21494    /// Sets or clears the value of [update_time][crate::model::SecurityProfile::update_time].
21495    ///
21496    /// # Example
21497    /// ```ignore,no_run
21498    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21499    /// use wkt::Timestamp;
21500    /// let x = SecurityProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
21501    /// let x = SecurityProfile::new().set_or_clear_update_time(None::<Timestamp>);
21502    /// ```
21503    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21504    where
21505        T: std::convert::Into<wkt::Timestamp>,
21506    {
21507        self.update_time = v.map(|x| x.into());
21508        self
21509    }
21510
21511    /// Sets the value of [etag][crate::model::SecurityProfile::etag].
21512    ///
21513    /// # Example
21514    /// ```ignore,no_run
21515    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21516    /// let x = SecurityProfile::new().set_etag("example");
21517    /// ```
21518    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21519        self.etag = v.into();
21520        self
21521    }
21522
21523    /// Sets the value of [labels][crate::model::SecurityProfile::labels].
21524    ///
21525    /// # Example
21526    /// ```ignore,no_run
21527    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21528    /// let x = SecurityProfile::new().set_labels([
21529    ///     ("key0", "abc"),
21530    ///     ("key1", "xyz"),
21531    /// ]);
21532    /// ```
21533    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
21534    where
21535        T: std::iter::IntoIterator<Item = (K, V)>,
21536        K: std::convert::Into<std::string::String>,
21537        V: std::convert::Into<std::string::String>,
21538    {
21539        use std::iter::Iterator;
21540        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21541        self
21542    }
21543
21544    /// Sets the value of [r#type][crate::model::SecurityProfile::type].
21545    ///
21546    /// # Example
21547    /// ```ignore,no_run
21548    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21549    /// use google_cloud_networksecurity_v1::model::security_profile::ProfileType;
21550    /// let x0 = SecurityProfile::new().set_type(ProfileType::ThreatPrevention);
21551    /// let x1 = SecurityProfile::new().set_type(ProfileType::CustomMirroring);
21552    /// let x2 = SecurityProfile::new().set_type(ProfileType::CustomIntercept);
21553    /// ```
21554    pub fn set_type<T: std::convert::Into<crate::model::security_profile::ProfileType>>(
21555        mut self,
21556        v: T,
21557    ) -> Self {
21558        self.r#type = v.into();
21559        self
21560    }
21561
21562    /// Sets the value of [profile][crate::model::SecurityProfile::profile].
21563    ///
21564    /// Note that all the setters affecting `profile` are mutually
21565    /// exclusive.
21566    ///
21567    /// # Example
21568    /// ```ignore,no_run
21569    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21570    /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21571    /// let x = SecurityProfile::new().set_profile(Some(
21572    ///     google_cloud_networksecurity_v1::model::security_profile::Profile::ThreatPreventionProfile(ThreatPreventionProfile::default().into())));
21573    /// ```
21574    pub fn set_profile<
21575        T: std::convert::Into<std::option::Option<crate::model::security_profile::Profile>>,
21576    >(
21577        mut self,
21578        v: T,
21579    ) -> Self {
21580        self.profile = v.into();
21581        self
21582    }
21583
21584    /// The value of [profile][crate::model::SecurityProfile::profile]
21585    /// if it holds a `ThreatPreventionProfile`, `None` if the field is not set or
21586    /// holds a different branch.
21587    pub fn threat_prevention_profile(
21588        &self,
21589    ) -> std::option::Option<&std::boxed::Box<crate::model::ThreatPreventionProfile>> {
21590        #[allow(unreachable_patterns)]
21591        self.profile.as_ref().and_then(|v| match v {
21592            crate::model::security_profile::Profile::ThreatPreventionProfile(v) => {
21593                std::option::Option::Some(v)
21594            }
21595            _ => std::option::Option::None,
21596        })
21597    }
21598
21599    /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21600    /// to hold a `ThreatPreventionProfile`.
21601    ///
21602    /// Note that all the setters affecting `profile` are
21603    /// mutually exclusive.
21604    ///
21605    /// # Example
21606    /// ```ignore,no_run
21607    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21608    /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21609    /// let x = SecurityProfile::new().set_threat_prevention_profile(ThreatPreventionProfile::default()/* use setters */);
21610    /// assert!(x.threat_prevention_profile().is_some());
21611    /// assert!(x.custom_mirroring_profile().is_none());
21612    /// assert!(x.custom_intercept_profile().is_none());
21613    /// assert!(x.url_filtering_profile().is_none());
21614    /// ```
21615    pub fn set_threat_prevention_profile<
21616        T: std::convert::Into<std::boxed::Box<crate::model::ThreatPreventionProfile>>,
21617    >(
21618        mut self,
21619        v: T,
21620    ) -> Self {
21621        self.profile = std::option::Option::Some(
21622            crate::model::security_profile::Profile::ThreatPreventionProfile(v.into()),
21623        );
21624        self
21625    }
21626
21627    /// The value of [profile][crate::model::SecurityProfile::profile]
21628    /// if it holds a `CustomMirroringProfile`, `None` if the field is not set or
21629    /// holds a different branch.
21630    pub fn custom_mirroring_profile(
21631        &self,
21632    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomMirroringProfile>> {
21633        #[allow(unreachable_patterns)]
21634        self.profile.as_ref().and_then(|v| match v {
21635            crate::model::security_profile::Profile::CustomMirroringProfile(v) => {
21636                std::option::Option::Some(v)
21637            }
21638            _ => std::option::Option::None,
21639        })
21640    }
21641
21642    /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21643    /// to hold a `CustomMirroringProfile`.
21644    ///
21645    /// Note that all the setters affecting `profile` are
21646    /// mutually exclusive.
21647    ///
21648    /// # Example
21649    /// ```ignore,no_run
21650    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21651    /// use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21652    /// let x = SecurityProfile::new().set_custom_mirroring_profile(CustomMirroringProfile::default()/* use setters */);
21653    /// assert!(x.custom_mirroring_profile().is_some());
21654    /// assert!(x.threat_prevention_profile().is_none());
21655    /// assert!(x.custom_intercept_profile().is_none());
21656    /// assert!(x.url_filtering_profile().is_none());
21657    /// ```
21658    pub fn set_custom_mirroring_profile<
21659        T: std::convert::Into<std::boxed::Box<crate::model::CustomMirroringProfile>>,
21660    >(
21661        mut self,
21662        v: T,
21663    ) -> Self {
21664        self.profile = std::option::Option::Some(
21665            crate::model::security_profile::Profile::CustomMirroringProfile(v.into()),
21666        );
21667        self
21668    }
21669
21670    /// The value of [profile][crate::model::SecurityProfile::profile]
21671    /// if it holds a `CustomInterceptProfile`, `None` if the field is not set or
21672    /// holds a different branch.
21673    pub fn custom_intercept_profile(
21674        &self,
21675    ) -> std::option::Option<&std::boxed::Box<crate::model::CustomInterceptProfile>> {
21676        #[allow(unreachable_patterns)]
21677        self.profile.as_ref().and_then(|v| match v {
21678            crate::model::security_profile::Profile::CustomInterceptProfile(v) => {
21679                std::option::Option::Some(v)
21680            }
21681            _ => std::option::Option::None,
21682        })
21683    }
21684
21685    /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21686    /// to hold a `CustomInterceptProfile`.
21687    ///
21688    /// Note that all the setters affecting `profile` are
21689    /// mutually exclusive.
21690    ///
21691    /// # Example
21692    /// ```ignore,no_run
21693    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21694    /// use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21695    /// let x = SecurityProfile::new().set_custom_intercept_profile(CustomInterceptProfile::default()/* use setters */);
21696    /// assert!(x.custom_intercept_profile().is_some());
21697    /// assert!(x.threat_prevention_profile().is_none());
21698    /// assert!(x.custom_mirroring_profile().is_none());
21699    /// assert!(x.url_filtering_profile().is_none());
21700    /// ```
21701    pub fn set_custom_intercept_profile<
21702        T: std::convert::Into<std::boxed::Box<crate::model::CustomInterceptProfile>>,
21703    >(
21704        mut self,
21705        v: T,
21706    ) -> Self {
21707        self.profile = std::option::Option::Some(
21708            crate::model::security_profile::Profile::CustomInterceptProfile(v.into()),
21709        );
21710        self
21711    }
21712
21713    /// The value of [profile][crate::model::SecurityProfile::profile]
21714    /// if it holds a `UrlFilteringProfile`, `None` if the field is not set or
21715    /// holds a different branch.
21716    pub fn url_filtering_profile(
21717        &self,
21718    ) -> std::option::Option<&std::boxed::Box<crate::model::UrlFilteringProfile>> {
21719        #[allow(unreachable_patterns)]
21720        self.profile.as_ref().and_then(|v| match v {
21721            crate::model::security_profile::Profile::UrlFilteringProfile(v) => {
21722                std::option::Option::Some(v)
21723            }
21724            _ => std::option::Option::None,
21725        })
21726    }
21727
21728    /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21729    /// to hold a `UrlFilteringProfile`.
21730    ///
21731    /// Note that all the setters affecting `profile` are
21732    /// mutually exclusive.
21733    ///
21734    /// # Example
21735    /// ```ignore,no_run
21736    /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21737    /// use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
21738    /// let x = SecurityProfile::new().set_url_filtering_profile(UrlFilteringProfile::default()/* use setters */);
21739    /// assert!(x.url_filtering_profile().is_some());
21740    /// assert!(x.threat_prevention_profile().is_none());
21741    /// assert!(x.custom_mirroring_profile().is_none());
21742    /// assert!(x.custom_intercept_profile().is_none());
21743    /// ```
21744    pub fn set_url_filtering_profile<
21745        T: std::convert::Into<std::boxed::Box<crate::model::UrlFilteringProfile>>,
21746    >(
21747        mut self,
21748        v: T,
21749    ) -> Self {
21750        self.profile = std::option::Option::Some(
21751            crate::model::security_profile::Profile::UrlFilteringProfile(v.into()),
21752        );
21753        self
21754    }
21755}
21756
21757impl wkt::message::Message for SecurityProfile {
21758    fn typename() -> &'static str {
21759        "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfile"
21760    }
21761}
21762
21763/// Defines additional types related to [SecurityProfile].
21764pub mod security_profile {
21765    #[allow(unused_imports)]
21766    use super::*;
21767
21768    /// The possible types that the SecurityProfile resource can configure.
21769    ///
21770    /// # Working with unknown values
21771    ///
21772    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21773    /// additional enum variants at any time. Adding new variants is not considered
21774    /// a breaking change. Applications should write their code in anticipation of:
21775    ///
21776    /// - New values appearing in future releases of the client library, **and**
21777    /// - New values received dynamically, without application changes.
21778    ///
21779    /// Please consult the [Working with enums] section in the user guide for some
21780    /// guidelines.
21781    ///
21782    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21783    #[derive(Clone, Debug, PartialEq)]
21784    #[non_exhaustive]
21785    pub enum ProfileType {
21786        /// Profile type not specified.
21787        Unspecified,
21788        /// Profile type for threat prevention.
21789        ThreatPrevention,
21790        /// Profile type for packet mirroring v2
21791        CustomMirroring,
21792        /// Profile type for TPPI.
21793        CustomIntercept,
21794        /// Profile type for URL filtering.
21795        UrlFiltering,
21796        /// If set, the enum was initialized with an unknown value.
21797        ///
21798        /// Applications can examine the value using [ProfileType::value] or
21799        /// [ProfileType::name].
21800        UnknownValue(profile_type::UnknownValue),
21801    }
21802
21803    #[doc(hidden)]
21804    pub mod profile_type {
21805        #[allow(unused_imports)]
21806        use super::*;
21807        #[derive(Clone, Debug, PartialEq)]
21808        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21809    }
21810
21811    impl ProfileType {
21812        /// Gets the enum value.
21813        ///
21814        /// Returns `None` if the enum contains an unknown value deserialized from
21815        /// the string representation of enums.
21816        pub fn value(&self) -> std::option::Option<i32> {
21817            match self {
21818                Self::Unspecified => std::option::Option::Some(0),
21819                Self::ThreatPrevention => std::option::Option::Some(1),
21820                Self::CustomMirroring => std::option::Option::Some(2),
21821                Self::CustomIntercept => std::option::Option::Some(3),
21822                Self::UrlFiltering => std::option::Option::Some(5),
21823                Self::UnknownValue(u) => u.0.value(),
21824            }
21825        }
21826
21827        /// Gets the enum value as a string.
21828        ///
21829        /// Returns `None` if the enum contains an unknown value deserialized from
21830        /// the integer representation of enums.
21831        pub fn name(&self) -> std::option::Option<&str> {
21832            match self {
21833                Self::Unspecified => std::option::Option::Some("PROFILE_TYPE_UNSPECIFIED"),
21834                Self::ThreatPrevention => std::option::Option::Some("THREAT_PREVENTION"),
21835                Self::CustomMirroring => std::option::Option::Some("CUSTOM_MIRRORING"),
21836                Self::CustomIntercept => std::option::Option::Some("CUSTOM_INTERCEPT"),
21837                Self::UrlFiltering => std::option::Option::Some("URL_FILTERING"),
21838                Self::UnknownValue(u) => u.0.name(),
21839            }
21840        }
21841    }
21842
21843    impl std::default::Default for ProfileType {
21844        fn default() -> Self {
21845            use std::convert::From;
21846            Self::from(0)
21847        }
21848    }
21849
21850    impl std::fmt::Display for ProfileType {
21851        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21852            wkt::internal::display_enum(f, self.name(), self.value())
21853        }
21854    }
21855
21856    impl std::convert::From<i32> for ProfileType {
21857        fn from(value: i32) -> Self {
21858            match value {
21859                0 => Self::Unspecified,
21860                1 => Self::ThreatPrevention,
21861                2 => Self::CustomMirroring,
21862                3 => Self::CustomIntercept,
21863                5 => Self::UrlFiltering,
21864                _ => Self::UnknownValue(profile_type::UnknownValue(
21865                    wkt::internal::UnknownEnumValue::Integer(value),
21866                )),
21867            }
21868        }
21869    }
21870
21871    impl std::convert::From<&str> for ProfileType {
21872        fn from(value: &str) -> Self {
21873            use std::string::ToString;
21874            match value {
21875                "PROFILE_TYPE_UNSPECIFIED" => Self::Unspecified,
21876                "THREAT_PREVENTION" => Self::ThreatPrevention,
21877                "CUSTOM_MIRRORING" => Self::CustomMirroring,
21878                "CUSTOM_INTERCEPT" => Self::CustomIntercept,
21879                "URL_FILTERING" => Self::UrlFiltering,
21880                _ => Self::UnknownValue(profile_type::UnknownValue(
21881                    wkt::internal::UnknownEnumValue::String(value.to_string()),
21882                )),
21883            }
21884        }
21885    }
21886
21887    impl serde::ser::Serialize for ProfileType {
21888        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21889        where
21890            S: serde::Serializer,
21891        {
21892            match self {
21893                Self::Unspecified => serializer.serialize_i32(0),
21894                Self::ThreatPrevention => serializer.serialize_i32(1),
21895                Self::CustomMirroring => serializer.serialize_i32(2),
21896                Self::CustomIntercept => serializer.serialize_i32(3),
21897                Self::UrlFiltering => serializer.serialize_i32(5),
21898                Self::UnknownValue(u) => u.0.serialize(serializer),
21899            }
21900        }
21901    }
21902
21903    impl<'de> serde::de::Deserialize<'de> for ProfileType {
21904        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21905        where
21906            D: serde::Deserializer<'de>,
21907        {
21908            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProfileType>::new(
21909                ".google.cloud.networksecurity.v1.SecurityProfile.ProfileType",
21910            ))
21911        }
21912    }
21913
21914    /// The behavior for the ProfileType that the SecurityProfile resource is meant
21915    /// to configure. This field must correspond to the ProfileType of the
21916    /// SecurityProfile.
21917    #[derive(Clone, Debug, PartialEq)]
21918    #[non_exhaustive]
21919    pub enum Profile {
21920        /// The threat prevention configuration for the SecurityProfile.
21921        ThreatPreventionProfile(std::boxed::Box<crate::model::ThreatPreventionProfile>),
21922        /// The custom Packet Mirroring v2 configuration for the SecurityProfile.
21923        CustomMirroringProfile(std::boxed::Box<crate::model::CustomMirroringProfile>),
21924        /// The custom TPPI configuration for the SecurityProfile.
21925        CustomInterceptProfile(std::boxed::Box<crate::model::CustomInterceptProfile>),
21926        /// The URL filtering configuration for the SecurityProfile.
21927        UrlFilteringProfile(std::boxed::Box<crate::model::UrlFilteringProfile>),
21928    }
21929}
21930
21931/// CustomInterceptProfile defines in-band integration behavior (intercept).
21932/// It is used by firewall rules with an APPLY_SECURITY_PROFILE_GROUP action.
21933#[derive(Clone, Default, PartialEq)]
21934#[non_exhaustive]
21935pub struct CustomInterceptProfile {
21936    /// Required. The target InterceptEndpointGroup.
21937    /// When a firewall rule with this security profile attached matches a packet,
21938    /// the packet will be intercepted to the location-local target in this group.
21939    pub intercept_endpoint_group: std::string::String,
21940
21941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21942}
21943
21944impl CustomInterceptProfile {
21945    /// Creates a new default instance.
21946    pub fn new() -> Self {
21947        std::default::Default::default()
21948    }
21949
21950    /// Sets the value of [intercept_endpoint_group][crate::model::CustomInterceptProfile::intercept_endpoint_group].
21951    ///
21952    /// # Example
21953    /// ```ignore,no_run
21954    /// # use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21955    /// # let project_id = "project_id";
21956    /// # let location_id = "location_id";
21957    /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
21958    /// let x = CustomInterceptProfile::new().set_intercept_endpoint_group(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
21959    /// ```
21960    pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
21961        mut self,
21962        v: T,
21963    ) -> Self {
21964        self.intercept_endpoint_group = v.into();
21965        self
21966    }
21967}
21968
21969impl wkt::message::Message for CustomInterceptProfile {
21970    fn typename() -> &'static str {
21971        "type.googleapis.com/google.cloud.networksecurity.v1.CustomInterceptProfile"
21972    }
21973}
21974
21975/// CustomMirroringProfile defines out-of-band integration behavior (mirroring).
21976/// It is used by mirroring rules with a MIRROR action.
21977#[derive(Clone, Default, PartialEq)]
21978#[non_exhaustive]
21979pub struct CustomMirroringProfile {
21980    /// Required. Immutable. The target MirroringEndpointGroup.
21981    /// When a mirroring rule with this security profile attached matches a packet,
21982    /// a replica will be mirrored to the location-local target in this group.
21983    pub mirroring_endpoint_group: std::string::String,
21984
21985    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21986}
21987
21988impl CustomMirroringProfile {
21989    /// Creates a new default instance.
21990    pub fn new() -> Self {
21991        std::default::Default::default()
21992    }
21993
21994    /// Sets the value of [mirroring_endpoint_group][crate::model::CustomMirroringProfile::mirroring_endpoint_group].
21995    ///
21996    /// # Example
21997    /// ```ignore,no_run
21998    /// # use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21999    /// # let project_id = "project_id";
22000    /// # let location_id = "location_id";
22001    /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
22002    /// let x = CustomMirroringProfile::new().set_mirroring_endpoint_group(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
22003    /// ```
22004    pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
22005        mut self,
22006        v: T,
22007    ) -> Self {
22008        self.mirroring_endpoint_group = v.into();
22009        self
22010    }
22011}
22012
22013impl wkt::message::Message for CustomMirroringProfile {
22014    fn typename() -> &'static str {
22015        "type.googleapis.com/google.cloud.networksecurity.v1.CustomMirroringProfile"
22016    }
22017}
22018
22019/// Request used with the ListSecurityProfileGroups method.
22020#[derive(Clone, Default, PartialEq)]
22021#[non_exhaustive]
22022pub struct ListSecurityProfileGroupsRequest {
22023    /// Required. The project or organization and location from which the
22024    /// SecurityProfileGroups should be listed, specified in the format
22025    /// `projects|organizations/*/locations/{location}`.
22026    pub parent: std::string::String,
22027
22028    /// Optional. Maximum number of SecurityProfileGroups to return per call.
22029    pub page_size: i32,
22030
22031    /// Optional. The value returned by the last
22032    /// `ListSecurityProfileGroupsResponse` Indicates that this is a
22033    /// continuation of a prior `ListSecurityProfileGroups` call, and
22034    /// that the system should return the next page of data.
22035    pub page_token: std::string::String,
22036
22037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22038}
22039
22040impl ListSecurityProfileGroupsRequest {
22041    /// Creates a new default instance.
22042    pub fn new() -> Self {
22043        std::default::Default::default()
22044    }
22045
22046    /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
22047    ///
22048    /// # Example
22049    /// ```ignore,no_run
22050    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22051    /// # let organization_id = "organization_id";
22052    /// # let location_id = "location_id";
22053    /// let x = ListSecurityProfileGroupsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22054    /// ```
22055    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22056        self.parent = v.into();
22057        self
22058    }
22059
22060    /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
22061    ///
22062    /// # Example
22063    /// ```ignore,no_run
22064    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22065    /// let x = ListSecurityProfileGroupsRequest::new().set_page_size(42);
22066    /// ```
22067    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22068        self.page_size = v.into();
22069        self
22070    }
22071
22072    /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
22073    ///
22074    /// # Example
22075    /// ```ignore,no_run
22076    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22077    /// let x = ListSecurityProfileGroupsRequest::new().set_page_token("example");
22078    /// ```
22079    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22080        self.page_token = v.into();
22081        self
22082    }
22083}
22084
22085impl wkt::message::Message for ListSecurityProfileGroupsRequest {
22086    fn typename() -> &'static str {
22087        "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest"
22088    }
22089}
22090
22091/// Response returned by the ListSecurityProfileGroups method.
22092#[derive(Clone, Default, PartialEq)]
22093#[non_exhaustive]
22094pub struct ListSecurityProfileGroupsResponse {
22095    /// List of SecurityProfileGroups resources.
22096    pub security_profile_groups: std::vec::Vec<crate::model::SecurityProfileGroup>,
22097
22098    /// If there might be more results than those appearing in this response, then
22099    /// `next_page_token` is included. To get the next set of results, call this
22100    /// method again using the value of `next_page_token` as `page_token`.
22101    pub next_page_token: std::string::String,
22102
22103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22104}
22105
22106impl ListSecurityProfileGroupsResponse {
22107    /// Creates a new default instance.
22108    pub fn new() -> Self {
22109        std::default::Default::default()
22110    }
22111
22112    /// Sets the value of [security_profile_groups][crate::model::ListSecurityProfileGroupsResponse::security_profile_groups].
22113    ///
22114    /// # Example
22115    /// ```ignore,no_run
22116    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
22117    /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22118    /// let x = ListSecurityProfileGroupsResponse::new()
22119    ///     .set_security_profile_groups([
22120    ///         SecurityProfileGroup::default()/* use setters */,
22121    ///         SecurityProfileGroup::default()/* use (different) setters */,
22122    ///     ]);
22123    /// ```
22124    pub fn set_security_profile_groups<T, V>(mut self, v: T) -> Self
22125    where
22126        T: std::iter::IntoIterator<Item = V>,
22127        V: std::convert::Into<crate::model::SecurityProfileGroup>,
22128    {
22129        use std::iter::Iterator;
22130        self.security_profile_groups = v.into_iter().map(|i| i.into()).collect();
22131        self
22132    }
22133
22134    /// Sets the value of [next_page_token][crate::model::ListSecurityProfileGroupsResponse::next_page_token].
22135    ///
22136    /// # Example
22137    /// ```ignore,no_run
22138    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
22139    /// let x = ListSecurityProfileGroupsResponse::new().set_next_page_token("example");
22140    /// ```
22141    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22142        self.next_page_token = v.into();
22143        self
22144    }
22145}
22146
22147impl wkt::message::Message for ListSecurityProfileGroupsResponse {
22148    fn typename() -> &'static str {
22149        "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse"
22150    }
22151}
22152
22153#[doc(hidden)]
22154impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfileGroupsResponse {
22155    type PageItem = crate::model::SecurityProfileGroup;
22156
22157    fn items(self) -> std::vec::Vec<Self::PageItem> {
22158        self.security_profile_groups
22159    }
22160
22161    fn next_page_token(&self) -> std::string::String {
22162        use std::clone::Clone;
22163        self.next_page_token.clone()
22164    }
22165}
22166
22167/// Request used by the GetSecurityProfileGroup method.
22168#[derive(Clone, Default, PartialEq)]
22169#[non_exhaustive]
22170pub struct GetSecurityProfileGroupRequest {
22171    /// Required. A name of the SecurityProfileGroup to get. Must be in the format
22172    /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
22173    pub name: std::string::String,
22174
22175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22176}
22177
22178impl GetSecurityProfileGroupRequest {
22179    /// Creates a new default instance.
22180    pub fn new() -> Self {
22181        std::default::Default::default()
22182    }
22183
22184    /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
22185    ///
22186    /// # Example
22187    /// ```ignore,no_run
22188    /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileGroupRequest;
22189    /// # let organization_id = "organization_id";
22190    /// # let location_id = "location_id";
22191    /// # let security_profile_group_id = "security_profile_group_id";
22192    /// let x = GetSecurityProfileGroupRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
22193    /// ```
22194    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22195        self.name = v.into();
22196        self
22197    }
22198}
22199
22200impl wkt::message::Message for GetSecurityProfileGroupRequest {
22201    fn typename() -> &'static str {
22202        "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest"
22203    }
22204}
22205
22206/// Request used by the CreateSecurityProfileGroup method.
22207#[derive(Clone, Default, PartialEq)]
22208#[non_exhaustive]
22209pub struct CreateSecurityProfileGroupRequest {
22210    /// Required. The parent resource of the SecurityProfileGroup. Must be in the
22211    /// format `projects|organizations/*/locations/{location}`.
22212    pub parent: std::string::String,
22213
22214    /// Required. Short name of the SecurityProfileGroup resource to be created.
22215    /// This value should be 1-63 characters long, containing only
22216    /// letters, numbers, hyphens, and underscores, and should not start
22217    /// with a number. E.g. "security_profile_group1".
22218    pub security_profile_group_id: std::string::String,
22219
22220    /// Required. SecurityProfileGroup resource to be created.
22221    pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
22222
22223    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22224}
22225
22226impl CreateSecurityProfileGroupRequest {
22227    /// Creates a new default instance.
22228    pub fn new() -> Self {
22229        std::default::Default::default()
22230    }
22231
22232    /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
22233    ///
22234    /// # Example
22235    /// ```ignore,no_run
22236    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22237    /// # let organization_id = "organization_id";
22238    /// # let location_id = "location_id";
22239    /// let x = CreateSecurityProfileGroupRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22240    /// ```
22241    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22242        self.parent = v.into();
22243        self
22244    }
22245
22246    /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
22247    ///
22248    /// # Example
22249    /// ```ignore,no_run
22250    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22251    /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group_id("example");
22252    /// ```
22253    pub fn set_security_profile_group_id<T: std::convert::Into<std::string::String>>(
22254        mut self,
22255        v: T,
22256    ) -> Self {
22257        self.security_profile_group_id = v.into();
22258        self
22259    }
22260
22261    /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22262    ///
22263    /// # Example
22264    /// ```ignore,no_run
22265    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22266    /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22267    /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
22268    /// ```
22269    pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22270    where
22271        T: std::convert::Into<crate::model::SecurityProfileGroup>,
22272    {
22273        self.security_profile_group = std::option::Option::Some(v.into());
22274        self
22275    }
22276
22277    /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22278    ///
22279    /// # Example
22280    /// ```ignore,no_run
22281    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22282    /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22283    /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
22284    /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
22285    /// ```
22286    pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22287    where
22288        T: std::convert::Into<crate::model::SecurityProfileGroup>,
22289    {
22290        self.security_profile_group = v.map(|x| x.into());
22291        self
22292    }
22293}
22294
22295impl wkt::message::Message for CreateSecurityProfileGroupRequest {
22296    fn typename() -> &'static str {
22297        "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest"
22298    }
22299}
22300
22301/// Request used by the UpdateSecurityProfileGroup method.
22302#[derive(Clone, Default, PartialEq)]
22303#[non_exhaustive]
22304pub struct UpdateSecurityProfileGroupRequest {
22305    /// Required. Field mask is used to specify the fields to be overwritten in the
22306    /// SecurityProfileGroup resource by the update.
22307    /// The fields specified in the update_mask are relative to the resource, not
22308    /// the full request. A field will be overwritten if it is in the mask.
22309    pub update_mask: std::option::Option<wkt::FieldMask>,
22310
22311    /// Required. Updated SecurityProfileGroup resource.
22312    pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
22313
22314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22315}
22316
22317impl UpdateSecurityProfileGroupRequest {
22318    /// Creates a new default instance.
22319    pub fn new() -> Self {
22320        std::default::Default::default()
22321    }
22322
22323    /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22324    ///
22325    /// # Example
22326    /// ```ignore,no_run
22327    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22328    /// use wkt::FieldMask;
22329    /// let x = UpdateSecurityProfileGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22330    /// ```
22331    pub fn set_update_mask<T>(mut self, v: T) -> Self
22332    where
22333        T: std::convert::Into<wkt::FieldMask>,
22334    {
22335        self.update_mask = std::option::Option::Some(v.into());
22336        self
22337    }
22338
22339    /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22340    ///
22341    /// # Example
22342    /// ```ignore,no_run
22343    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22344    /// use wkt::FieldMask;
22345    /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22346    /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22347    /// ```
22348    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22349    where
22350        T: std::convert::Into<wkt::FieldMask>,
22351    {
22352        self.update_mask = v.map(|x| x.into());
22353        self
22354    }
22355
22356    /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22357    ///
22358    /// # Example
22359    /// ```ignore,no_run
22360    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22361    /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22362    /// let x = UpdateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
22363    /// ```
22364    pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22365    where
22366        T: std::convert::Into<crate::model::SecurityProfileGroup>,
22367    {
22368        self.security_profile_group = std::option::Option::Some(v.into());
22369        self
22370    }
22371
22372    /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22373    ///
22374    /// # Example
22375    /// ```ignore,no_run
22376    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22377    /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22378    /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
22379    /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
22380    /// ```
22381    pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22382    where
22383        T: std::convert::Into<crate::model::SecurityProfileGroup>,
22384    {
22385        self.security_profile_group = v.map(|x| x.into());
22386        self
22387    }
22388}
22389
22390impl wkt::message::Message for UpdateSecurityProfileGroupRequest {
22391    fn typename() -> &'static str {
22392        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest"
22393    }
22394}
22395
22396/// Request used by the DeleteSecurityProfileGroup method.
22397#[derive(Clone, Default, PartialEq)]
22398#[non_exhaustive]
22399pub struct DeleteSecurityProfileGroupRequest {
22400    /// Required. A name of the SecurityProfileGroup to delete. Must be in the
22401    /// format
22402    /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
22403    pub name: std::string::String,
22404
22405    /// Optional. If client provided etag is out of date, delete will return
22406    /// FAILED_PRECONDITION error.
22407    pub etag: std::string::String,
22408
22409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22410}
22411
22412impl DeleteSecurityProfileGroupRequest {
22413    /// Creates a new default instance.
22414    pub fn new() -> Self {
22415        std::default::Default::default()
22416    }
22417
22418    /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
22419    ///
22420    /// # Example
22421    /// ```ignore,no_run
22422    /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22423    /// # let organization_id = "organization_id";
22424    /// # let location_id = "location_id";
22425    /// # let security_profile_group_id = "security_profile_group_id";
22426    /// let x = DeleteSecurityProfileGroupRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
22427    /// ```
22428    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22429        self.name = v.into();
22430        self
22431    }
22432
22433    /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
22434    ///
22435    /// # Example
22436    /// ```ignore,no_run
22437    /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22438    /// let x = DeleteSecurityProfileGroupRequest::new().set_etag("example");
22439    /// ```
22440    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22441        self.etag = v.into();
22442        self
22443    }
22444}
22445
22446impl wkt::message::Message for DeleteSecurityProfileGroupRequest {
22447    fn typename() -> &'static str {
22448        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest"
22449    }
22450}
22451
22452/// Request used with the ListSecurityProfiles method.
22453#[derive(Clone, Default, PartialEq)]
22454#[non_exhaustive]
22455pub struct ListSecurityProfilesRequest {
22456    /// Required. The project or organization and location from which the
22457    /// SecurityProfiles should be listed, specified in the format
22458    /// `projects|organizations/*/locations/{location}`.
22459    pub parent: std::string::String,
22460
22461    /// Optional. Maximum number of SecurityProfiles to return per call.
22462    pub page_size: i32,
22463
22464    /// Optional. The value returned by the last
22465    /// `ListSecurityProfilesResponse` Indicates that this is a continuation of a
22466    /// prior `ListSecurityProfiles` call, and that the system should return the
22467    /// next page of data.
22468    pub page_token: std::string::String,
22469
22470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22471}
22472
22473impl ListSecurityProfilesRequest {
22474    /// Creates a new default instance.
22475    pub fn new() -> Self {
22476        std::default::Default::default()
22477    }
22478
22479    /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
22480    ///
22481    /// # Example
22482    /// ```ignore,no_run
22483    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22484    /// # let organization_id = "organization_id";
22485    /// # let location_id = "location_id";
22486    /// let x = ListSecurityProfilesRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22487    /// ```
22488    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22489        self.parent = v.into();
22490        self
22491    }
22492
22493    /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
22494    ///
22495    /// # Example
22496    /// ```ignore,no_run
22497    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22498    /// let x = ListSecurityProfilesRequest::new().set_page_size(42);
22499    /// ```
22500    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22501        self.page_size = v.into();
22502        self
22503    }
22504
22505    /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
22506    ///
22507    /// # Example
22508    /// ```ignore,no_run
22509    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22510    /// let x = ListSecurityProfilesRequest::new().set_page_token("example");
22511    /// ```
22512    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22513        self.page_token = v.into();
22514        self
22515    }
22516}
22517
22518impl wkt::message::Message for ListSecurityProfilesRequest {
22519    fn typename() -> &'static str {
22520        "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesRequest"
22521    }
22522}
22523
22524/// Response returned by the ListSecurityProfiles method.
22525#[derive(Clone, Default, PartialEq)]
22526#[non_exhaustive]
22527pub struct ListSecurityProfilesResponse {
22528    /// List of SecurityProfile resources.
22529    pub security_profiles: std::vec::Vec<crate::model::SecurityProfile>,
22530
22531    /// If there might be more results than those appearing in this response, then
22532    /// `next_page_token` is included. To get the next set of results, call this
22533    /// method again using the value of `next_page_token` as `page_token`.
22534    pub next_page_token: std::string::String,
22535
22536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22537}
22538
22539impl ListSecurityProfilesResponse {
22540    /// Creates a new default instance.
22541    pub fn new() -> Self {
22542        std::default::Default::default()
22543    }
22544
22545    /// Sets the value of [security_profiles][crate::model::ListSecurityProfilesResponse::security_profiles].
22546    ///
22547    /// # Example
22548    /// ```ignore,no_run
22549    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22550    /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22551    /// let x = ListSecurityProfilesResponse::new()
22552    ///     .set_security_profiles([
22553    ///         SecurityProfile::default()/* use setters */,
22554    ///         SecurityProfile::default()/* use (different) setters */,
22555    ///     ]);
22556    /// ```
22557    pub fn set_security_profiles<T, V>(mut self, v: T) -> Self
22558    where
22559        T: std::iter::IntoIterator<Item = V>,
22560        V: std::convert::Into<crate::model::SecurityProfile>,
22561    {
22562        use std::iter::Iterator;
22563        self.security_profiles = v.into_iter().map(|i| i.into()).collect();
22564        self
22565    }
22566
22567    /// Sets the value of [next_page_token][crate::model::ListSecurityProfilesResponse::next_page_token].
22568    ///
22569    /// # Example
22570    /// ```ignore,no_run
22571    /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22572    /// let x = ListSecurityProfilesResponse::new().set_next_page_token("example");
22573    /// ```
22574    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22575        self.next_page_token = v.into();
22576        self
22577    }
22578}
22579
22580impl wkt::message::Message for ListSecurityProfilesResponse {
22581    fn typename() -> &'static str {
22582        "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesResponse"
22583    }
22584}
22585
22586#[doc(hidden)]
22587impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfilesResponse {
22588    type PageItem = crate::model::SecurityProfile;
22589
22590    fn items(self) -> std::vec::Vec<Self::PageItem> {
22591        self.security_profiles
22592    }
22593
22594    fn next_page_token(&self) -> std::string::String {
22595        use std::clone::Clone;
22596        self.next_page_token.clone()
22597    }
22598}
22599
22600/// Request used by the GetSecurityProfile method.
22601#[derive(Clone, Default, PartialEq)]
22602#[non_exhaustive]
22603pub struct GetSecurityProfileRequest {
22604    /// Required. A name of the SecurityProfile to get. Must be in the format
22605    /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22606    pub name: std::string::String,
22607
22608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22609}
22610
22611impl GetSecurityProfileRequest {
22612    /// Creates a new default instance.
22613    pub fn new() -> Self {
22614        std::default::Default::default()
22615    }
22616
22617    /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
22618    ///
22619    /// # Example
22620    /// ```ignore,no_run
22621    /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileRequest;
22622    /// # let organization_id = "organization_id";
22623    /// # let location_id = "location_id";
22624    /// # let security_profile_id = "security_profile_id";
22625    /// let x = GetSecurityProfileRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
22626    /// ```
22627    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22628        self.name = v.into();
22629        self
22630    }
22631}
22632
22633impl wkt::message::Message for GetSecurityProfileRequest {
22634    fn typename() -> &'static str {
22635        "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileRequest"
22636    }
22637}
22638
22639/// Request used by the CreateSecurityProfile method.
22640#[derive(Clone, Default, PartialEq)]
22641#[non_exhaustive]
22642pub struct CreateSecurityProfileRequest {
22643    /// Required. The parent resource of the SecurityProfile. Must be in the format
22644    /// `projects|organizations/*/locations/{location}`.
22645    pub parent: std::string::String,
22646
22647    /// Required. Short name of the SecurityProfile resource to be created. This
22648    /// value should be 1-63 characters long, containing only letters, numbers,
22649    /// hyphens, and underscores, and should not start with a number. E.g.
22650    /// "security_profile1".
22651    pub security_profile_id: std::string::String,
22652
22653    /// Required. SecurityProfile resource to be created.
22654    pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22655
22656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22657}
22658
22659impl CreateSecurityProfileRequest {
22660    /// Creates a new default instance.
22661    pub fn new() -> Self {
22662        std::default::Default::default()
22663    }
22664
22665    /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
22666    ///
22667    /// # Example
22668    /// ```ignore,no_run
22669    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22670    /// # let organization_id = "organization_id";
22671    /// # let location_id = "location_id";
22672    /// let x = CreateSecurityProfileRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22673    /// ```
22674    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22675        self.parent = v.into();
22676        self
22677    }
22678
22679    /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
22680    ///
22681    /// # Example
22682    /// ```ignore,no_run
22683    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22684    /// let x = CreateSecurityProfileRequest::new().set_security_profile_id("example");
22685    /// ```
22686    pub fn set_security_profile_id<T: std::convert::Into<std::string::String>>(
22687        mut self,
22688        v: T,
22689    ) -> Self {
22690        self.security_profile_id = v.into();
22691        self
22692    }
22693
22694    /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22695    ///
22696    /// # Example
22697    /// ```ignore,no_run
22698    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22699    /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22700    /// let x = CreateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22701    /// ```
22702    pub fn set_security_profile<T>(mut self, v: T) -> Self
22703    where
22704        T: std::convert::Into<crate::model::SecurityProfile>,
22705    {
22706        self.security_profile = std::option::Option::Some(v.into());
22707        self
22708    }
22709
22710    /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22711    ///
22712    /// # Example
22713    /// ```ignore,no_run
22714    /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22715    /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22716    /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22717    /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22718    /// ```
22719    pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22720    where
22721        T: std::convert::Into<crate::model::SecurityProfile>,
22722    {
22723        self.security_profile = v.map(|x| x.into());
22724        self
22725    }
22726}
22727
22728impl wkt::message::Message for CreateSecurityProfileRequest {
22729    fn typename() -> &'static str {
22730        "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileRequest"
22731    }
22732}
22733
22734/// Request used by the UpdateSecurityProfile method.
22735#[derive(Clone, Default, PartialEq)]
22736#[non_exhaustive]
22737pub struct UpdateSecurityProfileRequest {
22738    /// Required. Field mask is used to specify the fields to be overwritten in the
22739    /// SecurityProfile resource by the update.
22740    /// The fields specified in the update_mask are relative to the resource, not
22741    /// the full request. A field will be overwritten if it is in the mask.
22742    pub update_mask: std::option::Option<wkt::FieldMask>,
22743
22744    /// Required. Updated SecurityProfile resource.
22745    pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22746
22747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22748}
22749
22750impl UpdateSecurityProfileRequest {
22751    /// Creates a new default instance.
22752    pub fn new() -> Self {
22753        std::default::Default::default()
22754    }
22755
22756    /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22757    ///
22758    /// # Example
22759    /// ```ignore,no_run
22760    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22761    /// use wkt::FieldMask;
22762    /// let x = UpdateSecurityProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22763    /// ```
22764    pub fn set_update_mask<T>(mut self, v: T) -> Self
22765    where
22766        T: std::convert::Into<wkt::FieldMask>,
22767    {
22768        self.update_mask = std::option::Option::Some(v.into());
22769        self
22770    }
22771
22772    /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22773    ///
22774    /// # Example
22775    /// ```ignore,no_run
22776    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22777    /// use wkt::FieldMask;
22778    /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22779    /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22780    /// ```
22781    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22782    where
22783        T: std::convert::Into<wkt::FieldMask>,
22784    {
22785        self.update_mask = v.map(|x| x.into());
22786        self
22787    }
22788
22789    /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22790    ///
22791    /// # Example
22792    /// ```ignore,no_run
22793    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22794    /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22795    /// let x = UpdateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22796    /// ```
22797    pub fn set_security_profile<T>(mut self, v: T) -> Self
22798    where
22799        T: std::convert::Into<crate::model::SecurityProfile>,
22800    {
22801        self.security_profile = std::option::Option::Some(v.into());
22802        self
22803    }
22804
22805    /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22806    ///
22807    /// # Example
22808    /// ```ignore,no_run
22809    /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22810    /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22811    /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22812    /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22813    /// ```
22814    pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22815    where
22816        T: std::convert::Into<crate::model::SecurityProfile>,
22817    {
22818        self.security_profile = v.map(|x| x.into());
22819        self
22820    }
22821}
22822
22823impl wkt::message::Message for UpdateSecurityProfileRequest {
22824    fn typename() -> &'static str {
22825        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileRequest"
22826    }
22827}
22828
22829/// Request used by the DeleteSecurityProfile method.
22830#[derive(Clone, Default, PartialEq)]
22831#[non_exhaustive]
22832pub struct DeleteSecurityProfileRequest {
22833    /// Required. A name of the SecurityProfile to delete. Must be in the format
22834    /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22835    pub name: std::string::String,
22836
22837    /// Optional. If client provided etag is out of date, delete will return
22838    /// FAILED_PRECONDITION error.
22839    pub etag: std::string::String,
22840
22841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22842}
22843
22844impl DeleteSecurityProfileRequest {
22845    /// Creates a new default instance.
22846    pub fn new() -> Self {
22847        std::default::Default::default()
22848    }
22849
22850    /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
22851    ///
22852    /// # Example
22853    /// ```ignore,no_run
22854    /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22855    /// # let organization_id = "organization_id";
22856    /// # let location_id = "location_id";
22857    /// # let security_profile_id = "security_profile_id";
22858    /// let x = DeleteSecurityProfileRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
22859    /// ```
22860    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22861        self.name = v.into();
22862        self
22863    }
22864
22865    /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
22866    ///
22867    /// # Example
22868    /// ```ignore,no_run
22869    /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22870    /// let x = DeleteSecurityProfileRequest::new().set_etag("example");
22871    /// ```
22872    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22873        self.etag = v.into();
22874        self
22875    }
22876}
22877
22878impl wkt::message::Message for DeleteSecurityProfileRequest {
22879    fn typename() -> &'static str {
22880        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileRequest"
22881    }
22882}
22883
22884/// ThreatPreventionProfile defines an action for specific threat signatures or
22885/// severity levels.
22886#[derive(Clone, Default, PartialEq)]
22887#[non_exhaustive]
22888pub struct ThreatPreventionProfile {
22889    /// Optional. Configuration for overriding threats actions by severity match.
22890    pub severity_overrides: std::vec::Vec<crate::model::SeverityOverride>,
22891
22892    /// Optional. Configuration for overriding threats actions by threat_id match.
22893    /// If a threat is matched both by configuration provided in severity_overrides
22894    /// and threat_overrides, the threat_overrides action is applied.
22895    pub threat_overrides: std::vec::Vec<crate::model::ThreatOverride>,
22896
22897    /// Optional. Configuration for overriding antivirus actions per protocol.
22898    pub antivirus_overrides: std::vec::Vec<crate::model::AntivirusOverride>,
22899
22900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22901}
22902
22903impl ThreatPreventionProfile {
22904    /// Creates a new default instance.
22905    pub fn new() -> Self {
22906        std::default::Default::default()
22907    }
22908
22909    /// Sets the value of [severity_overrides][crate::model::ThreatPreventionProfile::severity_overrides].
22910    ///
22911    /// # Example
22912    /// ```ignore,no_run
22913    /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22914    /// use google_cloud_networksecurity_v1::model::SeverityOverride;
22915    /// let x = ThreatPreventionProfile::new()
22916    ///     .set_severity_overrides([
22917    ///         SeverityOverride::default()/* use setters */,
22918    ///         SeverityOverride::default()/* use (different) setters */,
22919    ///     ]);
22920    /// ```
22921    pub fn set_severity_overrides<T, V>(mut self, v: T) -> Self
22922    where
22923        T: std::iter::IntoIterator<Item = V>,
22924        V: std::convert::Into<crate::model::SeverityOverride>,
22925    {
22926        use std::iter::Iterator;
22927        self.severity_overrides = v.into_iter().map(|i| i.into()).collect();
22928        self
22929    }
22930
22931    /// Sets the value of [threat_overrides][crate::model::ThreatPreventionProfile::threat_overrides].
22932    ///
22933    /// # Example
22934    /// ```ignore,no_run
22935    /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22936    /// use google_cloud_networksecurity_v1::model::ThreatOverride;
22937    /// let x = ThreatPreventionProfile::new()
22938    ///     .set_threat_overrides([
22939    ///         ThreatOverride::default()/* use setters */,
22940    ///         ThreatOverride::default()/* use (different) setters */,
22941    ///     ]);
22942    /// ```
22943    pub fn set_threat_overrides<T, V>(mut self, v: T) -> Self
22944    where
22945        T: std::iter::IntoIterator<Item = V>,
22946        V: std::convert::Into<crate::model::ThreatOverride>,
22947    {
22948        use std::iter::Iterator;
22949        self.threat_overrides = v.into_iter().map(|i| i.into()).collect();
22950        self
22951    }
22952
22953    /// Sets the value of [antivirus_overrides][crate::model::ThreatPreventionProfile::antivirus_overrides].
22954    ///
22955    /// # Example
22956    /// ```ignore,no_run
22957    /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22958    /// use google_cloud_networksecurity_v1::model::AntivirusOverride;
22959    /// let x = ThreatPreventionProfile::new()
22960    ///     .set_antivirus_overrides([
22961    ///         AntivirusOverride::default()/* use setters */,
22962    ///         AntivirusOverride::default()/* use (different) setters */,
22963    ///     ]);
22964    /// ```
22965    pub fn set_antivirus_overrides<T, V>(mut self, v: T) -> Self
22966    where
22967        T: std::iter::IntoIterator<Item = V>,
22968        V: std::convert::Into<crate::model::AntivirusOverride>,
22969    {
22970        use std::iter::Iterator;
22971        self.antivirus_overrides = v.into_iter().map(|i| i.into()).collect();
22972        self
22973    }
22974}
22975
22976impl wkt::message::Message for ThreatPreventionProfile {
22977    fn typename() -> &'static str {
22978        "type.googleapis.com/google.cloud.networksecurity.v1.ThreatPreventionProfile"
22979    }
22980}
22981
22982/// Defines what action to take for a specific severity match.
22983#[derive(Clone, Default, PartialEq)]
22984#[non_exhaustive]
22985pub struct SeverityOverride {
22986    /// Required. Severity level to match.
22987    pub severity: crate::model::Severity,
22988
22989    /// Required. Threat action override.
22990    pub action: crate::model::ThreatAction,
22991
22992    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22993}
22994
22995impl SeverityOverride {
22996    /// Creates a new default instance.
22997    pub fn new() -> Self {
22998        std::default::Default::default()
22999    }
23000
23001    /// Sets the value of [severity][crate::model::SeverityOverride::severity].
23002    ///
23003    /// # Example
23004    /// ```ignore,no_run
23005    /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
23006    /// use google_cloud_networksecurity_v1::model::Severity;
23007    /// let x0 = SeverityOverride::new().set_severity(Severity::Informational);
23008    /// let x1 = SeverityOverride::new().set_severity(Severity::Low);
23009    /// let x2 = SeverityOverride::new().set_severity(Severity::Medium);
23010    /// ```
23011    pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
23012        self.severity = v.into();
23013        self
23014    }
23015
23016    /// Sets the value of [action][crate::model::SeverityOverride::action].
23017    ///
23018    /// # Example
23019    /// ```ignore,no_run
23020    /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
23021    /// use google_cloud_networksecurity_v1::model::ThreatAction;
23022    /// let x0 = SeverityOverride::new().set_action(ThreatAction::DefaultAction);
23023    /// let x1 = SeverityOverride::new().set_action(ThreatAction::Allow);
23024    /// let x2 = SeverityOverride::new().set_action(ThreatAction::Alert);
23025    /// ```
23026    pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23027        self.action = v.into();
23028        self
23029    }
23030}
23031
23032impl wkt::message::Message for SeverityOverride {
23033    fn typename() -> &'static str {
23034        "type.googleapis.com/google.cloud.networksecurity.v1.SeverityOverride"
23035    }
23036}
23037
23038/// Defines what action to take for a specific threat_id match.
23039#[derive(Clone, Default, PartialEq)]
23040#[non_exhaustive]
23041pub struct ThreatOverride {
23042    /// Required. Vendor-specific ID of a threat to override.
23043    pub threat_id: std::string::String,
23044
23045    /// Output only. Type of the threat (read only).
23046    pub r#type: crate::model::ThreatType,
23047
23048    /// Required. Threat action override. For some threat types, only a subset of
23049    /// actions applies.
23050    pub action: crate::model::ThreatAction,
23051
23052    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23053}
23054
23055impl ThreatOverride {
23056    /// Creates a new default instance.
23057    pub fn new() -> Self {
23058        std::default::Default::default()
23059    }
23060
23061    /// Sets the value of [threat_id][crate::model::ThreatOverride::threat_id].
23062    ///
23063    /// # Example
23064    /// ```ignore,no_run
23065    /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23066    /// let x = ThreatOverride::new().set_threat_id("example");
23067    /// ```
23068    pub fn set_threat_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23069        self.threat_id = v.into();
23070        self
23071    }
23072
23073    /// Sets the value of [r#type][crate::model::ThreatOverride::type].
23074    ///
23075    /// # Example
23076    /// ```ignore,no_run
23077    /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23078    /// use google_cloud_networksecurity_v1::model::ThreatType;
23079    /// let x0 = ThreatOverride::new().set_type(ThreatType::Unknown);
23080    /// let x1 = ThreatOverride::new().set_type(ThreatType::Vulnerability);
23081    /// let x2 = ThreatOverride::new().set_type(ThreatType::Antivirus);
23082    /// ```
23083    pub fn set_type<T: std::convert::Into<crate::model::ThreatType>>(mut self, v: T) -> Self {
23084        self.r#type = v.into();
23085        self
23086    }
23087
23088    /// Sets the value of [action][crate::model::ThreatOverride::action].
23089    ///
23090    /// # Example
23091    /// ```ignore,no_run
23092    /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23093    /// use google_cloud_networksecurity_v1::model::ThreatAction;
23094    /// let x0 = ThreatOverride::new().set_action(ThreatAction::DefaultAction);
23095    /// let x1 = ThreatOverride::new().set_action(ThreatAction::Allow);
23096    /// let x2 = ThreatOverride::new().set_action(ThreatAction::Alert);
23097    /// ```
23098    pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23099        self.action = v.into();
23100        self
23101    }
23102}
23103
23104impl wkt::message::Message for ThreatOverride {
23105    fn typename() -> &'static str {
23106        "type.googleapis.com/google.cloud.networksecurity.v1.ThreatOverride"
23107    }
23108}
23109
23110/// Defines what action to take for antivirus threats per protocol.
23111#[derive(Clone, Default, PartialEq)]
23112#[non_exhaustive]
23113pub struct AntivirusOverride {
23114    /// Required. Protocol to match.
23115    pub protocol: crate::model::Protocol,
23116
23117    /// Required. Threat action override. For some threat types, only a subset of
23118    /// actions applies.
23119    pub action: crate::model::ThreatAction,
23120
23121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23122}
23123
23124impl AntivirusOverride {
23125    /// Creates a new default instance.
23126    pub fn new() -> Self {
23127        std::default::Default::default()
23128    }
23129
23130    /// Sets the value of [protocol][crate::model::AntivirusOverride::protocol].
23131    ///
23132    /// # Example
23133    /// ```ignore,no_run
23134    /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
23135    /// use google_cloud_networksecurity_v1::model::Protocol;
23136    /// let x0 = AntivirusOverride::new().set_protocol(Protocol::Smtp);
23137    /// let x1 = AntivirusOverride::new().set_protocol(Protocol::Smb);
23138    /// let x2 = AntivirusOverride::new().set_protocol(Protocol::Pop3);
23139    /// ```
23140    pub fn set_protocol<T: std::convert::Into<crate::model::Protocol>>(mut self, v: T) -> Self {
23141        self.protocol = v.into();
23142        self
23143    }
23144
23145    /// Sets the value of [action][crate::model::AntivirusOverride::action].
23146    ///
23147    /// # Example
23148    /// ```ignore,no_run
23149    /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
23150    /// use google_cloud_networksecurity_v1::model::ThreatAction;
23151    /// let x0 = AntivirusOverride::new().set_action(ThreatAction::DefaultAction);
23152    /// let x1 = AntivirusOverride::new().set_action(ThreatAction::Allow);
23153    /// let x2 = AntivirusOverride::new().set_action(ThreatAction::Alert);
23154    /// ```
23155    pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23156        self.action = v.into();
23157        self
23158    }
23159}
23160
23161impl wkt::message::Message for AntivirusOverride {
23162    fn typename() -> &'static str {
23163        "type.googleapis.com/google.cloud.networksecurity.v1.AntivirusOverride"
23164    }
23165}
23166
23167/// UrlFilteringProfile defines filters based on URL.
23168#[derive(Clone, Default, PartialEq)]
23169#[non_exhaustive]
23170pub struct UrlFilteringProfile {
23171    /// Optional. The list of filtering configs in which each config defines an
23172    /// action to take for some URL match.
23173    pub url_filters: std::vec::Vec<crate::model::UrlFilter>,
23174
23175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23176}
23177
23178impl UrlFilteringProfile {
23179    /// Creates a new default instance.
23180    pub fn new() -> Self {
23181        std::default::Default::default()
23182    }
23183
23184    /// Sets the value of [url_filters][crate::model::UrlFilteringProfile::url_filters].
23185    ///
23186    /// # Example
23187    /// ```ignore,no_run
23188    /// # use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
23189    /// use google_cloud_networksecurity_v1::model::UrlFilter;
23190    /// let x = UrlFilteringProfile::new()
23191    ///     .set_url_filters([
23192    ///         UrlFilter::default()/* use setters */,
23193    ///         UrlFilter::default()/* use (different) setters */,
23194    ///     ]);
23195    /// ```
23196    pub fn set_url_filters<T, V>(mut self, v: T) -> Self
23197    where
23198        T: std::iter::IntoIterator<Item = V>,
23199        V: std::convert::Into<crate::model::UrlFilter>,
23200    {
23201        use std::iter::Iterator;
23202        self.url_filters = v.into_iter().map(|i| i.into()).collect();
23203        self
23204    }
23205}
23206
23207impl wkt::message::Message for UrlFilteringProfile {
23208    fn typename() -> &'static str {
23209        "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilteringProfile"
23210    }
23211}
23212
23213/// A URL filter defines an action to take for some URL match.
23214#[derive(Clone, Default, PartialEq)]
23215#[non_exhaustive]
23216pub struct UrlFilter {
23217    /// Required. The action taken when this filter is applied.
23218    pub filtering_action: crate::model::url_filter::UrlFilteringAction,
23219
23220    /// Required. The list of strings that a URL must match with for this filter to
23221    /// be applied.
23222    pub urls: std::vec::Vec<std::string::String>,
23223
23224    /// Required. The priority of this filter within the URL Filtering Profile.
23225    /// Lower integers indicate higher priorities. The priority of a filter must be
23226    /// unique within a URL Filtering Profile.
23227    pub priority: std::option::Option<i32>,
23228
23229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23230}
23231
23232impl UrlFilter {
23233    /// Creates a new default instance.
23234    pub fn new() -> Self {
23235        std::default::Default::default()
23236    }
23237
23238    /// Sets the value of [filtering_action][crate::model::UrlFilter::filtering_action].
23239    ///
23240    /// # Example
23241    /// ```ignore,no_run
23242    /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23243    /// use google_cloud_networksecurity_v1::model::url_filter::UrlFilteringAction;
23244    /// let x0 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Allow);
23245    /// let x1 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Deny);
23246    /// ```
23247    pub fn set_filtering_action<
23248        T: std::convert::Into<crate::model::url_filter::UrlFilteringAction>,
23249    >(
23250        mut self,
23251        v: T,
23252    ) -> Self {
23253        self.filtering_action = v.into();
23254        self
23255    }
23256
23257    /// Sets the value of [urls][crate::model::UrlFilter::urls].
23258    ///
23259    /// # Example
23260    /// ```ignore,no_run
23261    /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23262    /// let x = UrlFilter::new().set_urls(["a", "b", "c"]);
23263    /// ```
23264    pub fn set_urls<T, V>(mut self, v: T) -> Self
23265    where
23266        T: std::iter::IntoIterator<Item = V>,
23267        V: std::convert::Into<std::string::String>,
23268    {
23269        use std::iter::Iterator;
23270        self.urls = v.into_iter().map(|i| i.into()).collect();
23271        self
23272    }
23273
23274    /// Sets the value of [priority][crate::model::UrlFilter::priority].
23275    ///
23276    /// # Example
23277    /// ```ignore,no_run
23278    /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23279    /// let x = UrlFilter::new().set_priority(42);
23280    /// ```
23281    pub fn set_priority<T>(mut self, v: T) -> Self
23282    where
23283        T: std::convert::Into<i32>,
23284    {
23285        self.priority = std::option::Option::Some(v.into());
23286        self
23287    }
23288
23289    /// Sets or clears the value of [priority][crate::model::UrlFilter::priority].
23290    ///
23291    /// # Example
23292    /// ```ignore,no_run
23293    /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23294    /// let x = UrlFilter::new().set_or_clear_priority(Some(42));
23295    /// let x = UrlFilter::new().set_or_clear_priority(None::<i32>);
23296    /// ```
23297    pub fn set_or_clear_priority<T>(mut self, v: std::option::Option<T>) -> Self
23298    where
23299        T: std::convert::Into<i32>,
23300    {
23301        self.priority = v.map(|x| x.into());
23302        self
23303    }
23304}
23305
23306impl wkt::message::Message for UrlFilter {
23307    fn typename() -> &'static str {
23308        "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilter"
23309    }
23310}
23311
23312/// Defines additional types related to [UrlFilter].
23313pub mod url_filter {
23314    #[allow(unused_imports)]
23315    use super::*;
23316
23317    /// Action to be taken when a URL matches a filter.
23318    ///
23319    /// # Working with unknown values
23320    ///
23321    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23322    /// additional enum variants at any time. Adding new variants is not considered
23323    /// a breaking change. Applications should write their code in anticipation of:
23324    ///
23325    /// - New values appearing in future releases of the client library, **and**
23326    /// - New values received dynamically, without application changes.
23327    ///
23328    /// Please consult the [Working with enums] section in the user guide for some
23329    /// guidelines.
23330    ///
23331    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23332    #[derive(Clone, Debug, PartialEq)]
23333    #[non_exhaustive]
23334    pub enum UrlFilteringAction {
23335        /// Filtering action not specified.
23336        Unspecified,
23337        /// The connection matching this filter will be allowed to transmit.
23338        Allow,
23339        /// The connection matching this filter will be dropped.
23340        Deny,
23341        /// If set, the enum was initialized with an unknown value.
23342        ///
23343        /// Applications can examine the value using [UrlFilteringAction::value] or
23344        /// [UrlFilteringAction::name].
23345        UnknownValue(url_filtering_action::UnknownValue),
23346    }
23347
23348    #[doc(hidden)]
23349    pub mod url_filtering_action {
23350        #[allow(unused_imports)]
23351        use super::*;
23352        #[derive(Clone, Debug, PartialEq)]
23353        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23354    }
23355
23356    impl UrlFilteringAction {
23357        /// Gets the enum value.
23358        ///
23359        /// Returns `None` if the enum contains an unknown value deserialized from
23360        /// the string representation of enums.
23361        pub fn value(&self) -> std::option::Option<i32> {
23362            match self {
23363                Self::Unspecified => std::option::Option::Some(0),
23364                Self::Allow => std::option::Option::Some(1),
23365                Self::Deny => std::option::Option::Some(2),
23366                Self::UnknownValue(u) => u.0.value(),
23367            }
23368        }
23369
23370        /// Gets the enum value as a string.
23371        ///
23372        /// Returns `None` if the enum contains an unknown value deserialized from
23373        /// the integer representation of enums.
23374        pub fn name(&self) -> std::option::Option<&str> {
23375            match self {
23376                Self::Unspecified => std::option::Option::Some("URL_FILTERING_ACTION_UNSPECIFIED"),
23377                Self::Allow => std::option::Option::Some("ALLOW"),
23378                Self::Deny => std::option::Option::Some("DENY"),
23379                Self::UnknownValue(u) => u.0.name(),
23380            }
23381        }
23382    }
23383
23384    impl std::default::Default for UrlFilteringAction {
23385        fn default() -> Self {
23386            use std::convert::From;
23387            Self::from(0)
23388        }
23389    }
23390
23391    impl std::fmt::Display for UrlFilteringAction {
23392        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23393            wkt::internal::display_enum(f, self.name(), self.value())
23394        }
23395    }
23396
23397    impl std::convert::From<i32> for UrlFilteringAction {
23398        fn from(value: i32) -> Self {
23399            match value {
23400                0 => Self::Unspecified,
23401                1 => Self::Allow,
23402                2 => Self::Deny,
23403                _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23404                    wkt::internal::UnknownEnumValue::Integer(value),
23405                )),
23406            }
23407        }
23408    }
23409
23410    impl std::convert::From<&str> for UrlFilteringAction {
23411        fn from(value: &str) -> Self {
23412            use std::string::ToString;
23413            match value {
23414                "URL_FILTERING_ACTION_UNSPECIFIED" => Self::Unspecified,
23415                "ALLOW" => Self::Allow,
23416                "DENY" => Self::Deny,
23417                _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23418                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23419                )),
23420            }
23421        }
23422    }
23423
23424    impl serde::ser::Serialize for UrlFilteringAction {
23425        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23426        where
23427            S: serde::Serializer,
23428        {
23429            match self {
23430                Self::Unspecified => serializer.serialize_i32(0),
23431                Self::Allow => serializer.serialize_i32(1),
23432                Self::Deny => serializer.serialize_i32(2),
23433                Self::UnknownValue(u) => u.0.serialize(serializer),
23434            }
23435        }
23436    }
23437
23438    impl<'de> serde::de::Deserialize<'de> for UrlFilteringAction {
23439        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23440        where
23441            D: serde::Deserializer<'de>,
23442        {
23443            deserializer.deserialize_any(wkt::internal::EnumVisitor::<UrlFilteringAction>::new(
23444                ".google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction",
23445            ))
23446        }
23447    }
23448}
23449
23450/// ServerTlsPolicy is a resource that specifies how a server should authenticate
23451/// incoming requests. This resource itself does not affect configuration unless
23452/// it is attached to a target HTTPS proxy or endpoint config selector resource.
23453///
23454/// ServerTlsPolicy in the form accepted by Application Load Balancers can
23455/// be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED`
23456/// or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible
23457/// ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with
23458/// Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme.
23459#[derive(Clone, Default, PartialEq)]
23460#[non_exhaustive]
23461pub struct ServerTlsPolicy {
23462    /// Required. Name of the ServerTlsPolicy resource. It matches the pattern
23463    /// `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
23464    pub name: std::string::String,
23465
23466    /// Free-text description of the resource.
23467    pub description: std::string::String,
23468
23469    /// Output only. The timestamp when the resource was created.
23470    pub create_time: std::option::Option<wkt::Timestamp>,
23471
23472    /// Output only. The timestamp when the resource was updated.
23473    pub update_time: std::option::Option<wkt::Timestamp>,
23474
23475    /// Set of label tags associated with the resource.
23476    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
23477
23478    /// This field applies only for Traffic Director policies. It is must be set to
23479    /// false for Application Load Balancer policies.
23480    ///
23481    /// Determines if server allows plaintext connections. If set to true, server
23482    /// allows plain text connections. By default, it is set to false. This setting
23483    /// is not exclusive of other encryption modes. For example, if `allow_open`
23484    /// and `mtls_policy` are set, server allows both plain text and mTLS
23485    /// connections. See documentation of other encryption modes to confirm
23486    /// compatibility.
23487    ///
23488    /// Consider using it if you wish to upgrade in place your deployment to TLS
23489    /// while having mixed TLS and non-TLS traffic reaching port :80.
23490    pub allow_open: bool,
23491
23492    /// Optional if policy is to be used with Traffic Director. For Application
23493    /// Load Balancers must be empty.
23494    ///
23495    /// Defines a mechanism to provision server identity (public and private keys).
23496    /// Cannot be combined with `allow_open` as a permissive mode that allows both
23497    /// plain text and TLS is not supported.
23498    pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
23499
23500    /// This field is required if the policy is used with Application Load
23501    /// Balancers. This field can be empty for Traffic Director.
23502    ///
23503    /// Defines a mechanism to provision peer validation certificates for peer to
23504    /// peer authentication (Mutual TLS - mTLS). If not specified, client
23505    /// certificate will not be requested. The connection is treated as TLS and not
23506    /// mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
23507    /// text and mTLS connections.
23508    pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
23509
23510    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23511}
23512
23513impl ServerTlsPolicy {
23514    /// Creates a new default instance.
23515    pub fn new() -> Self {
23516        std::default::Default::default()
23517    }
23518
23519    /// Sets the value of [name][crate::model::ServerTlsPolicy::name].
23520    ///
23521    /// # Example
23522    /// ```ignore,no_run
23523    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23524    /// # let project_id = "project_id";
23525    /// # let location_id = "location_id";
23526    /// # let server_tls_policy_id = "server_tls_policy_id";
23527    /// let x = ServerTlsPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
23528    /// ```
23529    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23530        self.name = v.into();
23531        self
23532    }
23533
23534    /// Sets the value of [description][crate::model::ServerTlsPolicy::description].
23535    ///
23536    /// # Example
23537    /// ```ignore,no_run
23538    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23539    /// let x = ServerTlsPolicy::new().set_description("example");
23540    /// ```
23541    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23542        self.description = v.into();
23543        self
23544    }
23545
23546    /// Sets the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23547    ///
23548    /// # Example
23549    /// ```ignore,no_run
23550    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23551    /// use wkt::Timestamp;
23552    /// let x = ServerTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
23553    /// ```
23554    pub fn set_create_time<T>(mut self, v: T) -> Self
23555    where
23556        T: std::convert::Into<wkt::Timestamp>,
23557    {
23558        self.create_time = std::option::Option::Some(v.into());
23559        self
23560    }
23561
23562    /// Sets or clears the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23563    ///
23564    /// # Example
23565    /// ```ignore,no_run
23566    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23567    /// use wkt::Timestamp;
23568    /// let x = ServerTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
23569    /// let x = ServerTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
23570    /// ```
23571    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
23572    where
23573        T: std::convert::Into<wkt::Timestamp>,
23574    {
23575        self.create_time = v.map(|x| x.into());
23576        self
23577    }
23578
23579    /// Sets the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23580    ///
23581    /// # Example
23582    /// ```ignore,no_run
23583    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23584    /// use wkt::Timestamp;
23585    /// let x = ServerTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
23586    /// ```
23587    pub fn set_update_time<T>(mut self, v: T) -> Self
23588    where
23589        T: std::convert::Into<wkt::Timestamp>,
23590    {
23591        self.update_time = std::option::Option::Some(v.into());
23592        self
23593    }
23594
23595    /// Sets or clears the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23596    ///
23597    /// # Example
23598    /// ```ignore,no_run
23599    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23600    /// use wkt::Timestamp;
23601    /// let x = ServerTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
23602    /// let x = ServerTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
23603    /// ```
23604    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
23605    where
23606        T: std::convert::Into<wkt::Timestamp>,
23607    {
23608        self.update_time = v.map(|x| x.into());
23609        self
23610    }
23611
23612    /// Sets the value of [labels][crate::model::ServerTlsPolicy::labels].
23613    ///
23614    /// # Example
23615    /// ```ignore,no_run
23616    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23617    /// let x = ServerTlsPolicy::new().set_labels([
23618    ///     ("key0", "abc"),
23619    ///     ("key1", "xyz"),
23620    /// ]);
23621    /// ```
23622    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
23623    where
23624        T: std::iter::IntoIterator<Item = (K, V)>,
23625        K: std::convert::Into<std::string::String>,
23626        V: std::convert::Into<std::string::String>,
23627    {
23628        use std::iter::Iterator;
23629        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
23630        self
23631    }
23632
23633    /// Sets the value of [allow_open][crate::model::ServerTlsPolicy::allow_open].
23634    ///
23635    /// # Example
23636    /// ```ignore,no_run
23637    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23638    /// let x = ServerTlsPolicy::new().set_allow_open(true);
23639    /// ```
23640    pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23641        self.allow_open = v.into();
23642        self
23643    }
23644
23645    /// Sets the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23646    ///
23647    /// # Example
23648    /// ```ignore,no_run
23649    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23650    /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23651    /// let x = ServerTlsPolicy::new().set_server_certificate(CertificateProvider::default()/* use setters */);
23652    /// ```
23653    pub fn set_server_certificate<T>(mut self, v: T) -> Self
23654    where
23655        T: std::convert::Into<crate::model::CertificateProvider>,
23656    {
23657        self.server_certificate = std::option::Option::Some(v.into());
23658        self
23659    }
23660
23661    /// Sets or clears the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23662    ///
23663    /// # Example
23664    /// ```ignore,no_run
23665    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23666    /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23667    /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(Some(CertificateProvider::default()/* use setters */));
23668    /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(None::<CertificateProvider>);
23669    /// ```
23670    pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23671    where
23672        T: std::convert::Into<crate::model::CertificateProvider>,
23673    {
23674        self.server_certificate = v.map(|x| x.into());
23675        self
23676    }
23677
23678    /// Sets the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23679    ///
23680    /// # Example
23681    /// ```ignore,no_run
23682    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23683    /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23684    /// let x = ServerTlsPolicy::new().set_mtls_policy(MTLSPolicy::default()/* use setters */);
23685    /// ```
23686    pub fn set_mtls_policy<T>(mut self, v: T) -> Self
23687    where
23688        T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23689    {
23690        self.mtls_policy = std::option::Option::Some(v.into());
23691        self
23692    }
23693
23694    /// Sets or clears the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23695    ///
23696    /// # Example
23697    /// ```ignore,no_run
23698    /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23699    /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23700    /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(Some(MTLSPolicy::default()/* use setters */));
23701    /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(None::<MTLSPolicy>);
23702    /// ```
23703    pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23704    where
23705        T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23706    {
23707        self.mtls_policy = v.map(|x| x.into());
23708        self
23709    }
23710}
23711
23712impl wkt::message::Message for ServerTlsPolicy {
23713    fn typename() -> &'static str {
23714        "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
23715    }
23716}
23717
23718/// Defines additional types related to [ServerTlsPolicy].
23719pub mod server_tls_policy {
23720    #[allow(unused_imports)]
23721    use super::*;
23722
23723    /// Specification of the MTLSPolicy.
23724    #[derive(Clone, Default, PartialEq)]
23725    #[non_exhaustive]
23726    pub struct MTLSPolicy {
23727        /// When the client presents an invalid certificate or no certificate to the
23728        /// load balancer, the `client_validation_mode` specifies how the client
23729        /// connection is handled.
23730        ///
23731        /// Required if the policy is to be used with the Application Load
23732        /// Balancers. For Traffic Director it must be empty.
23733        pub client_validation_mode:
23734            crate::model::server_tls_policy::mtls_policy::ClientValidationMode,
23735
23736        /// Required if the policy is to be used with Traffic Director. For
23737        /// Application Load Balancers it must be empty.
23738        ///
23739        /// Defines the mechanism to obtain the Certificate Authority certificate to
23740        /// validate the client certificate.
23741        pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
23742
23743        /// Reference to the TrustConfig from certificatemanager.googleapis.com
23744        /// namespace.
23745        ///
23746        /// If specified, the chain validation will be performed against certificates
23747        /// configured in the given TrustConfig.
23748        ///
23749        /// Allowed only if the policy is to be used with Application Load
23750        /// Balancers.
23751        pub client_validation_trust_config: std::string::String,
23752
23753        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23754    }
23755
23756    impl MTLSPolicy {
23757        /// Creates a new default instance.
23758        pub fn new() -> Self {
23759            std::default::Default::default()
23760        }
23761
23762        /// Sets the value of [client_validation_mode][crate::model::server_tls_policy::MTLSPolicy::client_validation_mode].
23763        ///
23764        /// # Example
23765        /// ```ignore,no_run
23766        /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23767        /// use google_cloud_networksecurity_v1::model::server_tls_policy::mtls_policy::ClientValidationMode;
23768        /// let x0 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::AllowInvalidOrMissingClientCert);
23769        /// let x1 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::RejectInvalid);
23770        /// ```
23771        pub fn set_client_validation_mode<
23772            T: std::convert::Into<crate::model::server_tls_policy::mtls_policy::ClientValidationMode>,
23773        >(
23774            mut self,
23775            v: T,
23776        ) -> Self {
23777            self.client_validation_mode = v.into();
23778            self
23779        }
23780
23781        /// Sets the value of [client_validation_ca][crate::model::server_tls_policy::MTLSPolicy::client_validation_ca].
23782        ///
23783        /// # Example
23784        /// ```ignore,no_run
23785        /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23786        /// use google_cloud_networksecurity_v1::model::ValidationCA;
23787        /// let x = MTLSPolicy::new()
23788        ///     .set_client_validation_ca([
23789        ///         ValidationCA::default()/* use setters */,
23790        ///         ValidationCA::default()/* use (different) setters */,
23791        ///     ]);
23792        /// ```
23793        pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
23794        where
23795            T: std::iter::IntoIterator<Item = V>,
23796            V: std::convert::Into<crate::model::ValidationCA>,
23797        {
23798            use std::iter::Iterator;
23799            self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
23800            self
23801        }
23802
23803        /// Sets the value of [client_validation_trust_config][crate::model::server_tls_policy::MTLSPolicy::client_validation_trust_config].
23804        ///
23805        /// # Example
23806        /// ```ignore,no_run
23807        /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23808        /// let x = MTLSPolicy::new().set_client_validation_trust_config("example");
23809        /// ```
23810        pub fn set_client_validation_trust_config<T: std::convert::Into<std::string::String>>(
23811            mut self,
23812            v: T,
23813        ) -> Self {
23814            self.client_validation_trust_config = v.into();
23815            self
23816        }
23817    }
23818
23819    impl wkt::message::Message for MTLSPolicy {
23820        fn typename() -> &'static str {
23821            "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
23822        }
23823    }
23824
23825    /// Defines additional types related to [MTLSPolicy].
23826    pub mod mtls_policy {
23827        #[allow(unused_imports)]
23828        use super::*;
23829
23830        /// Mutual TLS certificate validation mode.
23831        ///
23832        /// # Working with unknown values
23833        ///
23834        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23835        /// additional enum variants at any time. Adding new variants is not considered
23836        /// a breaking change. Applications should write their code in anticipation of:
23837        ///
23838        /// - New values appearing in future releases of the client library, **and**
23839        /// - New values received dynamically, without application changes.
23840        ///
23841        /// Please consult the [Working with enums] section in the user guide for some
23842        /// guidelines.
23843        ///
23844        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23845        #[derive(Clone, Debug, PartialEq)]
23846        #[non_exhaustive]
23847        pub enum ClientValidationMode {
23848            /// Not allowed.
23849            Unspecified,
23850            /// Allow connection even if certificate chain validation
23851            /// of the client certificate failed or no client certificate was
23852            /// presented. The proof of possession of the private key is always checked
23853            /// if client certificate was presented. This mode requires the backend to
23854            /// implement processing of data extracted from a client certificate to
23855            /// authenticate the peer, or to reject connections if the client
23856            /// certificate fingerprint is missing.
23857            AllowInvalidOrMissingClientCert,
23858            /// Require a client certificate and allow connection to the backend only
23859            /// if validation of the client certificate passed.
23860            ///
23861            /// If set, requires a reference to non-empty TrustConfig specified in
23862            /// `client_validation_trust_config`.
23863            RejectInvalid,
23864            /// If set, the enum was initialized with an unknown value.
23865            ///
23866            /// Applications can examine the value using [ClientValidationMode::value] or
23867            /// [ClientValidationMode::name].
23868            UnknownValue(client_validation_mode::UnknownValue),
23869        }
23870
23871        #[doc(hidden)]
23872        pub mod client_validation_mode {
23873            #[allow(unused_imports)]
23874            use super::*;
23875            #[derive(Clone, Debug, PartialEq)]
23876            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23877        }
23878
23879        impl ClientValidationMode {
23880            /// Gets the enum value.
23881            ///
23882            /// Returns `None` if the enum contains an unknown value deserialized from
23883            /// the string representation of enums.
23884            pub fn value(&self) -> std::option::Option<i32> {
23885                match self {
23886                    Self::Unspecified => std::option::Option::Some(0),
23887                    Self::AllowInvalidOrMissingClientCert => std::option::Option::Some(1),
23888                    Self::RejectInvalid => std::option::Option::Some(2),
23889                    Self::UnknownValue(u) => u.0.value(),
23890                }
23891            }
23892
23893            /// Gets the enum value as a string.
23894            ///
23895            /// Returns `None` if the enum contains an unknown value deserialized from
23896            /// the integer representation of enums.
23897            pub fn name(&self) -> std::option::Option<&str> {
23898                match self {
23899                    Self::Unspecified => {
23900                        std::option::Option::Some("CLIENT_VALIDATION_MODE_UNSPECIFIED")
23901                    }
23902                    Self::AllowInvalidOrMissingClientCert => {
23903                        std::option::Option::Some("ALLOW_INVALID_OR_MISSING_CLIENT_CERT")
23904                    }
23905                    Self::RejectInvalid => std::option::Option::Some("REJECT_INVALID"),
23906                    Self::UnknownValue(u) => u.0.name(),
23907                }
23908            }
23909        }
23910
23911        impl std::default::Default for ClientValidationMode {
23912            fn default() -> Self {
23913                use std::convert::From;
23914                Self::from(0)
23915            }
23916        }
23917
23918        impl std::fmt::Display for ClientValidationMode {
23919            fn fmt(
23920                &self,
23921                f: &mut std::fmt::Formatter<'_>,
23922            ) -> std::result::Result<(), std::fmt::Error> {
23923                wkt::internal::display_enum(f, self.name(), self.value())
23924            }
23925        }
23926
23927        impl std::convert::From<i32> for ClientValidationMode {
23928            fn from(value: i32) -> Self {
23929                match value {
23930                    0 => Self::Unspecified,
23931                    1 => Self::AllowInvalidOrMissingClientCert,
23932                    2 => Self::RejectInvalid,
23933                    _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23934                        wkt::internal::UnknownEnumValue::Integer(value),
23935                    )),
23936                }
23937            }
23938        }
23939
23940        impl std::convert::From<&str> for ClientValidationMode {
23941            fn from(value: &str) -> Self {
23942                use std::string::ToString;
23943                match value {
23944                    "CLIENT_VALIDATION_MODE_UNSPECIFIED" => Self::Unspecified,
23945                    "ALLOW_INVALID_OR_MISSING_CLIENT_CERT" => Self::AllowInvalidOrMissingClientCert,
23946                    "REJECT_INVALID" => Self::RejectInvalid,
23947                    _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23948                        wkt::internal::UnknownEnumValue::String(value.to_string()),
23949                    )),
23950                }
23951            }
23952        }
23953
23954        impl serde::ser::Serialize for ClientValidationMode {
23955            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23956            where
23957                S: serde::Serializer,
23958            {
23959                match self {
23960                    Self::Unspecified => serializer.serialize_i32(0),
23961                    Self::AllowInvalidOrMissingClientCert => serializer.serialize_i32(1),
23962                    Self::RejectInvalid => serializer.serialize_i32(2),
23963                    Self::UnknownValue(u) => u.0.serialize(serializer),
23964                }
23965            }
23966        }
23967
23968        impl<'de> serde::de::Deserialize<'de> for ClientValidationMode {
23969            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23970            where
23971                D: serde::Deserializer<'de>,
23972            {
23973                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClientValidationMode>::new(
23974                    ".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode"))
23975            }
23976        }
23977    }
23978}
23979
23980/// Request used by the ListServerTlsPolicies method.
23981#[derive(Clone, Default, PartialEq)]
23982#[non_exhaustive]
23983pub struct ListServerTlsPoliciesRequest {
23984    /// Required. The project and location from which the ServerTlsPolicies should
23985    /// be listed, specified in the format `projects/*/locations/{location}`.
23986    pub parent: std::string::String,
23987
23988    /// Maximum number of ServerTlsPolicies to return per call.
23989    pub page_size: i32,
23990
23991    /// The value returned by the last `ListServerTlsPoliciesResponse`
23992    /// Indicates that this is a continuation of a prior
23993    /// `ListServerTlsPolicies` call, and that the system
23994    /// should return the next page of data.
23995    pub page_token: std::string::String,
23996
23997    /// Optional. Setting this field to `true` will opt the request into returning
23998    /// the resources that are reachable, and into including the names of those
23999    /// that were unreachable in the [ListServerTlsPoliciesResponse.unreachable]
24000    /// field. This can only be `true` when reading across collections e.g. when
24001    /// `parent` is set to `"projects/example/locations/-"`.
24002    pub return_partial_success: bool,
24003
24004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24005}
24006
24007impl ListServerTlsPoliciesRequest {
24008    /// Creates a new default instance.
24009    pub fn new() -> Self {
24010        std::default::Default::default()
24011    }
24012
24013    /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
24014    ///
24015    /// # Example
24016    /// ```ignore,no_run
24017    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24018    /// let x = ListServerTlsPoliciesRequest::new().set_parent("example");
24019    /// ```
24020    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24021        self.parent = v.into();
24022        self
24023    }
24024
24025    /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
24026    ///
24027    /// # Example
24028    /// ```ignore,no_run
24029    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24030    /// let x = ListServerTlsPoliciesRequest::new().set_page_size(42);
24031    /// ```
24032    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24033        self.page_size = v.into();
24034        self
24035    }
24036
24037    /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
24038    ///
24039    /// # Example
24040    /// ```ignore,no_run
24041    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24042    /// let x = ListServerTlsPoliciesRequest::new().set_page_token("example");
24043    /// ```
24044    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24045        self.page_token = v.into();
24046        self
24047    }
24048
24049    /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
24050    ///
24051    /// # Example
24052    /// ```ignore,no_run
24053    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24054    /// let x = ListServerTlsPoliciesRequest::new().set_return_partial_success(true);
24055    /// ```
24056    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24057        self.return_partial_success = v.into();
24058        self
24059    }
24060}
24061
24062impl wkt::message::Message for ListServerTlsPoliciesRequest {
24063    fn typename() -> &'static str {
24064        "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
24065    }
24066}
24067
24068/// Response returned by the ListServerTlsPolicies method.
24069#[derive(Clone, Default, PartialEq)]
24070#[non_exhaustive]
24071pub struct ListServerTlsPoliciesResponse {
24072    /// List of ServerTlsPolicy resources.
24073    pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
24074
24075    /// If there might be more results than those appearing in this response, then
24076    /// `next_page_token` is included. To get the next set of results, call this
24077    /// method again using the value of `next_page_token` as `page_token`.
24078    pub next_page_token: std::string::String,
24079
24080    /// Unreachable resources. Populated when the request opts into
24081    /// `return_partial_success` and reading across collections e.g. when
24082    /// attempting to list all resources across all supported locations.
24083    pub unreachable: std::vec::Vec<std::string::String>,
24084
24085    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24086}
24087
24088impl ListServerTlsPoliciesResponse {
24089    /// Creates a new default instance.
24090    pub fn new() -> Self {
24091        std::default::Default::default()
24092    }
24093
24094    /// Sets the value of [server_tls_policies][crate::model::ListServerTlsPoliciesResponse::server_tls_policies].
24095    ///
24096    /// # Example
24097    /// ```ignore,no_run
24098    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24099    /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24100    /// let x = ListServerTlsPoliciesResponse::new()
24101    ///     .set_server_tls_policies([
24102    ///         ServerTlsPolicy::default()/* use setters */,
24103    ///         ServerTlsPolicy::default()/* use (different) setters */,
24104    ///     ]);
24105    /// ```
24106    pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
24107    where
24108        T: std::iter::IntoIterator<Item = V>,
24109        V: std::convert::Into<crate::model::ServerTlsPolicy>,
24110    {
24111        use std::iter::Iterator;
24112        self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
24113        self
24114    }
24115
24116    /// Sets the value of [next_page_token][crate::model::ListServerTlsPoliciesResponse::next_page_token].
24117    ///
24118    /// # Example
24119    /// ```ignore,no_run
24120    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24121    /// let x = ListServerTlsPoliciesResponse::new().set_next_page_token("example");
24122    /// ```
24123    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24124        self.next_page_token = v.into();
24125        self
24126    }
24127
24128    /// Sets the value of [unreachable][crate::model::ListServerTlsPoliciesResponse::unreachable].
24129    ///
24130    /// # Example
24131    /// ```ignore,no_run
24132    /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24133    /// let x = ListServerTlsPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
24134    /// ```
24135    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
24136    where
24137        T: std::iter::IntoIterator<Item = V>,
24138        V: std::convert::Into<std::string::String>,
24139    {
24140        use std::iter::Iterator;
24141        self.unreachable = v.into_iter().map(|i| i.into()).collect();
24142        self
24143    }
24144}
24145
24146impl wkt::message::Message for ListServerTlsPoliciesResponse {
24147    fn typename() -> &'static str {
24148        "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
24149    }
24150}
24151
24152#[doc(hidden)]
24153impl google_cloud_gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
24154    type PageItem = crate::model::ServerTlsPolicy;
24155
24156    fn items(self) -> std::vec::Vec<Self::PageItem> {
24157        self.server_tls_policies
24158    }
24159
24160    fn next_page_token(&self) -> std::string::String {
24161        use std::clone::Clone;
24162        self.next_page_token.clone()
24163    }
24164}
24165
24166/// Request used by the GetServerTlsPolicy method.
24167#[derive(Clone, Default, PartialEq)]
24168#[non_exhaustive]
24169pub struct GetServerTlsPolicyRequest {
24170    /// Required. A name of the ServerTlsPolicy to get. Must be in the format
24171    /// `projects/*/locations/{location}/serverTlsPolicies/*`.
24172    pub name: std::string::String,
24173
24174    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24175}
24176
24177impl GetServerTlsPolicyRequest {
24178    /// Creates a new default instance.
24179    pub fn new() -> Self {
24180        std::default::Default::default()
24181    }
24182
24183    /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
24184    ///
24185    /// # Example
24186    /// ```ignore,no_run
24187    /// # use google_cloud_networksecurity_v1::model::GetServerTlsPolicyRequest;
24188    /// # let project_id = "project_id";
24189    /// # let location_id = "location_id";
24190    /// # let server_tls_policy_id = "server_tls_policy_id";
24191    /// let x = GetServerTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
24192    /// ```
24193    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24194        self.name = v.into();
24195        self
24196    }
24197}
24198
24199impl wkt::message::Message for GetServerTlsPolicyRequest {
24200    fn typename() -> &'static str {
24201        "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
24202    }
24203}
24204
24205/// Request used by the CreateServerTlsPolicy method.
24206#[derive(Clone, Default, PartialEq)]
24207#[non_exhaustive]
24208pub struct CreateServerTlsPolicyRequest {
24209    /// Required. The parent resource of the ServerTlsPolicy. Must be in
24210    /// the format `projects/*/locations/{location}`.
24211    pub parent: std::string::String,
24212
24213    /// Required. Short name of the ServerTlsPolicy resource to be created. This
24214    /// value should be 1-63 characters long, containing only letters, numbers,
24215    /// hyphens, and underscores, and should not start with a number. E.g.
24216    /// "server_mtls_policy".
24217    pub server_tls_policy_id: std::string::String,
24218
24219    /// Required. ServerTlsPolicy resource to be created.
24220    pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
24221
24222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24223}
24224
24225impl CreateServerTlsPolicyRequest {
24226    /// Creates a new default instance.
24227    pub fn new() -> Self {
24228        std::default::Default::default()
24229    }
24230
24231    /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
24232    ///
24233    /// # Example
24234    /// ```ignore,no_run
24235    /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24236    /// # let project_id = "project_id";
24237    /// # let location_id = "location_id";
24238    /// let x = CreateServerTlsPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
24239    /// ```
24240    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24241        self.parent = v.into();
24242        self
24243    }
24244
24245    /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
24246    ///
24247    /// # Example
24248    /// ```ignore,no_run
24249    /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24250    /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy_id("example");
24251    /// ```
24252    pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
24253        mut self,
24254        v: T,
24255    ) -> Self {
24256        self.server_tls_policy_id = v.into();
24257        self
24258    }
24259
24260    /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
24261    ///
24262    /// # Example
24263    /// ```ignore,no_run
24264    /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24265    /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24266    /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
24267    /// ```
24268    pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
24269    where
24270        T: std::convert::Into<crate::model::ServerTlsPolicy>,
24271    {
24272        self.server_tls_policy = std::option::Option::Some(v.into());
24273        self
24274    }
24275
24276    /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
24277    ///
24278    /// # Example
24279    /// ```ignore,no_run
24280    /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24281    /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24282    /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
24283    /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
24284    /// ```
24285    pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
24286    where
24287        T: std::convert::Into<crate::model::ServerTlsPolicy>,
24288    {
24289        self.server_tls_policy = v.map(|x| x.into());
24290        self
24291    }
24292}
24293
24294impl wkt::message::Message for CreateServerTlsPolicyRequest {
24295    fn typename() -> &'static str {
24296        "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
24297    }
24298}
24299
24300/// Request used by UpdateServerTlsPolicy method.
24301#[derive(Clone, Default, PartialEq)]
24302#[non_exhaustive]
24303pub struct UpdateServerTlsPolicyRequest {
24304    /// Optional. Field mask is used to specify the fields to be overwritten in the
24305    /// ServerTlsPolicy resource by the update.  The fields
24306    /// specified in the update_mask are relative to the resource, not
24307    /// the full request. A field will be overwritten if it is in the
24308    /// mask. If the user does not provide a mask then all fields will be
24309    /// overwritten.
24310    pub update_mask: std::option::Option<wkt::FieldMask>,
24311
24312    /// Required. Updated ServerTlsPolicy resource.
24313    pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
24314
24315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24316}
24317
24318impl UpdateServerTlsPolicyRequest {
24319    /// Creates a new default instance.
24320    pub fn new() -> Self {
24321        std::default::Default::default()
24322    }
24323
24324    /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
24325    ///
24326    /// # Example
24327    /// ```ignore,no_run
24328    /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24329    /// use wkt::FieldMask;
24330    /// let x = UpdateServerTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
24331    /// ```
24332    pub fn set_update_mask<T>(mut self, v: T) -> Self
24333    where
24334        T: std::convert::Into<wkt::FieldMask>,
24335    {
24336        self.update_mask = std::option::Option::Some(v.into());
24337        self
24338    }
24339
24340    /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
24341    ///
24342    /// # Example
24343    /// ```ignore,no_run
24344    /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24345    /// use wkt::FieldMask;
24346    /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
24347    /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
24348    /// ```
24349    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24350    where
24351        T: std::convert::Into<wkt::FieldMask>,
24352    {
24353        self.update_mask = v.map(|x| x.into());
24354        self
24355    }
24356
24357    /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
24358    ///
24359    /// # Example
24360    /// ```ignore,no_run
24361    /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24362    /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24363    /// let x = UpdateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
24364    /// ```
24365    pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
24366    where
24367        T: std::convert::Into<crate::model::ServerTlsPolicy>,
24368    {
24369        self.server_tls_policy = std::option::Option::Some(v.into());
24370        self
24371    }
24372
24373    /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
24374    ///
24375    /// # Example
24376    /// ```ignore,no_run
24377    /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24378    /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24379    /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
24380    /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
24381    /// ```
24382    pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
24383    where
24384        T: std::convert::Into<crate::model::ServerTlsPolicy>,
24385    {
24386        self.server_tls_policy = v.map(|x| x.into());
24387        self
24388    }
24389}
24390
24391impl wkt::message::Message for UpdateServerTlsPolicyRequest {
24392    fn typename() -> &'static str {
24393        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
24394    }
24395}
24396
24397/// Request used by the DeleteServerTlsPolicy method.
24398#[derive(Clone, Default, PartialEq)]
24399#[non_exhaustive]
24400pub struct DeleteServerTlsPolicyRequest {
24401    /// Required. A name of the ServerTlsPolicy to delete. Must be in
24402    /// the format `projects/*/locations/{location}/serverTlsPolicies/*`.
24403    pub name: std::string::String,
24404
24405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24406}
24407
24408impl DeleteServerTlsPolicyRequest {
24409    /// Creates a new default instance.
24410    pub fn new() -> Self {
24411        std::default::Default::default()
24412    }
24413
24414    /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
24415    ///
24416    /// # Example
24417    /// ```ignore,no_run
24418    /// # use google_cloud_networksecurity_v1::model::DeleteServerTlsPolicyRequest;
24419    /// # let project_id = "project_id";
24420    /// # let location_id = "location_id";
24421    /// # let server_tls_policy_id = "server_tls_policy_id";
24422    /// let x = DeleteServerTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
24423    /// ```
24424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24425        self.name = v.into();
24426        self
24427    }
24428}
24429
24430impl wkt::message::Message for DeleteServerTlsPolicyRequest {
24431    fn typename() -> &'static str {
24432        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
24433    }
24434}
24435
24436/// Represents a Secure Access Connect (SAC) realm resource.
24437///
24438/// A Secure Access Connect realm establishes a connection between your Google
24439/// Cloud project and an SSE service.
24440#[derive(Clone, Default, PartialEq)]
24441#[non_exhaustive]
24442pub struct SACRealm {
24443    /// Identifier. Resource name, in the form
24444    /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
24445    pub name: std::string::String,
24446
24447    /// Output only. Timestamp when the realm was created.
24448    pub create_time: std::option::Option<wkt::Timestamp>,
24449
24450    /// Output only. Timestamp when the realm was last updated.
24451    pub update_time: std::option::Option<wkt::Timestamp>,
24452
24453    /// Optional. Optional list of labels applied to the resource.
24454    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
24455
24456    /// Immutable. SSE service provider associated with the realm.
24457    pub security_service: crate::model::sac_realm::SecurityService,
24458
24459    /// Output only. Key to be shared with SSE service provider during pairing.
24460    pub pairing_key: std::option::Option<crate::model::sac_realm::PairingKey>,
24461
24462    /// Output only. State of the realm.
24463    pub state: crate::model::sac_realm::State,
24464
24465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24466}
24467
24468impl SACRealm {
24469    /// Creates a new default instance.
24470    pub fn new() -> Self {
24471        std::default::Default::default()
24472    }
24473
24474    /// Sets the value of [name][crate::model::SACRealm::name].
24475    ///
24476    /// # Example
24477    /// ```ignore,no_run
24478    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24479    /// # let project_id = "project_id";
24480    /// # let location_id = "location_id";
24481    /// # let sac_realm_id = "sac_realm_id";
24482    /// let x = SACRealm::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
24483    /// ```
24484    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24485        self.name = v.into();
24486        self
24487    }
24488
24489    /// Sets the value of [create_time][crate::model::SACRealm::create_time].
24490    ///
24491    /// # Example
24492    /// ```ignore,no_run
24493    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24494    /// use wkt::Timestamp;
24495    /// let x = SACRealm::new().set_create_time(Timestamp::default()/* use setters */);
24496    /// ```
24497    pub fn set_create_time<T>(mut self, v: T) -> Self
24498    where
24499        T: std::convert::Into<wkt::Timestamp>,
24500    {
24501        self.create_time = std::option::Option::Some(v.into());
24502        self
24503    }
24504
24505    /// Sets or clears the value of [create_time][crate::model::SACRealm::create_time].
24506    ///
24507    /// # Example
24508    /// ```ignore,no_run
24509    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24510    /// use wkt::Timestamp;
24511    /// let x = SACRealm::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
24512    /// let x = SACRealm::new().set_or_clear_create_time(None::<Timestamp>);
24513    /// ```
24514    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24515    where
24516        T: std::convert::Into<wkt::Timestamp>,
24517    {
24518        self.create_time = v.map(|x| x.into());
24519        self
24520    }
24521
24522    /// Sets the value of [update_time][crate::model::SACRealm::update_time].
24523    ///
24524    /// # Example
24525    /// ```ignore,no_run
24526    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24527    /// use wkt::Timestamp;
24528    /// let x = SACRealm::new().set_update_time(Timestamp::default()/* use setters */);
24529    /// ```
24530    pub fn set_update_time<T>(mut self, v: T) -> Self
24531    where
24532        T: std::convert::Into<wkt::Timestamp>,
24533    {
24534        self.update_time = std::option::Option::Some(v.into());
24535        self
24536    }
24537
24538    /// Sets or clears the value of [update_time][crate::model::SACRealm::update_time].
24539    ///
24540    /// # Example
24541    /// ```ignore,no_run
24542    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24543    /// use wkt::Timestamp;
24544    /// let x = SACRealm::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
24545    /// let x = SACRealm::new().set_or_clear_update_time(None::<Timestamp>);
24546    /// ```
24547    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24548    where
24549        T: std::convert::Into<wkt::Timestamp>,
24550    {
24551        self.update_time = v.map(|x| x.into());
24552        self
24553    }
24554
24555    /// Sets the value of [labels][crate::model::SACRealm::labels].
24556    ///
24557    /// # Example
24558    /// ```ignore,no_run
24559    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24560    /// let x = SACRealm::new().set_labels([
24561    ///     ("key0", "abc"),
24562    ///     ("key1", "xyz"),
24563    /// ]);
24564    /// ```
24565    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
24566    where
24567        T: std::iter::IntoIterator<Item = (K, V)>,
24568        K: std::convert::Into<std::string::String>,
24569        V: std::convert::Into<std::string::String>,
24570    {
24571        use std::iter::Iterator;
24572        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
24573        self
24574    }
24575
24576    /// Sets the value of [security_service][crate::model::SACRealm::security_service].
24577    ///
24578    /// # Example
24579    /// ```ignore,no_run
24580    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24581    /// use google_cloud_networksecurity_v1::model::sac_realm::SecurityService;
24582    /// let x0 = SACRealm::new().set_security_service(SecurityService::PaloAltoPrismaAccess);
24583    /// ```
24584    pub fn set_security_service<T: std::convert::Into<crate::model::sac_realm::SecurityService>>(
24585        mut self,
24586        v: T,
24587    ) -> Self {
24588        self.security_service = v.into();
24589        self
24590    }
24591
24592    /// Sets the value of [pairing_key][crate::model::SACRealm::pairing_key].
24593    ///
24594    /// # Example
24595    /// ```ignore,no_run
24596    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24597    /// use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24598    /// let x = SACRealm::new().set_pairing_key(PairingKey::default()/* use setters */);
24599    /// ```
24600    pub fn set_pairing_key<T>(mut self, v: T) -> Self
24601    where
24602        T: std::convert::Into<crate::model::sac_realm::PairingKey>,
24603    {
24604        self.pairing_key = std::option::Option::Some(v.into());
24605        self
24606    }
24607
24608    /// Sets or clears the value of [pairing_key][crate::model::SACRealm::pairing_key].
24609    ///
24610    /// # Example
24611    /// ```ignore,no_run
24612    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24613    /// use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24614    /// let x = SACRealm::new().set_or_clear_pairing_key(Some(PairingKey::default()/* use setters */));
24615    /// let x = SACRealm::new().set_or_clear_pairing_key(None::<PairingKey>);
24616    /// ```
24617    pub fn set_or_clear_pairing_key<T>(mut self, v: std::option::Option<T>) -> Self
24618    where
24619        T: std::convert::Into<crate::model::sac_realm::PairingKey>,
24620    {
24621        self.pairing_key = v.map(|x| x.into());
24622        self
24623    }
24624
24625    /// Sets the value of [state][crate::model::SACRealm::state].
24626    ///
24627    /// # Example
24628    /// ```ignore,no_run
24629    /// # use google_cloud_networksecurity_v1::model::SACRealm;
24630    /// use google_cloud_networksecurity_v1::model::sac_realm::State;
24631    /// let x0 = SACRealm::new().set_state(State::PendingPartnerAttachment);
24632    /// let x1 = SACRealm::new().set_state(State::PartnerAttached);
24633    /// let x2 = SACRealm::new().set_state(State::PartnerDetached);
24634    /// ```
24635    pub fn set_state<T: std::convert::Into<crate::model::sac_realm::State>>(
24636        mut self,
24637        v: T,
24638    ) -> Self {
24639        self.state = v.into();
24640        self
24641    }
24642}
24643
24644impl wkt::message::Message for SACRealm {
24645    fn typename() -> &'static str {
24646        "type.googleapis.com/google.cloud.networksecurity.v1.SACRealm"
24647    }
24648}
24649
24650/// Defines additional types related to [SACRealm].
24651pub mod sac_realm {
24652    #[allow(unused_imports)]
24653    use super::*;
24654
24655    /// Key to be shared with SSE service provider to establish global handshake.
24656    #[derive(Clone, Default, PartialEq)]
24657    #[non_exhaustive]
24658    pub struct PairingKey {
24659        /// Output only. Key value.
24660        pub key: std::string::String,
24661
24662        /// Output only. Timestamp in UTC of when this resource is considered
24663        /// expired. It expires 7 days after creation.
24664        pub expire_time: std::option::Option<wkt::Timestamp>,
24665
24666        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24667    }
24668
24669    impl PairingKey {
24670        /// Creates a new default instance.
24671        pub fn new() -> Self {
24672            std::default::Default::default()
24673        }
24674
24675        /// Sets the value of [key][crate::model::sac_realm::PairingKey::key].
24676        ///
24677        /// # Example
24678        /// ```ignore,no_run
24679        /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24680        /// let x = PairingKey::new().set_key("example");
24681        /// ```
24682        pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24683            self.key = v.into();
24684            self
24685        }
24686
24687        /// Sets the value of [expire_time][crate::model::sac_realm::PairingKey::expire_time].
24688        ///
24689        /// # Example
24690        /// ```ignore,no_run
24691        /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24692        /// use wkt::Timestamp;
24693        /// let x = PairingKey::new().set_expire_time(Timestamp::default()/* use setters */);
24694        /// ```
24695        pub fn set_expire_time<T>(mut self, v: T) -> Self
24696        where
24697            T: std::convert::Into<wkt::Timestamp>,
24698        {
24699            self.expire_time = std::option::Option::Some(v.into());
24700            self
24701        }
24702
24703        /// Sets or clears the value of [expire_time][crate::model::sac_realm::PairingKey::expire_time].
24704        ///
24705        /// # Example
24706        /// ```ignore,no_run
24707        /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24708        /// use wkt::Timestamp;
24709        /// let x = PairingKey::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
24710        /// let x = PairingKey::new().set_or_clear_expire_time(None::<Timestamp>);
24711        /// ```
24712        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
24713        where
24714            T: std::convert::Into<wkt::Timestamp>,
24715        {
24716            self.expire_time = v.map(|x| x.into());
24717            self
24718        }
24719    }
24720
24721    impl wkt::message::Message for PairingKey {
24722        fn typename() -> &'static str {
24723            "type.googleapis.com/google.cloud.networksecurity.v1.SACRealm.PairingKey"
24724        }
24725    }
24726
24727    /// SSE service provider
24728    ///
24729    /// # Working with unknown values
24730    ///
24731    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24732    /// additional enum variants at any time. Adding new variants is not considered
24733    /// a breaking change. Applications should write their code in anticipation of:
24734    ///
24735    /// - New values appearing in future releases of the client library, **and**
24736    /// - New values received dynamically, without application changes.
24737    ///
24738    /// Please consult the [Working with enums] section in the user guide for some
24739    /// guidelines.
24740    ///
24741    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24742    #[derive(Clone, Debug, PartialEq)]
24743    #[non_exhaustive]
24744    pub enum SecurityService {
24745        /// The default value. This value is used if the state is omitted.
24746        Unspecified,
24747        /// [Palo Alto Networks Prisma
24748        /// Access](https://www.paloaltonetworks.com/sase/access).
24749        PaloAltoPrismaAccess,
24750        /// If set, the enum was initialized with an unknown value.
24751        ///
24752        /// Applications can examine the value using [SecurityService::value] or
24753        /// [SecurityService::name].
24754        UnknownValue(security_service::UnknownValue),
24755    }
24756
24757    #[doc(hidden)]
24758    pub mod security_service {
24759        #[allow(unused_imports)]
24760        use super::*;
24761        #[derive(Clone, Debug, PartialEq)]
24762        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24763    }
24764
24765    impl SecurityService {
24766        /// Gets the enum value.
24767        ///
24768        /// Returns `None` if the enum contains an unknown value deserialized from
24769        /// the string representation of enums.
24770        pub fn value(&self) -> std::option::Option<i32> {
24771            match self {
24772                Self::Unspecified => std::option::Option::Some(0),
24773                Self::PaloAltoPrismaAccess => std::option::Option::Some(1),
24774                Self::UnknownValue(u) => u.0.value(),
24775            }
24776        }
24777
24778        /// Gets the enum value as a string.
24779        ///
24780        /// Returns `None` if the enum contains an unknown value deserialized from
24781        /// the integer representation of enums.
24782        pub fn name(&self) -> std::option::Option<&str> {
24783            match self {
24784                Self::Unspecified => std::option::Option::Some("SECURITY_SERVICE_UNSPECIFIED"),
24785                Self::PaloAltoPrismaAccess => std::option::Option::Some("PALO_ALTO_PRISMA_ACCESS"),
24786                Self::UnknownValue(u) => u.0.name(),
24787            }
24788        }
24789    }
24790
24791    impl std::default::Default for SecurityService {
24792        fn default() -> Self {
24793            use std::convert::From;
24794            Self::from(0)
24795        }
24796    }
24797
24798    impl std::fmt::Display for SecurityService {
24799        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24800            wkt::internal::display_enum(f, self.name(), self.value())
24801        }
24802    }
24803
24804    impl std::convert::From<i32> for SecurityService {
24805        fn from(value: i32) -> Self {
24806            match value {
24807                0 => Self::Unspecified,
24808                1 => Self::PaloAltoPrismaAccess,
24809                _ => Self::UnknownValue(security_service::UnknownValue(
24810                    wkt::internal::UnknownEnumValue::Integer(value),
24811                )),
24812            }
24813        }
24814    }
24815
24816    impl std::convert::From<&str> for SecurityService {
24817        fn from(value: &str) -> Self {
24818            use std::string::ToString;
24819            match value {
24820                "SECURITY_SERVICE_UNSPECIFIED" => Self::Unspecified,
24821                "PALO_ALTO_PRISMA_ACCESS" => Self::PaloAltoPrismaAccess,
24822                _ => Self::UnknownValue(security_service::UnknownValue(
24823                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24824                )),
24825            }
24826        }
24827    }
24828
24829    impl serde::ser::Serialize for SecurityService {
24830        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24831        where
24832            S: serde::Serializer,
24833        {
24834            match self {
24835                Self::Unspecified => serializer.serialize_i32(0),
24836                Self::PaloAltoPrismaAccess => serializer.serialize_i32(1),
24837                Self::UnknownValue(u) => u.0.serialize(serializer),
24838            }
24839        }
24840    }
24841
24842    impl<'de> serde::de::Deserialize<'de> for SecurityService {
24843        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24844        where
24845            D: serde::Deserializer<'de>,
24846        {
24847            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityService>::new(
24848                ".google.cloud.networksecurity.v1.SACRealm.SecurityService",
24849            ))
24850        }
24851    }
24852
24853    /// State of the realm.
24854    ///
24855    /// # Working with unknown values
24856    ///
24857    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24858    /// additional enum variants at any time. Adding new variants is not considered
24859    /// a breaking change. Applications should write their code in anticipation of:
24860    ///
24861    /// - New values appearing in future releases of the client library, **and**
24862    /// - New values received dynamically, without application changes.
24863    ///
24864    /// Please consult the [Working with enums] section in the user guide for some
24865    /// guidelines.
24866    ///
24867    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24868    #[derive(Clone, Debug, PartialEq)]
24869    #[non_exhaustive]
24870    pub enum State {
24871        /// No state specified. This should not be used.
24872        Unspecified,
24873        /// Has never been attached to a partner.
24874        /// Used only for Prisma Access.
24875        PendingPartnerAttachment,
24876        /// Currently attached to a partner.
24877        PartnerAttached,
24878        /// Was once attached to a partner but has been detached.
24879        PartnerDetached,
24880        /// Is not attached to a partner and has an expired pairing key.
24881        /// Used only for Prisma Access.
24882        KeyExpired,
24883        /// If set, the enum was initialized with an unknown value.
24884        ///
24885        /// Applications can examine the value using [State::value] or
24886        /// [State::name].
24887        UnknownValue(state::UnknownValue),
24888    }
24889
24890    #[doc(hidden)]
24891    pub mod state {
24892        #[allow(unused_imports)]
24893        use super::*;
24894        #[derive(Clone, Debug, PartialEq)]
24895        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24896    }
24897
24898    impl State {
24899        /// Gets the enum value.
24900        ///
24901        /// Returns `None` if the enum contains an unknown value deserialized from
24902        /// the string representation of enums.
24903        pub fn value(&self) -> std::option::Option<i32> {
24904            match self {
24905                Self::Unspecified => std::option::Option::Some(0),
24906                Self::PendingPartnerAttachment => std::option::Option::Some(7),
24907                Self::PartnerAttached => std::option::Option::Some(1),
24908                Self::PartnerDetached => std::option::Option::Some(2),
24909                Self::KeyExpired => std::option::Option::Some(3),
24910                Self::UnknownValue(u) => u.0.value(),
24911            }
24912        }
24913
24914        /// Gets the enum value as a string.
24915        ///
24916        /// Returns `None` if the enum contains an unknown value deserialized from
24917        /// the integer representation of enums.
24918        pub fn name(&self) -> std::option::Option<&str> {
24919            match self {
24920                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
24921                Self::PendingPartnerAttachment => {
24922                    std::option::Option::Some("PENDING_PARTNER_ATTACHMENT")
24923                }
24924                Self::PartnerAttached => std::option::Option::Some("PARTNER_ATTACHED"),
24925                Self::PartnerDetached => std::option::Option::Some("PARTNER_DETACHED"),
24926                Self::KeyExpired => std::option::Option::Some("KEY_EXPIRED"),
24927                Self::UnknownValue(u) => u.0.name(),
24928            }
24929        }
24930    }
24931
24932    impl std::default::Default for State {
24933        fn default() -> Self {
24934            use std::convert::From;
24935            Self::from(0)
24936        }
24937    }
24938
24939    impl std::fmt::Display for State {
24940        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24941            wkt::internal::display_enum(f, self.name(), self.value())
24942        }
24943    }
24944
24945    impl std::convert::From<i32> for State {
24946        fn from(value: i32) -> Self {
24947            match value {
24948                0 => Self::Unspecified,
24949                1 => Self::PartnerAttached,
24950                2 => Self::PartnerDetached,
24951                3 => Self::KeyExpired,
24952                7 => Self::PendingPartnerAttachment,
24953                _ => Self::UnknownValue(state::UnknownValue(
24954                    wkt::internal::UnknownEnumValue::Integer(value),
24955                )),
24956            }
24957        }
24958    }
24959
24960    impl std::convert::From<&str> for State {
24961        fn from(value: &str) -> Self {
24962            use std::string::ToString;
24963            match value {
24964                "STATE_UNSPECIFIED" => Self::Unspecified,
24965                "PENDING_PARTNER_ATTACHMENT" => Self::PendingPartnerAttachment,
24966                "PARTNER_ATTACHED" => Self::PartnerAttached,
24967                "PARTNER_DETACHED" => Self::PartnerDetached,
24968                "KEY_EXPIRED" => Self::KeyExpired,
24969                _ => Self::UnknownValue(state::UnknownValue(
24970                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24971                )),
24972            }
24973        }
24974    }
24975
24976    impl serde::ser::Serialize for State {
24977        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24978        where
24979            S: serde::Serializer,
24980        {
24981            match self {
24982                Self::Unspecified => serializer.serialize_i32(0),
24983                Self::PendingPartnerAttachment => serializer.serialize_i32(7),
24984                Self::PartnerAttached => serializer.serialize_i32(1),
24985                Self::PartnerDetached => serializer.serialize_i32(2),
24986                Self::KeyExpired => serializer.serialize_i32(3),
24987                Self::UnknownValue(u) => u.0.serialize(serializer),
24988            }
24989        }
24990    }
24991
24992    impl<'de> serde::de::Deserialize<'de> for State {
24993        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24994        where
24995            D: serde::Deserializer<'de>,
24996        {
24997            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
24998                ".google.cloud.networksecurity.v1.SACRealm.State",
24999            ))
25000        }
25001    }
25002}
25003
25004/// Request for `ListSACRealms` method.
25005#[derive(Clone, Default, PartialEq)]
25006#[non_exhaustive]
25007pub struct ListSACRealmsRequest {
25008    /// Required. The parent, in the form `projects/{project}/locations/global`.
25009    pub parent: std::string::String,
25010
25011    /// Optional. Requested page size. Server may return fewer items than
25012    /// requested. If unspecified, server will pick an appropriate default.
25013    pub page_size: i32,
25014
25015    /// Optional. A token identifying a page of results the server should return.
25016    pub page_token: std::string::String,
25017
25018    /// Optional. An expression that filters the list of results.
25019    pub filter: std::string::String,
25020
25021    /// Optional. Sort the results by a certain order.
25022    pub order_by: std::string::String,
25023
25024    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25025}
25026
25027impl ListSACRealmsRequest {
25028    /// Creates a new default instance.
25029    pub fn new() -> Self {
25030        std::default::Default::default()
25031    }
25032
25033    /// Sets the value of [parent][crate::model::ListSACRealmsRequest::parent].
25034    ///
25035    /// # Example
25036    /// ```ignore,no_run
25037    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25038    /// # let project_id = "project_id";
25039    /// # let location_id = "location_id";
25040    /// let x = ListSACRealmsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25041    /// ```
25042    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25043        self.parent = v.into();
25044        self
25045    }
25046
25047    /// Sets the value of [page_size][crate::model::ListSACRealmsRequest::page_size].
25048    ///
25049    /// # Example
25050    /// ```ignore,no_run
25051    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25052    /// let x = ListSACRealmsRequest::new().set_page_size(42);
25053    /// ```
25054    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25055        self.page_size = v.into();
25056        self
25057    }
25058
25059    /// Sets the value of [page_token][crate::model::ListSACRealmsRequest::page_token].
25060    ///
25061    /// # Example
25062    /// ```ignore,no_run
25063    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25064    /// let x = ListSACRealmsRequest::new().set_page_token("example");
25065    /// ```
25066    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25067        self.page_token = v.into();
25068        self
25069    }
25070
25071    /// Sets the value of [filter][crate::model::ListSACRealmsRequest::filter].
25072    ///
25073    /// # Example
25074    /// ```ignore,no_run
25075    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25076    /// let x = ListSACRealmsRequest::new().set_filter("example");
25077    /// ```
25078    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25079        self.filter = v.into();
25080        self
25081    }
25082
25083    /// Sets the value of [order_by][crate::model::ListSACRealmsRequest::order_by].
25084    ///
25085    /// # Example
25086    /// ```ignore,no_run
25087    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25088    /// let x = ListSACRealmsRequest::new().set_order_by("example");
25089    /// ```
25090    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25091        self.order_by = v.into();
25092        self
25093    }
25094}
25095
25096impl wkt::message::Message for ListSACRealmsRequest {
25097    fn typename() -> &'static str {
25098        "type.googleapis.com/google.cloud.networksecurity.v1.ListSACRealmsRequest"
25099    }
25100}
25101
25102/// Response for `ListSACRealms` method.
25103#[derive(Clone, Default, PartialEq)]
25104#[non_exhaustive]
25105pub struct ListSACRealmsResponse {
25106    /// The list of SACRealms.
25107    pub sac_realms: std::vec::Vec<crate::model::SACRealm>,
25108
25109    /// A token identifying a page of results the server should return.
25110    pub next_page_token: std::string::String,
25111
25112    /// Locations that could not be reached.
25113    pub unreachable: std::vec::Vec<std::string::String>,
25114
25115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25116}
25117
25118impl ListSACRealmsResponse {
25119    /// Creates a new default instance.
25120    pub fn new() -> Self {
25121        std::default::Default::default()
25122    }
25123
25124    /// Sets the value of [sac_realms][crate::model::ListSACRealmsResponse::sac_realms].
25125    ///
25126    /// # Example
25127    /// ```ignore,no_run
25128    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25129    /// use google_cloud_networksecurity_v1::model::SACRealm;
25130    /// let x = ListSACRealmsResponse::new()
25131    ///     .set_sac_realms([
25132    ///         SACRealm::default()/* use setters */,
25133    ///         SACRealm::default()/* use (different) setters */,
25134    ///     ]);
25135    /// ```
25136    pub fn set_sac_realms<T, V>(mut self, v: T) -> Self
25137    where
25138        T: std::iter::IntoIterator<Item = V>,
25139        V: std::convert::Into<crate::model::SACRealm>,
25140    {
25141        use std::iter::Iterator;
25142        self.sac_realms = v.into_iter().map(|i| i.into()).collect();
25143        self
25144    }
25145
25146    /// Sets the value of [next_page_token][crate::model::ListSACRealmsResponse::next_page_token].
25147    ///
25148    /// # Example
25149    /// ```ignore,no_run
25150    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25151    /// let x = ListSACRealmsResponse::new().set_next_page_token("example");
25152    /// ```
25153    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25154        self.next_page_token = v.into();
25155        self
25156    }
25157
25158    /// Sets the value of [unreachable][crate::model::ListSACRealmsResponse::unreachable].
25159    ///
25160    /// # Example
25161    /// ```ignore,no_run
25162    /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25163    /// let x = ListSACRealmsResponse::new().set_unreachable(["a", "b", "c"]);
25164    /// ```
25165    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25166    where
25167        T: std::iter::IntoIterator<Item = V>,
25168        V: std::convert::Into<std::string::String>,
25169    {
25170        use std::iter::Iterator;
25171        self.unreachable = v.into_iter().map(|i| i.into()).collect();
25172        self
25173    }
25174}
25175
25176impl wkt::message::Message for ListSACRealmsResponse {
25177    fn typename() -> &'static str {
25178        "type.googleapis.com/google.cloud.networksecurity.v1.ListSACRealmsResponse"
25179    }
25180}
25181
25182#[doc(hidden)]
25183impl google_cloud_gax::paginator::internal::PageableResponse for ListSACRealmsResponse {
25184    type PageItem = crate::model::SACRealm;
25185
25186    fn items(self) -> std::vec::Vec<Self::PageItem> {
25187        self.sac_realms
25188    }
25189
25190    fn next_page_token(&self) -> std::string::String {
25191        use std::clone::Clone;
25192        self.next_page_token.clone()
25193    }
25194}
25195
25196/// Request for `GetSACRealm` method.
25197#[derive(Clone, Default, PartialEq)]
25198#[non_exhaustive]
25199pub struct GetSACRealmRequest {
25200    /// Required. Name of the resource, in the form
25201    /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
25202    pub name: std::string::String,
25203
25204    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25205}
25206
25207impl GetSACRealmRequest {
25208    /// Creates a new default instance.
25209    pub fn new() -> Self {
25210        std::default::Default::default()
25211    }
25212
25213    /// Sets the value of [name][crate::model::GetSACRealmRequest::name].
25214    ///
25215    /// # Example
25216    /// ```ignore,no_run
25217    /// # use google_cloud_networksecurity_v1::model::GetSACRealmRequest;
25218    /// # let project_id = "project_id";
25219    /// # let location_id = "location_id";
25220    /// # let sac_realm_id = "sac_realm_id";
25221    /// let x = GetSACRealmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
25222    /// ```
25223    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25224        self.name = v.into();
25225        self
25226    }
25227}
25228
25229impl wkt::message::Message for GetSACRealmRequest {
25230    fn typename() -> &'static str {
25231        "type.googleapis.com/google.cloud.networksecurity.v1.GetSACRealmRequest"
25232    }
25233}
25234
25235/// Request for `CreateSACRealm` method.
25236#[derive(Clone, Default, PartialEq)]
25237#[non_exhaustive]
25238pub struct CreateSACRealmRequest {
25239    /// Required. The parent, in the form `projects/{project}/locations/global`.
25240    pub parent: std::string::String,
25241
25242    /// Required. ID of the created realm.
25243    /// The ID must be 1-63 characters long, and comply with
25244    /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
25245    /// Specifically, it must be 1-63 characters long and match the regular
25246    /// expression `[a-z]([-a-z0-9]*[a-z0-9])?`
25247    /// which means the first character must be a lowercase letter, and all
25248    /// following characters must be a dash, lowercase letter, or digit, except
25249    /// the last character, which cannot be a dash.
25250    pub sac_realm_id: std::string::String,
25251
25252    /// Required. The resource being created.
25253    pub sac_realm: std::option::Option<crate::model::SACRealm>,
25254
25255    /// Optional. An optional request ID to identify requests. Specify a unique
25256    /// request ID so that if you must retry your request, the server will know to
25257    /// ignore the request if it has already been completed. The server will
25258    /// guarantee that for at least 60 minutes since the first request.
25259    ///
25260    /// For example, consider a situation where you make an initial request and the
25261    /// request times out. If you make the request again with the same request
25262    /// ID, the server can check if original operation with the same request ID
25263    /// was received, and if so, will ignore the second request. This prevents
25264    /// clients from accidentally creating duplicate commitments.
25265    ///
25266    /// The request ID must be a valid UUID with the exception that zero UUID is
25267    /// not supported (00000000-0000-0000-0000-000000000000).
25268    pub request_id: std::string::String,
25269
25270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25271}
25272
25273impl CreateSACRealmRequest {
25274    /// Creates a new default instance.
25275    pub fn new() -> Self {
25276        std::default::Default::default()
25277    }
25278
25279    /// Sets the value of [parent][crate::model::CreateSACRealmRequest::parent].
25280    ///
25281    /// # Example
25282    /// ```ignore,no_run
25283    /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25284    /// # let project_id = "project_id";
25285    /// # let location_id = "location_id";
25286    /// let x = CreateSACRealmRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25287    /// ```
25288    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25289        self.parent = v.into();
25290        self
25291    }
25292
25293    /// Sets the value of [sac_realm_id][crate::model::CreateSACRealmRequest::sac_realm_id].
25294    ///
25295    /// # Example
25296    /// ```ignore,no_run
25297    /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25298    /// let x = CreateSACRealmRequest::new().set_sac_realm_id("example");
25299    /// ```
25300    pub fn set_sac_realm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25301        self.sac_realm_id = v.into();
25302        self
25303    }
25304
25305    /// Sets the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25306    ///
25307    /// # Example
25308    /// ```ignore,no_run
25309    /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25310    /// use google_cloud_networksecurity_v1::model::SACRealm;
25311    /// let x = CreateSACRealmRequest::new().set_sac_realm(SACRealm::default()/* use setters */);
25312    /// ```
25313    pub fn set_sac_realm<T>(mut self, v: T) -> Self
25314    where
25315        T: std::convert::Into<crate::model::SACRealm>,
25316    {
25317        self.sac_realm = std::option::Option::Some(v.into());
25318        self
25319    }
25320
25321    /// Sets or clears the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25322    ///
25323    /// # Example
25324    /// ```ignore,no_run
25325    /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25326    /// use google_cloud_networksecurity_v1::model::SACRealm;
25327    /// let x = CreateSACRealmRequest::new().set_or_clear_sac_realm(Some(SACRealm::default()/* use setters */));
25328    /// let x = CreateSACRealmRequest::new().set_or_clear_sac_realm(None::<SACRealm>);
25329    /// ```
25330    pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
25331    where
25332        T: std::convert::Into<crate::model::SACRealm>,
25333    {
25334        self.sac_realm = v.map(|x| x.into());
25335        self
25336    }
25337
25338    /// Sets the value of [request_id][crate::model::CreateSACRealmRequest::request_id].
25339    ///
25340    /// # Example
25341    /// ```ignore,no_run
25342    /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25343    /// let x = CreateSACRealmRequest::new().set_request_id("example");
25344    /// ```
25345    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25346        self.request_id = v.into();
25347        self
25348    }
25349}
25350
25351impl wkt::message::Message for CreateSACRealmRequest {
25352    fn typename() -> &'static str {
25353        "type.googleapis.com/google.cloud.networksecurity.v1.CreateSACRealmRequest"
25354    }
25355}
25356
25357/// Request for `DeleteSACRealm` method.
25358#[derive(Clone, Default, PartialEq)]
25359#[non_exhaustive]
25360pub struct DeleteSACRealmRequest {
25361    /// Required. Name of the resource, in the form
25362    /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
25363    pub name: std::string::String,
25364
25365    /// Optional. An optional request ID to identify requests. Specify a unique
25366    /// request ID so that if you must retry your request, the server will know to
25367    /// ignore the request if it has already been completed. The server will
25368    /// guarantee that for at least 60 minutes after the first request.
25369    ///
25370    /// For example, consider a situation where you make an initial request and the
25371    /// request times out. If you make the request again with the same request
25372    /// ID, the server can check if original operation with the same request ID
25373    /// was received, and if so, will ignore the second request. This prevents
25374    /// clients from accidentally creating duplicate commitments.
25375    ///
25376    /// The request ID must be a valid UUID with the exception that zero UUID is
25377    /// not supported (00000000-0000-0000-0000-000000000000).
25378    pub request_id: std::string::String,
25379
25380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25381}
25382
25383impl DeleteSACRealmRequest {
25384    /// Creates a new default instance.
25385    pub fn new() -> Self {
25386        std::default::Default::default()
25387    }
25388
25389    /// Sets the value of [name][crate::model::DeleteSACRealmRequest::name].
25390    ///
25391    /// # Example
25392    /// ```ignore,no_run
25393    /// # use google_cloud_networksecurity_v1::model::DeleteSACRealmRequest;
25394    /// # let project_id = "project_id";
25395    /// # let location_id = "location_id";
25396    /// # let sac_realm_id = "sac_realm_id";
25397    /// let x = DeleteSACRealmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
25398    /// ```
25399    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25400        self.name = v.into();
25401        self
25402    }
25403
25404    /// Sets the value of [request_id][crate::model::DeleteSACRealmRequest::request_id].
25405    ///
25406    /// # Example
25407    /// ```ignore,no_run
25408    /// # use google_cloud_networksecurity_v1::model::DeleteSACRealmRequest;
25409    /// let x = DeleteSACRealmRequest::new().set_request_id("example");
25410    /// ```
25411    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25412        self.request_id = v.into();
25413        self
25414    }
25415}
25416
25417impl wkt::message::Message for DeleteSACRealmRequest {
25418    fn typename() -> &'static str {
25419        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSACRealmRequest"
25420    }
25421}
25422
25423/// Represents a Secure Access Connect (SAC) attachment resource.
25424///
25425/// A Secure Access Connect attachment enables NCC Gateway to process traffic
25426/// with an SSE product.
25427#[derive(Clone, Default, PartialEq)]
25428#[non_exhaustive]
25429pub struct SACAttachment {
25430    /// Identifier. Resource name, in the form
25431    /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
25432    pub name: std::string::String,
25433
25434    /// Output only. Timestamp when the attachment was created.
25435    pub create_time: std::option::Option<wkt::Timestamp>,
25436
25437    /// Output only. Timestamp when the attachment was last updated.
25438    pub update_time: std::option::Option<wkt::Timestamp>,
25439
25440    /// Optional. Optional list of labels applied to the resource.
25441    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
25442
25443    /// Required. SAC Realm which owns the attachment. This can be input as an ID
25444    /// or a full resource name. The output always has the form
25445    /// `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`.
25446    pub sac_realm: std::string::String,
25447
25448    /// Required. NCC Gateway associated with the attachment. This can be input as
25449    /// an ID or a full resource name. The output always has the form
25450    /// `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`.
25451    pub ncc_gateway: std::string::String,
25452
25453    /// Output only. State of the attachment.
25454    pub state: crate::model::sac_attachment::State,
25455
25456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25457}
25458
25459impl SACAttachment {
25460    /// Creates a new default instance.
25461    pub fn new() -> Self {
25462        std::default::Default::default()
25463    }
25464
25465    /// Sets the value of [name][crate::model::SACAttachment::name].
25466    ///
25467    /// # Example
25468    /// ```ignore,no_run
25469    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25470    /// # let project_id = "project_id";
25471    /// # let location_id = "location_id";
25472    /// # let sac_attachment_id = "sac_attachment_id";
25473    /// let x = SACAttachment::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
25474    /// ```
25475    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25476        self.name = v.into();
25477        self
25478    }
25479
25480    /// Sets the value of [create_time][crate::model::SACAttachment::create_time].
25481    ///
25482    /// # Example
25483    /// ```ignore,no_run
25484    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25485    /// use wkt::Timestamp;
25486    /// let x = SACAttachment::new().set_create_time(Timestamp::default()/* use setters */);
25487    /// ```
25488    pub fn set_create_time<T>(mut self, v: T) -> Self
25489    where
25490        T: std::convert::Into<wkt::Timestamp>,
25491    {
25492        self.create_time = std::option::Option::Some(v.into());
25493        self
25494    }
25495
25496    /// Sets or clears the value of [create_time][crate::model::SACAttachment::create_time].
25497    ///
25498    /// # Example
25499    /// ```ignore,no_run
25500    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25501    /// use wkt::Timestamp;
25502    /// let x = SACAttachment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
25503    /// let x = SACAttachment::new().set_or_clear_create_time(None::<Timestamp>);
25504    /// ```
25505    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
25506    where
25507        T: std::convert::Into<wkt::Timestamp>,
25508    {
25509        self.create_time = v.map(|x| x.into());
25510        self
25511    }
25512
25513    /// Sets the value of [update_time][crate::model::SACAttachment::update_time].
25514    ///
25515    /// # Example
25516    /// ```ignore,no_run
25517    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25518    /// use wkt::Timestamp;
25519    /// let x = SACAttachment::new().set_update_time(Timestamp::default()/* use setters */);
25520    /// ```
25521    pub fn set_update_time<T>(mut self, v: T) -> Self
25522    where
25523        T: std::convert::Into<wkt::Timestamp>,
25524    {
25525        self.update_time = std::option::Option::Some(v.into());
25526        self
25527    }
25528
25529    /// Sets or clears the value of [update_time][crate::model::SACAttachment::update_time].
25530    ///
25531    /// # Example
25532    /// ```ignore,no_run
25533    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25534    /// use wkt::Timestamp;
25535    /// let x = SACAttachment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
25536    /// let x = SACAttachment::new().set_or_clear_update_time(None::<Timestamp>);
25537    /// ```
25538    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
25539    where
25540        T: std::convert::Into<wkt::Timestamp>,
25541    {
25542        self.update_time = v.map(|x| x.into());
25543        self
25544    }
25545
25546    /// Sets the value of [labels][crate::model::SACAttachment::labels].
25547    ///
25548    /// # Example
25549    /// ```ignore,no_run
25550    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25551    /// let x = SACAttachment::new().set_labels([
25552    ///     ("key0", "abc"),
25553    ///     ("key1", "xyz"),
25554    /// ]);
25555    /// ```
25556    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
25557    where
25558        T: std::iter::IntoIterator<Item = (K, V)>,
25559        K: std::convert::Into<std::string::String>,
25560        V: std::convert::Into<std::string::String>,
25561    {
25562        use std::iter::Iterator;
25563        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
25564        self
25565    }
25566
25567    /// Sets the value of [sac_realm][crate::model::SACAttachment::sac_realm].
25568    ///
25569    /// # Example
25570    /// ```ignore,no_run
25571    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25572    /// let x = SACAttachment::new().set_sac_realm("example");
25573    /// ```
25574    pub fn set_sac_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25575        self.sac_realm = v.into();
25576        self
25577    }
25578
25579    /// Sets the value of [ncc_gateway][crate::model::SACAttachment::ncc_gateway].
25580    ///
25581    /// # Example
25582    /// ```ignore,no_run
25583    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25584    /// let x = SACAttachment::new().set_ncc_gateway("example");
25585    /// ```
25586    pub fn set_ncc_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25587        self.ncc_gateway = v.into();
25588        self
25589    }
25590
25591    /// Sets the value of [state][crate::model::SACAttachment::state].
25592    ///
25593    /// # Example
25594    /// ```ignore,no_run
25595    /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25596    /// use google_cloud_networksecurity_v1::model::sac_attachment::State;
25597    /// let x0 = SACAttachment::new().set_state(State::PendingPartnerAttachment);
25598    /// let x1 = SACAttachment::new().set_state(State::PartnerAttached);
25599    /// let x2 = SACAttachment::new().set_state(State::PartnerDetached);
25600    /// ```
25601    pub fn set_state<T: std::convert::Into<crate::model::sac_attachment::State>>(
25602        mut self,
25603        v: T,
25604    ) -> Self {
25605        self.state = v.into();
25606        self
25607    }
25608}
25609
25610impl wkt::message::Message for SACAttachment {
25611    fn typename() -> &'static str {
25612        "type.googleapis.com/google.cloud.networksecurity.v1.SACAttachment"
25613    }
25614}
25615
25616/// Defines additional types related to [SACAttachment].
25617pub mod sac_attachment {
25618    #[allow(unused_imports)]
25619    use super::*;
25620
25621    /// State of the attachment.
25622    ///
25623    /// # Working with unknown values
25624    ///
25625    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25626    /// additional enum variants at any time. Adding new variants is not considered
25627    /// a breaking change. Applications should write their code in anticipation of:
25628    ///
25629    /// - New values appearing in future releases of the client library, **and**
25630    /// - New values received dynamically, without application changes.
25631    ///
25632    /// Please consult the [Working with enums] section in the user guide for some
25633    /// guidelines.
25634    ///
25635    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25636    #[derive(Clone, Debug, PartialEq)]
25637    #[non_exhaustive]
25638    pub enum State {
25639        /// No state specified. This should not be used.
25640        Unspecified,
25641        /// Has never been attached to a partner.
25642        PendingPartnerAttachment,
25643        /// Currently attached to a partner.
25644        PartnerAttached,
25645        /// Was once attached to a partner but has been detached.
25646        PartnerDetached,
25647        /// If set, the enum was initialized with an unknown value.
25648        ///
25649        /// Applications can examine the value using [State::value] or
25650        /// [State::name].
25651        UnknownValue(state::UnknownValue),
25652    }
25653
25654    #[doc(hidden)]
25655    pub mod state {
25656        #[allow(unused_imports)]
25657        use super::*;
25658        #[derive(Clone, Debug, PartialEq)]
25659        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25660    }
25661
25662    impl State {
25663        /// Gets the enum value.
25664        ///
25665        /// Returns `None` if the enum contains an unknown value deserialized from
25666        /// the string representation of enums.
25667        pub fn value(&self) -> std::option::Option<i32> {
25668            match self {
25669                Self::Unspecified => std::option::Option::Some(0),
25670                Self::PendingPartnerAttachment => std::option::Option::Some(1),
25671                Self::PartnerAttached => std::option::Option::Some(2),
25672                Self::PartnerDetached => std::option::Option::Some(3),
25673                Self::UnknownValue(u) => u.0.value(),
25674            }
25675        }
25676
25677        /// Gets the enum value as a string.
25678        ///
25679        /// Returns `None` if the enum contains an unknown value deserialized from
25680        /// the integer representation of enums.
25681        pub fn name(&self) -> std::option::Option<&str> {
25682            match self {
25683                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
25684                Self::PendingPartnerAttachment => {
25685                    std::option::Option::Some("PENDING_PARTNER_ATTACHMENT")
25686                }
25687                Self::PartnerAttached => std::option::Option::Some("PARTNER_ATTACHED"),
25688                Self::PartnerDetached => std::option::Option::Some("PARTNER_DETACHED"),
25689                Self::UnknownValue(u) => u.0.name(),
25690            }
25691        }
25692    }
25693
25694    impl std::default::Default for State {
25695        fn default() -> Self {
25696            use std::convert::From;
25697            Self::from(0)
25698        }
25699    }
25700
25701    impl std::fmt::Display for State {
25702        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25703            wkt::internal::display_enum(f, self.name(), self.value())
25704        }
25705    }
25706
25707    impl std::convert::From<i32> for State {
25708        fn from(value: i32) -> Self {
25709            match value {
25710                0 => Self::Unspecified,
25711                1 => Self::PendingPartnerAttachment,
25712                2 => Self::PartnerAttached,
25713                3 => Self::PartnerDetached,
25714                _ => Self::UnknownValue(state::UnknownValue(
25715                    wkt::internal::UnknownEnumValue::Integer(value),
25716                )),
25717            }
25718        }
25719    }
25720
25721    impl std::convert::From<&str> for State {
25722        fn from(value: &str) -> Self {
25723            use std::string::ToString;
25724            match value {
25725                "STATE_UNSPECIFIED" => Self::Unspecified,
25726                "PENDING_PARTNER_ATTACHMENT" => Self::PendingPartnerAttachment,
25727                "PARTNER_ATTACHED" => Self::PartnerAttached,
25728                "PARTNER_DETACHED" => Self::PartnerDetached,
25729                _ => Self::UnknownValue(state::UnknownValue(
25730                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25731                )),
25732            }
25733        }
25734    }
25735
25736    impl serde::ser::Serialize for State {
25737        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25738        where
25739            S: serde::Serializer,
25740        {
25741            match self {
25742                Self::Unspecified => serializer.serialize_i32(0),
25743                Self::PendingPartnerAttachment => serializer.serialize_i32(1),
25744                Self::PartnerAttached => serializer.serialize_i32(2),
25745                Self::PartnerDetached => serializer.serialize_i32(3),
25746                Self::UnknownValue(u) => u.0.serialize(serializer),
25747            }
25748        }
25749    }
25750
25751    impl<'de> serde::de::Deserialize<'de> for State {
25752        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25753        where
25754            D: serde::Deserializer<'de>,
25755        {
25756            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
25757                ".google.cloud.networksecurity.v1.SACAttachment.State",
25758            ))
25759        }
25760    }
25761}
25762
25763/// Request for `ListSACAttachments` method.
25764#[derive(Clone, Default, PartialEq)]
25765#[non_exhaustive]
25766pub struct ListSACAttachmentsRequest {
25767    /// Required. The parent, in the form
25768    /// `projects/{project}/locations/{location}`.
25769    pub parent: std::string::String,
25770
25771    /// Optional. Requested page size. Server may return fewer items than
25772    /// requested. If unspecified, server will pick an appropriate default.
25773    pub page_size: i32,
25774
25775    /// Optional. A token identifying a page of results the server should return.
25776    pub page_token: std::string::String,
25777
25778    /// Optional. An expression that filters the list of results.
25779    pub filter: std::string::String,
25780
25781    /// Optional. Sort the results by a certain order.
25782    pub order_by: std::string::String,
25783
25784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25785}
25786
25787impl ListSACAttachmentsRequest {
25788    /// Creates a new default instance.
25789    pub fn new() -> Self {
25790        std::default::Default::default()
25791    }
25792
25793    /// Sets the value of [parent][crate::model::ListSACAttachmentsRequest::parent].
25794    ///
25795    /// # Example
25796    /// ```ignore,no_run
25797    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25798    /// # let project_id = "project_id";
25799    /// # let location_id = "location_id";
25800    /// let x = ListSACAttachmentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25801    /// ```
25802    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25803        self.parent = v.into();
25804        self
25805    }
25806
25807    /// Sets the value of [page_size][crate::model::ListSACAttachmentsRequest::page_size].
25808    ///
25809    /// # Example
25810    /// ```ignore,no_run
25811    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25812    /// let x = ListSACAttachmentsRequest::new().set_page_size(42);
25813    /// ```
25814    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25815        self.page_size = v.into();
25816        self
25817    }
25818
25819    /// Sets the value of [page_token][crate::model::ListSACAttachmentsRequest::page_token].
25820    ///
25821    /// # Example
25822    /// ```ignore,no_run
25823    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25824    /// let x = ListSACAttachmentsRequest::new().set_page_token("example");
25825    /// ```
25826    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25827        self.page_token = v.into();
25828        self
25829    }
25830
25831    /// Sets the value of [filter][crate::model::ListSACAttachmentsRequest::filter].
25832    ///
25833    /// # Example
25834    /// ```ignore,no_run
25835    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25836    /// let x = ListSACAttachmentsRequest::new().set_filter("example");
25837    /// ```
25838    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25839        self.filter = v.into();
25840        self
25841    }
25842
25843    /// Sets the value of [order_by][crate::model::ListSACAttachmentsRequest::order_by].
25844    ///
25845    /// # Example
25846    /// ```ignore,no_run
25847    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25848    /// let x = ListSACAttachmentsRequest::new().set_order_by("example");
25849    /// ```
25850    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25851        self.order_by = v.into();
25852        self
25853    }
25854}
25855
25856impl wkt::message::Message for ListSACAttachmentsRequest {
25857    fn typename() -> &'static str {
25858        "type.googleapis.com/google.cloud.networksecurity.v1.ListSACAttachmentsRequest"
25859    }
25860}
25861
25862/// Response for `ListSACAttachments` method.
25863#[derive(Clone, Default, PartialEq)]
25864#[non_exhaustive]
25865pub struct ListSACAttachmentsResponse {
25866    /// The list of SACAttachments.
25867    pub sac_attachments: std::vec::Vec<crate::model::SACAttachment>,
25868
25869    /// A token identifying a page of results the server should return.
25870    pub next_page_token: std::string::String,
25871
25872    /// Locations that could not be reached.
25873    pub unreachable: std::vec::Vec<std::string::String>,
25874
25875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25876}
25877
25878impl ListSACAttachmentsResponse {
25879    /// Creates a new default instance.
25880    pub fn new() -> Self {
25881        std::default::Default::default()
25882    }
25883
25884    /// Sets the value of [sac_attachments][crate::model::ListSACAttachmentsResponse::sac_attachments].
25885    ///
25886    /// # Example
25887    /// ```ignore,no_run
25888    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25889    /// use google_cloud_networksecurity_v1::model::SACAttachment;
25890    /// let x = ListSACAttachmentsResponse::new()
25891    ///     .set_sac_attachments([
25892    ///         SACAttachment::default()/* use setters */,
25893    ///         SACAttachment::default()/* use (different) setters */,
25894    ///     ]);
25895    /// ```
25896    pub fn set_sac_attachments<T, V>(mut self, v: T) -> Self
25897    where
25898        T: std::iter::IntoIterator<Item = V>,
25899        V: std::convert::Into<crate::model::SACAttachment>,
25900    {
25901        use std::iter::Iterator;
25902        self.sac_attachments = v.into_iter().map(|i| i.into()).collect();
25903        self
25904    }
25905
25906    /// Sets the value of [next_page_token][crate::model::ListSACAttachmentsResponse::next_page_token].
25907    ///
25908    /// # Example
25909    /// ```ignore,no_run
25910    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25911    /// let x = ListSACAttachmentsResponse::new().set_next_page_token("example");
25912    /// ```
25913    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25914        self.next_page_token = v.into();
25915        self
25916    }
25917
25918    /// Sets the value of [unreachable][crate::model::ListSACAttachmentsResponse::unreachable].
25919    ///
25920    /// # Example
25921    /// ```ignore,no_run
25922    /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25923    /// let x = ListSACAttachmentsResponse::new().set_unreachable(["a", "b", "c"]);
25924    /// ```
25925    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25926    where
25927        T: std::iter::IntoIterator<Item = V>,
25928        V: std::convert::Into<std::string::String>,
25929    {
25930        use std::iter::Iterator;
25931        self.unreachable = v.into_iter().map(|i| i.into()).collect();
25932        self
25933    }
25934}
25935
25936impl wkt::message::Message for ListSACAttachmentsResponse {
25937    fn typename() -> &'static str {
25938        "type.googleapis.com/google.cloud.networksecurity.v1.ListSACAttachmentsResponse"
25939    }
25940}
25941
25942#[doc(hidden)]
25943impl google_cloud_gax::paginator::internal::PageableResponse for ListSACAttachmentsResponse {
25944    type PageItem = crate::model::SACAttachment;
25945
25946    fn items(self) -> std::vec::Vec<Self::PageItem> {
25947        self.sac_attachments
25948    }
25949
25950    fn next_page_token(&self) -> std::string::String {
25951        use std::clone::Clone;
25952        self.next_page_token.clone()
25953    }
25954}
25955
25956/// Request for `GetSACAttachment` method.
25957#[derive(Clone, Default, PartialEq)]
25958#[non_exhaustive]
25959pub struct GetSACAttachmentRequest {
25960    /// Required. Name of the resource, in the form
25961    /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
25962    pub name: std::string::String,
25963
25964    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25965}
25966
25967impl GetSACAttachmentRequest {
25968    /// Creates a new default instance.
25969    pub fn new() -> Self {
25970        std::default::Default::default()
25971    }
25972
25973    /// Sets the value of [name][crate::model::GetSACAttachmentRequest::name].
25974    ///
25975    /// # Example
25976    /// ```ignore,no_run
25977    /// # use google_cloud_networksecurity_v1::model::GetSACAttachmentRequest;
25978    /// # let project_id = "project_id";
25979    /// # let location_id = "location_id";
25980    /// # let sac_attachment_id = "sac_attachment_id";
25981    /// let x = GetSACAttachmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
25982    /// ```
25983    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25984        self.name = v.into();
25985        self
25986    }
25987}
25988
25989impl wkt::message::Message for GetSACAttachmentRequest {
25990    fn typename() -> &'static str {
25991        "type.googleapis.com/google.cloud.networksecurity.v1.GetSACAttachmentRequest"
25992    }
25993}
25994
25995/// Request for `CreateSACAttachment` method.
25996#[derive(Clone, Default, PartialEq)]
25997#[non_exhaustive]
25998pub struct CreateSACAttachmentRequest {
25999    /// Required. The parent, in the form
26000    /// `projects/{project}/locations/{location}`.
26001    pub parent: std::string::String,
26002
26003    /// Required. ID of the created attachment.
26004    /// The ID must be 1-63 characters long, and comply with
26005    /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
26006    /// Specifically, it must be 1-63 characters long and match the regular
26007    /// expression `[a-z]([-a-z0-9]*[a-z0-9])?`
26008    /// which means the first character must be a lowercase letter, and all
26009    /// following characters must be a dash, lowercase letter, or digit, except
26010    /// the last character, which cannot be a dash.
26011    pub sac_attachment_id: std::string::String,
26012
26013    /// Required. The resource being created.
26014    pub sac_attachment: std::option::Option<crate::model::SACAttachment>,
26015
26016    /// Optional. An optional request ID to identify requests. Specify a unique
26017    /// request ID so that if you must retry your request, the server will know to
26018    /// ignore the request if it has already been completed. The server will
26019    /// guarantee that for at least 60 minutes since the first request.
26020    ///
26021    /// For example, consider a situation where you make an initial request and the
26022    /// request times out. If you make the request again with the same request
26023    /// ID, the server can check if original operation with the same request ID
26024    /// was received, and if so, will ignore the second request. This prevents
26025    /// clients from accidentally creating duplicate commitments.
26026    ///
26027    /// The request ID must be a valid UUID with the exception that zero UUID is
26028    /// not supported (00000000-0000-0000-0000-000000000000).
26029    pub request_id: std::string::String,
26030
26031    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26032}
26033
26034impl CreateSACAttachmentRequest {
26035    /// Creates a new default instance.
26036    pub fn new() -> Self {
26037        std::default::Default::default()
26038    }
26039
26040    /// Sets the value of [parent][crate::model::CreateSACAttachmentRequest::parent].
26041    ///
26042    /// # Example
26043    /// ```ignore,no_run
26044    /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26045    /// # let project_id = "project_id";
26046    /// # let location_id = "location_id";
26047    /// let x = CreateSACAttachmentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
26048    /// ```
26049    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26050        self.parent = v.into();
26051        self
26052    }
26053
26054    /// Sets the value of [sac_attachment_id][crate::model::CreateSACAttachmentRequest::sac_attachment_id].
26055    ///
26056    /// # Example
26057    /// ```ignore,no_run
26058    /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26059    /// let x = CreateSACAttachmentRequest::new().set_sac_attachment_id("example");
26060    /// ```
26061    pub fn set_sac_attachment_id<T: std::convert::Into<std::string::String>>(
26062        mut self,
26063        v: T,
26064    ) -> Self {
26065        self.sac_attachment_id = v.into();
26066        self
26067    }
26068
26069    /// Sets the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
26070    ///
26071    /// # Example
26072    /// ```ignore,no_run
26073    /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26074    /// use google_cloud_networksecurity_v1::model::SACAttachment;
26075    /// let x = CreateSACAttachmentRequest::new().set_sac_attachment(SACAttachment::default()/* use setters */);
26076    /// ```
26077    pub fn set_sac_attachment<T>(mut self, v: T) -> Self
26078    where
26079        T: std::convert::Into<crate::model::SACAttachment>,
26080    {
26081        self.sac_attachment = std::option::Option::Some(v.into());
26082        self
26083    }
26084
26085    /// Sets or clears the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
26086    ///
26087    /// # Example
26088    /// ```ignore,no_run
26089    /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26090    /// use google_cloud_networksecurity_v1::model::SACAttachment;
26091    /// let x = CreateSACAttachmentRequest::new().set_or_clear_sac_attachment(Some(SACAttachment::default()/* use setters */));
26092    /// let x = CreateSACAttachmentRequest::new().set_or_clear_sac_attachment(None::<SACAttachment>);
26093    /// ```
26094    pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
26095    where
26096        T: std::convert::Into<crate::model::SACAttachment>,
26097    {
26098        self.sac_attachment = v.map(|x| x.into());
26099        self
26100    }
26101
26102    /// Sets the value of [request_id][crate::model::CreateSACAttachmentRequest::request_id].
26103    ///
26104    /// # Example
26105    /// ```ignore,no_run
26106    /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26107    /// let x = CreateSACAttachmentRequest::new().set_request_id("example");
26108    /// ```
26109    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26110        self.request_id = v.into();
26111        self
26112    }
26113}
26114
26115impl wkt::message::Message for CreateSACAttachmentRequest {
26116    fn typename() -> &'static str {
26117        "type.googleapis.com/google.cloud.networksecurity.v1.CreateSACAttachmentRequest"
26118    }
26119}
26120
26121/// Request for `DeleteSACAttachment` method.
26122#[derive(Clone, Default, PartialEq)]
26123#[non_exhaustive]
26124pub struct DeleteSACAttachmentRequest {
26125    /// Required. Name of the resource, in the form
26126    /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
26127    pub name: std::string::String,
26128
26129    /// Optional. An optional request ID to identify requests. Specify a unique
26130    /// request ID so that if you must retry your request, the server will know to
26131    /// ignore the request if it has already been completed. The server will
26132    /// guarantee that for at least 60 minutes after the first request.
26133    ///
26134    /// For example, consider a situation where you make an initial request and the
26135    /// request times out. If you make the request again with the same request
26136    /// ID, the server can check if original operation with the same request ID
26137    /// was received, and if so, will ignore the second request. This prevents
26138    /// clients from accidentally creating duplicate commitments.
26139    ///
26140    /// The request ID must be a valid UUID with the exception that zero UUID is
26141    /// not supported (00000000-0000-0000-0000-000000000000).
26142    pub request_id: std::string::String,
26143
26144    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26145}
26146
26147impl DeleteSACAttachmentRequest {
26148    /// Creates a new default instance.
26149    pub fn new() -> Self {
26150        std::default::Default::default()
26151    }
26152
26153    /// Sets the value of [name][crate::model::DeleteSACAttachmentRequest::name].
26154    ///
26155    /// # Example
26156    /// ```ignore,no_run
26157    /// # use google_cloud_networksecurity_v1::model::DeleteSACAttachmentRequest;
26158    /// # let project_id = "project_id";
26159    /// # let location_id = "location_id";
26160    /// # let sac_attachment_id = "sac_attachment_id";
26161    /// let x = DeleteSACAttachmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
26162    /// ```
26163    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26164        self.name = v.into();
26165        self
26166    }
26167
26168    /// Sets the value of [request_id][crate::model::DeleteSACAttachmentRequest::request_id].
26169    ///
26170    /// # Example
26171    /// ```ignore,no_run
26172    /// # use google_cloud_networksecurity_v1::model::DeleteSACAttachmentRequest;
26173    /// let x = DeleteSACAttachmentRequest::new().set_request_id("example");
26174    /// ```
26175    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26176        self.request_id = v.into();
26177        self
26178    }
26179}
26180
26181impl wkt::message::Message for DeleteSACAttachmentRequest {
26182    fn typename() -> &'static str {
26183        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSACAttachmentRequest"
26184    }
26185}
26186
26187/// Specification of the GRPC Endpoint.
26188#[derive(Clone, Default, PartialEq)]
26189#[non_exhaustive]
26190pub struct GrpcEndpoint {
26191    /// Required. The target URI of the gRPC endpoint. Only UDS path is supported,
26192    /// and should start with "unix:".
26193    pub target_uri: std::string::String,
26194
26195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26196}
26197
26198impl GrpcEndpoint {
26199    /// Creates a new default instance.
26200    pub fn new() -> Self {
26201        std::default::Default::default()
26202    }
26203
26204    /// Sets the value of [target_uri][crate::model::GrpcEndpoint::target_uri].
26205    ///
26206    /// # Example
26207    /// ```ignore,no_run
26208    /// # use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26209    /// let x = GrpcEndpoint::new().set_target_uri("example");
26210    /// ```
26211    pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26212        self.target_uri = v.into();
26213        self
26214    }
26215}
26216
26217impl wkt::message::Message for GrpcEndpoint {
26218    fn typename() -> &'static str {
26219        "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
26220    }
26221}
26222
26223/// Specification of ValidationCA. Defines the mechanism to obtain the
26224/// Certificate Authority certificate to validate the peer certificate.
26225#[derive(Clone, Default, PartialEq)]
26226#[non_exhaustive]
26227pub struct ValidationCA {
26228    /// The type of certificate provider which provides the CA certificate.
26229    pub r#type: std::option::Option<crate::model::validation_ca::Type>,
26230
26231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26232}
26233
26234impl ValidationCA {
26235    /// Creates a new default instance.
26236    pub fn new() -> Self {
26237        std::default::Default::default()
26238    }
26239
26240    /// Sets the value of [r#type][crate::model::ValidationCA::type].
26241    ///
26242    /// Note that all the setters affecting `r#type` are mutually
26243    /// exclusive.
26244    ///
26245    /// # Example
26246    /// ```ignore,no_run
26247    /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26248    /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26249    /// let x = ValidationCA::new().set_type(Some(
26250    ///     google_cloud_networksecurity_v1::model::validation_ca::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
26251    /// ```
26252    pub fn set_type<
26253        T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
26254    >(
26255        mut self,
26256        v: T,
26257    ) -> Self {
26258        self.r#type = v.into();
26259        self
26260    }
26261
26262    /// The value of [r#type][crate::model::ValidationCA::r#type]
26263    /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
26264    /// holds a different branch.
26265    pub fn grpc_endpoint(
26266        &self,
26267    ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
26268        #[allow(unreachable_patterns)]
26269        self.r#type.as_ref().and_then(|v| match v {
26270            crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
26271            _ => std::option::Option::None,
26272        })
26273    }
26274
26275    /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
26276    /// to hold a `GrpcEndpoint`.
26277    ///
26278    /// Note that all the setters affecting `r#type` are
26279    /// mutually exclusive.
26280    ///
26281    /// # Example
26282    /// ```ignore,no_run
26283    /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26284    /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26285    /// let x = ValidationCA::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
26286    /// assert!(x.grpc_endpoint().is_some());
26287    /// assert!(x.certificate_provider_instance().is_none());
26288    /// ```
26289    pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
26290        mut self,
26291        v: T,
26292    ) -> Self {
26293        self.r#type =
26294            std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
26295        self
26296    }
26297
26298    /// The value of [r#type][crate::model::ValidationCA::r#type]
26299    /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
26300    /// holds a different branch.
26301    pub fn certificate_provider_instance(
26302        &self,
26303    ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
26304        #[allow(unreachable_patterns)]
26305        self.r#type.as_ref().and_then(|v| match v {
26306            crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
26307                std::option::Option::Some(v)
26308            }
26309            _ => std::option::Option::None,
26310        })
26311    }
26312
26313    /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
26314    /// to hold a `CertificateProviderInstance`.
26315    ///
26316    /// Note that all the setters affecting `r#type` are
26317    /// mutually exclusive.
26318    ///
26319    /// # Example
26320    /// ```ignore,no_run
26321    /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26322    /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26323    /// let x = ValidationCA::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
26324    /// assert!(x.certificate_provider_instance().is_some());
26325    /// assert!(x.grpc_endpoint().is_none());
26326    /// ```
26327    pub fn set_certificate_provider_instance<
26328        T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
26329    >(
26330        mut self,
26331        v: T,
26332    ) -> Self {
26333        self.r#type = std::option::Option::Some(
26334            crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
26335        );
26336        self
26337    }
26338}
26339
26340impl wkt::message::Message for ValidationCA {
26341    fn typename() -> &'static str {
26342        "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
26343    }
26344}
26345
26346/// Defines additional types related to [ValidationCA].
26347pub mod validation_ca {
26348    #[allow(unused_imports)]
26349    use super::*;
26350
26351    /// The type of certificate provider which provides the CA certificate.
26352    #[derive(Clone, Debug, PartialEq)]
26353    #[non_exhaustive]
26354    pub enum Type {
26355        /// gRPC specific configuration to access the gRPC server to
26356        /// obtain the CA certificate.
26357        GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
26358        /// The certificate provider instance specification that will be passed to
26359        /// the data plane, which will be used to load necessary credential
26360        /// information.
26361        CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
26362    }
26363}
26364
26365/// Specification of a TLS certificate provider instance. Workloads may have one
26366/// or more CertificateProvider instances (plugins) and one of them is enabled
26367/// and configured by specifying this message. Workloads use the values from this
26368/// message to locate and load the CertificateProvider instance configuration.
26369#[derive(Clone, Default, PartialEq)]
26370#[non_exhaustive]
26371pub struct CertificateProviderInstance {
26372    /// Required. Plugin instance name, used to locate and load CertificateProvider
26373    /// instance configuration. Set to "google_cloud_private_spiffe" to use
26374    /// Certificate Authority Service certificate provider instance.
26375    pub plugin_instance: std::string::String,
26376
26377    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26378}
26379
26380impl CertificateProviderInstance {
26381    /// Creates a new default instance.
26382    pub fn new() -> Self {
26383        std::default::Default::default()
26384    }
26385
26386    /// Sets the value of [plugin_instance][crate::model::CertificateProviderInstance::plugin_instance].
26387    ///
26388    /// # Example
26389    /// ```ignore,no_run
26390    /// # use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26391    /// let x = CertificateProviderInstance::new().set_plugin_instance("example");
26392    /// ```
26393    pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26394        self.plugin_instance = v.into();
26395        self
26396    }
26397}
26398
26399impl wkt::message::Message for CertificateProviderInstance {
26400    fn typename() -> &'static str {
26401        "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
26402    }
26403}
26404
26405/// Specification of certificate provider. Defines the mechanism to obtain the
26406/// certificate and private key for peer to peer authentication.
26407#[derive(Clone, Default, PartialEq)]
26408#[non_exhaustive]
26409pub struct CertificateProvider {
26410    /// The type of certificate provider which provides the certificates and
26411    /// private keys.
26412    pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
26413
26414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26415}
26416
26417impl CertificateProvider {
26418    /// Creates a new default instance.
26419    pub fn new() -> Self {
26420        std::default::Default::default()
26421    }
26422
26423    /// Sets the value of [r#type][crate::model::CertificateProvider::type].
26424    ///
26425    /// Note that all the setters affecting `r#type` are mutually
26426    /// exclusive.
26427    ///
26428    /// # Example
26429    /// ```ignore,no_run
26430    /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26431    /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26432    /// let x = CertificateProvider::new().set_type(Some(
26433    ///     google_cloud_networksecurity_v1::model::certificate_provider::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
26434    /// ```
26435    pub fn set_type<
26436        T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
26437    >(
26438        mut self,
26439        v: T,
26440    ) -> Self {
26441        self.r#type = v.into();
26442        self
26443    }
26444
26445    /// The value of [r#type][crate::model::CertificateProvider::r#type]
26446    /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
26447    /// holds a different branch.
26448    pub fn grpc_endpoint(
26449        &self,
26450    ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
26451        #[allow(unreachable_patterns)]
26452        self.r#type.as_ref().and_then(|v| match v {
26453            crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
26454                std::option::Option::Some(v)
26455            }
26456            _ => std::option::Option::None,
26457        })
26458    }
26459
26460    /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
26461    /// to hold a `GrpcEndpoint`.
26462    ///
26463    /// Note that all the setters affecting `r#type` are
26464    /// mutually exclusive.
26465    ///
26466    /// # Example
26467    /// ```ignore,no_run
26468    /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26469    /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26470    /// let x = CertificateProvider::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
26471    /// assert!(x.grpc_endpoint().is_some());
26472    /// assert!(x.certificate_provider_instance().is_none());
26473    /// ```
26474    pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
26475        mut self,
26476        v: T,
26477    ) -> Self {
26478        self.r#type = std::option::Option::Some(
26479            crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
26480        );
26481        self
26482    }
26483
26484    /// The value of [r#type][crate::model::CertificateProvider::r#type]
26485    /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
26486    /// holds a different branch.
26487    pub fn certificate_provider_instance(
26488        &self,
26489    ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
26490        #[allow(unreachable_patterns)]
26491        self.r#type.as_ref().and_then(|v| match v {
26492            crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
26493                std::option::Option::Some(v)
26494            }
26495            _ => std::option::Option::None,
26496        })
26497    }
26498
26499    /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
26500    /// to hold a `CertificateProviderInstance`.
26501    ///
26502    /// Note that all the setters affecting `r#type` are
26503    /// mutually exclusive.
26504    ///
26505    /// # Example
26506    /// ```ignore,no_run
26507    /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26508    /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26509    /// let x = CertificateProvider::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
26510    /// assert!(x.certificate_provider_instance().is_some());
26511    /// assert!(x.grpc_endpoint().is_none());
26512    /// ```
26513    pub fn set_certificate_provider_instance<
26514        T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
26515    >(
26516        mut self,
26517        v: T,
26518    ) -> Self {
26519        self.r#type = std::option::Option::Some(
26520            crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
26521        );
26522        self
26523    }
26524}
26525
26526impl wkt::message::Message for CertificateProvider {
26527    fn typename() -> &'static str {
26528        "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
26529    }
26530}
26531
26532/// Defines additional types related to [CertificateProvider].
26533pub mod certificate_provider {
26534    #[allow(unused_imports)]
26535    use super::*;
26536
26537    /// The type of certificate provider which provides the certificates and
26538    /// private keys.
26539    #[derive(Clone, Debug, PartialEq)]
26540    #[non_exhaustive]
26541    pub enum Type {
26542        /// gRPC specific configuration to access the gRPC server to
26543        /// obtain the cert and private key.
26544        GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
26545        /// The certificate provider instance specification that will be passed to
26546        /// the data plane, which will be used to load necessary credential
26547        /// information.
26548        CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
26549    }
26550}
26551
26552/// The TlsInspectionPolicy resource contains references to CA pools in
26553/// Certificate Authority Service and associated metadata.
26554#[derive(Clone, Default, PartialEq)]
26555#[non_exhaustive]
26556pub struct TlsInspectionPolicy {
26557    /// Required. Name of the resource. Name is of the form
26558    /// projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}
26559    /// tls_inspection_policy should match the
26560    /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
26561    pub name: std::string::String,
26562
26563    /// Optional. Free-text description of the resource.
26564    pub description: std::string::String,
26565
26566    /// Output only. The timestamp when the resource was created.
26567    pub create_time: std::option::Option<wkt::Timestamp>,
26568
26569    /// Output only. The timestamp when the resource was updated.
26570    pub update_time: std::option::Option<wkt::Timestamp>,
26571
26572    /// Required. A CA pool resource used to issue interception certificates.
26573    /// The CA pool string has a relative resource path following the form
26574    /// "projects/{project}/locations/{location}/caPools/{ca_pool}".
26575    pub ca_pool: std::string::String,
26576
26577    /// Optional. A TrustConfig resource used when making a connection to the TLS
26578    /// server. This is a relative resource path following the form
26579    /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This
26580    /// is necessary to intercept TLS connections to servers with certificates
26581    /// signed by a private CA or self-signed certificates.
26582    /// Note that Secure Web Proxy does not yet honor this field.
26583    pub trust_config: std::string::String,
26584
26585    /// Optional. If  FALSE (the default), use our default set of public CAs in
26586    /// addition to any CAs specified in trust_config. These public CAs are
26587    /// currently based on the Mozilla Root Program and are subject to change over
26588    /// time. If TRUE, do not accept our default set of public CAs. Only CAs
26589    /// specified in trust_config will be accepted. This defaults to FALSE (use
26590    /// public CAs in addition to trust_config) for backwards compatibility, but
26591    /// trusting public root CAs is *not recommended* unless the traffic in
26592    /// question is outbound to public web servers. When possible, prefer setting
26593    /// this to "false" and explicitly specifying trusted CAs and certificates in a
26594    /// TrustConfig. Note that Secure Web Proxy does not yet honor this field.
26595    pub exclude_public_ca_set: std::option::Option<bool>,
26596
26597    /// Optional. Minimum TLS version that the firewall should use when negotiating
26598    /// connections with both clients and servers. If this is not set, then the
26599    /// default value is to allow the broadest set of clients and servers (TLS 1.0
26600    /// or higher). Setting this to more restrictive values may improve security,
26601    /// but may also prevent the firewall from connecting to some clients or
26602    /// servers.
26603    /// Note that Secure Web Proxy does not yet honor this field.
26604    pub min_tls_version: crate::model::tls_inspection_policy::TlsVersion,
26605
26606    /// Optional. The selected Profile. If this is not set, then the default value
26607    /// is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE").
26608    /// Setting this to more restrictive values may improve security, but may also
26609    /// prevent the TLS inspection proxy from connecting to some clients or
26610    /// servers. Note that Secure Web Proxy does not yet honor this field.
26611    pub tls_feature_profile: crate::model::tls_inspection_policy::Profile,
26612
26613    /// Optional. List of custom TLS cipher suites selected.
26614    /// This field is valid only if the selected tls_feature_profile is CUSTOM.
26615    /// The [compute.SslPoliciesService.ListAvailableFeatures][] method returns the
26616    /// set of features that can be specified in this list.
26617    /// Note that Secure Web Proxy does not yet honor this field.
26618    pub custom_tls_features: std::vec::Vec<std::string::String>,
26619
26620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26621}
26622
26623impl TlsInspectionPolicy {
26624    /// Creates a new default instance.
26625    pub fn new() -> Self {
26626        std::default::Default::default()
26627    }
26628
26629    /// Sets the value of [name][crate::model::TlsInspectionPolicy::name].
26630    ///
26631    /// # Example
26632    /// ```ignore,no_run
26633    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26634    /// # let project_id = "project_id";
26635    /// # let location_id = "location_id";
26636    /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
26637    /// let x = TlsInspectionPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
26638    /// ```
26639    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26640        self.name = v.into();
26641        self
26642    }
26643
26644    /// Sets the value of [description][crate::model::TlsInspectionPolicy::description].
26645    ///
26646    /// # Example
26647    /// ```ignore,no_run
26648    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26649    /// let x = TlsInspectionPolicy::new().set_description("example");
26650    /// ```
26651    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26652        self.description = v.into();
26653        self
26654    }
26655
26656    /// Sets the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
26657    ///
26658    /// # Example
26659    /// ```ignore,no_run
26660    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26661    /// use wkt::Timestamp;
26662    /// let x = TlsInspectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
26663    /// ```
26664    pub fn set_create_time<T>(mut self, v: T) -> Self
26665    where
26666        T: std::convert::Into<wkt::Timestamp>,
26667    {
26668        self.create_time = std::option::Option::Some(v.into());
26669        self
26670    }
26671
26672    /// Sets or clears the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
26673    ///
26674    /// # Example
26675    /// ```ignore,no_run
26676    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26677    /// use wkt::Timestamp;
26678    /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
26679    /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
26680    /// ```
26681    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
26682    where
26683        T: std::convert::Into<wkt::Timestamp>,
26684    {
26685        self.create_time = v.map(|x| x.into());
26686        self
26687    }
26688
26689    /// Sets the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
26690    ///
26691    /// # Example
26692    /// ```ignore,no_run
26693    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26694    /// use wkt::Timestamp;
26695    /// let x = TlsInspectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
26696    /// ```
26697    pub fn set_update_time<T>(mut self, v: T) -> Self
26698    where
26699        T: std::convert::Into<wkt::Timestamp>,
26700    {
26701        self.update_time = std::option::Option::Some(v.into());
26702        self
26703    }
26704
26705    /// Sets or clears the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
26706    ///
26707    /// # Example
26708    /// ```ignore,no_run
26709    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26710    /// use wkt::Timestamp;
26711    /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
26712    /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
26713    /// ```
26714    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
26715    where
26716        T: std::convert::Into<wkt::Timestamp>,
26717    {
26718        self.update_time = v.map(|x| x.into());
26719        self
26720    }
26721
26722    /// Sets the value of [ca_pool][crate::model::TlsInspectionPolicy::ca_pool].
26723    ///
26724    /// # Example
26725    /// ```ignore,no_run
26726    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26727    /// let x = TlsInspectionPolicy::new().set_ca_pool("example");
26728    /// ```
26729    pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26730        self.ca_pool = v.into();
26731        self
26732    }
26733
26734    /// Sets the value of [trust_config][crate::model::TlsInspectionPolicy::trust_config].
26735    ///
26736    /// # Example
26737    /// ```ignore,no_run
26738    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26739    /// let x = TlsInspectionPolicy::new().set_trust_config("example");
26740    /// ```
26741    pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26742        self.trust_config = v.into();
26743        self
26744    }
26745
26746    /// Sets the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
26747    ///
26748    /// # Example
26749    /// ```ignore,no_run
26750    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26751    /// let x = TlsInspectionPolicy::new().set_exclude_public_ca_set(true);
26752    /// ```
26753    pub fn set_exclude_public_ca_set<T>(mut self, v: T) -> Self
26754    where
26755        T: std::convert::Into<bool>,
26756    {
26757        self.exclude_public_ca_set = std::option::Option::Some(v.into());
26758        self
26759    }
26760
26761    /// Sets or clears the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
26762    ///
26763    /// # Example
26764    /// ```ignore,no_run
26765    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26766    /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(Some(false));
26767    /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(None::<bool>);
26768    /// ```
26769    pub fn set_or_clear_exclude_public_ca_set<T>(mut self, v: std::option::Option<T>) -> Self
26770    where
26771        T: std::convert::Into<bool>,
26772    {
26773        self.exclude_public_ca_set = v.map(|x| x.into());
26774        self
26775    }
26776
26777    /// Sets the value of [min_tls_version][crate::model::TlsInspectionPolicy::min_tls_version].
26778    ///
26779    /// # Example
26780    /// ```ignore,no_run
26781    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26782    /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::TlsVersion;
26783    /// let x0 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls10);
26784    /// let x1 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls11);
26785    /// let x2 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls12);
26786    /// ```
26787    pub fn set_min_tls_version<
26788        T: std::convert::Into<crate::model::tls_inspection_policy::TlsVersion>,
26789    >(
26790        mut self,
26791        v: T,
26792    ) -> Self {
26793        self.min_tls_version = v.into();
26794        self
26795    }
26796
26797    /// Sets the value of [tls_feature_profile][crate::model::TlsInspectionPolicy::tls_feature_profile].
26798    ///
26799    /// # Example
26800    /// ```ignore,no_run
26801    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26802    /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::Profile;
26803    /// let x0 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Compatible);
26804    /// let x1 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Modern);
26805    /// let x2 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Restricted);
26806    /// ```
26807    pub fn set_tls_feature_profile<
26808        T: std::convert::Into<crate::model::tls_inspection_policy::Profile>,
26809    >(
26810        mut self,
26811        v: T,
26812    ) -> Self {
26813        self.tls_feature_profile = v.into();
26814        self
26815    }
26816
26817    /// Sets the value of [custom_tls_features][crate::model::TlsInspectionPolicy::custom_tls_features].
26818    ///
26819    /// # Example
26820    /// ```ignore,no_run
26821    /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26822    /// let x = TlsInspectionPolicy::new().set_custom_tls_features(["a", "b", "c"]);
26823    /// ```
26824    pub fn set_custom_tls_features<T, V>(mut self, v: T) -> Self
26825    where
26826        T: std::iter::IntoIterator<Item = V>,
26827        V: std::convert::Into<std::string::String>,
26828    {
26829        use std::iter::Iterator;
26830        self.custom_tls_features = v.into_iter().map(|i| i.into()).collect();
26831        self
26832    }
26833}
26834
26835impl wkt::message::Message for TlsInspectionPolicy {
26836    fn typename() -> &'static str {
26837        "type.googleapis.com/google.cloud.networksecurity.v1.TlsInspectionPolicy"
26838    }
26839}
26840
26841/// Defines additional types related to [TlsInspectionPolicy].
26842pub mod tls_inspection_policy {
26843    #[allow(unused_imports)]
26844    use super::*;
26845
26846    /// The minimum version of TLS protocol that can be used by clients or servers
26847    /// to establish a connection with the TLS inspection proxy.
26848    ///
26849    /// # Working with unknown values
26850    ///
26851    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26852    /// additional enum variants at any time. Adding new variants is not considered
26853    /// a breaking change. Applications should write their code in anticipation of:
26854    ///
26855    /// - New values appearing in future releases of the client library, **and**
26856    /// - New values received dynamically, without application changes.
26857    ///
26858    /// Please consult the [Working with enums] section in the user guide for some
26859    /// guidelines.
26860    ///
26861    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26862    #[derive(Clone, Debug, PartialEq)]
26863    #[non_exhaustive]
26864    pub enum TlsVersion {
26865        /// Indicates no TLS version was specified.
26866        Unspecified,
26867        /// TLS 1.0
26868        Tls10,
26869        /// TLS 1.1
26870        Tls11,
26871        /// TLS 1.2
26872        Tls12,
26873        /// TLS 1.3
26874        Tls13,
26875        /// If set, the enum was initialized with an unknown value.
26876        ///
26877        /// Applications can examine the value using [TlsVersion::value] or
26878        /// [TlsVersion::name].
26879        UnknownValue(tls_version::UnknownValue),
26880    }
26881
26882    #[doc(hidden)]
26883    pub mod tls_version {
26884        #[allow(unused_imports)]
26885        use super::*;
26886        #[derive(Clone, Debug, PartialEq)]
26887        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26888    }
26889
26890    impl TlsVersion {
26891        /// Gets the enum value.
26892        ///
26893        /// Returns `None` if the enum contains an unknown value deserialized from
26894        /// the string representation of enums.
26895        pub fn value(&self) -> std::option::Option<i32> {
26896            match self {
26897                Self::Unspecified => std::option::Option::Some(0),
26898                Self::Tls10 => std::option::Option::Some(1),
26899                Self::Tls11 => std::option::Option::Some(2),
26900                Self::Tls12 => std::option::Option::Some(3),
26901                Self::Tls13 => std::option::Option::Some(4),
26902                Self::UnknownValue(u) => u.0.value(),
26903            }
26904        }
26905
26906        /// Gets the enum value as a string.
26907        ///
26908        /// Returns `None` if the enum contains an unknown value deserialized from
26909        /// the integer representation of enums.
26910        pub fn name(&self) -> std::option::Option<&str> {
26911            match self {
26912                Self::Unspecified => std::option::Option::Some("TLS_VERSION_UNSPECIFIED"),
26913                Self::Tls10 => std::option::Option::Some("TLS_1_0"),
26914                Self::Tls11 => std::option::Option::Some("TLS_1_1"),
26915                Self::Tls12 => std::option::Option::Some("TLS_1_2"),
26916                Self::Tls13 => std::option::Option::Some("TLS_1_3"),
26917                Self::UnknownValue(u) => u.0.name(),
26918            }
26919        }
26920    }
26921
26922    impl std::default::Default for TlsVersion {
26923        fn default() -> Self {
26924            use std::convert::From;
26925            Self::from(0)
26926        }
26927    }
26928
26929    impl std::fmt::Display for TlsVersion {
26930        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26931            wkt::internal::display_enum(f, self.name(), self.value())
26932        }
26933    }
26934
26935    impl std::convert::From<i32> for TlsVersion {
26936        fn from(value: i32) -> Self {
26937            match value {
26938                0 => Self::Unspecified,
26939                1 => Self::Tls10,
26940                2 => Self::Tls11,
26941                3 => Self::Tls12,
26942                4 => Self::Tls13,
26943                _ => Self::UnknownValue(tls_version::UnknownValue(
26944                    wkt::internal::UnknownEnumValue::Integer(value),
26945                )),
26946            }
26947        }
26948    }
26949
26950    impl std::convert::From<&str> for TlsVersion {
26951        fn from(value: &str) -> Self {
26952            use std::string::ToString;
26953            match value {
26954                "TLS_VERSION_UNSPECIFIED" => Self::Unspecified,
26955                "TLS_1_0" => Self::Tls10,
26956                "TLS_1_1" => Self::Tls11,
26957                "TLS_1_2" => Self::Tls12,
26958                "TLS_1_3" => Self::Tls13,
26959                _ => Self::UnknownValue(tls_version::UnknownValue(
26960                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26961                )),
26962            }
26963        }
26964    }
26965
26966    impl serde::ser::Serialize for TlsVersion {
26967        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26968        where
26969            S: serde::Serializer,
26970        {
26971            match self {
26972                Self::Unspecified => serializer.serialize_i32(0),
26973                Self::Tls10 => serializer.serialize_i32(1),
26974                Self::Tls11 => serializer.serialize_i32(2),
26975                Self::Tls12 => serializer.serialize_i32(3),
26976                Self::Tls13 => serializer.serialize_i32(4),
26977                Self::UnknownValue(u) => u.0.serialize(serializer),
26978            }
26979        }
26980    }
26981
26982    impl<'de> serde::de::Deserialize<'de> for TlsVersion {
26983        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26984        where
26985            D: serde::Deserializer<'de>,
26986        {
26987            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TlsVersion>::new(
26988                ".google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion",
26989            ))
26990        }
26991    }
26992
26993    /// Profile specifies the set of TLS cipher suites (and possibly
26994    /// other features in the future) that can be used by the firewall when
26995    /// negotiating TLS connections with clients and servers. The meaning of these
26996    /// fields is identical to the load balancers' SSLPolicy resource.
26997    ///
26998    /// # Working with unknown values
26999    ///
27000    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27001    /// additional enum variants at any time. Adding new variants is not considered
27002    /// a breaking change. Applications should write their code in anticipation of:
27003    ///
27004    /// - New values appearing in future releases of the client library, **and**
27005    /// - New values received dynamically, without application changes.
27006    ///
27007    /// Please consult the [Working with enums] section in the user guide for some
27008    /// guidelines.
27009    ///
27010    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27011    #[derive(Clone, Debug, PartialEq)]
27012    #[non_exhaustive]
27013    pub enum Profile {
27014        /// Indicates no profile was specified.
27015        Unspecified,
27016        /// Compatible profile. Allows the broadest set of clients, even those
27017        /// which support only out-of-date SSL features to negotiate with the TLS
27018        /// inspection proxy.
27019        Compatible,
27020        /// Modern profile. Supports a wide set of SSL features, allowing modern
27021        /// clients to negotiate SSL with the TLS inspection proxy.
27022        Modern,
27023        /// Restricted profile. Supports a reduced set of SSL features, intended to
27024        /// meet stricter compliance requirements.
27025        Restricted,
27026        /// Custom profile. Allow only the set of allowed SSL features specified in
27027        /// the custom_features field of SslPolicy.
27028        Custom,
27029        /// If set, the enum was initialized with an unknown value.
27030        ///
27031        /// Applications can examine the value using [Profile::value] or
27032        /// [Profile::name].
27033        UnknownValue(profile::UnknownValue),
27034    }
27035
27036    #[doc(hidden)]
27037    pub mod profile {
27038        #[allow(unused_imports)]
27039        use super::*;
27040        #[derive(Clone, Debug, PartialEq)]
27041        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27042    }
27043
27044    impl Profile {
27045        /// Gets the enum value.
27046        ///
27047        /// Returns `None` if the enum contains an unknown value deserialized from
27048        /// the string representation of enums.
27049        pub fn value(&self) -> std::option::Option<i32> {
27050            match self {
27051                Self::Unspecified => std::option::Option::Some(0),
27052                Self::Compatible => std::option::Option::Some(1),
27053                Self::Modern => std::option::Option::Some(2),
27054                Self::Restricted => std::option::Option::Some(3),
27055                Self::Custom => std::option::Option::Some(4),
27056                Self::UnknownValue(u) => u.0.value(),
27057            }
27058        }
27059
27060        /// Gets the enum value as a string.
27061        ///
27062        /// Returns `None` if the enum contains an unknown value deserialized from
27063        /// the integer representation of enums.
27064        pub fn name(&self) -> std::option::Option<&str> {
27065            match self {
27066                Self::Unspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
27067                Self::Compatible => std::option::Option::Some("PROFILE_COMPATIBLE"),
27068                Self::Modern => std::option::Option::Some("PROFILE_MODERN"),
27069                Self::Restricted => std::option::Option::Some("PROFILE_RESTRICTED"),
27070                Self::Custom => std::option::Option::Some("PROFILE_CUSTOM"),
27071                Self::UnknownValue(u) => u.0.name(),
27072            }
27073        }
27074    }
27075
27076    impl std::default::Default for Profile {
27077        fn default() -> Self {
27078            use std::convert::From;
27079            Self::from(0)
27080        }
27081    }
27082
27083    impl std::fmt::Display for Profile {
27084        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27085            wkt::internal::display_enum(f, self.name(), self.value())
27086        }
27087    }
27088
27089    impl std::convert::From<i32> for Profile {
27090        fn from(value: i32) -> Self {
27091            match value {
27092                0 => Self::Unspecified,
27093                1 => Self::Compatible,
27094                2 => Self::Modern,
27095                3 => Self::Restricted,
27096                4 => Self::Custom,
27097                _ => Self::UnknownValue(profile::UnknownValue(
27098                    wkt::internal::UnknownEnumValue::Integer(value),
27099                )),
27100            }
27101        }
27102    }
27103
27104    impl std::convert::From<&str> for Profile {
27105        fn from(value: &str) -> Self {
27106            use std::string::ToString;
27107            match value {
27108                "PROFILE_UNSPECIFIED" => Self::Unspecified,
27109                "PROFILE_COMPATIBLE" => Self::Compatible,
27110                "PROFILE_MODERN" => Self::Modern,
27111                "PROFILE_RESTRICTED" => Self::Restricted,
27112                "PROFILE_CUSTOM" => Self::Custom,
27113                _ => Self::UnknownValue(profile::UnknownValue(
27114                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27115                )),
27116            }
27117        }
27118    }
27119
27120    impl serde::ser::Serialize for Profile {
27121        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27122        where
27123            S: serde::Serializer,
27124        {
27125            match self {
27126                Self::Unspecified => serializer.serialize_i32(0),
27127                Self::Compatible => serializer.serialize_i32(1),
27128                Self::Modern => serializer.serialize_i32(2),
27129                Self::Restricted => serializer.serialize_i32(3),
27130                Self::Custom => serializer.serialize_i32(4),
27131                Self::UnknownValue(u) => u.0.serialize(serializer),
27132            }
27133        }
27134    }
27135
27136    impl<'de> serde::de::Deserialize<'de> for Profile {
27137        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27138        where
27139            D: serde::Deserializer<'de>,
27140        {
27141            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Profile>::new(
27142                ".google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile",
27143            ))
27144        }
27145    }
27146}
27147
27148/// Request used by the CreateTlsInspectionPolicy method.
27149#[derive(Clone, Default, PartialEq)]
27150#[non_exhaustive]
27151pub struct CreateTlsInspectionPolicyRequest {
27152    /// Required. The parent resource of the TlsInspectionPolicy. Must be in the
27153    /// format `projects/{project}/locations/{location}`.
27154    pub parent: std::string::String,
27155
27156    /// Required. Short name of the TlsInspectionPolicy resource to be created.
27157    /// This value should be 1-63 characters long, containing only
27158    /// letters, numbers, hyphens, and underscores, and should not start
27159    /// with a number. E.g. "tls_inspection_policy1".
27160    pub tls_inspection_policy_id: std::string::String,
27161
27162    /// Required. TlsInspectionPolicy resource to be created.
27163    pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
27164
27165    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27166}
27167
27168impl CreateTlsInspectionPolicyRequest {
27169    /// Creates a new default instance.
27170    pub fn new() -> Self {
27171        std::default::Default::default()
27172    }
27173
27174    /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
27175    ///
27176    /// # Example
27177    /// ```ignore,no_run
27178    /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27179    /// # let project_id = "project_id";
27180    /// # let location_id = "location_id";
27181    /// let x = CreateTlsInspectionPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
27182    /// ```
27183    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27184        self.parent = v.into();
27185        self
27186    }
27187
27188    /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
27189    ///
27190    /// # Example
27191    /// ```ignore,no_run
27192    /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27193    /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy_id("example");
27194    /// ```
27195    pub fn set_tls_inspection_policy_id<T: std::convert::Into<std::string::String>>(
27196        mut self,
27197        v: T,
27198    ) -> Self {
27199        self.tls_inspection_policy_id = v.into();
27200        self
27201    }
27202
27203    /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
27204    ///
27205    /// # Example
27206    /// ```ignore,no_run
27207    /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27208    /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27209    /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
27210    /// ```
27211    pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
27212    where
27213        T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27214    {
27215        self.tls_inspection_policy = std::option::Option::Some(v.into());
27216        self
27217    }
27218
27219    /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
27220    ///
27221    /// # Example
27222    /// ```ignore,no_run
27223    /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27224    /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27225    /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
27226    /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
27227    /// ```
27228    pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
27229    where
27230        T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27231    {
27232        self.tls_inspection_policy = v.map(|x| x.into());
27233        self
27234    }
27235}
27236
27237impl wkt::message::Message for CreateTlsInspectionPolicyRequest {
27238    fn typename() -> &'static str {
27239        "type.googleapis.com/google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest"
27240    }
27241}
27242
27243/// Request used with the ListTlsInspectionPolicies method.
27244#[derive(Clone, Default, PartialEq)]
27245#[non_exhaustive]
27246pub struct ListTlsInspectionPoliciesRequest {
27247    /// Required. The project and location from which the TlsInspectionPolicies
27248    /// should be listed, specified in the format
27249    /// `projects/{project}/locations/{location}`.
27250    pub parent: std::string::String,
27251
27252    /// Maximum number of TlsInspectionPolicies to return per call.
27253    pub page_size: i32,
27254
27255    /// The value returned by the last
27256    /// 'ListTlsInspectionPoliciesResponse' Indicates that this is a
27257    /// continuation of a prior 'ListTlsInspectionPolicies' call, and
27258    /// that the system should return the next page of data.
27259    pub page_token: std::string::String,
27260
27261    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27262}
27263
27264impl ListTlsInspectionPoliciesRequest {
27265    /// Creates a new default instance.
27266    pub fn new() -> Self {
27267        std::default::Default::default()
27268    }
27269
27270    /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
27271    ///
27272    /// # Example
27273    /// ```ignore,no_run
27274    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27275    /// let x = ListTlsInspectionPoliciesRequest::new().set_parent("example");
27276    /// ```
27277    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27278        self.parent = v.into();
27279        self
27280    }
27281
27282    /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
27283    ///
27284    /// # Example
27285    /// ```ignore,no_run
27286    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27287    /// let x = ListTlsInspectionPoliciesRequest::new().set_page_size(42);
27288    /// ```
27289    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
27290        self.page_size = v.into();
27291        self
27292    }
27293
27294    /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
27295    ///
27296    /// # Example
27297    /// ```ignore,no_run
27298    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27299    /// let x = ListTlsInspectionPoliciesRequest::new().set_page_token("example");
27300    /// ```
27301    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27302        self.page_token = v.into();
27303        self
27304    }
27305}
27306
27307impl wkt::message::Message for ListTlsInspectionPoliciesRequest {
27308    fn typename() -> &'static str {
27309        "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest"
27310    }
27311}
27312
27313/// Response returned by the ListTlsInspectionPolicies method.
27314#[derive(Clone, Default, PartialEq)]
27315#[non_exhaustive]
27316pub struct ListTlsInspectionPoliciesResponse {
27317    /// List of TlsInspectionPolicies resources.
27318    pub tls_inspection_policies: std::vec::Vec<crate::model::TlsInspectionPolicy>,
27319
27320    /// If there might be more results than those appearing in this response, then
27321    /// 'next_page_token' is included. To get the next set of results, call this
27322    /// method again using the value of 'next_page_token' as 'page_token'.
27323    pub next_page_token: std::string::String,
27324
27325    /// Locations that could not be reached.
27326    pub unreachable: std::vec::Vec<std::string::String>,
27327
27328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27329}
27330
27331impl ListTlsInspectionPoliciesResponse {
27332    /// Creates a new default instance.
27333    pub fn new() -> Self {
27334        std::default::Default::default()
27335    }
27336
27337    /// Sets the value of [tls_inspection_policies][crate::model::ListTlsInspectionPoliciesResponse::tls_inspection_policies].
27338    ///
27339    /// # Example
27340    /// ```ignore,no_run
27341    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27342    /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27343    /// let x = ListTlsInspectionPoliciesResponse::new()
27344    ///     .set_tls_inspection_policies([
27345    ///         TlsInspectionPolicy::default()/* use setters */,
27346    ///         TlsInspectionPolicy::default()/* use (different) setters */,
27347    ///     ]);
27348    /// ```
27349    pub fn set_tls_inspection_policies<T, V>(mut self, v: T) -> Self
27350    where
27351        T: std::iter::IntoIterator<Item = V>,
27352        V: std::convert::Into<crate::model::TlsInspectionPolicy>,
27353    {
27354        use std::iter::Iterator;
27355        self.tls_inspection_policies = v.into_iter().map(|i| i.into()).collect();
27356        self
27357    }
27358
27359    /// Sets the value of [next_page_token][crate::model::ListTlsInspectionPoliciesResponse::next_page_token].
27360    ///
27361    /// # Example
27362    /// ```ignore,no_run
27363    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27364    /// let x = ListTlsInspectionPoliciesResponse::new().set_next_page_token("example");
27365    /// ```
27366    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27367        self.next_page_token = v.into();
27368        self
27369    }
27370
27371    /// Sets the value of [unreachable][crate::model::ListTlsInspectionPoliciesResponse::unreachable].
27372    ///
27373    /// # Example
27374    /// ```ignore,no_run
27375    /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27376    /// let x = ListTlsInspectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
27377    /// ```
27378    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
27379    where
27380        T: std::iter::IntoIterator<Item = V>,
27381        V: std::convert::Into<std::string::String>,
27382    {
27383        use std::iter::Iterator;
27384        self.unreachable = v.into_iter().map(|i| i.into()).collect();
27385        self
27386    }
27387}
27388
27389impl wkt::message::Message for ListTlsInspectionPoliciesResponse {
27390    fn typename() -> &'static str {
27391        "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse"
27392    }
27393}
27394
27395#[doc(hidden)]
27396impl google_cloud_gax::paginator::internal::PageableResponse for ListTlsInspectionPoliciesResponse {
27397    type PageItem = crate::model::TlsInspectionPolicy;
27398
27399    fn items(self) -> std::vec::Vec<Self::PageItem> {
27400        self.tls_inspection_policies
27401    }
27402
27403    fn next_page_token(&self) -> std::string::String {
27404        use std::clone::Clone;
27405        self.next_page_token.clone()
27406    }
27407}
27408
27409/// Request used by the GetTlsInspectionPolicy method.
27410#[derive(Clone, Default, PartialEq)]
27411#[non_exhaustive]
27412pub struct GetTlsInspectionPolicyRequest {
27413    /// Required. A name of the TlsInspectionPolicy to get. Must be in the format
27414    /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
27415    pub name: std::string::String,
27416
27417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27418}
27419
27420impl GetTlsInspectionPolicyRequest {
27421    /// Creates a new default instance.
27422    pub fn new() -> Self {
27423        std::default::Default::default()
27424    }
27425
27426    /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
27427    ///
27428    /// # Example
27429    /// ```ignore,no_run
27430    /// # use google_cloud_networksecurity_v1::model::GetTlsInspectionPolicyRequest;
27431    /// # let project_id = "project_id";
27432    /// # let location_id = "location_id";
27433    /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
27434    /// let x = GetTlsInspectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
27435    /// ```
27436    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27437        self.name = v.into();
27438        self
27439    }
27440}
27441
27442impl wkt::message::Message for GetTlsInspectionPolicyRequest {
27443    fn typename() -> &'static str {
27444        "type.googleapis.com/google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest"
27445    }
27446}
27447
27448/// Request used by the DeleteTlsInspectionPolicy method.
27449#[derive(Clone, Default, PartialEq)]
27450#[non_exhaustive]
27451pub struct DeleteTlsInspectionPolicyRequest {
27452    /// Required. A name of the TlsInspectionPolicy to delete. Must be in the
27453    /// format
27454    /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
27455    pub name: std::string::String,
27456
27457    /// If set to true, any rules for this TlsInspectionPolicy will also be
27458    /// deleted. (Otherwise, the request will only work if the TlsInspectionPolicy
27459    /// has no rules.)
27460    pub force: bool,
27461
27462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27463}
27464
27465impl DeleteTlsInspectionPolicyRequest {
27466    /// Creates a new default instance.
27467    pub fn new() -> Self {
27468        std::default::Default::default()
27469    }
27470
27471    /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
27472    ///
27473    /// # Example
27474    /// ```ignore,no_run
27475    /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
27476    /// # let project_id = "project_id";
27477    /// # let location_id = "location_id";
27478    /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
27479    /// let x = DeleteTlsInspectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
27480    /// ```
27481    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27482        self.name = v.into();
27483        self
27484    }
27485
27486    /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
27487    ///
27488    /// # Example
27489    /// ```ignore,no_run
27490    /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
27491    /// let x = DeleteTlsInspectionPolicyRequest::new().set_force(true);
27492    /// ```
27493    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
27494        self.force = v.into();
27495        self
27496    }
27497}
27498
27499impl wkt::message::Message for DeleteTlsInspectionPolicyRequest {
27500    fn typename() -> &'static str {
27501        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest"
27502    }
27503}
27504
27505/// Request used by the UpdateTlsInspectionPolicy method.
27506#[derive(Clone, Default, PartialEq)]
27507#[non_exhaustive]
27508pub struct UpdateTlsInspectionPolicyRequest {
27509    /// Optional. Field mask is used to specify the fields to be overwritten in the
27510    /// TlsInspectionPolicy resource by the update.
27511    /// The fields specified in the update_mask are relative to the resource, not
27512    /// the full request. A field will be overwritten if it is in the mask. If the
27513    /// user does not provide a mask then all fields will be overwritten.
27514    pub update_mask: std::option::Option<wkt::FieldMask>,
27515
27516    /// Required. Updated TlsInspectionPolicy resource.
27517    pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
27518
27519    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27520}
27521
27522impl UpdateTlsInspectionPolicyRequest {
27523    /// Creates a new default instance.
27524    pub fn new() -> Self {
27525        std::default::Default::default()
27526    }
27527
27528    /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
27529    ///
27530    /// # Example
27531    /// ```ignore,no_run
27532    /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27533    /// use wkt::FieldMask;
27534    /// let x = UpdateTlsInspectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
27535    /// ```
27536    pub fn set_update_mask<T>(mut self, v: T) -> Self
27537    where
27538        T: std::convert::Into<wkt::FieldMask>,
27539    {
27540        self.update_mask = std::option::Option::Some(v.into());
27541        self
27542    }
27543
27544    /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
27545    ///
27546    /// # Example
27547    /// ```ignore,no_run
27548    /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27549    /// use wkt::FieldMask;
27550    /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
27551    /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
27552    /// ```
27553    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
27554    where
27555        T: std::convert::Into<wkt::FieldMask>,
27556    {
27557        self.update_mask = v.map(|x| x.into());
27558        self
27559    }
27560
27561    /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
27562    ///
27563    /// # Example
27564    /// ```ignore,no_run
27565    /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27566    /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27567    /// let x = UpdateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
27568    /// ```
27569    pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
27570    where
27571        T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27572    {
27573        self.tls_inspection_policy = std::option::Option::Some(v.into());
27574        self
27575    }
27576
27577    /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
27578    ///
27579    /// # Example
27580    /// ```ignore,no_run
27581    /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27582    /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27583    /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
27584    /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
27585    /// ```
27586    pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
27587    where
27588        T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27589    {
27590        self.tls_inspection_policy = v.map(|x| x.into());
27591        self
27592    }
27593}
27594
27595impl wkt::message::Message for UpdateTlsInspectionPolicyRequest {
27596    fn typename() -> &'static str {
27597        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest"
27598    }
27599}
27600
27601/// UrlList proto helps users to set reusable, independently manageable lists
27602/// of hosts, host patterns, URLs, URL patterns.
27603#[derive(Clone, Default, PartialEq)]
27604#[non_exhaustive]
27605pub struct UrlList {
27606    /// Required. Name of the resource provided by the user.
27607    /// Name is of the form
27608    /// projects/{project}/locations/{location}/urlLists/{url_list}
27609    /// url_list should match the
27610    /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
27611    pub name: std::string::String,
27612
27613    /// Output only. Time when the security policy was created.
27614    pub create_time: std::option::Option<wkt::Timestamp>,
27615
27616    /// Output only. Time when the security policy was updated.
27617    pub update_time: std::option::Option<wkt::Timestamp>,
27618
27619    /// Optional. Free-text description of the resource.
27620    pub description: std::string::String,
27621
27622    /// Required. FQDNs and URLs.
27623    pub values: std::vec::Vec<std::string::String>,
27624
27625    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27626}
27627
27628impl UrlList {
27629    /// Creates a new default instance.
27630    pub fn new() -> Self {
27631        std::default::Default::default()
27632    }
27633
27634    /// Sets the value of [name][crate::model::UrlList::name].
27635    ///
27636    /// # Example
27637    /// ```ignore,no_run
27638    /// # use google_cloud_networksecurity_v1::model::UrlList;
27639    /// # let project_id = "project_id";
27640    /// # let location_id = "location_id";
27641    /// # let url_list_id = "url_list_id";
27642    /// let x = UrlList::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
27643    /// ```
27644    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27645        self.name = v.into();
27646        self
27647    }
27648
27649    /// Sets the value of [create_time][crate::model::UrlList::create_time].
27650    ///
27651    /// # Example
27652    /// ```ignore,no_run
27653    /// # use google_cloud_networksecurity_v1::model::UrlList;
27654    /// use wkt::Timestamp;
27655    /// let x = UrlList::new().set_create_time(Timestamp::default()/* use setters */);
27656    /// ```
27657    pub fn set_create_time<T>(mut self, v: T) -> Self
27658    where
27659        T: std::convert::Into<wkt::Timestamp>,
27660    {
27661        self.create_time = std::option::Option::Some(v.into());
27662        self
27663    }
27664
27665    /// Sets or clears the value of [create_time][crate::model::UrlList::create_time].
27666    ///
27667    /// # Example
27668    /// ```ignore,no_run
27669    /// # use google_cloud_networksecurity_v1::model::UrlList;
27670    /// use wkt::Timestamp;
27671    /// let x = UrlList::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
27672    /// let x = UrlList::new().set_or_clear_create_time(None::<Timestamp>);
27673    /// ```
27674    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
27675    where
27676        T: std::convert::Into<wkt::Timestamp>,
27677    {
27678        self.create_time = v.map(|x| x.into());
27679        self
27680    }
27681
27682    /// Sets the value of [update_time][crate::model::UrlList::update_time].
27683    ///
27684    /// # Example
27685    /// ```ignore,no_run
27686    /// # use google_cloud_networksecurity_v1::model::UrlList;
27687    /// use wkt::Timestamp;
27688    /// let x = UrlList::new().set_update_time(Timestamp::default()/* use setters */);
27689    /// ```
27690    pub fn set_update_time<T>(mut self, v: T) -> Self
27691    where
27692        T: std::convert::Into<wkt::Timestamp>,
27693    {
27694        self.update_time = std::option::Option::Some(v.into());
27695        self
27696    }
27697
27698    /// Sets or clears the value of [update_time][crate::model::UrlList::update_time].
27699    ///
27700    /// # Example
27701    /// ```ignore,no_run
27702    /// # use google_cloud_networksecurity_v1::model::UrlList;
27703    /// use wkt::Timestamp;
27704    /// let x = UrlList::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
27705    /// let x = UrlList::new().set_or_clear_update_time(None::<Timestamp>);
27706    /// ```
27707    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
27708    where
27709        T: std::convert::Into<wkt::Timestamp>,
27710    {
27711        self.update_time = v.map(|x| x.into());
27712        self
27713    }
27714
27715    /// Sets the value of [description][crate::model::UrlList::description].
27716    ///
27717    /// # Example
27718    /// ```ignore,no_run
27719    /// # use google_cloud_networksecurity_v1::model::UrlList;
27720    /// let x = UrlList::new().set_description("example");
27721    /// ```
27722    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27723        self.description = v.into();
27724        self
27725    }
27726
27727    /// Sets the value of [values][crate::model::UrlList::values].
27728    ///
27729    /// # Example
27730    /// ```ignore,no_run
27731    /// # use google_cloud_networksecurity_v1::model::UrlList;
27732    /// let x = UrlList::new().set_values(["a", "b", "c"]);
27733    /// ```
27734    pub fn set_values<T, V>(mut self, v: T) -> Self
27735    where
27736        T: std::iter::IntoIterator<Item = V>,
27737        V: std::convert::Into<std::string::String>,
27738    {
27739        use std::iter::Iterator;
27740        self.values = v.into_iter().map(|i| i.into()).collect();
27741        self
27742    }
27743}
27744
27745impl wkt::message::Message for UrlList {
27746    fn typename() -> &'static str {
27747        "type.googleapis.com/google.cloud.networksecurity.v1.UrlList"
27748    }
27749}
27750
27751/// Request used by the ListUrlList method.
27752#[derive(Clone, Default, PartialEq)]
27753#[non_exhaustive]
27754pub struct ListUrlListsRequest {
27755    /// Required. The project and location from which the UrlLists should
27756    /// be listed, specified in the format
27757    /// `projects/{project}/locations/{location}`.
27758    pub parent: std::string::String,
27759
27760    /// Maximum number of UrlLists to return per call.
27761    pub page_size: i32,
27762
27763    /// The value returned by the last `ListUrlListsResponse`
27764    /// Indicates that this is a continuation of a prior
27765    /// `ListUrlLists` call, and that the system
27766    /// should return the next page of data.
27767    pub page_token: std::string::String,
27768
27769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27770}
27771
27772impl ListUrlListsRequest {
27773    /// Creates a new default instance.
27774    pub fn new() -> Self {
27775        std::default::Default::default()
27776    }
27777
27778    /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
27779    ///
27780    /// # Example
27781    /// ```ignore,no_run
27782    /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27783    /// let x = ListUrlListsRequest::new().set_parent("example");
27784    /// ```
27785    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27786        self.parent = v.into();
27787        self
27788    }
27789
27790    /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
27791    ///
27792    /// # Example
27793    /// ```ignore,no_run
27794    /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27795    /// let x = ListUrlListsRequest::new().set_page_size(42);
27796    /// ```
27797    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
27798        self.page_size = v.into();
27799        self
27800    }
27801
27802    /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
27803    ///
27804    /// # Example
27805    /// ```ignore,no_run
27806    /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27807    /// let x = ListUrlListsRequest::new().set_page_token("example");
27808    /// ```
27809    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27810        self.page_token = v.into();
27811        self
27812    }
27813}
27814
27815impl wkt::message::Message for ListUrlListsRequest {
27816    fn typename() -> &'static str {
27817        "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsRequest"
27818    }
27819}
27820
27821/// Response returned by the ListUrlLists method.
27822#[derive(Clone, Default, PartialEq)]
27823#[non_exhaustive]
27824pub struct ListUrlListsResponse {
27825    /// List of UrlList resources.
27826    pub url_lists: std::vec::Vec<crate::model::UrlList>,
27827
27828    /// If there might be more results than those appearing in this response, then
27829    /// `next_page_token` is included. To get the next set of results, call this
27830    /// method again using the value of `next_page_token` as `page_token`.
27831    pub next_page_token: std::string::String,
27832
27833    /// Locations that could not be reached.
27834    pub unreachable: std::vec::Vec<std::string::String>,
27835
27836    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27837}
27838
27839impl ListUrlListsResponse {
27840    /// Creates a new default instance.
27841    pub fn new() -> Self {
27842        std::default::Default::default()
27843    }
27844
27845    /// Sets the value of [url_lists][crate::model::ListUrlListsResponse::url_lists].
27846    ///
27847    /// # Example
27848    /// ```ignore,no_run
27849    /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27850    /// use google_cloud_networksecurity_v1::model::UrlList;
27851    /// let x = ListUrlListsResponse::new()
27852    ///     .set_url_lists([
27853    ///         UrlList::default()/* use setters */,
27854    ///         UrlList::default()/* use (different) setters */,
27855    ///     ]);
27856    /// ```
27857    pub fn set_url_lists<T, V>(mut self, v: T) -> Self
27858    where
27859        T: std::iter::IntoIterator<Item = V>,
27860        V: std::convert::Into<crate::model::UrlList>,
27861    {
27862        use std::iter::Iterator;
27863        self.url_lists = v.into_iter().map(|i| i.into()).collect();
27864        self
27865    }
27866
27867    /// Sets the value of [next_page_token][crate::model::ListUrlListsResponse::next_page_token].
27868    ///
27869    /// # Example
27870    /// ```ignore,no_run
27871    /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27872    /// let x = ListUrlListsResponse::new().set_next_page_token("example");
27873    /// ```
27874    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27875        self.next_page_token = v.into();
27876        self
27877    }
27878
27879    /// Sets the value of [unreachable][crate::model::ListUrlListsResponse::unreachable].
27880    ///
27881    /// # Example
27882    /// ```ignore,no_run
27883    /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27884    /// let x = ListUrlListsResponse::new().set_unreachable(["a", "b", "c"]);
27885    /// ```
27886    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
27887    where
27888        T: std::iter::IntoIterator<Item = V>,
27889        V: std::convert::Into<std::string::String>,
27890    {
27891        use std::iter::Iterator;
27892        self.unreachable = v.into_iter().map(|i| i.into()).collect();
27893        self
27894    }
27895}
27896
27897impl wkt::message::Message for ListUrlListsResponse {
27898    fn typename() -> &'static str {
27899        "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsResponse"
27900    }
27901}
27902
27903#[doc(hidden)]
27904impl google_cloud_gax::paginator::internal::PageableResponse for ListUrlListsResponse {
27905    type PageItem = crate::model::UrlList;
27906
27907    fn items(self) -> std::vec::Vec<Self::PageItem> {
27908        self.url_lists
27909    }
27910
27911    fn next_page_token(&self) -> std::string::String {
27912        use std::clone::Clone;
27913        self.next_page_token.clone()
27914    }
27915}
27916
27917/// Request used by the GetUrlList method.
27918#[derive(Clone, Default, PartialEq)]
27919#[non_exhaustive]
27920pub struct GetUrlListRequest {
27921    /// Required. A name of the UrlList to get. Must be in the format
27922    /// `projects/*/locations/{location}/urlLists/*`.
27923    pub name: std::string::String,
27924
27925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27926}
27927
27928impl GetUrlListRequest {
27929    /// Creates a new default instance.
27930    pub fn new() -> Self {
27931        std::default::Default::default()
27932    }
27933
27934    /// Sets the value of [name][crate::model::GetUrlListRequest::name].
27935    ///
27936    /// # Example
27937    /// ```ignore,no_run
27938    /// # use google_cloud_networksecurity_v1::model::GetUrlListRequest;
27939    /// # let project_id = "project_id";
27940    /// # let location_id = "location_id";
27941    /// # let url_list_id = "url_list_id";
27942    /// let x = GetUrlListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
27943    /// ```
27944    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27945        self.name = v.into();
27946        self
27947    }
27948}
27949
27950impl wkt::message::Message for GetUrlListRequest {
27951    fn typename() -> &'static str {
27952        "type.googleapis.com/google.cloud.networksecurity.v1.GetUrlListRequest"
27953    }
27954}
27955
27956/// Request used by the CreateUrlList method.
27957#[derive(Clone, Default, PartialEq)]
27958#[non_exhaustive]
27959pub struct CreateUrlListRequest {
27960    /// Required. The parent resource of the UrlList. Must be in
27961    /// the format `projects/*/locations/{location}`.
27962    pub parent: std::string::String,
27963
27964    /// Required. Short name of the UrlList resource to be created. This value
27965    /// should be 1-63 characters long, containing only letters, numbers, hyphens,
27966    /// and underscores, and should not start with a number. E.g. "url_list".
27967    pub url_list_id: std::string::String,
27968
27969    /// Required. UrlList resource to be created.
27970    pub url_list: std::option::Option<crate::model::UrlList>,
27971
27972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27973}
27974
27975impl CreateUrlListRequest {
27976    /// Creates a new default instance.
27977    pub fn new() -> Self {
27978        std::default::Default::default()
27979    }
27980
27981    /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
27982    ///
27983    /// # Example
27984    /// ```ignore,no_run
27985    /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
27986    /// # let project_id = "project_id";
27987    /// # let location_id = "location_id";
27988    /// let x = CreateUrlListRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
27989    /// ```
27990    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27991        self.parent = v.into();
27992        self
27993    }
27994
27995    /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
27996    ///
27997    /// # Example
27998    /// ```ignore,no_run
27999    /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
28000    /// let x = CreateUrlListRequest::new().set_url_list_id("example");
28001    /// ```
28002    pub fn set_url_list_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28003        self.url_list_id = v.into();
28004        self
28005    }
28006
28007    /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
28008    ///
28009    /// # Example
28010    /// ```ignore,no_run
28011    /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
28012    /// use google_cloud_networksecurity_v1::model::UrlList;
28013    /// let x = CreateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
28014    /// ```
28015    pub fn set_url_list<T>(mut self, v: T) -> Self
28016    where
28017        T: std::convert::Into<crate::model::UrlList>,
28018    {
28019        self.url_list = std::option::Option::Some(v.into());
28020        self
28021    }
28022
28023    /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
28024    ///
28025    /// # Example
28026    /// ```ignore,no_run
28027    /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
28028    /// use google_cloud_networksecurity_v1::model::UrlList;
28029    /// let x = CreateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
28030    /// let x = CreateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
28031    /// ```
28032    pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
28033    where
28034        T: std::convert::Into<crate::model::UrlList>,
28035    {
28036        self.url_list = v.map(|x| x.into());
28037        self
28038    }
28039}
28040
28041impl wkt::message::Message for CreateUrlListRequest {
28042    fn typename() -> &'static str {
28043        "type.googleapis.com/google.cloud.networksecurity.v1.CreateUrlListRequest"
28044    }
28045}
28046
28047/// Request used by UpdateUrlList method.
28048#[derive(Clone, Default, PartialEq)]
28049#[non_exhaustive]
28050pub struct UpdateUrlListRequest {
28051    /// Optional. Field mask is used to specify the fields to be overwritten in the
28052    /// UrlList resource by the update.  The fields
28053    /// specified in the update_mask are relative to the resource, not
28054    /// the full request. A field will be overwritten if it is in the
28055    /// mask. If the user does not provide a mask then all fields will be
28056    /// overwritten.
28057    pub update_mask: std::option::Option<wkt::FieldMask>,
28058
28059    /// Required. Updated UrlList resource.
28060    pub url_list: std::option::Option<crate::model::UrlList>,
28061
28062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28063}
28064
28065impl UpdateUrlListRequest {
28066    /// Creates a new default instance.
28067    pub fn new() -> Self {
28068        std::default::Default::default()
28069    }
28070
28071    /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
28072    ///
28073    /// # Example
28074    /// ```ignore,no_run
28075    /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28076    /// use wkt::FieldMask;
28077    /// let x = UpdateUrlListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
28078    /// ```
28079    pub fn set_update_mask<T>(mut self, v: T) -> Self
28080    where
28081        T: std::convert::Into<wkt::FieldMask>,
28082    {
28083        self.update_mask = std::option::Option::Some(v.into());
28084        self
28085    }
28086
28087    /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
28088    ///
28089    /// # Example
28090    /// ```ignore,no_run
28091    /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28092    /// use wkt::FieldMask;
28093    /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
28094    /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
28095    /// ```
28096    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
28097    where
28098        T: std::convert::Into<wkt::FieldMask>,
28099    {
28100        self.update_mask = v.map(|x| x.into());
28101        self
28102    }
28103
28104    /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
28105    ///
28106    /// # Example
28107    /// ```ignore,no_run
28108    /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28109    /// use google_cloud_networksecurity_v1::model::UrlList;
28110    /// let x = UpdateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
28111    /// ```
28112    pub fn set_url_list<T>(mut self, v: T) -> Self
28113    where
28114        T: std::convert::Into<crate::model::UrlList>,
28115    {
28116        self.url_list = std::option::Option::Some(v.into());
28117        self
28118    }
28119
28120    /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
28121    ///
28122    /// # Example
28123    /// ```ignore,no_run
28124    /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28125    /// use google_cloud_networksecurity_v1::model::UrlList;
28126    /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
28127    /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
28128    /// ```
28129    pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
28130    where
28131        T: std::convert::Into<crate::model::UrlList>,
28132    {
28133        self.url_list = v.map(|x| x.into());
28134        self
28135    }
28136}
28137
28138impl wkt::message::Message for UpdateUrlListRequest {
28139    fn typename() -> &'static str {
28140        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateUrlListRequest"
28141    }
28142}
28143
28144/// Request used by the DeleteUrlList method.
28145#[derive(Clone, Default, PartialEq)]
28146#[non_exhaustive]
28147pub struct DeleteUrlListRequest {
28148    /// Required. A name of the UrlList to delete. Must be in
28149    /// the format `projects/*/locations/{location}/urlLists/*`.
28150    pub name: std::string::String,
28151
28152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28153}
28154
28155impl DeleteUrlListRequest {
28156    /// Creates a new default instance.
28157    pub fn new() -> Self {
28158        std::default::Default::default()
28159    }
28160
28161    /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
28162    ///
28163    /// # Example
28164    /// ```ignore,no_run
28165    /// # use google_cloud_networksecurity_v1::model::DeleteUrlListRequest;
28166    /// # let project_id = "project_id";
28167    /// # let location_id = "location_id";
28168    /// # let url_list_id = "url_list_id";
28169    /// let x = DeleteUrlListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
28170    /// ```
28171    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28172        self.name = v.into();
28173        self
28174    }
28175}
28176
28177impl wkt::message::Message for DeleteUrlListRequest {
28178    fn typename() -> &'static str {
28179        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteUrlListRequest"
28180    }
28181}
28182
28183/// Severity level.
28184///
28185/// # Working with unknown values
28186///
28187/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28188/// additional enum variants at any time. Adding new variants is not considered
28189/// a breaking change. Applications should write their code in anticipation of:
28190///
28191/// - New values appearing in future releases of the client library, **and**
28192/// - New values received dynamically, without application changes.
28193///
28194/// Please consult the [Working with enums] section in the user guide for some
28195/// guidelines.
28196///
28197/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28198#[derive(Clone, Debug, PartialEq)]
28199#[non_exhaustive]
28200pub enum Severity {
28201    /// Severity level not specified.
28202    Unspecified,
28203    /// Suspicious events that do not pose an immediate threat, but that are
28204    /// reported to call attention to deeper problems that could possibly exist.
28205    Informational,
28206    /// Warning-level threats that have very little impact on an organization's
28207    /// infrastructure. They usually require local or physical system access and
28208    /// may often result in victim privacy issues and information leakage.
28209    Low,
28210    /// Minor threats in which impact is minimized, that do not compromise the
28211    /// target or exploits that require an attacker to reside on the same local
28212    /// network as the victim, affect only non-standard configurations or obscure
28213    /// applications, or provide very limited access.
28214    Medium,
28215    /// Threats that have the ability to become critical but have mitigating
28216    /// factors; for example, they may be difficult to exploit, do not result in
28217    /// elevated privileges, or do not have a large victim pool.
28218    High,
28219    /// Serious threats, such as those that affect default installations of widely
28220    /// deployed software, result in root compromise of servers, and the exploit
28221    /// code is widely available to attackers. The attacker usually does not need
28222    /// any special authentication credentials or knowledge about the individual
28223    /// victims and the target does not need to be manipulated into performing any
28224    /// special functions.
28225    Critical,
28226    /// If set, the enum was initialized with an unknown value.
28227    ///
28228    /// Applications can examine the value using [Severity::value] or
28229    /// [Severity::name].
28230    UnknownValue(severity::UnknownValue),
28231}
28232
28233#[doc(hidden)]
28234pub mod severity {
28235    #[allow(unused_imports)]
28236    use super::*;
28237    #[derive(Clone, Debug, PartialEq)]
28238    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28239}
28240
28241impl Severity {
28242    /// Gets the enum value.
28243    ///
28244    /// Returns `None` if the enum contains an unknown value deserialized from
28245    /// the string representation of enums.
28246    pub fn value(&self) -> std::option::Option<i32> {
28247        match self {
28248            Self::Unspecified => std::option::Option::Some(0),
28249            Self::Informational => std::option::Option::Some(1),
28250            Self::Low => std::option::Option::Some(2),
28251            Self::Medium => std::option::Option::Some(3),
28252            Self::High => std::option::Option::Some(4),
28253            Self::Critical => std::option::Option::Some(5),
28254            Self::UnknownValue(u) => u.0.value(),
28255        }
28256    }
28257
28258    /// Gets the enum value as a string.
28259    ///
28260    /// Returns `None` if the enum contains an unknown value deserialized from
28261    /// the integer representation of enums.
28262    pub fn name(&self) -> std::option::Option<&str> {
28263        match self {
28264            Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
28265            Self::Informational => std::option::Option::Some("INFORMATIONAL"),
28266            Self::Low => std::option::Option::Some("LOW"),
28267            Self::Medium => std::option::Option::Some("MEDIUM"),
28268            Self::High => std::option::Option::Some("HIGH"),
28269            Self::Critical => std::option::Option::Some("CRITICAL"),
28270            Self::UnknownValue(u) => u.0.name(),
28271        }
28272    }
28273}
28274
28275impl std::default::Default for Severity {
28276    fn default() -> Self {
28277        use std::convert::From;
28278        Self::from(0)
28279    }
28280}
28281
28282impl std::fmt::Display for Severity {
28283    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28284        wkt::internal::display_enum(f, self.name(), self.value())
28285    }
28286}
28287
28288impl std::convert::From<i32> for Severity {
28289    fn from(value: i32) -> Self {
28290        match value {
28291            0 => Self::Unspecified,
28292            1 => Self::Informational,
28293            2 => Self::Low,
28294            3 => Self::Medium,
28295            4 => Self::High,
28296            5 => Self::Critical,
28297            _ => Self::UnknownValue(severity::UnknownValue(
28298                wkt::internal::UnknownEnumValue::Integer(value),
28299            )),
28300        }
28301    }
28302}
28303
28304impl std::convert::From<&str> for Severity {
28305    fn from(value: &str) -> Self {
28306        use std::string::ToString;
28307        match value {
28308            "SEVERITY_UNSPECIFIED" => Self::Unspecified,
28309            "INFORMATIONAL" => Self::Informational,
28310            "LOW" => Self::Low,
28311            "MEDIUM" => Self::Medium,
28312            "HIGH" => Self::High,
28313            "CRITICAL" => Self::Critical,
28314            _ => Self::UnknownValue(severity::UnknownValue(
28315                wkt::internal::UnknownEnumValue::String(value.to_string()),
28316            )),
28317        }
28318    }
28319}
28320
28321impl serde::ser::Serialize for Severity {
28322    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28323    where
28324        S: serde::Serializer,
28325    {
28326        match self {
28327            Self::Unspecified => serializer.serialize_i32(0),
28328            Self::Informational => serializer.serialize_i32(1),
28329            Self::Low => serializer.serialize_i32(2),
28330            Self::Medium => serializer.serialize_i32(3),
28331            Self::High => serializer.serialize_i32(4),
28332            Self::Critical => serializer.serialize_i32(5),
28333            Self::UnknownValue(u) => u.0.serialize(serializer),
28334        }
28335    }
28336}
28337
28338impl<'de> serde::de::Deserialize<'de> for Severity {
28339    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28340    where
28341        D: serde::Deserializer<'de>,
28342    {
28343        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
28344            ".google.cloud.networksecurity.v1.Severity",
28345        ))
28346    }
28347}
28348
28349/// Type of threat.
28350///
28351/// # Working with unknown values
28352///
28353/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28354/// additional enum variants at any time. Adding new variants is not considered
28355/// a breaking change. Applications should write their code in anticipation of:
28356///
28357/// - New values appearing in future releases of the client library, **and**
28358/// - New values received dynamically, without application changes.
28359///
28360/// Please consult the [Working with enums] section in the user guide for some
28361/// guidelines.
28362///
28363/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28364#[derive(Clone, Debug, PartialEq)]
28365#[non_exhaustive]
28366pub enum ThreatType {
28367    /// Type of threat not specified.
28368    Unspecified,
28369    /// Type of threat is not derivable from threat ID. An override will be
28370    /// created for all types. Firewall will ignore overridden signature ID's
28371    /// that don't exist in the specific type.
28372    Unknown,
28373    /// Threats related to system flaws that an attacker might otherwise attempt
28374    /// to exploit.
28375    Vulnerability,
28376    /// Threats related to viruses and malware found in executables and file
28377    /// types.
28378    Antivirus,
28379    /// Threats related to command-and-control (C2) activity, where spyware on an
28380    /// infected client is collecting data without the user's consent and/or
28381    /// communicating with a remote attacker.
28382    Spyware,
28383    /// Threats related to DNS.
28384    Dns,
28385    /// If set, the enum was initialized with an unknown value.
28386    ///
28387    /// Applications can examine the value using [ThreatType::value] or
28388    /// [ThreatType::name].
28389    UnknownValue(threat_type::UnknownValue),
28390}
28391
28392#[doc(hidden)]
28393pub mod threat_type {
28394    #[allow(unused_imports)]
28395    use super::*;
28396    #[derive(Clone, Debug, PartialEq)]
28397    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28398}
28399
28400impl ThreatType {
28401    /// Gets the enum value.
28402    ///
28403    /// Returns `None` if the enum contains an unknown value deserialized from
28404    /// the string representation of enums.
28405    pub fn value(&self) -> std::option::Option<i32> {
28406        match self {
28407            Self::Unspecified => std::option::Option::Some(0),
28408            Self::Unknown => std::option::Option::Some(1),
28409            Self::Vulnerability => std::option::Option::Some(2),
28410            Self::Antivirus => std::option::Option::Some(3),
28411            Self::Spyware => std::option::Option::Some(4),
28412            Self::Dns => std::option::Option::Some(5),
28413            Self::UnknownValue(u) => u.0.value(),
28414        }
28415    }
28416
28417    /// Gets the enum value as a string.
28418    ///
28419    /// Returns `None` if the enum contains an unknown value deserialized from
28420    /// the integer representation of enums.
28421    pub fn name(&self) -> std::option::Option<&str> {
28422        match self {
28423            Self::Unspecified => std::option::Option::Some("THREAT_TYPE_UNSPECIFIED"),
28424            Self::Unknown => std::option::Option::Some("UNKNOWN"),
28425            Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
28426            Self::Antivirus => std::option::Option::Some("ANTIVIRUS"),
28427            Self::Spyware => std::option::Option::Some("SPYWARE"),
28428            Self::Dns => std::option::Option::Some("DNS"),
28429            Self::UnknownValue(u) => u.0.name(),
28430        }
28431    }
28432}
28433
28434impl std::default::Default for ThreatType {
28435    fn default() -> Self {
28436        use std::convert::From;
28437        Self::from(0)
28438    }
28439}
28440
28441impl std::fmt::Display for ThreatType {
28442    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28443        wkt::internal::display_enum(f, self.name(), self.value())
28444    }
28445}
28446
28447impl std::convert::From<i32> for ThreatType {
28448    fn from(value: i32) -> Self {
28449        match value {
28450            0 => Self::Unspecified,
28451            1 => Self::Unknown,
28452            2 => Self::Vulnerability,
28453            3 => Self::Antivirus,
28454            4 => Self::Spyware,
28455            5 => Self::Dns,
28456            _ => Self::UnknownValue(threat_type::UnknownValue(
28457                wkt::internal::UnknownEnumValue::Integer(value),
28458            )),
28459        }
28460    }
28461}
28462
28463impl std::convert::From<&str> for ThreatType {
28464    fn from(value: &str) -> Self {
28465        use std::string::ToString;
28466        match value {
28467            "THREAT_TYPE_UNSPECIFIED" => Self::Unspecified,
28468            "UNKNOWN" => Self::Unknown,
28469            "VULNERABILITY" => Self::Vulnerability,
28470            "ANTIVIRUS" => Self::Antivirus,
28471            "SPYWARE" => Self::Spyware,
28472            "DNS" => Self::Dns,
28473            _ => Self::UnknownValue(threat_type::UnknownValue(
28474                wkt::internal::UnknownEnumValue::String(value.to_string()),
28475            )),
28476        }
28477    }
28478}
28479
28480impl serde::ser::Serialize for ThreatType {
28481    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28482    where
28483        S: serde::Serializer,
28484    {
28485        match self {
28486            Self::Unspecified => serializer.serialize_i32(0),
28487            Self::Unknown => serializer.serialize_i32(1),
28488            Self::Vulnerability => serializer.serialize_i32(2),
28489            Self::Antivirus => serializer.serialize_i32(3),
28490            Self::Spyware => serializer.serialize_i32(4),
28491            Self::Dns => serializer.serialize_i32(5),
28492            Self::UnknownValue(u) => u.0.serialize(serializer),
28493        }
28494    }
28495}
28496
28497impl<'de> serde::de::Deserialize<'de> for ThreatType {
28498    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28499    where
28500        D: serde::Deserializer<'de>,
28501    {
28502        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatType>::new(
28503            ".google.cloud.networksecurity.v1.ThreatType",
28504        ))
28505    }
28506}
28507
28508/// Threat action override.
28509///
28510/// # Working with unknown values
28511///
28512/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28513/// additional enum variants at any time. Adding new variants is not considered
28514/// a breaking change. Applications should write their code in anticipation of:
28515///
28516/// - New values appearing in future releases of the client library, **and**
28517/// - New values received dynamically, without application changes.
28518///
28519/// Please consult the [Working with enums] section in the user guide for some
28520/// guidelines.
28521///
28522/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28523#[derive(Clone, Debug, PartialEq)]
28524#[non_exhaustive]
28525pub enum ThreatAction {
28526    /// Threat action not specified.
28527    Unspecified,
28528    /// The default action (as specified by the vendor) is taken.
28529    DefaultAction,
28530    /// The packet matching this rule will be allowed to transmit.
28531    Allow,
28532    /// The packet matching this rule will be allowed to transmit, but a threat_log
28533    /// entry will be sent to the consumer project.
28534    Alert,
28535    /// The packet matching this rule will be dropped, and a threat_log entry will
28536    /// be sent to the consumer project.
28537    Deny,
28538    /// If set, the enum was initialized with an unknown value.
28539    ///
28540    /// Applications can examine the value using [ThreatAction::value] or
28541    /// [ThreatAction::name].
28542    UnknownValue(threat_action::UnknownValue),
28543}
28544
28545#[doc(hidden)]
28546pub mod threat_action {
28547    #[allow(unused_imports)]
28548    use super::*;
28549    #[derive(Clone, Debug, PartialEq)]
28550    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28551}
28552
28553impl ThreatAction {
28554    /// Gets the enum value.
28555    ///
28556    /// Returns `None` if the enum contains an unknown value deserialized from
28557    /// the string representation of enums.
28558    pub fn value(&self) -> std::option::Option<i32> {
28559        match self {
28560            Self::Unspecified => std::option::Option::Some(0),
28561            Self::DefaultAction => std::option::Option::Some(4),
28562            Self::Allow => std::option::Option::Some(1),
28563            Self::Alert => std::option::Option::Some(2),
28564            Self::Deny => std::option::Option::Some(3),
28565            Self::UnknownValue(u) => u.0.value(),
28566        }
28567    }
28568
28569    /// Gets the enum value as a string.
28570    ///
28571    /// Returns `None` if the enum contains an unknown value deserialized from
28572    /// the integer representation of enums.
28573    pub fn name(&self) -> std::option::Option<&str> {
28574        match self {
28575            Self::Unspecified => std::option::Option::Some("THREAT_ACTION_UNSPECIFIED"),
28576            Self::DefaultAction => std::option::Option::Some("DEFAULT_ACTION"),
28577            Self::Allow => std::option::Option::Some("ALLOW"),
28578            Self::Alert => std::option::Option::Some("ALERT"),
28579            Self::Deny => std::option::Option::Some("DENY"),
28580            Self::UnknownValue(u) => u.0.name(),
28581        }
28582    }
28583}
28584
28585impl std::default::Default for ThreatAction {
28586    fn default() -> Self {
28587        use std::convert::From;
28588        Self::from(0)
28589    }
28590}
28591
28592impl std::fmt::Display for ThreatAction {
28593    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28594        wkt::internal::display_enum(f, self.name(), self.value())
28595    }
28596}
28597
28598impl std::convert::From<i32> for ThreatAction {
28599    fn from(value: i32) -> Self {
28600        match value {
28601            0 => Self::Unspecified,
28602            1 => Self::Allow,
28603            2 => Self::Alert,
28604            3 => Self::Deny,
28605            4 => Self::DefaultAction,
28606            _ => Self::UnknownValue(threat_action::UnknownValue(
28607                wkt::internal::UnknownEnumValue::Integer(value),
28608            )),
28609        }
28610    }
28611}
28612
28613impl std::convert::From<&str> for ThreatAction {
28614    fn from(value: &str) -> Self {
28615        use std::string::ToString;
28616        match value {
28617            "THREAT_ACTION_UNSPECIFIED" => Self::Unspecified,
28618            "DEFAULT_ACTION" => Self::DefaultAction,
28619            "ALLOW" => Self::Allow,
28620            "ALERT" => Self::Alert,
28621            "DENY" => Self::Deny,
28622            _ => Self::UnknownValue(threat_action::UnknownValue(
28623                wkt::internal::UnknownEnumValue::String(value.to_string()),
28624            )),
28625        }
28626    }
28627}
28628
28629impl serde::ser::Serialize for ThreatAction {
28630    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28631    where
28632        S: serde::Serializer,
28633    {
28634        match self {
28635            Self::Unspecified => serializer.serialize_i32(0),
28636            Self::DefaultAction => serializer.serialize_i32(4),
28637            Self::Allow => serializer.serialize_i32(1),
28638            Self::Alert => serializer.serialize_i32(2),
28639            Self::Deny => serializer.serialize_i32(3),
28640            Self::UnknownValue(u) => u.0.serialize(serializer),
28641        }
28642    }
28643}
28644
28645impl<'de> serde::de::Deserialize<'de> for ThreatAction {
28646    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28647    where
28648        D: serde::Deserializer<'de>,
28649    {
28650        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatAction>::new(
28651            ".google.cloud.networksecurity.v1.ThreatAction",
28652        ))
28653    }
28654}
28655
28656/// Antivirus protocol.
28657///
28658/// # Working with unknown values
28659///
28660/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28661/// additional enum variants at any time. Adding new variants is not considered
28662/// a breaking change. Applications should write their code in anticipation of:
28663///
28664/// - New values appearing in future releases of the client library, **and**
28665/// - New values received dynamically, without application changes.
28666///
28667/// Please consult the [Working with enums] section in the user guide for some
28668/// guidelines.
28669///
28670/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28671#[derive(Clone, Debug, PartialEq)]
28672#[non_exhaustive]
28673pub enum Protocol {
28674    /// Protocol not specified.
28675    Unspecified,
28676    /// SMTP protocol
28677    Smtp,
28678    /// SMB protocol
28679    Smb,
28680    /// POP3 protocol
28681    Pop3,
28682    /// IMAP protocol
28683    Imap,
28684    /// HTTP2 protocol
28685    Http2,
28686    /// HTTP protocol
28687    Http,
28688    /// FTP protocol
28689    Ftp,
28690    /// If set, the enum was initialized with an unknown value.
28691    ///
28692    /// Applications can examine the value using [Protocol::value] or
28693    /// [Protocol::name].
28694    UnknownValue(protocol::UnknownValue),
28695}
28696
28697#[doc(hidden)]
28698pub mod protocol {
28699    #[allow(unused_imports)]
28700    use super::*;
28701    #[derive(Clone, Debug, PartialEq)]
28702    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28703}
28704
28705impl Protocol {
28706    /// Gets the enum value.
28707    ///
28708    /// Returns `None` if the enum contains an unknown value deserialized from
28709    /// the string representation of enums.
28710    pub fn value(&self) -> std::option::Option<i32> {
28711        match self {
28712            Self::Unspecified => std::option::Option::Some(0),
28713            Self::Smtp => std::option::Option::Some(1),
28714            Self::Smb => std::option::Option::Some(2),
28715            Self::Pop3 => std::option::Option::Some(3),
28716            Self::Imap => std::option::Option::Some(4),
28717            Self::Http2 => std::option::Option::Some(5),
28718            Self::Http => std::option::Option::Some(6),
28719            Self::Ftp => std::option::Option::Some(7),
28720            Self::UnknownValue(u) => u.0.value(),
28721        }
28722    }
28723
28724    /// Gets the enum value as a string.
28725    ///
28726    /// Returns `None` if the enum contains an unknown value deserialized from
28727    /// the integer representation of enums.
28728    pub fn name(&self) -> std::option::Option<&str> {
28729        match self {
28730            Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
28731            Self::Smtp => std::option::Option::Some("SMTP"),
28732            Self::Smb => std::option::Option::Some("SMB"),
28733            Self::Pop3 => std::option::Option::Some("POP3"),
28734            Self::Imap => std::option::Option::Some("IMAP"),
28735            Self::Http2 => std::option::Option::Some("HTTP2"),
28736            Self::Http => std::option::Option::Some("HTTP"),
28737            Self::Ftp => std::option::Option::Some("FTP"),
28738            Self::UnknownValue(u) => u.0.name(),
28739        }
28740    }
28741}
28742
28743impl std::default::Default for Protocol {
28744    fn default() -> Self {
28745        use std::convert::From;
28746        Self::from(0)
28747    }
28748}
28749
28750impl std::fmt::Display for Protocol {
28751    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28752        wkt::internal::display_enum(f, self.name(), self.value())
28753    }
28754}
28755
28756impl std::convert::From<i32> for Protocol {
28757    fn from(value: i32) -> Self {
28758        match value {
28759            0 => Self::Unspecified,
28760            1 => Self::Smtp,
28761            2 => Self::Smb,
28762            3 => Self::Pop3,
28763            4 => Self::Imap,
28764            5 => Self::Http2,
28765            6 => Self::Http,
28766            7 => Self::Ftp,
28767            _ => Self::UnknownValue(protocol::UnknownValue(
28768                wkt::internal::UnknownEnumValue::Integer(value),
28769            )),
28770        }
28771    }
28772}
28773
28774impl std::convert::From<&str> for Protocol {
28775    fn from(value: &str) -> Self {
28776        use std::string::ToString;
28777        match value {
28778            "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
28779            "SMTP" => Self::Smtp,
28780            "SMB" => Self::Smb,
28781            "POP3" => Self::Pop3,
28782            "IMAP" => Self::Imap,
28783            "HTTP2" => Self::Http2,
28784            "HTTP" => Self::Http,
28785            "FTP" => Self::Ftp,
28786            _ => Self::UnknownValue(protocol::UnknownValue(
28787                wkt::internal::UnknownEnumValue::String(value.to_string()),
28788            )),
28789        }
28790    }
28791}
28792
28793impl serde::ser::Serialize for Protocol {
28794    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28795    where
28796        S: serde::Serializer,
28797    {
28798        match self {
28799            Self::Unspecified => serializer.serialize_i32(0),
28800            Self::Smtp => serializer.serialize_i32(1),
28801            Self::Smb => serializer.serialize_i32(2),
28802            Self::Pop3 => serializer.serialize_i32(3),
28803            Self::Imap => serializer.serialize_i32(4),
28804            Self::Http2 => serializer.serialize_i32(5),
28805            Self::Http => serializer.serialize_i32(6),
28806            Self::Ftp => serializer.serialize_i32(7),
28807            Self::UnknownValue(u) => u.0.serialize(serializer),
28808        }
28809    }
28810}
28811
28812impl<'de> serde::de::Deserialize<'de> for Protocol {
28813    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28814    where
28815        D: serde::Deserializer<'de>,
28816    {
28817        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
28818            ".google.cloud.networksecurity.v1.Protocol",
28819        ))
28820    }
28821}