google_cloud_networksecurity_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate 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    pub fn new() -> Self {
83        std::default::Default::default()
84    }
85
86    /// Sets the value of [name][crate::model::AddressGroup::name].
87    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.name = v.into();
89        self
90    }
91
92    /// Sets the value of [description][crate::model::AddressGroup::description].
93    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94        self.description = v.into();
95        self
96    }
97
98    /// Sets the value of [create_time][crate::model::AddressGroup::create_time].
99    pub fn set_create_time<T>(mut self, v: T) -> Self
100    where
101        T: std::convert::Into<wkt::Timestamp>,
102    {
103        self.create_time = std::option::Option::Some(v.into());
104        self
105    }
106
107    /// Sets or clears the value of [create_time][crate::model::AddressGroup::create_time].
108    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
109    where
110        T: std::convert::Into<wkt::Timestamp>,
111    {
112        self.create_time = v.map(|x| x.into());
113        self
114    }
115
116    /// Sets the value of [update_time][crate::model::AddressGroup::update_time].
117    pub fn set_update_time<T>(mut self, v: T) -> Self
118    where
119        T: std::convert::Into<wkt::Timestamp>,
120    {
121        self.update_time = std::option::Option::Some(v.into());
122        self
123    }
124
125    /// Sets or clears the value of [update_time][crate::model::AddressGroup::update_time].
126    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
127    where
128        T: std::convert::Into<wkt::Timestamp>,
129    {
130        self.update_time = v.map(|x| x.into());
131        self
132    }
133
134    /// Sets the value of [labels][crate::model::AddressGroup::labels].
135    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
136    where
137        T: std::iter::IntoIterator<Item = (K, V)>,
138        K: std::convert::Into<std::string::String>,
139        V: std::convert::Into<std::string::String>,
140    {
141        use std::iter::Iterator;
142        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
143        self
144    }
145
146    /// Sets the value of [r#type][crate::model::AddressGroup::type].
147    pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
148        mut self,
149        v: T,
150    ) -> Self {
151        self.r#type = v.into();
152        self
153    }
154
155    /// Sets the value of [items][crate::model::AddressGroup::items].
156    pub fn set_items<T, V>(mut self, v: T) -> Self
157    where
158        T: std::iter::IntoIterator<Item = V>,
159        V: std::convert::Into<std::string::String>,
160    {
161        use std::iter::Iterator;
162        self.items = v.into_iter().map(|i| i.into()).collect();
163        self
164    }
165
166    /// Sets the value of [capacity][crate::model::AddressGroup::capacity].
167    pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
168        self.capacity = v.into();
169        self
170    }
171
172    /// Sets the value of [self_link][crate::model::AddressGroup::self_link].
173    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
174        self.self_link = v.into();
175        self
176    }
177
178    /// Sets the value of [purpose][crate::model::AddressGroup::purpose].
179    pub fn set_purpose<T, V>(mut self, v: T) -> Self
180    where
181        T: std::iter::IntoIterator<Item = V>,
182        V: std::convert::Into<crate::model::address_group::Purpose>,
183    {
184        use std::iter::Iterator;
185        self.purpose = v.into_iter().map(|i| i.into()).collect();
186        self
187    }
188}
189
190impl wkt::message::Message for AddressGroup {
191    fn typename() -> &'static str {
192        "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
193    }
194}
195
196/// Defines additional types related to [AddressGroup].
197pub mod address_group {
198    #[allow(unused_imports)]
199    use super::*;
200
201    /// Possible type of the Address Group.
202    ///
203    /// # Working with unknown values
204    ///
205    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
206    /// additional enum variants at any time. Adding new variants is not considered
207    /// a breaking change. Applications should write their code in anticipation of:
208    ///
209    /// - New values appearing in future releases of the client library, **and**
210    /// - New values received dynamically, without application changes.
211    ///
212    /// Please consult the [Working with enums] section in the user guide for some
213    /// guidelines.
214    ///
215    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
216    #[derive(Clone, Debug, PartialEq)]
217    #[non_exhaustive]
218    pub enum Type {
219        /// Default value.
220        Unspecified,
221        /// IP v4 ranges.
222        Ipv4,
223        /// IP v6 ranges.
224        Ipv6,
225        /// If set, the enum was initialized with an unknown value.
226        ///
227        /// Applications can examine the value using [Type::value] or
228        /// [Type::name].
229        UnknownValue(r#type::UnknownValue),
230    }
231
232    #[doc(hidden)]
233    pub mod r#type {
234        #[allow(unused_imports)]
235        use super::*;
236        #[derive(Clone, Debug, PartialEq)]
237        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
238    }
239
240    impl Type {
241        /// Gets the enum value.
242        ///
243        /// Returns `None` if the enum contains an unknown value deserialized from
244        /// the string representation of enums.
245        pub fn value(&self) -> std::option::Option<i32> {
246            match self {
247                Self::Unspecified => std::option::Option::Some(0),
248                Self::Ipv4 => std::option::Option::Some(1),
249                Self::Ipv6 => std::option::Option::Some(2),
250                Self::UnknownValue(u) => u.0.value(),
251            }
252        }
253
254        /// Gets the enum value as a string.
255        ///
256        /// Returns `None` if the enum contains an unknown value deserialized from
257        /// the integer representation of enums.
258        pub fn name(&self) -> std::option::Option<&str> {
259            match self {
260                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
261                Self::Ipv4 => std::option::Option::Some("IPV4"),
262                Self::Ipv6 => std::option::Option::Some("IPV6"),
263                Self::UnknownValue(u) => u.0.name(),
264            }
265        }
266    }
267
268    impl std::default::Default for Type {
269        fn default() -> Self {
270            use std::convert::From;
271            Self::from(0)
272        }
273    }
274
275    impl std::fmt::Display for Type {
276        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
277            wkt::internal::display_enum(f, self.name(), self.value())
278        }
279    }
280
281    impl std::convert::From<i32> for Type {
282        fn from(value: i32) -> Self {
283            match value {
284                0 => Self::Unspecified,
285                1 => Self::Ipv4,
286                2 => Self::Ipv6,
287                _ => Self::UnknownValue(r#type::UnknownValue(
288                    wkt::internal::UnknownEnumValue::Integer(value),
289                )),
290            }
291        }
292    }
293
294    impl std::convert::From<&str> for Type {
295        fn from(value: &str) -> Self {
296            use std::string::ToString;
297            match value {
298                "TYPE_UNSPECIFIED" => Self::Unspecified,
299                "IPV4" => Self::Ipv4,
300                "IPV6" => Self::Ipv6,
301                _ => Self::UnknownValue(r#type::UnknownValue(
302                    wkt::internal::UnknownEnumValue::String(value.to_string()),
303                )),
304            }
305        }
306    }
307
308    impl serde::ser::Serialize for Type {
309        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
310        where
311            S: serde::Serializer,
312        {
313            match self {
314                Self::Unspecified => serializer.serialize_i32(0),
315                Self::Ipv4 => serializer.serialize_i32(1),
316                Self::Ipv6 => serializer.serialize_i32(2),
317                Self::UnknownValue(u) => u.0.serialize(serializer),
318            }
319        }
320    }
321
322    impl<'de> serde::de::Deserialize<'de> for Type {
323        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
324        where
325            D: serde::Deserializer<'de>,
326        {
327            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
328                ".google.cloud.networksecurity.v1.AddressGroup.Type",
329            ))
330        }
331    }
332
333    /// Purpose of the Address Group.
334    ///
335    /// # Working with unknown values
336    ///
337    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
338    /// additional enum variants at any time. Adding new variants is not considered
339    /// a breaking change. Applications should write their code in anticipation of:
340    ///
341    /// - New values appearing in future releases of the client library, **and**
342    /// - New values received dynamically, without application changes.
343    ///
344    /// Please consult the [Working with enums] section in the user guide for some
345    /// guidelines.
346    ///
347    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
348    #[derive(Clone, Debug, PartialEq)]
349    #[non_exhaustive]
350    pub enum Purpose {
351        /// Default value. Should never happen.
352        Unspecified,
353        /// Address Group is distributed to VMC, and is usable in Firewall Policies
354        /// and other systems that rely on VMC.
355        Default,
356        /// Address Group is usable in Cloud Armor.
357        CloudArmor,
358        /// If set, the enum was initialized with an unknown value.
359        ///
360        /// Applications can examine the value using [Purpose::value] or
361        /// [Purpose::name].
362        UnknownValue(purpose::UnknownValue),
363    }
364
365    #[doc(hidden)]
366    pub mod purpose {
367        #[allow(unused_imports)]
368        use super::*;
369        #[derive(Clone, Debug, PartialEq)]
370        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
371    }
372
373    impl Purpose {
374        /// Gets the enum value.
375        ///
376        /// Returns `None` if the enum contains an unknown value deserialized from
377        /// the string representation of enums.
378        pub fn value(&self) -> std::option::Option<i32> {
379            match self {
380                Self::Unspecified => std::option::Option::Some(0),
381                Self::Default => std::option::Option::Some(1),
382                Self::CloudArmor => std::option::Option::Some(2),
383                Self::UnknownValue(u) => u.0.value(),
384            }
385        }
386
387        /// Gets the enum value as a string.
388        ///
389        /// Returns `None` if the enum contains an unknown value deserialized from
390        /// the integer representation of enums.
391        pub fn name(&self) -> std::option::Option<&str> {
392            match self {
393                Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
394                Self::Default => std::option::Option::Some("DEFAULT"),
395                Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
396                Self::UnknownValue(u) => u.0.name(),
397            }
398        }
399    }
400
401    impl std::default::Default for Purpose {
402        fn default() -> Self {
403            use std::convert::From;
404            Self::from(0)
405        }
406    }
407
408    impl std::fmt::Display for Purpose {
409        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
410            wkt::internal::display_enum(f, self.name(), self.value())
411        }
412    }
413
414    impl std::convert::From<i32> for Purpose {
415        fn from(value: i32) -> Self {
416            match value {
417                0 => Self::Unspecified,
418                1 => Self::Default,
419                2 => Self::CloudArmor,
420                _ => Self::UnknownValue(purpose::UnknownValue(
421                    wkt::internal::UnknownEnumValue::Integer(value),
422                )),
423            }
424        }
425    }
426
427    impl std::convert::From<&str> for Purpose {
428        fn from(value: &str) -> Self {
429            use std::string::ToString;
430            match value {
431                "PURPOSE_UNSPECIFIED" => Self::Unspecified,
432                "DEFAULT" => Self::Default,
433                "CLOUD_ARMOR" => Self::CloudArmor,
434                _ => Self::UnknownValue(purpose::UnknownValue(
435                    wkt::internal::UnknownEnumValue::String(value.to_string()),
436                )),
437            }
438        }
439    }
440
441    impl serde::ser::Serialize for Purpose {
442        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
443        where
444            S: serde::Serializer,
445        {
446            match self {
447                Self::Unspecified => serializer.serialize_i32(0),
448                Self::Default => serializer.serialize_i32(1),
449                Self::CloudArmor => serializer.serialize_i32(2),
450                Self::UnknownValue(u) => u.0.serialize(serializer),
451            }
452        }
453    }
454
455    impl<'de> serde::de::Deserialize<'de> for Purpose {
456        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
457        where
458            D: serde::Deserializer<'de>,
459        {
460            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
461                ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
462            ))
463        }
464    }
465}
466
467/// Request used with the ListAddressGroups method.
468#[derive(Clone, Default, PartialEq)]
469#[non_exhaustive]
470pub struct ListAddressGroupsRequest {
471    /// Required. The project and location from which the AddressGroups
472    /// should be listed, specified in the format
473    /// `projects/*/locations/{location}`.
474    pub parent: std::string::String,
475
476    /// Maximum number of AddressGroups to return per call.
477    pub page_size: i32,
478
479    /// The value returned by the last
480    /// `ListAddressGroupsResponse` Indicates that this is a
481    /// continuation of a prior `ListAddressGroups` call, and
482    /// that the system should return the next page of data.
483    pub page_token: std::string::String,
484
485    /// Optional. If true, allow partial responses for multi-regional Aggregated
486    /// List requests.
487    pub return_partial_success: bool,
488
489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
490}
491
492impl ListAddressGroupsRequest {
493    pub fn new() -> Self {
494        std::default::Default::default()
495    }
496
497    /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
498    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
499        self.parent = v.into();
500        self
501    }
502
503    /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
504    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
505        self.page_size = v.into();
506        self
507    }
508
509    /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
510    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
511        self.page_token = v.into();
512        self
513    }
514
515    /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
516    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
517        self.return_partial_success = v.into();
518        self
519    }
520}
521
522impl wkt::message::Message for ListAddressGroupsRequest {
523    fn typename() -> &'static str {
524        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
525    }
526}
527
528/// Response returned by the ListAddressGroups method.
529#[derive(Clone, Default, PartialEq)]
530#[non_exhaustive]
531pub struct ListAddressGroupsResponse {
532    /// List of AddressGroups resources.
533    pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
534
535    /// If there might be more results than those appearing in this response, then
536    /// `next_page_token` is included. To get the next set of results, call this
537    /// method again using the value of `next_page_token` as `page_token`.
538    pub next_page_token: std::string::String,
539
540    /// Locations that could not be reached.
541    pub unreachable: std::vec::Vec<std::string::String>,
542
543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
544}
545
546impl ListAddressGroupsResponse {
547    pub fn new() -> Self {
548        std::default::Default::default()
549    }
550
551    /// Sets the value of [address_groups][crate::model::ListAddressGroupsResponse::address_groups].
552    pub fn set_address_groups<T, V>(mut self, v: T) -> Self
553    where
554        T: std::iter::IntoIterator<Item = V>,
555        V: std::convert::Into<crate::model::AddressGroup>,
556    {
557        use std::iter::Iterator;
558        self.address_groups = v.into_iter().map(|i| i.into()).collect();
559        self
560    }
561
562    /// Sets the value of [next_page_token][crate::model::ListAddressGroupsResponse::next_page_token].
563    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
564        self.next_page_token = v.into();
565        self
566    }
567
568    /// Sets the value of [unreachable][crate::model::ListAddressGroupsResponse::unreachable].
569    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
570    where
571        T: std::iter::IntoIterator<Item = V>,
572        V: std::convert::Into<std::string::String>,
573    {
574        use std::iter::Iterator;
575        self.unreachable = v.into_iter().map(|i| i.into()).collect();
576        self
577    }
578}
579
580impl wkt::message::Message for ListAddressGroupsResponse {
581    fn typename() -> &'static str {
582        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
583    }
584}
585
586#[doc(hidden)]
587impl gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
588    type PageItem = crate::model::AddressGroup;
589
590    fn items(self) -> std::vec::Vec<Self::PageItem> {
591        self.address_groups
592    }
593
594    fn next_page_token(&self) -> std::string::String {
595        use std::clone::Clone;
596        self.next_page_token.clone()
597    }
598}
599
600/// Request used by the GetAddressGroup method.
601#[derive(Clone, Default, PartialEq)]
602#[non_exhaustive]
603pub struct GetAddressGroupRequest {
604    /// Required. A name of the AddressGroup to get. Must be in the format
605    /// `projects/*/locations/{location}/addressGroups/*`.
606    pub name: std::string::String,
607
608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
609}
610
611impl GetAddressGroupRequest {
612    pub fn new() -> Self {
613        std::default::Default::default()
614    }
615
616    /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
617    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
618        self.name = v.into();
619        self
620    }
621}
622
623impl wkt::message::Message for GetAddressGroupRequest {
624    fn typename() -> &'static str {
625        "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
626    }
627}
628
629/// Request used by the CreateAddressGroup method.
630#[derive(Clone, Default, PartialEq)]
631#[non_exhaustive]
632pub struct CreateAddressGroupRequest {
633    /// Required. The parent resource of the AddressGroup. Must be in the
634    /// format `projects/*/locations/{location}`.
635    pub parent: std::string::String,
636
637    /// Required. Short name of the AddressGroup resource to be created.
638    /// This value should be 1-63 characters long, containing only
639    /// letters, numbers, hyphens, and underscores, and should not start
640    /// with a number. E.g. "authz_policy".
641    pub address_group_id: std::string::String,
642
643    /// Required. AddressGroup resource to be created.
644    pub address_group: std::option::Option<crate::model::AddressGroup>,
645
646    /// Optional. An optional request ID to identify requests. Specify a unique
647    /// request ID so that if you must retry your request, the server will know to
648    /// ignore the request if it has already been completed. The server will
649    /// guarantee that for at least 60 minutes since the first request.
650    ///
651    /// For example, consider a situation where you make an initial request and
652    /// the request times out. If you make the request again with the same request
653    /// ID, the server can check if original operation with the same request ID
654    /// was received, and if so, will ignore the second request. This prevents
655    /// clients from accidentally creating duplicate commitments.
656    ///
657    /// The request ID must be a valid UUID with the exception that zero UUID is
658    /// not supported (00000000-0000-0000-0000-000000000000).
659    pub request_id: std::string::String,
660
661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
662}
663
664impl CreateAddressGroupRequest {
665    pub fn new() -> Self {
666        std::default::Default::default()
667    }
668
669    /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
670    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671        self.parent = v.into();
672        self
673    }
674
675    /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
676    pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
677        mut self,
678        v: T,
679    ) -> Self {
680        self.address_group_id = v.into();
681        self
682    }
683
684    /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
685    pub fn set_address_group<T>(mut self, v: T) -> Self
686    where
687        T: std::convert::Into<crate::model::AddressGroup>,
688    {
689        self.address_group = std::option::Option::Some(v.into());
690        self
691    }
692
693    /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
694    pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
695    where
696        T: std::convert::Into<crate::model::AddressGroup>,
697    {
698        self.address_group = v.map(|x| x.into());
699        self
700    }
701
702    /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
703    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
704        self.request_id = v.into();
705        self
706    }
707}
708
709impl wkt::message::Message for CreateAddressGroupRequest {
710    fn typename() -> &'static str {
711        "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
712    }
713}
714
715/// Request used by the UpdateAddressGroup method.
716#[derive(Clone, Default, PartialEq)]
717#[non_exhaustive]
718pub struct UpdateAddressGroupRequest {
719    /// Optional. Field mask is used to specify the fields to be overwritten in the
720    /// AddressGroup resource by the update.
721    /// The fields specified in the update_mask are relative to the resource, not
722    /// the full request. A field will be overwritten if it is in the mask. If the
723    /// user does not provide a mask then all fields will be overwritten.
724    pub update_mask: std::option::Option<wkt::FieldMask>,
725
726    /// Required. Updated AddressGroup resource.
727    pub address_group: std::option::Option<crate::model::AddressGroup>,
728
729    /// Optional. An optional request ID to identify requests. Specify a unique
730    /// request ID so that if you must retry your request, the server will know to
731    /// ignore the request if it has already been completed. The server will
732    /// guarantee that for at least 60 minutes since the first request.
733    ///
734    /// For example, consider a situation where you make an initial request and
735    /// the request times out. If you make the request again with the same request
736    /// ID, the server can check if original operation with the same request ID
737    /// was received, and if so, will ignore the second request. This prevents
738    /// clients from accidentally creating duplicate commitments.
739    ///
740    /// The request ID must be a valid UUID with the exception that zero UUID is
741    /// not supported (00000000-0000-0000-0000-000000000000).
742    pub request_id: std::string::String,
743
744    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
745}
746
747impl UpdateAddressGroupRequest {
748    pub fn new() -> Self {
749        std::default::Default::default()
750    }
751
752    /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
753    pub fn set_update_mask<T>(mut self, v: T) -> Self
754    where
755        T: std::convert::Into<wkt::FieldMask>,
756    {
757        self.update_mask = std::option::Option::Some(v.into());
758        self
759    }
760
761    /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
762    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
763    where
764        T: std::convert::Into<wkt::FieldMask>,
765    {
766        self.update_mask = v.map(|x| x.into());
767        self
768    }
769
770    /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
771    pub fn set_address_group<T>(mut self, v: T) -> Self
772    where
773        T: std::convert::Into<crate::model::AddressGroup>,
774    {
775        self.address_group = std::option::Option::Some(v.into());
776        self
777    }
778
779    /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
780    pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
781    where
782        T: std::convert::Into<crate::model::AddressGroup>,
783    {
784        self.address_group = v.map(|x| x.into());
785        self
786    }
787
788    /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
789    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790        self.request_id = v.into();
791        self
792    }
793}
794
795impl wkt::message::Message for UpdateAddressGroupRequest {
796    fn typename() -> &'static str {
797        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
798    }
799}
800
801/// Request used by the DeleteAddressGroup method.
802#[derive(Clone, Default, PartialEq)]
803#[non_exhaustive]
804pub struct DeleteAddressGroupRequest {
805    /// Required. A name of the AddressGroup to delete. Must be in the format
806    /// `projects/*/locations/{location}/addressGroups/*`.
807    pub name: std::string::String,
808
809    /// Optional. An optional request ID to identify requests. Specify a unique
810    /// request ID so that if you must retry your request, the server will know to
811    /// ignore the request if it has already been completed. The server will
812    /// guarantee that for at least 60 minutes since the first request.
813    ///
814    /// For example, consider a situation where you make an initial request and
815    /// the request times out. If you make the request again with the same request
816    /// ID, the server can check if original operation with the same request ID
817    /// was received, and if so, will ignore the second request. This prevents
818    /// clients from accidentally creating duplicate commitments.
819    ///
820    /// The request ID must be a valid UUID with the exception that zero UUID is
821    /// not supported (00000000-0000-0000-0000-000000000000).
822    pub request_id: std::string::String,
823
824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
825}
826
827impl DeleteAddressGroupRequest {
828    pub fn new() -> Self {
829        std::default::Default::default()
830    }
831
832    /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
833    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
834        self.name = v.into();
835        self
836    }
837
838    /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
839    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
840        self.request_id = v.into();
841        self
842    }
843}
844
845impl wkt::message::Message for DeleteAddressGroupRequest {
846    fn typename() -> &'static str {
847        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
848    }
849}
850
851/// Request used by the AddAddressGroupItems method.
852#[derive(Clone, Default, PartialEq)]
853#[non_exhaustive]
854pub struct AddAddressGroupItemsRequest {
855    /// Required. A name of the AddressGroup to add items to. Must be in the format
856    /// `projects|organization/*/locations/{location}/addressGroups/*`.
857    pub address_group: std::string::String,
858
859    /// Required. List of items to add.
860    pub items: std::vec::Vec<std::string::String>,
861
862    /// Optional. An optional request ID to identify requests. Specify a unique
863    /// request ID so that if you must retry your request, the server will know to
864    /// ignore the request if it has already been completed. The server will
865    /// guarantee that for at least 60 minutes since the first request.
866    ///
867    /// For example, consider a situation where you make an initial request and
868    /// the request times out. If you make the request again with the same request
869    /// ID, the server can check if original operation with the same request ID
870    /// was received, and if so, will ignore the second request. This prevents
871    /// clients from accidentally creating duplicate commitments.
872    ///
873    /// The request ID must be a valid UUID with the exception that zero UUID is
874    /// not supported (00000000-0000-0000-0000-000000000000).
875    pub request_id: std::string::String,
876
877    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
878}
879
880impl AddAddressGroupItemsRequest {
881    pub fn new() -> Self {
882        std::default::Default::default()
883    }
884
885    /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
886    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
887        self.address_group = v.into();
888        self
889    }
890
891    /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
892    pub fn set_items<T, V>(mut self, v: T) -> Self
893    where
894        T: std::iter::IntoIterator<Item = V>,
895        V: std::convert::Into<std::string::String>,
896    {
897        use std::iter::Iterator;
898        self.items = v.into_iter().map(|i| i.into()).collect();
899        self
900    }
901
902    /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
903    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
904        self.request_id = v.into();
905        self
906    }
907}
908
909impl wkt::message::Message for AddAddressGroupItemsRequest {
910    fn typename() -> &'static str {
911        "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
912    }
913}
914
915/// Request used by the RemoveAddressGroupItems method.
916#[derive(Clone, Default, PartialEq)]
917#[non_exhaustive]
918pub struct RemoveAddressGroupItemsRequest {
919    /// Required. A name of the AddressGroup to remove items from. Must be in the
920    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
921    pub address_group: std::string::String,
922
923    /// Required. List of items to remove.
924    pub items: std::vec::Vec<std::string::String>,
925
926    /// Optional. An optional request ID to identify requests. Specify a unique
927    /// request ID so that if you must retry your request, the server will know to
928    /// ignore the request if it has already been completed. The server will
929    /// guarantee that for at least 60 minutes since the first request.
930    ///
931    /// For example, consider a situation where you make an initial request and
932    /// the request times out. If you make the request again with the same request
933    /// ID, the server can check if original operation with the same request ID
934    /// was received, and if so, will ignore the second request. This prevents
935    /// clients from accidentally creating duplicate commitments.
936    ///
937    /// The request ID must be a valid UUID with the exception that zero UUID is
938    /// not supported (00000000-0000-0000-0000-000000000000).
939    pub request_id: std::string::String,
940
941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
942}
943
944impl RemoveAddressGroupItemsRequest {
945    pub fn new() -> Self {
946        std::default::Default::default()
947    }
948
949    /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
950    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
951        self.address_group = v.into();
952        self
953    }
954
955    /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
956    pub fn set_items<T, V>(mut self, v: T) -> Self
957    where
958        T: std::iter::IntoIterator<Item = V>,
959        V: std::convert::Into<std::string::String>,
960    {
961        use std::iter::Iterator;
962        self.items = v.into_iter().map(|i| i.into()).collect();
963        self
964    }
965
966    /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
967    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
968        self.request_id = v.into();
969        self
970    }
971}
972
973impl wkt::message::Message for RemoveAddressGroupItemsRequest {
974    fn typename() -> &'static str {
975        "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
976    }
977}
978
979/// Request used by the CloneAddressGroupItems method.
980#[derive(Clone, Default, PartialEq)]
981#[non_exhaustive]
982pub struct CloneAddressGroupItemsRequest {
983    /// Required. A name of the AddressGroup to clone items to. Must be in the
984    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
985    pub address_group: std::string::String,
986
987    /// Required. Source address group to clone items from.
988    pub source_address_group: std::string::String,
989
990    /// Optional. An optional request ID to identify requests. Specify a unique
991    /// request ID so that if you must retry your request, the server will know to
992    /// ignore the request if it has already been completed. The server will
993    /// guarantee that for at least 60 minutes since the first request.
994    ///
995    /// For example, consider a situation where you make an initial request and
996    /// the request times out. If you make the request again with the same request
997    /// ID, the server can check if original operation with the same request ID
998    /// was received, and if so, will ignore the second request. This prevents
999    /// clients from accidentally creating duplicate commitments.
1000    ///
1001    /// The request ID must be a valid UUID with the exception that zero UUID is
1002    /// not supported (00000000-0000-0000-0000-000000000000).
1003    pub request_id: std::string::String,
1004
1005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1006}
1007
1008impl CloneAddressGroupItemsRequest {
1009    pub fn new() -> Self {
1010        std::default::Default::default()
1011    }
1012
1013    /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
1014    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1015        self.address_group = v.into();
1016        self
1017    }
1018
1019    /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
1020    pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1021        mut self,
1022        v: T,
1023    ) -> Self {
1024        self.source_address_group = v.into();
1025        self
1026    }
1027
1028    /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
1029    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1030        self.request_id = v.into();
1031        self
1032    }
1033}
1034
1035impl wkt::message::Message for CloneAddressGroupItemsRequest {
1036    fn typename() -> &'static str {
1037        "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1038    }
1039}
1040
1041/// Request used by the ListAddressGroupReferences method.
1042#[derive(Clone, Default, PartialEq)]
1043#[non_exhaustive]
1044pub struct ListAddressGroupReferencesRequest {
1045    /// Required. A name of the AddressGroup to clone items to. Must be in the
1046    /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1047    pub address_group: std::string::String,
1048
1049    /// The maximum number of references to return.  If unspecified, server
1050    /// will pick an appropriate default. Server may return fewer items than
1051    /// requested. A caller should only rely on response's
1052    /// [next_page_token][google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]
1053    /// to determine if there are more AddressGroupUsers left to be queried.
1054    ///
1055    /// [google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]: crate::model::ListAddressGroupReferencesResponse::next_page_token
1056    pub page_size: i32,
1057
1058    /// The next_page_token value returned from a previous List request,
1059    /// if any.
1060    pub page_token: std::string::String,
1061
1062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063}
1064
1065impl ListAddressGroupReferencesRequest {
1066    pub fn new() -> Self {
1067        std::default::Default::default()
1068    }
1069
1070    /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1071    pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1072        self.address_group = v.into();
1073        self
1074    }
1075
1076    /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1077    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1078        self.page_size = v.into();
1079        self
1080    }
1081
1082    /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1083    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1084        self.page_token = v.into();
1085        self
1086    }
1087}
1088
1089impl wkt::message::Message for ListAddressGroupReferencesRequest {
1090    fn typename() -> &'static str {
1091        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1092    }
1093}
1094
1095/// Response of the ListAddressGroupReferences method.
1096#[derive(Clone, Default, PartialEq)]
1097#[non_exhaustive]
1098pub struct ListAddressGroupReferencesResponse {
1099    /// A list of references that matches the specified filter in the request.
1100    pub address_group_references:
1101        std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1102
1103    /// If there might be more results than those appearing in this response, then
1104    /// `next_page_token` is included. To get the next set of results, call this
1105    /// method again using the value of `next_page_token` as `page_token`.
1106    pub next_page_token: std::string::String,
1107
1108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1109}
1110
1111impl ListAddressGroupReferencesResponse {
1112    pub fn new() -> Self {
1113        std::default::Default::default()
1114    }
1115
1116    /// Sets the value of [address_group_references][crate::model::ListAddressGroupReferencesResponse::address_group_references].
1117    pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1118    where
1119        T: std::iter::IntoIterator<Item = V>,
1120        V: std::convert::Into<
1121                crate::model::list_address_group_references_response::AddressGroupReference,
1122            >,
1123    {
1124        use std::iter::Iterator;
1125        self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1126        self
1127    }
1128
1129    /// Sets the value of [next_page_token][crate::model::ListAddressGroupReferencesResponse::next_page_token].
1130    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131        self.next_page_token = v.into();
1132        self
1133    }
1134}
1135
1136impl wkt::message::Message for ListAddressGroupReferencesResponse {
1137    fn typename() -> &'static str {
1138        "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1139    }
1140}
1141
1142#[doc(hidden)]
1143impl gax::paginator::internal::PageableResponse for ListAddressGroupReferencesResponse {
1144    type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1145
1146    fn items(self) -> std::vec::Vec<Self::PageItem> {
1147        self.address_group_references
1148    }
1149
1150    fn next_page_token(&self) -> std::string::String {
1151        use std::clone::Clone;
1152        self.next_page_token.clone()
1153    }
1154}
1155
1156/// Defines additional types related to [ListAddressGroupReferencesResponse].
1157pub mod list_address_group_references_response {
1158    #[allow(unused_imports)]
1159    use super::*;
1160
1161    /// The Reference of AddressGroup.
1162    #[derive(Clone, Default, PartialEq)]
1163    #[non_exhaustive]
1164    pub struct AddressGroupReference {
1165        /// FirewallPolicy that is using the Address Group.
1166        pub firewall_policy: std::string::String,
1167
1168        /// Cloud Armor SecurityPolicy that is using the Address Group.
1169        pub security_policy: std::string::String,
1170
1171        /// Rule priority of the FirewallPolicy that is using the Address Group.
1172        pub rule_priority: i32,
1173
1174        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1175    }
1176
1177    impl AddressGroupReference {
1178        pub fn new() -> Self {
1179            std::default::Default::default()
1180        }
1181
1182        /// Sets the value of [firewall_policy][crate::model::list_address_group_references_response::AddressGroupReference::firewall_policy].
1183        pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1184            mut self,
1185            v: T,
1186        ) -> Self {
1187            self.firewall_policy = v.into();
1188            self
1189        }
1190
1191        /// Sets the value of [security_policy][crate::model::list_address_group_references_response::AddressGroupReference::security_policy].
1192        pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1193            mut self,
1194            v: T,
1195        ) -> Self {
1196            self.security_policy = v.into();
1197            self
1198        }
1199
1200        /// Sets the value of [rule_priority][crate::model::list_address_group_references_response::AddressGroupReference::rule_priority].
1201        pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1202            self.rule_priority = v.into();
1203            self
1204        }
1205    }
1206
1207    impl wkt::message::Message for AddressGroupReference {
1208        fn typename() -> &'static str {
1209            "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1210        }
1211    }
1212}
1213
1214/// AuthorizationPolicy is a resource that specifies how a server
1215/// should authorize incoming connections. This resource in itself does
1216/// not change the configuration unless it's attached to a target https
1217/// proxy or endpoint config selector resource.
1218#[derive(Clone, Default, PartialEq)]
1219#[non_exhaustive]
1220pub struct AuthorizationPolicy {
1221    /// Required. Name of the AuthorizationPolicy resource. It matches pattern
1222    /// `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
1223    pub name: std::string::String,
1224
1225    /// Optional. Free-text description of the resource.
1226    pub description: std::string::String,
1227
1228    /// Output only. The timestamp when the resource was created.
1229    pub create_time: std::option::Option<wkt::Timestamp>,
1230
1231    /// Output only. The timestamp when the resource was updated.
1232    pub update_time: std::option::Option<wkt::Timestamp>,
1233
1234    /// Optional. Set of label tags associated with the AuthorizationPolicy resource.
1235    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1236
1237    /// Required. The action to take when a rule match is found. Possible values
1238    /// are "ALLOW" or "DENY".
1239    pub action: crate::model::authorization_policy::Action,
1240
1241    /// Optional. List of rules to match. Note that at least one of the rules must match in
1242    /// order for the action specified in the 'action' field to be taken. A rule is
1243    /// a match if there is a matching source and destination. If left blank, the
1244    /// action specified in the `action` field will be applied on every request.
1245    pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1246
1247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1248}
1249
1250impl AuthorizationPolicy {
1251    pub fn new() -> Self {
1252        std::default::Default::default()
1253    }
1254
1255    /// Sets the value of [name][crate::model::AuthorizationPolicy::name].
1256    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1257        self.name = v.into();
1258        self
1259    }
1260
1261    /// Sets the value of [description][crate::model::AuthorizationPolicy::description].
1262    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1263        self.description = v.into();
1264        self
1265    }
1266
1267    /// Sets the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1268    pub fn set_create_time<T>(mut self, v: T) -> Self
1269    where
1270        T: std::convert::Into<wkt::Timestamp>,
1271    {
1272        self.create_time = std::option::Option::Some(v.into());
1273        self
1274    }
1275
1276    /// Sets or clears the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1277    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1278    where
1279        T: std::convert::Into<wkt::Timestamp>,
1280    {
1281        self.create_time = v.map(|x| x.into());
1282        self
1283    }
1284
1285    /// Sets the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1286    pub fn set_update_time<T>(mut self, v: T) -> Self
1287    where
1288        T: std::convert::Into<wkt::Timestamp>,
1289    {
1290        self.update_time = std::option::Option::Some(v.into());
1291        self
1292    }
1293
1294    /// Sets or clears the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1295    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1296    where
1297        T: std::convert::Into<wkt::Timestamp>,
1298    {
1299        self.update_time = v.map(|x| x.into());
1300        self
1301    }
1302
1303    /// Sets the value of [labels][crate::model::AuthorizationPolicy::labels].
1304    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1305    where
1306        T: std::iter::IntoIterator<Item = (K, V)>,
1307        K: std::convert::Into<std::string::String>,
1308        V: std::convert::Into<std::string::String>,
1309    {
1310        use std::iter::Iterator;
1311        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1312        self
1313    }
1314
1315    /// Sets the value of [action][crate::model::AuthorizationPolicy::action].
1316    pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1317        mut self,
1318        v: T,
1319    ) -> Self {
1320        self.action = v.into();
1321        self
1322    }
1323
1324    /// Sets the value of [rules][crate::model::AuthorizationPolicy::rules].
1325    pub fn set_rules<T, V>(mut self, v: T) -> Self
1326    where
1327        T: std::iter::IntoIterator<Item = V>,
1328        V: std::convert::Into<crate::model::authorization_policy::Rule>,
1329    {
1330        use std::iter::Iterator;
1331        self.rules = v.into_iter().map(|i| i.into()).collect();
1332        self
1333    }
1334}
1335
1336impl wkt::message::Message for AuthorizationPolicy {
1337    fn typename() -> &'static str {
1338        "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1339    }
1340}
1341
1342/// Defines additional types related to [AuthorizationPolicy].
1343pub mod authorization_policy {
1344    #[allow(unused_imports)]
1345    use super::*;
1346
1347    /// Specification of rules.
1348    #[derive(Clone, Default, PartialEq)]
1349    #[non_exhaustive]
1350    pub struct Rule {
1351        /// Optional. List of attributes for the traffic source. All of the sources must match.
1352        /// A source is a match if both principals and ip_blocks match. If not set,
1353        /// the action specified in the 'action' field will be applied without any
1354        /// rule checks for the source.
1355        pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1356
1357        /// Optional. List of attributes for the traffic destination. All of the destinations
1358        /// must match. A destination is a match if a request matches all the
1359        /// specified hosts, ports, methods and headers. If not set, the
1360        /// action specified in the 'action' field will be applied without any rule
1361        /// checks for the destination.
1362        pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1363
1364        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1365    }
1366
1367    impl Rule {
1368        pub fn new() -> Self {
1369            std::default::Default::default()
1370        }
1371
1372        /// Sets the value of [sources][crate::model::authorization_policy::Rule::sources].
1373        pub fn set_sources<T, V>(mut self, v: T) -> Self
1374        where
1375            T: std::iter::IntoIterator<Item = V>,
1376            V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1377        {
1378            use std::iter::Iterator;
1379            self.sources = v.into_iter().map(|i| i.into()).collect();
1380            self
1381        }
1382
1383        /// Sets the value of [destinations][crate::model::authorization_policy::Rule::destinations].
1384        pub fn set_destinations<T, V>(mut self, v: T) -> Self
1385        where
1386            T: std::iter::IntoIterator<Item = V>,
1387            V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1388        {
1389            use std::iter::Iterator;
1390            self.destinations = v.into_iter().map(|i| i.into()).collect();
1391            self
1392        }
1393    }
1394
1395    impl wkt::message::Message for Rule {
1396        fn typename() -> &'static str {
1397            "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1398        }
1399    }
1400
1401    /// Defines additional types related to [Rule].
1402    pub mod rule {
1403        #[allow(unused_imports)]
1404        use super::*;
1405
1406        /// Specification of traffic source attributes.
1407        #[derive(Clone, Default, PartialEq)]
1408        #[non_exhaustive]
1409        pub struct Source {
1410            /// Optional. List of peer identities to match for authorization. At least one
1411            /// principal should match. Each peer can be an exact match, or a prefix
1412            /// match (example, "namespace/*") or a suffix match (example,
1413            /// "*/service-account") or a presence match "*". Authorization based on
1414            /// the principal name without certificate validation (configured by
1415            /// ServerTlsPolicy resource) is considered insecure.
1416            pub principals: std::vec::Vec<std::string::String>,
1417
1418            /// Optional. List of CIDR ranges to match based on source IP address. At least one
1419            /// IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
1420            /// "1.2.3.0/24") are supported. Authorization based on source IP alone
1421            /// should be avoided. The IP addresses of any load balancers or proxies
1422            /// should be considered untrusted.
1423            pub ip_blocks: std::vec::Vec<std::string::String>,
1424
1425            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426        }
1427
1428        impl Source {
1429            pub fn new() -> Self {
1430                std::default::Default::default()
1431            }
1432
1433            /// Sets the value of [principals][crate::model::authorization_policy::rule::Source::principals].
1434            pub fn set_principals<T, V>(mut self, v: T) -> Self
1435            where
1436                T: std::iter::IntoIterator<Item = V>,
1437                V: std::convert::Into<std::string::String>,
1438            {
1439                use std::iter::Iterator;
1440                self.principals = v.into_iter().map(|i| i.into()).collect();
1441                self
1442            }
1443
1444            /// Sets the value of [ip_blocks][crate::model::authorization_policy::rule::Source::ip_blocks].
1445            pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1446            where
1447                T: std::iter::IntoIterator<Item = V>,
1448                V: std::convert::Into<std::string::String>,
1449            {
1450                use std::iter::Iterator;
1451                self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1452                self
1453            }
1454        }
1455
1456        impl wkt::message::Message for Source {
1457            fn typename() -> &'static str {
1458                "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1459            }
1460        }
1461
1462        /// Specification of traffic destination attributes.
1463        #[derive(Clone, Default, PartialEq)]
1464        #[non_exhaustive]
1465        pub struct Destination {
1466            /// Required. List of host names to match. Matched against the ":authority" header in
1467            /// http requests. At least one host should match. Each host can be an
1468            /// exact match, or a prefix match (example "mydomain.*") or a suffix
1469            /// match (example "*.myorg.com") or a presence (any) match "*".
1470            pub hosts: std::vec::Vec<std::string::String>,
1471
1472            /// Required. List of destination ports to match. At least one port should match.
1473            pub ports: std::vec::Vec<u32>,
1474
1475            /// Optional. A list of HTTP methods to match. At least one method should
1476            /// match. Should not be set for gRPC services.
1477            pub methods: std::vec::Vec<std::string::String>,
1478
1479            /// Optional. Match against key:value pair in http header. Provides a flexible match
1480            /// based on HTTP headers, for potentially advanced use cases. At least one
1481            /// header should match. Avoid using header matches to make authorization
1482            /// decisions unless there is a strong guarantee that requests arrive
1483            /// through a trusted client or proxy.
1484            pub http_header_match: std::option::Option<
1485                crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1486            >,
1487
1488            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1489        }
1490
1491        impl Destination {
1492            pub fn new() -> Self {
1493                std::default::Default::default()
1494            }
1495
1496            /// Sets the value of [hosts][crate::model::authorization_policy::rule::Destination::hosts].
1497            pub fn set_hosts<T, V>(mut self, v: T) -> Self
1498            where
1499                T: std::iter::IntoIterator<Item = V>,
1500                V: std::convert::Into<std::string::String>,
1501            {
1502                use std::iter::Iterator;
1503                self.hosts = v.into_iter().map(|i| i.into()).collect();
1504                self
1505            }
1506
1507            /// Sets the value of [ports][crate::model::authorization_policy::rule::Destination::ports].
1508            pub fn set_ports<T, V>(mut self, v: T) -> Self
1509            where
1510                T: std::iter::IntoIterator<Item = V>,
1511                V: std::convert::Into<u32>,
1512            {
1513                use std::iter::Iterator;
1514                self.ports = v.into_iter().map(|i| i.into()).collect();
1515                self
1516            }
1517
1518            /// Sets the value of [methods][crate::model::authorization_policy::rule::Destination::methods].
1519            pub fn set_methods<T, V>(mut self, v: T) -> Self
1520            where
1521                T: std::iter::IntoIterator<Item = V>,
1522                V: std::convert::Into<std::string::String>,
1523            {
1524                use std::iter::Iterator;
1525                self.methods = v.into_iter().map(|i| i.into()).collect();
1526                self
1527            }
1528
1529            /// Sets the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
1530            pub fn set_http_header_match<T>(mut self, v: T) -> Self
1531            where
1532                T: std::convert::Into<
1533                        crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1534                    >,
1535            {
1536                self.http_header_match = std::option::Option::Some(v.into());
1537                self
1538            }
1539
1540            /// Sets or clears the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
1541            pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
1542            where
1543                T: std::convert::Into<
1544                        crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1545                    >,
1546            {
1547                self.http_header_match = v.map(|x| x.into());
1548                self
1549            }
1550        }
1551
1552        impl wkt::message::Message for Destination {
1553            fn typename() -> &'static str {
1554                "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
1555            }
1556        }
1557
1558        /// Defines additional types related to [Destination].
1559        pub mod destination {
1560            #[allow(unused_imports)]
1561            use super::*;
1562
1563            /// Specification of HTTP header match attributes.
1564            #[derive(Clone, Default, PartialEq)]
1565            #[non_exhaustive]
1566            pub struct HttpHeaderMatch {
1567                /// Required. The name of the HTTP header to match. For matching
1568                /// against the HTTP request's authority, use a headerMatch
1569                /// with the header name ":authority". For matching a
1570                /// request's method, use the headerName ":method".
1571                pub header_name: std::string::String,
1572
1573                pub r#type: std::option::Option<
1574                    crate::model::authorization_policy::rule::destination::http_header_match::Type,
1575                >,
1576
1577                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1578            }
1579
1580            impl HttpHeaderMatch {
1581                pub fn new() -> Self {
1582                    std::default::Default::default()
1583                }
1584
1585                /// Sets the value of [header_name][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::header_name].
1586                pub fn set_header_name<T: std::convert::Into<std::string::String>>(
1587                    mut self,
1588                    v: T,
1589                ) -> Self {
1590                    self.header_name = v.into();
1591                    self
1592                }
1593
1594                /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::type].
1595                ///
1596                /// Note that all the setters affecting `r#type` are mutually
1597                /// exclusive.
1598                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
1599                {
1600                    self.r#type = v.into();
1601                    self
1602                }
1603
1604                /// The value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
1605                /// if it holds a `RegexMatch`, `None` if the field is not set or
1606                /// holds a different branch.
1607                pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
1608                    #[allow(unreachable_patterns)]
1609                    self.r#type.as_ref().and_then(|v| match v {
1610                        crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
1611                        _ => std::option::Option::None,
1612                    })
1613                }
1614
1615                /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
1616                /// to hold a `RegexMatch`.
1617                ///
1618                /// Note that all the setters affecting `r#type` are
1619                /// mutually exclusive.
1620                pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
1621                    mut self,
1622                    v: T,
1623                ) -> Self {
1624                    self.r#type = std::option::Option::Some(
1625                        crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
1626                            v.into()
1627                        )
1628                    );
1629                    self
1630                }
1631            }
1632
1633            impl wkt::message::Message for HttpHeaderMatch {
1634                fn typename() -> &'static str {
1635                    "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
1636                }
1637            }
1638
1639            /// Defines additional types related to [HttpHeaderMatch].
1640            pub mod http_header_match {
1641                #[allow(unused_imports)]
1642                use super::*;
1643
1644                #[derive(Clone, Debug, PartialEq)]
1645                #[non_exhaustive]
1646                pub enum Type {
1647                    /// Required. The value of the header must match the regular expression
1648                    /// specified in regexMatch. For regular expression grammar,
1649                    /// please see: en.cppreference.com/w/cpp/regex/ecmascript
1650                    /// For matching against a port specified in the HTTP
1651                    /// request, use a headerMatch with headerName set to Host
1652                    /// and a regular expression that satisfies the RFC2616 Host
1653                    /// header's port specifier.
1654                    RegexMatch(std::string::String),
1655                }
1656            }
1657        }
1658    }
1659
1660    /// Possible values that define what action to take.
1661    ///
1662    /// # Working with unknown values
1663    ///
1664    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1665    /// additional enum variants at any time. Adding new variants is not considered
1666    /// a breaking change. Applications should write their code in anticipation of:
1667    ///
1668    /// - New values appearing in future releases of the client library, **and**
1669    /// - New values received dynamically, without application changes.
1670    ///
1671    /// Please consult the [Working with enums] section in the user guide for some
1672    /// guidelines.
1673    ///
1674    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1675    #[derive(Clone, Debug, PartialEq)]
1676    #[non_exhaustive]
1677    pub enum Action {
1678        /// Default value.
1679        Unspecified,
1680        /// Grant access.
1681        Allow,
1682        /// Deny access.
1683        /// Deny rules should be avoided unless they are used to provide a default
1684        /// "deny all" fallback.
1685        Deny,
1686        /// If set, the enum was initialized with an unknown value.
1687        ///
1688        /// Applications can examine the value using [Action::value] or
1689        /// [Action::name].
1690        UnknownValue(action::UnknownValue),
1691    }
1692
1693    #[doc(hidden)]
1694    pub mod action {
1695        #[allow(unused_imports)]
1696        use super::*;
1697        #[derive(Clone, Debug, PartialEq)]
1698        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1699    }
1700
1701    impl Action {
1702        /// Gets the enum value.
1703        ///
1704        /// Returns `None` if the enum contains an unknown value deserialized from
1705        /// the string representation of enums.
1706        pub fn value(&self) -> std::option::Option<i32> {
1707            match self {
1708                Self::Unspecified => std::option::Option::Some(0),
1709                Self::Allow => std::option::Option::Some(1),
1710                Self::Deny => std::option::Option::Some(2),
1711                Self::UnknownValue(u) => u.0.value(),
1712            }
1713        }
1714
1715        /// Gets the enum value as a string.
1716        ///
1717        /// Returns `None` if the enum contains an unknown value deserialized from
1718        /// the integer representation of enums.
1719        pub fn name(&self) -> std::option::Option<&str> {
1720            match self {
1721                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
1722                Self::Allow => std::option::Option::Some("ALLOW"),
1723                Self::Deny => std::option::Option::Some("DENY"),
1724                Self::UnknownValue(u) => u.0.name(),
1725            }
1726        }
1727    }
1728
1729    impl std::default::Default for Action {
1730        fn default() -> Self {
1731            use std::convert::From;
1732            Self::from(0)
1733        }
1734    }
1735
1736    impl std::fmt::Display for Action {
1737        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1738            wkt::internal::display_enum(f, self.name(), self.value())
1739        }
1740    }
1741
1742    impl std::convert::From<i32> for Action {
1743        fn from(value: i32) -> Self {
1744            match value {
1745                0 => Self::Unspecified,
1746                1 => Self::Allow,
1747                2 => Self::Deny,
1748                _ => Self::UnknownValue(action::UnknownValue(
1749                    wkt::internal::UnknownEnumValue::Integer(value),
1750                )),
1751            }
1752        }
1753    }
1754
1755    impl std::convert::From<&str> for Action {
1756        fn from(value: &str) -> Self {
1757            use std::string::ToString;
1758            match value {
1759                "ACTION_UNSPECIFIED" => Self::Unspecified,
1760                "ALLOW" => Self::Allow,
1761                "DENY" => Self::Deny,
1762                _ => Self::UnknownValue(action::UnknownValue(
1763                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1764                )),
1765            }
1766        }
1767    }
1768
1769    impl serde::ser::Serialize for Action {
1770        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1771        where
1772            S: serde::Serializer,
1773        {
1774            match self {
1775                Self::Unspecified => serializer.serialize_i32(0),
1776                Self::Allow => serializer.serialize_i32(1),
1777                Self::Deny => serializer.serialize_i32(2),
1778                Self::UnknownValue(u) => u.0.serialize(serializer),
1779            }
1780        }
1781    }
1782
1783    impl<'de> serde::de::Deserialize<'de> for Action {
1784        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1785        where
1786            D: serde::Deserializer<'de>,
1787        {
1788            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
1789                ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
1790            ))
1791        }
1792    }
1793}
1794
1795/// Request used with the ListAuthorizationPolicies method.
1796#[derive(Clone, Default, PartialEq)]
1797#[non_exhaustive]
1798pub struct ListAuthorizationPoliciesRequest {
1799    /// Required. The project and location from which the AuthorizationPolicies
1800    /// should be listed, specified in the format
1801    /// `projects/{project}/locations/{location}`.
1802    pub parent: std::string::String,
1803
1804    /// Maximum number of AuthorizationPolicies to return per call.
1805    pub page_size: i32,
1806
1807    /// The value returned by the last
1808    /// `ListAuthorizationPoliciesResponse` Indicates that this is a
1809    /// continuation of a prior `ListAuthorizationPolicies` call, and
1810    /// that the system should return the next page of data.
1811    pub page_token: std::string::String,
1812
1813    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1814}
1815
1816impl ListAuthorizationPoliciesRequest {
1817    pub fn new() -> Self {
1818        std::default::Default::default()
1819    }
1820
1821    /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
1822    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1823        self.parent = v.into();
1824        self
1825    }
1826
1827    /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
1828    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1829        self.page_size = v.into();
1830        self
1831    }
1832
1833    /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
1834    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1835        self.page_token = v.into();
1836        self
1837    }
1838}
1839
1840impl wkt::message::Message for ListAuthorizationPoliciesRequest {
1841    fn typename() -> &'static str {
1842        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
1843    }
1844}
1845
1846/// Response returned by the ListAuthorizationPolicies method.
1847#[derive(Clone, Default, PartialEq)]
1848#[non_exhaustive]
1849pub struct ListAuthorizationPoliciesResponse {
1850    /// List of AuthorizationPolicies resources.
1851    pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
1852
1853    /// If there might be more results than those appearing in this response, then
1854    /// `next_page_token` is included. To get the next set of results, call this
1855    /// method again using the value of `next_page_token` as `page_token`.
1856    pub next_page_token: std::string::String,
1857
1858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859}
1860
1861impl ListAuthorizationPoliciesResponse {
1862    pub fn new() -> Self {
1863        std::default::Default::default()
1864    }
1865
1866    /// Sets the value of [authorization_policies][crate::model::ListAuthorizationPoliciesResponse::authorization_policies].
1867    pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
1868    where
1869        T: std::iter::IntoIterator<Item = V>,
1870        V: std::convert::Into<crate::model::AuthorizationPolicy>,
1871    {
1872        use std::iter::Iterator;
1873        self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
1874        self
1875    }
1876
1877    /// Sets the value of [next_page_token][crate::model::ListAuthorizationPoliciesResponse::next_page_token].
1878    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1879        self.next_page_token = v.into();
1880        self
1881    }
1882}
1883
1884impl wkt::message::Message for ListAuthorizationPoliciesResponse {
1885    fn typename() -> &'static str {
1886        "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
1887    }
1888}
1889
1890#[doc(hidden)]
1891impl gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
1892    type PageItem = crate::model::AuthorizationPolicy;
1893
1894    fn items(self) -> std::vec::Vec<Self::PageItem> {
1895        self.authorization_policies
1896    }
1897
1898    fn next_page_token(&self) -> std::string::String {
1899        use std::clone::Clone;
1900        self.next_page_token.clone()
1901    }
1902}
1903
1904/// Request used by the GetAuthorizationPolicy method.
1905#[derive(Clone, Default, PartialEq)]
1906#[non_exhaustive]
1907pub struct GetAuthorizationPolicyRequest {
1908    /// Required. A name of the AuthorizationPolicy to get. Must be in the format
1909    /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
1910    pub name: std::string::String,
1911
1912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1913}
1914
1915impl GetAuthorizationPolicyRequest {
1916    pub fn new() -> Self {
1917        std::default::Default::default()
1918    }
1919
1920    /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
1921    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1922        self.name = v.into();
1923        self
1924    }
1925}
1926
1927impl wkt::message::Message for GetAuthorizationPolicyRequest {
1928    fn typename() -> &'static str {
1929        "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
1930    }
1931}
1932
1933/// Request used by the CreateAuthorizationPolicy method.
1934#[derive(Clone, Default, PartialEq)]
1935#[non_exhaustive]
1936pub struct CreateAuthorizationPolicyRequest {
1937    /// Required. The parent resource of the AuthorizationPolicy. Must be in the
1938    /// format `projects/{project}/locations/{location}`.
1939    pub parent: std::string::String,
1940
1941    /// Required. Short name of the AuthorizationPolicy resource to be created.
1942    /// This value should be 1-63 characters long, containing only
1943    /// letters, numbers, hyphens, and underscores, and should not start
1944    /// with a number. E.g. "authz_policy".
1945    pub authorization_policy_id: std::string::String,
1946
1947    /// Required. AuthorizationPolicy resource to be created.
1948    pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
1949
1950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1951}
1952
1953impl CreateAuthorizationPolicyRequest {
1954    pub fn new() -> Self {
1955        std::default::Default::default()
1956    }
1957
1958    /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
1959    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1960        self.parent = v.into();
1961        self
1962    }
1963
1964    /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
1965    pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
1966        mut self,
1967        v: T,
1968    ) -> Self {
1969        self.authorization_policy_id = v.into();
1970        self
1971    }
1972
1973    /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
1974    pub fn set_authorization_policy<T>(mut self, v: T) -> Self
1975    where
1976        T: std::convert::Into<crate::model::AuthorizationPolicy>,
1977    {
1978        self.authorization_policy = std::option::Option::Some(v.into());
1979        self
1980    }
1981
1982    /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
1983    pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
1984    where
1985        T: std::convert::Into<crate::model::AuthorizationPolicy>,
1986    {
1987        self.authorization_policy = v.map(|x| x.into());
1988        self
1989    }
1990}
1991
1992impl wkt::message::Message for CreateAuthorizationPolicyRequest {
1993    fn typename() -> &'static str {
1994        "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
1995    }
1996}
1997
1998/// Request used by the UpdateAuthorizationPolicy method.
1999#[derive(Clone, Default, PartialEq)]
2000#[non_exhaustive]
2001pub struct UpdateAuthorizationPolicyRequest {
2002    /// Optional. Field mask is used to specify the fields to be overwritten in the
2003    /// AuthorizationPolicy resource by the update.
2004    /// The fields specified in the update_mask are relative to the resource, not
2005    /// the full request. A field will be overwritten if it is in the mask. If the
2006    /// user does not provide a mask then all fields will be overwritten.
2007    pub update_mask: std::option::Option<wkt::FieldMask>,
2008
2009    /// Required. Updated AuthorizationPolicy resource.
2010    pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2011
2012    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2013}
2014
2015impl UpdateAuthorizationPolicyRequest {
2016    pub fn new() -> Self {
2017        std::default::Default::default()
2018    }
2019
2020    /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2021    pub fn set_update_mask<T>(mut self, v: T) -> Self
2022    where
2023        T: std::convert::Into<wkt::FieldMask>,
2024    {
2025        self.update_mask = std::option::Option::Some(v.into());
2026        self
2027    }
2028
2029    /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2030    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2031    where
2032        T: std::convert::Into<wkt::FieldMask>,
2033    {
2034        self.update_mask = v.map(|x| x.into());
2035        self
2036    }
2037
2038    /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2039    pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2040    where
2041        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2042    {
2043        self.authorization_policy = std::option::Option::Some(v.into());
2044        self
2045    }
2046
2047    /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2048    pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2049    where
2050        T: std::convert::Into<crate::model::AuthorizationPolicy>,
2051    {
2052        self.authorization_policy = v.map(|x| x.into());
2053        self
2054    }
2055}
2056
2057impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2058    fn typename() -> &'static str {
2059        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2060    }
2061}
2062
2063/// Request used by the DeleteAuthorizationPolicy method.
2064#[derive(Clone, Default, PartialEq)]
2065#[non_exhaustive]
2066pub struct DeleteAuthorizationPolicyRequest {
2067    /// Required. A name of the AuthorizationPolicy to delete. Must be in the format
2068    /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
2069    pub name: std::string::String,
2070
2071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2072}
2073
2074impl DeleteAuthorizationPolicyRequest {
2075    pub fn new() -> Self {
2076        std::default::Default::default()
2077    }
2078
2079    /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
2080    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2081        self.name = v.into();
2082        self
2083    }
2084}
2085
2086impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2087    fn typename() -> &'static str {
2088        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2089    }
2090}
2091
2092/// ClientTlsPolicy is a resource that specifies how a client should authenticate
2093/// connections to backends of a service. This resource itself does not affect
2094/// configuration unless it is attached to a backend service resource.
2095#[derive(Clone, Default, PartialEq)]
2096#[non_exhaustive]
2097pub struct ClientTlsPolicy {
2098    /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
2099    /// `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
2100    pub name: std::string::String,
2101
2102    /// Optional. Free-text description of the resource.
2103    pub description: std::string::String,
2104
2105    /// Output only. The timestamp when the resource was created.
2106    pub create_time: std::option::Option<wkt::Timestamp>,
2107
2108    /// Output only. The timestamp when the resource was updated.
2109    pub update_time: std::option::Option<wkt::Timestamp>,
2110
2111    /// Optional. Set of label tags associated with the resource.
2112    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2113
2114    /// Optional. Server Name Indication string to present to the server during TLS
2115    /// handshake. E.g: "secure.example.com".
2116    pub sni: std::string::String,
2117
2118    /// Optional. Defines a mechanism to provision client identity (public and private keys)
2119    /// for peer to peer authentication. The presence of this dictates mTLS.
2120    pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
2121
2122    /// Optional. Defines the mechanism to obtain the Certificate Authority certificate to
2123    /// validate the server certificate. If empty, client does not validate the
2124    /// server certificate.
2125    pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
2126
2127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl ClientTlsPolicy {
2131    pub fn new() -> Self {
2132        std::default::Default::default()
2133    }
2134
2135    /// Sets the value of [name][crate::model::ClientTlsPolicy::name].
2136    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2137        self.name = v.into();
2138        self
2139    }
2140
2141    /// Sets the value of [description][crate::model::ClientTlsPolicy::description].
2142    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2143        self.description = v.into();
2144        self
2145    }
2146
2147    /// Sets the value of [create_time][crate::model::ClientTlsPolicy::create_time].
2148    pub fn set_create_time<T>(mut self, v: T) -> Self
2149    where
2150        T: std::convert::Into<wkt::Timestamp>,
2151    {
2152        self.create_time = std::option::Option::Some(v.into());
2153        self
2154    }
2155
2156    /// Sets or clears the value of [create_time][crate::model::ClientTlsPolicy::create_time].
2157    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2158    where
2159        T: std::convert::Into<wkt::Timestamp>,
2160    {
2161        self.create_time = v.map(|x| x.into());
2162        self
2163    }
2164
2165    /// Sets the value of [update_time][crate::model::ClientTlsPolicy::update_time].
2166    pub fn set_update_time<T>(mut self, v: T) -> Self
2167    where
2168        T: std::convert::Into<wkt::Timestamp>,
2169    {
2170        self.update_time = std::option::Option::Some(v.into());
2171        self
2172    }
2173
2174    /// Sets or clears the value of [update_time][crate::model::ClientTlsPolicy::update_time].
2175    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2176    where
2177        T: std::convert::Into<wkt::Timestamp>,
2178    {
2179        self.update_time = v.map(|x| x.into());
2180        self
2181    }
2182
2183    /// Sets the value of [labels][crate::model::ClientTlsPolicy::labels].
2184    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2185    where
2186        T: std::iter::IntoIterator<Item = (K, V)>,
2187        K: std::convert::Into<std::string::String>,
2188        V: std::convert::Into<std::string::String>,
2189    {
2190        use std::iter::Iterator;
2191        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2192        self
2193    }
2194
2195    /// Sets the value of [sni][crate::model::ClientTlsPolicy::sni].
2196    pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2197        self.sni = v.into();
2198        self
2199    }
2200
2201    /// Sets the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
2202    pub fn set_client_certificate<T>(mut self, v: T) -> Self
2203    where
2204        T: std::convert::Into<crate::model::CertificateProvider>,
2205    {
2206        self.client_certificate = std::option::Option::Some(v.into());
2207        self
2208    }
2209
2210    /// Sets or clears the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
2211    pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
2212    where
2213        T: std::convert::Into<crate::model::CertificateProvider>,
2214    {
2215        self.client_certificate = v.map(|x| x.into());
2216        self
2217    }
2218
2219    /// Sets the value of [server_validation_ca][crate::model::ClientTlsPolicy::server_validation_ca].
2220    pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
2221    where
2222        T: std::iter::IntoIterator<Item = V>,
2223        V: std::convert::Into<crate::model::ValidationCA>,
2224    {
2225        use std::iter::Iterator;
2226        self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
2227        self
2228    }
2229}
2230
2231impl wkt::message::Message for ClientTlsPolicy {
2232    fn typename() -> &'static str {
2233        "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
2234    }
2235}
2236
2237/// Request used by the ListClientTlsPolicies method.
2238#[derive(Clone, Default, PartialEq)]
2239#[non_exhaustive]
2240pub struct ListClientTlsPoliciesRequest {
2241    /// Required. The project and location from which the ClientTlsPolicies should
2242    /// be listed, specified in the format `projects/*/locations/{location}`.
2243    pub parent: std::string::String,
2244
2245    /// Maximum number of ClientTlsPolicies to return per call.
2246    pub page_size: i32,
2247
2248    /// The value returned by the last `ListClientTlsPoliciesResponse`
2249    /// Indicates that this is a continuation of a prior
2250    /// `ListClientTlsPolicies` call, and that the system
2251    /// should return the next page of data.
2252    pub page_token: std::string::String,
2253
2254    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2255}
2256
2257impl ListClientTlsPoliciesRequest {
2258    pub fn new() -> Self {
2259        std::default::Default::default()
2260    }
2261
2262    /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
2263    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2264        self.parent = v.into();
2265        self
2266    }
2267
2268    /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
2269    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2270        self.page_size = v.into();
2271        self
2272    }
2273
2274    /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
2275    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2276        self.page_token = v.into();
2277        self
2278    }
2279}
2280
2281impl wkt::message::Message for ListClientTlsPoliciesRequest {
2282    fn typename() -> &'static str {
2283        "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
2284    }
2285}
2286
2287/// Response returned by the ListClientTlsPolicies method.
2288#[derive(Clone, Default, PartialEq)]
2289#[non_exhaustive]
2290pub struct ListClientTlsPoliciesResponse {
2291    /// List of ClientTlsPolicy resources.
2292    pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
2293
2294    /// If there might be more results than those appearing in this response, then
2295    /// `next_page_token` is included. To get the next set of results, call this
2296    /// method again using the value of `next_page_token` as `page_token`.
2297    pub next_page_token: std::string::String,
2298
2299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2300}
2301
2302impl ListClientTlsPoliciesResponse {
2303    pub fn new() -> Self {
2304        std::default::Default::default()
2305    }
2306
2307    /// Sets the value of [client_tls_policies][crate::model::ListClientTlsPoliciesResponse::client_tls_policies].
2308    pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
2309    where
2310        T: std::iter::IntoIterator<Item = V>,
2311        V: std::convert::Into<crate::model::ClientTlsPolicy>,
2312    {
2313        use std::iter::Iterator;
2314        self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
2315        self
2316    }
2317
2318    /// Sets the value of [next_page_token][crate::model::ListClientTlsPoliciesResponse::next_page_token].
2319    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2320        self.next_page_token = v.into();
2321        self
2322    }
2323}
2324
2325impl wkt::message::Message for ListClientTlsPoliciesResponse {
2326    fn typename() -> &'static str {
2327        "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
2328    }
2329}
2330
2331#[doc(hidden)]
2332impl gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
2333    type PageItem = crate::model::ClientTlsPolicy;
2334
2335    fn items(self) -> std::vec::Vec<Self::PageItem> {
2336        self.client_tls_policies
2337    }
2338
2339    fn next_page_token(&self) -> std::string::String {
2340        use std::clone::Clone;
2341        self.next_page_token.clone()
2342    }
2343}
2344
2345/// Request used by the GetClientTlsPolicy method.
2346#[derive(Clone, Default, PartialEq)]
2347#[non_exhaustive]
2348pub struct GetClientTlsPolicyRequest {
2349    /// Required. A name of the ClientTlsPolicy to get. Must be in the format
2350    /// `projects/*/locations/{location}/clientTlsPolicies/*`.
2351    pub name: std::string::String,
2352
2353    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2354}
2355
2356impl GetClientTlsPolicyRequest {
2357    pub fn new() -> Self {
2358        std::default::Default::default()
2359    }
2360
2361    /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
2362    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2363        self.name = v.into();
2364        self
2365    }
2366}
2367
2368impl wkt::message::Message for GetClientTlsPolicyRequest {
2369    fn typename() -> &'static str {
2370        "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
2371    }
2372}
2373
2374/// Request used by the CreateClientTlsPolicy method.
2375#[derive(Clone, Default, PartialEq)]
2376#[non_exhaustive]
2377pub struct CreateClientTlsPolicyRequest {
2378    /// Required. The parent resource of the ClientTlsPolicy. Must be in
2379    /// the format `projects/*/locations/{location}`.
2380    pub parent: std::string::String,
2381
2382    /// Required. Short name of the ClientTlsPolicy resource to be created. This value should
2383    /// be 1-63 characters long, containing only letters, numbers, hyphens, and
2384    /// underscores, and should not start with a number. E.g. "client_mtls_policy".
2385    pub client_tls_policy_id: std::string::String,
2386
2387    /// Required. ClientTlsPolicy resource to be created.
2388    pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
2389
2390    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2391}
2392
2393impl CreateClientTlsPolicyRequest {
2394    pub fn new() -> Self {
2395        std::default::Default::default()
2396    }
2397
2398    /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
2399    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2400        self.parent = v.into();
2401        self
2402    }
2403
2404    /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
2405    pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
2406        mut self,
2407        v: T,
2408    ) -> Self {
2409        self.client_tls_policy_id = v.into();
2410        self
2411    }
2412
2413    /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
2414    pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
2415    where
2416        T: std::convert::Into<crate::model::ClientTlsPolicy>,
2417    {
2418        self.client_tls_policy = std::option::Option::Some(v.into());
2419        self
2420    }
2421
2422    /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
2423    pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2424    where
2425        T: std::convert::Into<crate::model::ClientTlsPolicy>,
2426    {
2427        self.client_tls_policy = v.map(|x| x.into());
2428        self
2429    }
2430}
2431
2432impl wkt::message::Message for CreateClientTlsPolicyRequest {
2433    fn typename() -> &'static str {
2434        "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
2435    }
2436}
2437
2438/// Request used by UpdateClientTlsPolicy method.
2439#[derive(Clone, Default, PartialEq)]
2440#[non_exhaustive]
2441pub struct UpdateClientTlsPolicyRequest {
2442    /// Optional. Field mask is used to specify the fields to be overwritten in the
2443    /// ClientTlsPolicy resource by the update.  The fields
2444    /// specified in the update_mask are relative to the resource, not
2445    /// the full request. A field will be overwritten if it is in the
2446    /// mask. If the user does not provide a mask then all fields will be
2447    /// overwritten.
2448    pub update_mask: std::option::Option<wkt::FieldMask>,
2449
2450    /// Required. Updated ClientTlsPolicy resource.
2451    pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
2452
2453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2454}
2455
2456impl UpdateClientTlsPolicyRequest {
2457    pub fn new() -> Self {
2458        std::default::Default::default()
2459    }
2460
2461    /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
2462    pub fn set_update_mask<T>(mut self, v: T) -> Self
2463    where
2464        T: std::convert::Into<wkt::FieldMask>,
2465    {
2466        self.update_mask = std::option::Option::Some(v.into());
2467        self
2468    }
2469
2470    /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
2471    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2472    where
2473        T: std::convert::Into<wkt::FieldMask>,
2474    {
2475        self.update_mask = v.map(|x| x.into());
2476        self
2477    }
2478
2479    /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
2480    pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
2481    where
2482        T: std::convert::Into<crate::model::ClientTlsPolicy>,
2483    {
2484        self.client_tls_policy = std::option::Option::Some(v.into());
2485        self
2486    }
2487
2488    /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
2489    pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2490    where
2491        T: std::convert::Into<crate::model::ClientTlsPolicy>,
2492    {
2493        self.client_tls_policy = v.map(|x| x.into());
2494        self
2495    }
2496}
2497
2498impl wkt::message::Message for UpdateClientTlsPolicyRequest {
2499    fn typename() -> &'static str {
2500        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
2501    }
2502}
2503
2504/// Request used by the DeleteClientTlsPolicy method.
2505#[derive(Clone, Default, PartialEq)]
2506#[non_exhaustive]
2507pub struct DeleteClientTlsPolicyRequest {
2508    /// Required. A name of the ClientTlsPolicy to delete. Must be in
2509    /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
2510    pub name: std::string::String,
2511
2512    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2513}
2514
2515impl DeleteClientTlsPolicyRequest {
2516    pub fn new() -> Self {
2517        std::default::Default::default()
2518    }
2519
2520    /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
2521    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2522        self.name = v.into();
2523        self
2524    }
2525}
2526
2527impl wkt::message::Message for DeleteClientTlsPolicyRequest {
2528    fn typename() -> &'static str {
2529        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
2530    }
2531}
2532
2533/// Represents the metadata of the long-running operation.
2534#[derive(Clone, Default, PartialEq)]
2535#[non_exhaustive]
2536pub struct OperationMetadata {
2537    /// Output only. The time the operation was created.
2538    pub create_time: std::option::Option<wkt::Timestamp>,
2539
2540    /// Output only. The time the operation finished running.
2541    pub end_time: std::option::Option<wkt::Timestamp>,
2542
2543    /// Output only. Server-defined resource path for the target of the operation.
2544    pub target: std::string::String,
2545
2546    /// Output only. Name of the verb executed by the operation.
2547    pub verb: std::string::String,
2548
2549    /// Output only. Human-readable status of the operation, if any.
2550    pub status_message: std::string::String,
2551
2552    /// Output only. Identifies whether the user has requested cancellation
2553    /// of the operation. Operations that have successfully been cancelled
2554    /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2555    /// corresponding to `Code.CANCELLED`.
2556    ///
2557    /// [google.rpc.Status.code]: rpc::model::Status::code
2558    pub requested_cancellation: bool,
2559
2560    /// Output only. API version used to start the operation.
2561    pub api_version: std::string::String,
2562
2563    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl OperationMetadata {
2567    pub fn new() -> Self {
2568        std::default::Default::default()
2569    }
2570
2571    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2572    pub fn set_create_time<T>(mut self, v: T) -> Self
2573    where
2574        T: std::convert::Into<wkt::Timestamp>,
2575    {
2576        self.create_time = std::option::Option::Some(v.into());
2577        self
2578    }
2579
2580    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2581    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2582    where
2583        T: std::convert::Into<wkt::Timestamp>,
2584    {
2585        self.create_time = v.map(|x| x.into());
2586        self
2587    }
2588
2589    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2590    pub fn set_end_time<T>(mut self, v: T) -> Self
2591    where
2592        T: std::convert::Into<wkt::Timestamp>,
2593    {
2594        self.end_time = std::option::Option::Some(v.into());
2595        self
2596    }
2597
2598    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2599    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2600    where
2601        T: std::convert::Into<wkt::Timestamp>,
2602    {
2603        self.end_time = v.map(|x| x.into());
2604        self
2605    }
2606
2607    /// Sets the value of [target][crate::model::OperationMetadata::target].
2608    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2609        self.target = v.into();
2610        self
2611    }
2612
2613    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2614    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2615        self.verb = v.into();
2616        self
2617    }
2618
2619    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2620    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2621        self.status_message = v.into();
2622        self
2623    }
2624
2625    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2626    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2627        self.requested_cancellation = v.into();
2628        self
2629    }
2630
2631    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2632    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2633        self.api_version = v.into();
2634        self
2635    }
2636}
2637
2638impl wkt::message::Message for OperationMetadata {
2639    fn typename() -> &'static str {
2640        "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
2641    }
2642}
2643
2644/// ServerTlsPolicy is a resource that specifies how a server should authenticate
2645/// incoming requests. This resource itself does not affect configuration unless
2646/// it is attached to a target https proxy or endpoint config selector resource.
2647#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct ServerTlsPolicy {
2650    /// Required. Name of the ServerTlsPolicy resource. It matches the pattern
2651    /// `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
2652    pub name: std::string::String,
2653
2654    /// Free-text description of the resource.
2655    pub description: std::string::String,
2656
2657    /// Output only. The timestamp when the resource was created.
2658    pub create_time: std::option::Option<wkt::Timestamp>,
2659
2660    /// Output only. The timestamp when the resource was updated.
2661    pub update_time: std::option::Option<wkt::Timestamp>,
2662
2663    /// Set of label tags associated with the resource.
2664    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2665
2666    /// Determines if server allows plaintext connections. If set to true, server
2667    /// allows plain text connections. By default, it is set to false. This setting
2668    /// is not exclusive of other encryption modes. For example, if `allow_open`
2669    /// and `mtls_policy` are set, server allows both plain text and mTLS
2670    /// connections. See documentation of other encryption modes to confirm
2671    /// compatibility.
2672    ///
2673    /// Consider using it if you wish to upgrade in place your deployment to TLS
2674    /// while having mixed TLS and non-TLS traffic reaching port :80.
2675    pub allow_open: bool,
2676
2677    /// Defines a mechanism to provision server identity (public and private keys).
2678    /// Cannot be combined with `allow_open` as a permissive mode that allows both
2679    /// plain text and TLS is not supported.
2680    pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
2681
2682    /// Defines a mechanism to provision peer validation certificates for peer to
2683    /// peer authentication (Mutual TLS - mTLS). If not specified, client
2684    /// certificate will not be requested. The connection is treated as TLS and not
2685    /// mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
2686    /// text and mTLS connections.
2687    pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
2688
2689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2690}
2691
2692impl ServerTlsPolicy {
2693    pub fn new() -> Self {
2694        std::default::Default::default()
2695    }
2696
2697    /// Sets the value of [name][crate::model::ServerTlsPolicy::name].
2698    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2699        self.name = v.into();
2700        self
2701    }
2702
2703    /// Sets the value of [description][crate::model::ServerTlsPolicy::description].
2704    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2705        self.description = v.into();
2706        self
2707    }
2708
2709    /// Sets the value of [create_time][crate::model::ServerTlsPolicy::create_time].
2710    pub fn set_create_time<T>(mut self, v: T) -> Self
2711    where
2712        T: std::convert::Into<wkt::Timestamp>,
2713    {
2714        self.create_time = std::option::Option::Some(v.into());
2715        self
2716    }
2717
2718    /// Sets or clears the value of [create_time][crate::model::ServerTlsPolicy::create_time].
2719    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2720    where
2721        T: std::convert::Into<wkt::Timestamp>,
2722    {
2723        self.create_time = v.map(|x| x.into());
2724        self
2725    }
2726
2727    /// Sets the value of [update_time][crate::model::ServerTlsPolicy::update_time].
2728    pub fn set_update_time<T>(mut self, v: T) -> Self
2729    where
2730        T: std::convert::Into<wkt::Timestamp>,
2731    {
2732        self.update_time = std::option::Option::Some(v.into());
2733        self
2734    }
2735
2736    /// Sets or clears the value of [update_time][crate::model::ServerTlsPolicy::update_time].
2737    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2738    where
2739        T: std::convert::Into<wkt::Timestamp>,
2740    {
2741        self.update_time = v.map(|x| x.into());
2742        self
2743    }
2744
2745    /// Sets the value of [labels][crate::model::ServerTlsPolicy::labels].
2746    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2747    where
2748        T: std::iter::IntoIterator<Item = (K, V)>,
2749        K: std::convert::Into<std::string::String>,
2750        V: std::convert::Into<std::string::String>,
2751    {
2752        use std::iter::Iterator;
2753        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2754        self
2755    }
2756
2757    /// Sets the value of [allow_open][crate::model::ServerTlsPolicy::allow_open].
2758    pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2759        self.allow_open = v.into();
2760        self
2761    }
2762
2763    /// Sets the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
2764    pub fn set_server_certificate<T>(mut self, v: T) -> Self
2765    where
2766        T: std::convert::Into<crate::model::CertificateProvider>,
2767    {
2768        self.server_certificate = std::option::Option::Some(v.into());
2769        self
2770    }
2771
2772    /// Sets or clears the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
2773    pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
2774    where
2775        T: std::convert::Into<crate::model::CertificateProvider>,
2776    {
2777        self.server_certificate = v.map(|x| x.into());
2778        self
2779    }
2780
2781    /// Sets the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
2782    pub fn set_mtls_policy<T>(mut self, v: T) -> Self
2783    where
2784        T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
2785    {
2786        self.mtls_policy = std::option::Option::Some(v.into());
2787        self
2788    }
2789
2790    /// Sets or clears the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
2791    pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2792    where
2793        T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
2794    {
2795        self.mtls_policy = v.map(|x| x.into());
2796        self
2797    }
2798}
2799
2800impl wkt::message::Message for ServerTlsPolicy {
2801    fn typename() -> &'static str {
2802        "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
2803    }
2804}
2805
2806/// Defines additional types related to [ServerTlsPolicy].
2807pub mod server_tls_policy {
2808    #[allow(unused_imports)]
2809    use super::*;
2810
2811    /// Specification of the MTLSPolicy.
2812    #[derive(Clone, Default, PartialEq)]
2813    #[non_exhaustive]
2814    pub struct MTLSPolicy {
2815        /// Defines the mechanism to obtain the Certificate Authority certificate to
2816        /// validate the client certificate.
2817        pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
2818
2819        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2820    }
2821
2822    impl MTLSPolicy {
2823        pub fn new() -> Self {
2824            std::default::Default::default()
2825        }
2826
2827        /// Sets the value of [client_validation_ca][crate::model::server_tls_policy::MTLSPolicy::client_validation_ca].
2828        pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
2829        where
2830            T: std::iter::IntoIterator<Item = V>,
2831            V: std::convert::Into<crate::model::ValidationCA>,
2832        {
2833            use std::iter::Iterator;
2834            self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
2835            self
2836        }
2837    }
2838
2839    impl wkt::message::Message for MTLSPolicy {
2840        fn typename() -> &'static str {
2841            "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
2842        }
2843    }
2844}
2845
2846/// Request used by the ListServerTlsPolicies method.
2847#[derive(Clone, Default, PartialEq)]
2848#[non_exhaustive]
2849pub struct ListServerTlsPoliciesRequest {
2850    /// Required. The project and location from which the ServerTlsPolicies should
2851    /// be listed, specified in the format `projects/*/locations/{location}`.
2852    pub parent: std::string::String,
2853
2854    /// Maximum number of ServerTlsPolicies to return per call.
2855    pub page_size: i32,
2856
2857    /// The value returned by the last `ListServerTlsPoliciesResponse`
2858    /// Indicates that this is a continuation of a prior
2859    /// `ListServerTlsPolicies` call, and that the system
2860    /// should return the next page of data.
2861    pub page_token: std::string::String,
2862
2863    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864}
2865
2866impl ListServerTlsPoliciesRequest {
2867    pub fn new() -> Self {
2868        std::default::Default::default()
2869    }
2870
2871    /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
2872    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873        self.parent = v.into();
2874        self
2875    }
2876
2877    /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
2878    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2879        self.page_size = v.into();
2880        self
2881    }
2882
2883    /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
2884    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2885        self.page_token = v.into();
2886        self
2887    }
2888}
2889
2890impl wkt::message::Message for ListServerTlsPoliciesRequest {
2891    fn typename() -> &'static str {
2892        "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
2893    }
2894}
2895
2896/// Response returned by the ListServerTlsPolicies method.
2897#[derive(Clone, Default, PartialEq)]
2898#[non_exhaustive]
2899pub struct ListServerTlsPoliciesResponse {
2900    /// List of ServerTlsPolicy resources.
2901    pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
2902
2903    /// If there might be more results than those appearing in this response, then
2904    /// `next_page_token` is included. To get the next set of results, call this
2905    /// method again using the value of `next_page_token` as `page_token`.
2906    pub next_page_token: std::string::String,
2907
2908    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2909}
2910
2911impl ListServerTlsPoliciesResponse {
2912    pub fn new() -> Self {
2913        std::default::Default::default()
2914    }
2915
2916    /// Sets the value of [server_tls_policies][crate::model::ListServerTlsPoliciesResponse::server_tls_policies].
2917    pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
2918    where
2919        T: std::iter::IntoIterator<Item = V>,
2920        V: std::convert::Into<crate::model::ServerTlsPolicy>,
2921    {
2922        use std::iter::Iterator;
2923        self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
2924        self
2925    }
2926
2927    /// Sets the value of [next_page_token][crate::model::ListServerTlsPoliciesResponse::next_page_token].
2928    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2929        self.next_page_token = v.into();
2930        self
2931    }
2932}
2933
2934impl wkt::message::Message for ListServerTlsPoliciesResponse {
2935    fn typename() -> &'static str {
2936        "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
2937    }
2938}
2939
2940#[doc(hidden)]
2941impl gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
2942    type PageItem = crate::model::ServerTlsPolicy;
2943
2944    fn items(self) -> std::vec::Vec<Self::PageItem> {
2945        self.server_tls_policies
2946    }
2947
2948    fn next_page_token(&self) -> std::string::String {
2949        use std::clone::Clone;
2950        self.next_page_token.clone()
2951    }
2952}
2953
2954/// Request used by the GetServerTlsPolicy method.
2955#[derive(Clone, Default, PartialEq)]
2956#[non_exhaustive]
2957pub struct GetServerTlsPolicyRequest {
2958    /// Required. A name of the ServerTlsPolicy to get. Must be in the format
2959    /// `projects/*/locations/{location}/serverTlsPolicies/*`.
2960    pub name: std::string::String,
2961
2962    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2963}
2964
2965impl GetServerTlsPolicyRequest {
2966    pub fn new() -> Self {
2967        std::default::Default::default()
2968    }
2969
2970    /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
2971    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2972        self.name = v.into();
2973        self
2974    }
2975}
2976
2977impl wkt::message::Message for GetServerTlsPolicyRequest {
2978    fn typename() -> &'static str {
2979        "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
2980    }
2981}
2982
2983/// Request used by the CreateServerTlsPolicy method.
2984#[derive(Clone, Default, PartialEq)]
2985#[non_exhaustive]
2986pub struct CreateServerTlsPolicyRequest {
2987    /// Required. The parent resource of the ServerTlsPolicy. Must be in
2988    /// the format `projects/*/locations/{location}`.
2989    pub parent: std::string::String,
2990
2991    /// Required. Short name of the ServerTlsPolicy resource to be created. This value should
2992    /// be 1-63 characters long, containing only letters, numbers, hyphens, and
2993    /// underscores, and should not start with a number. E.g. "server_mtls_policy".
2994    pub server_tls_policy_id: std::string::String,
2995
2996    /// Required. ServerTlsPolicy resource to be created.
2997    pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
2998
2999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3000}
3001
3002impl CreateServerTlsPolicyRequest {
3003    pub fn new() -> Self {
3004        std::default::Default::default()
3005    }
3006
3007    /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
3008    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009        self.parent = v.into();
3010        self
3011    }
3012
3013    /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
3014    pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
3015        mut self,
3016        v: T,
3017    ) -> Self {
3018        self.server_tls_policy_id = v.into();
3019        self
3020    }
3021
3022    /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
3023    pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
3024    where
3025        T: std::convert::Into<crate::model::ServerTlsPolicy>,
3026    {
3027        self.server_tls_policy = std::option::Option::Some(v.into());
3028        self
3029    }
3030
3031    /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
3032    pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
3033    where
3034        T: std::convert::Into<crate::model::ServerTlsPolicy>,
3035    {
3036        self.server_tls_policy = v.map(|x| x.into());
3037        self
3038    }
3039}
3040
3041impl wkt::message::Message for CreateServerTlsPolicyRequest {
3042    fn typename() -> &'static str {
3043        "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
3044    }
3045}
3046
3047/// Request used by UpdateServerTlsPolicy method.
3048#[derive(Clone, Default, PartialEq)]
3049#[non_exhaustive]
3050pub struct UpdateServerTlsPolicyRequest {
3051    /// Optional. Field mask is used to specify the fields to be overwritten in the
3052    /// ServerTlsPolicy resource by the update.  The fields
3053    /// specified in the update_mask are relative to the resource, not
3054    /// the full request. A field will be overwritten if it is in the
3055    /// mask. If the user does not provide a mask then all fields will be
3056    /// overwritten.
3057    pub update_mask: std::option::Option<wkt::FieldMask>,
3058
3059    /// Required. Updated ServerTlsPolicy resource.
3060    pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
3061
3062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3063}
3064
3065impl UpdateServerTlsPolicyRequest {
3066    pub fn new() -> Self {
3067        std::default::Default::default()
3068    }
3069
3070    /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
3071    pub fn set_update_mask<T>(mut self, v: T) -> Self
3072    where
3073        T: std::convert::Into<wkt::FieldMask>,
3074    {
3075        self.update_mask = std::option::Option::Some(v.into());
3076        self
3077    }
3078
3079    /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
3080    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3081    where
3082        T: std::convert::Into<wkt::FieldMask>,
3083    {
3084        self.update_mask = v.map(|x| x.into());
3085        self
3086    }
3087
3088    /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
3089    pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
3090    where
3091        T: std::convert::Into<crate::model::ServerTlsPolicy>,
3092    {
3093        self.server_tls_policy = std::option::Option::Some(v.into());
3094        self
3095    }
3096
3097    /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
3098    pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
3099    where
3100        T: std::convert::Into<crate::model::ServerTlsPolicy>,
3101    {
3102        self.server_tls_policy = v.map(|x| x.into());
3103        self
3104    }
3105}
3106
3107impl wkt::message::Message for UpdateServerTlsPolicyRequest {
3108    fn typename() -> &'static str {
3109        "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
3110    }
3111}
3112
3113/// Request used by the DeleteServerTlsPolicy method.
3114#[derive(Clone, Default, PartialEq)]
3115#[non_exhaustive]
3116pub struct DeleteServerTlsPolicyRequest {
3117    /// Required. A name of the ServerTlsPolicy to delete. Must be in
3118    /// the format `projects/*/locations/{location}/serverTlsPolicies/*`.
3119    pub name: std::string::String,
3120
3121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3122}
3123
3124impl DeleteServerTlsPolicyRequest {
3125    pub fn new() -> Self {
3126        std::default::Default::default()
3127    }
3128
3129    /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
3130    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131        self.name = v.into();
3132        self
3133    }
3134}
3135
3136impl wkt::message::Message for DeleteServerTlsPolicyRequest {
3137    fn typename() -> &'static str {
3138        "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
3139    }
3140}
3141
3142/// Specification of the GRPC Endpoint.
3143#[derive(Clone, Default, PartialEq)]
3144#[non_exhaustive]
3145pub struct GrpcEndpoint {
3146    /// Required. The target URI of the gRPC endpoint. Only UDS path is supported, and
3147    /// should start with "unix:".
3148    pub target_uri: std::string::String,
3149
3150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3151}
3152
3153impl GrpcEndpoint {
3154    pub fn new() -> Self {
3155        std::default::Default::default()
3156    }
3157
3158    /// Sets the value of [target_uri][crate::model::GrpcEndpoint::target_uri].
3159    pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160        self.target_uri = v.into();
3161        self
3162    }
3163}
3164
3165impl wkt::message::Message for GrpcEndpoint {
3166    fn typename() -> &'static str {
3167        "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
3168    }
3169}
3170
3171/// Specification of ValidationCA. Defines the mechanism to obtain the
3172/// Certificate Authority certificate to validate the peer certificate.
3173#[derive(Clone, Default, PartialEq)]
3174#[non_exhaustive]
3175pub struct ValidationCA {
3176    /// The type of certificate provider which provides the CA certificate.
3177    pub r#type: std::option::Option<crate::model::validation_ca::Type>,
3178
3179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3180}
3181
3182impl ValidationCA {
3183    pub fn new() -> Self {
3184        std::default::Default::default()
3185    }
3186
3187    /// Sets the value of [r#type][crate::model::ValidationCA::type].
3188    ///
3189    /// Note that all the setters affecting `r#type` are mutually
3190    /// exclusive.
3191    pub fn set_type<
3192        T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
3193    >(
3194        mut self,
3195        v: T,
3196    ) -> Self {
3197        self.r#type = v.into();
3198        self
3199    }
3200
3201    /// The value of [r#type][crate::model::ValidationCA::r#type]
3202    /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
3203    /// holds a different branch.
3204    pub fn grpc_endpoint(
3205        &self,
3206    ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
3207        #[allow(unreachable_patterns)]
3208        self.r#type.as_ref().and_then(|v| match v {
3209            crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
3210            _ => std::option::Option::None,
3211        })
3212    }
3213
3214    /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
3215    /// to hold a `GrpcEndpoint`.
3216    ///
3217    /// Note that all the setters affecting `r#type` are
3218    /// mutually exclusive.
3219    pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
3220        mut self,
3221        v: T,
3222    ) -> Self {
3223        self.r#type =
3224            std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
3225        self
3226    }
3227
3228    /// The value of [r#type][crate::model::ValidationCA::r#type]
3229    /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
3230    /// holds a different branch.
3231    pub fn certificate_provider_instance(
3232        &self,
3233    ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
3234        #[allow(unreachable_patterns)]
3235        self.r#type.as_ref().and_then(|v| match v {
3236            crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
3237                std::option::Option::Some(v)
3238            }
3239            _ => std::option::Option::None,
3240        })
3241    }
3242
3243    /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
3244    /// to hold a `CertificateProviderInstance`.
3245    ///
3246    /// Note that all the setters affecting `r#type` are
3247    /// mutually exclusive.
3248    pub fn set_certificate_provider_instance<
3249        T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
3250    >(
3251        mut self,
3252        v: T,
3253    ) -> Self {
3254        self.r#type = std::option::Option::Some(
3255            crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
3256        );
3257        self
3258    }
3259}
3260
3261impl wkt::message::Message for ValidationCA {
3262    fn typename() -> &'static str {
3263        "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
3264    }
3265}
3266
3267/// Defines additional types related to [ValidationCA].
3268pub mod validation_ca {
3269    #[allow(unused_imports)]
3270    use super::*;
3271
3272    /// The type of certificate provider which provides the CA certificate.
3273    #[derive(Clone, Debug, PartialEq)]
3274    #[non_exhaustive]
3275    pub enum Type {
3276        /// gRPC specific configuration to access the gRPC server to
3277        /// obtain the CA certificate.
3278        GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
3279        /// The certificate provider instance specification that will be passed to
3280        /// the data plane, which will be used to load necessary credential
3281        /// information.
3282        CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
3283    }
3284}
3285
3286/// Specification of a TLS certificate provider instance. Workloads may have one
3287/// or more CertificateProvider instances (plugins) and one of them is enabled
3288/// and configured by specifying this message. Workloads use the values from this
3289/// message to locate and load the CertificateProvider instance configuration.
3290#[derive(Clone, Default, PartialEq)]
3291#[non_exhaustive]
3292pub struct CertificateProviderInstance {
3293    /// Required. Plugin instance name, used to locate and load CertificateProvider instance
3294    /// configuration. Set to "google_cloud_private_spiffe" to use Certificate
3295    /// Authority Service certificate provider instance.
3296    pub plugin_instance: std::string::String,
3297
3298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3299}
3300
3301impl CertificateProviderInstance {
3302    pub fn new() -> Self {
3303        std::default::Default::default()
3304    }
3305
3306    /// Sets the value of [plugin_instance][crate::model::CertificateProviderInstance::plugin_instance].
3307    pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3308        self.plugin_instance = v.into();
3309        self
3310    }
3311}
3312
3313impl wkt::message::Message for CertificateProviderInstance {
3314    fn typename() -> &'static str {
3315        "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
3316    }
3317}
3318
3319/// Specification of certificate provider. Defines the mechanism to obtain the
3320/// certificate and private key for peer to peer authentication.
3321#[derive(Clone, Default, PartialEq)]
3322#[non_exhaustive]
3323pub struct CertificateProvider {
3324    /// The type of certificate provider which provides the certificates and
3325    /// private keys.
3326    pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
3327
3328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3329}
3330
3331impl CertificateProvider {
3332    pub fn new() -> Self {
3333        std::default::Default::default()
3334    }
3335
3336    /// Sets the value of [r#type][crate::model::CertificateProvider::type].
3337    ///
3338    /// Note that all the setters affecting `r#type` are mutually
3339    /// exclusive.
3340    pub fn set_type<
3341        T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
3342    >(
3343        mut self,
3344        v: T,
3345    ) -> Self {
3346        self.r#type = v.into();
3347        self
3348    }
3349
3350    /// The value of [r#type][crate::model::CertificateProvider::r#type]
3351    /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
3352    /// holds a different branch.
3353    pub fn grpc_endpoint(
3354        &self,
3355    ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
3356        #[allow(unreachable_patterns)]
3357        self.r#type.as_ref().and_then(|v| match v {
3358            crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
3359                std::option::Option::Some(v)
3360            }
3361            _ => std::option::Option::None,
3362        })
3363    }
3364
3365    /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
3366    /// to hold a `GrpcEndpoint`.
3367    ///
3368    /// Note that all the setters affecting `r#type` are
3369    /// mutually exclusive.
3370    pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
3371        mut self,
3372        v: T,
3373    ) -> Self {
3374        self.r#type = std::option::Option::Some(
3375            crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
3376        );
3377        self
3378    }
3379
3380    /// The value of [r#type][crate::model::CertificateProvider::r#type]
3381    /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
3382    /// holds a different branch.
3383    pub fn certificate_provider_instance(
3384        &self,
3385    ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
3386        #[allow(unreachable_patterns)]
3387        self.r#type.as_ref().and_then(|v| match v {
3388            crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
3389                std::option::Option::Some(v)
3390            }
3391            _ => std::option::Option::None,
3392        })
3393    }
3394
3395    /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
3396    /// to hold a `CertificateProviderInstance`.
3397    ///
3398    /// Note that all the setters affecting `r#type` are
3399    /// mutually exclusive.
3400    pub fn set_certificate_provider_instance<
3401        T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
3402    >(
3403        mut self,
3404        v: T,
3405    ) -> Self {
3406        self.r#type = std::option::Option::Some(
3407            crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
3408        );
3409        self
3410    }
3411}
3412
3413impl wkt::message::Message for CertificateProvider {
3414    fn typename() -> &'static str {
3415        "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
3416    }
3417}
3418
3419/// Defines additional types related to [CertificateProvider].
3420pub mod certificate_provider {
3421    #[allow(unused_imports)]
3422    use super::*;
3423
3424    /// The type of certificate provider which provides the certificates and
3425    /// private keys.
3426    #[derive(Clone, Debug, PartialEq)]
3427    #[non_exhaustive]
3428    pub enum Type {
3429        /// gRPC specific configuration to access the gRPC server to
3430        /// obtain the cert and private key.
3431        GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
3432        /// The certificate provider instance specification that will be passed to
3433        /// the data plane, which will be used to load necessary credential
3434        /// information.
3435        CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
3436    }
3437}