google_cloud_networksecurity_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// AddressGroup is a resource that specifies how a collection of IP/DNS used
40/// in Firewall Policy.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct AddressGroup {
44 /// Required. Name of the AddressGroup resource. It matches pattern
45 /// `projects/*/locations/{location}/addressGroups/<address_group>`.
46 pub name: std::string::String,
47
48 /// Optional. Free-text description of the resource.
49 pub description: std::string::String,
50
51 /// Output only. The timestamp when the resource was created.
52 pub create_time: std::option::Option<wkt::Timestamp>,
53
54 /// Output only. The timestamp when the resource was updated.
55 pub update_time: std::option::Option<wkt::Timestamp>,
56
57 /// Optional. Set of label tags associated with the AddressGroup resource.
58 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60 /// Required. The type of the Address Group. Possible values are "IPv4" or
61 /// "IPV6".
62 pub r#type: crate::model::address_group::Type,
63
64 /// Optional. List of items.
65 pub items: std::vec::Vec<std::string::String>,
66
67 /// Required. Capacity of the Address Group
68 pub capacity: i32,
69
70 /// Output only. Server-defined fully-qualified URL for this resource.
71 pub self_link: std::string::String,
72
73 /// Optional. List of supported purposes of the Address Group.
74 pub purpose: std::vec::Vec<crate::model::address_group::Purpose>,
75
76 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
77}
78
79impl AddressGroup {
80 /// Creates a new default instance.
81 pub fn new() -> Self {
82 std::default::Default::default()
83 }
84
85 /// Sets the value of [name][crate::model::AddressGroup::name].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
90 /// # let project_id = "project_id";
91 /// # let location_id = "location_id";
92 /// # let address_group_id = "address_group_id";
93 /// let x = AddressGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
94 /// ```
95 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
96 self.name = v.into();
97 self
98 }
99
100 /// Sets the value of [description][crate::model::AddressGroup::description].
101 ///
102 /// # Example
103 /// ```ignore,no_run
104 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
105 /// let x = AddressGroup::new().set_description("example");
106 /// ```
107 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108 self.description = v.into();
109 self
110 }
111
112 /// Sets the value of [create_time][crate::model::AddressGroup::create_time].
113 ///
114 /// # Example
115 /// ```ignore,no_run
116 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
117 /// use wkt::Timestamp;
118 /// let x = AddressGroup::new().set_create_time(Timestamp::default()/* use setters */);
119 /// ```
120 pub fn set_create_time<T>(mut self, v: T) -> Self
121 where
122 T: std::convert::Into<wkt::Timestamp>,
123 {
124 self.create_time = std::option::Option::Some(v.into());
125 self
126 }
127
128 /// Sets or clears the value of [create_time][crate::model::AddressGroup::create_time].
129 ///
130 /// # Example
131 /// ```ignore,no_run
132 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
133 /// use wkt::Timestamp;
134 /// let x = AddressGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
135 /// let x = AddressGroup::new().set_or_clear_create_time(None::<Timestamp>);
136 /// ```
137 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
138 where
139 T: std::convert::Into<wkt::Timestamp>,
140 {
141 self.create_time = v.map(|x| x.into());
142 self
143 }
144
145 /// Sets the value of [update_time][crate::model::AddressGroup::update_time].
146 ///
147 /// # Example
148 /// ```ignore,no_run
149 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
150 /// use wkt::Timestamp;
151 /// let x = AddressGroup::new().set_update_time(Timestamp::default()/* use setters */);
152 /// ```
153 pub fn set_update_time<T>(mut self, v: T) -> Self
154 where
155 T: std::convert::Into<wkt::Timestamp>,
156 {
157 self.update_time = std::option::Option::Some(v.into());
158 self
159 }
160
161 /// Sets or clears the value of [update_time][crate::model::AddressGroup::update_time].
162 ///
163 /// # Example
164 /// ```ignore,no_run
165 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
166 /// use wkt::Timestamp;
167 /// let x = AddressGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
168 /// let x = AddressGroup::new().set_or_clear_update_time(None::<Timestamp>);
169 /// ```
170 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
171 where
172 T: std::convert::Into<wkt::Timestamp>,
173 {
174 self.update_time = v.map(|x| x.into());
175 self
176 }
177
178 /// Sets the value of [labels][crate::model::AddressGroup::labels].
179 ///
180 /// # Example
181 /// ```ignore,no_run
182 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
183 /// let x = AddressGroup::new().set_labels([
184 /// ("key0", "abc"),
185 /// ("key1", "xyz"),
186 /// ]);
187 /// ```
188 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
189 where
190 T: std::iter::IntoIterator<Item = (K, V)>,
191 K: std::convert::Into<std::string::String>,
192 V: std::convert::Into<std::string::String>,
193 {
194 use std::iter::Iterator;
195 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
196 self
197 }
198
199 /// Sets the value of [r#type][crate::model::AddressGroup::type].
200 ///
201 /// # Example
202 /// ```ignore,no_run
203 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
204 /// use google_cloud_networksecurity_v1::model::address_group::Type;
205 /// let x0 = AddressGroup::new().set_type(Type::Ipv4);
206 /// let x1 = AddressGroup::new().set_type(Type::Ipv6);
207 /// ```
208 pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
209 mut self,
210 v: T,
211 ) -> Self {
212 self.r#type = v.into();
213 self
214 }
215
216 /// Sets the value of [items][crate::model::AddressGroup::items].
217 ///
218 /// # Example
219 /// ```ignore,no_run
220 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
221 /// let x = AddressGroup::new().set_items(["a", "b", "c"]);
222 /// ```
223 pub fn set_items<T, V>(mut self, v: T) -> Self
224 where
225 T: std::iter::IntoIterator<Item = V>,
226 V: std::convert::Into<std::string::String>,
227 {
228 use std::iter::Iterator;
229 self.items = v.into_iter().map(|i| i.into()).collect();
230 self
231 }
232
233 /// Sets the value of [capacity][crate::model::AddressGroup::capacity].
234 ///
235 /// # Example
236 /// ```ignore,no_run
237 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
238 /// let x = AddressGroup::new().set_capacity(42);
239 /// ```
240 pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
241 self.capacity = v.into();
242 self
243 }
244
245 /// Sets the value of [self_link][crate::model::AddressGroup::self_link].
246 ///
247 /// # Example
248 /// ```ignore,no_run
249 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
250 /// let x = AddressGroup::new().set_self_link("example");
251 /// ```
252 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
253 self.self_link = v.into();
254 self
255 }
256
257 /// Sets the value of [purpose][crate::model::AddressGroup::purpose].
258 ///
259 /// # Example
260 /// ```ignore,no_run
261 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
262 /// use google_cloud_networksecurity_v1::model::address_group::Purpose;
263 /// let x = AddressGroup::new().set_purpose([
264 /// Purpose::Default,
265 /// Purpose::CloudArmor,
266 /// ]);
267 /// ```
268 pub fn set_purpose<T, V>(mut self, v: T) -> Self
269 where
270 T: std::iter::IntoIterator<Item = V>,
271 V: std::convert::Into<crate::model::address_group::Purpose>,
272 {
273 use std::iter::Iterator;
274 self.purpose = v.into_iter().map(|i| i.into()).collect();
275 self
276 }
277}
278
279impl wkt::message::Message for AddressGroup {
280 fn typename() -> &'static str {
281 "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
282 }
283}
284
285/// Defines additional types related to [AddressGroup].
286pub mod address_group {
287 #[allow(unused_imports)]
288 use super::*;
289
290 /// Possible type of the Address Group.
291 ///
292 /// # Working with unknown values
293 ///
294 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
295 /// additional enum variants at any time. Adding new variants is not considered
296 /// a breaking change. Applications should write their code in anticipation of:
297 ///
298 /// - New values appearing in future releases of the client library, **and**
299 /// - New values received dynamically, without application changes.
300 ///
301 /// Please consult the [Working with enums] section in the user guide for some
302 /// guidelines.
303 ///
304 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
305 #[derive(Clone, Debug, PartialEq)]
306 #[non_exhaustive]
307 pub enum Type {
308 /// Default value.
309 Unspecified,
310 /// IP v4 ranges.
311 Ipv4,
312 /// IP v6 ranges.
313 Ipv6,
314 /// If set, the enum was initialized with an unknown value.
315 ///
316 /// Applications can examine the value using [Type::value] or
317 /// [Type::name].
318 UnknownValue(r#type::UnknownValue),
319 }
320
321 #[doc(hidden)]
322 pub mod r#type {
323 #[allow(unused_imports)]
324 use super::*;
325 #[derive(Clone, Debug, PartialEq)]
326 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
327 }
328
329 impl Type {
330 /// Gets the enum value.
331 ///
332 /// Returns `None` if the enum contains an unknown value deserialized from
333 /// the string representation of enums.
334 pub fn value(&self) -> std::option::Option<i32> {
335 match self {
336 Self::Unspecified => std::option::Option::Some(0),
337 Self::Ipv4 => std::option::Option::Some(1),
338 Self::Ipv6 => std::option::Option::Some(2),
339 Self::UnknownValue(u) => u.0.value(),
340 }
341 }
342
343 /// Gets the enum value as a string.
344 ///
345 /// Returns `None` if the enum contains an unknown value deserialized from
346 /// the integer representation of enums.
347 pub fn name(&self) -> std::option::Option<&str> {
348 match self {
349 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
350 Self::Ipv4 => std::option::Option::Some("IPV4"),
351 Self::Ipv6 => std::option::Option::Some("IPV6"),
352 Self::UnknownValue(u) => u.0.name(),
353 }
354 }
355 }
356
357 impl std::default::Default for Type {
358 fn default() -> Self {
359 use std::convert::From;
360 Self::from(0)
361 }
362 }
363
364 impl std::fmt::Display for Type {
365 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
366 wkt::internal::display_enum(f, self.name(), self.value())
367 }
368 }
369
370 impl std::convert::From<i32> for Type {
371 fn from(value: i32) -> Self {
372 match value {
373 0 => Self::Unspecified,
374 1 => Self::Ipv4,
375 2 => Self::Ipv6,
376 _ => Self::UnknownValue(r#type::UnknownValue(
377 wkt::internal::UnknownEnumValue::Integer(value),
378 )),
379 }
380 }
381 }
382
383 impl std::convert::From<&str> for Type {
384 fn from(value: &str) -> Self {
385 use std::string::ToString;
386 match value {
387 "TYPE_UNSPECIFIED" => Self::Unspecified,
388 "IPV4" => Self::Ipv4,
389 "IPV6" => Self::Ipv6,
390 _ => Self::UnknownValue(r#type::UnknownValue(
391 wkt::internal::UnknownEnumValue::String(value.to_string()),
392 )),
393 }
394 }
395 }
396
397 impl serde::ser::Serialize for Type {
398 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
399 where
400 S: serde::Serializer,
401 {
402 match self {
403 Self::Unspecified => serializer.serialize_i32(0),
404 Self::Ipv4 => serializer.serialize_i32(1),
405 Self::Ipv6 => serializer.serialize_i32(2),
406 Self::UnknownValue(u) => u.0.serialize(serializer),
407 }
408 }
409 }
410
411 impl<'de> serde::de::Deserialize<'de> for Type {
412 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
413 where
414 D: serde::Deserializer<'de>,
415 {
416 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
417 ".google.cloud.networksecurity.v1.AddressGroup.Type",
418 ))
419 }
420 }
421
422 /// Purpose of the Address Group.
423 ///
424 /// # Working with unknown values
425 ///
426 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
427 /// additional enum variants at any time. Adding new variants is not considered
428 /// a breaking change. Applications should write their code in anticipation of:
429 ///
430 /// - New values appearing in future releases of the client library, **and**
431 /// - New values received dynamically, without application changes.
432 ///
433 /// Please consult the [Working with enums] section in the user guide for some
434 /// guidelines.
435 ///
436 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
437 #[derive(Clone, Debug, PartialEq)]
438 #[non_exhaustive]
439 pub enum Purpose {
440 /// Default value. Should never happen.
441 Unspecified,
442 /// Address Group is distributed to VMC, and is usable in Firewall Policies
443 /// and other systems that rely on VMC.
444 Default,
445 /// Address Group is usable in Cloud Armor.
446 CloudArmor,
447 /// If set, the enum was initialized with an unknown value.
448 ///
449 /// Applications can examine the value using [Purpose::value] or
450 /// [Purpose::name].
451 UnknownValue(purpose::UnknownValue),
452 }
453
454 #[doc(hidden)]
455 pub mod purpose {
456 #[allow(unused_imports)]
457 use super::*;
458 #[derive(Clone, Debug, PartialEq)]
459 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
460 }
461
462 impl Purpose {
463 /// Gets the enum value.
464 ///
465 /// Returns `None` if the enum contains an unknown value deserialized from
466 /// the string representation of enums.
467 pub fn value(&self) -> std::option::Option<i32> {
468 match self {
469 Self::Unspecified => std::option::Option::Some(0),
470 Self::Default => std::option::Option::Some(1),
471 Self::CloudArmor => std::option::Option::Some(2),
472 Self::UnknownValue(u) => u.0.value(),
473 }
474 }
475
476 /// Gets the enum value as a string.
477 ///
478 /// Returns `None` if the enum contains an unknown value deserialized from
479 /// the integer representation of enums.
480 pub fn name(&self) -> std::option::Option<&str> {
481 match self {
482 Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
483 Self::Default => std::option::Option::Some("DEFAULT"),
484 Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
485 Self::UnknownValue(u) => u.0.name(),
486 }
487 }
488 }
489
490 impl std::default::Default for Purpose {
491 fn default() -> Self {
492 use std::convert::From;
493 Self::from(0)
494 }
495 }
496
497 impl std::fmt::Display for Purpose {
498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
499 wkt::internal::display_enum(f, self.name(), self.value())
500 }
501 }
502
503 impl std::convert::From<i32> for Purpose {
504 fn from(value: i32) -> Self {
505 match value {
506 0 => Self::Unspecified,
507 1 => Self::Default,
508 2 => Self::CloudArmor,
509 _ => Self::UnknownValue(purpose::UnknownValue(
510 wkt::internal::UnknownEnumValue::Integer(value),
511 )),
512 }
513 }
514 }
515
516 impl std::convert::From<&str> for Purpose {
517 fn from(value: &str) -> Self {
518 use std::string::ToString;
519 match value {
520 "PURPOSE_UNSPECIFIED" => Self::Unspecified,
521 "DEFAULT" => Self::Default,
522 "CLOUD_ARMOR" => Self::CloudArmor,
523 _ => Self::UnknownValue(purpose::UnknownValue(
524 wkt::internal::UnknownEnumValue::String(value.to_string()),
525 )),
526 }
527 }
528 }
529
530 impl serde::ser::Serialize for Purpose {
531 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
532 where
533 S: serde::Serializer,
534 {
535 match self {
536 Self::Unspecified => serializer.serialize_i32(0),
537 Self::Default => serializer.serialize_i32(1),
538 Self::CloudArmor => serializer.serialize_i32(2),
539 Self::UnknownValue(u) => u.0.serialize(serializer),
540 }
541 }
542 }
543
544 impl<'de> serde::de::Deserialize<'de> for Purpose {
545 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
546 where
547 D: serde::Deserializer<'de>,
548 {
549 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
550 ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
551 ))
552 }
553 }
554}
555
556/// Request used with the ListAddressGroups method.
557#[derive(Clone, Default, PartialEq)]
558#[non_exhaustive]
559pub struct ListAddressGroupsRequest {
560 /// Required. The project and location from which the AddressGroups
561 /// should be listed, specified in the format
562 /// `projects/*/locations/{location}`.
563 pub parent: std::string::String,
564
565 /// Maximum number of AddressGroups to return per call.
566 pub page_size: i32,
567
568 /// The value returned by the last
569 /// `ListAddressGroupsResponse` Indicates that this is a
570 /// continuation of a prior `ListAddressGroups` call, and
571 /// that the system should return the next page of data.
572 pub page_token: std::string::String,
573
574 /// Optional. If true, allow partial responses for multi-regional Aggregated
575 /// List requests.
576 pub return_partial_success: bool,
577
578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
579}
580
581impl ListAddressGroupsRequest {
582 /// Creates a new default instance.
583 pub fn new() -> Self {
584 std::default::Default::default()
585 }
586
587 /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
588 ///
589 /// # Example
590 /// ```ignore,no_run
591 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
592 /// let x = ListAddressGroupsRequest::new().set_parent("example");
593 /// ```
594 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
595 self.parent = v.into();
596 self
597 }
598
599 /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
600 ///
601 /// # Example
602 /// ```ignore,no_run
603 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
604 /// let x = ListAddressGroupsRequest::new().set_page_size(42);
605 /// ```
606 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
607 self.page_size = v.into();
608 self
609 }
610
611 /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
612 ///
613 /// # Example
614 /// ```ignore,no_run
615 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
616 /// let x = ListAddressGroupsRequest::new().set_page_token("example");
617 /// ```
618 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
619 self.page_token = v.into();
620 self
621 }
622
623 /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
624 ///
625 /// # Example
626 /// ```ignore,no_run
627 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
628 /// let x = ListAddressGroupsRequest::new().set_return_partial_success(true);
629 /// ```
630 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
631 self.return_partial_success = v.into();
632 self
633 }
634}
635
636impl wkt::message::Message for ListAddressGroupsRequest {
637 fn typename() -> &'static str {
638 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
639 }
640}
641
642/// Response returned by the ListAddressGroups method.
643#[derive(Clone, Default, PartialEq)]
644#[non_exhaustive]
645pub struct ListAddressGroupsResponse {
646 /// List of AddressGroups resources.
647 pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
648
649 /// If there might be more results than those appearing in this response, then
650 /// `next_page_token` is included. To get the next set of results, call this
651 /// method again using the value of `next_page_token` as `page_token`.
652 pub next_page_token: std::string::String,
653
654 /// Locations that could not be reached.
655 pub unreachable: std::vec::Vec<std::string::String>,
656
657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
658}
659
660impl ListAddressGroupsResponse {
661 /// Creates a new default instance.
662 pub fn new() -> Self {
663 std::default::Default::default()
664 }
665
666 /// Sets the value of [address_groups][crate::model::ListAddressGroupsResponse::address_groups].
667 ///
668 /// # Example
669 /// ```ignore,no_run
670 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
671 /// use google_cloud_networksecurity_v1::model::AddressGroup;
672 /// let x = ListAddressGroupsResponse::new()
673 /// .set_address_groups([
674 /// AddressGroup::default()/* use setters */,
675 /// AddressGroup::default()/* use (different) setters */,
676 /// ]);
677 /// ```
678 pub fn set_address_groups<T, V>(mut self, v: T) -> Self
679 where
680 T: std::iter::IntoIterator<Item = V>,
681 V: std::convert::Into<crate::model::AddressGroup>,
682 {
683 use std::iter::Iterator;
684 self.address_groups = v.into_iter().map(|i| i.into()).collect();
685 self
686 }
687
688 /// Sets the value of [next_page_token][crate::model::ListAddressGroupsResponse::next_page_token].
689 ///
690 /// # Example
691 /// ```ignore,no_run
692 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
693 /// let x = ListAddressGroupsResponse::new().set_next_page_token("example");
694 /// ```
695 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696 self.next_page_token = v.into();
697 self
698 }
699
700 /// Sets the value of [unreachable][crate::model::ListAddressGroupsResponse::unreachable].
701 ///
702 /// # Example
703 /// ```ignore,no_run
704 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
705 /// let x = ListAddressGroupsResponse::new().set_unreachable(["a", "b", "c"]);
706 /// ```
707 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
708 where
709 T: std::iter::IntoIterator<Item = V>,
710 V: std::convert::Into<std::string::String>,
711 {
712 use std::iter::Iterator;
713 self.unreachable = v.into_iter().map(|i| i.into()).collect();
714 self
715 }
716}
717
718impl wkt::message::Message for ListAddressGroupsResponse {
719 fn typename() -> &'static str {
720 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
721 }
722}
723
724#[doc(hidden)]
725impl google_cloud_gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
726 type PageItem = crate::model::AddressGroup;
727
728 fn items(self) -> std::vec::Vec<Self::PageItem> {
729 self.address_groups
730 }
731
732 fn next_page_token(&self) -> std::string::String {
733 use std::clone::Clone;
734 self.next_page_token.clone()
735 }
736}
737
738/// Request used by the GetAddressGroup method.
739#[derive(Clone, Default, PartialEq)]
740#[non_exhaustive]
741pub struct GetAddressGroupRequest {
742 /// Required. A name of the AddressGroup to get. Must be in the format
743 /// `projects/*/locations/{location}/addressGroups/*`.
744 pub name: std::string::String,
745
746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
747}
748
749impl GetAddressGroupRequest {
750 /// Creates a new default instance.
751 pub fn new() -> Self {
752 std::default::Default::default()
753 }
754
755 /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
756 ///
757 /// # Example
758 /// ```ignore,no_run
759 /// # use google_cloud_networksecurity_v1::model::GetAddressGroupRequest;
760 /// # let project_id = "project_id";
761 /// # let location_id = "location_id";
762 /// # let address_group_id = "address_group_id";
763 /// let x = GetAddressGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
764 /// ```
765 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
766 self.name = v.into();
767 self
768 }
769}
770
771impl wkt::message::Message for GetAddressGroupRequest {
772 fn typename() -> &'static str {
773 "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
774 }
775}
776
777/// Request used by the CreateAddressGroup method.
778#[derive(Clone, Default, PartialEq)]
779#[non_exhaustive]
780pub struct CreateAddressGroupRequest {
781 /// Required. The parent resource of the AddressGroup. Must be in the
782 /// format `projects/*/locations/{location}`.
783 pub parent: std::string::String,
784
785 /// Required. Short name of the AddressGroup resource to be created.
786 /// This value should be 1-63 characters long, containing only
787 /// letters, numbers, hyphens, and underscores, and should not start
788 /// with a number. E.g. "authz_policy".
789 pub address_group_id: std::string::String,
790
791 /// Required. AddressGroup resource to be created.
792 pub address_group: std::option::Option<crate::model::AddressGroup>,
793
794 /// Optional. An optional request ID to identify requests. Specify a unique
795 /// request ID so that if you must retry your request, the server will know to
796 /// ignore the request if it has already been completed. The server will
797 /// guarantee that for at least 60 minutes since the first request.
798 ///
799 /// For example, consider a situation where you make an initial request and
800 /// the request times out. If you make the request again with the same request
801 /// ID, the server can check if original operation with the same request ID
802 /// was received, and if so, will ignore the second request. This prevents
803 /// clients from accidentally creating duplicate commitments.
804 ///
805 /// The request ID must be a valid UUID with the exception that zero UUID is
806 /// not supported (00000000-0000-0000-0000-000000000000).
807 pub request_id: std::string::String,
808
809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
810}
811
812impl CreateAddressGroupRequest {
813 /// Creates a new default instance.
814 pub fn new() -> Self {
815 std::default::Default::default()
816 }
817
818 /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
819 ///
820 /// # Example
821 /// ```ignore,no_run
822 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
823 /// # let project_id = "project_id";
824 /// # let location_id = "location_id";
825 /// let x = CreateAddressGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
826 /// ```
827 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
828 self.parent = v.into();
829 self
830 }
831
832 /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
833 ///
834 /// # Example
835 /// ```ignore,no_run
836 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
837 /// let x = CreateAddressGroupRequest::new().set_address_group_id("example");
838 /// ```
839 pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
840 mut self,
841 v: T,
842 ) -> Self {
843 self.address_group_id = v.into();
844 self
845 }
846
847 /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
848 ///
849 /// # Example
850 /// ```ignore,no_run
851 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
852 /// use google_cloud_networksecurity_v1::model::AddressGroup;
853 /// let x = CreateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
854 /// ```
855 pub fn set_address_group<T>(mut self, v: T) -> Self
856 where
857 T: std::convert::Into<crate::model::AddressGroup>,
858 {
859 self.address_group = std::option::Option::Some(v.into());
860 self
861 }
862
863 /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
864 ///
865 /// # Example
866 /// ```ignore,no_run
867 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
868 /// use google_cloud_networksecurity_v1::model::AddressGroup;
869 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
870 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
871 /// ```
872 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
873 where
874 T: std::convert::Into<crate::model::AddressGroup>,
875 {
876 self.address_group = v.map(|x| x.into());
877 self
878 }
879
880 /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
881 ///
882 /// # Example
883 /// ```ignore,no_run
884 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
885 /// let x = CreateAddressGroupRequest::new().set_request_id("example");
886 /// ```
887 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
888 self.request_id = v.into();
889 self
890 }
891}
892
893impl wkt::message::Message for CreateAddressGroupRequest {
894 fn typename() -> &'static str {
895 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
896 }
897}
898
899/// Request used by the UpdateAddressGroup method.
900#[derive(Clone, Default, PartialEq)]
901#[non_exhaustive]
902pub struct UpdateAddressGroupRequest {
903 /// Optional. Field mask is used to specify the fields to be overwritten in the
904 /// AddressGroup resource by the update.
905 /// The fields specified in the update_mask are relative to the resource, not
906 /// the full request. A field will be overwritten if it is in the mask. If the
907 /// user does not provide a mask then all fields will be overwritten.
908 pub update_mask: std::option::Option<wkt::FieldMask>,
909
910 /// Required. Updated AddressGroup resource.
911 pub address_group: std::option::Option<crate::model::AddressGroup>,
912
913 /// Optional. An optional request ID to identify requests. Specify a unique
914 /// request ID so that if you must retry your request, the server will know to
915 /// ignore the request if it has already been completed. The server will
916 /// guarantee that for at least 60 minutes since the first request.
917 ///
918 /// For example, consider a situation where you make an initial request and
919 /// the request times out. If you make the request again with the same request
920 /// ID, the server can check if original operation with the same request ID
921 /// was received, and if so, will ignore the second request. This prevents
922 /// clients from accidentally creating duplicate commitments.
923 ///
924 /// The request ID must be a valid UUID with the exception that zero UUID is
925 /// not supported (00000000-0000-0000-0000-000000000000).
926 pub request_id: std::string::String,
927
928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
929}
930
931impl UpdateAddressGroupRequest {
932 /// Creates a new default instance.
933 pub fn new() -> Self {
934 std::default::Default::default()
935 }
936
937 /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
938 ///
939 /// # Example
940 /// ```ignore,no_run
941 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
942 /// use wkt::FieldMask;
943 /// let x = UpdateAddressGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
944 /// ```
945 pub fn set_update_mask<T>(mut self, v: T) -> Self
946 where
947 T: std::convert::Into<wkt::FieldMask>,
948 {
949 self.update_mask = std::option::Option::Some(v.into());
950 self
951 }
952
953 /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
954 ///
955 /// # Example
956 /// ```ignore,no_run
957 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
958 /// use wkt::FieldMask;
959 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
960 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
961 /// ```
962 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
963 where
964 T: std::convert::Into<wkt::FieldMask>,
965 {
966 self.update_mask = v.map(|x| x.into());
967 self
968 }
969
970 /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
971 ///
972 /// # Example
973 /// ```ignore,no_run
974 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
975 /// use google_cloud_networksecurity_v1::model::AddressGroup;
976 /// let x = UpdateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
977 /// ```
978 pub fn set_address_group<T>(mut self, v: T) -> Self
979 where
980 T: std::convert::Into<crate::model::AddressGroup>,
981 {
982 self.address_group = std::option::Option::Some(v.into());
983 self
984 }
985
986 /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
987 ///
988 /// # Example
989 /// ```ignore,no_run
990 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
991 /// use google_cloud_networksecurity_v1::model::AddressGroup;
992 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
993 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
994 /// ```
995 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
996 where
997 T: std::convert::Into<crate::model::AddressGroup>,
998 {
999 self.address_group = v.map(|x| x.into());
1000 self
1001 }
1002
1003 /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
1004 ///
1005 /// # Example
1006 /// ```ignore,no_run
1007 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
1008 /// let x = UpdateAddressGroupRequest::new().set_request_id("example");
1009 /// ```
1010 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.request_id = v.into();
1012 self
1013 }
1014}
1015
1016impl wkt::message::Message for UpdateAddressGroupRequest {
1017 fn typename() -> &'static str {
1018 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
1019 }
1020}
1021
1022/// Request used by the DeleteAddressGroup method.
1023#[derive(Clone, Default, PartialEq)]
1024#[non_exhaustive]
1025pub struct DeleteAddressGroupRequest {
1026 /// Required. A name of the AddressGroup to delete. Must be in the format
1027 /// `projects/*/locations/{location}/addressGroups/*`.
1028 pub name: std::string::String,
1029
1030 /// Optional. An optional request ID to identify requests. Specify a unique
1031 /// request ID so that if you must retry your request, the server will know to
1032 /// ignore the request if it has already been completed. The server will
1033 /// guarantee that for at least 60 minutes since the first request.
1034 ///
1035 /// For example, consider a situation where you make an initial request and
1036 /// the request times out. If you make the request again with the same request
1037 /// ID, the server can check if original operation with the same request ID
1038 /// was received, and if so, will ignore the second request. This prevents
1039 /// clients from accidentally creating duplicate commitments.
1040 ///
1041 /// The request ID must be a valid UUID with the exception that zero UUID is
1042 /// not supported (00000000-0000-0000-0000-000000000000).
1043 pub request_id: std::string::String,
1044
1045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1046}
1047
1048impl DeleteAddressGroupRequest {
1049 /// Creates a new default instance.
1050 pub fn new() -> Self {
1051 std::default::Default::default()
1052 }
1053
1054 /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1055 ///
1056 /// # Example
1057 /// ```ignore,no_run
1058 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1059 /// # let project_id = "project_id";
1060 /// # let location_id = "location_id";
1061 /// # let address_group_id = "address_group_id";
1062 /// let x = DeleteAddressGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1063 /// ```
1064 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1065 self.name = v.into();
1066 self
1067 }
1068
1069 /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1074 /// let x = DeleteAddressGroupRequest::new().set_request_id("example");
1075 /// ```
1076 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1077 self.request_id = v.into();
1078 self
1079 }
1080}
1081
1082impl wkt::message::Message for DeleteAddressGroupRequest {
1083 fn typename() -> &'static str {
1084 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
1085 }
1086}
1087
1088/// Request used by the AddAddressGroupItems method.
1089#[derive(Clone, Default, PartialEq)]
1090#[non_exhaustive]
1091pub struct AddAddressGroupItemsRequest {
1092 /// Required. A name of the AddressGroup to add items to. Must be in the format
1093 /// `projects|organization/*/locations/{location}/addressGroups/*`.
1094 pub address_group: std::string::String,
1095
1096 /// Required. List of items to add.
1097 pub items: std::vec::Vec<std::string::String>,
1098
1099 /// Optional. An optional request ID to identify requests. Specify a unique
1100 /// request ID so that if you must retry your request, the server will know to
1101 /// ignore the request if it has already been completed. The server will
1102 /// guarantee that for at least 60 minutes since the first request.
1103 ///
1104 /// For example, consider a situation where you make an initial request and
1105 /// the request times out. If you make the request again with the same request
1106 /// ID, the server can check if original operation with the same request ID
1107 /// was received, and if so, will ignore the second request. This prevents
1108 /// clients from accidentally creating duplicate commitments.
1109 ///
1110 /// The request ID must be a valid UUID with the exception that zero UUID is
1111 /// not supported (00000000-0000-0000-0000-000000000000).
1112 pub request_id: std::string::String,
1113
1114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1115}
1116
1117impl AddAddressGroupItemsRequest {
1118 /// Creates a new default instance.
1119 pub fn new() -> Self {
1120 std::default::Default::default()
1121 }
1122
1123 /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
1124 ///
1125 /// # Example
1126 /// ```ignore,no_run
1127 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1128 /// # let project_id = "project_id";
1129 /// # let location_id = "location_id";
1130 /// # let address_group_id = "address_group_id";
1131 /// let x = AddAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1132 /// ```
1133 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1134 self.address_group = v.into();
1135 self
1136 }
1137
1138 /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
1139 ///
1140 /// # Example
1141 /// ```ignore,no_run
1142 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1143 /// let x = AddAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1144 /// ```
1145 pub fn set_items<T, V>(mut self, v: T) -> Self
1146 where
1147 T: std::iter::IntoIterator<Item = V>,
1148 V: std::convert::Into<std::string::String>,
1149 {
1150 use std::iter::Iterator;
1151 self.items = v.into_iter().map(|i| i.into()).collect();
1152 self
1153 }
1154
1155 /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
1156 ///
1157 /// # Example
1158 /// ```ignore,no_run
1159 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1160 /// let x = AddAddressGroupItemsRequest::new().set_request_id("example");
1161 /// ```
1162 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.request_id = v.into();
1164 self
1165 }
1166}
1167
1168impl wkt::message::Message for AddAddressGroupItemsRequest {
1169 fn typename() -> &'static str {
1170 "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
1171 }
1172}
1173
1174/// Request used by the RemoveAddressGroupItems method.
1175#[derive(Clone, Default, PartialEq)]
1176#[non_exhaustive]
1177pub struct RemoveAddressGroupItemsRequest {
1178 /// Required. A name of the AddressGroup to remove items from. Must be in the
1179 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1180 pub address_group: std::string::String,
1181
1182 /// Required. List of items to remove.
1183 pub items: std::vec::Vec<std::string::String>,
1184
1185 /// Optional. An optional request ID to identify requests. Specify a unique
1186 /// request ID so that if you must retry your request, the server will know to
1187 /// ignore the request if it has already been completed. The server will
1188 /// guarantee that for at least 60 minutes since the first request.
1189 ///
1190 /// For example, consider a situation where you make an initial request and
1191 /// the request times out. If you make the request again with the same request
1192 /// ID, the server can check if original operation with the same request ID
1193 /// was received, and if so, will ignore the second request. This prevents
1194 /// clients from accidentally creating duplicate commitments.
1195 ///
1196 /// The request ID must be a valid UUID with the exception that zero UUID is
1197 /// not supported (00000000-0000-0000-0000-000000000000).
1198 pub request_id: std::string::String,
1199
1200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1201}
1202
1203impl RemoveAddressGroupItemsRequest {
1204 /// Creates a new default instance.
1205 pub fn new() -> Self {
1206 std::default::Default::default()
1207 }
1208
1209 /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
1210 ///
1211 /// # Example
1212 /// ```ignore,no_run
1213 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1214 /// # let project_id = "project_id";
1215 /// # let location_id = "location_id";
1216 /// # let address_group_id = "address_group_id";
1217 /// let x = RemoveAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1218 /// ```
1219 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1220 self.address_group = v.into();
1221 self
1222 }
1223
1224 /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
1225 ///
1226 /// # Example
1227 /// ```ignore,no_run
1228 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1229 /// let x = RemoveAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1230 /// ```
1231 pub fn set_items<T, V>(mut self, v: T) -> Self
1232 where
1233 T: std::iter::IntoIterator<Item = V>,
1234 V: std::convert::Into<std::string::String>,
1235 {
1236 use std::iter::Iterator;
1237 self.items = v.into_iter().map(|i| i.into()).collect();
1238 self
1239 }
1240
1241 /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
1242 ///
1243 /// # Example
1244 /// ```ignore,no_run
1245 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1246 /// let x = RemoveAddressGroupItemsRequest::new().set_request_id("example");
1247 /// ```
1248 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1249 self.request_id = v.into();
1250 self
1251 }
1252}
1253
1254impl wkt::message::Message for RemoveAddressGroupItemsRequest {
1255 fn typename() -> &'static str {
1256 "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
1257 }
1258}
1259
1260/// Request used by the CloneAddressGroupItems method.
1261#[derive(Clone, Default, PartialEq)]
1262#[non_exhaustive]
1263pub struct CloneAddressGroupItemsRequest {
1264 /// Required. A name of the AddressGroup to clone items to. Must be in the
1265 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1266 pub address_group: std::string::String,
1267
1268 /// Required. Source address group to clone items from.
1269 pub source_address_group: std::string::String,
1270
1271 /// Optional. An optional request ID to identify requests. Specify a unique
1272 /// request ID so that if you must retry your request, the server will know to
1273 /// ignore the request if it has already been completed. The server will
1274 /// guarantee that for at least 60 minutes since the first request.
1275 ///
1276 /// For example, consider a situation where you make an initial request and
1277 /// the request times out. If you make the request again with the same request
1278 /// ID, the server can check if original operation with the same request ID
1279 /// was received, and if so, will ignore the second request. This prevents
1280 /// clients from accidentally creating duplicate commitments.
1281 ///
1282 /// The request ID must be a valid UUID with the exception that zero UUID is
1283 /// not supported (00000000-0000-0000-0000-000000000000).
1284 pub request_id: std::string::String,
1285
1286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1287}
1288
1289impl CloneAddressGroupItemsRequest {
1290 /// Creates a new default instance.
1291 pub fn new() -> Self {
1292 std::default::Default::default()
1293 }
1294
1295 /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
1296 ///
1297 /// # Example
1298 /// ```ignore,no_run
1299 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1300 /// # let project_id = "project_id";
1301 /// # let location_id = "location_id";
1302 /// # let address_group_id = "address_group_id";
1303 /// let x = CloneAddressGroupItemsRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1304 /// ```
1305 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.address_group = v.into();
1307 self
1308 }
1309
1310 /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
1311 ///
1312 /// # Example
1313 /// ```ignore,no_run
1314 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1315 /// # let project_id = "project_id";
1316 /// # let location_id = "location_id";
1317 /// # let address_group_id = "address_group_id";
1318 /// let x = CloneAddressGroupItemsRequest::new().set_source_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1319 /// ```
1320 pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1321 mut self,
1322 v: T,
1323 ) -> Self {
1324 self.source_address_group = v.into();
1325 self
1326 }
1327
1328 /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
1329 ///
1330 /// # Example
1331 /// ```ignore,no_run
1332 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1333 /// let x = CloneAddressGroupItemsRequest::new().set_request_id("example");
1334 /// ```
1335 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.request_id = v.into();
1337 self
1338 }
1339}
1340
1341impl wkt::message::Message for CloneAddressGroupItemsRequest {
1342 fn typename() -> &'static str {
1343 "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1344 }
1345}
1346
1347/// Request used by the ListAddressGroupReferences method.
1348#[derive(Clone, Default, PartialEq)]
1349#[non_exhaustive]
1350pub struct ListAddressGroupReferencesRequest {
1351 /// Required. A name of the AddressGroup to clone items to. Must be in the
1352 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1353 pub address_group: std::string::String,
1354
1355 /// The maximum number of references to return. If unspecified, server
1356 /// will pick an appropriate default. Server may return fewer items than
1357 /// requested. A caller should only rely on response's
1358 /// [next_page_token][google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]
1359 /// to determine if there are more AddressGroupUsers left to be queried.
1360 ///
1361 /// [google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]: crate::model::ListAddressGroupReferencesResponse::next_page_token
1362 pub page_size: i32,
1363
1364 /// The next_page_token value returned from a previous List request,
1365 /// if any.
1366 pub page_token: std::string::String,
1367
1368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1369}
1370
1371impl ListAddressGroupReferencesRequest {
1372 /// Creates a new default instance.
1373 pub fn new() -> Self {
1374 std::default::Default::default()
1375 }
1376
1377 /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1378 ///
1379 /// # Example
1380 /// ```ignore,no_run
1381 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1382 /// # let project_id = "project_id";
1383 /// # let location_id = "location_id";
1384 /// # let address_group_id = "address_group_id";
1385 /// let x = ListAddressGroupReferencesRequest::new().set_address_group(format!("projects/{project_id}/locations/{location_id}/addressGroups/{address_group_id}"));
1386 /// ```
1387 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1388 self.address_group = v.into();
1389 self
1390 }
1391
1392 /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1393 ///
1394 /// # Example
1395 /// ```ignore,no_run
1396 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1397 /// let x = ListAddressGroupReferencesRequest::new().set_page_size(42);
1398 /// ```
1399 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1400 self.page_size = v.into();
1401 self
1402 }
1403
1404 /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1405 ///
1406 /// # Example
1407 /// ```ignore,no_run
1408 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1409 /// let x = ListAddressGroupReferencesRequest::new().set_page_token("example");
1410 /// ```
1411 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1412 self.page_token = v.into();
1413 self
1414 }
1415}
1416
1417impl wkt::message::Message for ListAddressGroupReferencesRequest {
1418 fn typename() -> &'static str {
1419 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1420 }
1421}
1422
1423/// Response of the ListAddressGroupReferences method.
1424#[derive(Clone, Default, PartialEq)]
1425#[non_exhaustive]
1426pub struct ListAddressGroupReferencesResponse {
1427 /// A list of references that matches the specified filter in the request.
1428 pub address_group_references:
1429 std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1430
1431 /// If there might be more results than those appearing in this response, then
1432 /// `next_page_token` is included. To get the next set of results, call this
1433 /// method again using the value of `next_page_token` as `page_token`.
1434 pub next_page_token: std::string::String,
1435
1436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1437}
1438
1439impl ListAddressGroupReferencesResponse {
1440 /// Creates a new default instance.
1441 pub fn new() -> Self {
1442 std::default::Default::default()
1443 }
1444
1445 /// Sets the value of [address_group_references][crate::model::ListAddressGroupReferencesResponse::address_group_references].
1446 ///
1447 /// # Example
1448 /// ```ignore,no_run
1449 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1450 /// use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1451 /// let x = ListAddressGroupReferencesResponse::new()
1452 /// .set_address_group_references([
1453 /// AddressGroupReference::default()/* use setters */,
1454 /// AddressGroupReference::default()/* use (different) setters */,
1455 /// ]);
1456 /// ```
1457 pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1458 where
1459 T: std::iter::IntoIterator<Item = V>,
1460 V: std::convert::Into<
1461 crate::model::list_address_group_references_response::AddressGroupReference,
1462 >,
1463 {
1464 use std::iter::Iterator;
1465 self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1466 self
1467 }
1468
1469 /// Sets the value of [next_page_token][crate::model::ListAddressGroupReferencesResponse::next_page_token].
1470 ///
1471 /// # Example
1472 /// ```ignore,no_run
1473 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1474 /// let x = ListAddressGroupReferencesResponse::new().set_next_page_token("example");
1475 /// ```
1476 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1477 self.next_page_token = v.into();
1478 self
1479 }
1480}
1481
1482impl wkt::message::Message for ListAddressGroupReferencesResponse {
1483 fn typename() -> &'static str {
1484 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1485 }
1486}
1487
1488#[doc(hidden)]
1489impl google_cloud_gax::paginator::internal::PageableResponse
1490 for ListAddressGroupReferencesResponse
1491{
1492 type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1493
1494 fn items(self) -> std::vec::Vec<Self::PageItem> {
1495 self.address_group_references
1496 }
1497
1498 fn next_page_token(&self) -> std::string::String {
1499 use std::clone::Clone;
1500 self.next_page_token.clone()
1501 }
1502}
1503
1504/// Defines additional types related to [ListAddressGroupReferencesResponse].
1505pub mod list_address_group_references_response {
1506 #[allow(unused_imports)]
1507 use super::*;
1508
1509 /// The Reference of AddressGroup.
1510 #[derive(Clone, Default, PartialEq)]
1511 #[non_exhaustive]
1512 pub struct AddressGroupReference {
1513 /// FirewallPolicy that is using the Address Group.
1514 pub firewall_policy: std::string::String,
1515
1516 /// Cloud Armor SecurityPolicy that is using the Address Group.
1517 pub security_policy: std::string::String,
1518
1519 /// Rule priority of the FirewallPolicy that is using the Address Group.
1520 pub rule_priority: i32,
1521
1522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1523 }
1524
1525 impl AddressGroupReference {
1526 /// Creates a new default instance.
1527 pub fn new() -> Self {
1528 std::default::Default::default()
1529 }
1530
1531 /// Sets the value of [firewall_policy][crate::model::list_address_group_references_response::AddressGroupReference::firewall_policy].
1532 ///
1533 /// # Example
1534 /// ```ignore,no_run
1535 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1536 /// let x = AddressGroupReference::new().set_firewall_policy("example");
1537 /// ```
1538 pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1539 mut self,
1540 v: T,
1541 ) -> Self {
1542 self.firewall_policy = v.into();
1543 self
1544 }
1545
1546 /// Sets the value of [security_policy][crate::model::list_address_group_references_response::AddressGroupReference::security_policy].
1547 ///
1548 /// # Example
1549 /// ```ignore,no_run
1550 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1551 /// let x = AddressGroupReference::new().set_security_policy("example");
1552 /// ```
1553 pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1554 mut self,
1555 v: T,
1556 ) -> Self {
1557 self.security_policy = v.into();
1558 self
1559 }
1560
1561 /// Sets the value of [rule_priority][crate::model::list_address_group_references_response::AddressGroupReference::rule_priority].
1562 ///
1563 /// # Example
1564 /// ```ignore,no_run
1565 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1566 /// let x = AddressGroupReference::new().set_rule_priority(42);
1567 /// ```
1568 pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1569 self.rule_priority = v.into();
1570 self
1571 }
1572 }
1573
1574 impl wkt::message::Message for AddressGroupReference {
1575 fn typename() -> &'static str {
1576 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1577 }
1578 }
1579}
1580
1581/// AuthorizationPolicy is a resource that specifies how a server
1582/// should authorize incoming connections. This resource in itself does
1583/// not change the configuration unless it's attached to a target https
1584/// proxy or endpoint config selector resource.
1585#[derive(Clone, Default, PartialEq)]
1586#[non_exhaustive]
1587pub struct AuthorizationPolicy {
1588 /// Required. Name of the AuthorizationPolicy resource. It matches pattern
1589 /// `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
1590 pub name: std::string::String,
1591
1592 /// Optional. Free-text description of the resource.
1593 pub description: std::string::String,
1594
1595 /// Output only. The timestamp when the resource was created.
1596 pub create_time: std::option::Option<wkt::Timestamp>,
1597
1598 /// Output only. The timestamp when the resource was updated.
1599 pub update_time: std::option::Option<wkt::Timestamp>,
1600
1601 /// Optional. Set of label tags associated with the AuthorizationPolicy
1602 /// resource.
1603 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1604
1605 /// Required. The action to take when a rule match is found. Possible values
1606 /// are "ALLOW" or "DENY".
1607 pub action: crate::model::authorization_policy::Action,
1608
1609 /// Optional. List of rules to match. Note that at least one of the rules must
1610 /// match in order for the action specified in the 'action' field to be taken.
1611 /// A rule is a match if there is a matching source and destination. If left
1612 /// blank, the action specified in the `action` field will be applied on every
1613 /// request.
1614 pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1615
1616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1617}
1618
1619impl AuthorizationPolicy {
1620 /// Creates a new default instance.
1621 pub fn new() -> Self {
1622 std::default::Default::default()
1623 }
1624
1625 /// Sets the value of [name][crate::model::AuthorizationPolicy::name].
1626 ///
1627 /// # Example
1628 /// ```ignore,no_run
1629 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1630 /// # let project_id = "project_id";
1631 /// # let location_id = "location_id";
1632 /// # let authorization_policy_id = "authorization_policy_id";
1633 /// let x = AuthorizationPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
1634 /// ```
1635 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1636 self.name = v.into();
1637 self
1638 }
1639
1640 /// Sets the value of [description][crate::model::AuthorizationPolicy::description].
1641 ///
1642 /// # Example
1643 /// ```ignore,no_run
1644 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1645 /// let x = AuthorizationPolicy::new().set_description("example");
1646 /// ```
1647 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.description = v.into();
1649 self
1650 }
1651
1652 /// Sets the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1653 ///
1654 /// # Example
1655 /// ```ignore,no_run
1656 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1657 /// use wkt::Timestamp;
1658 /// let x = AuthorizationPolicy::new().set_create_time(Timestamp::default()/* use setters */);
1659 /// ```
1660 pub fn set_create_time<T>(mut self, v: T) -> Self
1661 where
1662 T: std::convert::Into<wkt::Timestamp>,
1663 {
1664 self.create_time = std::option::Option::Some(v.into());
1665 self
1666 }
1667
1668 /// Sets or clears the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1669 ///
1670 /// # Example
1671 /// ```ignore,no_run
1672 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1673 /// use wkt::Timestamp;
1674 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1675 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(None::<Timestamp>);
1676 /// ```
1677 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1678 where
1679 T: std::convert::Into<wkt::Timestamp>,
1680 {
1681 self.create_time = v.map(|x| x.into());
1682 self
1683 }
1684
1685 /// Sets the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1686 ///
1687 /// # Example
1688 /// ```ignore,no_run
1689 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1690 /// use wkt::Timestamp;
1691 /// let x = AuthorizationPolicy::new().set_update_time(Timestamp::default()/* use setters */);
1692 /// ```
1693 pub fn set_update_time<T>(mut self, v: T) -> Self
1694 where
1695 T: std::convert::Into<wkt::Timestamp>,
1696 {
1697 self.update_time = std::option::Option::Some(v.into());
1698 self
1699 }
1700
1701 /// Sets or clears the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1702 ///
1703 /// # Example
1704 /// ```ignore,no_run
1705 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1706 /// use wkt::Timestamp;
1707 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1708 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(None::<Timestamp>);
1709 /// ```
1710 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1711 where
1712 T: std::convert::Into<wkt::Timestamp>,
1713 {
1714 self.update_time = v.map(|x| x.into());
1715 self
1716 }
1717
1718 /// Sets the value of [labels][crate::model::AuthorizationPolicy::labels].
1719 ///
1720 /// # Example
1721 /// ```ignore,no_run
1722 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1723 /// let x = AuthorizationPolicy::new().set_labels([
1724 /// ("key0", "abc"),
1725 /// ("key1", "xyz"),
1726 /// ]);
1727 /// ```
1728 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1729 where
1730 T: std::iter::IntoIterator<Item = (K, V)>,
1731 K: std::convert::Into<std::string::String>,
1732 V: std::convert::Into<std::string::String>,
1733 {
1734 use std::iter::Iterator;
1735 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1736 self
1737 }
1738
1739 /// Sets the value of [action][crate::model::AuthorizationPolicy::action].
1740 ///
1741 /// # Example
1742 /// ```ignore,no_run
1743 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1744 /// use google_cloud_networksecurity_v1::model::authorization_policy::Action;
1745 /// let x0 = AuthorizationPolicy::new().set_action(Action::Allow);
1746 /// let x1 = AuthorizationPolicy::new().set_action(Action::Deny);
1747 /// ```
1748 pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1749 mut self,
1750 v: T,
1751 ) -> Self {
1752 self.action = v.into();
1753 self
1754 }
1755
1756 /// Sets the value of [rules][crate::model::AuthorizationPolicy::rules].
1757 ///
1758 /// # Example
1759 /// ```ignore,no_run
1760 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1761 /// use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1762 /// let x = AuthorizationPolicy::new()
1763 /// .set_rules([
1764 /// Rule::default()/* use setters */,
1765 /// Rule::default()/* use (different) setters */,
1766 /// ]);
1767 /// ```
1768 pub fn set_rules<T, V>(mut self, v: T) -> Self
1769 where
1770 T: std::iter::IntoIterator<Item = V>,
1771 V: std::convert::Into<crate::model::authorization_policy::Rule>,
1772 {
1773 use std::iter::Iterator;
1774 self.rules = v.into_iter().map(|i| i.into()).collect();
1775 self
1776 }
1777}
1778
1779impl wkt::message::Message for AuthorizationPolicy {
1780 fn typename() -> &'static str {
1781 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1782 }
1783}
1784
1785/// Defines additional types related to [AuthorizationPolicy].
1786pub mod authorization_policy {
1787 #[allow(unused_imports)]
1788 use super::*;
1789
1790 /// Specification of rules.
1791 #[derive(Clone, Default, PartialEq)]
1792 #[non_exhaustive]
1793 pub struct Rule {
1794 /// Optional. List of attributes for the traffic source. All of the sources
1795 /// must match. A source is a match if both principals and ip_blocks match.
1796 /// If not set, the action specified in the 'action' field will be applied
1797 /// without any rule checks for the source.
1798 pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1799
1800 /// Optional. List of attributes for the traffic destination. All of the
1801 /// destinations must match. A destination is a match if a request matches
1802 /// all the specified hosts, ports, methods and headers. If not set, the
1803 /// action specified in the 'action' field will be applied without any rule
1804 /// checks for the destination.
1805 pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1806
1807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1808 }
1809
1810 impl Rule {
1811 /// Creates a new default instance.
1812 pub fn new() -> Self {
1813 std::default::Default::default()
1814 }
1815
1816 /// Sets the value of [sources][crate::model::authorization_policy::Rule::sources].
1817 ///
1818 /// # Example
1819 /// ```ignore,no_run
1820 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1821 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1822 /// let x = Rule::new()
1823 /// .set_sources([
1824 /// Source::default()/* use setters */,
1825 /// Source::default()/* use (different) setters */,
1826 /// ]);
1827 /// ```
1828 pub fn set_sources<T, V>(mut self, v: T) -> Self
1829 where
1830 T: std::iter::IntoIterator<Item = V>,
1831 V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1832 {
1833 use std::iter::Iterator;
1834 self.sources = v.into_iter().map(|i| i.into()).collect();
1835 self
1836 }
1837
1838 /// Sets the value of [destinations][crate::model::authorization_policy::Rule::destinations].
1839 ///
1840 /// # Example
1841 /// ```ignore,no_run
1842 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1843 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1844 /// let x = Rule::new()
1845 /// .set_destinations([
1846 /// Destination::default()/* use setters */,
1847 /// Destination::default()/* use (different) setters */,
1848 /// ]);
1849 /// ```
1850 pub fn set_destinations<T, V>(mut self, v: T) -> Self
1851 where
1852 T: std::iter::IntoIterator<Item = V>,
1853 V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1854 {
1855 use std::iter::Iterator;
1856 self.destinations = v.into_iter().map(|i| i.into()).collect();
1857 self
1858 }
1859 }
1860
1861 impl wkt::message::Message for Rule {
1862 fn typename() -> &'static str {
1863 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1864 }
1865 }
1866
1867 /// Defines additional types related to [Rule].
1868 pub mod rule {
1869 #[allow(unused_imports)]
1870 use super::*;
1871
1872 /// Specification of traffic source attributes.
1873 #[derive(Clone, Default, PartialEq)]
1874 #[non_exhaustive]
1875 pub struct Source {
1876 /// Optional. List of peer identities to match for authorization. At least
1877 /// one principal should match. Each peer can be an exact match, or a
1878 /// prefix match (example, "namespace/*") or a suffix match (example,
1879 /// "*/service-account") or a presence match "*". Authorization based on
1880 /// the principal name without certificate validation (configured by
1881 /// ServerTlsPolicy resource) is considered insecure.
1882 pub principals: std::vec::Vec<std::string::String>,
1883
1884 /// Optional. List of CIDR ranges to match based on source IP address. At
1885 /// least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
1886 /// (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
1887 /// alone should be avoided. The IP addresses of any load balancers or
1888 /// proxies should be considered untrusted.
1889 pub ip_blocks: std::vec::Vec<std::string::String>,
1890
1891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1892 }
1893
1894 impl Source {
1895 /// Creates a new default instance.
1896 pub fn new() -> Self {
1897 std::default::Default::default()
1898 }
1899
1900 /// Sets the value of [principals][crate::model::authorization_policy::rule::Source::principals].
1901 ///
1902 /// # Example
1903 /// ```ignore,no_run
1904 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1905 /// let x = Source::new().set_principals(["a", "b", "c"]);
1906 /// ```
1907 pub fn set_principals<T, V>(mut self, v: T) -> Self
1908 where
1909 T: std::iter::IntoIterator<Item = V>,
1910 V: std::convert::Into<std::string::String>,
1911 {
1912 use std::iter::Iterator;
1913 self.principals = v.into_iter().map(|i| i.into()).collect();
1914 self
1915 }
1916
1917 /// Sets the value of [ip_blocks][crate::model::authorization_policy::rule::Source::ip_blocks].
1918 ///
1919 /// # Example
1920 /// ```ignore,no_run
1921 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1922 /// let x = Source::new().set_ip_blocks(["a", "b", "c"]);
1923 /// ```
1924 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1925 where
1926 T: std::iter::IntoIterator<Item = V>,
1927 V: std::convert::Into<std::string::String>,
1928 {
1929 use std::iter::Iterator;
1930 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1931 self
1932 }
1933 }
1934
1935 impl wkt::message::Message for Source {
1936 fn typename() -> &'static str {
1937 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1938 }
1939 }
1940
1941 /// Specification of traffic destination attributes.
1942 #[derive(Clone, Default, PartialEq)]
1943 #[non_exhaustive]
1944 pub struct Destination {
1945 /// Required. List of host names to match. Matched against the ":authority"
1946 /// header in http requests. At least one host should match. Each host can
1947 /// be an exact match, or a prefix match (example "mydomain.*") or a suffix
1948 /// match (example "*.myorg.com") or a presence (any) match "*".
1949 pub hosts: std::vec::Vec<std::string::String>,
1950
1951 /// Required. List of destination ports to match. At least one port should
1952 /// match.
1953 pub ports: std::vec::Vec<u32>,
1954
1955 /// Optional. A list of HTTP methods to match. At least one method should
1956 /// match. Should not be set for gRPC services.
1957 pub methods: std::vec::Vec<std::string::String>,
1958
1959 /// Optional. Match against key:value pair in http header. Provides a
1960 /// flexible match based on HTTP headers, for potentially advanced use
1961 /// cases. At least one header should match. Avoid using header matches to
1962 /// make authorization decisions unless there is a strong guarantee that
1963 /// requests arrive through a trusted client or proxy.
1964 pub http_header_match: std::option::Option<
1965 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1966 >,
1967
1968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1969 }
1970
1971 impl Destination {
1972 /// Creates a new default instance.
1973 pub fn new() -> Self {
1974 std::default::Default::default()
1975 }
1976
1977 /// Sets the value of [hosts][crate::model::authorization_policy::rule::Destination::hosts].
1978 ///
1979 /// # Example
1980 /// ```ignore,no_run
1981 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1982 /// let x = Destination::new().set_hosts(["a", "b", "c"]);
1983 /// ```
1984 pub fn set_hosts<T, V>(mut self, v: T) -> Self
1985 where
1986 T: std::iter::IntoIterator<Item = V>,
1987 V: std::convert::Into<std::string::String>,
1988 {
1989 use std::iter::Iterator;
1990 self.hosts = v.into_iter().map(|i| i.into()).collect();
1991 self
1992 }
1993
1994 /// Sets the value of [ports][crate::model::authorization_policy::rule::Destination::ports].
1995 ///
1996 /// # Example
1997 /// ```ignore,no_run
1998 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1999 /// let x = Destination::new().set_ports([1_u32, 2_u32, 3_u32]);
2000 /// ```
2001 pub fn set_ports<T, V>(mut self, v: T) -> Self
2002 where
2003 T: std::iter::IntoIterator<Item = V>,
2004 V: std::convert::Into<u32>,
2005 {
2006 use std::iter::Iterator;
2007 self.ports = v.into_iter().map(|i| i.into()).collect();
2008 self
2009 }
2010
2011 /// Sets the value of [methods][crate::model::authorization_policy::rule::Destination::methods].
2012 ///
2013 /// # Example
2014 /// ```ignore,no_run
2015 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2016 /// let x = Destination::new().set_methods(["a", "b", "c"]);
2017 /// ```
2018 pub fn set_methods<T, V>(mut self, v: T) -> Self
2019 where
2020 T: std::iter::IntoIterator<Item = V>,
2021 V: std::convert::Into<std::string::String>,
2022 {
2023 use std::iter::Iterator;
2024 self.methods = v.into_iter().map(|i| i.into()).collect();
2025 self
2026 }
2027
2028 /// Sets the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2029 ///
2030 /// # Example
2031 /// ```ignore,no_run
2032 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2033 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2034 /// let x = Destination::new().set_http_header_match(HttpHeaderMatch::default()/* use setters */);
2035 /// ```
2036 pub fn set_http_header_match<T>(mut self, v: T) -> Self
2037 where
2038 T: std::convert::Into<
2039 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2040 >,
2041 {
2042 self.http_header_match = std::option::Option::Some(v.into());
2043 self
2044 }
2045
2046 /// Sets or clears the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2051 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2052 /// let x = Destination::new().set_or_clear_http_header_match(Some(HttpHeaderMatch::default()/* use setters */));
2053 /// let x = Destination::new().set_or_clear_http_header_match(None::<HttpHeaderMatch>);
2054 /// ```
2055 pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
2056 where
2057 T: std::convert::Into<
2058 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2059 >,
2060 {
2061 self.http_header_match = v.map(|x| x.into());
2062 self
2063 }
2064 }
2065
2066 impl wkt::message::Message for Destination {
2067 fn typename() -> &'static str {
2068 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
2069 }
2070 }
2071
2072 /// Defines additional types related to [Destination].
2073 pub mod destination {
2074 #[allow(unused_imports)]
2075 use super::*;
2076
2077 /// Specification of HTTP header match attributes.
2078 #[derive(Clone, Default, PartialEq)]
2079 #[non_exhaustive]
2080 pub struct HttpHeaderMatch {
2081 /// Required. The name of the HTTP header to match. For matching
2082 /// against the HTTP request's authority, use a headerMatch
2083 /// with the header name ":authority". For matching a
2084 /// request's method, use the headerName ":method".
2085 pub header_name: std::string::String,
2086
2087 #[allow(missing_docs)]
2088 pub r#type: std::option::Option<
2089 crate::model::authorization_policy::rule::destination::http_header_match::Type,
2090 >,
2091
2092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2093 }
2094
2095 impl HttpHeaderMatch {
2096 /// Creates a new default instance.
2097 pub fn new() -> Self {
2098 std::default::Default::default()
2099 }
2100
2101 /// Sets the value of [header_name][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::header_name].
2102 ///
2103 /// # Example
2104 /// ```ignore,no_run
2105 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2106 /// let x = HttpHeaderMatch::new().set_header_name("example");
2107 /// ```
2108 pub fn set_header_name<T: std::convert::Into<std::string::String>>(
2109 mut self,
2110 v: T,
2111 ) -> Self {
2112 self.header_name = v.into();
2113 self
2114 }
2115
2116 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::type].
2117 ///
2118 /// Note that all the setters affecting `r#type` are mutually
2119 /// exclusive.
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2124 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::http_header_match::Type;
2125 /// let x = HttpHeaderMatch::new().set_type(Some(Type::RegexMatch("example".to_string())));
2126 /// ```
2127 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
2128 {
2129 self.r#type = v.into();
2130 self
2131 }
2132
2133 /// The value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2134 /// if it holds a `RegexMatch`, `None` if the field is not set or
2135 /// holds a different branch.
2136 pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
2137 #[allow(unreachable_patterns)]
2138 self.r#type.as_ref().and_then(|v| match v {
2139 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
2140 _ => std::option::Option::None,
2141 })
2142 }
2143
2144 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2145 /// to hold a `RegexMatch`.
2146 ///
2147 /// Note that all the setters affecting `r#type` are
2148 /// mutually exclusive.
2149 ///
2150 /// # Example
2151 /// ```ignore,no_run
2152 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2153 /// let x = HttpHeaderMatch::new().set_regex_match("example");
2154 /// assert!(x.regex_match().is_some());
2155 /// ```
2156 pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
2157 mut self,
2158 v: T,
2159 ) -> Self {
2160 self.r#type = std::option::Option::Some(
2161 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
2162 v.into()
2163 )
2164 );
2165 self
2166 }
2167 }
2168
2169 impl wkt::message::Message for HttpHeaderMatch {
2170 fn typename() -> &'static str {
2171 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
2172 }
2173 }
2174
2175 /// Defines additional types related to [HttpHeaderMatch].
2176 pub mod http_header_match {
2177 #[allow(unused_imports)]
2178 use super::*;
2179
2180 #[allow(missing_docs)]
2181 #[derive(Clone, Debug, PartialEq)]
2182 #[non_exhaustive]
2183 pub enum Type {
2184 /// Required. The value of the header must match the regular expression
2185 /// specified in regexMatch. For regular expression grammar,
2186 /// please see: en.cppreference.com/w/cpp/regex/ecmascript
2187 /// For matching against a port specified in the HTTP
2188 /// request, use a headerMatch with headerName set to Host
2189 /// and a regular expression that satisfies the RFC2616 Host
2190 /// header's port specifier.
2191 RegexMatch(std::string::String),
2192 }
2193 }
2194 }
2195 }
2196
2197 /// Possible values that define what action to take.
2198 ///
2199 /// # Working with unknown values
2200 ///
2201 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2202 /// additional enum variants at any time. Adding new variants is not considered
2203 /// a breaking change. Applications should write their code in anticipation of:
2204 ///
2205 /// - New values appearing in future releases of the client library, **and**
2206 /// - New values received dynamically, without application changes.
2207 ///
2208 /// Please consult the [Working with enums] section in the user guide for some
2209 /// guidelines.
2210 ///
2211 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2212 #[derive(Clone, Debug, PartialEq)]
2213 #[non_exhaustive]
2214 pub enum Action {
2215 /// Default value.
2216 Unspecified,
2217 /// Grant access.
2218 Allow,
2219 /// Deny access.
2220 /// Deny rules should be avoided unless they are used to provide a default
2221 /// "deny all" fallback.
2222 Deny,
2223 /// If set, the enum was initialized with an unknown value.
2224 ///
2225 /// Applications can examine the value using [Action::value] or
2226 /// [Action::name].
2227 UnknownValue(action::UnknownValue),
2228 }
2229
2230 #[doc(hidden)]
2231 pub mod action {
2232 #[allow(unused_imports)]
2233 use super::*;
2234 #[derive(Clone, Debug, PartialEq)]
2235 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2236 }
2237
2238 impl Action {
2239 /// Gets the enum value.
2240 ///
2241 /// Returns `None` if the enum contains an unknown value deserialized from
2242 /// the string representation of enums.
2243 pub fn value(&self) -> std::option::Option<i32> {
2244 match self {
2245 Self::Unspecified => std::option::Option::Some(0),
2246 Self::Allow => std::option::Option::Some(1),
2247 Self::Deny => std::option::Option::Some(2),
2248 Self::UnknownValue(u) => u.0.value(),
2249 }
2250 }
2251
2252 /// Gets the enum value as a string.
2253 ///
2254 /// Returns `None` if the enum contains an unknown value deserialized from
2255 /// the integer representation of enums.
2256 pub fn name(&self) -> std::option::Option<&str> {
2257 match self {
2258 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2259 Self::Allow => std::option::Option::Some("ALLOW"),
2260 Self::Deny => std::option::Option::Some("DENY"),
2261 Self::UnknownValue(u) => u.0.name(),
2262 }
2263 }
2264 }
2265
2266 impl std::default::Default for Action {
2267 fn default() -> Self {
2268 use std::convert::From;
2269 Self::from(0)
2270 }
2271 }
2272
2273 impl std::fmt::Display for Action {
2274 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2275 wkt::internal::display_enum(f, self.name(), self.value())
2276 }
2277 }
2278
2279 impl std::convert::From<i32> for Action {
2280 fn from(value: i32) -> Self {
2281 match value {
2282 0 => Self::Unspecified,
2283 1 => Self::Allow,
2284 2 => Self::Deny,
2285 _ => Self::UnknownValue(action::UnknownValue(
2286 wkt::internal::UnknownEnumValue::Integer(value),
2287 )),
2288 }
2289 }
2290 }
2291
2292 impl std::convert::From<&str> for Action {
2293 fn from(value: &str) -> Self {
2294 use std::string::ToString;
2295 match value {
2296 "ACTION_UNSPECIFIED" => Self::Unspecified,
2297 "ALLOW" => Self::Allow,
2298 "DENY" => Self::Deny,
2299 _ => Self::UnknownValue(action::UnknownValue(
2300 wkt::internal::UnknownEnumValue::String(value.to_string()),
2301 )),
2302 }
2303 }
2304 }
2305
2306 impl serde::ser::Serialize for Action {
2307 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2308 where
2309 S: serde::Serializer,
2310 {
2311 match self {
2312 Self::Unspecified => serializer.serialize_i32(0),
2313 Self::Allow => serializer.serialize_i32(1),
2314 Self::Deny => serializer.serialize_i32(2),
2315 Self::UnknownValue(u) => u.0.serialize(serializer),
2316 }
2317 }
2318 }
2319
2320 impl<'de> serde::de::Deserialize<'de> for Action {
2321 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2322 where
2323 D: serde::Deserializer<'de>,
2324 {
2325 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
2326 ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
2327 ))
2328 }
2329 }
2330}
2331
2332/// Request used with the ListAuthorizationPolicies method.
2333#[derive(Clone, Default, PartialEq)]
2334#[non_exhaustive]
2335pub struct ListAuthorizationPoliciesRequest {
2336 /// Required. The project and location from which the AuthorizationPolicies
2337 /// should be listed, specified in the format
2338 /// `projects/{project}/locations/{location}`.
2339 pub parent: std::string::String,
2340
2341 /// Maximum number of AuthorizationPolicies to return per call.
2342 pub page_size: i32,
2343
2344 /// The value returned by the last
2345 /// `ListAuthorizationPoliciesResponse` Indicates that this is a
2346 /// continuation of a prior `ListAuthorizationPolicies` call, and
2347 /// that the system should return the next page of data.
2348 pub page_token: std::string::String,
2349
2350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2351}
2352
2353impl ListAuthorizationPoliciesRequest {
2354 /// Creates a new default instance.
2355 pub fn new() -> Self {
2356 std::default::Default::default()
2357 }
2358
2359 /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
2360 ///
2361 /// # Example
2362 /// ```ignore,no_run
2363 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2364 /// let x = ListAuthorizationPoliciesRequest::new().set_parent("example");
2365 /// ```
2366 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2367 self.parent = v.into();
2368 self
2369 }
2370
2371 /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
2372 ///
2373 /// # Example
2374 /// ```ignore,no_run
2375 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2376 /// let x = ListAuthorizationPoliciesRequest::new().set_page_size(42);
2377 /// ```
2378 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2379 self.page_size = v.into();
2380 self
2381 }
2382
2383 /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
2384 ///
2385 /// # Example
2386 /// ```ignore,no_run
2387 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2388 /// let x = ListAuthorizationPoliciesRequest::new().set_page_token("example");
2389 /// ```
2390 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.page_token = v.into();
2392 self
2393 }
2394}
2395
2396impl wkt::message::Message for ListAuthorizationPoliciesRequest {
2397 fn typename() -> &'static str {
2398 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
2399 }
2400}
2401
2402/// Response returned by the ListAuthorizationPolicies method.
2403#[derive(Clone, Default, PartialEq)]
2404#[non_exhaustive]
2405pub struct ListAuthorizationPoliciesResponse {
2406 /// List of AuthorizationPolicies resources.
2407 pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
2408
2409 /// If there might be more results than those appearing in this response, then
2410 /// `next_page_token` is included. To get the next set of results, call this
2411 /// method again using the value of `next_page_token` as `page_token`.
2412 pub next_page_token: std::string::String,
2413
2414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2415}
2416
2417impl ListAuthorizationPoliciesResponse {
2418 /// Creates a new default instance.
2419 pub fn new() -> Self {
2420 std::default::Default::default()
2421 }
2422
2423 /// Sets the value of [authorization_policies][crate::model::ListAuthorizationPoliciesResponse::authorization_policies].
2424 ///
2425 /// # Example
2426 /// ```ignore,no_run
2427 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2428 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2429 /// let x = ListAuthorizationPoliciesResponse::new()
2430 /// .set_authorization_policies([
2431 /// AuthorizationPolicy::default()/* use setters */,
2432 /// AuthorizationPolicy::default()/* use (different) setters */,
2433 /// ]);
2434 /// ```
2435 pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
2436 where
2437 T: std::iter::IntoIterator<Item = V>,
2438 V: std::convert::Into<crate::model::AuthorizationPolicy>,
2439 {
2440 use std::iter::Iterator;
2441 self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
2442 self
2443 }
2444
2445 /// Sets the value of [next_page_token][crate::model::ListAuthorizationPoliciesResponse::next_page_token].
2446 ///
2447 /// # Example
2448 /// ```ignore,no_run
2449 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2450 /// let x = ListAuthorizationPoliciesResponse::new().set_next_page_token("example");
2451 /// ```
2452 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2453 self.next_page_token = v.into();
2454 self
2455 }
2456}
2457
2458impl wkt::message::Message for ListAuthorizationPoliciesResponse {
2459 fn typename() -> &'static str {
2460 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
2461 }
2462}
2463
2464#[doc(hidden)]
2465impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
2466 type PageItem = crate::model::AuthorizationPolicy;
2467
2468 fn items(self) -> std::vec::Vec<Self::PageItem> {
2469 self.authorization_policies
2470 }
2471
2472 fn next_page_token(&self) -> std::string::String {
2473 use std::clone::Clone;
2474 self.next_page_token.clone()
2475 }
2476}
2477
2478/// Request used by the GetAuthorizationPolicy method.
2479#[derive(Clone, Default, PartialEq)]
2480#[non_exhaustive]
2481pub struct GetAuthorizationPolicyRequest {
2482 /// Required. A name of the AuthorizationPolicy to get. Must be in the format
2483 /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
2484 pub name: std::string::String,
2485
2486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2487}
2488
2489impl GetAuthorizationPolicyRequest {
2490 /// Creates a new default instance.
2491 pub fn new() -> Self {
2492 std::default::Default::default()
2493 }
2494
2495 /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
2496 ///
2497 /// # Example
2498 /// ```ignore,no_run
2499 /// # use google_cloud_networksecurity_v1::model::GetAuthorizationPolicyRequest;
2500 /// # let project_id = "project_id";
2501 /// # let location_id = "location_id";
2502 /// # let authorization_policy_id = "authorization_policy_id";
2503 /// let x = GetAuthorizationPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
2504 /// ```
2505 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.name = v.into();
2507 self
2508 }
2509}
2510
2511impl wkt::message::Message for GetAuthorizationPolicyRequest {
2512 fn typename() -> &'static str {
2513 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
2514 }
2515}
2516
2517/// Request used by the CreateAuthorizationPolicy method.
2518#[derive(Clone, Default, PartialEq)]
2519#[non_exhaustive]
2520pub struct CreateAuthorizationPolicyRequest {
2521 /// Required. The parent resource of the AuthorizationPolicy. Must be in the
2522 /// format `projects/{project}/locations/{location}`.
2523 pub parent: std::string::String,
2524
2525 /// Required. Short name of the AuthorizationPolicy resource to be created.
2526 /// This value should be 1-63 characters long, containing only
2527 /// letters, numbers, hyphens, and underscores, and should not start
2528 /// with a number. E.g. "authz_policy".
2529 pub authorization_policy_id: std::string::String,
2530
2531 /// Required. AuthorizationPolicy resource to be created.
2532 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2533
2534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2535}
2536
2537impl CreateAuthorizationPolicyRequest {
2538 /// Creates a new default instance.
2539 pub fn new() -> Self {
2540 std::default::Default::default()
2541 }
2542
2543 /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
2544 ///
2545 /// # Example
2546 /// ```ignore,no_run
2547 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2548 /// # let project_id = "project_id";
2549 /// # let location_id = "location_id";
2550 /// let x = CreateAuthorizationPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2551 /// ```
2552 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2553 self.parent = v.into();
2554 self
2555 }
2556
2557 /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
2558 ///
2559 /// # Example
2560 /// ```ignore,no_run
2561 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2562 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy_id("example");
2563 /// ```
2564 pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
2565 mut self,
2566 v: T,
2567 ) -> Self {
2568 self.authorization_policy_id = v.into();
2569 self
2570 }
2571
2572 /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2573 ///
2574 /// # Example
2575 /// ```ignore,no_run
2576 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2577 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2578 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2579 /// ```
2580 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2581 where
2582 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2583 {
2584 self.authorization_policy = std::option::Option::Some(v.into());
2585 self
2586 }
2587
2588 /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2589 ///
2590 /// # Example
2591 /// ```ignore,no_run
2592 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2593 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2594 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2595 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2596 /// ```
2597 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2600 {
2601 self.authorization_policy = v.map(|x| x.into());
2602 self
2603 }
2604}
2605
2606impl wkt::message::Message for CreateAuthorizationPolicyRequest {
2607 fn typename() -> &'static str {
2608 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
2609 }
2610}
2611
2612/// Request used by the UpdateAuthorizationPolicy method.
2613#[derive(Clone, Default, PartialEq)]
2614#[non_exhaustive]
2615pub struct UpdateAuthorizationPolicyRequest {
2616 /// Optional. Field mask is used to specify the fields to be overwritten in the
2617 /// AuthorizationPolicy resource by the update.
2618 /// The fields specified in the update_mask are relative to the resource, not
2619 /// the full request. A field will be overwritten if it is in the mask. If the
2620 /// user does not provide a mask then all fields will be overwritten.
2621 pub update_mask: std::option::Option<wkt::FieldMask>,
2622
2623 /// Required. Updated AuthorizationPolicy resource.
2624 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2625
2626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2627}
2628
2629impl UpdateAuthorizationPolicyRequest {
2630 /// Creates a new default instance.
2631 pub fn new() -> Self {
2632 std::default::Default::default()
2633 }
2634
2635 /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2636 ///
2637 /// # Example
2638 /// ```ignore,no_run
2639 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2640 /// use wkt::FieldMask;
2641 /// let x = UpdateAuthorizationPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2642 /// ```
2643 pub fn set_update_mask<T>(mut self, v: T) -> Self
2644 where
2645 T: std::convert::Into<wkt::FieldMask>,
2646 {
2647 self.update_mask = std::option::Option::Some(v.into());
2648 self
2649 }
2650
2651 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2652 ///
2653 /// # Example
2654 /// ```ignore,no_run
2655 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2656 /// use wkt::FieldMask;
2657 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2658 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2659 /// ```
2660 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2661 where
2662 T: std::convert::Into<wkt::FieldMask>,
2663 {
2664 self.update_mask = v.map(|x| x.into());
2665 self
2666 }
2667
2668 /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2669 ///
2670 /// # Example
2671 /// ```ignore,no_run
2672 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2673 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2674 /// let x = UpdateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2675 /// ```
2676 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2677 where
2678 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2679 {
2680 self.authorization_policy = std::option::Option::Some(v.into());
2681 self
2682 }
2683
2684 /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2685 ///
2686 /// # Example
2687 /// ```ignore,no_run
2688 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2689 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2690 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2691 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2692 /// ```
2693 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2694 where
2695 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2696 {
2697 self.authorization_policy = v.map(|x| x.into());
2698 self
2699 }
2700}
2701
2702impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2703 fn typename() -> &'static str {
2704 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2705 }
2706}
2707
2708/// Request used by the DeleteAuthorizationPolicy method.
2709#[derive(Clone, Default, PartialEq)]
2710#[non_exhaustive]
2711pub struct DeleteAuthorizationPolicyRequest {
2712 /// Required. A name of the AuthorizationPolicy to delete. Must be in the
2713 /// format `projects/{project}/locations/{location}/authorizationPolicies/*`.
2714 pub name: std::string::String,
2715
2716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2717}
2718
2719impl DeleteAuthorizationPolicyRequest {
2720 /// Creates a new default instance.
2721 pub fn new() -> Self {
2722 std::default::Default::default()
2723 }
2724
2725 /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
2726 ///
2727 /// # Example
2728 /// ```ignore,no_run
2729 /// # use google_cloud_networksecurity_v1::model::DeleteAuthorizationPolicyRequest;
2730 /// # let project_id = "project_id";
2731 /// # let location_id = "location_id";
2732 /// # let authorization_policy_id = "authorization_policy_id";
2733 /// let x = DeleteAuthorizationPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authorizationPolicies/{authorization_policy_id}"));
2734 /// ```
2735 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2736 self.name = v.into();
2737 self
2738 }
2739}
2740
2741impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2742 fn typename() -> &'static str {
2743 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2744 }
2745}
2746
2747/// `AuthzPolicy` is a resource that allows to forward traffic to a
2748/// callout backend designed to scan the traffic for security purposes.
2749#[derive(Clone, Default, PartialEq)]
2750#[non_exhaustive]
2751pub struct AuthzPolicy {
2752 /// Required. Identifier. Name of the `AuthzPolicy` resource in the following
2753 /// format:
2754 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
2755 pub name: std::string::String,
2756
2757 /// Output only. The timestamp when the resource was created.
2758 pub create_time: std::option::Option<wkt::Timestamp>,
2759
2760 /// Output only. The timestamp when the resource was updated.
2761 pub update_time: std::option::Option<wkt::Timestamp>,
2762
2763 /// Optional. A human-readable description of the resource.
2764 pub description: std::string::String,
2765
2766 /// Optional. Set of labels associated with the `AuthzPolicy` resource.
2767 ///
2768 /// The format must comply with [the following
2769 /// requirements](/compute/docs/labeling-resources#requirements).
2770 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2771
2772 /// Required. Specifies the set of resources to which this policy should be
2773 /// applied to.
2774 pub target: std::option::Option<crate::model::authz_policy::Target>,
2775
2776 /// Optional. A list of authorization HTTP rules to match against the incoming
2777 /// request. A policy match occurs when at least one HTTP rule matches the
2778 /// request or when no HTTP rules are specified in the policy.
2779 /// At least one HTTP Rule is required for Allow or Deny Action. Limited
2780 /// to 5 rules.
2781 pub http_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2782
2783 /// Optional. A list of authorization network rules to match against the
2784 /// incoming request. A policy match occurs when at least one network rule
2785 /// matches the request.
2786 /// At least one network rule is required for Allow or Deny Action if no HTTP
2787 /// rules are provided. Network rules are mutually exclusive with HTTP rules.
2788 /// Limited to 5 rules.
2789 pub network_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2790
2791 /// Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
2792 ///
2793 /// When the action is `CUSTOM`, `customProvider` must be specified.
2794 ///
2795 /// When the action is `ALLOW`, only requests matching the policy will
2796 /// be allowed.
2797 ///
2798 /// When the action is `DENY`, only requests matching the policy will be
2799 /// denied.
2800 ///
2801 /// When a request arrives, the policies are evaluated in the following order:
2802 ///
2803 /// 1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
2804 /// policy is evaluated using the custom authorization providers and the
2805 /// request is denied if the provider rejects the request.
2806 ///
2807 /// 1. If there are any `DENY` policies that match the request, the request
2808 /// is denied.
2809 ///
2810 /// 1. If there are no `ALLOW` policies for the resource or if any of the
2811 /// `ALLOW` policies match the request, the request is allowed.
2812 ///
2813 /// 1. Else the request is denied by default if none of the configured
2814 /// AuthzPolicies with `ALLOW` action match the request.
2815 ///
2816 pub action: crate::model::authz_policy::AuthzAction,
2817
2818 /// Optional. Required if the action is `CUSTOM`. Allows delegating
2819 /// authorization decisions to Cloud IAP or to Service Extensions. One of
2820 /// `cloudIap` or `authzExtension` must be specified.
2821 pub custom_provider: std::option::Option<crate::model::authz_policy::CustomProvider>,
2822
2823 /// Optional. Immutable. Defines the type of authorization being performed.
2824 /// If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
2825 /// once AuthzPolicy is created.
2826 pub policy_profile: crate::model::authz_policy::PolicyProfile,
2827
2828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2829}
2830
2831impl AuthzPolicy {
2832 /// Creates a new default instance.
2833 pub fn new() -> Self {
2834 std::default::Default::default()
2835 }
2836
2837 /// Sets the value of [name][crate::model::AuthzPolicy::name].
2838 ///
2839 /// # Example
2840 /// ```ignore,no_run
2841 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2842 /// # let project_id = "project_id";
2843 /// # let location_id = "location_id";
2844 /// # let authz_policy_id = "authz_policy_id";
2845 /// let x = AuthzPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
2846 /// ```
2847 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848 self.name = v.into();
2849 self
2850 }
2851
2852 /// Sets the value of [create_time][crate::model::AuthzPolicy::create_time].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2857 /// use wkt::Timestamp;
2858 /// let x = AuthzPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2859 /// ```
2860 pub fn set_create_time<T>(mut self, v: T) -> Self
2861 where
2862 T: std::convert::Into<wkt::Timestamp>,
2863 {
2864 self.create_time = std::option::Option::Some(v.into());
2865 self
2866 }
2867
2868 /// Sets or clears the value of [create_time][crate::model::AuthzPolicy::create_time].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2873 /// use wkt::Timestamp;
2874 /// let x = AuthzPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2875 /// let x = AuthzPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2876 /// ```
2877 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2878 where
2879 T: std::convert::Into<wkt::Timestamp>,
2880 {
2881 self.create_time = v.map(|x| x.into());
2882 self
2883 }
2884
2885 /// Sets the value of [update_time][crate::model::AuthzPolicy::update_time].
2886 ///
2887 /// # Example
2888 /// ```ignore,no_run
2889 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2890 /// use wkt::Timestamp;
2891 /// let x = AuthzPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2892 /// ```
2893 pub fn set_update_time<T>(mut self, v: T) -> Self
2894 where
2895 T: std::convert::Into<wkt::Timestamp>,
2896 {
2897 self.update_time = std::option::Option::Some(v.into());
2898 self
2899 }
2900
2901 /// Sets or clears the value of [update_time][crate::model::AuthzPolicy::update_time].
2902 ///
2903 /// # Example
2904 /// ```ignore,no_run
2905 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2906 /// use wkt::Timestamp;
2907 /// let x = AuthzPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2908 /// let x = AuthzPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2909 /// ```
2910 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2911 where
2912 T: std::convert::Into<wkt::Timestamp>,
2913 {
2914 self.update_time = v.map(|x| x.into());
2915 self
2916 }
2917
2918 /// Sets the value of [description][crate::model::AuthzPolicy::description].
2919 ///
2920 /// # Example
2921 /// ```ignore,no_run
2922 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2923 /// let x = AuthzPolicy::new().set_description("example");
2924 /// ```
2925 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2926 self.description = v.into();
2927 self
2928 }
2929
2930 /// Sets the value of [labels][crate::model::AuthzPolicy::labels].
2931 ///
2932 /// # Example
2933 /// ```ignore,no_run
2934 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2935 /// let x = AuthzPolicy::new().set_labels([
2936 /// ("key0", "abc"),
2937 /// ("key1", "xyz"),
2938 /// ]);
2939 /// ```
2940 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2941 where
2942 T: std::iter::IntoIterator<Item = (K, V)>,
2943 K: std::convert::Into<std::string::String>,
2944 V: std::convert::Into<std::string::String>,
2945 {
2946 use std::iter::Iterator;
2947 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2948 self
2949 }
2950
2951 /// Sets the value of [target][crate::model::AuthzPolicy::target].
2952 ///
2953 /// # Example
2954 /// ```ignore,no_run
2955 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2956 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2957 /// let x = AuthzPolicy::new().set_target(Target::default()/* use setters */);
2958 /// ```
2959 pub fn set_target<T>(mut self, v: T) -> Self
2960 where
2961 T: std::convert::Into<crate::model::authz_policy::Target>,
2962 {
2963 self.target = std::option::Option::Some(v.into());
2964 self
2965 }
2966
2967 /// Sets or clears the value of [target][crate::model::AuthzPolicy::target].
2968 ///
2969 /// # Example
2970 /// ```ignore,no_run
2971 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2972 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2973 /// let x = AuthzPolicy::new().set_or_clear_target(Some(Target::default()/* use setters */));
2974 /// let x = AuthzPolicy::new().set_or_clear_target(None::<Target>);
2975 /// ```
2976 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
2977 where
2978 T: std::convert::Into<crate::model::authz_policy::Target>,
2979 {
2980 self.target = v.map(|x| x.into());
2981 self
2982 }
2983
2984 /// Sets the value of [http_rules][crate::model::AuthzPolicy::http_rules].
2985 ///
2986 /// # Example
2987 /// ```ignore,no_run
2988 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2989 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
2990 /// let x = AuthzPolicy::new()
2991 /// .set_http_rules([
2992 /// AuthzRule::default()/* use setters */,
2993 /// AuthzRule::default()/* use (different) setters */,
2994 /// ]);
2995 /// ```
2996 pub fn set_http_rules<T, V>(mut self, v: T) -> Self
2997 where
2998 T: std::iter::IntoIterator<Item = V>,
2999 V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
3000 {
3001 use std::iter::Iterator;
3002 self.http_rules = v.into_iter().map(|i| i.into()).collect();
3003 self
3004 }
3005
3006 /// Sets the value of [network_rules][crate::model::AuthzPolicy::network_rules].
3007 ///
3008 /// # Example
3009 /// ```ignore,no_run
3010 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3011 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3012 /// let x = AuthzPolicy::new()
3013 /// .set_network_rules([
3014 /// AuthzRule::default()/* use setters */,
3015 /// AuthzRule::default()/* use (different) setters */,
3016 /// ]);
3017 /// ```
3018 pub fn set_network_rules<T, V>(mut self, v: T) -> Self
3019 where
3020 T: std::iter::IntoIterator<Item = V>,
3021 V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
3022 {
3023 use std::iter::Iterator;
3024 self.network_rules = v.into_iter().map(|i| i.into()).collect();
3025 self
3026 }
3027
3028 /// Sets the value of [action][crate::model::AuthzPolicy::action].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3033 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzAction;
3034 /// let x0 = AuthzPolicy::new().set_action(AuthzAction::Allow);
3035 /// let x1 = AuthzPolicy::new().set_action(AuthzAction::Deny);
3036 /// let x2 = AuthzPolicy::new().set_action(AuthzAction::Custom);
3037 /// ```
3038 pub fn set_action<T: std::convert::Into<crate::model::authz_policy::AuthzAction>>(
3039 mut self,
3040 v: T,
3041 ) -> Self {
3042 self.action = v.into();
3043 self
3044 }
3045
3046 /// Sets the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
3047 ///
3048 /// # Example
3049 /// ```ignore,no_run
3050 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3051 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
3052 /// let x = AuthzPolicy::new().set_custom_provider(CustomProvider::default()/* use setters */);
3053 /// ```
3054 pub fn set_custom_provider<T>(mut self, v: T) -> Self
3055 where
3056 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
3057 {
3058 self.custom_provider = std::option::Option::Some(v.into());
3059 self
3060 }
3061
3062 /// Sets or clears the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
3063 ///
3064 /// # Example
3065 /// ```ignore,no_run
3066 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3067 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
3068 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(Some(CustomProvider::default()/* use setters */));
3069 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(None::<CustomProvider>);
3070 /// ```
3071 pub fn set_or_clear_custom_provider<T>(mut self, v: std::option::Option<T>) -> Self
3072 where
3073 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
3074 {
3075 self.custom_provider = v.map(|x| x.into());
3076 self
3077 }
3078
3079 /// Sets the value of [policy_profile][crate::model::AuthzPolicy::policy_profile].
3080 ///
3081 /// # Example
3082 /// ```ignore,no_run
3083 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
3084 /// use google_cloud_networksecurity_v1::model::authz_policy::PolicyProfile;
3085 /// let x0 = AuthzPolicy::new().set_policy_profile(PolicyProfile::RequestAuthz);
3086 /// let x1 = AuthzPolicy::new().set_policy_profile(PolicyProfile::ContentAuthz);
3087 /// ```
3088 pub fn set_policy_profile<T: std::convert::Into<crate::model::authz_policy::PolicyProfile>>(
3089 mut self,
3090 v: T,
3091 ) -> Self {
3092 self.policy_profile = v.into();
3093 self
3094 }
3095}
3096
3097impl wkt::message::Message for AuthzPolicy {
3098 fn typename() -> &'static str {
3099 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy"
3100 }
3101}
3102
3103/// Defines additional types related to [AuthzPolicy].
3104pub mod authz_policy {
3105 #[allow(unused_imports)]
3106 use super::*;
3107
3108 /// Specifies the set of targets to which this policy should be applied to.
3109 #[derive(Clone, Default, PartialEq)]
3110 #[non_exhaustive]
3111 pub struct Target {
3112 /// Optional. All gateways and forwarding rules referenced by this policy and
3113 /// extensions must share the same load balancing scheme. Required only when
3114 /// targeting forwarding rules. If targeting Secure Web Proxy, this field
3115 /// must be `INTERNAL_MANAGED` or not specified. Must not be specified
3116 /// when targeting Agent Gateway. Supported values:
3117 /// `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer
3118 /// to [Backend services
3119 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
3120 pub load_balancing_scheme: crate::model::authz_policy::LoadBalancingScheme,
3121
3122 /// Required. A list of references to the Forwarding Rules, Secure Web Proxy
3123 /// Gateways, or Agent Gateways on which this policy will be applied.
3124 pub resources: std::vec::Vec<std::string::String>,
3125
3126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3127 }
3128
3129 impl Target {
3130 /// Creates a new default instance.
3131 pub fn new() -> Self {
3132 std::default::Default::default()
3133 }
3134
3135 /// Sets the value of [load_balancing_scheme][crate::model::authz_policy::Target::load_balancing_scheme].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3140 /// use google_cloud_networksecurity_v1::model::authz_policy::LoadBalancingScheme;
3141 /// let x0 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalManaged);
3142 /// let x1 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::ExternalManaged);
3143 /// let x2 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalSelfManaged);
3144 /// ```
3145 pub fn set_load_balancing_scheme<
3146 T: std::convert::Into<crate::model::authz_policy::LoadBalancingScheme>,
3147 >(
3148 mut self,
3149 v: T,
3150 ) -> Self {
3151 self.load_balancing_scheme = v.into();
3152 self
3153 }
3154
3155 /// Sets the value of [resources][crate::model::authz_policy::Target::resources].
3156 ///
3157 /// # Example
3158 /// ```ignore,no_run
3159 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3160 /// let x = Target::new().set_resources(["a", "b", "c"]);
3161 /// ```
3162 pub fn set_resources<T, V>(mut self, v: T) -> Self
3163 where
3164 T: std::iter::IntoIterator<Item = V>,
3165 V: std::convert::Into<std::string::String>,
3166 {
3167 use std::iter::Iterator;
3168 self.resources = v.into_iter().map(|i| i.into()).collect();
3169 self
3170 }
3171 }
3172
3173 impl wkt::message::Message for Target {
3174 fn typename() -> &'static str {
3175 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.Target"
3176 }
3177 }
3178
3179 /// Conditions to match against the incoming request.
3180 #[derive(Clone, Default, PartialEq)]
3181 #[non_exhaustive]
3182 pub struct AuthzRule {
3183 /// Optional. Describes properties of a source of a request.
3184 pub from: std::option::Option<crate::model::authz_policy::authz_rule::From>,
3185
3186 /// Optional. Describes properties of a target of a request.
3187 pub to: std::option::Option<crate::model::authz_policy::authz_rule::To>,
3188
3189 /// Optional. CEL expression that describes the conditions to be satisfied
3190 /// for the action. The result of the CEL expression is ANDed with the from
3191 /// and to. Refer to the CEL language reference for a list of available
3192 /// attributes.
3193 pub when: std::string::String,
3194
3195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3196 }
3197
3198 impl AuthzRule {
3199 /// Creates a new default instance.
3200 pub fn new() -> Self {
3201 std::default::Default::default()
3202 }
3203
3204 /// Sets the value of [from][crate::model::authz_policy::AuthzRule::from].
3205 ///
3206 /// # Example
3207 /// ```ignore,no_run
3208 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3209 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3210 /// let x = AuthzRule::new().set_from(From::default()/* use setters */);
3211 /// ```
3212 pub fn set_from<T>(mut self, v: T) -> Self
3213 where
3214 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3215 {
3216 self.from = std::option::Option::Some(v.into());
3217 self
3218 }
3219
3220 /// Sets or clears the value of [from][crate::model::authz_policy::AuthzRule::from].
3221 ///
3222 /// # Example
3223 /// ```ignore,no_run
3224 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3225 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3226 /// let x = AuthzRule::new().set_or_clear_from(Some(From::default()/* use setters */));
3227 /// let x = AuthzRule::new().set_or_clear_from(None::<From>);
3228 /// ```
3229 pub fn set_or_clear_from<T>(mut self, v: std::option::Option<T>) -> Self
3230 where
3231 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3232 {
3233 self.from = v.map(|x| x.into());
3234 self
3235 }
3236
3237 /// Sets the value of [to][crate::model::authz_policy::AuthzRule::to].
3238 ///
3239 /// # Example
3240 /// ```ignore,no_run
3241 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3242 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3243 /// let x = AuthzRule::new().set_to(To::default()/* use setters */);
3244 /// ```
3245 pub fn set_to<T>(mut self, v: T) -> Self
3246 where
3247 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3248 {
3249 self.to = std::option::Option::Some(v.into());
3250 self
3251 }
3252
3253 /// Sets or clears the value of [to][crate::model::authz_policy::AuthzRule::to].
3254 ///
3255 /// # Example
3256 /// ```ignore,no_run
3257 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3258 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3259 /// let x = AuthzRule::new().set_or_clear_to(Some(To::default()/* use setters */));
3260 /// let x = AuthzRule::new().set_or_clear_to(None::<To>);
3261 /// ```
3262 pub fn set_or_clear_to<T>(mut self, v: std::option::Option<T>) -> Self
3263 where
3264 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3265 {
3266 self.to = v.map(|x| x.into());
3267 self
3268 }
3269
3270 /// Sets the value of [when][crate::model::authz_policy::AuthzRule::when].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3275 /// let x = AuthzRule::new().set_when("example");
3276 /// ```
3277 pub fn set_when<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.when = v.into();
3279 self
3280 }
3281 }
3282
3283 impl wkt::message::Message for AuthzRule {
3284 fn typename() -> &'static str {
3285 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule"
3286 }
3287 }
3288
3289 /// Defines additional types related to [AuthzRule].
3290 pub mod authz_rule {
3291 #[allow(unused_imports)]
3292 use super::*;
3293
3294 /// Determines how a string value should be matched.
3295 #[derive(Clone, Default, PartialEq)]
3296 #[non_exhaustive]
3297 pub struct StringMatch {
3298 /// If true, indicates the exact/prefix/suffix/contains matching should be
3299 /// case insensitive. For example, the matcher ``data`` will match both
3300 /// input string ``Data`` and ``data`` if set to true.
3301 pub ignore_case: bool,
3302
3303 #[allow(missing_docs)]
3304 pub match_pattern: std::option::Option<
3305 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3306 >,
3307
3308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3309 }
3310
3311 impl StringMatch {
3312 /// Creates a new default instance.
3313 pub fn new() -> Self {
3314 std::default::Default::default()
3315 }
3316
3317 /// Sets the value of [ignore_case][crate::model::authz_policy::authz_rule::StringMatch::ignore_case].
3318 ///
3319 /// # Example
3320 /// ```ignore,no_run
3321 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3322 /// let x = StringMatch::new().set_ignore_case(true);
3323 /// ```
3324 pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3325 self.ignore_case = v.into();
3326 self
3327 }
3328
3329 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern].
3330 ///
3331 /// Note that all the setters affecting `match_pattern` are mutually
3332 /// exclusive.
3333 ///
3334 /// # Example
3335 /// ```ignore,no_run
3336 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3337 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::string_match::MatchPattern;
3338 /// let x = StringMatch::new().set_match_pattern(Some(MatchPattern::Exact("example".to_string())));
3339 /// ```
3340 pub fn set_match_pattern<
3341 T: std::convert::Into<
3342 std::option::Option<
3343 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3344 >,
3345 >,
3346 >(
3347 mut self,
3348 v: T,
3349 ) -> Self {
3350 self.match_pattern = v.into();
3351 self
3352 }
3353
3354 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3355 /// if it holds a `Exact`, `None` if the field is not set or
3356 /// holds a different branch.
3357 pub fn exact(&self) -> std::option::Option<&std::string::String> {
3358 #[allow(unreachable_patterns)]
3359 self.match_pattern.as_ref().and_then(|v| match v {
3360 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3361 v,
3362 ) => std::option::Option::Some(v),
3363 _ => std::option::Option::None,
3364 })
3365 }
3366
3367 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3368 /// to hold a `Exact`.
3369 ///
3370 /// Note that all the setters affecting `match_pattern` are
3371 /// mutually exclusive.
3372 ///
3373 /// # Example
3374 /// ```ignore,no_run
3375 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3376 /// let x = StringMatch::new().set_exact("example");
3377 /// assert!(x.exact().is_some());
3378 /// assert!(x.prefix().is_none());
3379 /// assert!(x.suffix().is_none());
3380 /// assert!(x.contains().is_none());
3381 /// ```
3382 pub fn set_exact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3383 self.match_pattern = std::option::Option::Some(
3384 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3385 v.into(),
3386 ),
3387 );
3388 self
3389 }
3390
3391 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3392 /// if it holds a `Prefix`, `None` if the field is not set or
3393 /// holds a different branch.
3394 pub fn prefix(&self) -> std::option::Option<&std::string::String> {
3395 #[allow(unreachable_patterns)]
3396 self.match_pattern.as_ref().and_then(|v| match v {
3397 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3398 v,
3399 ) => std::option::Option::Some(v),
3400 _ => std::option::Option::None,
3401 })
3402 }
3403
3404 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3405 /// to hold a `Prefix`.
3406 ///
3407 /// Note that all the setters affecting `match_pattern` are
3408 /// mutually exclusive.
3409 ///
3410 /// # Example
3411 /// ```ignore,no_run
3412 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3413 /// let x = StringMatch::new().set_prefix("example");
3414 /// assert!(x.prefix().is_some());
3415 /// assert!(x.exact().is_none());
3416 /// assert!(x.suffix().is_none());
3417 /// assert!(x.contains().is_none());
3418 /// ```
3419 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3420 self.match_pattern = std::option::Option::Some(
3421 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3422 v.into(),
3423 ),
3424 );
3425 self
3426 }
3427
3428 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3429 /// if it holds a `Suffix`, `None` if the field is not set or
3430 /// holds a different branch.
3431 pub fn suffix(&self) -> std::option::Option<&std::string::String> {
3432 #[allow(unreachable_patterns)]
3433 self.match_pattern.as_ref().and_then(|v| match v {
3434 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3435 v,
3436 ) => std::option::Option::Some(v),
3437 _ => std::option::Option::None,
3438 })
3439 }
3440
3441 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3442 /// to hold a `Suffix`.
3443 ///
3444 /// Note that all the setters affecting `match_pattern` are
3445 /// mutually exclusive.
3446 ///
3447 /// # Example
3448 /// ```ignore,no_run
3449 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3450 /// let x = StringMatch::new().set_suffix("example");
3451 /// assert!(x.suffix().is_some());
3452 /// assert!(x.exact().is_none());
3453 /// assert!(x.prefix().is_none());
3454 /// assert!(x.contains().is_none());
3455 /// ```
3456 pub fn set_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3457 self.match_pattern = std::option::Option::Some(
3458 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3459 v.into(),
3460 ),
3461 );
3462 self
3463 }
3464
3465 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3466 /// if it holds a `Contains`, `None` if the field is not set or
3467 /// holds a different branch.
3468 pub fn contains(&self) -> std::option::Option<&std::string::String> {
3469 #[allow(unreachable_patterns)]
3470 self.match_pattern.as_ref().and_then(|v| match v {
3471 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(v) => std::option::Option::Some(v),
3472 _ => std::option::Option::None,
3473 })
3474 }
3475
3476 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3477 /// to hold a `Contains`.
3478 ///
3479 /// Note that all the setters affecting `match_pattern` are
3480 /// mutually exclusive.
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3485 /// let x = StringMatch::new().set_contains("example");
3486 /// assert!(x.contains().is_some());
3487 /// assert!(x.exact().is_none());
3488 /// assert!(x.prefix().is_none());
3489 /// assert!(x.suffix().is_none());
3490 /// ```
3491 pub fn set_contains<T: std::convert::Into<std::string::String>>(
3492 mut self,
3493 v: T,
3494 ) -> Self {
3495 self.match_pattern = std::option::Option::Some(
3496 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(
3497 v.into(),
3498 ),
3499 );
3500 self
3501 }
3502 }
3503
3504 impl wkt::message::Message for StringMatch {
3505 fn typename() -> &'static str {
3506 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch"
3507 }
3508 }
3509
3510 /// Defines additional types related to [StringMatch].
3511 pub mod string_match {
3512 #[allow(unused_imports)]
3513 use super::*;
3514
3515 #[allow(missing_docs)]
3516 #[derive(Clone, Debug, PartialEq)]
3517 #[non_exhaustive]
3518 pub enum MatchPattern {
3519 /// The input string must match exactly the string specified here.
3520 ///
3521 /// Examples:
3522 ///
3523 /// * ``abc`` only matches the value ``abc``.
3524 Exact(std::string::String),
3525 /// The input string must have the prefix specified here.
3526 /// Note: empty prefix is not allowed, please use regex instead.
3527 ///
3528 /// Examples:
3529 ///
3530 /// * ``abc`` matches the value ``abc.xyz``
3531 Prefix(std::string::String),
3532 /// The input string must have the suffix specified here.
3533 /// Note: empty prefix is not allowed, please use regex instead.
3534 ///
3535 /// Examples:
3536 ///
3537 /// * ``abc`` matches the value ``xyz.abc``
3538 Suffix(std::string::String),
3539 /// The input string must have the substring specified here.
3540 /// Note: empty contains match is not allowed, please use regex instead.
3541 ///
3542 /// Examples:
3543 ///
3544 /// * ``abc`` matches the value ``xyz.abc.def``
3545 Contains(std::string::String),
3546 }
3547 }
3548
3549 /// Represents a range of IP Addresses.
3550 #[derive(Clone, Default, PartialEq)]
3551 #[non_exhaustive]
3552 pub struct IpBlock {
3553 /// Required. The address prefix.
3554 pub prefix: std::string::String,
3555
3556 /// Required. The length of the address range.
3557 pub length: i32,
3558
3559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3560 }
3561
3562 impl IpBlock {
3563 /// Creates a new default instance.
3564 pub fn new() -> Self {
3565 std::default::Default::default()
3566 }
3567
3568 /// Sets the value of [prefix][crate::model::authz_policy::authz_rule::IpBlock::prefix].
3569 ///
3570 /// # Example
3571 /// ```ignore,no_run
3572 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3573 /// let x = IpBlock::new().set_prefix("example");
3574 /// ```
3575 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3576 self.prefix = v.into();
3577 self
3578 }
3579
3580 /// Sets the value of [length][crate::model::authz_policy::authz_rule::IpBlock::length].
3581 ///
3582 /// # Example
3583 /// ```ignore,no_run
3584 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3585 /// let x = IpBlock::new().set_length(42);
3586 /// ```
3587 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3588 self.length = v.into();
3589 self
3590 }
3591 }
3592
3593 impl wkt::message::Message for IpBlock {
3594 fn typename() -> &'static str {
3595 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock"
3596 }
3597 }
3598
3599 /// Describes the properties of a client VM resource accessing the internal
3600 /// application load balancers.
3601 #[derive(Clone, Default, PartialEq)]
3602 #[non_exhaustive]
3603 pub struct RequestResource {
3604 /// Optional. A list of resource tag value permanent IDs to match against
3605 /// the resource manager tags value associated with the source VM of a
3606 /// request.
3607 pub tag_value_id_set: std::option::Option<
3608 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3609 >,
3610
3611 /// Optional. An IAM service account to match against the source
3612 /// service account of the VM sending the request.
3613 pub iam_service_account:
3614 std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3615
3616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3617 }
3618
3619 impl RequestResource {
3620 /// Creates a new default instance.
3621 pub fn new() -> Self {
3622 std::default::Default::default()
3623 }
3624
3625 /// Sets the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3626 ///
3627 /// # Example
3628 /// ```ignore,no_run
3629 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3630 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3631 /// let x = RequestResource::new().set_tag_value_id_set(TagValueIdSet::default()/* use setters */);
3632 /// ```
3633 pub fn set_tag_value_id_set<T>(mut self, v: T) -> Self
3634 where
3635 T: std::convert::Into<
3636 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3637 >,
3638 {
3639 self.tag_value_id_set = std::option::Option::Some(v.into());
3640 self
3641 }
3642
3643 /// Sets or clears the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3644 ///
3645 /// # Example
3646 /// ```ignore,no_run
3647 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3648 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3649 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(Some(TagValueIdSet::default()/* use setters */));
3650 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(None::<TagValueIdSet>);
3651 /// ```
3652 pub fn set_or_clear_tag_value_id_set<T>(mut self, v: std::option::Option<T>) -> Self
3653 where
3654 T: std::convert::Into<
3655 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3656 >,
3657 {
3658 self.tag_value_id_set = v.map(|x| x.into());
3659 self
3660 }
3661
3662 /// Sets the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3663 ///
3664 /// # Example
3665 /// ```ignore,no_run
3666 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3667 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3668 /// let x = RequestResource::new().set_iam_service_account(StringMatch::default()/* use setters */);
3669 /// ```
3670 pub fn set_iam_service_account<T>(mut self, v: T) -> Self
3671 where
3672 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3673 {
3674 self.iam_service_account = std::option::Option::Some(v.into());
3675 self
3676 }
3677
3678 /// Sets or clears the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3679 ///
3680 /// # Example
3681 /// ```ignore,no_run
3682 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3683 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3684 /// let x = RequestResource::new().set_or_clear_iam_service_account(Some(StringMatch::default()/* use setters */));
3685 /// let x = RequestResource::new().set_or_clear_iam_service_account(None::<StringMatch>);
3686 /// ```
3687 pub fn set_or_clear_iam_service_account<T>(mut self, v: std::option::Option<T>) -> Self
3688 where
3689 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3690 {
3691 self.iam_service_account = v.map(|x| x.into());
3692 self
3693 }
3694 }
3695
3696 impl wkt::message::Message for RequestResource {
3697 fn typename() -> &'static str {
3698 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource"
3699 }
3700 }
3701
3702 /// Defines additional types related to [RequestResource].
3703 pub mod request_resource {
3704 #[allow(unused_imports)]
3705 use super::*;
3706
3707 /// Describes a set of resource tag value permanent IDs to match against
3708 /// the resource manager tags value associated with the source VM of a
3709 /// request.
3710 #[derive(Clone, Default, PartialEq)]
3711 #[non_exhaustive]
3712 pub struct TagValueIdSet {
3713 /// Required. A list of resource tag value permanent IDs to match against
3714 /// the resource manager tags value associated with the source VM of a
3715 /// request. The match follows AND semantics which means all
3716 /// the ids must match. Limited to 5 ids in the Tag value id set.
3717 pub ids: std::vec::Vec<i64>,
3718
3719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3720 }
3721
3722 impl TagValueIdSet {
3723 /// Creates a new default instance.
3724 pub fn new() -> Self {
3725 std::default::Default::default()
3726 }
3727
3728 /// Sets the value of [ids][crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet::ids].
3729 ///
3730 /// # Example
3731 /// ```ignore,no_run
3732 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3733 /// let x = TagValueIdSet::new().set_ids([1, 2, 3]);
3734 /// ```
3735 pub fn set_ids<T, V>(mut self, v: T) -> Self
3736 where
3737 T: std::iter::IntoIterator<Item = V>,
3738 V: std::convert::Into<i64>,
3739 {
3740 use std::iter::Iterator;
3741 self.ids = v.into_iter().map(|i| i.into()).collect();
3742 self
3743 }
3744 }
3745
3746 impl wkt::message::Message for TagValueIdSet {
3747 fn typename() -> &'static str {
3748 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet"
3749 }
3750 }
3751 }
3752
3753 /// Determines how a HTTP header should be matched.
3754 #[derive(Clone, Default, PartialEq)]
3755 #[non_exhaustive]
3756 pub struct HeaderMatch {
3757 /// Optional. Specifies the name of the header in the request.
3758 pub name: std::string::String,
3759
3760 /// Optional. Specifies how the header match will be performed.
3761 pub value: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3762
3763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3764 }
3765
3766 impl HeaderMatch {
3767 /// Creates a new default instance.
3768 pub fn new() -> Self {
3769 std::default::Default::default()
3770 }
3771
3772 /// Sets the value of [name][crate::model::authz_policy::authz_rule::HeaderMatch::name].
3773 ///
3774 /// # Example
3775 /// ```ignore,no_run
3776 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3777 /// let x = HeaderMatch::new().set_name("example");
3778 /// ```
3779 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3780 self.name = v.into();
3781 self
3782 }
3783
3784 /// Sets the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3785 ///
3786 /// # Example
3787 /// ```ignore,no_run
3788 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3789 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3790 /// let x = HeaderMatch::new().set_value(StringMatch::default()/* use setters */);
3791 /// ```
3792 pub fn set_value<T>(mut self, v: T) -> Self
3793 where
3794 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3795 {
3796 self.value = std::option::Option::Some(v.into());
3797 self
3798 }
3799
3800 /// Sets or clears the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3801 ///
3802 /// # Example
3803 /// ```ignore,no_run
3804 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3805 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3806 /// let x = HeaderMatch::new().set_or_clear_value(Some(StringMatch::default()/* use setters */));
3807 /// let x = HeaderMatch::new().set_or_clear_value(None::<StringMatch>);
3808 /// ```
3809 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
3810 where
3811 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3812 {
3813 self.value = v.map(|x| x.into());
3814 self
3815 }
3816 }
3817
3818 impl wkt::message::Message for HeaderMatch {
3819 fn typename() -> &'static str {
3820 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch"
3821 }
3822 }
3823
3824 /// Describes the properties of a principal to be matched against.
3825 #[derive(Clone, Default, PartialEq)]
3826 #[non_exhaustive]
3827 pub struct Principal {
3828 /// Optional. An enum to decide what principal value the principal rule
3829 /// will match against. If not specified, the PrincipalSelector is
3830 /// CLIENT_CERT_URI_SAN.
3831 pub principal_selector:
3832 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3833
3834 /// Required. A non-empty string whose value is matched against the
3835 /// principal value based on the principal_selector. Only exact match can
3836 /// be applied for CLIENT_CERT_URI_SAN, CLIENT_CERT_DNS_NAME_SAN,
3837 /// CLIENT_CERT_COMMON_NAME selectors.
3838 pub principal: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3839
3840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3841 }
3842
3843 impl Principal {
3844 /// Creates a new default instance.
3845 pub fn new() -> Self {
3846 std::default::Default::default()
3847 }
3848
3849 /// Sets the value of [principal_selector][crate::model::authz_policy::authz_rule::Principal::principal_selector].
3850 ///
3851 /// # Example
3852 /// ```ignore,no_run
3853 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3854 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::principal::PrincipalSelector;
3855 /// let x0 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertUriSan);
3856 /// let x1 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertDnsNameSan);
3857 /// let x2 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertCommonName);
3858 /// ```
3859 pub fn set_principal_selector<
3860 T: std::convert::Into<
3861 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3862 >,
3863 >(
3864 mut self,
3865 v: T,
3866 ) -> Self {
3867 self.principal_selector = v.into();
3868 self
3869 }
3870
3871 /// Sets the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3876 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3877 /// let x = Principal::new().set_principal(StringMatch::default()/* use setters */);
3878 /// ```
3879 pub fn set_principal<T>(mut self, v: T) -> Self
3880 where
3881 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3882 {
3883 self.principal = std::option::Option::Some(v.into());
3884 self
3885 }
3886
3887 /// Sets or clears the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3888 ///
3889 /// # Example
3890 /// ```ignore,no_run
3891 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3892 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3893 /// let x = Principal::new().set_or_clear_principal(Some(StringMatch::default()/* use setters */));
3894 /// let x = Principal::new().set_or_clear_principal(None::<StringMatch>);
3895 /// ```
3896 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
3897 where
3898 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3899 {
3900 self.principal = v.map(|x| x.into());
3901 self
3902 }
3903 }
3904
3905 impl wkt::message::Message for Principal {
3906 fn typename() -> &'static str {
3907 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal"
3908 }
3909 }
3910
3911 /// Defines additional types related to [Principal].
3912 pub mod principal {
3913 #[allow(unused_imports)]
3914 use super::*;
3915
3916 /// The principal value the principal rule will match against.
3917 ///
3918 /// # Working with unknown values
3919 ///
3920 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3921 /// additional enum variants at any time. Adding new variants is not considered
3922 /// a breaking change. Applications should write their code in anticipation of:
3923 ///
3924 /// - New values appearing in future releases of the client library, **and**
3925 /// - New values received dynamically, without application changes.
3926 ///
3927 /// Please consult the [Working with enums] section in the user guide for some
3928 /// guidelines.
3929 ///
3930 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3931 #[derive(Clone, Debug, PartialEq)]
3932 #[non_exhaustive]
3933 pub enum PrincipalSelector {
3934 /// Unspecified principal selector. It will be treated as
3935 /// CLIENT_CERT_URI_SAN by default.
3936 Unspecified,
3937 /// The principal rule is matched against a list of URI SANs in the
3938 /// validated client's certificate. A match happens when there is any
3939 /// exact URI SAN value match. This is the default principal selector.
3940 ClientCertUriSan,
3941 /// The principal rule is matched against a list of DNS Name SANs in the
3942 /// validated client's certificate. A match happens when there is any
3943 /// exact DNS Name SAN value match.
3944 /// This is only applicable for Application Load Balancers
3945 /// except for classic Global External Application load balancer.
3946 /// CLIENT_CERT_DNS_NAME_SAN is not supported for INTERNAL_SELF_MANAGED
3947 /// load balancing scheme.
3948 ClientCertDnsNameSan,
3949 /// The principal rule is matched against the common name in the client's
3950 /// certificate. Authorization against multiple common names in the
3951 /// client certificate is not supported. Requests with multiple common
3952 /// names in the client certificate will be rejected if
3953 /// CLIENT_CERT_COMMON_NAME is set as the principal selector. A match
3954 /// happens when there is an exact common name value match.
3955 /// This is only applicable for Application Load Balancers
3956 /// except for global external Application Load Balancer and
3957 /// classic Application Load Balancer.
3958 /// CLIENT_CERT_COMMON_NAME is not supported for INTERNAL_SELF_MANAGED
3959 /// load balancing scheme.
3960 ClientCertCommonName,
3961 /// If set, the enum was initialized with an unknown value.
3962 ///
3963 /// Applications can examine the value using [PrincipalSelector::value] or
3964 /// [PrincipalSelector::name].
3965 UnknownValue(principal_selector::UnknownValue),
3966 }
3967
3968 #[doc(hidden)]
3969 pub mod principal_selector {
3970 #[allow(unused_imports)]
3971 use super::*;
3972 #[derive(Clone, Debug, PartialEq)]
3973 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3974 }
3975
3976 impl PrincipalSelector {
3977 /// Gets the enum value.
3978 ///
3979 /// Returns `None` if the enum contains an unknown value deserialized from
3980 /// the string representation of enums.
3981 pub fn value(&self) -> std::option::Option<i32> {
3982 match self {
3983 Self::Unspecified => std::option::Option::Some(0),
3984 Self::ClientCertUriSan => std::option::Option::Some(1),
3985 Self::ClientCertDnsNameSan => std::option::Option::Some(2),
3986 Self::ClientCertCommonName => std::option::Option::Some(3),
3987 Self::UnknownValue(u) => u.0.value(),
3988 }
3989 }
3990
3991 /// Gets the enum value as a string.
3992 ///
3993 /// Returns `None` if the enum contains an unknown value deserialized from
3994 /// the integer representation of enums.
3995 pub fn name(&self) -> std::option::Option<&str> {
3996 match self {
3997 Self::Unspecified => {
3998 std::option::Option::Some("PRINCIPAL_SELECTOR_UNSPECIFIED")
3999 }
4000 Self::ClientCertUriSan => std::option::Option::Some("CLIENT_CERT_URI_SAN"),
4001 Self::ClientCertDnsNameSan => {
4002 std::option::Option::Some("CLIENT_CERT_DNS_NAME_SAN")
4003 }
4004 Self::ClientCertCommonName => {
4005 std::option::Option::Some("CLIENT_CERT_COMMON_NAME")
4006 }
4007 Self::UnknownValue(u) => u.0.name(),
4008 }
4009 }
4010 }
4011
4012 impl std::default::Default for PrincipalSelector {
4013 fn default() -> Self {
4014 use std::convert::From;
4015 Self::from(0)
4016 }
4017 }
4018
4019 impl std::fmt::Display for PrincipalSelector {
4020 fn fmt(
4021 &self,
4022 f: &mut std::fmt::Formatter<'_>,
4023 ) -> std::result::Result<(), std::fmt::Error> {
4024 wkt::internal::display_enum(f, self.name(), self.value())
4025 }
4026 }
4027
4028 impl std::convert::From<i32> for PrincipalSelector {
4029 fn from(value: i32) -> Self {
4030 match value {
4031 0 => Self::Unspecified,
4032 1 => Self::ClientCertUriSan,
4033 2 => Self::ClientCertDnsNameSan,
4034 3 => Self::ClientCertCommonName,
4035 _ => Self::UnknownValue(principal_selector::UnknownValue(
4036 wkt::internal::UnknownEnumValue::Integer(value),
4037 )),
4038 }
4039 }
4040 }
4041
4042 impl std::convert::From<&str> for PrincipalSelector {
4043 fn from(value: &str) -> Self {
4044 use std::string::ToString;
4045 match value {
4046 "PRINCIPAL_SELECTOR_UNSPECIFIED" => Self::Unspecified,
4047 "CLIENT_CERT_URI_SAN" => Self::ClientCertUriSan,
4048 "CLIENT_CERT_DNS_NAME_SAN" => Self::ClientCertDnsNameSan,
4049 "CLIENT_CERT_COMMON_NAME" => Self::ClientCertCommonName,
4050 _ => Self::UnknownValue(principal_selector::UnknownValue(
4051 wkt::internal::UnknownEnumValue::String(value.to_string()),
4052 )),
4053 }
4054 }
4055 }
4056
4057 impl serde::ser::Serialize for PrincipalSelector {
4058 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4059 where
4060 S: serde::Serializer,
4061 {
4062 match self {
4063 Self::Unspecified => serializer.serialize_i32(0),
4064 Self::ClientCertUriSan => serializer.serialize_i32(1),
4065 Self::ClientCertDnsNameSan => serializer.serialize_i32(2),
4066 Self::ClientCertCommonName => serializer.serialize_i32(3),
4067 Self::UnknownValue(u) => u.0.serialize(serializer),
4068 }
4069 }
4070 }
4071
4072 impl<'de> serde::de::Deserialize<'de> for PrincipalSelector {
4073 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4074 where
4075 D: serde::Deserializer<'de>,
4076 {
4077 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrincipalSelector>::new(
4078 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector"))
4079 }
4080 }
4081 }
4082
4083 /// Describes properties of one or more sources of a request.
4084 #[derive(Clone, Default, PartialEq)]
4085 #[non_exhaustive]
4086 pub struct From {
4087 /// Optional. Describes the properties of a request's sources. At least one
4088 /// of sources or notSources must be specified. Limited to 1 source.
4089 /// A match occurs when ANY source (in sources or notSources) matches the
4090 /// request. Within a single source, the match follows AND semantics
4091 /// across fields and OR semantics within a single field, i.e. a match
4092 /// occurs when ANY principal matches AND ANY ipBlocks match.
4093 pub sources: std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4094
4095 /// Optional. Describes the negated properties of request sources. Matches
4096 /// requests from sources that do not match the criteria specified in this
4097 /// field. At least one of sources or notSources must be specified.
4098 pub not_sources:
4099 std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
4100
4101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4102 }
4103
4104 impl From {
4105 /// Creates a new default instance.
4106 pub fn new() -> Self {
4107 std::default::Default::default()
4108 }
4109
4110 /// Sets the value of [sources][crate::model::authz_policy::authz_rule::From::sources].
4111 ///
4112 /// # Example
4113 /// ```ignore,no_run
4114 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4115 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4116 /// let x = From::new()
4117 /// .set_sources([
4118 /// RequestSource::default()/* use setters */,
4119 /// RequestSource::default()/* use (different) setters */,
4120 /// ]);
4121 /// ```
4122 pub fn set_sources<T, V>(mut self, v: T) -> Self
4123 where
4124 T: std::iter::IntoIterator<Item = V>,
4125 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4126 {
4127 use std::iter::Iterator;
4128 self.sources = v.into_iter().map(|i| i.into()).collect();
4129 self
4130 }
4131
4132 /// Sets the value of [not_sources][crate::model::authz_policy::authz_rule::From::not_sources].
4133 ///
4134 /// # Example
4135 /// ```ignore,no_run
4136 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4137 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4138 /// let x = From::new()
4139 /// .set_not_sources([
4140 /// RequestSource::default()/* use setters */,
4141 /// RequestSource::default()/* use (different) setters */,
4142 /// ]);
4143 /// ```
4144 pub fn set_not_sources<T, V>(mut self, v: T) -> Self
4145 where
4146 T: std::iter::IntoIterator<Item = V>,
4147 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4148 {
4149 use std::iter::Iterator;
4150 self.not_sources = v.into_iter().map(|i| i.into()).collect();
4151 self
4152 }
4153 }
4154
4155 impl wkt::message::Message for From {
4156 fn typename() -> &'static str {
4157 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From"
4158 }
4159 }
4160
4161 /// Defines additional types related to [From].
4162 pub mod from {
4163 #[allow(unused_imports)]
4164 use super::*;
4165
4166 /// Describes the properties of a single source.
4167 #[derive(Clone, Default, PartialEq)]
4168 #[non_exhaustive]
4169 pub struct RequestSource {
4170 /// Optional. A list of identities derived from the client's certificate.
4171 /// This field will not match on a request unless frontend mutual TLS is
4172 /// enabled for the forwarding rule or Gateway and the client certificate
4173 /// has been successfully validated by mTLS.
4174 /// Each identity is a string whose value is matched against a list of
4175 /// URI SANs, DNS Name SANs, or the common name in the client's
4176 /// certificate. A match happens when any principal matches with the
4177 /// rule. Limited to 50 principals per Authorization Policy for regional
4178 /// internal Application Load Balancers, regional external Application
4179 /// Load Balancers, cross-region internal Application Load Balancers, and
4180 /// Cloud Service Mesh. This field is not supported for global external
4181 /// Application Load Balancers.
4182 pub principals: std::vec::Vec<crate::model::authz_policy::authz_rule::Principal>,
4183
4184 /// Optional. A list of IP addresses or IP address ranges to match
4185 /// against the source IP address of the request. Limited to 10 ip_blocks
4186 /// per Authorization Policy
4187 pub ip_blocks: std::vec::Vec<crate::model::authz_policy::authz_rule::IpBlock>,
4188
4189 /// Optional. A list of resources to match against the resource of the
4190 /// source VM of a request. Limited to 10 resources per Authorization
4191 /// Policy.
4192 pub resources:
4193 std::vec::Vec<crate::model::authz_policy::authz_rule::RequestResource>,
4194
4195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4196 }
4197
4198 impl RequestSource {
4199 /// Creates a new default instance.
4200 pub fn new() -> Self {
4201 std::default::Default::default()
4202 }
4203
4204 /// Sets the value of [principals][crate::model::authz_policy::authz_rule::from::RequestSource::principals].
4205 ///
4206 /// # Example
4207 /// ```ignore,no_run
4208 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4209 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
4210 /// let x = RequestSource::new()
4211 /// .set_principals([
4212 /// Principal::default()/* use setters */,
4213 /// Principal::default()/* use (different) setters */,
4214 /// ]);
4215 /// ```
4216 pub fn set_principals<T, V>(mut self, v: T) -> Self
4217 where
4218 T: std::iter::IntoIterator<Item = V>,
4219 V: std::convert::Into<crate::model::authz_policy::authz_rule::Principal>,
4220 {
4221 use std::iter::Iterator;
4222 self.principals = v.into_iter().map(|i| i.into()).collect();
4223 self
4224 }
4225
4226 /// Sets the value of [ip_blocks][crate::model::authz_policy::authz_rule::from::RequestSource::ip_blocks].
4227 ///
4228 /// # Example
4229 /// ```ignore,no_run
4230 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4231 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
4232 /// let x = RequestSource::new()
4233 /// .set_ip_blocks([
4234 /// IpBlock::default()/* use setters */,
4235 /// IpBlock::default()/* use (different) setters */,
4236 /// ]);
4237 /// ```
4238 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
4239 where
4240 T: std::iter::IntoIterator<Item = V>,
4241 V: std::convert::Into<crate::model::authz_policy::authz_rule::IpBlock>,
4242 {
4243 use std::iter::Iterator;
4244 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
4245 self
4246 }
4247
4248 /// Sets the value of [resources][crate::model::authz_policy::authz_rule::from::RequestSource::resources].
4249 ///
4250 /// # Example
4251 /// ```ignore,no_run
4252 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4253 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
4254 /// let x = RequestSource::new()
4255 /// .set_resources([
4256 /// RequestResource::default()/* use setters */,
4257 /// RequestResource::default()/* use (different) setters */,
4258 /// ]);
4259 /// ```
4260 pub fn set_resources<T, V>(mut self, v: T) -> Self
4261 where
4262 T: std::iter::IntoIterator<Item = V>,
4263 V: std::convert::Into<crate::model::authz_policy::authz_rule::RequestResource>,
4264 {
4265 use std::iter::Iterator;
4266 self.resources = v.into_iter().map(|i| i.into()).collect();
4267 self
4268 }
4269 }
4270
4271 impl wkt::message::Message for RequestSource {
4272 fn typename() -> &'static str {
4273 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource"
4274 }
4275 }
4276 }
4277
4278 /// Describes properties of one or more targets of a request.
4279 #[derive(Clone, Default, PartialEq)]
4280 #[non_exhaustive]
4281 pub struct To {
4282 /// Optional. Describes properties of one or more targets of a request. At
4283 /// least one of operations or notOperations must be specified. Limited to
4284 /// 1 operation. A match occurs when ANY operation (in operations or
4285 /// notOperations) matches. Within an operation, the match follows AND
4286 /// semantics across fields and OR semantics within a field, i.e. a match
4287 /// occurs when ANY path matches AND ANY header matches and ANY method
4288 /// matches.
4289 pub operations:
4290 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4291
4292 /// Optional. Describes the negated properties of the targets of a request.
4293 /// Matches requests for operations that do not match the criteria
4294 /// specified in this field. At least one of operations or notOperations
4295 /// must be specified.
4296 pub not_operations:
4297 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4298
4299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4300 }
4301
4302 impl To {
4303 /// Creates a new default instance.
4304 pub fn new() -> Self {
4305 std::default::Default::default()
4306 }
4307
4308 /// Sets the value of [operations][crate::model::authz_policy::authz_rule::To::operations].
4309 ///
4310 /// # Example
4311 /// ```ignore,no_run
4312 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4313 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4314 /// let x = To::new()
4315 /// .set_operations([
4316 /// RequestOperation::default()/* use setters */,
4317 /// RequestOperation::default()/* use (different) setters */,
4318 /// ]);
4319 /// ```
4320 pub fn set_operations<T, V>(mut self, v: T) -> Self
4321 where
4322 T: std::iter::IntoIterator<Item = V>,
4323 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4324 {
4325 use std::iter::Iterator;
4326 self.operations = v.into_iter().map(|i| i.into()).collect();
4327 self
4328 }
4329
4330 /// Sets the value of [not_operations][crate::model::authz_policy::authz_rule::To::not_operations].
4331 ///
4332 /// # Example
4333 /// ```ignore,no_run
4334 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4335 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4336 /// let x = To::new()
4337 /// .set_not_operations([
4338 /// RequestOperation::default()/* use setters */,
4339 /// RequestOperation::default()/* use (different) setters */,
4340 /// ]);
4341 /// ```
4342 pub fn set_not_operations<T, V>(mut self, v: T) -> Self
4343 where
4344 T: std::iter::IntoIterator<Item = V>,
4345 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4346 {
4347 use std::iter::Iterator;
4348 self.not_operations = v.into_iter().map(|i| i.into()).collect();
4349 self
4350 }
4351 }
4352
4353 impl wkt::message::Message for To {
4354 fn typename() -> &'static str {
4355 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To"
4356 }
4357 }
4358
4359 /// Defines additional types related to [To].
4360 pub mod to {
4361 #[allow(unused_imports)]
4362 use super::*;
4363
4364 /// Describes properties of one or more targets of a request.
4365 #[derive(Clone, Default, PartialEq)]
4366 #[non_exhaustive]
4367 pub struct RequestOperation {
4368 /// Optional. A list of headers to match against in http header.
4369 pub header_set: std::option::Option<
4370 crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet,
4371 >,
4372
4373 /// Optional. A list of HTTP Hosts to match against. The match can be one
4374 /// of exact, prefix, suffix, or contains (substring match). Matches are
4375 /// always case sensitive unless the ignoreCase is set. Limited to 10
4376 /// hosts per Authorization Policy.
4377 pub hosts: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4378
4379 /// Optional. A list of paths to match against. The match can be one of
4380 /// exact, prefix, suffix, or contains (substring match). Matches are
4381 /// always case sensitive unless the ignoreCase is set. Limited to 10
4382 /// paths per Authorization Policy.
4383 /// Note that this path match includes the query parameters. For gRPC
4384 /// services, this should be a fully-qualified name of the form
4385 /// /package.service/method.
4386 pub paths: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4387
4388 /// Optional. A list of HTTP methods to match against. Each entry must be
4389 /// a valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE,
4390 /// OPTIONS). It only allows exact match and is always case sensitive.
4391 /// Limited to 10 methods per Authorization Policy.
4392 pub methods: std::vec::Vec<std::string::String>,
4393
4394 /// Optional. Defines the MCP protocol attributes to match on. If the MCP
4395 /// payload in the request body cannot be successfully parsed, the
4396 /// request will be denied. This field can be set only for AuthzPolicies
4397 /// targeting AgentGateway resources.
4398 pub mcp: std::option::Option<
4399 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4400 >,
4401
4402 /// Optional. A list of SNIs to match against. The match can be one of
4403 /// exact, prefix, suffix, or contains (substring match). If there is no
4404 /// SNI (i.e. plaintext HTTP traffic), the request will be denied.
4405 /// Matches are always case sensitive unless the ignoreCase is set.
4406 /// Limited to 10 SNIs per Authorization Policy.
4407 pub snis: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4408
4409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4410 }
4411
4412 impl RequestOperation {
4413 /// Creates a new default instance.
4414 pub fn new() -> Self {
4415 std::default::Default::default()
4416 }
4417
4418 /// Sets the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4419 ///
4420 /// # Example
4421 /// ```ignore,no_run
4422 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4423 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4424 /// let x = RequestOperation::new().set_header_set(HeaderSet::default()/* use setters */);
4425 /// ```
4426 pub fn set_header_set<T>(mut self, v: T) -> Self
4427 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4428 {
4429 self.header_set = std::option::Option::Some(v.into());
4430 self
4431 }
4432
4433 /// Sets or clears the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4434 ///
4435 /// # Example
4436 /// ```ignore,no_run
4437 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4438 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4439 /// let x = RequestOperation::new().set_or_clear_header_set(Some(HeaderSet::default()/* use setters */));
4440 /// let x = RequestOperation::new().set_or_clear_header_set(None::<HeaderSet>);
4441 /// ```
4442 pub fn set_or_clear_header_set<T>(mut self, v: std::option::Option<T>) -> Self
4443 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4444 {
4445 self.header_set = v.map(|x| x.into());
4446 self
4447 }
4448
4449 /// Sets the value of [hosts][crate::model::authz_policy::authz_rule::to::RequestOperation::hosts].
4450 ///
4451 /// # Example
4452 /// ```ignore,no_run
4453 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4454 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4455 /// let x = RequestOperation::new()
4456 /// .set_hosts([
4457 /// StringMatch::default()/* use setters */,
4458 /// StringMatch::default()/* use (different) setters */,
4459 /// ]);
4460 /// ```
4461 pub fn set_hosts<T, V>(mut self, v: T) -> Self
4462 where
4463 T: std::iter::IntoIterator<Item = V>,
4464 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4465 {
4466 use std::iter::Iterator;
4467 self.hosts = v.into_iter().map(|i| i.into()).collect();
4468 self
4469 }
4470
4471 /// Sets the value of [paths][crate::model::authz_policy::authz_rule::to::RequestOperation::paths].
4472 ///
4473 /// # Example
4474 /// ```ignore,no_run
4475 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4476 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4477 /// let x = RequestOperation::new()
4478 /// .set_paths([
4479 /// StringMatch::default()/* use setters */,
4480 /// StringMatch::default()/* use (different) setters */,
4481 /// ]);
4482 /// ```
4483 pub fn set_paths<T, V>(mut self, v: T) -> Self
4484 where
4485 T: std::iter::IntoIterator<Item = V>,
4486 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4487 {
4488 use std::iter::Iterator;
4489 self.paths = v.into_iter().map(|i| i.into()).collect();
4490 self
4491 }
4492
4493 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::RequestOperation::methods].
4494 ///
4495 /// # Example
4496 /// ```ignore,no_run
4497 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4498 /// let x = RequestOperation::new().set_methods(["a", "b", "c"]);
4499 /// ```
4500 pub fn set_methods<T, V>(mut self, v: T) -> Self
4501 where
4502 T: std::iter::IntoIterator<Item = V>,
4503 V: std::convert::Into<std::string::String>,
4504 {
4505 use std::iter::Iterator;
4506 self.methods = v.into_iter().map(|i| i.into()).collect();
4507 self
4508 }
4509
4510 /// Sets the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4511 ///
4512 /// # Example
4513 /// ```ignore,no_run
4514 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4515 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4516 /// let x = RequestOperation::new().set_mcp(Mcp::default()/* use setters */);
4517 /// ```
4518 pub fn set_mcp<T>(mut self, v: T) -> Self
4519 where
4520 T: std::convert::Into<
4521 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4522 >,
4523 {
4524 self.mcp = std::option::Option::Some(v.into());
4525 self
4526 }
4527
4528 /// Sets or clears the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4529 ///
4530 /// # Example
4531 /// ```ignore,no_run
4532 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4533 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4534 /// let x = RequestOperation::new().set_or_clear_mcp(Some(Mcp::default()/* use setters */));
4535 /// let x = RequestOperation::new().set_or_clear_mcp(None::<Mcp>);
4536 /// ```
4537 pub fn set_or_clear_mcp<T>(mut self, v: std::option::Option<T>) -> Self
4538 where
4539 T: std::convert::Into<
4540 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4541 >,
4542 {
4543 self.mcp = v.map(|x| x.into());
4544 self
4545 }
4546
4547 /// Sets the value of [snis][crate::model::authz_policy::authz_rule::to::RequestOperation::snis].
4548 ///
4549 /// # Example
4550 /// ```ignore,no_run
4551 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4552 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4553 /// let x = RequestOperation::new()
4554 /// .set_snis([
4555 /// StringMatch::default()/* use setters */,
4556 /// StringMatch::default()/* use (different) setters */,
4557 /// ]);
4558 /// ```
4559 pub fn set_snis<T, V>(mut self, v: T) -> Self
4560 where
4561 T: std::iter::IntoIterator<Item = V>,
4562 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4563 {
4564 use std::iter::Iterator;
4565 self.snis = v.into_iter().map(|i| i.into()).collect();
4566 self
4567 }
4568 }
4569
4570 impl wkt::message::Message for RequestOperation {
4571 fn typename() -> &'static str {
4572 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation"
4573 }
4574 }
4575
4576 /// Defines additional types related to [RequestOperation].
4577 pub mod request_operation {
4578 #[allow(unused_imports)]
4579 use super::*;
4580
4581 /// Describes a set of HTTP headers to match against.
4582 #[derive(Clone, Default, PartialEq)]
4583 #[non_exhaustive]
4584 pub struct HeaderSet {
4585 /// Required. A list of headers to match against in http header.
4586 /// The match can be one of exact, prefix, suffix, or contains
4587 /// (substring match). The match follows AND semantics which means all
4588 /// the headers must match. Matches are always case sensitive unless
4589 /// the ignoreCase is set. Limited to 10 headers per Authorization
4590 /// Policy.
4591 pub headers: std::vec::Vec<crate::model::authz_policy::authz_rule::HeaderMatch>,
4592
4593 pub(crate) _unknown_fields:
4594 serde_json::Map<std::string::String, serde_json::Value>,
4595 }
4596
4597 impl HeaderSet {
4598 /// Creates a new default instance.
4599 pub fn new() -> Self {
4600 std::default::Default::default()
4601 }
4602
4603 /// Sets the value of [headers][crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet::headers].
4604 ///
4605 /// # Example
4606 /// ```ignore,no_run
4607 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4608 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
4609 /// let x = HeaderSet::new()
4610 /// .set_headers([
4611 /// HeaderMatch::default()/* use setters */,
4612 /// HeaderMatch::default()/* use (different) setters */,
4613 /// ]);
4614 /// ```
4615 pub fn set_headers<T, V>(mut self, v: T) -> Self
4616 where
4617 T: std::iter::IntoIterator<Item = V>,
4618 V: std::convert::Into<crate::model::authz_policy::authz_rule::HeaderMatch>,
4619 {
4620 use std::iter::Iterator;
4621 self.headers = v.into_iter().map(|i| i.into()).collect();
4622 self
4623 }
4624 }
4625
4626 impl wkt::message::Message for HeaderSet {
4627 fn typename() -> &'static str {
4628 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet"
4629 }
4630 }
4631
4632 /// Describes a set of MCP methods to match against.
4633 #[derive(Clone, Default, PartialEq)]
4634 #[non_exhaustive]
4635 pub struct MCPMethod {
4636 /// Required. The MCP method to match against. Allowed values are as
4637 /// follows:
4638 ///
4639 /// 1. `tools`, `prompts`, `resources` - these will match against all
4640 /// sub methods under the respective methods.
4641 /// 1. `prompts/list`, `tools/list`, `resources/list`,
4642 /// `resources/templates/list`
4643 /// 1. `prompts/get`, `tools/call`, `resources/subscribe`,
4644 /// `resources/unsubscribe`, `resources/read`
4645 /// Params cannot be specified for categories 1 and 2.
4646 pub name: std::string::String,
4647
4648 /// Optional. A list of MCP method parameters to match against. The
4649 /// match can be one of exact, prefix, suffix, or contains (substring
4650 /// match). Matches are always case sensitive unless the ignoreCase is
4651 /// set. Limited to 10 MCP method parameters per Authorization Policy.
4652 pub params: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4653
4654 pub(crate) _unknown_fields:
4655 serde_json::Map<std::string::String, serde_json::Value>,
4656 }
4657
4658 impl MCPMethod {
4659 /// Creates a new default instance.
4660 pub fn new() -> Self {
4661 std::default::Default::default()
4662 }
4663
4664 /// Sets the value of [name][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::name].
4665 ///
4666 /// # Example
4667 /// ```ignore,no_run
4668 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4669 /// let x = MCPMethod::new().set_name("example");
4670 /// ```
4671 pub fn set_name<T: std::convert::Into<std::string::String>>(
4672 mut self,
4673 v: T,
4674 ) -> Self {
4675 self.name = v.into();
4676 self
4677 }
4678
4679 /// Sets the value of [params][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::params].
4680 ///
4681 /// # Example
4682 /// ```ignore,no_run
4683 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4684 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4685 /// let x = MCPMethod::new()
4686 /// .set_params([
4687 /// StringMatch::default()/* use setters */,
4688 /// StringMatch::default()/* use (different) setters */,
4689 /// ]);
4690 /// ```
4691 pub fn set_params<T, V>(mut self, v: T) -> Self
4692 where
4693 T: std::iter::IntoIterator<Item = V>,
4694 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4695 {
4696 use std::iter::Iterator;
4697 self.params = v.into_iter().map(|i| i.into()).collect();
4698 self
4699 }
4700 }
4701
4702 impl wkt::message::Message for MCPMethod {
4703 fn typename() -> &'static str {
4704 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod"
4705 }
4706 }
4707
4708 /// Describes a set of MCP protocol attributes to match against for a
4709 /// given MCP request.
4710 #[derive(Clone, Default, PartialEq)]
4711 #[non_exhaustive]
4712 pub struct Mcp {
4713
4714 /// Optional. If specified, matches on the MCP protocol’s non-access
4715 /// specific methods namely:
4716 ///
4717 /// * initialize
4718 /// * completion/
4719 /// * logging/
4720 /// * notifications/
4721 /// * ping
4722 /// Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
4723 pub base_protocol_methods_option: crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption,
4724
4725 /// Optional. A list of MCP methods and associated parameters to match
4726 /// on. It is recommended to use this field to match on tools, prompts
4727 /// and resource accesses while setting the baseProtocolMethodsOption
4728 /// to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
4729 /// protocol methods.
4730 /// Limited to 10 MCP methods per Authorization Policy.
4731 pub methods: std::vec::Vec<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>,
4732
4733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4734 }
4735
4736 impl Mcp {
4737 /// Creates a new default instance.
4738 pub fn new() -> Self {
4739 std::default::Default::default()
4740 }
4741
4742 /// Sets the value of [base_protocol_methods_option][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::base_protocol_methods_option].
4743 ///
4744 /// # Example
4745 /// ```ignore,no_run
4746 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4747 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption;
4748 /// let x0 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::SkipBaseProtocolMethods);
4749 /// let x1 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::MatchBaseProtocolMethods);
4750 /// ```
4751 pub fn set_base_protocol_methods_option<T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption>>(mut self, v: T) -> Self{
4752 self.base_protocol_methods_option = v.into();
4753 self
4754 }
4755
4756 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::methods].
4757 ///
4758 /// # Example
4759 /// ```ignore,no_run
4760 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4761 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4762 /// let x = Mcp::new()
4763 /// .set_methods([
4764 /// MCPMethod::default()/* use setters */,
4765 /// MCPMethod::default()/* use (different) setters */,
4766 /// ]);
4767 /// ```
4768 pub fn set_methods<T, V>(mut self, v: T) -> Self
4769 where
4770 T: std::iter::IntoIterator<Item = V>,
4771 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>
4772 {
4773 use std::iter::Iterator;
4774 self.methods = v.into_iter().map(|i| i.into()).collect();
4775 self
4776 }
4777 }
4778
4779 impl wkt::message::Message for Mcp {
4780 fn typename() -> &'static str {
4781 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP"
4782 }
4783 }
4784
4785 /// Describes the option to match against the base MCP protocol methods.
4786 ///
4787 /// # Working with unknown values
4788 ///
4789 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4790 /// additional enum variants at any time. Adding new variants is not considered
4791 /// a breaking change. Applications should write their code in anticipation of:
4792 ///
4793 /// - New values appearing in future releases of the client library, **and**
4794 /// - New values received dynamically, without application changes.
4795 ///
4796 /// Please consult the [Working with enums] section in the user guide for some
4797 /// guidelines.
4798 ///
4799 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4800 #[derive(Clone, Debug, PartialEq)]
4801 #[non_exhaustive]
4802 pub enum BaseProtocolMethodsOption {
4803 /// Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS.
4804 Unspecified,
4805 /// Skip matching on the base MCP protocol methods.
4806 SkipBaseProtocolMethods,
4807 /// Match on the base MCP protocol methods.
4808 MatchBaseProtocolMethods,
4809 /// If set, the enum was initialized with an unknown value.
4810 ///
4811 /// Applications can examine the value using [BaseProtocolMethodsOption::value] or
4812 /// [BaseProtocolMethodsOption::name].
4813 UnknownValue(base_protocol_methods_option::UnknownValue),
4814 }
4815
4816 #[doc(hidden)]
4817 pub mod base_protocol_methods_option {
4818 #[allow(unused_imports)]
4819 use super::*;
4820 #[derive(Clone, Debug, PartialEq)]
4821 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4822 }
4823
4824 impl BaseProtocolMethodsOption {
4825 /// Gets the enum value.
4826 ///
4827 /// Returns `None` if the enum contains an unknown value deserialized from
4828 /// the string representation of enums.
4829 pub fn value(&self) -> std::option::Option<i32> {
4830 match self {
4831 Self::Unspecified => std::option::Option::Some(0),
4832 Self::SkipBaseProtocolMethods => std::option::Option::Some(1),
4833 Self::MatchBaseProtocolMethods => std::option::Option::Some(2),
4834 Self::UnknownValue(u) => u.0.value(),
4835 }
4836 }
4837
4838 /// Gets the enum value as a string.
4839 ///
4840 /// Returns `None` if the enum contains an unknown value deserialized from
4841 /// the integer representation of enums.
4842 pub fn name(&self) -> std::option::Option<&str> {
4843 match self {
4844 Self::Unspecified => std::option::Option::Some(
4845 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED",
4846 ),
4847 Self::SkipBaseProtocolMethods => {
4848 std::option::Option::Some("SKIP_BASE_PROTOCOL_METHODS")
4849 }
4850 Self::MatchBaseProtocolMethods => {
4851 std::option::Option::Some("MATCH_BASE_PROTOCOL_METHODS")
4852 }
4853 Self::UnknownValue(u) => u.0.name(),
4854 }
4855 }
4856 }
4857
4858 impl std::default::Default for BaseProtocolMethodsOption {
4859 fn default() -> Self {
4860 use std::convert::From;
4861 Self::from(0)
4862 }
4863 }
4864
4865 impl std::fmt::Display for BaseProtocolMethodsOption {
4866 fn fmt(
4867 &self,
4868 f: &mut std::fmt::Formatter<'_>,
4869 ) -> std::result::Result<(), std::fmt::Error> {
4870 wkt::internal::display_enum(f, self.name(), self.value())
4871 }
4872 }
4873
4874 impl std::convert::From<i32> for BaseProtocolMethodsOption {
4875 fn from(value: i32) -> Self {
4876 match value {
4877 0 => Self::Unspecified,
4878 1 => Self::SkipBaseProtocolMethods,
4879 2 => Self::MatchBaseProtocolMethods,
4880 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4881 wkt::internal::UnknownEnumValue::Integer(value),
4882 )),
4883 }
4884 }
4885 }
4886
4887 impl std::convert::From<&str> for BaseProtocolMethodsOption {
4888 fn from(value: &str) -> Self {
4889 use std::string::ToString;
4890 match value {
4891 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED" => Self::Unspecified,
4892 "SKIP_BASE_PROTOCOL_METHODS" => Self::SkipBaseProtocolMethods,
4893 "MATCH_BASE_PROTOCOL_METHODS" => Self::MatchBaseProtocolMethods,
4894 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4895 wkt::internal::UnknownEnumValue::String(value.to_string()),
4896 )),
4897 }
4898 }
4899 }
4900
4901 impl serde::ser::Serialize for BaseProtocolMethodsOption {
4902 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4903 where
4904 S: serde::Serializer,
4905 {
4906 match self {
4907 Self::Unspecified => serializer.serialize_i32(0),
4908 Self::SkipBaseProtocolMethods => serializer.serialize_i32(1),
4909 Self::MatchBaseProtocolMethods => serializer.serialize_i32(2),
4910 Self::UnknownValue(u) => u.0.serialize(serializer),
4911 }
4912 }
4913 }
4914
4915 impl<'de> serde::de::Deserialize<'de> for BaseProtocolMethodsOption {
4916 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4917 where
4918 D: serde::Deserializer<'de>,
4919 {
4920 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BaseProtocolMethodsOption>::new(
4921 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption"))
4922 }
4923 }
4924 }
4925 }
4926 }
4927
4928 /// Allows delegating authorization decisions to Cloud IAP or to
4929 /// Service Extensions.
4930 #[derive(Clone, Default, PartialEq)]
4931 #[non_exhaustive]
4932 pub struct CustomProvider {
4933 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4934 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4935 /// level is not compatible with Cloud IAP settings in the BackendService.
4936 /// Enabling IAP in both places will result in request failure. Ensure that
4937 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4938 /// both places.
4939 pub cloud_iap: std::option::Option<crate::model::authz_policy::custom_provider::CloudIap>,
4940
4941 /// Optional. Delegate authorization decision to user authored Service
4942 /// Extension. Only one of cloudIap or authzExtension can be specified.
4943 pub authz_extension:
4944 std::option::Option<crate::model::authz_policy::custom_provider::AuthzExtension>,
4945
4946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4947 }
4948
4949 impl CustomProvider {
4950 /// Creates a new default instance.
4951 pub fn new() -> Self {
4952 std::default::Default::default()
4953 }
4954
4955 /// Sets the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4956 ///
4957 /// # Example
4958 /// ```ignore,no_run
4959 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4960 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4961 /// let x = CustomProvider::new().set_cloud_iap(CloudIap::default()/* use setters */);
4962 /// ```
4963 pub fn set_cloud_iap<T>(mut self, v: T) -> Self
4964 where
4965 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4966 {
4967 self.cloud_iap = std::option::Option::Some(v.into());
4968 self
4969 }
4970
4971 /// Sets or clears the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4972 ///
4973 /// # Example
4974 /// ```ignore,no_run
4975 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4976 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4977 /// let x = CustomProvider::new().set_or_clear_cloud_iap(Some(CloudIap::default()/* use setters */));
4978 /// let x = CustomProvider::new().set_or_clear_cloud_iap(None::<CloudIap>);
4979 /// ```
4980 pub fn set_or_clear_cloud_iap<T>(mut self, v: std::option::Option<T>) -> Self
4981 where
4982 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4983 {
4984 self.cloud_iap = v.map(|x| x.into());
4985 self
4986 }
4987
4988 /// Sets the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4989 ///
4990 /// # Example
4991 /// ```ignore,no_run
4992 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4993 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4994 /// let x = CustomProvider::new().set_authz_extension(AuthzExtension::default()/* use setters */);
4995 /// ```
4996 pub fn set_authz_extension<T>(mut self, v: T) -> Self
4997 where
4998 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
4999 {
5000 self.authz_extension = std::option::Option::Some(v.into());
5001 self
5002 }
5003
5004 /// Sets or clears the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
5005 ///
5006 /// # Example
5007 /// ```ignore,no_run
5008 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
5009 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
5010 /// let x = CustomProvider::new().set_or_clear_authz_extension(Some(AuthzExtension::default()/* use setters */));
5011 /// let x = CustomProvider::new().set_or_clear_authz_extension(None::<AuthzExtension>);
5012 /// ```
5013 pub fn set_or_clear_authz_extension<T>(mut self, v: std::option::Option<T>) -> Self
5014 where
5015 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
5016 {
5017 self.authz_extension = v.map(|x| x.into());
5018 self
5019 }
5020 }
5021
5022 impl wkt::message::Message for CustomProvider {
5023 fn typename() -> &'static str {
5024 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider"
5025 }
5026 }
5027
5028 /// Defines additional types related to [CustomProvider].
5029 pub mod custom_provider {
5030 #[allow(unused_imports)]
5031 use super::*;
5032
5033 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
5034 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
5035 /// level is not compatible with Cloud IAP settings in the BackendService.
5036 /// Enabling IAP in both places will result in request failure. Ensure that
5037 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
5038 /// both places.
5039 #[derive(Clone, Default, PartialEq)]
5040 #[non_exhaustive]
5041 pub struct CloudIap {
5042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5043 }
5044
5045 impl CloudIap {
5046 /// Creates a new default instance.
5047 pub fn new() -> Self {
5048 std::default::Default::default()
5049 }
5050 }
5051
5052 impl wkt::message::Message for CloudIap {
5053 fn typename() -> &'static str {
5054 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap"
5055 }
5056 }
5057
5058 /// Optional. Delegate authorization decision to user authored extension.
5059 /// Only one of cloudIap or authzExtension can be specified.
5060 #[derive(Clone, Default, PartialEq)]
5061 #[non_exhaustive]
5062 pub struct AuthzExtension {
5063 /// Required. A list of references to authorization
5064 /// extensions that will be invoked for requests matching this policy.
5065 /// Limited to 1 custom provider.
5066 pub resources: std::vec::Vec<std::string::String>,
5067
5068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5069 }
5070
5071 impl AuthzExtension {
5072 /// Creates a new default instance.
5073 pub fn new() -> Self {
5074 std::default::Default::default()
5075 }
5076
5077 /// Sets the value of [resources][crate::model::authz_policy::custom_provider::AuthzExtension::resources].
5078 ///
5079 /// # Example
5080 /// ```ignore,no_run
5081 /// # use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
5082 /// let x = AuthzExtension::new().set_resources(["a", "b", "c"]);
5083 /// ```
5084 pub fn set_resources<T, V>(mut self, v: T) -> Self
5085 where
5086 T: std::iter::IntoIterator<Item = V>,
5087 V: std::convert::Into<std::string::String>,
5088 {
5089 use std::iter::Iterator;
5090 self.resources = v.into_iter().map(|i| i.into()).collect();
5091 self
5092 }
5093 }
5094
5095 impl wkt::message::Message for AuthzExtension {
5096 fn typename() -> &'static str {
5097 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension"
5098 }
5099 }
5100 }
5101
5102 /// Load balancing schemes supported by the `AuthzPolicy` resource. The valid
5103 /// values are `INTERNAL_MANAGED` and
5104 /// `EXTERNAL_MANAGED`. For more information, refer to [Backend services
5105 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
5106 ///
5107 /// # Working with unknown values
5108 ///
5109 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5110 /// additional enum variants at any time. Adding new variants is not considered
5111 /// a breaking change. Applications should write their code in anticipation of:
5112 ///
5113 /// - New values appearing in future releases of the client library, **and**
5114 /// - New values received dynamically, without application changes.
5115 ///
5116 /// Please consult the [Working with enums] section in the user guide for some
5117 /// guidelines.
5118 ///
5119 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5120 #[derive(Clone, Debug, PartialEq)]
5121 #[non_exhaustive]
5122 pub enum LoadBalancingScheme {
5123 /// Default value. Do not use.
5124 Unspecified,
5125 /// Signifies that this is used for Regional internal or Cross-region
5126 /// internal Application Load Balancing.
5127 InternalManaged,
5128 /// Signifies that this is used for Global external or Regional external
5129 /// Application Load Balancing.
5130 ExternalManaged,
5131 /// Signifies that this is used for Cloud Service Mesh. Meant for use by
5132 /// CSM GKE controller only.
5133 InternalSelfManaged,
5134 /// If set, the enum was initialized with an unknown value.
5135 ///
5136 /// Applications can examine the value using [LoadBalancingScheme::value] or
5137 /// [LoadBalancingScheme::name].
5138 UnknownValue(load_balancing_scheme::UnknownValue),
5139 }
5140
5141 #[doc(hidden)]
5142 pub mod load_balancing_scheme {
5143 #[allow(unused_imports)]
5144 use super::*;
5145 #[derive(Clone, Debug, PartialEq)]
5146 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5147 }
5148
5149 impl LoadBalancingScheme {
5150 /// Gets the enum value.
5151 ///
5152 /// Returns `None` if the enum contains an unknown value deserialized from
5153 /// the string representation of enums.
5154 pub fn value(&self) -> std::option::Option<i32> {
5155 match self {
5156 Self::Unspecified => std::option::Option::Some(0),
5157 Self::InternalManaged => std::option::Option::Some(1),
5158 Self::ExternalManaged => std::option::Option::Some(2),
5159 Self::InternalSelfManaged => std::option::Option::Some(3),
5160 Self::UnknownValue(u) => u.0.value(),
5161 }
5162 }
5163
5164 /// Gets the enum value as a string.
5165 ///
5166 /// Returns `None` if the enum contains an unknown value deserialized from
5167 /// the integer representation of enums.
5168 pub fn name(&self) -> std::option::Option<&str> {
5169 match self {
5170 Self::Unspecified => std::option::Option::Some("LOAD_BALANCING_SCHEME_UNSPECIFIED"),
5171 Self::InternalManaged => std::option::Option::Some("INTERNAL_MANAGED"),
5172 Self::ExternalManaged => std::option::Option::Some("EXTERNAL_MANAGED"),
5173 Self::InternalSelfManaged => std::option::Option::Some("INTERNAL_SELF_MANAGED"),
5174 Self::UnknownValue(u) => u.0.name(),
5175 }
5176 }
5177 }
5178
5179 impl std::default::Default for LoadBalancingScheme {
5180 fn default() -> Self {
5181 use std::convert::From;
5182 Self::from(0)
5183 }
5184 }
5185
5186 impl std::fmt::Display for LoadBalancingScheme {
5187 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5188 wkt::internal::display_enum(f, self.name(), self.value())
5189 }
5190 }
5191
5192 impl std::convert::From<i32> for LoadBalancingScheme {
5193 fn from(value: i32) -> Self {
5194 match value {
5195 0 => Self::Unspecified,
5196 1 => Self::InternalManaged,
5197 2 => Self::ExternalManaged,
5198 3 => Self::InternalSelfManaged,
5199 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5200 wkt::internal::UnknownEnumValue::Integer(value),
5201 )),
5202 }
5203 }
5204 }
5205
5206 impl std::convert::From<&str> for LoadBalancingScheme {
5207 fn from(value: &str) -> Self {
5208 use std::string::ToString;
5209 match value {
5210 "LOAD_BALANCING_SCHEME_UNSPECIFIED" => Self::Unspecified,
5211 "INTERNAL_MANAGED" => Self::InternalManaged,
5212 "EXTERNAL_MANAGED" => Self::ExternalManaged,
5213 "INTERNAL_SELF_MANAGED" => Self::InternalSelfManaged,
5214 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5215 wkt::internal::UnknownEnumValue::String(value.to_string()),
5216 )),
5217 }
5218 }
5219 }
5220
5221 impl serde::ser::Serialize for LoadBalancingScheme {
5222 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5223 where
5224 S: serde::Serializer,
5225 {
5226 match self {
5227 Self::Unspecified => serializer.serialize_i32(0),
5228 Self::InternalManaged => serializer.serialize_i32(1),
5229 Self::ExternalManaged => serializer.serialize_i32(2),
5230 Self::InternalSelfManaged => serializer.serialize_i32(3),
5231 Self::UnknownValue(u) => u.0.serialize(serializer),
5232 }
5233 }
5234 }
5235
5236 impl<'de> serde::de::Deserialize<'de> for LoadBalancingScheme {
5237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5238 where
5239 D: serde::Deserializer<'de>,
5240 {
5241 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancingScheme>::new(
5242 ".google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme",
5243 ))
5244 }
5245 }
5246
5247 /// The action to be applied to this policy. Valid values are
5248 /// `ALLOW`, `DENY`, `CUSTOM`.
5249 ///
5250 /// # Working with unknown values
5251 ///
5252 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5253 /// additional enum variants at any time. Adding new variants is not considered
5254 /// a breaking change. Applications should write their code in anticipation of:
5255 ///
5256 /// - New values appearing in future releases of the client library, **and**
5257 /// - New values received dynamically, without application changes.
5258 ///
5259 /// Please consult the [Working with enums] section in the user guide for some
5260 /// guidelines.
5261 ///
5262 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5263 #[derive(Clone, Debug, PartialEq)]
5264 #[non_exhaustive]
5265 pub enum AuthzAction {
5266 /// Unspecified action.
5267 Unspecified,
5268 /// Allow request to pass through to the backend.
5269 Allow,
5270 /// Deny the request and return a HTTP 404 to the client.
5271 Deny,
5272 /// Delegate the authorization decision to an external authorization engine.
5273 Custom,
5274 /// If set, the enum was initialized with an unknown value.
5275 ///
5276 /// Applications can examine the value using [AuthzAction::value] or
5277 /// [AuthzAction::name].
5278 UnknownValue(authz_action::UnknownValue),
5279 }
5280
5281 #[doc(hidden)]
5282 pub mod authz_action {
5283 #[allow(unused_imports)]
5284 use super::*;
5285 #[derive(Clone, Debug, PartialEq)]
5286 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5287 }
5288
5289 impl AuthzAction {
5290 /// Gets the enum value.
5291 ///
5292 /// Returns `None` if the enum contains an unknown value deserialized from
5293 /// the string representation of enums.
5294 pub fn value(&self) -> std::option::Option<i32> {
5295 match self {
5296 Self::Unspecified => std::option::Option::Some(0),
5297 Self::Allow => std::option::Option::Some(1),
5298 Self::Deny => std::option::Option::Some(2),
5299 Self::Custom => std::option::Option::Some(3),
5300 Self::UnknownValue(u) => u.0.value(),
5301 }
5302 }
5303
5304 /// Gets the enum value as a string.
5305 ///
5306 /// Returns `None` if the enum contains an unknown value deserialized from
5307 /// the integer representation of enums.
5308 pub fn name(&self) -> std::option::Option<&str> {
5309 match self {
5310 Self::Unspecified => std::option::Option::Some("AUTHZ_ACTION_UNSPECIFIED"),
5311 Self::Allow => std::option::Option::Some("ALLOW"),
5312 Self::Deny => std::option::Option::Some("DENY"),
5313 Self::Custom => std::option::Option::Some("CUSTOM"),
5314 Self::UnknownValue(u) => u.0.name(),
5315 }
5316 }
5317 }
5318
5319 impl std::default::Default for AuthzAction {
5320 fn default() -> Self {
5321 use std::convert::From;
5322 Self::from(0)
5323 }
5324 }
5325
5326 impl std::fmt::Display for AuthzAction {
5327 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5328 wkt::internal::display_enum(f, self.name(), self.value())
5329 }
5330 }
5331
5332 impl std::convert::From<i32> for AuthzAction {
5333 fn from(value: i32) -> Self {
5334 match value {
5335 0 => Self::Unspecified,
5336 1 => Self::Allow,
5337 2 => Self::Deny,
5338 3 => Self::Custom,
5339 _ => Self::UnknownValue(authz_action::UnknownValue(
5340 wkt::internal::UnknownEnumValue::Integer(value),
5341 )),
5342 }
5343 }
5344 }
5345
5346 impl std::convert::From<&str> for AuthzAction {
5347 fn from(value: &str) -> Self {
5348 use std::string::ToString;
5349 match value {
5350 "AUTHZ_ACTION_UNSPECIFIED" => Self::Unspecified,
5351 "ALLOW" => Self::Allow,
5352 "DENY" => Self::Deny,
5353 "CUSTOM" => Self::Custom,
5354 _ => Self::UnknownValue(authz_action::UnknownValue(
5355 wkt::internal::UnknownEnumValue::String(value.to_string()),
5356 )),
5357 }
5358 }
5359 }
5360
5361 impl serde::ser::Serialize for AuthzAction {
5362 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5363 where
5364 S: serde::Serializer,
5365 {
5366 match self {
5367 Self::Unspecified => serializer.serialize_i32(0),
5368 Self::Allow => serializer.serialize_i32(1),
5369 Self::Deny => serializer.serialize_i32(2),
5370 Self::Custom => serializer.serialize_i32(3),
5371 Self::UnknownValue(u) => u.0.serialize(serializer),
5372 }
5373 }
5374 }
5375
5376 impl<'de> serde::de::Deserialize<'de> for AuthzAction {
5377 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5378 where
5379 D: serde::Deserializer<'de>,
5380 {
5381 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthzAction>::new(
5382 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction",
5383 ))
5384 }
5385 }
5386
5387 /// The type of authorization being performed.
5388 /// New values may be added in the future.
5389 ///
5390 /// # Working with unknown values
5391 ///
5392 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5393 /// additional enum variants at any time. Adding new variants is not considered
5394 /// a breaking change. Applications should write their code in anticipation of:
5395 ///
5396 /// - New values appearing in future releases of the client library, **and**
5397 /// - New values received dynamically, without application changes.
5398 ///
5399 /// Please consult the [Working with enums] section in the user guide for some
5400 /// guidelines.
5401 ///
5402 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5403 #[derive(Clone, Debug, PartialEq)]
5404 #[non_exhaustive]
5405 pub enum PolicyProfile {
5406 /// Unspecified policy profile.
5407 Unspecified,
5408 /// Applies to request authorization. `CUSTOM` authorization
5409 /// policies with Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or
5410 /// `EXT_PROC_GRPC` protocols. Extensions are invoked only for request header
5411 /// events.
5412 RequestAuthz,
5413 /// Applies to content security, sanitization, etc. Only
5414 /// `CUSTOM` action is allowed in this policy profile. AuthzExtensions in the
5415 /// custom provider must support `EXT_PROC_GRPC` protocol only and be capable
5416 /// of receiving all `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY,
5417 /// REQUEST_TRAILERS, RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS)
5418 /// with `FULL_DUPLEX_STREAMED` body send mode.
5419 ContentAuthz,
5420 /// If set, the enum was initialized with an unknown value.
5421 ///
5422 /// Applications can examine the value using [PolicyProfile::value] or
5423 /// [PolicyProfile::name].
5424 UnknownValue(policy_profile::UnknownValue),
5425 }
5426
5427 #[doc(hidden)]
5428 pub mod policy_profile {
5429 #[allow(unused_imports)]
5430 use super::*;
5431 #[derive(Clone, Debug, PartialEq)]
5432 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5433 }
5434
5435 impl PolicyProfile {
5436 /// Gets the enum value.
5437 ///
5438 /// Returns `None` if the enum contains an unknown value deserialized from
5439 /// the string representation of enums.
5440 pub fn value(&self) -> std::option::Option<i32> {
5441 match self {
5442 Self::Unspecified => std::option::Option::Some(0),
5443 Self::RequestAuthz => std::option::Option::Some(1),
5444 Self::ContentAuthz => std::option::Option::Some(2),
5445 Self::UnknownValue(u) => u.0.value(),
5446 }
5447 }
5448
5449 /// Gets the enum value as a string.
5450 ///
5451 /// Returns `None` if the enum contains an unknown value deserialized from
5452 /// the integer representation of enums.
5453 pub fn name(&self) -> std::option::Option<&str> {
5454 match self {
5455 Self::Unspecified => std::option::Option::Some("POLICY_PROFILE_UNSPECIFIED"),
5456 Self::RequestAuthz => std::option::Option::Some("REQUEST_AUTHZ"),
5457 Self::ContentAuthz => std::option::Option::Some("CONTENT_AUTHZ"),
5458 Self::UnknownValue(u) => u.0.name(),
5459 }
5460 }
5461 }
5462
5463 impl std::default::Default for PolicyProfile {
5464 fn default() -> Self {
5465 use std::convert::From;
5466 Self::from(0)
5467 }
5468 }
5469
5470 impl std::fmt::Display for PolicyProfile {
5471 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5472 wkt::internal::display_enum(f, self.name(), self.value())
5473 }
5474 }
5475
5476 impl std::convert::From<i32> for PolicyProfile {
5477 fn from(value: i32) -> Self {
5478 match value {
5479 0 => Self::Unspecified,
5480 1 => Self::RequestAuthz,
5481 2 => Self::ContentAuthz,
5482 _ => Self::UnknownValue(policy_profile::UnknownValue(
5483 wkt::internal::UnknownEnumValue::Integer(value),
5484 )),
5485 }
5486 }
5487 }
5488
5489 impl std::convert::From<&str> for PolicyProfile {
5490 fn from(value: &str) -> Self {
5491 use std::string::ToString;
5492 match value {
5493 "POLICY_PROFILE_UNSPECIFIED" => Self::Unspecified,
5494 "REQUEST_AUTHZ" => Self::RequestAuthz,
5495 "CONTENT_AUTHZ" => Self::ContentAuthz,
5496 _ => Self::UnknownValue(policy_profile::UnknownValue(
5497 wkt::internal::UnknownEnumValue::String(value.to_string()),
5498 )),
5499 }
5500 }
5501 }
5502
5503 impl serde::ser::Serialize for PolicyProfile {
5504 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5505 where
5506 S: serde::Serializer,
5507 {
5508 match self {
5509 Self::Unspecified => serializer.serialize_i32(0),
5510 Self::RequestAuthz => serializer.serialize_i32(1),
5511 Self::ContentAuthz => serializer.serialize_i32(2),
5512 Self::UnknownValue(u) => u.0.serialize(serializer),
5513 }
5514 }
5515 }
5516
5517 impl<'de> serde::de::Deserialize<'de> for PolicyProfile {
5518 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5519 where
5520 D: serde::Deserializer<'de>,
5521 {
5522 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyProfile>::new(
5523 ".google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile",
5524 ))
5525 }
5526 }
5527}
5528
5529/// Message for creating an `AuthzPolicy` resource.
5530#[derive(Clone, Default, PartialEq)]
5531#[non_exhaustive]
5532pub struct CreateAuthzPolicyRequest {
5533 /// Required. The parent resource of the `AuthzPolicy` resource. Must be in
5534 /// the format `projects/{project}/locations/{location}`.
5535 pub parent: std::string::String,
5536
5537 /// Required. User-provided ID of the `AuthzPolicy` resource to be created.
5538 pub authz_policy_id: std::string::String,
5539
5540 /// Required. `AuthzPolicy` resource to be created.
5541 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5542
5543 /// Optional. An optional request ID to identify requests. Specify a unique
5544 /// request ID so that if you must retry your request, the server can ignore
5545 /// the request if it has already been completed. The server guarantees
5546 /// that for at least 60 minutes since the first request.
5547 ///
5548 /// For example, consider a situation where you make an initial request and the
5549 /// request times out. If you make the request again with the same request
5550 /// ID, the server can check if original operation with the same request ID
5551 /// was received, and if so, ignores the second request. This prevents
5552 /// clients from accidentally creating duplicate commitments.
5553 ///
5554 /// The request ID must be a valid UUID with the exception that zero UUID is
5555 /// not supported (00000000-0000-0000-0000-000000000000).
5556 pub request_id: std::string::String,
5557
5558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5559}
5560
5561impl CreateAuthzPolicyRequest {
5562 /// Creates a new default instance.
5563 pub fn new() -> Self {
5564 std::default::Default::default()
5565 }
5566
5567 /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
5568 ///
5569 /// # Example
5570 /// ```ignore,no_run
5571 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5572 /// # let project_id = "project_id";
5573 /// # let location_id = "location_id";
5574 /// let x = CreateAuthzPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5575 /// ```
5576 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5577 self.parent = v.into();
5578 self
5579 }
5580
5581 /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
5582 ///
5583 /// # Example
5584 /// ```ignore,no_run
5585 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5586 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy_id("example");
5587 /// ```
5588 pub fn set_authz_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5589 self.authz_policy_id = v.into();
5590 self
5591 }
5592
5593 /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5594 ///
5595 /// # Example
5596 /// ```ignore,no_run
5597 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5598 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5599 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5600 /// ```
5601 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5602 where
5603 T: std::convert::Into<crate::model::AuthzPolicy>,
5604 {
5605 self.authz_policy = std::option::Option::Some(v.into());
5606 self
5607 }
5608
5609 /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5610 ///
5611 /// # Example
5612 /// ```ignore,no_run
5613 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5614 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5615 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5616 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5617 /// ```
5618 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5619 where
5620 T: std::convert::Into<crate::model::AuthzPolicy>,
5621 {
5622 self.authz_policy = v.map(|x| x.into());
5623 self
5624 }
5625
5626 /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
5627 ///
5628 /// # Example
5629 /// ```ignore,no_run
5630 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5631 /// let x = CreateAuthzPolicyRequest::new().set_request_id("example");
5632 /// ```
5633 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5634 self.request_id = v.into();
5635 self
5636 }
5637}
5638
5639impl wkt::message::Message for CreateAuthzPolicyRequest {
5640 fn typename() -> &'static str {
5641 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthzPolicyRequest"
5642 }
5643}
5644
5645/// Message for requesting list of `AuthzPolicy` resources.
5646#[derive(Clone, Default, PartialEq)]
5647#[non_exhaustive]
5648pub struct ListAuthzPoliciesRequest {
5649 /// Required. The project and location from which the `AuthzPolicy` resources
5650 /// are listed, specified in the following format:
5651 /// `projects/{project}/locations/{location}`.
5652 pub parent: std::string::String,
5653
5654 /// Optional. Requested page size. The server might return fewer items than
5655 /// requested. If unspecified, the server picks an appropriate default.
5656 pub page_size: i32,
5657
5658 /// Optional. A token identifying a page of results that the server returns.
5659 pub page_token: std::string::String,
5660
5661 /// Optional. Filtering results.
5662 pub filter: std::string::String,
5663
5664 /// Optional. Hint for how to order the results.
5665 pub order_by: std::string::String,
5666
5667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5668}
5669
5670impl ListAuthzPoliciesRequest {
5671 /// Creates a new default instance.
5672 pub fn new() -> Self {
5673 std::default::Default::default()
5674 }
5675
5676 /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
5677 ///
5678 /// # Example
5679 /// ```ignore,no_run
5680 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5681 /// # let project_id = "project_id";
5682 /// # let location_id = "location_id";
5683 /// let x = ListAuthzPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5684 /// ```
5685 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5686 self.parent = v.into();
5687 self
5688 }
5689
5690 /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
5691 ///
5692 /// # Example
5693 /// ```ignore,no_run
5694 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5695 /// let x = ListAuthzPoliciesRequest::new().set_page_size(42);
5696 /// ```
5697 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5698 self.page_size = v.into();
5699 self
5700 }
5701
5702 /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
5703 ///
5704 /// # Example
5705 /// ```ignore,no_run
5706 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5707 /// let x = ListAuthzPoliciesRequest::new().set_page_token("example");
5708 /// ```
5709 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5710 self.page_token = v.into();
5711 self
5712 }
5713
5714 /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
5715 ///
5716 /// # Example
5717 /// ```ignore,no_run
5718 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5719 /// let x = ListAuthzPoliciesRequest::new().set_filter("example");
5720 /// ```
5721 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5722 self.filter = v.into();
5723 self
5724 }
5725
5726 /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
5727 ///
5728 /// # Example
5729 /// ```ignore,no_run
5730 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5731 /// let x = ListAuthzPoliciesRequest::new().set_order_by("example");
5732 /// ```
5733 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5734 self.order_by = v.into();
5735 self
5736 }
5737}
5738
5739impl wkt::message::Message for ListAuthzPoliciesRequest {
5740 fn typename() -> &'static str {
5741 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesRequest"
5742 }
5743}
5744
5745/// Message for response to listing `AuthzPolicy` resources.
5746#[derive(Clone, Default, PartialEq)]
5747#[non_exhaustive]
5748pub struct ListAuthzPoliciesResponse {
5749 /// The list of `AuthzPolicy` resources.
5750 pub authz_policies: std::vec::Vec<crate::model::AuthzPolicy>,
5751
5752 /// A token identifying a page of results that the server returns.
5753 pub next_page_token: std::string::String,
5754
5755 /// Locations that could not be reached.
5756 pub unreachable: std::vec::Vec<std::string::String>,
5757
5758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5759}
5760
5761impl ListAuthzPoliciesResponse {
5762 /// Creates a new default instance.
5763 pub fn new() -> Self {
5764 std::default::Default::default()
5765 }
5766
5767 /// Sets the value of [authz_policies][crate::model::ListAuthzPoliciesResponse::authz_policies].
5768 ///
5769 /// # Example
5770 /// ```ignore,no_run
5771 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5772 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5773 /// let x = ListAuthzPoliciesResponse::new()
5774 /// .set_authz_policies([
5775 /// AuthzPolicy::default()/* use setters */,
5776 /// AuthzPolicy::default()/* use (different) setters */,
5777 /// ]);
5778 /// ```
5779 pub fn set_authz_policies<T, V>(mut self, v: T) -> Self
5780 where
5781 T: std::iter::IntoIterator<Item = V>,
5782 V: std::convert::Into<crate::model::AuthzPolicy>,
5783 {
5784 use std::iter::Iterator;
5785 self.authz_policies = v.into_iter().map(|i| i.into()).collect();
5786 self
5787 }
5788
5789 /// Sets the value of [next_page_token][crate::model::ListAuthzPoliciesResponse::next_page_token].
5790 ///
5791 /// # Example
5792 /// ```ignore,no_run
5793 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5794 /// let x = ListAuthzPoliciesResponse::new().set_next_page_token("example");
5795 /// ```
5796 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5797 self.next_page_token = v.into();
5798 self
5799 }
5800
5801 /// Sets the value of [unreachable][crate::model::ListAuthzPoliciesResponse::unreachable].
5802 ///
5803 /// # Example
5804 /// ```ignore,no_run
5805 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5806 /// let x = ListAuthzPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
5807 /// ```
5808 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5809 where
5810 T: std::iter::IntoIterator<Item = V>,
5811 V: std::convert::Into<std::string::String>,
5812 {
5813 use std::iter::Iterator;
5814 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5815 self
5816 }
5817}
5818
5819impl wkt::message::Message for ListAuthzPoliciesResponse {
5820 fn typename() -> &'static str {
5821 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesResponse"
5822 }
5823}
5824
5825#[doc(hidden)]
5826impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthzPoliciesResponse {
5827 type PageItem = crate::model::AuthzPolicy;
5828
5829 fn items(self) -> std::vec::Vec<Self::PageItem> {
5830 self.authz_policies
5831 }
5832
5833 fn next_page_token(&self) -> std::string::String {
5834 use std::clone::Clone;
5835 self.next_page_token.clone()
5836 }
5837}
5838
5839/// Message for getting a `AuthzPolicy` resource.
5840#[derive(Clone, Default, PartialEq)]
5841#[non_exhaustive]
5842pub struct GetAuthzPolicyRequest {
5843 /// Required. A name of the `AuthzPolicy` resource to get. Must be in the
5844 /// format
5845 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5846 pub name: std::string::String,
5847
5848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5849}
5850
5851impl GetAuthzPolicyRequest {
5852 /// Creates a new default instance.
5853 pub fn new() -> Self {
5854 std::default::Default::default()
5855 }
5856
5857 /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
5858 ///
5859 /// # Example
5860 /// ```ignore,no_run
5861 /// # use google_cloud_networksecurity_v1::model::GetAuthzPolicyRequest;
5862 /// # let project_id = "project_id";
5863 /// # let location_id = "location_id";
5864 /// # let authz_policy_id = "authz_policy_id";
5865 /// let x = GetAuthzPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
5866 /// ```
5867 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5868 self.name = v.into();
5869 self
5870 }
5871}
5872
5873impl wkt::message::Message for GetAuthzPolicyRequest {
5874 fn typename() -> &'static str {
5875 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthzPolicyRequest"
5876 }
5877}
5878
5879/// Message for updating an `AuthzPolicy` resource.
5880#[derive(Clone, Default, PartialEq)]
5881#[non_exhaustive]
5882pub struct UpdateAuthzPolicyRequest {
5883 /// Required. Used to specify the fields to be overwritten in the
5884 /// `AuthzPolicy` resource by the update.
5885 /// The fields specified in the `update_mask` are relative to the resource, not
5886 /// the full request. A field is overwritten if it is in the mask. If the
5887 /// user does not specify a mask, then all fields are overwritten.
5888 pub update_mask: std::option::Option<wkt::FieldMask>,
5889
5890 /// Required. `AuthzPolicy` resource being updated.
5891 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5892
5893 /// Optional. An optional request ID to identify requests. Specify a unique
5894 /// request ID so that if you must retry your request, the server can ignore
5895 /// the request if it has already been completed. The server guarantees
5896 /// that for at least 60 minutes since the first request.
5897 ///
5898 /// For example, consider a situation where you make an initial request and the
5899 /// request times out. If you make the request again with the same request
5900 /// ID, the server can check if original operation with the same request ID
5901 /// was received, and if so, ignores the second request. This prevents
5902 /// clients from accidentally creating duplicate commitments.
5903 ///
5904 /// The request ID must be a valid UUID with the exception that zero UUID is
5905 /// not supported (00000000-0000-0000-0000-000000000000).
5906 pub request_id: std::string::String,
5907
5908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5909}
5910
5911impl UpdateAuthzPolicyRequest {
5912 /// Creates a new default instance.
5913 pub fn new() -> Self {
5914 std::default::Default::default()
5915 }
5916
5917 /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5918 ///
5919 /// # Example
5920 /// ```ignore,no_run
5921 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5922 /// use wkt::FieldMask;
5923 /// let x = UpdateAuthzPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5924 /// ```
5925 pub fn set_update_mask<T>(mut self, v: T) -> Self
5926 where
5927 T: std::convert::Into<wkt::FieldMask>,
5928 {
5929 self.update_mask = std::option::Option::Some(v.into());
5930 self
5931 }
5932
5933 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5934 ///
5935 /// # Example
5936 /// ```ignore,no_run
5937 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5938 /// use wkt::FieldMask;
5939 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5940 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5941 /// ```
5942 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5943 where
5944 T: std::convert::Into<wkt::FieldMask>,
5945 {
5946 self.update_mask = v.map(|x| x.into());
5947 self
5948 }
5949
5950 /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5951 ///
5952 /// # Example
5953 /// ```ignore,no_run
5954 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5955 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5956 /// let x = UpdateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5957 /// ```
5958 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5959 where
5960 T: std::convert::Into<crate::model::AuthzPolicy>,
5961 {
5962 self.authz_policy = std::option::Option::Some(v.into());
5963 self
5964 }
5965
5966 /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5967 ///
5968 /// # Example
5969 /// ```ignore,no_run
5970 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5971 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5972 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5973 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5974 /// ```
5975 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5976 where
5977 T: std::convert::Into<crate::model::AuthzPolicy>,
5978 {
5979 self.authz_policy = v.map(|x| x.into());
5980 self
5981 }
5982
5983 /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
5984 ///
5985 /// # Example
5986 /// ```ignore,no_run
5987 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5988 /// let x = UpdateAuthzPolicyRequest::new().set_request_id("example");
5989 /// ```
5990 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5991 self.request_id = v.into();
5992 self
5993 }
5994}
5995
5996impl wkt::message::Message for UpdateAuthzPolicyRequest {
5997 fn typename() -> &'static str {
5998 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest"
5999 }
6000}
6001
6002/// Message for deleting an `AuthzPolicy` resource.
6003#[derive(Clone, Default, PartialEq)]
6004#[non_exhaustive]
6005pub struct DeleteAuthzPolicyRequest {
6006 /// Required. The name of the `AuthzPolicy` resource to delete. Must be in
6007 /// the format
6008 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
6009 pub name: std::string::String,
6010
6011 /// Optional. An optional request ID to identify requests. Specify a unique
6012 /// request ID so that if you must retry your request, the server can ignore
6013 /// the request if it has already been completed. The server guarantees
6014 /// that for at least 60 minutes after the first request.
6015 ///
6016 /// For example, consider a situation where you make an initial request and the
6017 /// request times out. If you make the request again with the same request
6018 /// ID, the server can check if original operation with the same request ID
6019 /// was received, and if so, ignores the second request. This prevents
6020 /// clients from accidentally creating duplicate commitments.
6021 ///
6022 /// The request ID must be a valid UUID with the exception that zero UUID is
6023 /// not supported (00000000-0000-0000-0000-000000000000).
6024 pub request_id: std::string::String,
6025
6026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6027}
6028
6029impl DeleteAuthzPolicyRequest {
6030 /// Creates a new default instance.
6031 pub fn new() -> Self {
6032 std::default::Default::default()
6033 }
6034
6035 /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
6036 ///
6037 /// # Example
6038 /// ```ignore,no_run
6039 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
6040 /// # let project_id = "project_id";
6041 /// # let location_id = "location_id";
6042 /// # let authz_policy_id = "authz_policy_id";
6043 /// let x = DeleteAuthzPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/authzPolicies/{authz_policy_id}"));
6044 /// ```
6045 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.name = v.into();
6047 self
6048 }
6049
6050 /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
6055 /// let x = DeleteAuthzPolicyRequest::new().set_request_id("example");
6056 /// ```
6057 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6058 self.request_id = v.into();
6059 self
6060 }
6061}
6062
6063impl wkt::message::Message for DeleteAuthzPolicyRequest {
6064 fn typename() -> &'static str {
6065 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest"
6066 }
6067}
6068
6069/// BackendAuthenticationConfig message groups the TrustConfig together with
6070/// other settings that control how the load balancer authenticates, and
6071/// expresses its identity to, the backend:
6072///
6073/// * `trustConfig` is the attached TrustConfig.
6074///
6075/// * `wellKnownRoots` indicates whether the load balance should trust backend
6076/// server certificates that are issued by public certificate authorities, in
6077/// addition to certificates trusted by the TrustConfig.
6078///
6079/// * `clientCertificate` is a client certificate that the load balancer uses to
6080/// express its identity to the backend, if the connection to the backend uses
6081/// mTLS.
6082///
6083///
6084/// You can attach the BackendAuthenticationConfig to the load balancer's
6085/// BackendService directly determining how that BackendService negotiates TLS.
6086#[derive(Clone, Default, PartialEq)]
6087#[non_exhaustive]
6088pub struct BackendAuthenticationConfig {
6089 /// Required. Name of the BackendAuthenticationConfig resource. It matches the
6090 /// pattern
6091 /// `projects/*/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}`
6092 pub name: std::string::String,
6093
6094 /// Optional. Free-text description of the resource.
6095 pub description: std::string::String,
6096
6097 /// Output only. The timestamp when the resource was created.
6098 pub create_time: std::option::Option<wkt::Timestamp>,
6099
6100 /// Output only. The timestamp when the resource was updated.
6101 pub update_time: std::option::Option<wkt::Timestamp>,
6102
6103 /// Set of label tags associated with the resource.
6104 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6105
6106 /// Optional. A reference to a certificatemanager.googleapis.com.Certificate
6107 /// resource. This is a relative resource path following the form
6108 /// "projects/{project}/locations/{location}/certificates/{certificate}".
6109 ///
6110 /// Used by a BackendService to negotiate mTLS when the backend connection uses
6111 /// TLS and the backend requests a client certificate. Must have a CLIENT_AUTH
6112 /// scope.
6113 pub client_certificate: std::string::String,
6114
6115 /// Optional. A reference to a TrustConfig resource from the
6116 /// certificatemanager.googleapis.com namespace. This is a relative resource
6117 /// path following the form
6118 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}".
6119 ///
6120 /// A BackendService uses the chain of trust represented by this TrustConfig,
6121 /// if specified, to validate the server certificates presented by the backend.
6122 /// Required unless wellKnownRoots is set to PUBLIC_ROOTS.
6123 pub trust_config: std::string::String,
6124
6125 /// Well known roots to use for server certificate validation.
6126 pub well_known_roots: crate::model::backend_authentication_config::WellKnownRoots,
6127
6128 /// Output only. Etag of the resource.
6129 pub etag: std::string::String,
6130
6131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6132}
6133
6134impl BackendAuthenticationConfig {
6135 /// Creates a new default instance.
6136 pub fn new() -> Self {
6137 std::default::Default::default()
6138 }
6139
6140 /// Sets the value of [name][crate::model::BackendAuthenticationConfig::name].
6141 ///
6142 /// # Example
6143 /// ```ignore,no_run
6144 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6145 /// # let project_id = "project_id";
6146 /// # let location_id = "location_id";
6147 /// # let backend_authentication_config_id = "backend_authentication_config_id";
6148 /// let x = BackendAuthenticationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6149 /// ```
6150 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.name = v.into();
6152 self
6153 }
6154
6155 /// Sets the value of [description][crate::model::BackendAuthenticationConfig::description].
6156 ///
6157 /// # Example
6158 /// ```ignore,no_run
6159 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6160 /// let x = BackendAuthenticationConfig::new().set_description("example");
6161 /// ```
6162 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6163 self.description = v.into();
6164 self
6165 }
6166
6167 /// Sets the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6168 ///
6169 /// # Example
6170 /// ```ignore,no_run
6171 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6172 /// use wkt::Timestamp;
6173 /// let x = BackendAuthenticationConfig::new().set_create_time(Timestamp::default()/* use setters */);
6174 /// ```
6175 pub fn set_create_time<T>(mut self, v: T) -> Self
6176 where
6177 T: std::convert::Into<wkt::Timestamp>,
6178 {
6179 self.create_time = std::option::Option::Some(v.into());
6180 self
6181 }
6182
6183 /// Sets or clears the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6184 ///
6185 /// # Example
6186 /// ```ignore,no_run
6187 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6188 /// use wkt::Timestamp;
6189 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6190 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(None::<Timestamp>);
6191 /// ```
6192 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6193 where
6194 T: std::convert::Into<wkt::Timestamp>,
6195 {
6196 self.create_time = v.map(|x| x.into());
6197 self
6198 }
6199
6200 /// Sets the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6201 ///
6202 /// # Example
6203 /// ```ignore,no_run
6204 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6205 /// use wkt::Timestamp;
6206 /// let x = BackendAuthenticationConfig::new().set_update_time(Timestamp::default()/* use setters */);
6207 /// ```
6208 pub fn set_update_time<T>(mut self, v: T) -> Self
6209 where
6210 T: std::convert::Into<wkt::Timestamp>,
6211 {
6212 self.update_time = std::option::Option::Some(v.into());
6213 self
6214 }
6215
6216 /// Sets or clears the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6217 ///
6218 /// # Example
6219 /// ```ignore,no_run
6220 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6221 /// use wkt::Timestamp;
6222 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6223 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(None::<Timestamp>);
6224 /// ```
6225 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6226 where
6227 T: std::convert::Into<wkt::Timestamp>,
6228 {
6229 self.update_time = v.map(|x| x.into());
6230 self
6231 }
6232
6233 /// Sets the value of [labels][crate::model::BackendAuthenticationConfig::labels].
6234 ///
6235 /// # Example
6236 /// ```ignore,no_run
6237 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6238 /// let x = BackendAuthenticationConfig::new().set_labels([
6239 /// ("key0", "abc"),
6240 /// ("key1", "xyz"),
6241 /// ]);
6242 /// ```
6243 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6244 where
6245 T: std::iter::IntoIterator<Item = (K, V)>,
6246 K: std::convert::Into<std::string::String>,
6247 V: std::convert::Into<std::string::String>,
6248 {
6249 use std::iter::Iterator;
6250 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6251 self
6252 }
6253
6254 /// Sets the value of [client_certificate][crate::model::BackendAuthenticationConfig::client_certificate].
6255 ///
6256 /// # Example
6257 /// ```ignore,no_run
6258 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6259 /// let x = BackendAuthenticationConfig::new().set_client_certificate("example");
6260 /// ```
6261 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6262 mut self,
6263 v: T,
6264 ) -> Self {
6265 self.client_certificate = v.into();
6266 self
6267 }
6268
6269 /// Sets the value of [trust_config][crate::model::BackendAuthenticationConfig::trust_config].
6270 ///
6271 /// # Example
6272 /// ```ignore,no_run
6273 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6274 /// let x = BackendAuthenticationConfig::new().set_trust_config("example");
6275 /// ```
6276 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6277 self.trust_config = v.into();
6278 self
6279 }
6280
6281 /// Sets the value of [well_known_roots][crate::model::BackendAuthenticationConfig::well_known_roots].
6282 ///
6283 /// # Example
6284 /// ```ignore,no_run
6285 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6286 /// use google_cloud_networksecurity_v1::model::backend_authentication_config::WellKnownRoots;
6287 /// let x0 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::None);
6288 /// let x1 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::PublicRoots);
6289 /// ```
6290 pub fn set_well_known_roots<
6291 T: std::convert::Into<crate::model::backend_authentication_config::WellKnownRoots>,
6292 >(
6293 mut self,
6294 v: T,
6295 ) -> Self {
6296 self.well_known_roots = v.into();
6297 self
6298 }
6299
6300 /// Sets the value of [etag][crate::model::BackendAuthenticationConfig::etag].
6301 ///
6302 /// # Example
6303 /// ```ignore,no_run
6304 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6305 /// let x = BackendAuthenticationConfig::new().set_etag("example");
6306 /// ```
6307 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308 self.etag = v.into();
6309 self
6310 }
6311}
6312
6313impl wkt::message::Message for BackendAuthenticationConfig {
6314 fn typename() -> &'static str {
6315 "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig"
6316 }
6317}
6318
6319/// Defines additional types related to [BackendAuthenticationConfig].
6320pub mod backend_authentication_config {
6321 #[allow(unused_imports)]
6322 use super::*;
6323
6324 /// Enum to specify the well known roots to use for server certificate
6325 /// validation.
6326 ///
6327 /// # Working with unknown values
6328 ///
6329 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6330 /// additional enum variants at any time. Adding new variants is not considered
6331 /// a breaking change. Applications should write their code in anticipation of:
6332 ///
6333 /// - New values appearing in future releases of the client library, **and**
6334 /// - New values received dynamically, without application changes.
6335 ///
6336 /// Please consult the [Working with enums] section in the user guide for some
6337 /// guidelines.
6338 ///
6339 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6340 #[derive(Clone, Debug, PartialEq)]
6341 #[non_exhaustive]
6342 pub enum WellKnownRoots {
6343 /// Equivalent to NONE.
6344 Unspecified,
6345 /// The BackendService will only validate server certificates against roots
6346 /// specified in TrustConfig.
6347 None,
6348 /// The BackendService uses a set of well-known public roots, in addition to
6349 /// any roots specified in the trustConfig field, when validating the server
6350 /// certificates presented by the backend. Validation with these roots is
6351 /// only considered when the TlsSettings.sni field in the BackendService is
6352 /// set.
6353 ///
6354 /// The well-known roots are a set of root CAs managed by Google. CAs in this
6355 /// set can be added or removed without notice.
6356 PublicRoots,
6357 /// If set, the enum was initialized with an unknown value.
6358 ///
6359 /// Applications can examine the value using [WellKnownRoots::value] or
6360 /// [WellKnownRoots::name].
6361 UnknownValue(well_known_roots::UnknownValue),
6362 }
6363
6364 #[doc(hidden)]
6365 pub mod well_known_roots {
6366 #[allow(unused_imports)]
6367 use super::*;
6368 #[derive(Clone, Debug, PartialEq)]
6369 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6370 }
6371
6372 impl WellKnownRoots {
6373 /// Gets the enum value.
6374 ///
6375 /// Returns `None` if the enum contains an unknown value deserialized from
6376 /// the string representation of enums.
6377 pub fn value(&self) -> std::option::Option<i32> {
6378 match self {
6379 Self::Unspecified => std::option::Option::Some(0),
6380 Self::None => std::option::Option::Some(1),
6381 Self::PublicRoots => std::option::Option::Some(2),
6382 Self::UnknownValue(u) => u.0.value(),
6383 }
6384 }
6385
6386 /// Gets the enum value as a string.
6387 ///
6388 /// Returns `None` if the enum contains an unknown value deserialized from
6389 /// the integer representation of enums.
6390 pub fn name(&self) -> std::option::Option<&str> {
6391 match self {
6392 Self::Unspecified => std::option::Option::Some("WELL_KNOWN_ROOTS_UNSPECIFIED"),
6393 Self::None => std::option::Option::Some("NONE"),
6394 Self::PublicRoots => std::option::Option::Some("PUBLIC_ROOTS"),
6395 Self::UnknownValue(u) => u.0.name(),
6396 }
6397 }
6398 }
6399
6400 impl std::default::Default for WellKnownRoots {
6401 fn default() -> Self {
6402 use std::convert::From;
6403 Self::from(0)
6404 }
6405 }
6406
6407 impl std::fmt::Display for WellKnownRoots {
6408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6409 wkt::internal::display_enum(f, self.name(), self.value())
6410 }
6411 }
6412
6413 impl std::convert::From<i32> for WellKnownRoots {
6414 fn from(value: i32) -> Self {
6415 match value {
6416 0 => Self::Unspecified,
6417 1 => Self::None,
6418 2 => Self::PublicRoots,
6419 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6420 wkt::internal::UnknownEnumValue::Integer(value),
6421 )),
6422 }
6423 }
6424 }
6425
6426 impl std::convert::From<&str> for WellKnownRoots {
6427 fn from(value: &str) -> Self {
6428 use std::string::ToString;
6429 match value {
6430 "WELL_KNOWN_ROOTS_UNSPECIFIED" => Self::Unspecified,
6431 "NONE" => Self::None,
6432 "PUBLIC_ROOTS" => Self::PublicRoots,
6433 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6434 wkt::internal::UnknownEnumValue::String(value.to_string()),
6435 )),
6436 }
6437 }
6438 }
6439
6440 impl serde::ser::Serialize for WellKnownRoots {
6441 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6442 where
6443 S: serde::Serializer,
6444 {
6445 match self {
6446 Self::Unspecified => serializer.serialize_i32(0),
6447 Self::None => serializer.serialize_i32(1),
6448 Self::PublicRoots => serializer.serialize_i32(2),
6449 Self::UnknownValue(u) => u.0.serialize(serializer),
6450 }
6451 }
6452 }
6453
6454 impl<'de> serde::de::Deserialize<'de> for WellKnownRoots {
6455 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6456 where
6457 D: serde::Deserializer<'de>,
6458 {
6459 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WellKnownRoots>::new(
6460 ".google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots",
6461 ))
6462 }
6463 }
6464}
6465
6466/// Request used by the ListBackendAuthenticationConfigs method.
6467#[derive(Clone, Default, PartialEq)]
6468#[non_exhaustive]
6469pub struct ListBackendAuthenticationConfigsRequest {
6470 /// Required. The project and location from which the
6471 /// BackendAuthenticationConfigs should be listed, specified in the format
6472 /// `projects/*/locations/{location}`.
6473 pub parent: std::string::String,
6474
6475 /// Maximum number of BackendAuthenticationConfigs to return per call.
6476 pub page_size: i32,
6477
6478 /// The value returned by the last `ListBackendAuthenticationConfigsResponse`
6479 /// Indicates that this is a continuation of a prior
6480 /// `ListBackendAuthenticationConfigs` call, and that the system
6481 /// should return the next page of data.
6482 pub page_token: std::string::String,
6483
6484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6485}
6486
6487impl ListBackendAuthenticationConfigsRequest {
6488 /// Creates a new default instance.
6489 pub fn new() -> Self {
6490 std::default::Default::default()
6491 }
6492
6493 /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
6494 ///
6495 /// # Example
6496 /// ```ignore,no_run
6497 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6498 /// let x = ListBackendAuthenticationConfigsRequest::new().set_parent("example");
6499 /// ```
6500 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.parent = v.into();
6502 self
6503 }
6504
6505 /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
6506 ///
6507 /// # Example
6508 /// ```ignore,no_run
6509 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6510 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_size(42);
6511 /// ```
6512 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6513 self.page_size = v.into();
6514 self
6515 }
6516
6517 /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
6518 ///
6519 /// # Example
6520 /// ```ignore,no_run
6521 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6522 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_token("example");
6523 /// ```
6524 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6525 self.page_token = v.into();
6526 self
6527 }
6528}
6529
6530impl wkt::message::Message for ListBackendAuthenticationConfigsRequest {
6531 fn typename() -> &'static str {
6532 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest"
6533 }
6534}
6535
6536/// Response returned by the ListBackendAuthenticationConfigs method.
6537#[derive(Clone, Default, PartialEq)]
6538#[non_exhaustive]
6539pub struct ListBackendAuthenticationConfigsResponse {
6540 /// List of BackendAuthenticationConfig resources.
6541 pub backend_authentication_configs: std::vec::Vec<crate::model::BackendAuthenticationConfig>,
6542
6543 /// If there might be more results than those appearing in this response, then
6544 /// `next_page_token` is included. To get the next set of results, call this
6545 /// method again using the value of `next_page_token` as `page_token`.
6546 pub next_page_token: std::string::String,
6547
6548 /// Locations that could not be reached.
6549 pub unreachable: std::vec::Vec<std::string::String>,
6550
6551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6552}
6553
6554impl ListBackendAuthenticationConfigsResponse {
6555 /// Creates a new default instance.
6556 pub fn new() -> Self {
6557 std::default::Default::default()
6558 }
6559
6560 /// Sets the value of [backend_authentication_configs][crate::model::ListBackendAuthenticationConfigsResponse::backend_authentication_configs].
6561 ///
6562 /// # Example
6563 /// ```ignore,no_run
6564 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6565 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6566 /// let x = ListBackendAuthenticationConfigsResponse::new()
6567 /// .set_backend_authentication_configs([
6568 /// BackendAuthenticationConfig::default()/* use setters */,
6569 /// BackendAuthenticationConfig::default()/* use (different) setters */,
6570 /// ]);
6571 /// ```
6572 pub fn set_backend_authentication_configs<T, V>(mut self, v: T) -> Self
6573 where
6574 T: std::iter::IntoIterator<Item = V>,
6575 V: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6576 {
6577 use std::iter::Iterator;
6578 self.backend_authentication_configs = v.into_iter().map(|i| i.into()).collect();
6579 self
6580 }
6581
6582 /// Sets the value of [next_page_token][crate::model::ListBackendAuthenticationConfigsResponse::next_page_token].
6583 ///
6584 /// # Example
6585 /// ```ignore,no_run
6586 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6587 /// let x = ListBackendAuthenticationConfigsResponse::new().set_next_page_token("example");
6588 /// ```
6589 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6590 self.next_page_token = v.into();
6591 self
6592 }
6593
6594 /// Sets the value of [unreachable][crate::model::ListBackendAuthenticationConfigsResponse::unreachable].
6595 ///
6596 /// # Example
6597 /// ```ignore,no_run
6598 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6599 /// let x = ListBackendAuthenticationConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6600 /// ```
6601 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6602 where
6603 T: std::iter::IntoIterator<Item = V>,
6604 V: std::convert::Into<std::string::String>,
6605 {
6606 use std::iter::Iterator;
6607 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6608 self
6609 }
6610}
6611
6612impl wkt::message::Message for ListBackendAuthenticationConfigsResponse {
6613 fn typename() -> &'static str {
6614 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse"
6615 }
6616}
6617
6618#[doc(hidden)]
6619impl google_cloud_gax::paginator::internal::PageableResponse
6620 for ListBackendAuthenticationConfigsResponse
6621{
6622 type PageItem = crate::model::BackendAuthenticationConfig;
6623
6624 fn items(self) -> std::vec::Vec<Self::PageItem> {
6625 self.backend_authentication_configs
6626 }
6627
6628 fn next_page_token(&self) -> std::string::String {
6629 use std::clone::Clone;
6630 self.next_page_token.clone()
6631 }
6632}
6633
6634/// Request used by the GetBackendAuthenticationConfig method.
6635#[derive(Clone, Default, PartialEq)]
6636#[non_exhaustive]
6637pub struct GetBackendAuthenticationConfigRequest {
6638 /// Required. A name of the BackendAuthenticationConfig to get. Must be in the
6639 /// format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6640 pub name: std::string::String,
6641
6642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6643}
6644
6645impl GetBackendAuthenticationConfigRequest {
6646 /// Creates a new default instance.
6647 pub fn new() -> Self {
6648 std::default::Default::default()
6649 }
6650
6651 /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
6652 ///
6653 /// # Example
6654 /// ```ignore,no_run
6655 /// # use google_cloud_networksecurity_v1::model::GetBackendAuthenticationConfigRequest;
6656 /// # let project_id = "project_id";
6657 /// # let location_id = "location_id";
6658 /// # let backend_authentication_config_id = "backend_authentication_config_id";
6659 /// let x = GetBackendAuthenticationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6660 /// ```
6661 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6662 self.name = v.into();
6663 self
6664 }
6665}
6666
6667impl wkt::message::Message for GetBackendAuthenticationConfigRequest {
6668 fn typename() -> &'static str {
6669 "type.googleapis.com/google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest"
6670 }
6671}
6672
6673/// Request used by the CreateBackendAuthenticationConfig method.
6674#[derive(Clone, Default, PartialEq)]
6675#[non_exhaustive]
6676pub struct CreateBackendAuthenticationConfigRequest {
6677 /// Required. The parent resource of the BackendAuthenticationConfig. Must be
6678 /// in the format `projects/*/locations/{location}`.
6679 pub parent: std::string::String,
6680
6681 /// Required. Short name of the BackendAuthenticationConfig resource to be
6682 /// created. This value should be 1-63 characters long, containing only
6683 /// letters, numbers, hyphens, and underscores, and should not start with a
6684 /// number. E.g. "backend-auth-config".
6685 pub backend_authentication_config_id: std::string::String,
6686
6687 /// Required. BackendAuthenticationConfig resource to be created.
6688 pub backend_authentication_config:
6689 std::option::Option<crate::model::BackendAuthenticationConfig>,
6690
6691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6692}
6693
6694impl CreateBackendAuthenticationConfigRequest {
6695 /// Creates a new default instance.
6696 pub fn new() -> Self {
6697 std::default::Default::default()
6698 }
6699
6700 /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
6701 ///
6702 /// # Example
6703 /// ```ignore,no_run
6704 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6705 /// # let project_id = "project_id";
6706 /// # let location_id = "location_id";
6707 /// let x = CreateBackendAuthenticationConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6708 /// ```
6709 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6710 self.parent = v.into();
6711 self
6712 }
6713
6714 /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
6715 ///
6716 /// # Example
6717 /// ```ignore,no_run
6718 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6719 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config_id("example");
6720 /// ```
6721 pub fn set_backend_authentication_config_id<T: std::convert::Into<std::string::String>>(
6722 mut self,
6723 v: T,
6724 ) -> Self {
6725 self.backend_authentication_config_id = v.into();
6726 self
6727 }
6728
6729 /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6730 ///
6731 /// # Example
6732 /// ```ignore,no_run
6733 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6734 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6735 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6736 /// ```
6737 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6738 where
6739 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6740 {
6741 self.backend_authentication_config = std::option::Option::Some(v.into());
6742 self
6743 }
6744
6745 /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6746 ///
6747 /// # Example
6748 /// ```ignore,no_run
6749 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6750 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6751 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6752 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6753 /// ```
6754 pub fn set_or_clear_backend_authentication_config<T>(
6755 mut self,
6756 v: std::option::Option<T>,
6757 ) -> Self
6758 where
6759 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6760 {
6761 self.backend_authentication_config = v.map(|x| x.into());
6762 self
6763 }
6764}
6765
6766impl wkt::message::Message for CreateBackendAuthenticationConfigRequest {
6767 fn typename() -> &'static str {
6768 "type.googleapis.com/google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest"
6769 }
6770}
6771
6772/// Request used by UpdateBackendAuthenticationConfig method.
6773#[derive(Clone, Default, PartialEq)]
6774#[non_exhaustive]
6775pub struct UpdateBackendAuthenticationConfigRequest {
6776 /// Optional. Field mask is used to specify the fields to be overwritten in the
6777 /// BackendAuthenticationConfig resource by the update. The fields
6778 /// specified in the update_mask are relative to the resource, not
6779 /// the full request. A field will be overwritten if it is in the
6780 /// mask. If the user does not provide a mask then all fields will be
6781 /// overwritten.
6782 pub update_mask: std::option::Option<wkt::FieldMask>,
6783
6784 /// Required. Updated BackendAuthenticationConfig resource.
6785 pub backend_authentication_config:
6786 std::option::Option<crate::model::BackendAuthenticationConfig>,
6787
6788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6789}
6790
6791impl UpdateBackendAuthenticationConfigRequest {
6792 /// Creates a new default instance.
6793 pub fn new() -> Self {
6794 std::default::Default::default()
6795 }
6796
6797 /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6798 ///
6799 /// # Example
6800 /// ```ignore,no_run
6801 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6802 /// use wkt::FieldMask;
6803 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6804 /// ```
6805 pub fn set_update_mask<T>(mut self, v: T) -> Self
6806 where
6807 T: std::convert::Into<wkt::FieldMask>,
6808 {
6809 self.update_mask = std::option::Option::Some(v.into());
6810 self
6811 }
6812
6813 /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6814 ///
6815 /// # Example
6816 /// ```ignore,no_run
6817 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6818 /// use wkt::FieldMask;
6819 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6820 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6821 /// ```
6822 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6823 where
6824 T: std::convert::Into<wkt::FieldMask>,
6825 {
6826 self.update_mask = v.map(|x| x.into());
6827 self
6828 }
6829
6830 /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6831 ///
6832 /// # Example
6833 /// ```ignore,no_run
6834 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6835 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6836 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6837 /// ```
6838 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6839 where
6840 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6841 {
6842 self.backend_authentication_config = std::option::Option::Some(v.into());
6843 self
6844 }
6845
6846 /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6847 ///
6848 /// # Example
6849 /// ```ignore,no_run
6850 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6851 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6852 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6853 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6854 /// ```
6855 pub fn set_or_clear_backend_authentication_config<T>(
6856 mut self,
6857 v: std::option::Option<T>,
6858 ) -> Self
6859 where
6860 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6861 {
6862 self.backend_authentication_config = v.map(|x| x.into());
6863 self
6864 }
6865}
6866
6867impl wkt::message::Message for UpdateBackendAuthenticationConfigRequest {
6868 fn typename() -> &'static str {
6869 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest"
6870 }
6871}
6872
6873/// Request used by the DeleteBackendAuthenticationConfig method.
6874#[derive(Clone, Default, PartialEq)]
6875#[non_exhaustive]
6876pub struct DeleteBackendAuthenticationConfigRequest {
6877 /// Required. A name of the BackendAuthenticationConfig to delete. Must be in
6878 /// the format
6879 /// `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6880 pub name: std::string::String,
6881
6882 /// Optional. Etag of the resource.
6883 /// If this is provided, it must match the server's etag.
6884 pub etag: std::string::String,
6885
6886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6887}
6888
6889impl DeleteBackendAuthenticationConfigRequest {
6890 /// Creates a new default instance.
6891 pub fn new() -> Self {
6892 std::default::Default::default()
6893 }
6894
6895 /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
6896 ///
6897 /// # Example
6898 /// ```ignore,no_run
6899 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6900 /// # let project_id = "project_id";
6901 /// # let location_id = "location_id";
6902 /// # let backend_authentication_config_id = "backend_authentication_config_id";
6903 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backendAuthenticationConfigs/{backend_authentication_config_id}"));
6904 /// ```
6905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6906 self.name = v.into();
6907 self
6908 }
6909
6910 /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
6911 ///
6912 /// # Example
6913 /// ```ignore,no_run
6914 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6915 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_etag("example");
6916 /// ```
6917 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6918 self.etag = v.into();
6919 self
6920 }
6921}
6922
6923impl wkt::message::Message for DeleteBackendAuthenticationConfigRequest {
6924 fn typename() -> &'static str {
6925 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest"
6926 }
6927}
6928
6929/// ClientTlsPolicy is a resource that specifies how a client should authenticate
6930/// connections to backends of a service. This resource itself does not affect
6931/// configuration unless it is attached to a backend service resource.
6932#[derive(Clone, Default, PartialEq)]
6933#[non_exhaustive]
6934pub struct ClientTlsPolicy {
6935 /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
6936 /// `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}`
6937 pub name: std::string::String,
6938
6939 /// Optional. Free-text description of the resource.
6940 pub description: std::string::String,
6941
6942 /// Output only. The timestamp when the resource was created.
6943 pub create_time: std::option::Option<wkt::Timestamp>,
6944
6945 /// Output only. The timestamp when the resource was updated.
6946 pub update_time: std::option::Option<wkt::Timestamp>,
6947
6948 /// Optional. Set of label tags associated with the resource.
6949 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6950
6951 /// Optional. Server Name Indication string to present to the server during TLS
6952 /// handshake. E.g: "secure.example.com".
6953 pub sni: std::string::String,
6954
6955 /// Optional. Defines a mechanism to provision client identity (public and
6956 /// private keys) for peer to peer authentication. The presence of this
6957 /// dictates mTLS.
6958 pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
6959
6960 /// Optional. Defines the mechanism to obtain the Certificate Authority
6961 /// certificate to validate the server certificate. If empty, client does not
6962 /// validate the server certificate.
6963 pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
6964
6965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6966}
6967
6968impl ClientTlsPolicy {
6969 /// Creates a new default instance.
6970 pub fn new() -> Self {
6971 std::default::Default::default()
6972 }
6973
6974 /// Sets the value of [name][crate::model::ClientTlsPolicy::name].
6975 ///
6976 /// # Example
6977 /// ```ignore,no_run
6978 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6979 /// # let project_id = "project_id";
6980 /// # let location_id = "location_id";
6981 /// # let client_tls_policy_id = "client_tls_policy_id";
6982 /// let x = ClientTlsPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
6983 /// ```
6984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6985 self.name = v.into();
6986 self
6987 }
6988
6989 /// Sets the value of [description][crate::model::ClientTlsPolicy::description].
6990 ///
6991 /// # Example
6992 /// ```ignore,no_run
6993 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6994 /// let x = ClientTlsPolicy::new().set_description("example");
6995 /// ```
6996 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6997 self.description = v.into();
6998 self
6999 }
7000
7001 /// Sets the value of [create_time][crate::model::ClientTlsPolicy::create_time].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7006 /// use wkt::Timestamp;
7007 /// let x = ClientTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7008 /// ```
7009 pub fn set_create_time<T>(mut self, v: T) -> Self
7010 where
7011 T: std::convert::Into<wkt::Timestamp>,
7012 {
7013 self.create_time = std::option::Option::Some(v.into());
7014 self
7015 }
7016
7017 /// Sets or clears the value of [create_time][crate::model::ClientTlsPolicy::create_time].
7018 ///
7019 /// # Example
7020 /// ```ignore,no_run
7021 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7022 /// use wkt::Timestamp;
7023 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7024 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7025 /// ```
7026 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7027 where
7028 T: std::convert::Into<wkt::Timestamp>,
7029 {
7030 self.create_time = v.map(|x| x.into());
7031 self
7032 }
7033
7034 /// Sets the value of [update_time][crate::model::ClientTlsPolicy::update_time].
7035 ///
7036 /// # Example
7037 /// ```ignore,no_run
7038 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7039 /// use wkt::Timestamp;
7040 /// let x = ClientTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7041 /// ```
7042 pub fn set_update_time<T>(mut self, v: T) -> Self
7043 where
7044 T: std::convert::Into<wkt::Timestamp>,
7045 {
7046 self.update_time = std::option::Option::Some(v.into());
7047 self
7048 }
7049
7050 /// Sets or clears the value of [update_time][crate::model::ClientTlsPolicy::update_time].
7051 ///
7052 /// # Example
7053 /// ```ignore,no_run
7054 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7055 /// use wkt::Timestamp;
7056 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7057 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7058 /// ```
7059 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7060 where
7061 T: std::convert::Into<wkt::Timestamp>,
7062 {
7063 self.update_time = v.map(|x| x.into());
7064 self
7065 }
7066
7067 /// Sets the value of [labels][crate::model::ClientTlsPolicy::labels].
7068 ///
7069 /// # Example
7070 /// ```ignore,no_run
7071 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7072 /// let x = ClientTlsPolicy::new().set_labels([
7073 /// ("key0", "abc"),
7074 /// ("key1", "xyz"),
7075 /// ]);
7076 /// ```
7077 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7078 where
7079 T: std::iter::IntoIterator<Item = (K, V)>,
7080 K: std::convert::Into<std::string::String>,
7081 V: std::convert::Into<std::string::String>,
7082 {
7083 use std::iter::Iterator;
7084 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7085 self
7086 }
7087
7088 /// Sets the value of [sni][crate::model::ClientTlsPolicy::sni].
7089 ///
7090 /// # Example
7091 /// ```ignore,no_run
7092 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7093 /// let x = ClientTlsPolicy::new().set_sni("example");
7094 /// ```
7095 pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7096 self.sni = v.into();
7097 self
7098 }
7099
7100 /// Sets the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
7101 ///
7102 /// # Example
7103 /// ```ignore,no_run
7104 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7105 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
7106 /// let x = ClientTlsPolicy::new().set_client_certificate(CertificateProvider::default()/* use setters */);
7107 /// ```
7108 pub fn set_client_certificate<T>(mut self, v: T) -> Self
7109 where
7110 T: std::convert::Into<crate::model::CertificateProvider>,
7111 {
7112 self.client_certificate = std::option::Option::Some(v.into());
7113 self
7114 }
7115
7116 /// Sets or clears the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
7117 ///
7118 /// # Example
7119 /// ```ignore,no_run
7120 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7121 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
7122 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(Some(CertificateProvider::default()/* use setters */));
7123 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(None::<CertificateProvider>);
7124 /// ```
7125 pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7126 where
7127 T: std::convert::Into<crate::model::CertificateProvider>,
7128 {
7129 self.client_certificate = v.map(|x| x.into());
7130 self
7131 }
7132
7133 /// Sets the value of [server_validation_ca][crate::model::ClientTlsPolicy::server_validation_ca].
7134 ///
7135 /// # Example
7136 /// ```ignore,no_run
7137 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7138 /// use google_cloud_networksecurity_v1::model::ValidationCA;
7139 /// let x = ClientTlsPolicy::new()
7140 /// .set_server_validation_ca([
7141 /// ValidationCA::default()/* use setters */,
7142 /// ValidationCA::default()/* use (different) setters */,
7143 /// ]);
7144 /// ```
7145 pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
7146 where
7147 T: std::iter::IntoIterator<Item = V>,
7148 V: std::convert::Into<crate::model::ValidationCA>,
7149 {
7150 use std::iter::Iterator;
7151 self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
7152 self
7153 }
7154}
7155
7156impl wkt::message::Message for ClientTlsPolicy {
7157 fn typename() -> &'static str {
7158 "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
7159 }
7160}
7161
7162/// Request used by the ListClientTlsPolicies method.
7163#[derive(Clone, Default, PartialEq)]
7164#[non_exhaustive]
7165pub struct ListClientTlsPoliciesRequest {
7166 /// Required. The project and location from which the ClientTlsPolicies should
7167 /// be listed, specified in the format `projects/*/locations/{location}`.
7168 pub parent: std::string::String,
7169
7170 /// Maximum number of ClientTlsPolicies to return per call.
7171 pub page_size: i32,
7172
7173 /// The value returned by the last `ListClientTlsPoliciesResponse`
7174 /// Indicates that this is a continuation of a prior
7175 /// `ListClientTlsPolicies` call, and that the system
7176 /// should return the next page of data.
7177 pub page_token: std::string::String,
7178
7179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7180}
7181
7182impl ListClientTlsPoliciesRequest {
7183 /// Creates a new default instance.
7184 pub fn new() -> Self {
7185 std::default::Default::default()
7186 }
7187
7188 /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
7189 ///
7190 /// # Example
7191 /// ```ignore,no_run
7192 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7193 /// let x = ListClientTlsPoliciesRequest::new().set_parent("example");
7194 /// ```
7195 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7196 self.parent = v.into();
7197 self
7198 }
7199
7200 /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
7201 ///
7202 /// # Example
7203 /// ```ignore,no_run
7204 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7205 /// let x = ListClientTlsPoliciesRequest::new().set_page_size(42);
7206 /// ```
7207 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7208 self.page_size = v.into();
7209 self
7210 }
7211
7212 /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
7213 ///
7214 /// # Example
7215 /// ```ignore,no_run
7216 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7217 /// let x = ListClientTlsPoliciesRequest::new().set_page_token("example");
7218 /// ```
7219 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7220 self.page_token = v.into();
7221 self
7222 }
7223}
7224
7225impl wkt::message::Message for ListClientTlsPoliciesRequest {
7226 fn typename() -> &'static str {
7227 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
7228 }
7229}
7230
7231/// Response returned by the ListClientTlsPolicies method.
7232#[derive(Clone, Default, PartialEq)]
7233#[non_exhaustive]
7234pub struct ListClientTlsPoliciesResponse {
7235 /// List of ClientTlsPolicy resources.
7236 pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
7237
7238 /// If there might be more results than those appearing in this response, then
7239 /// `next_page_token` is included. To get the next set of results, call this
7240 /// method again using the value of `next_page_token` as `page_token`.
7241 pub next_page_token: std::string::String,
7242
7243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7244}
7245
7246impl ListClientTlsPoliciesResponse {
7247 /// Creates a new default instance.
7248 pub fn new() -> Self {
7249 std::default::Default::default()
7250 }
7251
7252 /// Sets the value of [client_tls_policies][crate::model::ListClientTlsPoliciesResponse::client_tls_policies].
7253 ///
7254 /// # Example
7255 /// ```ignore,no_run
7256 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7257 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7258 /// let x = ListClientTlsPoliciesResponse::new()
7259 /// .set_client_tls_policies([
7260 /// ClientTlsPolicy::default()/* use setters */,
7261 /// ClientTlsPolicy::default()/* use (different) setters */,
7262 /// ]);
7263 /// ```
7264 pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
7265 where
7266 T: std::iter::IntoIterator<Item = V>,
7267 V: std::convert::Into<crate::model::ClientTlsPolicy>,
7268 {
7269 use std::iter::Iterator;
7270 self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
7271 self
7272 }
7273
7274 /// Sets the value of [next_page_token][crate::model::ListClientTlsPoliciesResponse::next_page_token].
7275 ///
7276 /// # Example
7277 /// ```ignore,no_run
7278 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7279 /// let x = ListClientTlsPoliciesResponse::new().set_next_page_token("example");
7280 /// ```
7281 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7282 self.next_page_token = v.into();
7283 self
7284 }
7285}
7286
7287impl wkt::message::Message for ListClientTlsPoliciesResponse {
7288 fn typename() -> &'static str {
7289 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
7290 }
7291}
7292
7293#[doc(hidden)]
7294impl google_cloud_gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
7295 type PageItem = crate::model::ClientTlsPolicy;
7296
7297 fn items(self) -> std::vec::Vec<Self::PageItem> {
7298 self.client_tls_policies
7299 }
7300
7301 fn next_page_token(&self) -> std::string::String {
7302 use std::clone::Clone;
7303 self.next_page_token.clone()
7304 }
7305}
7306
7307/// Request used by the GetClientTlsPolicy method.
7308#[derive(Clone, Default, PartialEq)]
7309#[non_exhaustive]
7310pub struct GetClientTlsPolicyRequest {
7311 /// Required. A name of the ClientTlsPolicy to get. Must be in the format
7312 /// `projects/*/locations/{location}/clientTlsPolicies/*`.
7313 pub name: std::string::String,
7314
7315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7316}
7317
7318impl GetClientTlsPolicyRequest {
7319 /// Creates a new default instance.
7320 pub fn new() -> Self {
7321 std::default::Default::default()
7322 }
7323
7324 /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
7325 ///
7326 /// # Example
7327 /// ```ignore,no_run
7328 /// # use google_cloud_networksecurity_v1::model::GetClientTlsPolicyRequest;
7329 /// # let project_id = "project_id";
7330 /// # let location_id = "location_id";
7331 /// # let client_tls_policy_id = "client_tls_policy_id";
7332 /// let x = GetClientTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
7333 /// ```
7334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7335 self.name = v.into();
7336 self
7337 }
7338}
7339
7340impl wkt::message::Message for GetClientTlsPolicyRequest {
7341 fn typename() -> &'static str {
7342 "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
7343 }
7344}
7345
7346/// Request used by the CreateClientTlsPolicy method.
7347#[derive(Clone, Default, PartialEq)]
7348#[non_exhaustive]
7349pub struct CreateClientTlsPolicyRequest {
7350 /// Required. The parent resource of the ClientTlsPolicy. Must be in
7351 /// the format `projects/*/locations/{location}`.
7352 pub parent: std::string::String,
7353
7354 /// Required. Short name of the ClientTlsPolicy resource to be created. This
7355 /// value should be 1-63 characters long, containing only letters, numbers,
7356 /// hyphens, and underscores, and should not start with a number. E.g.
7357 /// "client_mtls_policy".
7358 pub client_tls_policy_id: std::string::String,
7359
7360 /// Required. ClientTlsPolicy resource to be created.
7361 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7362
7363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7364}
7365
7366impl CreateClientTlsPolicyRequest {
7367 /// Creates a new default instance.
7368 pub fn new() -> Self {
7369 std::default::Default::default()
7370 }
7371
7372 /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
7373 ///
7374 /// # Example
7375 /// ```ignore,no_run
7376 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7377 /// # let project_id = "project_id";
7378 /// # let location_id = "location_id";
7379 /// let x = CreateClientTlsPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7380 /// ```
7381 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7382 self.parent = v.into();
7383 self
7384 }
7385
7386 /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
7387 ///
7388 /// # Example
7389 /// ```ignore,no_run
7390 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7391 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy_id("example");
7392 /// ```
7393 pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
7394 mut self,
7395 v: T,
7396 ) -> Self {
7397 self.client_tls_policy_id = v.into();
7398 self
7399 }
7400
7401 /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7402 ///
7403 /// # Example
7404 /// ```ignore,no_run
7405 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7406 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7407 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7408 /// ```
7409 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7410 where
7411 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7412 {
7413 self.client_tls_policy = std::option::Option::Some(v.into());
7414 self
7415 }
7416
7417 /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7418 ///
7419 /// # Example
7420 /// ```ignore,no_run
7421 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7422 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7423 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7424 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7425 /// ```
7426 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7427 where
7428 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7429 {
7430 self.client_tls_policy = v.map(|x| x.into());
7431 self
7432 }
7433}
7434
7435impl wkt::message::Message for CreateClientTlsPolicyRequest {
7436 fn typename() -> &'static str {
7437 "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
7438 }
7439}
7440
7441/// Request used by UpdateClientTlsPolicy method.
7442#[derive(Clone, Default, PartialEq)]
7443#[non_exhaustive]
7444pub struct UpdateClientTlsPolicyRequest {
7445 /// Optional. Field mask is used to specify the fields to be overwritten in the
7446 /// ClientTlsPolicy resource by the update. The fields
7447 /// specified in the update_mask are relative to the resource, not
7448 /// the full request. A field will be overwritten if it is in the
7449 /// mask. If the user does not provide a mask then all fields will be
7450 /// overwritten.
7451 pub update_mask: std::option::Option<wkt::FieldMask>,
7452
7453 /// Required. Updated ClientTlsPolicy resource.
7454 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7455
7456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7457}
7458
7459impl UpdateClientTlsPolicyRequest {
7460 /// Creates a new default instance.
7461 pub fn new() -> Self {
7462 std::default::Default::default()
7463 }
7464
7465 /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7466 ///
7467 /// # Example
7468 /// ```ignore,no_run
7469 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7470 /// use wkt::FieldMask;
7471 /// let x = UpdateClientTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7472 /// ```
7473 pub fn set_update_mask<T>(mut self, v: T) -> Self
7474 where
7475 T: std::convert::Into<wkt::FieldMask>,
7476 {
7477 self.update_mask = std::option::Option::Some(v.into());
7478 self
7479 }
7480
7481 /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7482 ///
7483 /// # Example
7484 /// ```ignore,no_run
7485 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7486 /// use wkt::FieldMask;
7487 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7488 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7489 /// ```
7490 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7491 where
7492 T: std::convert::Into<wkt::FieldMask>,
7493 {
7494 self.update_mask = v.map(|x| x.into());
7495 self
7496 }
7497
7498 /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7499 ///
7500 /// # Example
7501 /// ```ignore,no_run
7502 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7503 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7504 /// let x = UpdateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7505 /// ```
7506 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7507 where
7508 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7509 {
7510 self.client_tls_policy = std::option::Option::Some(v.into());
7511 self
7512 }
7513
7514 /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7515 ///
7516 /// # Example
7517 /// ```ignore,no_run
7518 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7519 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7520 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7521 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7522 /// ```
7523 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7524 where
7525 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7526 {
7527 self.client_tls_policy = v.map(|x| x.into());
7528 self
7529 }
7530}
7531
7532impl wkt::message::Message for UpdateClientTlsPolicyRequest {
7533 fn typename() -> &'static str {
7534 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
7535 }
7536}
7537
7538/// Request used by the DeleteClientTlsPolicy method.
7539#[derive(Clone, Default, PartialEq)]
7540#[non_exhaustive]
7541pub struct DeleteClientTlsPolicyRequest {
7542 /// Required. A name of the ClientTlsPolicy to delete. Must be in
7543 /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
7544 pub name: std::string::String,
7545
7546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7547}
7548
7549impl DeleteClientTlsPolicyRequest {
7550 /// Creates a new default instance.
7551 pub fn new() -> Self {
7552 std::default::Default::default()
7553 }
7554
7555 /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
7556 ///
7557 /// # Example
7558 /// ```ignore,no_run
7559 /// # use google_cloud_networksecurity_v1::model::DeleteClientTlsPolicyRequest;
7560 /// # let project_id = "project_id";
7561 /// # let location_id = "location_id";
7562 /// # let client_tls_policy_id = "client_tls_policy_id";
7563 /// let x = DeleteClientTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/clientTlsPolicies/{client_tls_policy_id}"));
7564 /// ```
7565 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7566 self.name = v.into();
7567 self
7568 }
7569}
7570
7571impl wkt::message::Message for DeleteClientTlsPolicyRequest {
7572 fn typename() -> &'static str {
7573 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
7574 }
7575}
7576
7577/// Represents the metadata of the long-running operation.
7578#[derive(Clone, Default, PartialEq)]
7579#[non_exhaustive]
7580pub struct OperationMetadata {
7581 /// Output only. The time the operation was created.
7582 pub create_time: std::option::Option<wkt::Timestamp>,
7583
7584 /// Output only. The time the operation finished running.
7585 pub end_time: std::option::Option<wkt::Timestamp>,
7586
7587 /// Output only. Server-defined resource path for the target of the operation.
7588 pub target: std::string::String,
7589
7590 /// Output only. Name of the verb executed by the operation.
7591 pub verb: std::string::String,
7592
7593 /// Output only. Human-readable status of the operation, if any.
7594 pub status_message: std::string::String,
7595
7596 /// Output only. Identifies whether the user has requested cancellation
7597 /// of the operation. Operations that have successfully been cancelled
7598 /// have [Operation.error][] value with a
7599 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7600 /// `Code.CANCELLED`.
7601 pub requested_cancellation: bool,
7602
7603 /// Output only. API version used to start the operation.
7604 pub api_version: std::string::String,
7605
7606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7607}
7608
7609impl OperationMetadata {
7610 /// Creates a new default instance.
7611 pub fn new() -> Self {
7612 std::default::Default::default()
7613 }
7614
7615 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7616 ///
7617 /// # Example
7618 /// ```ignore,no_run
7619 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7620 /// use wkt::Timestamp;
7621 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7622 /// ```
7623 pub fn set_create_time<T>(mut self, v: T) -> Self
7624 where
7625 T: std::convert::Into<wkt::Timestamp>,
7626 {
7627 self.create_time = std::option::Option::Some(v.into());
7628 self
7629 }
7630
7631 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7632 ///
7633 /// # Example
7634 /// ```ignore,no_run
7635 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7636 /// use wkt::Timestamp;
7637 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7638 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7639 /// ```
7640 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7641 where
7642 T: std::convert::Into<wkt::Timestamp>,
7643 {
7644 self.create_time = v.map(|x| x.into());
7645 self
7646 }
7647
7648 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7649 ///
7650 /// # Example
7651 /// ```ignore,no_run
7652 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7653 /// use wkt::Timestamp;
7654 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7655 /// ```
7656 pub fn set_end_time<T>(mut self, v: T) -> Self
7657 where
7658 T: std::convert::Into<wkt::Timestamp>,
7659 {
7660 self.end_time = std::option::Option::Some(v.into());
7661 self
7662 }
7663
7664 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7665 ///
7666 /// # Example
7667 /// ```ignore,no_run
7668 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7669 /// use wkt::Timestamp;
7670 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7671 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7672 /// ```
7673 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7674 where
7675 T: std::convert::Into<wkt::Timestamp>,
7676 {
7677 self.end_time = v.map(|x| x.into());
7678 self
7679 }
7680
7681 /// Sets the value of [target][crate::model::OperationMetadata::target].
7682 ///
7683 /// # Example
7684 /// ```ignore,no_run
7685 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7686 /// let x = OperationMetadata::new().set_target("example");
7687 /// ```
7688 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7689 self.target = v.into();
7690 self
7691 }
7692
7693 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7694 ///
7695 /// # Example
7696 /// ```ignore,no_run
7697 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7698 /// let x = OperationMetadata::new().set_verb("example");
7699 /// ```
7700 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7701 self.verb = v.into();
7702 self
7703 }
7704
7705 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7706 ///
7707 /// # Example
7708 /// ```ignore,no_run
7709 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7710 /// let x = OperationMetadata::new().set_status_message("example");
7711 /// ```
7712 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7713 self.status_message = v.into();
7714 self
7715 }
7716
7717 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7718 ///
7719 /// # Example
7720 /// ```ignore,no_run
7721 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7722 /// let x = OperationMetadata::new().set_requested_cancellation(true);
7723 /// ```
7724 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7725 self.requested_cancellation = v.into();
7726 self
7727 }
7728
7729 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7730 ///
7731 /// # Example
7732 /// ```ignore,no_run
7733 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7734 /// let x = OperationMetadata::new().set_api_version("example");
7735 /// ```
7736 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7737 self.api_version = v.into();
7738 self
7739 }
7740}
7741
7742impl wkt::message::Message for OperationMetadata {
7743 fn typename() -> &'static str {
7744 "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
7745 }
7746}
7747
7748/// A DNS threat detector sends DNS query logs to a _provider_ that then
7749/// analyzes the logs to identify threat events in the DNS queries.
7750/// By default, all VPC networks in your projects are included. You can exclude
7751/// specific networks by supplying `excluded_networks`.
7752#[derive(Clone, Default, PartialEq)]
7753#[non_exhaustive]
7754pub struct DnsThreatDetector {
7755 /// Immutable. Identifier. Name of the DnsThreatDetector resource.
7756 pub name: std::string::String,
7757
7758 /// Output only. Create time stamp.
7759 pub create_time: std::option::Option<wkt::Timestamp>,
7760
7761 /// Output only. Update time stamp.
7762 pub update_time: std::option::Option<wkt::Timestamp>,
7763
7764 /// Optional. Any labels associated with the DnsThreatDetector, listed as key
7765 /// value pairs.
7766 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7767
7768 /// Optional. A list of network resource names which aren't monitored by this
7769 /// DnsThreatDetector.
7770 ///
7771 /// Example:
7772 /// `projects/PROJECT_ID/global/networks/NETWORK_NAME`.
7773 pub excluded_networks: std::vec::Vec<std::string::String>,
7774
7775 /// Required. The provider used for DNS threat analysis.
7776 pub provider: crate::model::dns_threat_detector::Provider,
7777
7778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7779}
7780
7781impl DnsThreatDetector {
7782 /// Creates a new default instance.
7783 pub fn new() -> Self {
7784 std::default::Default::default()
7785 }
7786
7787 /// Sets the value of [name][crate::model::DnsThreatDetector::name].
7788 ///
7789 /// # Example
7790 /// ```ignore,no_run
7791 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7792 /// # let project_id = "project_id";
7793 /// # let location_id = "location_id";
7794 /// # let dns_threat_detector_id = "dns_threat_detector_id";
7795 /// let x = DnsThreatDetector::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
7796 /// ```
7797 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7798 self.name = v.into();
7799 self
7800 }
7801
7802 /// Sets the value of [create_time][crate::model::DnsThreatDetector::create_time].
7803 ///
7804 /// # Example
7805 /// ```ignore,no_run
7806 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7807 /// use wkt::Timestamp;
7808 /// let x = DnsThreatDetector::new().set_create_time(Timestamp::default()/* use setters */);
7809 /// ```
7810 pub fn set_create_time<T>(mut self, v: T) -> Self
7811 where
7812 T: std::convert::Into<wkt::Timestamp>,
7813 {
7814 self.create_time = std::option::Option::Some(v.into());
7815 self
7816 }
7817
7818 /// Sets or clears the value of [create_time][crate::model::DnsThreatDetector::create_time].
7819 ///
7820 /// # Example
7821 /// ```ignore,no_run
7822 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7823 /// use wkt::Timestamp;
7824 /// let x = DnsThreatDetector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7825 /// let x = DnsThreatDetector::new().set_or_clear_create_time(None::<Timestamp>);
7826 /// ```
7827 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7828 where
7829 T: std::convert::Into<wkt::Timestamp>,
7830 {
7831 self.create_time = v.map(|x| x.into());
7832 self
7833 }
7834
7835 /// Sets the value of [update_time][crate::model::DnsThreatDetector::update_time].
7836 ///
7837 /// # Example
7838 /// ```ignore,no_run
7839 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7840 /// use wkt::Timestamp;
7841 /// let x = DnsThreatDetector::new().set_update_time(Timestamp::default()/* use setters */);
7842 /// ```
7843 pub fn set_update_time<T>(mut self, v: T) -> Self
7844 where
7845 T: std::convert::Into<wkt::Timestamp>,
7846 {
7847 self.update_time = std::option::Option::Some(v.into());
7848 self
7849 }
7850
7851 /// Sets or clears the value of [update_time][crate::model::DnsThreatDetector::update_time].
7852 ///
7853 /// # Example
7854 /// ```ignore,no_run
7855 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7856 /// use wkt::Timestamp;
7857 /// let x = DnsThreatDetector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7858 /// let x = DnsThreatDetector::new().set_or_clear_update_time(None::<Timestamp>);
7859 /// ```
7860 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7861 where
7862 T: std::convert::Into<wkt::Timestamp>,
7863 {
7864 self.update_time = v.map(|x| x.into());
7865 self
7866 }
7867
7868 /// Sets the value of [labels][crate::model::DnsThreatDetector::labels].
7869 ///
7870 /// # Example
7871 /// ```ignore,no_run
7872 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7873 /// let x = DnsThreatDetector::new().set_labels([
7874 /// ("key0", "abc"),
7875 /// ("key1", "xyz"),
7876 /// ]);
7877 /// ```
7878 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7879 where
7880 T: std::iter::IntoIterator<Item = (K, V)>,
7881 K: std::convert::Into<std::string::String>,
7882 V: std::convert::Into<std::string::String>,
7883 {
7884 use std::iter::Iterator;
7885 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7886 self
7887 }
7888
7889 /// Sets the value of [excluded_networks][crate::model::DnsThreatDetector::excluded_networks].
7890 ///
7891 /// # Example
7892 /// ```ignore,no_run
7893 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7894 /// let x = DnsThreatDetector::new().set_excluded_networks(["a", "b", "c"]);
7895 /// ```
7896 pub fn set_excluded_networks<T, V>(mut self, v: T) -> Self
7897 where
7898 T: std::iter::IntoIterator<Item = V>,
7899 V: std::convert::Into<std::string::String>,
7900 {
7901 use std::iter::Iterator;
7902 self.excluded_networks = v.into_iter().map(|i| i.into()).collect();
7903 self
7904 }
7905
7906 /// Sets the value of [provider][crate::model::DnsThreatDetector::provider].
7907 ///
7908 /// # Example
7909 /// ```ignore,no_run
7910 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7911 /// use google_cloud_networksecurity_v1::model::dns_threat_detector::Provider;
7912 /// let x0 = DnsThreatDetector::new().set_provider(Provider::Infoblox);
7913 /// ```
7914 pub fn set_provider<T: std::convert::Into<crate::model::dns_threat_detector::Provider>>(
7915 mut self,
7916 v: T,
7917 ) -> Self {
7918 self.provider = v.into();
7919 self
7920 }
7921}
7922
7923impl wkt::message::Message for DnsThreatDetector {
7924 fn typename() -> &'static str {
7925 "type.googleapis.com/google.cloud.networksecurity.v1.DnsThreatDetector"
7926 }
7927}
7928
7929/// Defines additional types related to [DnsThreatDetector].
7930pub mod dns_threat_detector {
7931 #[allow(unused_imports)]
7932 use super::*;
7933
7934 /// Name of the provider used for DNS threat analysis.
7935 ///
7936 /// # Working with unknown values
7937 ///
7938 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7939 /// additional enum variants at any time. Adding new variants is not considered
7940 /// a breaking change. Applications should write their code in anticipation of:
7941 ///
7942 /// - New values appearing in future releases of the client library, **and**
7943 /// - New values received dynamically, without application changes.
7944 ///
7945 /// Please consult the [Working with enums] section in the user guide for some
7946 /// guidelines.
7947 ///
7948 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7949 #[derive(Clone, Debug, PartialEq)]
7950 #[non_exhaustive]
7951 pub enum Provider {
7952 /// An unspecified provider.
7953 Unspecified,
7954 /// The Infoblox DNS threat detector provider.
7955 Infoblox,
7956 /// If set, the enum was initialized with an unknown value.
7957 ///
7958 /// Applications can examine the value using [Provider::value] or
7959 /// [Provider::name].
7960 UnknownValue(provider::UnknownValue),
7961 }
7962
7963 #[doc(hidden)]
7964 pub mod provider {
7965 #[allow(unused_imports)]
7966 use super::*;
7967 #[derive(Clone, Debug, PartialEq)]
7968 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7969 }
7970
7971 impl Provider {
7972 /// Gets the enum value.
7973 ///
7974 /// Returns `None` if the enum contains an unknown value deserialized from
7975 /// the string representation of enums.
7976 pub fn value(&self) -> std::option::Option<i32> {
7977 match self {
7978 Self::Unspecified => std::option::Option::Some(0),
7979 Self::Infoblox => std::option::Option::Some(1),
7980 Self::UnknownValue(u) => u.0.value(),
7981 }
7982 }
7983
7984 /// Gets the enum value as a string.
7985 ///
7986 /// Returns `None` if the enum contains an unknown value deserialized from
7987 /// the integer representation of enums.
7988 pub fn name(&self) -> std::option::Option<&str> {
7989 match self {
7990 Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
7991 Self::Infoblox => std::option::Option::Some("INFOBLOX"),
7992 Self::UnknownValue(u) => u.0.name(),
7993 }
7994 }
7995 }
7996
7997 impl std::default::Default for Provider {
7998 fn default() -> Self {
7999 use std::convert::From;
8000 Self::from(0)
8001 }
8002 }
8003
8004 impl std::fmt::Display for Provider {
8005 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8006 wkt::internal::display_enum(f, self.name(), self.value())
8007 }
8008 }
8009
8010 impl std::convert::From<i32> for Provider {
8011 fn from(value: i32) -> Self {
8012 match value {
8013 0 => Self::Unspecified,
8014 1 => Self::Infoblox,
8015 _ => Self::UnknownValue(provider::UnknownValue(
8016 wkt::internal::UnknownEnumValue::Integer(value),
8017 )),
8018 }
8019 }
8020 }
8021
8022 impl std::convert::From<&str> for Provider {
8023 fn from(value: &str) -> Self {
8024 use std::string::ToString;
8025 match value {
8026 "PROVIDER_UNSPECIFIED" => Self::Unspecified,
8027 "INFOBLOX" => Self::Infoblox,
8028 _ => Self::UnknownValue(provider::UnknownValue(
8029 wkt::internal::UnknownEnumValue::String(value.to_string()),
8030 )),
8031 }
8032 }
8033 }
8034
8035 impl serde::ser::Serialize for Provider {
8036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8037 where
8038 S: serde::Serializer,
8039 {
8040 match self {
8041 Self::Unspecified => serializer.serialize_i32(0),
8042 Self::Infoblox => serializer.serialize_i32(1),
8043 Self::UnknownValue(u) => u.0.serialize(serializer),
8044 }
8045 }
8046 }
8047
8048 impl<'de> serde::de::Deserialize<'de> for Provider {
8049 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8050 where
8051 D: serde::Deserializer<'de>,
8052 {
8053 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
8054 ".google.cloud.networksecurity.v1.DnsThreatDetector.Provider",
8055 ))
8056 }
8057 }
8058}
8059
8060/// The message for requesting a list of DnsThreatDetectors in the project.
8061#[derive(Clone, Default, PartialEq)]
8062#[non_exhaustive]
8063pub struct ListDnsThreatDetectorsRequest {
8064 /// Required. The parent value for `ListDnsThreatDetectorsRequest`.
8065 pub parent: std::string::String,
8066
8067 /// Optional. The requested page size. The server may return fewer items than
8068 /// requested. If unspecified, the server picks an appropriate default.
8069 pub page_size: i32,
8070
8071 /// Optional. A page token received from a previous
8072 /// `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the
8073 /// subsequent page.
8074 pub page_token: std::string::String,
8075
8076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8077}
8078
8079impl ListDnsThreatDetectorsRequest {
8080 /// Creates a new default instance.
8081 pub fn new() -> Self {
8082 std::default::Default::default()
8083 }
8084
8085 /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
8086 ///
8087 /// # Example
8088 /// ```ignore,no_run
8089 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8090 /// # let project_id = "project_id";
8091 /// # let location_id = "location_id";
8092 /// let x = ListDnsThreatDetectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8093 /// ```
8094 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8095 self.parent = v.into();
8096 self
8097 }
8098
8099 /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
8100 ///
8101 /// # Example
8102 /// ```ignore,no_run
8103 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8104 /// let x = ListDnsThreatDetectorsRequest::new().set_page_size(42);
8105 /// ```
8106 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8107 self.page_size = v.into();
8108 self
8109 }
8110
8111 /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
8112 ///
8113 /// # Example
8114 /// ```ignore,no_run
8115 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
8116 /// let x = ListDnsThreatDetectorsRequest::new().set_page_token("example");
8117 /// ```
8118 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8119 self.page_token = v.into();
8120 self
8121 }
8122}
8123
8124impl wkt::message::Message for ListDnsThreatDetectorsRequest {
8125 fn typename() -> &'static str {
8126 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest"
8127 }
8128}
8129
8130/// The response message to requesting a list of DnsThreatDetectors.
8131#[derive(Clone, Default, PartialEq)]
8132#[non_exhaustive]
8133pub struct ListDnsThreatDetectorsResponse {
8134 /// The list of DnsThreatDetector resources.
8135 pub dns_threat_detectors: std::vec::Vec<crate::model::DnsThreatDetector>,
8136
8137 /// A token, which can be sent as `page_token`, to retrieve the next page.
8138 pub next_page_token: std::string::String,
8139
8140 /// Unordered list. Unreachable `DnsThreatDetector` resources.
8141 pub unreachable: std::vec::Vec<std::string::String>,
8142
8143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8144}
8145
8146impl ListDnsThreatDetectorsResponse {
8147 /// Creates a new default instance.
8148 pub fn new() -> Self {
8149 std::default::Default::default()
8150 }
8151
8152 /// Sets the value of [dns_threat_detectors][crate::model::ListDnsThreatDetectorsResponse::dns_threat_detectors].
8153 ///
8154 /// # Example
8155 /// ```ignore,no_run
8156 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8157 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8158 /// let x = ListDnsThreatDetectorsResponse::new()
8159 /// .set_dns_threat_detectors([
8160 /// DnsThreatDetector::default()/* use setters */,
8161 /// DnsThreatDetector::default()/* use (different) setters */,
8162 /// ]);
8163 /// ```
8164 pub fn set_dns_threat_detectors<T, V>(mut self, v: T) -> Self
8165 where
8166 T: std::iter::IntoIterator<Item = V>,
8167 V: std::convert::Into<crate::model::DnsThreatDetector>,
8168 {
8169 use std::iter::Iterator;
8170 self.dns_threat_detectors = v.into_iter().map(|i| i.into()).collect();
8171 self
8172 }
8173
8174 /// Sets the value of [next_page_token][crate::model::ListDnsThreatDetectorsResponse::next_page_token].
8175 ///
8176 /// # Example
8177 /// ```ignore,no_run
8178 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8179 /// let x = ListDnsThreatDetectorsResponse::new().set_next_page_token("example");
8180 /// ```
8181 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8182 self.next_page_token = v.into();
8183 self
8184 }
8185
8186 /// Sets the value of [unreachable][crate::model::ListDnsThreatDetectorsResponse::unreachable].
8187 ///
8188 /// # Example
8189 /// ```ignore,no_run
8190 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
8191 /// let x = ListDnsThreatDetectorsResponse::new().set_unreachable(["a", "b", "c"]);
8192 /// ```
8193 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8194 where
8195 T: std::iter::IntoIterator<Item = V>,
8196 V: std::convert::Into<std::string::String>,
8197 {
8198 use std::iter::Iterator;
8199 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8200 self
8201 }
8202}
8203
8204impl wkt::message::Message for ListDnsThreatDetectorsResponse {
8205 fn typename() -> &'static str {
8206 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse"
8207 }
8208}
8209
8210#[doc(hidden)]
8211impl google_cloud_gax::paginator::internal::PageableResponse for ListDnsThreatDetectorsResponse {
8212 type PageItem = crate::model::DnsThreatDetector;
8213
8214 fn items(self) -> std::vec::Vec<Self::PageItem> {
8215 self.dns_threat_detectors
8216 }
8217
8218 fn next_page_token(&self) -> std::string::String {
8219 use std::clone::Clone;
8220 self.next_page_token.clone()
8221 }
8222}
8223
8224/// The message sent to get a DnsThreatDetector.
8225#[derive(Clone, Default, PartialEq)]
8226#[non_exhaustive]
8227pub struct GetDnsThreatDetectorRequest {
8228 /// Required. Name of the DnsThreatDetector resource.
8229 pub name: std::string::String,
8230
8231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8232}
8233
8234impl GetDnsThreatDetectorRequest {
8235 /// Creates a new default instance.
8236 pub fn new() -> Self {
8237 std::default::Default::default()
8238 }
8239
8240 /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
8241 ///
8242 /// # Example
8243 /// ```ignore,no_run
8244 /// # use google_cloud_networksecurity_v1::model::GetDnsThreatDetectorRequest;
8245 /// # let project_id = "project_id";
8246 /// # let location_id = "location_id";
8247 /// # let dns_threat_detector_id = "dns_threat_detector_id";
8248 /// let x = GetDnsThreatDetectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
8249 /// ```
8250 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8251 self.name = v.into();
8252 self
8253 }
8254}
8255
8256impl wkt::message::Message for GetDnsThreatDetectorRequest {
8257 fn typename() -> &'static str {
8258 "type.googleapis.com/google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest"
8259 }
8260}
8261
8262/// The message to create a DnsThreatDetector.
8263#[derive(Clone, Default, PartialEq)]
8264#[non_exhaustive]
8265pub struct CreateDnsThreatDetectorRequest {
8266 /// Required. The value for the parent of the DnsThreatDetector resource.
8267 pub parent: std::string::String,
8268
8269 /// Optional. The ID of the requesting DnsThreatDetector object.
8270 /// If this field is not supplied, the service generates an identifier.
8271 pub dns_threat_detector_id: std::string::String,
8272
8273 /// Required. The `DnsThreatDetector` resource to create.
8274 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8275
8276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8277}
8278
8279impl CreateDnsThreatDetectorRequest {
8280 /// Creates a new default instance.
8281 pub fn new() -> Self {
8282 std::default::Default::default()
8283 }
8284
8285 /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
8286 ///
8287 /// # Example
8288 /// ```ignore,no_run
8289 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8290 /// # let project_id = "project_id";
8291 /// # let location_id = "location_id";
8292 /// let x = CreateDnsThreatDetectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8293 /// ```
8294 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8295 self.parent = v.into();
8296 self
8297 }
8298
8299 /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
8300 ///
8301 /// # Example
8302 /// ```ignore,no_run
8303 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8304 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector_id("example");
8305 /// ```
8306 pub fn set_dns_threat_detector_id<T: std::convert::Into<std::string::String>>(
8307 mut self,
8308 v: T,
8309 ) -> Self {
8310 self.dns_threat_detector_id = v.into();
8311 self
8312 }
8313
8314 /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8315 ///
8316 /// # Example
8317 /// ```ignore,no_run
8318 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8319 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8320 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8321 /// ```
8322 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8323 where
8324 T: std::convert::Into<crate::model::DnsThreatDetector>,
8325 {
8326 self.dns_threat_detector = std::option::Option::Some(v.into());
8327 self
8328 }
8329
8330 /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8331 ///
8332 /// # Example
8333 /// ```ignore,no_run
8334 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8335 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8336 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8337 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8338 /// ```
8339 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8340 where
8341 T: std::convert::Into<crate::model::DnsThreatDetector>,
8342 {
8343 self.dns_threat_detector = v.map(|x| x.into());
8344 self
8345 }
8346}
8347
8348impl wkt::message::Message for CreateDnsThreatDetectorRequest {
8349 fn typename() -> &'static str {
8350 "type.googleapis.com/google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest"
8351 }
8352}
8353
8354/// The message for updating a DnsThreatDetector.
8355#[derive(Clone, Default, PartialEq)]
8356#[non_exhaustive]
8357pub struct UpdateDnsThreatDetectorRequest {
8358 /// Optional. The field mask is used to specify the fields to be overwritten in
8359 /// the DnsThreatDetector resource by the update. The fields specified in the
8360 /// update_mask are relative to the resource, not the full request. A field
8361 /// will be overwritten if it is in the mask. If the mask is not provided then
8362 /// all fields present in the request will be overwritten.
8363 pub update_mask: std::option::Option<wkt::FieldMask>,
8364
8365 /// Required. The DnsThreatDetector resource being updated.
8366 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8367
8368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8369}
8370
8371impl UpdateDnsThreatDetectorRequest {
8372 /// Creates a new default instance.
8373 pub fn new() -> Self {
8374 std::default::Default::default()
8375 }
8376
8377 /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8378 ///
8379 /// # Example
8380 /// ```ignore,no_run
8381 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8382 /// use wkt::FieldMask;
8383 /// let x = UpdateDnsThreatDetectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8384 /// ```
8385 pub fn set_update_mask<T>(mut self, v: T) -> Self
8386 where
8387 T: std::convert::Into<wkt::FieldMask>,
8388 {
8389 self.update_mask = std::option::Option::Some(v.into());
8390 self
8391 }
8392
8393 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8394 ///
8395 /// # Example
8396 /// ```ignore,no_run
8397 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8398 /// use wkt::FieldMask;
8399 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8400 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8401 /// ```
8402 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8403 where
8404 T: std::convert::Into<wkt::FieldMask>,
8405 {
8406 self.update_mask = v.map(|x| x.into());
8407 self
8408 }
8409
8410 /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8411 ///
8412 /// # Example
8413 /// ```ignore,no_run
8414 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8415 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8416 /// let x = UpdateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8417 /// ```
8418 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8419 where
8420 T: std::convert::Into<crate::model::DnsThreatDetector>,
8421 {
8422 self.dns_threat_detector = std::option::Option::Some(v.into());
8423 self
8424 }
8425
8426 /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8427 ///
8428 /// # Example
8429 /// ```ignore,no_run
8430 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8431 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8432 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8433 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8434 /// ```
8435 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8436 where
8437 T: std::convert::Into<crate::model::DnsThreatDetector>,
8438 {
8439 self.dns_threat_detector = v.map(|x| x.into());
8440 self
8441 }
8442}
8443
8444impl wkt::message::Message for UpdateDnsThreatDetectorRequest {
8445 fn typename() -> &'static str {
8446 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest"
8447 }
8448}
8449
8450/// The message for deleting a DnsThreatDetector.
8451#[derive(Clone, Default, PartialEq)]
8452#[non_exhaustive]
8453pub struct DeleteDnsThreatDetectorRequest {
8454 /// Required. Name of the DnsThreatDetector resource.
8455 pub name: std::string::String,
8456
8457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8458}
8459
8460impl DeleteDnsThreatDetectorRequest {
8461 /// Creates a new default instance.
8462 pub fn new() -> Self {
8463 std::default::Default::default()
8464 }
8465
8466 /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
8467 ///
8468 /// # Example
8469 /// ```ignore,no_run
8470 /// # use google_cloud_networksecurity_v1::model::DeleteDnsThreatDetectorRequest;
8471 /// # let project_id = "project_id";
8472 /// # let location_id = "location_id";
8473 /// # let dns_threat_detector_id = "dns_threat_detector_id";
8474 /// let x = DeleteDnsThreatDetectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsThreatDetectors/{dns_threat_detector_id}"));
8475 /// ```
8476 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8477 self.name = v.into();
8478 self
8479 }
8480}
8481
8482impl wkt::message::Message for DeleteDnsThreatDetectorRequest {
8483 fn typename() -> &'static str {
8484 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest"
8485 }
8486}
8487
8488/// Message describing Endpoint object.
8489#[derive(Clone, Default, PartialEq)]
8490#[non_exhaustive]
8491pub struct FirewallEndpoint {
8492 /// Immutable. Identifier. Name of resource.
8493 pub name: std::string::String,
8494
8495 /// Optional. Description of the firewall endpoint. Max length 2048
8496 /// characters.
8497 pub description: std::string::String,
8498
8499 /// Output only. Create time stamp.
8500 pub create_time: std::option::Option<wkt::Timestamp>,
8501
8502 /// Output only. Update time stamp
8503 pub update_time: std::option::Option<wkt::Timestamp>,
8504
8505 /// Optional. Labels as key value pairs
8506 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8507
8508 /// Output only. Current state of the endpoint.
8509 pub state: crate::model::firewall_endpoint::State,
8510
8511 /// Output only. Whether reconciling is in progress, recommended per
8512 /// <https://google.aip.dev/128>.
8513 pub reconciling: bool,
8514
8515 /// Output only. Deprecated: List of networks that are associated with this
8516 /// endpoint in the local zone. This is a projection of the
8517 /// FirewallEndpointAssociations pointing at this endpoint. A network will only
8518 /// appear in this list after traffic routing is fully configured. Format:
8519 /// projects/{project}/global/networks/{name}.
8520 #[deprecated]
8521 pub associated_networks: std::vec::Vec<std::string::String>,
8522
8523 /// Output only. List of FirewallEndpointAssociations that are associated to
8524 /// this endpoint. An association will only appear in this list after traffic
8525 /// routing is fully configured.
8526 pub associations: std::vec::Vec<crate::model::firewall_endpoint::AssociationReference>,
8527
8528 /// Output only. [Output Only] Reserved for future use.
8529 pub satisfies_pzs: std::option::Option<bool>,
8530
8531 /// Output only. [Output Only] Reserved for future use.
8532 pub satisfies_pzi: std::option::Option<bool>,
8533
8534 /// Optional. Project to charge for the deployed firewall endpoint.
8535 /// This field must be specified when creating the endpoint in the organization
8536 /// scope, and should be omitted otherwise.
8537 pub billing_project_id: std::string::String,
8538
8539 /// Optional. Settings for the endpoint.
8540 pub endpoint_settings: std::option::Option<crate::model::firewall_endpoint::EndpointSettings>,
8541
8542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8543}
8544
8545impl FirewallEndpoint {
8546 /// Creates a new default instance.
8547 pub fn new() -> Self {
8548 std::default::Default::default()
8549 }
8550
8551 /// Sets the value of [name][crate::model::FirewallEndpoint::name].
8552 ///
8553 /// # Example
8554 /// ```ignore,no_run
8555 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8556 /// # let organization_id = "organization_id";
8557 /// # let location_id = "location_id";
8558 /// # let firewall_endpoint_id = "firewall_endpoint_id";
8559 /// let x = FirewallEndpoint::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
8560 /// ```
8561 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8562 self.name = v.into();
8563 self
8564 }
8565
8566 /// Sets the value of [description][crate::model::FirewallEndpoint::description].
8567 ///
8568 /// # Example
8569 /// ```ignore,no_run
8570 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8571 /// let x = FirewallEndpoint::new().set_description("example");
8572 /// ```
8573 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8574 self.description = v.into();
8575 self
8576 }
8577
8578 /// Sets the value of [create_time][crate::model::FirewallEndpoint::create_time].
8579 ///
8580 /// # Example
8581 /// ```ignore,no_run
8582 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8583 /// use wkt::Timestamp;
8584 /// let x = FirewallEndpoint::new().set_create_time(Timestamp::default()/* use setters */);
8585 /// ```
8586 pub fn set_create_time<T>(mut self, v: T) -> Self
8587 where
8588 T: std::convert::Into<wkt::Timestamp>,
8589 {
8590 self.create_time = std::option::Option::Some(v.into());
8591 self
8592 }
8593
8594 /// Sets or clears the value of [create_time][crate::model::FirewallEndpoint::create_time].
8595 ///
8596 /// # Example
8597 /// ```ignore,no_run
8598 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8599 /// use wkt::Timestamp;
8600 /// let x = FirewallEndpoint::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8601 /// let x = FirewallEndpoint::new().set_or_clear_create_time(None::<Timestamp>);
8602 /// ```
8603 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8604 where
8605 T: std::convert::Into<wkt::Timestamp>,
8606 {
8607 self.create_time = v.map(|x| x.into());
8608 self
8609 }
8610
8611 /// Sets the value of [update_time][crate::model::FirewallEndpoint::update_time].
8612 ///
8613 /// # Example
8614 /// ```ignore,no_run
8615 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8616 /// use wkt::Timestamp;
8617 /// let x = FirewallEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
8618 /// ```
8619 pub fn set_update_time<T>(mut self, v: T) -> Self
8620 where
8621 T: std::convert::Into<wkt::Timestamp>,
8622 {
8623 self.update_time = std::option::Option::Some(v.into());
8624 self
8625 }
8626
8627 /// Sets or clears the value of [update_time][crate::model::FirewallEndpoint::update_time].
8628 ///
8629 /// # Example
8630 /// ```ignore,no_run
8631 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8632 /// use wkt::Timestamp;
8633 /// let x = FirewallEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8634 /// let x = FirewallEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
8635 /// ```
8636 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8637 where
8638 T: std::convert::Into<wkt::Timestamp>,
8639 {
8640 self.update_time = v.map(|x| x.into());
8641 self
8642 }
8643
8644 /// Sets the value of [labels][crate::model::FirewallEndpoint::labels].
8645 ///
8646 /// # Example
8647 /// ```ignore,no_run
8648 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8649 /// let x = FirewallEndpoint::new().set_labels([
8650 /// ("key0", "abc"),
8651 /// ("key1", "xyz"),
8652 /// ]);
8653 /// ```
8654 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8655 where
8656 T: std::iter::IntoIterator<Item = (K, V)>,
8657 K: std::convert::Into<std::string::String>,
8658 V: std::convert::Into<std::string::String>,
8659 {
8660 use std::iter::Iterator;
8661 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8662 self
8663 }
8664
8665 /// Sets the value of [state][crate::model::FirewallEndpoint::state].
8666 ///
8667 /// # Example
8668 /// ```ignore,no_run
8669 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8670 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::State;
8671 /// let x0 = FirewallEndpoint::new().set_state(State::Creating);
8672 /// let x1 = FirewallEndpoint::new().set_state(State::Active);
8673 /// let x2 = FirewallEndpoint::new().set_state(State::Deleting);
8674 /// ```
8675 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint::State>>(
8676 mut self,
8677 v: T,
8678 ) -> Self {
8679 self.state = v.into();
8680 self
8681 }
8682
8683 /// Sets the value of [reconciling][crate::model::FirewallEndpoint::reconciling].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8688 /// let x = FirewallEndpoint::new().set_reconciling(true);
8689 /// ```
8690 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8691 self.reconciling = v.into();
8692 self
8693 }
8694
8695 /// Sets the value of [associated_networks][crate::model::FirewallEndpoint::associated_networks].
8696 ///
8697 /// # Example
8698 /// ```ignore,no_run
8699 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8700 /// let x = FirewallEndpoint::new().set_associated_networks(["a", "b", "c"]);
8701 /// ```
8702 #[deprecated]
8703 pub fn set_associated_networks<T, V>(mut self, v: T) -> Self
8704 where
8705 T: std::iter::IntoIterator<Item = V>,
8706 V: std::convert::Into<std::string::String>,
8707 {
8708 use std::iter::Iterator;
8709 self.associated_networks = v.into_iter().map(|i| i.into()).collect();
8710 self
8711 }
8712
8713 /// Sets the value of [associations][crate::model::FirewallEndpoint::associations].
8714 ///
8715 /// # Example
8716 /// ```ignore,no_run
8717 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8718 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8719 /// let x = FirewallEndpoint::new()
8720 /// .set_associations([
8721 /// AssociationReference::default()/* use setters */,
8722 /// AssociationReference::default()/* use (different) setters */,
8723 /// ]);
8724 /// ```
8725 pub fn set_associations<T, V>(mut self, v: T) -> Self
8726 where
8727 T: std::iter::IntoIterator<Item = V>,
8728 V: std::convert::Into<crate::model::firewall_endpoint::AssociationReference>,
8729 {
8730 use std::iter::Iterator;
8731 self.associations = v.into_iter().map(|i| i.into()).collect();
8732 self
8733 }
8734
8735 /// Sets the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8736 ///
8737 /// # Example
8738 /// ```ignore,no_run
8739 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8740 /// let x = FirewallEndpoint::new().set_satisfies_pzs(true);
8741 /// ```
8742 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
8743 where
8744 T: std::convert::Into<bool>,
8745 {
8746 self.satisfies_pzs = std::option::Option::Some(v.into());
8747 self
8748 }
8749
8750 /// Sets or clears the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8755 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(Some(false));
8756 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(None::<bool>);
8757 /// ```
8758 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
8759 where
8760 T: std::convert::Into<bool>,
8761 {
8762 self.satisfies_pzs = v.map(|x| x.into());
8763 self
8764 }
8765
8766 /// Sets the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8767 ///
8768 /// # Example
8769 /// ```ignore,no_run
8770 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8771 /// let x = FirewallEndpoint::new().set_satisfies_pzi(true);
8772 /// ```
8773 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8774 where
8775 T: std::convert::Into<bool>,
8776 {
8777 self.satisfies_pzi = std::option::Option::Some(v.into());
8778 self
8779 }
8780
8781 /// Sets or clears the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8782 ///
8783 /// # Example
8784 /// ```ignore,no_run
8785 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8786 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(Some(false));
8787 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(None::<bool>);
8788 /// ```
8789 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8790 where
8791 T: std::convert::Into<bool>,
8792 {
8793 self.satisfies_pzi = v.map(|x| x.into());
8794 self
8795 }
8796
8797 /// Sets the value of [billing_project_id][crate::model::FirewallEndpoint::billing_project_id].
8798 ///
8799 /// # Example
8800 /// ```ignore,no_run
8801 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8802 /// let x = FirewallEndpoint::new().set_billing_project_id("example");
8803 /// ```
8804 pub fn set_billing_project_id<T: std::convert::Into<std::string::String>>(
8805 mut self,
8806 v: T,
8807 ) -> Self {
8808 self.billing_project_id = v.into();
8809 self
8810 }
8811
8812 /// Sets the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8813 ///
8814 /// # Example
8815 /// ```ignore,no_run
8816 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8817 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8818 /// let x = FirewallEndpoint::new().set_endpoint_settings(EndpointSettings::default()/* use setters */);
8819 /// ```
8820 pub fn set_endpoint_settings<T>(mut self, v: T) -> Self
8821 where
8822 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8823 {
8824 self.endpoint_settings = std::option::Option::Some(v.into());
8825 self
8826 }
8827
8828 /// Sets or clears the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8829 ///
8830 /// # Example
8831 /// ```ignore,no_run
8832 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8833 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8834 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(Some(EndpointSettings::default()/* use setters */));
8835 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(None::<EndpointSettings>);
8836 /// ```
8837 pub fn set_or_clear_endpoint_settings<T>(mut self, v: std::option::Option<T>) -> Self
8838 where
8839 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8840 {
8841 self.endpoint_settings = v.map(|x| x.into());
8842 self
8843 }
8844}
8845
8846impl wkt::message::Message for FirewallEndpoint {
8847 fn typename() -> &'static str {
8848 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint"
8849 }
8850}
8851
8852/// Defines additional types related to [FirewallEndpoint].
8853pub mod firewall_endpoint {
8854 #[allow(unused_imports)]
8855 use super::*;
8856
8857 /// This is a subset of the FirewallEndpointAssociation message, containing
8858 /// fields to be used by the consumer.
8859 #[derive(Clone, Default, PartialEq)]
8860 #[non_exhaustive]
8861 pub struct AssociationReference {
8862 /// Output only. The resource name of the FirewallEndpointAssociation.
8863 /// Format:
8864 /// projects/{project}/locations/{location}/firewallEndpointAssociations/{id}
8865 pub name: std::string::String,
8866
8867 /// Output only. The VPC network associated. Format:
8868 /// projects/{project}/global/networks/{name}.
8869 pub network: std::string::String,
8870
8871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8872 }
8873
8874 impl AssociationReference {
8875 /// Creates a new default instance.
8876 pub fn new() -> Self {
8877 std::default::Default::default()
8878 }
8879
8880 /// Sets the value of [name][crate::model::firewall_endpoint::AssociationReference::name].
8881 ///
8882 /// # Example
8883 /// ```ignore,no_run
8884 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8885 /// # let project_id = "project_id";
8886 /// # let location_id = "location_id";
8887 /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
8888 /// let x = AssociationReference::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
8889 /// ```
8890 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8891 self.name = v.into();
8892 self
8893 }
8894
8895 /// Sets the value of [network][crate::model::firewall_endpoint::AssociationReference::network].
8896 ///
8897 /// # Example
8898 /// ```ignore,no_run
8899 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8900 /// let x = AssociationReference::new().set_network("example");
8901 /// ```
8902 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8903 self.network = v.into();
8904 self
8905 }
8906 }
8907
8908 impl wkt::message::Message for AssociationReference {
8909 fn typename() -> &'static str {
8910 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference"
8911 }
8912 }
8913
8914 /// Settings for the endpoint.
8915 #[derive(Clone, Default, PartialEq)]
8916 #[non_exhaustive]
8917 pub struct EndpointSettings {
8918 /// Optional. Immutable. Indicates whether Jumbo Frames are enabled.
8919 /// Default value is false.
8920 pub jumbo_frames_enabled: bool,
8921
8922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8923 }
8924
8925 impl EndpointSettings {
8926 /// Creates a new default instance.
8927 pub fn new() -> Self {
8928 std::default::Default::default()
8929 }
8930
8931 /// Sets the value of [jumbo_frames_enabled][crate::model::firewall_endpoint::EndpointSettings::jumbo_frames_enabled].
8932 ///
8933 /// # Example
8934 /// ```ignore,no_run
8935 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8936 /// let x = EndpointSettings::new().set_jumbo_frames_enabled(true);
8937 /// ```
8938 pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8939 self.jumbo_frames_enabled = v.into();
8940 self
8941 }
8942 }
8943
8944 impl wkt::message::Message for EndpointSettings {
8945 fn typename() -> &'static str {
8946 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings"
8947 }
8948 }
8949
8950 /// Endpoint state.
8951 ///
8952 /// # Working with unknown values
8953 ///
8954 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8955 /// additional enum variants at any time. Adding new variants is not considered
8956 /// a breaking change. Applications should write their code in anticipation of:
8957 ///
8958 /// - New values appearing in future releases of the client library, **and**
8959 /// - New values received dynamically, without application changes.
8960 ///
8961 /// Please consult the [Working with enums] section in the user guide for some
8962 /// guidelines.
8963 ///
8964 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8965 #[derive(Clone, Debug, PartialEq)]
8966 #[non_exhaustive]
8967 pub enum State {
8968 /// Not set.
8969 Unspecified,
8970 /// Being created.
8971 Creating,
8972 /// Processing configuration updates.
8973 Active,
8974 /// Being deleted.
8975 Deleting,
8976 /// Down or in an error state.
8977 Inactive,
8978 /// If set, the enum was initialized with an unknown value.
8979 ///
8980 /// Applications can examine the value using [State::value] or
8981 /// [State::name].
8982 UnknownValue(state::UnknownValue),
8983 }
8984
8985 #[doc(hidden)]
8986 pub mod state {
8987 #[allow(unused_imports)]
8988 use super::*;
8989 #[derive(Clone, Debug, PartialEq)]
8990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8991 }
8992
8993 impl State {
8994 /// Gets the enum value.
8995 ///
8996 /// Returns `None` if the enum contains an unknown value deserialized from
8997 /// the string representation of enums.
8998 pub fn value(&self) -> std::option::Option<i32> {
8999 match self {
9000 Self::Unspecified => std::option::Option::Some(0),
9001 Self::Creating => std::option::Option::Some(1),
9002 Self::Active => std::option::Option::Some(2),
9003 Self::Deleting => std::option::Option::Some(3),
9004 Self::Inactive => std::option::Option::Some(4),
9005 Self::UnknownValue(u) => u.0.value(),
9006 }
9007 }
9008
9009 /// Gets the enum value as a string.
9010 ///
9011 /// Returns `None` if the enum contains an unknown value deserialized from
9012 /// the integer representation of enums.
9013 pub fn name(&self) -> std::option::Option<&str> {
9014 match self {
9015 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9016 Self::Creating => std::option::Option::Some("CREATING"),
9017 Self::Active => std::option::Option::Some("ACTIVE"),
9018 Self::Deleting => std::option::Option::Some("DELETING"),
9019 Self::Inactive => std::option::Option::Some("INACTIVE"),
9020 Self::UnknownValue(u) => u.0.name(),
9021 }
9022 }
9023 }
9024
9025 impl std::default::Default for State {
9026 fn default() -> Self {
9027 use std::convert::From;
9028 Self::from(0)
9029 }
9030 }
9031
9032 impl std::fmt::Display for State {
9033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9034 wkt::internal::display_enum(f, self.name(), self.value())
9035 }
9036 }
9037
9038 impl std::convert::From<i32> for State {
9039 fn from(value: i32) -> Self {
9040 match value {
9041 0 => Self::Unspecified,
9042 1 => Self::Creating,
9043 2 => Self::Active,
9044 3 => Self::Deleting,
9045 4 => Self::Inactive,
9046 _ => Self::UnknownValue(state::UnknownValue(
9047 wkt::internal::UnknownEnumValue::Integer(value),
9048 )),
9049 }
9050 }
9051 }
9052
9053 impl std::convert::From<&str> for State {
9054 fn from(value: &str) -> Self {
9055 use std::string::ToString;
9056 match value {
9057 "STATE_UNSPECIFIED" => Self::Unspecified,
9058 "CREATING" => Self::Creating,
9059 "ACTIVE" => Self::Active,
9060 "DELETING" => Self::Deleting,
9061 "INACTIVE" => Self::Inactive,
9062 _ => Self::UnknownValue(state::UnknownValue(
9063 wkt::internal::UnknownEnumValue::String(value.to_string()),
9064 )),
9065 }
9066 }
9067 }
9068
9069 impl serde::ser::Serialize for State {
9070 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9071 where
9072 S: serde::Serializer,
9073 {
9074 match self {
9075 Self::Unspecified => serializer.serialize_i32(0),
9076 Self::Creating => serializer.serialize_i32(1),
9077 Self::Active => serializer.serialize_i32(2),
9078 Self::Deleting => serializer.serialize_i32(3),
9079 Self::Inactive => serializer.serialize_i32(4),
9080 Self::UnknownValue(u) => u.0.serialize(serializer),
9081 }
9082 }
9083 }
9084
9085 impl<'de> serde::de::Deserialize<'de> for State {
9086 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9087 where
9088 D: serde::Deserializer<'de>,
9089 {
9090 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9091 ".google.cloud.networksecurity.v1.FirewallEndpoint.State",
9092 ))
9093 }
9094 }
9095}
9096
9097/// Message for requesting list of Endpoints
9098#[derive(Clone, Default, PartialEq)]
9099#[non_exhaustive]
9100pub struct ListFirewallEndpointsRequest {
9101 /// Required. Parent value for ListEndpointsRequest
9102 pub parent: std::string::String,
9103
9104 /// Optional. Requested page size. Server may return fewer items than
9105 /// requested. If unspecified, server will pick an appropriate default.
9106 pub page_size: i32,
9107
9108 /// A token identifying a page of results the server should return.
9109 pub page_token: std::string::String,
9110
9111 /// Optional. Filtering results
9112 pub filter: std::string::String,
9113
9114 /// Hint for how to order the results
9115 pub order_by: std::string::String,
9116
9117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9118}
9119
9120impl ListFirewallEndpointsRequest {
9121 /// Creates a new default instance.
9122 pub fn new() -> Self {
9123 std::default::Default::default()
9124 }
9125
9126 /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
9127 ///
9128 /// # Example
9129 /// ```ignore,no_run
9130 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9131 /// # let organization_id = "organization_id";
9132 /// # let location_id = "location_id";
9133 /// let x = ListFirewallEndpointsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
9134 /// ```
9135 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9136 self.parent = v.into();
9137 self
9138 }
9139
9140 /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
9141 ///
9142 /// # Example
9143 /// ```ignore,no_run
9144 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9145 /// let x = ListFirewallEndpointsRequest::new().set_page_size(42);
9146 /// ```
9147 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9148 self.page_size = v.into();
9149 self
9150 }
9151
9152 /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9157 /// let x = ListFirewallEndpointsRequest::new().set_page_token("example");
9158 /// ```
9159 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160 self.page_token = v.into();
9161 self
9162 }
9163
9164 /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9169 /// let x = ListFirewallEndpointsRequest::new().set_filter("example");
9170 /// ```
9171 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9172 self.filter = v.into();
9173 self
9174 }
9175
9176 /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
9177 ///
9178 /// # Example
9179 /// ```ignore,no_run
9180 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
9181 /// let x = ListFirewallEndpointsRequest::new().set_order_by("example");
9182 /// ```
9183 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9184 self.order_by = v.into();
9185 self
9186 }
9187}
9188
9189impl wkt::message::Message for ListFirewallEndpointsRequest {
9190 fn typename() -> &'static str {
9191 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsRequest"
9192 }
9193}
9194
9195/// Message for response to listing Endpoints
9196#[derive(Clone, Default, PartialEq)]
9197#[non_exhaustive]
9198pub struct ListFirewallEndpointsResponse {
9199 /// The list of Endpoint
9200 pub firewall_endpoints: std::vec::Vec<crate::model::FirewallEndpoint>,
9201
9202 /// A token identifying a page of results the server should return.
9203 pub next_page_token: std::string::String,
9204
9205 /// Locations that could not be reached.
9206 pub unreachable: std::vec::Vec<std::string::String>,
9207
9208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9209}
9210
9211impl ListFirewallEndpointsResponse {
9212 /// Creates a new default instance.
9213 pub fn new() -> Self {
9214 std::default::Default::default()
9215 }
9216
9217 /// Sets the value of [firewall_endpoints][crate::model::ListFirewallEndpointsResponse::firewall_endpoints].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9222 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9223 /// let x = ListFirewallEndpointsResponse::new()
9224 /// .set_firewall_endpoints([
9225 /// FirewallEndpoint::default()/* use setters */,
9226 /// FirewallEndpoint::default()/* use (different) setters */,
9227 /// ]);
9228 /// ```
9229 pub fn set_firewall_endpoints<T, V>(mut self, v: T) -> Self
9230 where
9231 T: std::iter::IntoIterator<Item = V>,
9232 V: std::convert::Into<crate::model::FirewallEndpoint>,
9233 {
9234 use std::iter::Iterator;
9235 self.firewall_endpoints = v.into_iter().map(|i| i.into()).collect();
9236 self
9237 }
9238
9239 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointsResponse::next_page_token].
9240 ///
9241 /// # Example
9242 /// ```ignore,no_run
9243 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9244 /// let x = ListFirewallEndpointsResponse::new().set_next_page_token("example");
9245 /// ```
9246 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9247 self.next_page_token = v.into();
9248 self
9249 }
9250
9251 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointsResponse::unreachable].
9252 ///
9253 /// # Example
9254 /// ```ignore,no_run
9255 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9256 /// let x = ListFirewallEndpointsResponse::new().set_unreachable(["a", "b", "c"]);
9257 /// ```
9258 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9259 where
9260 T: std::iter::IntoIterator<Item = V>,
9261 V: std::convert::Into<std::string::String>,
9262 {
9263 use std::iter::Iterator;
9264 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9265 self
9266 }
9267}
9268
9269impl wkt::message::Message for ListFirewallEndpointsResponse {
9270 fn typename() -> &'static str {
9271 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsResponse"
9272 }
9273}
9274
9275#[doc(hidden)]
9276impl google_cloud_gax::paginator::internal::PageableResponse for ListFirewallEndpointsResponse {
9277 type PageItem = crate::model::FirewallEndpoint;
9278
9279 fn items(self) -> std::vec::Vec<Self::PageItem> {
9280 self.firewall_endpoints
9281 }
9282
9283 fn next_page_token(&self) -> std::string::String {
9284 use std::clone::Clone;
9285 self.next_page_token.clone()
9286 }
9287}
9288
9289/// Message for getting a Endpoint
9290#[derive(Clone, Default, PartialEq)]
9291#[non_exhaustive]
9292pub struct GetFirewallEndpointRequest {
9293 /// Required. Name of the resource
9294 pub name: std::string::String,
9295
9296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9297}
9298
9299impl GetFirewallEndpointRequest {
9300 /// Creates a new default instance.
9301 pub fn new() -> Self {
9302 std::default::Default::default()
9303 }
9304
9305 /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
9306 ///
9307 /// # Example
9308 /// ```ignore,no_run
9309 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointRequest;
9310 /// # let organization_id = "organization_id";
9311 /// # let location_id = "location_id";
9312 /// # let firewall_endpoint_id = "firewall_endpoint_id";
9313 /// let x = GetFirewallEndpointRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
9314 /// ```
9315 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9316 self.name = v.into();
9317 self
9318 }
9319}
9320
9321impl wkt::message::Message for GetFirewallEndpointRequest {
9322 fn typename() -> &'static str {
9323 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointRequest"
9324 }
9325}
9326
9327/// Message for creating a Endpoint
9328#[derive(Clone, Default, PartialEq)]
9329#[non_exhaustive]
9330pub struct CreateFirewallEndpointRequest {
9331 /// Required. Value for parent.
9332 pub parent: std::string::String,
9333
9334 /// Required. Id of the requesting object.
9335 /// If auto-generating Id server-side, remove this field and
9336 /// firewall_endpoint_id from the method_signature of Create RPC.
9337 pub firewall_endpoint_id: std::string::String,
9338
9339 /// Required. The resource being created
9340 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9341
9342 /// Optional. An optional request ID to identify requests. Specify a unique
9343 /// request ID so that if you must retry your request, the server will know to
9344 /// ignore the request if it has already been completed. The server will
9345 /// guarantee that for at least 60 minutes since the first request.
9346 ///
9347 /// For example, consider a situation where you make an initial request and
9348 /// the request times out. If you make the request again with the same request
9349 /// ID, the server can check if original operation with the same request ID
9350 /// was received, and if so, will ignore the second request. This prevents
9351 /// clients from accidentally creating duplicate commitments.
9352 ///
9353 /// The request ID must be a valid UUID with the exception that zero UUID is
9354 /// not supported (00000000-0000-0000-0000-000000000000).
9355 pub request_id: std::string::String,
9356
9357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9358}
9359
9360impl CreateFirewallEndpointRequest {
9361 /// Creates a new default instance.
9362 pub fn new() -> Self {
9363 std::default::Default::default()
9364 }
9365
9366 /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
9367 ///
9368 /// # Example
9369 /// ```ignore,no_run
9370 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9371 /// # let organization_id = "organization_id";
9372 /// # let location_id = "location_id";
9373 /// let x = CreateFirewallEndpointRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
9374 /// ```
9375 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9376 self.parent = v.into();
9377 self
9378 }
9379
9380 /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
9381 ///
9382 /// # Example
9383 /// ```ignore,no_run
9384 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9385 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint_id("example");
9386 /// ```
9387 pub fn set_firewall_endpoint_id<T: std::convert::Into<std::string::String>>(
9388 mut self,
9389 v: T,
9390 ) -> Self {
9391 self.firewall_endpoint_id = v.into();
9392 self
9393 }
9394
9395 /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9396 ///
9397 /// # Example
9398 /// ```ignore,no_run
9399 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9400 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9401 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9402 /// ```
9403 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9404 where
9405 T: std::convert::Into<crate::model::FirewallEndpoint>,
9406 {
9407 self.firewall_endpoint = std::option::Option::Some(v.into());
9408 self
9409 }
9410
9411 /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9412 ///
9413 /// # Example
9414 /// ```ignore,no_run
9415 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9416 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9417 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9418 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9419 /// ```
9420 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9421 where
9422 T: std::convert::Into<crate::model::FirewallEndpoint>,
9423 {
9424 self.firewall_endpoint = v.map(|x| x.into());
9425 self
9426 }
9427
9428 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
9429 ///
9430 /// # Example
9431 /// ```ignore,no_run
9432 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9433 /// let x = CreateFirewallEndpointRequest::new().set_request_id("example");
9434 /// ```
9435 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9436 self.request_id = v.into();
9437 self
9438 }
9439}
9440
9441impl wkt::message::Message for CreateFirewallEndpointRequest {
9442 fn typename() -> &'static str {
9443 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointRequest"
9444 }
9445}
9446
9447/// Message for updating a Endpoint
9448#[derive(Clone, Default, PartialEq)]
9449#[non_exhaustive]
9450pub struct UpdateFirewallEndpointRequest {
9451 /// Required. Field mask is used to specify the fields to be overwritten in the
9452 /// Endpoint resource by the update.
9453 /// The fields specified in the update_mask are relative to the resource, not
9454 /// the full request. A field will be overwritten if it is in the mask. If the
9455 /// user does not provide a mask then all fields will be overwritten.
9456 pub update_mask: std::option::Option<wkt::FieldMask>,
9457
9458 /// Required. The resource being updated
9459 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9460
9461 /// Optional. An optional request ID to identify requests. Specify a unique
9462 /// request ID so that if you must retry your request, the server will know to
9463 /// ignore the request if it has already been completed. The server will
9464 /// guarantee that for at least 60 minutes since the first request.
9465 ///
9466 /// For example, consider a situation where you make an initial request and
9467 /// the request times out. If you make the request again with the same request
9468 /// ID, the server can check if original operation with the same request ID
9469 /// was received, and if so, will ignore the second request. This prevents
9470 /// clients from accidentally creating duplicate commitments.
9471 ///
9472 /// The request ID must be a valid UUID with the exception that zero UUID is
9473 /// not supported (00000000-0000-0000-0000-000000000000).
9474 pub request_id: std::string::String,
9475
9476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9477}
9478
9479impl UpdateFirewallEndpointRequest {
9480 /// Creates a new default instance.
9481 pub fn new() -> Self {
9482 std::default::Default::default()
9483 }
9484
9485 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9486 ///
9487 /// # Example
9488 /// ```ignore,no_run
9489 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9490 /// use wkt::FieldMask;
9491 /// let x = UpdateFirewallEndpointRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9492 /// ```
9493 pub fn set_update_mask<T>(mut self, v: T) -> Self
9494 where
9495 T: std::convert::Into<wkt::FieldMask>,
9496 {
9497 self.update_mask = std::option::Option::Some(v.into());
9498 self
9499 }
9500
9501 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9502 ///
9503 /// # Example
9504 /// ```ignore,no_run
9505 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9506 /// use wkt::FieldMask;
9507 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9508 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9509 /// ```
9510 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9511 where
9512 T: std::convert::Into<wkt::FieldMask>,
9513 {
9514 self.update_mask = v.map(|x| x.into());
9515 self
9516 }
9517
9518 /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9519 ///
9520 /// # Example
9521 /// ```ignore,no_run
9522 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9523 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9524 /// let x = UpdateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9525 /// ```
9526 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9527 where
9528 T: std::convert::Into<crate::model::FirewallEndpoint>,
9529 {
9530 self.firewall_endpoint = std::option::Option::Some(v.into());
9531 self
9532 }
9533
9534 /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9535 ///
9536 /// # Example
9537 /// ```ignore,no_run
9538 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9539 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9540 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9541 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9542 /// ```
9543 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9544 where
9545 T: std::convert::Into<crate::model::FirewallEndpoint>,
9546 {
9547 self.firewall_endpoint = v.map(|x| x.into());
9548 self
9549 }
9550
9551 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
9552 ///
9553 /// # Example
9554 /// ```ignore,no_run
9555 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9556 /// let x = UpdateFirewallEndpointRequest::new().set_request_id("example");
9557 /// ```
9558 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9559 self.request_id = v.into();
9560 self
9561 }
9562}
9563
9564impl wkt::message::Message for UpdateFirewallEndpointRequest {
9565 fn typename() -> &'static str {
9566 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest"
9567 }
9568}
9569
9570/// Message for deleting a Endpoint
9571#[derive(Clone, Default, PartialEq)]
9572#[non_exhaustive]
9573pub struct DeleteFirewallEndpointRequest {
9574 /// Required. Name of the resource
9575 pub name: std::string::String,
9576
9577 /// Optional. An optional request ID to identify requests. Specify a unique
9578 /// request ID so that if you must retry your request, the server will know to
9579 /// ignore the request if it has already been completed. The server will
9580 /// guarantee that for at least 60 minutes after the first request.
9581 ///
9582 /// For example, consider a situation where you make an initial request and
9583 /// the request times out. If you make the request again with the same request
9584 /// ID, the server can check if original operation with the same request ID
9585 /// was received, and if so, will ignore the second request. This prevents
9586 /// clients from accidentally creating duplicate commitments.
9587 ///
9588 /// The request ID must be a valid UUID with the exception that zero UUID is
9589 /// not supported (00000000-0000-0000-0000-000000000000).
9590 pub request_id: std::string::String,
9591
9592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9593}
9594
9595impl DeleteFirewallEndpointRequest {
9596 /// Creates a new default instance.
9597 pub fn new() -> Self {
9598 std::default::Default::default()
9599 }
9600
9601 /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
9602 ///
9603 /// # Example
9604 /// ```ignore,no_run
9605 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9606 /// # let organization_id = "organization_id";
9607 /// # let location_id = "location_id";
9608 /// # let firewall_endpoint_id = "firewall_endpoint_id";
9609 /// let x = DeleteFirewallEndpointRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/firewallEndpoints/{firewall_endpoint_id}"));
9610 /// ```
9611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9612 self.name = v.into();
9613 self
9614 }
9615
9616 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
9617 ///
9618 /// # Example
9619 /// ```ignore,no_run
9620 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9621 /// let x = DeleteFirewallEndpointRequest::new().set_request_id("example");
9622 /// ```
9623 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9624 self.request_id = v.into();
9625 self
9626 }
9627}
9628
9629impl wkt::message::Message for DeleteFirewallEndpointRequest {
9630 fn typename() -> &'static str {
9631 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest"
9632 }
9633}
9634
9635/// Message describing Association object
9636#[derive(Clone, Default, PartialEq)]
9637#[non_exhaustive]
9638pub struct FirewallEndpointAssociation {
9639 /// Immutable. Identifier. name of resource
9640 pub name: std::string::String,
9641
9642 /// Output only. Create time stamp
9643 pub create_time: std::option::Option<wkt::Timestamp>,
9644
9645 /// Output only. Update time stamp
9646 pub update_time: std::option::Option<wkt::Timestamp>,
9647
9648 /// Optional. Labels as key value pairs
9649 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9650
9651 /// Output only. Current state of the association.
9652 pub state: crate::model::firewall_endpoint_association::State,
9653
9654 /// Required. The URL of the network that is being associated.
9655 pub network: std::string::String,
9656
9657 /// Required. The URL of the FirewallEndpoint that is being associated.
9658 pub firewall_endpoint: std::string::String,
9659
9660 /// Optional. The URL of the TlsInspectionPolicy that is being associated.
9661 pub tls_inspection_policy: std::string::String,
9662
9663 /// Output only. Whether reconciling is in progress, recommended per
9664 /// <https://google.aip.dev/128>.
9665 pub reconciling: bool,
9666
9667 /// Optional. Whether the association is disabled.
9668 /// True indicates that traffic won't be intercepted
9669 pub disabled: bool,
9670
9671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9672}
9673
9674impl FirewallEndpointAssociation {
9675 /// Creates a new default instance.
9676 pub fn new() -> Self {
9677 std::default::Default::default()
9678 }
9679
9680 /// Sets the value of [name][crate::model::FirewallEndpointAssociation::name].
9681 ///
9682 /// # Example
9683 /// ```ignore,no_run
9684 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9685 /// # let project_id = "project_id";
9686 /// # let location_id = "location_id";
9687 /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
9688 /// let x = FirewallEndpointAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
9689 /// ```
9690 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9691 self.name = v.into();
9692 self
9693 }
9694
9695 /// Sets the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9696 ///
9697 /// # Example
9698 /// ```ignore,no_run
9699 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9700 /// use wkt::Timestamp;
9701 /// let x = FirewallEndpointAssociation::new().set_create_time(Timestamp::default()/* use setters */);
9702 /// ```
9703 pub fn set_create_time<T>(mut self, v: T) -> Self
9704 where
9705 T: std::convert::Into<wkt::Timestamp>,
9706 {
9707 self.create_time = std::option::Option::Some(v.into());
9708 self
9709 }
9710
9711 /// Sets or clears the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9712 ///
9713 /// # Example
9714 /// ```ignore,no_run
9715 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9716 /// use wkt::Timestamp;
9717 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9718 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(None::<Timestamp>);
9719 /// ```
9720 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9721 where
9722 T: std::convert::Into<wkt::Timestamp>,
9723 {
9724 self.create_time = v.map(|x| x.into());
9725 self
9726 }
9727
9728 /// Sets the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9729 ///
9730 /// # Example
9731 /// ```ignore,no_run
9732 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9733 /// use wkt::Timestamp;
9734 /// let x = FirewallEndpointAssociation::new().set_update_time(Timestamp::default()/* use setters */);
9735 /// ```
9736 pub fn set_update_time<T>(mut self, v: T) -> Self
9737 where
9738 T: std::convert::Into<wkt::Timestamp>,
9739 {
9740 self.update_time = std::option::Option::Some(v.into());
9741 self
9742 }
9743
9744 /// Sets or clears the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9745 ///
9746 /// # Example
9747 /// ```ignore,no_run
9748 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9749 /// use wkt::Timestamp;
9750 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9751 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(None::<Timestamp>);
9752 /// ```
9753 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9754 where
9755 T: std::convert::Into<wkt::Timestamp>,
9756 {
9757 self.update_time = v.map(|x| x.into());
9758 self
9759 }
9760
9761 /// Sets the value of [labels][crate::model::FirewallEndpointAssociation::labels].
9762 ///
9763 /// # Example
9764 /// ```ignore,no_run
9765 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9766 /// let x = FirewallEndpointAssociation::new().set_labels([
9767 /// ("key0", "abc"),
9768 /// ("key1", "xyz"),
9769 /// ]);
9770 /// ```
9771 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9772 where
9773 T: std::iter::IntoIterator<Item = (K, V)>,
9774 K: std::convert::Into<std::string::String>,
9775 V: std::convert::Into<std::string::String>,
9776 {
9777 use std::iter::Iterator;
9778 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9779 self
9780 }
9781
9782 /// Sets the value of [state][crate::model::FirewallEndpointAssociation::state].
9783 ///
9784 /// # Example
9785 /// ```ignore,no_run
9786 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9787 /// use google_cloud_networksecurity_v1::model::firewall_endpoint_association::State;
9788 /// let x0 = FirewallEndpointAssociation::new().set_state(State::Creating);
9789 /// let x1 = FirewallEndpointAssociation::new().set_state(State::Active);
9790 /// let x2 = FirewallEndpointAssociation::new().set_state(State::Deleting);
9791 /// ```
9792 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint_association::State>>(
9793 mut self,
9794 v: T,
9795 ) -> Self {
9796 self.state = v.into();
9797 self
9798 }
9799
9800 /// Sets the value of [network][crate::model::FirewallEndpointAssociation::network].
9801 ///
9802 /// # Example
9803 /// ```ignore,no_run
9804 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9805 /// let x = FirewallEndpointAssociation::new().set_network("example");
9806 /// ```
9807 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9808 self.network = v.into();
9809 self
9810 }
9811
9812 /// Sets the value of [firewall_endpoint][crate::model::FirewallEndpointAssociation::firewall_endpoint].
9813 ///
9814 /// # Example
9815 /// ```ignore,no_run
9816 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9817 /// let x = FirewallEndpointAssociation::new().set_firewall_endpoint("example");
9818 /// ```
9819 pub fn set_firewall_endpoint<T: std::convert::Into<std::string::String>>(
9820 mut self,
9821 v: T,
9822 ) -> Self {
9823 self.firewall_endpoint = v.into();
9824 self
9825 }
9826
9827 /// Sets the value of [tls_inspection_policy][crate::model::FirewallEndpointAssociation::tls_inspection_policy].
9828 ///
9829 /// # Example
9830 /// ```ignore,no_run
9831 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9832 /// # let project_id = "project_id";
9833 /// # let location_id = "location_id";
9834 /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
9835 /// let x = FirewallEndpointAssociation::new().set_tls_inspection_policy(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
9836 /// ```
9837 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
9838 mut self,
9839 v: T,
9840 ) -> Self {
9841 self.tls_inspection_policy = v.into();
9842 self
9843 }
9844
9845 /// Sets the value of [reconciling][crate::model::FirewallEndpointAssociation::reconciling].
9846 ///
9847 /// # Example
9848 /// ```ignore,no_run
9849 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9850 /// let x = FirewallEndpointAssociation::new().set_reconciling(true);
9851 /// ```
9852 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9853 self.reconciling = v.into();
9854 self
9855 }
9856
9857 /// Sets the value of [disabled][crate::model::FirewallEndpointAssociation::disabled].
9858 ///
9859 /// # Example
9860 /// ```ignore,no_run
9861 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9862 /// let x = FirewallEndpointAssociation::new().set_disabled(true);
9863 /// ```
9864 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9865 self.disabled = v.into();
9866 self
9867 }
9868}
9869
9870impl wkt::message::Message for FirewallEndpointAssociation {
9871 fn typename() -> &'static str {
9872 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpointAssociation"
9873 }
9874}
9875
9876/// Defines additional types related to [FirewallEndpointAssociation].
9877pub mod firewall_endpoint_association {
9878 #[allow(unused_imports)]
9879 use super::*;
9880
9881 /// Association state.
9882 ///
9883 /// # Working with unknown values
9884 ///
9885 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9886 /// additional enum variants at any time. Adding new variants is not considered
9887 /// a breaking change. Applications should write their code in anticipation of:
9888 ///
9889 /// - New values appearing in future releases of the client library, **and**
9890 /// - New values received dynamically, without application changes.
9891 ///
9892 /// Please consult the [Working with enums] section in the user guide for some
9893 /// guidelines.
9894 ///
9895 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9896 #[derive(Clone, Debug, PartialEq)]
9897 #[non_exhaustive]
9898 pub enum State {
9899 /// Not set.
9900 Unspecified,
9901 /// Being created.
9902 Creating,
9903 /// Active and ready for traffic.
9904 Active,
9905 /// Being deleted.
9906 Deleting,
9907 /// Down or in an error state.
9908 Inactive,
9909 /// The project that housed the association has been deleted.
9910 Orphan,
9911 /// If set, the enum was initialized with an unknown value.
9912 ///
9913 /// Applications can examine the value using [State::value] or
9914 /// [State::name].
9915 UnknownValue(state::UnknownValue),
9916 }
9917
9918 #[doc(hidden)]
9919 pub mod state {
9920 #[allow(unused_imports)]
9921 use super::*;
9922 #[derive(Clone, Debug, PartialEq)]
9923 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9924 }
9925
9926 impl State {
9927 /// Gets the enum value.
9928 ///
9929 /// Returns `None` if the enum contains an unknown value deserialized from
9930 /// the string representation of enums.
9931 pub fn value(&self) -> std::option::Option<i32> {
9932 match self {
9933 Self::Unspecified => std::option::Option::Some(0),
9934 Self::Creating => std::option::Option::Some(1),
9935 Self::Active => std::option::Option::Some(2),
9936 Self::Deleting => std::option::Option::Some(3),
9937 Self::Inactive => std::option::Option::Some(4),
9938 Self::Orphan => std::option::Option::Some(5),
9939 Self::UnknownValue(u) => u.0.value(),
9940 }
9941 }
9942
9943 /// Gets the enum value as a string.
9944 ///
9945 /// Returns `None` if the enum contains an unknown value deserialized from
9946 /// the integer representation of enums.
9947 pub fn name(&self) -> std::option::Option<&str> {
9948 match self {
9949 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9950 Self::Creating => std::option::Option::Some("CREATING"),
9951 Self::Active => std::option::Option::Some("ACTIVE"),
9952 Self::Deleting => std::option::Option::Some("DELETING"),
9953 Self::Inactive => std::option::Option::Some("INACTIVE"),
9954 Self::Orphan => std::option::Option::Some("ORPHAN"),
9955 Self::UnknownValue(u) => u.0.name(),
9956 }
9957 }
9958 }
9959
9960 impl std::default::Default for State {
9961 fn default() -> Self {
9962 use std::convert::From;
9963 Self::from(0)
9964 }
9965 }
9966
9967 impl std::fmt::Display for State {
9968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9969 wkt::internal::display_enum(f, self.name(), self.value())
9970 }
9971 }
9972
9973 impl std::convert::From<i32> for State {
9974 fn from(value: i32) -> Self {
9975 match value {
9976 0 => Self::Unspecified,
9977 1 => Self::Creating,
9978 2 => Self::Active,
9979 3 => Self::Deleting,
9980 4 => Self::Inactive,
9981 5 => Self::Orphan,
9982 _ => Self::UnknownValue(state::UnknownValue(
9983 wkt::internal::UnknownEnumValue::Integer(value),
9984 )),
9985 }
9986 }
9987 }
9988
9989 impl std::convert::From<&str> for State {
9990 fn from(value: &str) -> Self {
9991 use std::string::ToString;
9992 match value {
9993 "STATE_UNSPECIFIED" => Self::Unspecified,
9994 "CREATING" => Self::Creating,
9995 "ACTIVE" => Self::Active,
9996 "DELETING" => Self::Deleting,
9997 "INACTIVE" => Self::Inactive,
9998 "ORPHAN" => Self::Orphan,
9999 _ => Self::UnknownValue(state::UnknownValue(
10000 wkt::internal::UnknownEnumValue::String(value.to_string()),
10001 )),
10002 }
10003 }
10004 }
10005
10006 impl serde::ser::Serialize for State {
10007 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10008 where
10009 S: serde::Serializer,
10010 {
10011 match self {
10012 Self::Unspecified => serializer.serialize_i32(0),
10013 Self::Creating => serializer.serialize_i32(1),
10014 Self::Active => serializer.serialize_i32(2),
10015 Self::Deleting => serializer.serialize_i32(3),
10016 Self::Inactive => serializer.serialize_i32(4),
10017 Self::Orphan => serializer.serialize_i32(5),
10018 Self::UnknownValue(u) => u.0.serialize(serializer),
10019 }
10020 }
10021 }
10022
10023 impl<'de> serde::de::Deserialize<'de> for State {
10024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10025 where
10026 D: serde::Deserializer<'de>,
10027 {
10028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10029 ".google.cloud.networksecurity.v1.FirewallEndpointAssociation.State",
10030 ))
10031 }
10032 }
10033}
10034
10035/// Message for requesting list of Associations
10036#[derive(Clone, Default, PartialEq)]
10037#[non_exhaustive]
10038pub struct ListFirewallEndpointAssociationsRequest {
10039 /// Required. Parent value for ListAssociationsRequest
10040 pub parent: std::string::String,
10041
10042 /// Optional. Requested page size. Server may return fewer items than
10043 /// requested. If unspecified, server will pick an appropriate default.
10044 pub page_size: i32,
10045
10046 /// A token identifying a page of results the server should return.
10047 pub page_token: std::string::String,
10048
10049 /// Optional. Filtering results
10050 pub filter: std::string::String,
10051
10052 /// Hint for how to order the results
10053 pub order_by: std::string::String,
10054
10055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10056}
10057
10058impl ListFirewallEndpointAssociationsRequest {
10059 /// Creates a new default instance.
10060 pub fn new() -> Self {
10061 std::default::Default::default()
10062 }
10063
10064 /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
10065 ///
10066 /// # Example
10067 /// ```ignore,no_run
10068 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10069 /// # let project_id = "project_id";
10070 /// # let location_id = "location_id";
10071 /// let x = ListFirewallEndpointAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10072 /// ```
10073 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10074 self.parent = v.into();
10075 self
10076 }
10077
10078 /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
10079 ///
10080 /// # Example
10081 /// ```ignore,no_run
10082 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10083 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_size(42);
10084 /// ```
10085 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10086 self.page_size = v.into();
10087 self
10088 }
10089
10090 /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
10091 ///
10092 /// # Example
10093 /// ```ignore,no_run
10094 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10095 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_token("example");
10096 /// ```
10097 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10098 self.page_token = v.into();
10099 self
10100 }
10101
10102 /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
10103 ///
10104 /// # Example
10105 /// ```ignore,no_run
10106 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10107 /// let x = ListFirewallEndpointAssociationsRequest::new().set_filter("example");
10108 /// ```
10109 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10110 self.filter = v.into();
10111 self
10112 }
10113
10114 /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
10115 ///
10116 /// # Example
10117 /// ```ignore,no_run
10118 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
10119 /// let x = ListFirewallEndpointAssociationsRequest::new().set_order_by("example");
10120 /// ```
10121 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10122 self.order_by = v.into();
10123 self
10124 }
10125}
10126
10127impl wkt::message::Message for ListFirewallEndpointAssociationsRequest {
10128 fn typename() -> &'static str {
10129 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest"
10130 }
10131}
10132
10133/// Message for response to listing Associations
10134#[derive(Clone, Default, PartialEq)]
10135#[non_exhaustive]
10136pub struct ListFirewallEndpointAssociationsResponse {
10137 /// The list of Association
10138 pub firewall_endpoint_associations: std::vec::Vec<crate::model::FirewallEndpointAssociation>,
10139
10140 /// A token identifying a page of results the server should return.
10141 pub next_page_token: std::string::String,
10142
10143 /// Locations that could not be reached.
10144 pub unreachable: std::vec::Vec<std::string::String>,
10145
10146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10147}
10148
10149impl ListFirewallEndpointAssociationsResponse {
10150 /// Creates a new default instance.
10151 pub fn new() -> Self {
10152 std::default::Default::default()
10153 }
10154
10155 /// Sets the value of [firewall_endpoint_associations][crate::model::ListFirewallEndpointAssociationsResponse::firewall_endpoint_associations].
10156 ///
10157 /// # Example
10158 /// ```ignore,no_run
10159 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10160 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10161 /// let x = ListFirewallEndpointAssociationsResponse::new()
10162 /// .set_firewall_endpoint_associations([
10163 /// FirewallEndpointAssociation::default()/* use setters */,
10164 /// FirewallEndpointAssociation::default()/* use (different) setters */,
10165 /// ]);
10166 /// ```
10167 pub fn set_firewall_endpoint_associations<T, V>(mut self, v: T) -> Self
10168 where
10169 T: std::iter::IntoIterator<Item = V>,
10170 V: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10171 {
10172 use std::iter::Iterator;
10173 self.firewall_endpoint_associations = v.into_iter().map(|i| i.into()).collect();
10174 self
10175 }
10176
10177 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointAssociationsResponse::next_page_token].
10178 ///
10179 /// # Example
10180 /// ```ignore,no_run
10181 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10182 /// let x = ListFirewallEndpointAssociationsResponse::new().set_next_page_token("example");
10183 /// ```
10184 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185 self.next_page_token = v.into();
10186 self
10187 }
10188
10189 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointAssociationsResponse::unreachable].
10190 ///
10191 /// # Example
10192 /// ```ignore,no_run
10193 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
10194 /// let x = ListFirewallEndpointAssociationsResponse::new().set_unreachable(["a", "b", "c"]);
10195 /// ```
10196 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10197 where
10198 T: std::iter::IntoIterator<Item = V>,
10199 V: std::convert::Into<std::string::String>,
10200 {
10201 use std::iter::Iterator;
10202 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10203 self
10204 }
10205}
10206
10207impl wkt::message::Message for ListFirewallEndpointAssociationsResponse {
10208 fn typename() -> &'static str {
10209 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse"
10210 }
10211}
10212
10213#[doc(hidden)]
10214impl google_cloud_gax::paginator::internal::PageableResponse
10215 for ListFirewallEndpointAssociationsResponse
10216{
10217 type PageItem = crate::model::FirewallEndpointAssociation;
10218
10219 fn items(self) -> std::vec::Vec<Self::PageItem> {
10220 self.firewall_endpoint_associations
10221 }
10222
10223 fn next_page_token(&self) -> std::string::String {
10224 use std::clone::Clone;
10225 self.next_page_token.clone()
10226 }
10227}
10228
10229/// Message for getting a Association
10230#[derive(Clone, Default, PartialEq)]
10231#[non_exhaustive]
10232pub struct GetFirewallEndpointAssociationRequest {
10233 /// Required. Name of the resource
10234 pub name: std::string::String,
10235
10236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10237}
10238
10239impl GetFirewallEndpointAssociationRequest {
10240 /// Creates a new default instance.
10241 pub fn new() -> Self {
10242 std::default::Default::default()
10243 }
10244
10245 /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
10246 ///
10247 /// # Example
10248 /// ```ignore,no_run
10249 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointAssociationRequest;
10250 /// # let project_id = "project_id";
10251 /// # let location_id = "location_id";
10252 /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
10253 /// let x = GetFirewallEndpointAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
10254 /// ```
10255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10256 self.name = v.into();
10257 self
10258 }
10259}
10260
10261impl wkt::message::Message for GetFirewallEndpointAssociationRequest {
10262 fn typename() -> &'static str {
10263 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest"
10264 }
10265}
10266
10267/// Message for creating a Association
10268#[derive(Clone, Default, PartialEq)]
10269#[non_exhaustive]
10270pub struct CreateFirewallEndpointAssociationRequest {
10271 /// Required. Value for parent.
10272 pub parent: std::string::String,
10273
10274 /// Optional. Id of the requesting object.
10275 /// If auto-generating Id server-side, remove this field and
10276 /// firewall_endpoint_association_id from the method_signature of Create RPC.
10277 pub firewall_endpoint_association_id: std::string::String,
10278
10279 /// Required. The resource being created
10280 pub firewall_endpoint_association:
10281 std::option::Option<crate::model::FirewallEndpointAssociation>,
10282
10283 /// Optional. An optional request ID to identify requests. Specify a unique
10284 /// request ID so that if you must retry your request, the server will know to
10285 /// ignore the request if it has already been completed. The server will
10286 /// guarantee that for at least 60 minutes since the first request.
10287 ///
10288 /// For example, consider a situation where you make an initial request and
10289 /// the request times out. If you make the request again with the same request
10290 /// ID, the server can check if original operation with the same request ID
10291 /// was received, and if so, will ignore the second request. This prevents
10292 /// clients from accidentally creating duplicate commitments.
10293 ///
10294 /// The request ID must be a valid UUID with the exception that zero UUID is
10295 /// not supported (00000000-0000-0000-0000-000000000000).
10296 pub request_id: std::string::String,
10297
10298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10299}
10300
10301impl CreateFirewallEndpointAssociationRequest {
10302 /// Creates a new default instance.
10303 pub fn new() -> Self {
10304 std::default::Default::default()
10305 }
10306
10307 /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
10308 ///
10309 /// # Example
10310 /// ```ignore,no_run
10311 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10312 /// # let project_id = "project_id";
10313 /// # let location_id = "location_id";
10314 /// let x = CreateFirewallEndpointAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10315 /// ```
10316 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10317 self.parent = v.into();
10318 self
10319 }
10320
10321 /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
10322 ///
10323 /// # Example
10324 /// ```ignore,no_run
10325 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10326 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association_id("example");
10327 /// ```
10328 pub fn set_firewall_endpoint_association_id<T: std::convert::Into<std::string::String>>(
10329 mut self,
10330 v: T,
10331 ) -> Self {
10332 self.firewall_endpoint_association_id = v.into();
10333 self
10334 }
10335
10336 /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10337 ///
10338 /// # Example
10339 /// ```ignore,no_run
10340 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10341 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10342 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10343 /// ```
10344 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10345 where
10346 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10347 {
10348 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10349 self
10350 }
10351
10352 /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10353 ///
10354 /// # Example
10355 /// ```ignore,no_run
10356 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10357 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10358 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10359 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10360 /// ```
10361 pub fn set_or_clear_firewall_endpoint_association<T>(
10362 mut self,
10363 v: std::option::Option<T>,
10364 ) -> Self
10365 where
10366 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10367 {
10368 self.firewall_endpoint_association = v.map(|x| x.into());
10369 self
10370 }
10371
10372 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
10373 ///
10374 /// # Example
10375 /// ```ignore,no_run
10376 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10377 /// let x = CreateFirewallEndpointAssociationRequest::new().set_request_id("example");
10378 /// ```
10379 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10380 self.request_id = v.into();
10381 self
10382 }
10383}
10384
10385impl wkt::message::Message for CreateFirewallEndpointAssociationRequest {
10386 fn typename() -> &'static str {
10387 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest"
10388 }
10389}
10390
10391/// Message for deleting a Association
10392#[derive(Clone, Default, PartialEq)]
10393#[non_exhaustive]
10394pub struct DeleteFirewallEndpointAssociationRequest {
10395 /// Required. Name of the resource
10396 pub name: std::string::String,
10397
10398 /// Optional. An optional request ID to identify requests. Specify a unique
10399 /// request ID so that if you must retry your request, the server will know to
10400 /// ignore the request if it has already been completed. The server will
10401 /// guarantee that for at least 60 minutes after the first request.
10402 ///
10403 /// For example, consider a situation where you make an initial request and
10404 /// the request times out. If you make the request again with the same request
10405 /// ID, the server can check if original operation with the same request ID
10406 /// was received, and if so, will ignore the second request. This prevents
10407 /// clients from accidentally creating duplicate commitments.
10408 ///
10409 /// The request ID must be a valid UUID with the exception that zero UUID is
10410 /// not supported (00000000-0000-0000-0000-000000000000).
10411 pub request_id: std::string::String,
10412
10413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10414}
10415
10416impl DeleteFirewallEndpointAssociationRequest {
10417 /// Creates a new default instance.
10418 pub fn new() -> Self {
10419 std::default::Default::default()
10420 }
10421
10422 /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
10423 ///
10424 /// # Example
10425 /// ```ignore,no_run
10426 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10427 /// # let project_id = "project_id";
10428 /// # let location_id = "location_id";
10429 /// # let firewall_endpoint_association_id = "firewall_endpoint_association_id";
10430 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/firewallEndpointAssociations/{firewall_endpoint_association_id}"));
10431 /// ```
10432 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10433 self.name = v.into();
10434 self
10435 }
10436
10437 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
10438 ///
10439 /// # Example
10440 /// ```ignore,no_run
10441 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10442 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_request_id("example");
10443 /// ```
10444 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10445 self.request_id = v.into();
10446 self
10447 }
10448}
10449
10450impl wkt::message::Message for DeleteFirewallEndpointAssociationRequest {
10451 fn typename() -> &'static str {
10452 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest"
10453 }
10454}
10455
10456/// Message for updating an Association
10457#[derive(Clone, Default, PartialEq)]
10458#[non_exhaustive]
10459pub struct UpdateFirewallEndpointAssociationRequest {
10460 /// Required. Field mask is used to specify the fields to be overwritten in the
10461 /// Association resource by the update.
10462 /// The fields specified in the update_mask are relative to the resource, not
10463 /// the full request. A field will be overwritten if it is in the mask. If the
10464 /// user does not provide a mask then all fields will be overwritten.
10465 pub update_mask: std::option::Option<wkt::FieldMask>,
10466
10467 /// Required. The resource being updated
10468 pub firewall_endpoint_association:
10469 std::option::Option<crate::model::FirewallEndpointAssociation>,
10470
10471 /// Optional. An optional request ID to identify requests. Specify a unique
10472 /// request ID so that if you must retry your request, the server will know to
10473 /// ignore the request if it has already been completed. The server will
10474 /// guarantee that for at least 60 minutes since the first request.
10475 ///
10476 /// For example, consider a situation where you make an initial request and
10477 /// the request times out. If you make the request again with the same request
10478 /// ID, the server can check if original operation with the same request ID
10479 /// was received, and if so, will ignore the second request. This prevents
10480 /// clients from accidentally creating duplicate commitments.
10481 ///
10482 /// The request ID must be a valid UUID with the exception that zero UUID is
10483 /// not supported (00000000-0000-0000-0000-000000000000).
10484 pub request_id: std::string::String,
10485
10486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10487}
10488
10489impl UpdateFirewallEndpointAssociationRequest {
10490 /// Creates a new default instance.
10491 pub fn new() -> Self {
10492 std::default::Default::default()
10493 }
10494
10495 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10496 ///
10497 /// # Example
10498 /// ```ignore,no_run
10499 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10500 /// use wkt::FieldMask;
10501 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10502 /// ```
10503 pub fn set_update_mask<T>(mut self, v: T) -> Self
10504 where
10505 T: std::convert::Into<wkt::FieldMask>,
10506 {
10507 self.update_mask = std::option::Option::Some(v.into());
10508 self
10509 }
10510
10511 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10512 ///
10513 /// # Example
10514 /// ```ignore,no_run
10515 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10516 /// use wkt::FieldMask;
10517 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10518 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10519 /// ```
10520 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10521 where
10522 T: std::convert::Into<wkt::FieldMask>,
10523 {
10524 self.update_mask = v.map(|x| x.into());
10525 self
10526 }
10527
10528 /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10529 ///
10530 /// # Example
10531 /// ```ignore,no_run
10532 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10533 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10534 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10535 /// ```
10536 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10537 where
10538 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10539 {
10540 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10541 self
10542 }
10543
10544 /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10545 ///
10546 /// # Example
10547 /// ```ignore,no_run
10548 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10549 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10550 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10551 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10552 /// ```
10553 pub fn set_or_clear_firewall_endpoint_association<T>(
10554 mut self,
10555 v: std::option::Option<T>,
10556 ) -> Self
10557 where
10558 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10559 {
10560 self.firewall_endpoint_association = v.map(|x| x.into());
10561 self
10562 }
10563
10564 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
10565 ///
10566 /// # Example
10567 /// ```ignore,no_run
10568 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10569 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_request_id("example");
10570 /// ```
10571 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10572 self.request_id = v.into();
10573 self
10574 }
10575}
10576
10577impl wkt::message::Message for UpdateFirewallEndpointAssociationRequest {
10578 fn typename() -> &'static str {
10579 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest"
10580 }
10581}
10582
10583/// The GatewaySecurityPolicy resource contains a collection of
10584/// GatewaySecurityPolicyRules and associated metadata.
10585#[derive(Clone, Default, PartialEq)]
10586#[non_exhaustive]
10587pub struct GatewaySecurityPolicy {
10588 /// Required. Name of the resource. Name is of the form
10589 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}
10590 /// gateway_security_policy should match the
10591 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10592 pub name: std::string::String,
10593
10594 /// Output only. The timestamp when the resource was created.
10595 pub create_time: std::option::Option<wkt::Timestamp>,
10596
10597 /// Output only. The timestamp when the resource was updated.
10598 pub update_time: std::option::Option<wkt::Timestamp>,
10599
10600 /// Optional. Free-text description of the resource.
10601 pub description: std::string::String,
10602
10603 /// Optional. Name of a TLS Inspection Policy resource that defines how TLS
10604 /// inspection will be performed for any rule(s) which enables it.
10605 pub tls_inspection_policy: std::string::String,
10606
10607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10608}
10609
10610impl GatewaySecurityPolicy {
10611 /// Creates a new default instance.
10612 pub fn new() -> Self {
10613 std::default::Default::default()
10614 }
10615
10616 /// Sets the value of [name][crate::model::GatewaySecurityPolicy::name].
10617 ///
10618 /// # Example
10619 /// ```ignore,no_run
10620 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10621 /// # let project_id = "project_id";
10622 /// # let location_id = "location_id";
10623 /// # let gateway_security_policy_id = "gateway_security_policy_id";
10624 /// let x = GatewaySecurityPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
10625 /// ```
10626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10627 self.name = v.into();
10628 self
10629 }
10630
10631 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10632 ///
10633 /// # Example
10634 /// ```ignore,no_run
10635 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10636 /// use wkt::Timestamp;
10637 /// let x = GatewaySecurityPolicy::new().set_create_time(Timestamp::default()/* use setters */);
10638 /// ```
10639 pub fn set_create_time<T>(mut self, v: T) -> Self
10640 where
10641 T: std::convert::Into<wkt::Timestamp>,
10642 {
10643 self.create_time = std::option::Option::Some(v.into());
10644 self
10645 }
10646
10647 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10648 ///
10649 /// # Example
10650 /// ```ignore,no_run
10651 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10652 /// use wkt::Timestamp;
10653 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10654 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(None::<Timestamp>);
10655 /// ```
10656 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10657 where
10658 T: std::convert::Into<wkt::Timestamp>,
10659 {
10660 self.create_time = v.map(|x| x.into());
10661 self
10662 }
10663
10664 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10665 ///
10666 /// # Example
10667 /// ```ignore,no_run
10668 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10669 /// use wkt::Timestamp;
10670 /// let x = GatewaySecurityPolicy::new().set_update_time(Timestamp::default()/* use setters */);
10671 /// ```
10672 pub fn set_update_time<T>(mut self, v: T) -> Self
10673 where
10674 T: std::convert::Into<wkt::Timestamp>,
10675 {
10676 self.update_time = std::option::Option::Some(v.into());
10677 self
10678 }
10679
10680 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10681 ///
10682 /// # Example
10683 /// ```ignore,no_run
10684 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10685 /// use wkt::Timestamp;
10686 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10687 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(None::<Timestamp>);
10688 /// ```
10689 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10690 where
10691 T: std::convert::Into<wkt::Timestamp>,
10692 {
10693 self.update_time = v.map(|x| x.into());
10694 self
10695 }
10696
10697 /// Sets the value of [description][crate::model::GatewaySecurityPolicy::description].
10698 ///
10699 /// # Example
10700 /// ```ignore,no_run
10701 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10702 /// let x = GatewaySecurityPolicy::new().set_description("example");
10703 /// ```
10704 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10705 self.description = v.into();
10706 self
10707 }
10708
10709 /// Sets the value of [tls_inspection_policy][crate::model::GatewaySecurityPolicy::tls_inspection_policy].
10710 ///
10711 /// # Example
10712 /// ```ignore,no_run
10713 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10714 /// # let project_id = "project_id";
10715 /// # let location_id = "location_id";
10716 /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
10717 /// let x = GatewaySecurityPolicy::new().set_tls_inspection_policy(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
10718 /// ```
10719 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
10720 mut self,
10721 v: T,
10722 ) -> Self {
10723 self.tls_inspection_policy = v.into();
10724 self
10725 }
10726}
10727
10728impl wkt::message::Message for GatewaySecurityPolicy {
10729 fn typename() -> &'static str {
10730 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicy"
10731 }
10732}
10733
10734/// Request used by the CreateGatewaySecurityPolicy method.
10735#[derive(Clone, Default, PartialEq)]
10736#[non_exhaustive]
10737pub struct CreateGatewaySecurityPolicyRequest {
10738 /// Required. The parent resource of the GatewaySecurityPolicy. Must be in the
10739 /// format `projects/{project}/locations/{location}`.
10740 pub parent: std::string::String,
10741
10742 /// Required. Short name of the GatewaySecurityPolicy resource to be created.
10743 /// This value should be 1-63 characters long, containing only
10744 /// letters, numbers, hyphens, and underscores, and should not start
10745 /// with a number. E.g. "gateway_security_policy1".
10746 pub gateway_security_policy_id: std::string::String,
10747
10748 /// Required. GatewaySecurityPolicy resource to be created.
10749 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10750
10751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10752}
10753
10754impl CreateGatewaySecurityPolicyRequest {
10755 /// Creates a new default instance.
10756 pub fn new() -> Self {
10757 std::default::Default::default()
10758 }
10759
10760 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
10761 ///
10762 /// # Example
10763 /// ```ignore,no_run
10764 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10765 /// # let project_id = "project_id";
10766 /// # let location_id = "location_id";
10767 /// let x = CreateGatewaySecurityPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10768 /// ```
10769 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10770 self.parent = v.into();
10771 self
10772 }
10773
10774 /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
10775 ///
10776 /// # Example
10777 /// ```ignore,no_run
10778 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10779 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy_id("example");
10780 /// ```
10781 pub fn set_gateway_security_policy_id<T: std::convert::Into<std::string::String>>(
10782 mut self,
10783 v: T,
10784 ) -> Self {
10785 self.gateway_security_policy_id = v.into();
10786 self
10787 }
10788
10789 /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10790 ///
10791 /// # Example
10792 /// ```ignore,no_run
10793 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10794 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10795 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10796 /// ```
10797 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10798 where
10799 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10800 {
10801 self.gateway_security_policy = std::option::Option::Some(v.into());
10802 self
10803 }
10804
10805 /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10806 ///
10807 /// # Example
10808 /// ```ignore,no_run
10809 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10810 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10811 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10812 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10813 /// ```
10814 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10815 where
10816 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10817 {
10818 self.gateway_security_policy = v.map(|x| x.into());
10819 self
10820 }
10821}
10822
10823impl wkt::message::Message for CreateGatewaySecurityPolicyRequest {
10824 fn typename() -> &'static str {
10825 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest"
10826 }
10827}
10828
10829/// Request used with the ListGatewaySecurityPolicies method.
10830#[derive(Clone, Default, PartialEq)]
10831#[non_exhaustive]
10832pub struct ListGatewaySecurityPoliciesRequest {
10833 /// Required. The project and location from which the GatewaySecurityPolicies
10834 /// should be listed, specified in the format
10835 /// `projects/{project}/locations/{location}`.
10836 pub parent: std::string::String,
10837
10838 /// Maximum number of GatewaySecurityPolicies to return per call.
10839 pub page_size: i32,
10840
10841 /// The value returned by the last
10842 /// 'ListGatewaySecurityPoliciesResponse' Indicates that this is a
10843 /// continuation of a prior 'ListGatewaySecurityPolicies' call, and
10844 /// that the system should return the next page of data.
10845 pub page_token: std::string::String,
10846
10847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10848}
10849
10850impl ListGatewaySecurityPoliciesRequest {
10851 /// Creates a new default instance.
10852 pub fn new() -> Self {
10853 std::default::Default::default()
10854 }
10855
10856 /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
10857 ///
10858 /// # Example
10859 /// ```ignore,no_run
10860 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10861 /// let x = ListGatewaySecurityPoliciesRequest::new().set_parent("example");
10862 /// ```
10863 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10864 self.parent = v.into();
10865 self
10866 }
10867
10868 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
10869 ///
10870 /// # Example
10871 /// ```ignore,no_run
10872 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10873 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_size(42);
10874 /// ```
10875 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10876 self.page_size = v.into();
10877 self
10878 }
10879
10880 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
10881 ///
10882 /// # Example
10883 /// ```ignore,no_run
10884 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10885 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_token("example");
10886 /// ```
10887 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10888 self.page_token = v.into();
10889 self
10890 }
10891}
10892
10893impl wkt::message::Message for ListGatewaySecurityPoliciesRequest {
10894 fn typename() -> &'static str {
10895 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest"
10896 }
10897}
10898
10899/// Response returned by the ListGatewaySecurityPolicies method.
10900#[derive(Clone, Default, PartialEq)]
10901#[non_exhaustive]
10902pub struct ListGatewaySecurityPoliciesResponse {
10903 /// List of GatewaySecurityPolicies resources.
10904 pub gateway_security_policies: std::vec::Vec<crate::model::GatewaySecurityPolicy>,
10905
10906 /// If there might be more results than those appearing in this response, then
10907 /// 'next_page_token' is included. To get the next set of results, call this
10908 /// method again using the value of 'next_page_token' as 'page_token'.
10909 pub next_page_token: std::string::String,
10910
10911 /// Locations that could not be reached.
10912 pub unreachable: std::vec::Vec<std::string::String>,
10913
10914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10915}
10916
10917impl ListGatewaySecurityPoliciesResponse {
10918 /// Creates a new default instance.
10919 pub fn new() -> Self {
10920 std::default::Default::default()
10921 }
10922
10923 /// Sets the value of [gateway_security_policies][crate::model::ListGatewaySecurityPoliciesResponse::gateway_security_policies].
10924 ///
10925 /// # Example
10926 /// ```ignore,no_run
10927 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10928 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10929 /// let x = ListGatewaySecurityPoliciesResponse::new()
10930 /// .set_gateway_security_policies([
10931 /// GatewaySecurityPolicy::default()/* use setters */,
10932 /// GatewaySecurityPolicy::default()/* use (different) setters */,
10933 /// ]);
10934 /// ```
10935 pub fn set_gateway_security_policies<T, V>(mut self, v: T) -> Self
10936 where
10937 T: std::iter::IntoIterator<Item = V>,
10938 V: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10939 {
10940 use std::iter::Iterator;
10941 self.gateway_security_policies = v.into_iter().map(|i| i.into()).collect();
10942 self
10943 }
10944
10945 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPoliciesResponse::next_page_token].
10946 ///
10947 /// # Example
10948 /// ```ignore,no_run
10949 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10950 /// let x = ListGatewaySecurityPoliciesResponse::new().set_next_page_token("example");
10951 /// ```
10952 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10953 self.next_page_token = v.into();
10954 self
10955 }
10956
10957 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPoliciesResponse::unreachable].
10958 ///
10959 /// # Example
10960 /// ```ignore,no_run
10961 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10962 /// let x = ListGatewaySecurityPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10963 /// ```
10964 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10965 where
10966 T: std::iter::IntoIterator<Item = V>,
10967 V: std::convert::Into<std::string::String>,
10968 {
10969 use std::iter::Iterator;
10970 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10971 self
10972 }
10973}
10974
10975impl wkt::message::Message for ListGatewaySecurityPoliciesResponse {
10976 fn typename() -> &'static str {
10977 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse"
10978 }
10979}
10980
10981#[doc(hidden)]
10982impl google_cloud_gax::paginator::internal::PageableResponse
10983 for ListGatewaySecurityPoliciesResponse
10984{
10985 type PageItem = crate::model::GatewaySecurityPolicy;
10986
10987 fn items(self) -> std::vec::Vec<Self::PageItem> {
10988 self.gateway_security_policies
10989 }
10990
10991 fn next_page_token(&self) -> std::string::String {
10992 use std::clone::Clone;
10993 self.next_page_token.clone()
10994 }
10995}
10996
10997/// Request used by the GetGatewaySecurityPolicy method.
10998#[derive(Clone, Default, PartialEq)]
10999#[non_exhaustive]
11000pub struct GetGatewaySecurityPolicyRequest {
11001 /// Required. A name of the GatewaySecurityPolicy to get. Must be in the format
11002 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
11003 pub name: std::string::String,
11004
11005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11006}
11007
11008impl GetGatewaySecurityPolicyRequest {
11009 /// Creates a new default instance.
11010 pub fn new() -> Self {
11011 std::default::Default::default()
11012 }
11013
11014 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
11015 ///
11016 /// # Example
11017 /// ```ignore,no_run
11018 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRequest;
11019 /// # let project_id = "project_id";
11020 /// # let location_id = "location_id";
11021 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11022 /// let x = GetGatewaySecurityPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11023 /// ```
11024 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11025 self.name = v.into();
11026 self
11027 }
11028}
11029
11030impl wkt::message::Message for GetGatewaySecurityPolicyRequest {
11031 fn typename() -> &'static str {
11032 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest"
11033 }
11034}
11035
11036/// Request used by the DeleteGatewaySecurityPolicy method.
11037#[derive(Clone, Default, PartialEq)]
11038#[non_exhaustive]
11039pub struct DeleteGatewaySecurityPolicyRequest {
11040 /// Required. A name of the GatewaySecurityPolicy to delete. Must be in the
11041 /// format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
11042 pub name: std::string::String,
11043
11044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11045}
11046
11047impl DeleteGatewaySecurityPolicyRequest {
11048 /// Creates a new default instance.
11049 pub fn new() -> Self {
11050 std::default::Default::default()
11051 }
11052
11053 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
11054 ///
11055 /// # Example
11056 /// ```ignore,no_run
11057 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRequest;
11058 /// # let project_id = "project_id";
11059 /// # let location_id = "location_id";
11060 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11061 /// let x = DeleteGatewaySecurityPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11062 /// ```
11063 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11064 self.name = v.into();
11065 self
11066 }
11067}
11068
11069impl wkt::message::Message for DeleteGatewaySecurityPolicyRequest {
11070 fn typename() -> &'static str {
11071 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest"
11072 }
11073}
11074
11075/// Request used by the UpdateGatewaySecurityPolicy method.
11076#[derive(Clone, Default, PartialEq)]
11077#[non_exhaustive]
11078pub struct UpdateGatewaySecurityPolicyRequest {
11079 /// Optional. Field mask is used to specify the fields to be overwritten in the
11080 /// GatewaySecurityPolicy resource by the update.
11081 /// The fields specified in the update_mask are relative to the resource, not
11082 /// the full request. A field will be overwritten if it is in the mask. If the
11083 /// user does not provide a mask then all fields will be overwritten.
11084 pub update_mask: std::option::Option<wkt::FieldMask>,
11085
11086 /// Required. Updated GatewaySecurityPolicy resource.
11087 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
11088
11089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11090}
11091
11092impl UpdateGatewaySecurityPolicyRequest {
11093 /// Creates a new default instance.
11094 pub fn new() -> Self {
11095 std::default::Default::default()
11096 }
11097
11098 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
11099 ///
11100 /// # Example
11101 /// ```ignore,no_run
11102 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11103 /// use wkt::FieldMask;
11104 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11105 /// ```
11106 pub fn set_update_mask<T>(mut self, v: T) -> Self
11107 where
11108 T: std::convert::Into<wkt::FieldMask>,
11109 {
11110 self.update_mask = std::option::Option::Some(v.into());
11111 self
11112 }
11113
11114 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
11115 ///
11116 /// # Example
11117 /// ```ignore,no_run
11118 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11119 /// use wkt::FieldMask;
11120 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11121 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11122 /// ```
11123 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11124 where
11125 T: std::convert::Into<wkt::FieldMask>,
11126 {
11127 self.update_mask = v.map(|x| x.into());
11128 self
11129 }
11130
11131 /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
11132 ///
11133 /// # Example
11134 /// ```ignore,no_run
11135 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11136 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
11137 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
11138 /// ```
11139 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
11140 where
11141 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
11142 {
11143 self.gateway_security_policy = std::option::Option::Some(v.into());
11144 self
11145 }
11146
11147 /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
11148 ///
11149 /// # Example
11150 /// ```ignore,no_run
11151 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
11152 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
11153 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
11154 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
11155 /// ```
11156 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
11157 where
11158 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
11159 {
11160 self.gateway_security_policy = v.map(|x| x.into());
11161 self
11162 }
11163}
11164
11165impl wkt::message::Message for UpdateGatewaySecurityPolicyRequest {
11166 fn typename() -> &'static str {
11167 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest"
11168 }
11169}
11170
11171/// The GatewaySecurityPolicyRule resource is in a nested collection within a
11172/// GatewaySecurityPolicy and represents a traffic matching condition and
11173/// associated action to perform.
11174#[derive(Clone, Default, PartialEq)]
11175#[non_exhaustive]
11176pub struct GatewaySecurityPolicyRule {
11177 /// Required. Immutable. Name of the resource. ame is the full resource name so
11178 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}
11179 /// rule should match the
11180 /// pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
11181 pub name: std::string::String,
11182
11183 /// Output only. Time when the rule was created.
11184 pub create_time: std::option::Option<wkt::Timestamp>,
11185
11186 /// Output only. Time when the rule was updated.
11187 pub update_time: std::option::Option<wkt::Timestamp>,
11188
11189 /// Required. Whether the rule is enforced.
11190 pub enabled: bool,
11191
11192 /// Required. Priority of the rule.
11193 /// Lower number corresponds to higher precedence.
11194 pub priority: i32,
11195
11196 /// Optional. Free-text description of the resource.
11197 pub description: std::string::String,
11198
11199 /// Required. CEL expression for matching on session criteria.
11200 pub session_matcher: std::string::String,
11201
11202 /// Optional. CEL expression for matching on L7/application level criteria.
11203 pub application_matcher: std::string::String,
11204
11205 /// Optional. Flag to enable TLS inspection of traffic matching on
11206 /// <session_matcher>, can only be true if the parent GatewaySecurityPolicy
11207 /// references a TLSInspectionConfig.
11208 pub tls_inspection_enabled: bool,
11209
11210 #[allow(missing_docs)]
11211 pub profile: std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11212
11213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11214}
11215
11216impl GatewaySecurityPolicyRule {
11217 /// Creates a new default instance.
11218 pub fn new() -> Self {
11219 std::default::Default::default()
11220 }
11221
11222 /// Sets the value of [name][crate::model::GatewaySecurityPolicyRule::name].
11223 ///
11224 /// # Example
11225 /// ```ignore,no_run
11226 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11227 /// # let project_id = "project_id";
11228 /// # let location_id = "location_id";
11229 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11230 /// # let rule_id = "rule_id";
11231 /// let x = GatewaySecurityPolicyRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
11232 /// ```
11233 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11234 self.name = v.into();
11235 self
11236 }
11237
11238 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11239 ///
11240 /// # Example
11241 /// ```ignore,no_run
11242 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11243 /// use wkt::Timestamp;
11244 /// let x = GatewaySecurityPolicyRule::new().set_create_time(Timestamp::default()/* use setters */);
11245 /// ```
11246 pub fn set_create_time<T>(mut self, v: T) -> Self
11247 where
11248 T: std::convert::Into<wkt::Timestamp>,
11249 {
11250 self.create_time = std::option::Option::Some(v.into());
11251 self
11252 }
11253
11254 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
11255 ///
11256 /// # Example
11257 /// ```ignore,no_run
11258 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11259 /// use wkt::Timestamp;
11260 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11261 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(None::<Timestamp>);
11262 /// ```
11263 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11264 where
11265 T: std::convert::Into<wkt::Timestamp>,
11266 {
11267 self.create_time = v.map(|x| x.into());
11268 self
11269 }
11270
11271 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11272 ///
11273 /// # Example
11274 /// ```ignore,no_run
11275 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11276 /// use wkt::Timestamp;
11277 /// let x = GatewaySecurityPolicyRule::new().set_update_time(Timestamp::default()/* use setters */);
11278 /// ```
11279 pub fn set_update_time<T>(mut self, v: T) -> Self
11280 where
11281 T: std::convert::Into<wkt::Timestamp>,
11282 {
11283 self.update_time = std::option::Option::Some(v.into());
11284 self
11285 }
11286
11287 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
11288 ///
11289 /// # Example
11290 /// ```ignore,no_run
11291 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11292 /// use wkt::Timestamp;
11293 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11294 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(None::<Timestamp>);
11295 /// ```
11296 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11297 where
11298 T: std::convert::Into<wkt::Timestamp>,
11299 {
11300 self.update_time = v.map(|x| x.into());
11301 self
11302 }
11303
11304 /// Sets the value of [enabled][crate::model::GatewaySecurityPolicyRule::enabled].
11305 ///
11306 /// # Example
11307 /// ```ignore,no_run
11308 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11309 /// let x = GatewaySecurityPolicyRule::new().set_enabled(true);
11310 /// ```
11311 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11312 self.enabled = v.into();
11313 self
11314 }
11315
11316 /// Sets the value of [priority][crate::model::GatewaySecurityPolicyRule::priority].
11317 ///
11318 /// # Example
11319 /// ```ignore,no_run
11320 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11321 /// let x = GatewaySecurityPolicyRule::new().set_priority(42);
11322 /// ```
11323 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11324 self.priority = v.into();
11325 self
11326 }
11327
11328 /// Sets the value of [description][crate::model::GatewaySecurityPolicyRule::description].
11329 ///
11330 /// # Example
11331 /// ```ignore,no_run
11332 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11333 /// let x = GatewaySecurityPolicyRule::new().set_description("example");
11334 /// ```
11335 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11336 self.description = v.into();
11337 self
11338 }
11339
11340 /// Sets the value of [session_matcher][crate::model::GatewaySecurityPolicyRule::session_matcher].
11341 ///
11342 /// # Example
11343 /// ```ignore,no_run
11344 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11345 /// let x = GatewaySecurityPolicyRule::new().set_session_matcher("example");
11346 /// ```
11347 pub fn set_session_matcher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11348 self.session_matcher = v.into();
11349 self
11350 }
11351
11352 /// Sets the value of [application_matcher][crate::model::GatewaySecurityPolicyRule::application_matcher].
11353 ///
11354 /// # Example
11355 /// ```ignore,no_run
11356 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11357 /// let x = GatewaySecurityPolicyRule::new().set_application_matcher("example");
11358 /// ```
11359 pub fn set_application_matcher<T: std::convert::Into<std::string::String>>(
11360 mut self,
11361 v: T,
11362 ) -> Self {
11363 self.application_matcher = v.into();
11364 self
11365 }
11366
11367 /// Sets the value of [tls_inspection_enabled][crate::model::GatewaySecurityPolicyRule::tls_inspection_enabled].
11368 ///
11369 /// # Example
11370 /// ```ignore,no_run
11371 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11372 /// let x = GatewaySecurityPolicyRule::new().set_tls_inspection_enabled(true);
11373 /// ```
11374 pub fn set_tls_inspection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11375 self.tls_inspection_enabled = v.into();
11376 self
11377 }
11378
11379 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile].
11380 ///
11381 /// Note that all the setters affecting `profile` are mutually
11382 /// exclusive.
11383 ///
11384 /// # Example
11385 /// ```ignore,no_run
11386 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11387 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11388 /// let x0 = GatewaySecurityPolicyRule::new().set_profile(Some(
11389 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Allow)));
11390 /// let x1 = GatewaySecurityPolicyRule::new().set_profile(Some(
11391 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Deny)));
11392 /// ```
11393 pub fn set_profile<
11394 T: std::convert::Into<
11395 std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11396 >,
11397 >(
11398 mut self,
11399 v: T,
11400 ) -> Self {
11401 self.profile = v.into();
11402 self
11403 }
11404
11405 /// The value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11406 /// if it holds a `BasicProfile`, `None` if the field is not set or
11407 /// holds a different branch.
11408 pub fn basic_profile(
11409 &self,
11410 ) -> std::option::Option<&crate::model::gateway_security_policy_rule::BasicProfile> {
11411 #[allow(unreachable_patterns)]
11412 self.profile.as_ref().and_then(|v| match v {
11413 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v) => {
11414 std::option::Option::Some(v)
11415 }
11416 _ => std::option::Option::None,
11417 })
11418 }
11419
11420 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11421 /// to hold a `BasicProfile`.
11422 ///
11423 /// Note that all the setters affecting `profile` are
11424 /// mutually exclusive.
11425 ///
11426 /// # Example
11427 /// ```ignore,no_run
11428 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11429 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11430 /// let x0 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Allow);
11431 /// let x1 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Deny);
11432 /// assert!(x0.basic_profile().is_some());
11433 /// assert!(x1.basic_profile().is_some());
11434 /// ```
11435 pub fn set_basic_profile<
11436 T: std::convert::Into<crate::model::gateway_security_policy_rule::BasicProfile>,
11437 >(
11438 mut self,
11439 v: T,
11440 ) -> Self {
11441 self.profile = std::option::Option::Some(
11442 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v.into()),
11443 );
11444 self
11445 }
11446}
11447
11448impl wkt::message::Message for GatewaySecurityPolicyRule {
11449 fn typename() -> &'static str {
11450 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicyRule"
11451 }
11452}
11453
11454/// Defines additional types related to [GatewaySecurityPolicyRule].
11455pub mod gateway_security_policy_rule {
11456 #[allow(unused_imports)]
11457 use super::*;
11458
11459 /// enum to define the primitive action.
11460 ///
11461 /// # Working with unknown values
11462 ///
11463 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11464 /// additional enum variants at any time. Adding new variants is not considered
11465 /// a breaking change. Applications should write their code in anticipation of:
11466 ///
11467 /// - New values appearing in future releases of the client library, **and**
11468 /// - New values received dynamically, without application changes.
11469 ///
11470 /// Please consult the [Working with enums] section in the user guide for some
11471 /// guidelines.
11472 ///
11473 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11474 #[derive(Clone, Debug, PartialEq)]
11475 #[non_exhaustive]
11476 pub enum BasicProfile {
11477 /// If there is not a mentioned action for the target.
11478 Unspecified,
11479 /// Allow the matched traffic.
11480 Allow,
11481 /// Deny the matched traffic.
11482 Deny,
11483 /// If set, the enum was initialized with an unknown value.
11484 ///
11485 /// Applications can examine the value using [BasicProfile::value] or
11486 /// [BasicProfile::name].
11487 UnknownValue(basic_profile::UnknownValue),
11488 }
11489
11490 #[doc(hidden)]
11491 pub mod basic_profile {
11492 #[allow(unused_imports)]
11493 use super::*;
11494 #[derive(Clone, Debug, PartialEq)]
11495 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11496 }
11497
11498 impl BasicProfile {
11499 /// Gets the enum value.
11500 ///
11501 /// Returns `None` if the enum contains an unknown value deserialized from
11502 /// the string representation of enums.
11503 pub fn value(&self) -> std::option::Option<i32> {
11504 match self {
11505 Self::Unspecified => std::option::Option::Some(0),
11506 Self::Allow => std::option::Option::Some(1),
11507 Self::Deny => std::option::Option::Some(2),
11508 Self::UnknownValue(u) => u.0.value(),
11509 }
11510 }
11511
11512 /// Gets the enum value as a string.
11513 ///
11514 /// Returns `None` if the enum contains an unknown value deserialized from
11515 /// the integer representation of enums.
11516 pub fn name(&self) -> std::option::Option<&str> {
11517 match self {
11518 Self::Unspecified => std::option::Option::Some("BASIC_PROFILE_UNSPECIFIED"),
11519 Self::Allow => std::option::Option::Some("ALLOW"),
11520 Self::Deny => std::option::Option::Some("DENY"),
11521 Self::UnknownValue(u) => u.0.name(),
11522 }
11523 }
11524 }
11525
11526 impl std::default::Default for BasicProfile {
11527 fn default() -> Self {
11528 use std::convert::From;
11529 Self::from(0)
11530 }
11531 }
11532
11533 impl std::fmt::Display for BasicProfile {
11534 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11535 wkt::internal::display_enum(f, self.name(), self.value())
11536 }
11537 }
11538
11539 impl std::convert::From<i32> for BasicProfile {
11540 fn from(value: i32) -> Self {
11541 match value {
11542 0 => Self::Unspecified,
11543 1 => Self::Allow,
11544 2 => Self::Deny,
11545 _ => Self::UnknownValue(basic_profile::UnknownValue(
11546 wkt::internal::UnknownEnumValue::Integer(value),
11547 )),
11548 }
11549 }
11550 }
11551
11552 impl std::convert::From<&str> for BasicProfile {
11553 fn from(value: &str) -> Self {
11554 use std::string::ToString;
11555 match value {
11556 "BASIC_PROFILE_UNSPECIFIED" => Self::Unspecified,
11557 "ALLOW" => Self::Allow,
11558 "DENY" => Self::Deny,
11559 _ => Self::UnknownValue(basic_profile::UnknownValue(
11560 wkt::internal::UnknownEnumValue::String(value.to_string()),
11561 )),
11562 }
11563 }
11564 }
11565
11566 impl serde::ser::Serialize for BasicProfile {
11567 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11568 where
11569 S: serde::Serializer,
11570 {
11571 match self {
11572 Self::Unspecified => serializer.serialize_i32(0),
11573 Self::Allow => serializer.serialize_i32(1),
11574 Self::Deny => serializer.serialize_i32(2),
11575 Self::UnknownValue(u) => u.0.serialize(serializer),
11576 }
11577 }
11578 }
11579
11580 impl<'de> serde::de::Deserialize<'de> for BasicProfile {
11581 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11582 where
11583 D: serde::Deserializer<'de>,
11584 {
11585 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BasicProfile>::new(
11586 ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile",
11587 ))
11588 }
11589 }
11590
11591 #[allow(missing_docs)]
11592 #[derive(Clone, Debug, PartialEq)]
11593 #[non_exhaustive]
11594 pub enum Profile {
11595 /// Required. Profile which tells what the primitive action should be.
11596 BasicProfile(crate::model::gateway_security_policy_rule::BasicProfile),
11597 }
11598}
11599
11600/// Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules.
11601/// Request used by the CreateGatewaySecurityPolicyRule method.
11602#[derive(Clone, Default, PartialEq)]
11603#[non_exhaustive]
11604pub struct CreateGatewaySecurityPolicyRuleRequest {
11605 /// Required. The parent where this rule will be created.
11606 /// Format :
11607 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*
11608 pub parent: std::string::String,
11609
11610 /// Required. The rule to be created.
11611 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11612
11613 /// The ID to use for the rule, which will become the final component of
11614 /// the rule's resource name.
11615 /// This value should be 4-63 characters, and valid characters
11616 /// are /[a-z][0-9]-/.
11617 pub gateway_security_policy_rule_id: std::string::String,
11618
11619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11620}
11621
11622impl CreateGatewaySecurityPolicyRuleRequest {
11623 /// Creates a new default instance.
11624 pub fn new() -> Self {
11625 std::default::Default::default()
11626 }
11627
11628 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
11629 ///
11630 /// # Example
11631 /// ```ignore,no_run
11632 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11633 /// # let project_id = "project_id";
11634 /// # let location_id = "location_id";
11635 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11636 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11637 /// ```
11638 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639 self.parent = v.into();
11640 self
11641 }
11642
11643 /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11644 ///
11645 /// # Example
11646 /// ```ignore,no_run
11647 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11648 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11649 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11650 /// ```
11651 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11652 where
11653 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11654 {
11655 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11656 self
11657 }
11658
11659 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11660 ///
11661 /// # Example
11662 /// ```ignore,no_run
11663 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11664 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11665 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11666 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11667 /// ```
11668 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11669 where
11670 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11671 {
11672 self.gateway_security_policy_rule = v.map(|x| x.into());
11673 self
11674 }
11675
11676 /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
11677 ///
11678 /// # Example
11679 /// ```ignore,no_run
11680 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11681 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule_id("example");
11682 /// ```
11683 pub fn set_gateway_security_policy_rule_id<T: std::convert::Into<std::string::String>>(
11684 mut self,
11685 v: T,
11686 ) -> Self {
11687 self.gateway_security_policy_rule_id = v.into();
11688 self
11689 }
11690}
11691
11692impl wkt::message::Message for CreateGatewaySecurityPolicyRuleRequest {
11693 fn typename() -> &'static str {
11694 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest"
11695 }
11696}
11697
11698/// Request used by the GetGatewaySecurityPolicyRule method.
11699#[derive(Clone, Default, PartialEq)]
11700#[non_exhaustive]
11701pub struct GetGatewaySecurityPolicyRuleRequest {
11702 /// Required. The name of the GatewaySecurityPolicyRule to retrieve.
11703 /// Format:
11704 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
11705 pub name: std::string::String,
11706
11707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11708}
11709
11710impl GetGatewaySecurityPolicyRuleRequest {
11711 /// Creates a new default instance.
11712 pub fn new() -> Self {
11713 std::default::Default::default()
11714 }
11715
11716 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
11717 ///
11718 /// # Example
11719 /// ```ignore,no_run
11720 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRuleRequest;
11721 /// # let project_id = "project_id";
11722 /// # let location_id = "location_id";
11723 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11724 /// # let rule_id = "rule_id";
11725 /// let x = GetGatewaySecurityPolicyRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
11726 /// ```
11727 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11728 self.name = v.into();
11729 self
11730 }
11731}
11732
11733impl wkt::message::Message for GetGatewaySecurityPolicyRuleRequest {
11734 fn typename() -> &'static str {
11735 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest"
11736 }
11737}
11738
11739/// Request used by the UpdateGatewaySecurityPolicyRule method.
11740#[derive(Clone, Default, PartialEq)]
11741#[non_exhaustive]
11742pub struct UpdateGatewaySecurityPolicyRuleRequest {
11743 /// Optional. Field mask is used to specify the fields to be overwritten in the
11744 /// GatewaySecurityPolicy resource by the update.
11745 /// The fields specified in the update_mask are relative to the resource, not
11746 /// the full request. A field will be overwritten if it is in the mask. If the
11747 /// user does not provide a mask then all fields will be overwritten.
11748 pub update_mask: std::option::Option<wkt::FieldMask>,
11749
11750 /// Required. Updated GatewaySecurityPolicyRule resource.
11751 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11752
11753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11754}
11755
11756impl UpdateGatewaySecurityPolicyRuleRequest {
11757 /// Creates a new default instance.
11758 pub fn new() -> Self {
11759 std::default::Default::default()
11760 }
11761
11762 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11763 ///
11764 /// # Example
11765 /// ```ignore,no_run
11766 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11767 /// use wkt::FieldMask;
11768 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11769 /// ```
11770 pub fn set_update_mask<T>(mut self, v: T) -> Self
11771 where
11772 T: std::convert::Into<wkt::FieldMask>,
11773 {
11774 self.update_mask = std::option::Option::Some(v.into());
11775 self
11776 }
11777
11778 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11779 ///
11780 /// # Example
11781 /// ```ignore,no_run
11782 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11783 /// use wkt::FieldMask;
11784 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11785 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11786 /// ```
11787 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11788 where
11789 T: std::convert::Into<wkt::FieldMask>,
11790 {
11791 self.update_mask = v.map(|x| x.into());
11792 self
11793 }
11794
11795 /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11796 ///
11797 /// # Example
11798 /// ```ignore,no_run
11799 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11800 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11801 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11802 /// ```
11803 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11804 where
11805 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11806 {
11807 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11808 self
11809 }
11810
11811 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11812 ///
11813 /// # Example
11814 /// ```ignore,no_run
11815 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11816 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11817 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11818 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11819 /// ```
11820 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11821 where
11822 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11823 {
11824 self.gateway_security_policy_rule = v.map(|x| x.into());
11825 self
11826 }
11827}
11828
11829impl wkt::message::Message for UpdateGatewaySecurityPolicyRuleRequest {
11830 fn typename() -> &'static str {
11831 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest"
11832 }
11833}
11834
11835/// Request used with the ListGatewaySecurityPolicyRules method.
11836#[derive(Clone, Default, PartialEq)]
11837#[non_exhaustive]
11838pub struct ListGatewaySecurityPolicyRulesRequest {
11839 /// Required. The project, location and GatewaySecurityPolicy from which the
11840 /// GatewaySecurityPolicyRules should be listed, specified in the format
11841 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
11842 pub parent: std::string::String,
11843
11844 /// Maximum number of GatewaySecurityPolicyRules to return per call.
11845 pub page_size: i32,
11846
11847 /// The value returned by the last
11848 /// 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a
11849 /// continuation of a prior 'ListGatewaySecurityPolicyRules' call, and
11850 /// that the system should return the next page of data.
11851 pub page_token: std::string::String,
11852
11853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11854}
11855
11856impl ListGatewaySecurityPolicyRulesRequest {
11857 /// Creates a new default instance.
11858 pub fn new() -> Self {
11859 std::default::Default::default()
11860 }
11861
11862 /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
11863 ///
11864 /// # Example
11865 /// ```ignore,no_run
11866 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11867 /// # let project_id = "project_id";
11868 /// # let location_id = "location_id";
11869 /// # let gateway_security_policy_id = "gateway_security_policy_id";
11870 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}"));
11871 /// ```
11872 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11873 self.parent = v.into();
11874 self
11875 }
11876
11877 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
11878 ///
11879 /// # Example
11880 /// ```ignore,no_run
11881 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11882 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_size(42);
11883 /// ```
11884 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11885 self.page_size = v.into();
11886 self
11887 }
11888
11889 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
11890 ///
11891 /// # Example
11892 /// ```ignore,no_run
11893 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11894 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_token("example");
11895 /// ```
11896 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11897 self.page_token = v.into();
11898 self
11899 }
11900}
11901
11902impl wkt::message::Message for ListGatewaySecurityPolicyRulesRequest {
11903 fn typename() -> &'static str {
11904 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest"
11905 }
11906}
11907
11908/// Response returned by the ListGatewaySecurityPolicyRules method.
11909#[derive(Clone, Default, PartialEq)]
11910#[non_exhaustive]
11911pub struct ListGatewaySecurityPolicyRulesResponse {
11912 /// List of GatewaySecurityPolicyRule resources.
11913 pub gateway_security_policy_rules: std::vec::Vec<crate::model::GatewaySecurityPolicyRule>,
11914
11915 /// If there might be more results than those appearing in this response, then
11916 /// 'next_page_token' is included. To get the next set of results, call this
11917 /// method again using the value of 'next_page_token' as 'page_token'.
11918 pub next_page_token: std::string::String,
11919
11920 /// Locations that could not be reached.
11921 pub unreachable: std::vec::Vec<std::string::String>,
11922
11923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11924}
11925
11926impl ListGatewaySecurityPolicyRulesResponse {
11927 /// Creates a new default instance.
11928 pub fn new() -> Self {
11929 std::default::Default::default()
11930 }
11931
11932 /// Sets the value of [gateway_security_policy_rules][crate::model::ListGatewaySecurityPolicyRulesResponse::gateway_security_policy_rules].
11933 ///
11934 /// # Example
11935 /// ```ignore,no_run
11936 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11937 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11938 /// let x = ListGatewaySecurityPolicyRulesResponse::new()
11939 /// .set_gateway_security_policy_rules([
11940 /// GatewaySecurityPolicyRule::default()/* use setters */,
11941 /// GatewaySecurityPolicyRule::default()/* use (different) setters */,
11942 /// ]);
11943 /// ```
11944 pub fn set_gateway_security_policy_rules<T, V>(mut self, v: T) -> Self
11945 where
11946 T: std::iter::IntoIterator<Item = V>,
11947 V: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11948 {
11949 use std::iter::Iterator;
11950 self.gateway_security_policy_rules = v.into_iter().map(|i| i.into()).collect();
11951 self
11952 }
11953
11954 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPolicyRulesResponse::next_page_token].
11955 ///
11956 /// # Example
11957 /// ```ignore,no_run
11958 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11959 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_next_page_token("example");
11960 /// ```
11961 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11962 self.next_page_token = v.into();
11963 self
11964 }
11965
11966 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPolicyRulesResponse::unreachable].
11967 ///
11968 /// # Example
11969 /// ```ignore,no_run
11970 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11971 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_unreachable(["a", "b", "c"]);
11972 /// ```
11973 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11974 where
11975 T: std::iter::IntoIterator<Item = V>,
11976 V: std::convert::Into<std::string::String>,
11977 {
11978 use std::iter::Iterator;
11979 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11980 self
11981 }
11982}
11983
11984impl wkt::message::Message for ListGatewaySecurityPolicyRulesResponse {
11985 fn typename() -> &'static str {
11986 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse"
11987 }
11988}
11989
11990#[doc(hidden)]
11991impl google_cloud_gax::paginator::internal::PageableResponse
11992 for ListGatewaySecurityPolicyRulesResponse
11993{
11994 type PageItem = crate::model::GatewaySecurityPolicyRule;
11995
11996 fn items(self) -> std::vec::Vec<Self::PageItem> {
11997 self.gateway_security_policy_rules
11998 }
11999
12000 fn next_page_token(&self) -> std::string::String {
12001 use std::clone::Clone;
12002 self.next_page_token.clone()
12003 }
12004}
12005
12006/// Request used by the DeleteGatewaySecurityPolicyRule method.
12007#[derive(Clone, Default, PartialEq)]
12008#[non_exhaustive]
12009pub struct DeleteGatewaySecurityPolicyRuleRequest {
12010 /// Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the
12011 /// format
12012 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
12013 pub name: std::string::String,
12014
12015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12016}
12017
12018impl DeleteGatewaySecurityPolicyRuleRequest {
12019 /// Creates a new default instance.
12020 pub fn new() -> Self {
12021 std::default::Default::default()
12022 }
12023
12024 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
12025 ///
12026 /// # Example
12027 /// ```ignore,no_run
12028 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRuleRequest;
12029 /// # let project_id = "project_id";
12030 /// # let location_id = "location_id";
12031 /// # let gateway_security_policy_id = "gateway_security_policy_id";
12032 /// # let rule_id = "rule_id";
12033 /// let x = DeleteGatewaySecurityPolicyRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/gatewaySecurityPolicies/{gateway_security_policy_id}/rules/{rule_id}"));
12034 /// ```
12035 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12036 self.name = v.into();
12037 self
12038 }
12039}
12040
12041impl wkt::message::Message for DeleteGatewaySecurityPolicyRuleRequest {
12042 fn typename() -> &'static str {
12043 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest"
12044 }
12045}
12046
12047/// An endpoint group is a consumer frontend for a deployment group (backend).
12048/// In order to configure intercept for a network, consumers must create:
12049///
12050/// - An association between their network and the endpoint group.
12051/// - A security profile that points to the endpoint group.
12052/// - A firewall rule that references the security profile (group).
12053#[derive(Clone, Default, PartialEq)]
12054#[non_exhaustive]
12055pub struct InterceptEndpointGroup {
12056 /// Immutable. Identifier. The resource name of this endpoint group, for
12057 /// example:
12058 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
12059 /// See <https://google.aip.dev/122> for more details.
12060 pub name: std::string::String,
12061
12062 /// Output only. The timestamp when the resource was created.
12063 /// See <https://google.aip.dev/148#timestamps>.
12064 pub create_time: std::option::Option<wkt::Timestamp>,
12065
12066 /// Output only. The timestamp when the resource was most recently updated.
12067 /// See <https://google.aip.dev/148#timestamps>.
12068 pub update_time: std::option::Option<wkt::Timestamp>,
12069
12070 /// Optional. Labels are key/value pairs that help to organize and filter
12071 /// resources.
12072 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12073
12074 /// Required. Immutable. The deployment group that this endpoint group is
12075 /// connected to, for example:
12076 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12077 /// See <https://google.aip.dev/124>.
12078 pub intercept_deployment_group: std::string::String,
12079
12080 /// Output only. Details about the connected deployment group to this endpoint
12081 /// group.
12082 pub connected_deployment_group:
12083 std::option::Option<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12084
12085 /// Output only. The current state of the endpoint group.
12086 /// See <https://google.aip.dev/216>.
12087 pub state: crate::model::intercept_endpoint_group::State,
12088
12089 /// Output only. The current state of the resource does not match the user's
12090 /// intended state, and the system is working to reconcile them. This is part
12091 /// of the normal operation (e.g. adding a new association to the group). See
12092 /// <https://google.aip.dev/128>.
12093 pub reconciling: bool,
12094
12095 /// Output only. List of associations to this endpoint group.
12096 pub associations: std::vec::Vec<crate::model::intercept_endpoint_group::AssociationDetails>,
12097
12098 /// Optional. User-provided description of the endpoint group.
12099 /// Used as additional context for the endpoint group.
12100 pub description: std::string::String,
12101
12102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12103}
12104
12105impl InterceptEndpointGroup {
12106 /// Creates a new default instance.
12107 pub fn new() -> Self {
12108 std::default::Default::default()
12109 }
12110
12111 /// Sets the value of [name][crate::model::InterceptEndpointGroup::name].
12112 ///
12113 /// # Example
12114 /// ```ignore,no_run
12115 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12116 /// # let project_id = "project_id";
12117 /// # let location_id = "location_id";
12118 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
12119 /// let x = InterceptEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
12120 /// ```
12121 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12122 self.name = v.into();
12123 self
12124 }
12125
12126 /// Sets the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
12127 ///
12128 /// # Example
12129 /// ```ignore,no_run
12130 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12131 /// use wkt::Timestamp;
12132 /// let x = InterceptEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
12133 /// ```
12134 pub fn set_create_time<T>(mut self, v: T) -> Self
12135 where
12136 T: std::convert::Into<wkt::Timestamp>,
12137 {
12138 self.create_time = std::option::Option::Some(v.into());
12139 self
12140 }
12141
12142 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
12143 ///
12144 /// # Example
12145 /// ```ignore,no_run
12146 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12147 /// use wkt::Timestamp;
12148 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12149 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
12150 /// ```
12151 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12152 where
12153 T: std::convert::Into<wkt::Timestamp>,
12154 {
12155 self.create_time = v.map(|x| x.into());
12156 self
12157 }
12158
12159 /// Sets the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
12160 ///
12161 /// # Example
12162 /// ```ignore,no_run
12163 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12164 /// use wkt::Timestamp;
12165 /// let x = InterceptEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
12166 /// ```
12167 pub fn set_update_time<T>(mut self, v: T) -> Self
12168 where
12169 T: std::convert::Into<wkt::Timestamp>,
12170 {
12171 self.update_time = std::option::Option::Some(v.into());
12172 self
12173 }
12174
12175 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
12176 ///
12177 /// # Example
12178 /// ```ignore,no_run
12179 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12180 /// use wkt::Timestamp;
12181 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12182 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
12183 /// ```
12184 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12185 where
12186 T: std::convert::Into<wkt::Timestamp>,
12187 {
12188 self.update_time = v.map(|x| x.into());
12189 self
12190 }
12191
12192 /// Sets the value of [labels][crate::model::InterceptEndpointGroup::labels].
12193 ///
12194 /// # Example
12195 /// ```ignore,no_run
12196 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12197 /// let x = InterceptEndpointGroup::new().set_labels([
12198 /// ("key0", "abc"),
12199 /// ("key1", "xyz"),
12200 /// ]);
12201 /// ```
12202 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12203 where
12204 T: std::iter::IntoIterator<Item = (K, V)>,
12205 K: std::convert::Into<std::string::String>,
12206 V: std::convert::Into<std::string::String>,
12207 {
12208 use std::iter::Iterator;
12209 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12210 self
12211 }
12212
12213 /// Sets the value of [intercept_deployment_group][crate::model::InterceptEndpointGroup::intercept_deployment_group].
12214 ///
12215 /// # Example
12216 /// ```ignore,no_run
12217 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12218 /// # let project_id = "project_id";
12219 /// # let location_id = "location_id";
12220 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
12221 /// let x = InterceptEndpointGroup::new().set_intercept_deployment_group(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
12222 /// ```
12223 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
12224 mut self,
12225 v: T,
12226 ) -> Self {
12227 self.intercept_deployment_group = v.into();
12228 self
12229 }
12230
12231 /// Sets the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12232 ///
12233 /// # Example
12234 /// ```ignore,no_run
12235 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12236 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12237 /// let x = InterceptEndpointGroup::new().set_connected_deployment_group(ConnectedDeploymentGroup::default()/* use setters */);
12238 /// ```
12239 pub fn set_connected_deployment_group<T>(mut self, v: T) -> Self
12240 where
12241 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12242 {
12243 self.connected_deployment_group = std::option::Option::Some(v.into());
12244 self
12245 }
12246
12247 /// Sets or clears the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
12248 ///
12249 /// # Example
12250 /// ```ignore,no_run
12251 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12252 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12253 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(Some(ConnectedDeploymentGroup::default()/* use setters */));
12254 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(None::<ConnectedDeploymentGroup>);
12255 /// ```
12256 pub fn set_or_clear_connected_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
12257 where
12258 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
12259 {
12260 self.connected_deployment_group = v.map(|x| x.into());
12261 self
12262 }
12263
12264 /// Sets the value of [state][crate::model::InterceptEndpointGroup::state].
12265 ///
12266 /// # Example
12267 /// ```ignore,no_run
12268 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12269 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::State;
12270 /// let x0 = InterceptEndpointGroup::new().set_state(State::Active);
12271 /// let x1 = InterceptEndpointGroup::new().set_state(State::Closed);
12272 /// let x2 = InterceptEndpointGroup::new().set_state(State::Creating);
12273 /// ```
12274 pub fn set_state<T: std::convert::Into<crate::model::intercept_endpoint_group::State>>(
12275 mut self,
12276 v: T,
12277 ) -> Self {
12278 self.state = v.into();
12279 self
12280 }
12281
12282 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroup::reconciling].
12283 ///
12284 /// # Example
12285 /// ```ignore,no_run
12286 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12287 /// let x = InterceptEndpointGroup::new().set_reconciling(true);
12288 /// ```
12289 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12290 self.reconciling = v.into();
12291 self
12292 }
12293
12294 /// Sets the value of [associations][crate::model::InterceptEndpointGroup::associations].
12295 ///
12296 /// # Example
12297 /// ```ignore,no_run
12298 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12299 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12300 /// let x = InterceptEndpointGroup::new()
12301 /// .set_associations([
12302 /// AssociationDetails::default()/* use setters */,
12303 /// AssociationDetails::default()/* use (different) setters */,
12304 /// ]);
12305 /// ```
12306 pub fn set_associations<T, V>(mut self, v: T) -> Self
12307 where
12308 T: std::iter::IntoIterator<Item = V>,
12309 V: std::convert::Into<crate::model::intercept_endpoint_group::AssociationDetails>,
12310 {
12311 use std::iter::Iterator;
12312 self.associations = v.into_iter().map(|i| i.into()).collect();
12313 self
12314 }
12315
12316 /// Sets the value of [description][crate::model::InterceptEndpointGroup::description].
12317 ///
12318 /// # Example
12319 /// ```ignore,no_run
12320 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12321 /// let x = InterceptEndpointGroup::new().set_description("example");
12322 /// ```
12323 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12324 self.description = v.into();
12325 self
12326 }
12327}
12328
12329impl wkt::message::Message for InterceptEndpointGroup {
12330 fn typename() -> &'static str {
12331 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup"
12332 }
12333}
12334
12335/// Defines additional types related to [InterceptEndpointGroup].
12336pub mod intercept_endpoint_group {
12337 #[allow(unused_imports)]
12338 use super::*;
12339
12340 /// The endpoint group's view of a connected deployment group.
12341 #[derive(Clone, Default, PartialEq)]
12342 #[non_exhaustive]
12343 pub struct ConnectedDeploymentGroup {
12344 /// Output only. The connected deployment group's resource name, for example:
12345 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12346 /// See <https://google.aip.dev/124>.
12347 pub name: std::string::String,
12348
12349 /// Output only. The list of locations where the deployment group is present.
12350 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12351
12352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12353 }
12354
12355 impl ConnectedDeploymentGroup {
12356 /// Creates a new default instance.
12357 pub fn new() -> Self {
12358 std::default::Default::default()
12359 }
12360
12361 /// Sets the value of [name][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::name].
12362 ///
12363 /// # Example
12364 /// ```ignore,no_run
12365 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12366 /// # let project_id = "project_id";
12367 /// # let location_id = "location_id";
12368 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
12369 /// let x = ConnectedDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
12370 /// ```
12371 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12372 self.name = v.into();
12373 self
12374 }
12375
12376 /// Sets the value of [locations][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::locations].
12377 ///
12378 /// # Example
12379 /// ```ignore,no_run
12380 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12381 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
12382 /// let x = ConnectedDeploymentGroup::new()
12383 /// .set_locations([
12384 /// InterceptLocation::default()/* use setters */,
12385 /// InterceptLocation::default()/* use (different) setters */,
12386 /// ]);
12387 /// ```
12388 pub fn set_locations<T, V>(mut self, v: T) -> Self
12389 where
12390 T: std::iter::IntoIterator<Item = V>,
12391 V: std::convert::Into<crate::model::InterceptLocation>,
12392 {
12393 use std::iter::Iterator;
12394 self.locations = v.into_iter().map(|i| i.into()).collect();
12395 self
12396 }
12397 }
12398
12399 impl wkt::message::Message for ConnectedDeploymentGroup {
12400 fn typename() -> &'static str {
12401 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup"
12402 }
12403 }
12404
12405 /// The endpoint group's view of a connected association.
12406 #[derive(Clone, Default, PartialEq)]
12407 #[non_exhaustive]
12408 pub struct AssociationDetails {
12409 /// Output only. The connected association's resource name, for example:
12410 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-ega`.
12411 /// See <https://google.aip.dev/124>.
12412 pub name: std::string::String,
12413
12414 /// Output only. The associated network, for example:
12415 /// projects/123456789/global/networks/my-network.
12416 /// See <https://google.aip.dev/124>.
12417 pub network: std::string::String,
12418
12419 /// Output only. Most recent known state of the association.
12420 pub state: crate::model::intercept_endpoint_group_association::State,
12421
12422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12423 }
12424
12425 impl AssociationDetails {
12426 /// Creates a new default instance.
12427 pub fn new() -> Self {
12428 std::default::Default::default()
12429 }
12430
12431 /// Sets the value of [name][crate::model::intercept_endpoint_group::AssociationDetails::name].
12432 ///
12433 /// # Example
12434 /// ```ignore,no_run
12435 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12436 /// # let project_id = "project_id";
12437 /// # let location_id = "location_id";
12438 /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
12439 /// let x = AssociationDetails::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
12440 /// ```
12441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12442 self.name = v.into();
12443 self
12444 }
12445
12446 /// Sets the value of [network][crate::model::intercept_endpoint_group::AssociationDetails::network].
12447 ///
12448 /// # Example
12449 /// ```ignore,no_run
12450 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12451 /// let x = AssociationDetails::new().set_network("example");
12452 /// ```
12453 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12454 self.network = v.into();
12455 self
12456 }
12457
12458 /// Sets the value of [state][crate::model::intercept_endpoint_group::AssociationDetails::state].
12459 ///
12460 /// # Example
12461 /// ```ignore,no_run
12462 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12463 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
12464 /// let x0 = AssociationDetails::new().set_state(State::Active);
12465 /// let x1 = AssociationDetails::new().set_state(State::Creating);
12466 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
12467 /// ```
12468 pub fn set_state<
12469 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
12470 >(
12471 mut self,
12472 v: T,
12473 ) -> Self {
12474 self.state = v.into();
12475 self
12476 }
12477 }
12478
12479 impl wkt::message::Message for AssociationDetails {
12480 fn typename() -> &'static str {
12481 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails"
12482 }
12483 }
12484
12485 /// Endpoint group state.
12486 ///
12487 /// # Working with unknown values
12488 ///
12489 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12490 /// additional enum variants at any time. Adding new variants is not considered
12491 /// a breaking change. Applications should write their code in anticipation of:
12492 ///
12493 /// - New values appearing in future releases of the client library, **and**
12494 /// - New values received dynamically, without application changes.
12495 ///
12496 /// Please consult the [Working with enums] section in the user guide for some
12497 /// guidelines.
12498 ///
12499 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12500 #[derive(Clone, Debug, PartialEq)]
12501 #[non_exhaustive]
12502 pub enum State {
12503 /// State not set (this is not a valid state).
12504 Unspecified,
12505 /// The endpoint group is ready and in sync with the target deployment group.
12506 Active,
12507 /// The deployment group backing this endpoint group has been force-deleted.
12508 /// This endpoint group cannot be used and interception is effectively
12509 /// disabled.
12510 Closed,
12511 /// The endpoint group is being created.
12512 Creating,
12513 /// The endpoint group is being deleted.
12514 Deleting,
12515 /// The endpoint group is out of sync with the backing deployment group.
12516 /// In most cases, this is a result of a transient issue within the system
12517 /// (e.g. an inaccessible location) and the system is expected to recover
12518 /// automatically. See the associations field for details per network and
12519 /// location.
12520 OutOfSync,
12521 /// An attempt to delete the endpoint group has failed. This is a terminal
12522 /// state and the endpoint group is not expected to recover.
12523 /// The only permitted operation is to retry deleting the endpoint group.
12524 DeleteFailed,
12525 /// If set, the enum was initialized with an unknown value.
12526 ///
12527 /// Applications can examine the value using [State::value] or
12528 /// [State::name].
12529 UnknownValue(state::UnknownValue),
12530 }
12531
12532 #[doc(hidden)]
12533 pub mod state {
12534 #[allow(unused_imports)]
12535 use super::*;
12536 #[derive(Clone, Debug, PartialEq)]
12537 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12538 }
12539
12540 impl State {
12541 /// Gets the enum value.
12542 ///
12543 /// Returns `None` if the enum contains an unknown value deserialized from
12544 /// the string representation of enums.
12545 pub fn value(&self) -> std::option::Option<i32> {
12546 match self {
12547 Self::Unspecified => std::option::Option::Some(0),
12548 Self::Active => std::option::Option::Some(1),
12549 Self::Closed => std::option::Option::Some(2),
12550 Self::Creating => std::option::Option::Some(3),
12551 Self::Deleting => std::option::Option::Some(4),
12552 Self::OutOfSync => std::option::Option::Some(5),
12553 Self::DeleteFailed => std::option::Option::Some(6),
12554 Self::UnknownValue(u) => u.0.value(),
12555 }
12556 }
12557
12558 /// Gets the enum value as a string.
12559 ///
12560 /// Returns `None` if the enum contains an unknown value deserialized from
12561 /// the integer representation of enums.
12562 pub fn name(&self) -> std::option::Option<&str> {
12563 match self {
12564 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12565 Self::Active => std::option::Option::Some("ACTIVE"),
12566 Self::Closed => std::option::Option::Some("CLOSED"),
12567 Self::Creating => std::option::Option::Some("CREATING"),
12568 Self::Deleting => std::option::Option::Some("DELETING"),
12569 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
12570 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
12571 Self::UnknownValue(u) => u.0.name(),
12572 }
12573 }
12574 }
12575
12576 impl std::default::Default for State {
12577 fn default() -> Self {
12578 use std::convert::From;
12579 Self::from(0)
12580 }
12581 }
12582
12583 impl std::fmt::Display for State {
12584 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12585 wkt::internal::display_enum(f, self.name(), self.value())
12586 }
12587 }
12588
12589 impl std::convert::From<i32> for State {
12590 fn from(value: i32) -> Self {
12591 match value {
12592 0 => Self::Unspecified,
12593 1 => Self::Active,
12594 2 => Self::Closed,
12595 3 => Self::Creating,
12596 4 => Self::Deleting,
12597 5 => Self::OutOfSync,
12598 6 => Self::DeleteFailed,
12599 _ => Self::UnknownValue(state::UnknownValue(
12600 wkt::internal::UnknownEnumValue::Integer(value),
12601 )),
12602 }
12603 }
12604 }
12605
12606 impl std::convert::From<&str> for State {
12607 fn from(value: &str) -> Self {
12608 use std::string::ToString;
12609 match value {
12610 "STATE_UNSPECIFIED" => Self::Unspecified,
12611 "ACTIVE" => Self::Active,
12612 "CLOSED" => Self::Closed,
12613 "CREATING" => Self::Creating,
12614 "DELETING" => Self::Deleting,
12615 "OUT_OF_SYNC" => Self::OutOfSync,
12616 "DELETE_FAILED" => Self::DeleteFailed,
12617 _ => Self::UnknownValue(state::UnknownValue(
12618 wkt::internal::UnknownEnumValue::String(value.to_string()),
12619 )),
12620 }
12621 }
12622 }
12623
12624 impl serde::ser::Serialize for State {
12625 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12626 where
12627 S: serde::Serializer,
12628 {
12629 match self {
12630 Self::Unspecified => serializer.serialize_i32(0),
12631 Self::Active => serializer.serialize_i32(1),
12632 Self::Closed => serializer.serialize_i32(2),
12633 Self::Creating => serializer.serialize_i32(3),
12634 Self::Deleting => serializer.serialize_i32(4),
12635 Self::OutOfSync => serializer.serialize_i32(5),
12636 Self::DeleteFailed => serializer.serialize_i32(6),
12637 Self::UnknownValue(u) => u.0.serialize(serializer),
12638 }
12639 }
12640 }
12641
12642 impl<'de> serde::de::Deserialize<'de> for State {
12643 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12644 where
12645 D: serde::Deserializer<'de>,
12646 {
12647 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12648 ".google.cloud.networksecurity.v1.InterceptEndpointGroup.State",
12649 ))
12650 }
12651 }
12652}
12653
12654/// Request message for ListInterceptEndpointGroups.
12655#[derive(Clone, Default, PartialEq)]
12656#[non_exhaustive]
12657pub struct ListInterceptEndpointGroupsRequest {
12658 /// Required. The parent, which owns this collection of endpoint groups.
12659 /// Example: `projects/123456789/locations/global`.
12660 /// See <https://google.aip.dev/132> for more details.
12661 pub parent: std::string::String,
12662
12663 /// Optional. Requested page size. Server may return fewer items than
12664 /// requested. If unspecified, server will pick an appropriate default. See
12665 /// <https://google.aip.dev/158> for more details.
12666 pub page_size: i32,
12667
12668 /// Optional. A page token, received from a previous
12669 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
12670 /// page. When paginating, all other parameters provided to
12671 /// `ListInterceptEndpointGroups` must match the call that provided the page
12672 /// token.
12673 /// See <https://google.aip.dev/158> for more details.
12674 pub page_token: std::string::String,
12675
12676 /// Optional. Filter expression.
12677 /// See <https://google.aip.dev/160#filtering> for more details.
12678 pub filter: std::string::String,
12679
12680 /// Optional. Sort expression.
12681 /// See <https://google.aip.dev/132#ordering> for more details.
12682 pub order_by: std::string::String,
12683
12684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12685}
12686
12687impl ListInterceptEndpointGroupsRequest {
12688 /// Creates a new default instance.
12689 pub fn new() -> Self {
12690 std::default::Default::default()
12691 }
12692
12693 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
12694 ///
12695 /// # Example
12696 /// ```ignore,no_run
12697 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12698 /// # let project_id = "project_id";
12699 /// # let location_id = "location_id";
12700 /// let x = ListInterceptEndpointGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
12701 /// ```
12702 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12703 self.parent = v.into();
12704 self
12705 }
12706
12707 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
12708 ///
12709 /// # Example
12710 /// ```ignore,no_run
12711 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12712 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_size(42);
12713 /// ```
12714 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12715 self.page_size = v.into();
12716 self
12717 }
12718
12719 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
12720 ///
12721 /// # Example
12722 /// ```ignore,no_run
12723 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12724 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_token("example");
12725 /// ```
12726 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12727 self.page_token = v.into();
12728 self
12729 }
12730
12731 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
12732 ///
12733 /// # Example
12734 /// ```ignore,no_run
12735 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12736 /// let x = ListInterceptEndpointGroupsRequest::new().set_filter("example");
12737 /// ```
12738 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12739 self.filter = v.into();
12740 self
12741 }
12742
12743 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
12744 ///
12745 /// # Example
12746 /// ```ignore,no_run
12747 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12748 /// let x = ListInterceptEndpointGroupsRequest::new().set_order_by("example");
12749 /// ```
12750 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12751 self.order_by = v.into();
12752 self
12753 }
12754}
12755
12756impl wkt::message::Message for ListInterceptEndpointGroupsRequest {
12757 fn typename() -> &'static str {
12758 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest"
12759 }
12760}
12761
12762/// Response message for ListInterceptEndpointGroups.
12763#[derive(Clone, Default, PartialEq)]
12764#[non_exhaustive]
12765pub struct ListInterceptEndpointGroupsResponse {
12766 /// The endpoint groups from the specified parent.
12767 pub intercept_endpoint_groups: std::vec::Vec<crate::model::InterceptEndpointGroup>,
12768
12769 /// A token that can be sent as `page_token` to retrieve the next page.
12770 /// If this field is omitted, there are no subsequent pages.
12771 /// See <https://google.aip.dev/158> for more details.
12772 pub next_page_token: std::string::String,
12773
12774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12775}
12776
12777impl ListInterceptEndpointGroupsResponse {
12778 /// Creates a new default instance.
12779 pub fn new() -> Self {
12780 std::default::Default::default()
12781 }
12782
12783 /// Sets the value of [intercept_endpoint_groups][crate::model::ListInterceptEndpointGroupsResponse::intercept_endpoint_groups].
12784 ///
12785 /// # Example
12786 /// ```ignore,no_run
12787 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12788 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12789 /// let x = ListInterceptEndpointGroupsResponse::new()
12790 /// .set_intercept_endpoint_groups([
12791 /// InterceptEndpointGroup::default()/* use setters */,
12792 /// InterceptEndpointGroup::default()/* use (different) setters */,
12793 /// ]);
12794 /// ```
12795 pub fn set_intercept_endpoint_groups<T, V>(mut self, v: T) -> Self
12796 where
12797 T: std::iter::IntoIterator<Item = V>,
12798 V: std::convert::Into<crate::model::InterceptEndpointGroup>,
12799 {
12800 use std::iter::Iterator;
12801 self.intercept_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
12802 self
12803 }
12804
12805 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupsResponse::next_page_token].
12806 ///
12807 /// # Example
12808 /// ```ignore,no_run
12809 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12810 /// let x = ListInterceptEndpointGroupsResponse::new().set_next_page_token("example");
12811 /// ```
12812 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12813 self.next_page_token = v.into();
12814 self
12815 }
12816}
12817
12818impl wkt::message::Message for ListInterceptEndpointGroupsResponse {
12819 fn typename() -> &'static str {
12820 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse"
12821 }
12822}
12823
12824#[doc(hidden)]
12825impl google_cloud_gax::paginator::internal::PageableResponse
12826 for ListInterceptEndpointGroupsResponse
12827{
12828 type PageItem = crate::model::InterceptEndpointGroup;
12829
12830 fn items(self) -> std::vec::Vec<Self::PageItem> {
12831 self.intercept_endpoint_groups
12832 }
12833
12834 fn next_page_token(&self) -> std::string::String {
12835 use std::clone::Clone;
12836 self.next_page_token.clone()
12837 }
12838}
12839
12840/// Request message for GetInterceptEndpointGroup.
12841#[derive(Clone, Default, PartialEq)]
12842#[non_exhaustive]
12843pub struct GetInterceptEndpointGroupRequest {
12844 /// Required. The name of the endpoint group to retrieve.
12845 /// Format:
12846 /// projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}
12847 pub name: std::string::String,
12848
12849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12850}
12851
12852impl GetInterceptEndpointGroupRequest {
12853 /// Creates a new default instance.
12854 pub fn new() -> Self {
12855 std::default::Default::default()
12856 }
12857
12858 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
12859 ///
12860 /// # Example
12861 /// ```ignore,no_run
12862 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupRequest;
12863 /// # let project_id = "project_id";
12864 /// # let location_id = "location_id";
12865 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
12866 /// let x = GetInterceptEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
12867 /// ```
12868 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12869 self.name = v.into();
12870 self
12871 }
12872}
12873
12874impl wkt::message::Message for GetInterceptEndpointGroupRequest {
12875 fn typename() -> &'static str {
12876 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest"
12877 }
12878}
12879
12880/// Request message for CreateInterceptEndpointGroup.
12881#[derive(Clone, Default, PartialEq)]
12882#[non_exhaustive]
12883pub struct CreateInterceptEndpointGroupRequest {
12884 /// Required. The parent resource where this endpoint group will be created.
12885 /// Format: projects/{project}/locations/{location}
12886 pub parent: std::string::String,
12887
12888 /// Required. The ID to use for the endpoint group, which will become the final
12889 /// component of the endpoint group's resource name.
12890 pub intercept_endpoint_group_id: std::string::String,
12891
12892 /// Required. The endpoint group to create.
12893 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12894
12895 /// Optional. A unique identifier for this request. Must be a UUID4.
12896 /// This request is only idempotent if a `request_id` is provided.
12897 /// See <https://google.aip.dev/155> for more details.
12898 pub request_id: std::string::String,
12899
12900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12901}
12902
12903impl CreateInterceptEndpointGroupRequest {
12904 /// Creates a new default instance.
12905 pub fn new() -> Self {
12906 std::default::Default::default()
12907 }
12908
12909 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
12910 ///
12911 /// # Example
12912 /// ```ignore,no_run
12913 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12914 /// # let project_id = "project_id";
12915 /// # let location_id = "location_id";
12916 /// let x = CreateInterceptEndpointGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
12917 /// ```
12918 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12919 self.parent = v.into();
12920 self
12921 }
12922
12923 /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
12924 ///
12925 /// # Example
12926 /// ```ignore,no_run
12927 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12928 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group_id("example");
12929 /// ```
12930 pub fn set_intercept_endpoint_group_id<T: std::convert::Into<std::string::String>>(
12931 mut self,
12932 v: T,
12933 ) -> Self {
12934 self.intercept_endpoint_group_id = v.into();
12935 self
12936 }
12937
12938 /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12939 ///
12940 /// # Example
12941 /// ```ignore,no_run
12942 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12943 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12944 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12945 /// ```
12946 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12947 where
12948 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12949 {
12950 self.intercept_endpoint_group = std::option::Option::Some(v.into());
12951 self
12952 }
12953
12954 /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12955 ///
12956 /// # Example
12957 /// ```ignore,no_run
12958 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12959 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12960 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12961 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12962 /// ```
12963 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12964 where
12965 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12966 {
12967 self.intercept_endpoint_group = v.map(|x| x.into());
12968 self
12969 }
12970
12971 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
12972 ///
12973 /// # Example
12974 /// ```ignore,no_run
12975 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12976 /// let x = CreateInterceptEndpointGroupRequest::new().set_request_id("example");
12977 /// ```
12978 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12979 self.request_id = v.into();
12980 self
12981 }
12982}
12983
12984impl wkt::message::Message for CreateInterceptEndpointGroupRequest {
12985 fn typename() -> &'static str {
12986 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest"
12987 }
12988}
12989
12990/// Request message for UpdateInterceptEndpointGroup.
12991#[derive(Clone, Default, PartialEq)]
12992#[non_exhaustive]
12993pub struct UpdateInterceptEndpointGroupRequest {
12994 /// Optional. The list of fields to update.
12995 /// Fields are specified relative to the endpoint group
12996 /// (e.g. `description`; *not* `intercept_endpoint_group.description`).
12997 /// See <https://google.aip.dev/161> for more details.
12998 pub update_mask: std::option::Option<wkt::FieldMask>,
12999
13000 /// Required. The endpoint group to update.
13001 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
13002
13003 /// Optional. A unique identifier for this request. Must be a UUID4.
13004 /// This request is only idempotent if a `request_id` is provided.
13005 /// See <https://google.aip.dev/155> for more details.
13006 pub request_id: std::string::String,
13007
13008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13009}
13010
13011impl UpdateInterceptEndpointGroupRequest {
13012 /// Creates a new default instance.
13013 pub fn new() -> Self {
13014 std::default::Default::default()
13015 }
13016
13017 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
13018 ///
13019 /// # Example
13020 /// ```ignore,no_run
13021 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13022 /// use wkt::FieldMask;
13023 /// let x = UpdateInterceptEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13024 /// ```
13025 pub fn set_update_mask<T>(mut self, v: T) -> Self
13026 where
13027 T: std::convert::Into<wkt::FieldMask>,
13028 {
13029 self.update_mask = std::option::Option::Some(v.into());
13030 self
13031 }
13032
13033 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
13034 ///
13035 /// # Example
13036 /// ```ignore,no_run
13037 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13038 /// use wkt::FieldMask;
13039 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13040 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13041 /// ```
13042 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13043 where
13044 T: std::convert::Into<wkt::FieldMask>,
13045 {
13046 self.update_mask = v.map(|x| x.into());
13047 self
13048 }
13049
13050 /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
13051 ///
13052 /// # Example
13053 /// ```ignore,no_run
13054 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13055 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
13056 /// let x = UpdateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
13057 /// ```
13058 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
13059 where
13060 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
13061 {
13062 self.intercept_endpoint_group = std::option::Option::Some(v.into());
13063 self
13064 }
13065
13066 /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
13067 ///
13068 /// # Example
13069 /// ```ignore,no_run
13070 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13071 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
13072 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
13073 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
13074 /// ```
13075 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
13076 where
13077 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
13078 {
13079 self.intercept_endpoint_group = v.map(|x| x.into());
13080 self
13081 }
13082
13083 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
13084 ///
13085 /// # Example
13086 /// ```ignore,no_run
13087 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
13088 /// let x = UpdateInterceptEndpointGroupRequest::new().set_request_id("example");
13089 /// ```
13090 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13091 self.request_id = v.into();
13092 self
13093 }
13094}
13095
13096impl wkt::message::Message for UpdateInterceptEndpointGroupRequest {
13097 fn typename() -> &'static str {
13098 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest"
13099 }
13100}
13101
13102/// Request message for DeleteInterceptEndpointGroup.
13103#[derive(Clone, Default, PartialEq)]
13104#[non_exhaustive]
13105pub struct DeleteInterceptEndpointGroupRequest {
13106 /// Required. The endpoint group to delete.
13107 pub name: std::string::String,
13108
13109 /// Optional. A unique identifier for this request. Must be a UUID4.
13110 /// This request is only idempotent if a `request_id` is provided.
13111 /// See <https://google.aip.dev/155> for more details.
13112 pub request_id: std::string::String,
13113
13114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13115}
13116
13117impl DeleteInterceptEndpointGroupRequest {
13118 /// Creates a new default instance.
13119 pub fn new() -> Self {
13120 std::default::Default::default()
13121 }
13122
13123 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
13124 ///
13125 /// # Example
13126 /// ```ignore,no_run
13127 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
13128 /// # let project_id = "project_id";
13129 /// # let location_id = "location_id";
13130 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
13131 /// let x = DeleteInterceptEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
13132 /// ```
13133 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13134 self.name = v.into();
13135 self
13136 }
13137
13138 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
13139 ///
13140 /// # Example
13141 /// ```ignore,no_run
13142 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
13143 /// let x = DeleteInterceptEndpointGroupRequest::new().set_request_id("example");
13144 /// ```
13145 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13146 self.request_id = v.into();
13147 self
13148 }
13149}
13150
13151impl wkt::message::Message for DeleteInterceptEndpointGroupRequest {
13152 fn typename() -> &'static str {
13153 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest"
13154 }
13155}
13156
13157/// An endpoint group association represents a link between a network and an
13158/// endpoint group in the organization.
13159///
13160/// Creating an association creates the networking infrastructure linking the
13161/// network to the endpoint group, but does not enable intercept by itself.
13162/// To enable intercept, the user must also create a network firewall policy
13163/// containing intercept rules and associate it with the network.
13164#[derive(Clone, Default, PartialEq)]
13165#[non_exhaustive]
13166pub struct InterceptEndpointGroupAssociation {
13167 /// Immutable. Identifier. The resource name of this endpoint group
13168 /// association, for example:
13169 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association`.
13170 /// See <https://google.aip.dev/122> for more details.
13171 pub name: std::string::String,
13172
13173 /// Output only. The timestamp when the resource was created.
13174 /// See <https://google.aip.dev/148#timestamps>.
13175 pub create_time: std::option::Option<wkt::Timestamp>,
13176
13177 /// Output only. The timestamp when the resource was most recently updated.
13178 /// See <https://google.aip.dev/148#timestamps>.
13179 pub update_time: std::option::Option<wkt::Timestamp>,
13180
13181 /// Optional. Labels are key/value pairs that help to organize and filter
13182 /// resources.
13183 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13184
13185 /// Required. Immutable. The endpoint group that this association is connected
13186 /// to, for example:
13187 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
13188 /// See <https://google.aip.dev/124>.
13189 pub intercept_endpoint_group: std::string::String,
13190
13191 /// Required. Immutable. The VPC network that is associated. for example:
13192 /// `projects/123456789/global/networks/my-network`.
13193 /// See <https://google.aip.dev/124>.
13194 pub network: std::string::String,
13195
13196 /// Output only. The list of locations where the association is present. This
13197 /// information is retrieved from the linked endpoint group, and not configured
13198 /// as part of the association itself.
13199 #[deprecated]
13200 pub locations_details:
13201 std::vec::Vec<crate::model::intercept_endpoint_group_association::LocationDetails>,
13202
13203 /// Output only. Current state of the endpoint group association.
13204 pub state: crate::model::intercept_endpoint_group_association::State,
13205
13206 /// Output only. The current state of the resource does not match the user's
13207 /// intended state, and the system is working to reconcile them. This part of
13208 /// the normal operation (e.g. adding a new location to the target deployment
13209 /// group). See <https://google.aip.dev/128>.
13210 pub reconciling: bool,
13211
13212 /// Output only. The list of locations where the association is configured.
13213 /// This information is retrieved from the linked endpoint group.
13214 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
13215
13216 /// Output only. Identifier used by the data-path.
13217 /// See the NSI GENEVE format for more details:
13218 /// <https://docs.cloud.google.com/network-security-integration/docs/understand-geneve#network_id>
13219 pub network_cookie: u32,
13220
13221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13222}
13223
13224impl InterceptEndpointGroupAssociation {
13225 /// Creates a new default instance.
13226 pub fn new() -> Self {
13227 std::default::Default::default()
13228 }
13229
13230 /// Sets the value of [name][crate::model::InterceptEndpointGroupAssociation::name].
13231 ///
13232 /// # Example
13233 /// ```ignore,no_run
13234 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13235 /// # let project_id = "project_id";
13236 /// # let location_id = "location_id";
13237 /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
13238 /// let x = InterceptEndpointGroupAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
13239 /// ```
13240 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13241 self.name = v.into();
13242 self
13243 }
13244
13245 /// Sets the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13246 ///
13247 /// # Example
13248 /// ```ignore,no_run
13249 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13250 /// use wkt::Timestamp;
13251 /// let x = InterceptEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
13252 /// ```
13253 pub fn set_create_time<T>(mut self, v: T) -> Self
13254 where
13255 T: std::convert::Into<wkt::Timestamp>,
13256 {
13257 self.create_time = std::option::Option::Some(v.into());
13258 self
13259 }
13260
13261 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
13262 ///
13263 /// # Example
13264 /// ```ignore,no_run
13265 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13266 /// use wkt::Timestamp;
13267 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13268 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
13269 /// ```
13270 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13271 where
13272 T: std::convert::Into<wkt::Timestamp>,
13273 {
13274 self.create_time = v.map(|x| x.into());
13275 self
13276 }
13277
13278 /// Sets the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13279 ///
13280 /// # Example
13281 /// ```ignore,no_run
13282 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13283 /// use wkt::Timestamp;
13284 /// let x = InterceptEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
13285 /// ```
13286 pub fn set_update_time<T>(mut self, v: T) -> Self
13287 where
13288 T: std::convert::Into<wkt::Timestamp>,
13289 {
13290 self.update_time = std::option::Option::Some(v.into());
13291 self
13292 }
13293
13294 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
13295 ///
13296 /// # Example
13297 /// ```ignore,no_run
13298 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13299 /// use wkt::Timestamp;
13300 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13301 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
13302 /// ```
13303 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13304 where
13305 T: std::convert::Into<wkt::Timestamp>,
13306 {
13307 self.update_time = v.map(|x| x.into());
13308 self
13309 }
13310
13311 /// Sets the value of [labels][crate::model::InterceptEndpointGroupAssociation::labels].
13312 ///
13313 /// # Example
13314 /// ```ignore,no_run
13315 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13316 /// let x = InterceptEndpointGroupAssociation::new().set_labels([
13317 /// ("key0", "abc"),
13318 /// ("key1", "xyz"),
13319 /// ]);
13320 /// ```
13321 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13322 where
13323 T: std::iter::IntoIterator<Item = (K, V)>,
13324 K: std::convert::Into<std::string::String>,
13325 V: std::convert::Into<std::string::String>,
13326 {
13327 use std::iter::Iterator;
13328 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13329 self
13330 }
13331
13332 /// Sets the value of [intercept_endpoint_group][crate::model::InterceptEndpointGroupAssociation::intercept_endpoint_group].
13333 ///
13334 /// # Example
13335 /// ```ignore,no_run
13336 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13337 /// # let project_id = "project_id";
13338 /// # let location_id = "location_id";
13339 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
13340 /// let x = InterceptEndpointGroupAssociation::new().set_intercept_endpoint_group(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
13341 /// ```
13342 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
13343 mut self,
13344 v: T,
13345 ) -> Self {
13346 self.intercept_endpoint_group = v.into();
13347 self
13348 }
13349
13350 /// Sets the value of [network][crate::model::InterceptEndpointGroupAssociation::network].
13351 ///
13352 /// # Example
13353 /// ```ignore,no_run
13354 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13355 /// let x = InterceptEndpointGroupAssociation::new().set_network("example");
13356 /// ```
13357 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13358 self.network = v.into();
13359 self
13360 }
13361
13362 /// Sets the value of [locations_details][crate::model::InterceptEndpointGroupAssociation::locations_details].
13363 ///
13364 /// # Example
13365 /// ```ignore,no_run
13366 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13367 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13368 /// let x = InterceptEndpointGroupAssociation::new()
13369 /// .set_locations_details([
13370 /// LocationDetails::default()/* use setters */,
13371 /// LocationDetails::default()/* use (different) setters */,
13372 /// ]);
13373 /// ```
13374 #[deprecated]
13375 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
13376 where
13377 T: std::iter::IntoIterator<Item = V>,
13378 V: std::convert::Into<crate::model::intercept_endpoint_group_association::LocationDetails>,
13379 {
13380 use std::iter::Iterator;
13381 self.locations_details = v.into_iter().map(|i| i.into()).collect();
13382 self
13383 }
13384
13385 /// Sets the value of [state][crate::model::InterceptEndpointGroupAssociation::state].
13386 ///
13387 /// # Example
13388 /// ```ignore,no_run
13389 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13390 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
13391 /// let x0 = InterceptEndpointGroupAssociation::new().set_state(State::Active);
13392 /// let x1 = InterceptEndpointGroupAssociation::new().set_state(State::Creating);
13393 /// let x2 = InterceptEndpointGroupAssociation::new().set_state(State::Deleting);
13394 /// ```
13395 pub fn set_state<
13396 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
13397 >(
13398 mut self,
13399 v: T,
13400 ) -> Self {
13401 self.state = v.into();
13402 self
13403 }
13404
13405 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroupAssociation::reconciling].
13406 ///
13407 /// # Example
13408 /// ```ignore,no_run
13409 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13410 /// let x = InterceptEndpointGroupAssociation::new().set_reconciling(true);
13411 /// ```
13412 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13413 self.reconciling = v.into();
13414 self
13415 }
13416
13417 /// Sets the value of [locations][crate::model::InterceptEndpointGroupAssociation::locations].
13418 ///
13419 /// # Example
13420 /// ```ignore,no_run
13421 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13422 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
13423 /// let x = InterceptEndpointGroupAssociation::new()
13424 /// .set_locations([
13425 /// InterceptLocation::default()/* use setters */,
13426 /// InterceptLocation::default()/* use (different) setters */,
13427 /// ]);
13428 /// ```
13429 pub fn set_locations<T, V>(mut self, v: T) -> Self
13430 where
13431 T: std::iter::IntoIterator<Item = V>,
13432 V: std::convert::Into<crate::model::InterceptLocation>,
13433 {
13434 use std::iter::Iterator;
13435 self.locations = v.into_iter().map(|i| i.into()).collect();
13436 self
13437 }
13438
13439 /// Sets the value of [network_cookie][crate::model::InterceptEndpointGroupAssociation::network_cookie].
13440 ///
13441 /// # Example
13442 /// ```ignore,no_run
13443 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13444 /// let x = InterceptEndpointGroupAssociation::new().set_network_cookie(42_u32);
13445 /// ```
13446 pub fn set_network_cookie<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
13447 self.network_cookie = v.into();
13448 self
13449 }
13450}
13451
13452impl wkt::message::Message for InterceptEndpointGroupAssociation {
13453 fn typename() -> &'static str {
13454 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation"
13455 }
13456}
13457
13458/// Defines additional types related to [InterceptEndpointGroupAssociation].
13459pub mod intercept_endpoint_group_association {
13460 #[allow(unused_imports)]
13461 use super::*;
13462
13463 /// Contains details about the state of an association in a specific cloud
13464 /// location.
13465 #[derive(Clone, Default, PartialEq)]
13466 #[non_exhaustive]
13467 pub struct LocationDetails {
13468 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
13469 pub location: std::string::String,
13470
13471 /// Output only. The current state of the association in this location.
13472 pub state: crate::model::intercept_endpoint_group_association::location_details::State,
13473
13474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13475 }
13476
13477 impl LocationDetails {
13478 /// Creates a new default instance.
13479 pub fn new() -> Self {
13480 std::default::Default::default()
13481 }
13482
13483 /// Sets the value of [location][crate::model::intercept_endpoint_group_association::LocationDetails::location].
13484 ///
13485 /// # Example
13486 /// ```ignore,no_run
13487 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13488 /// let x = LocationDetails::new().set_location("example");
13489 /// ```
13490 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13491 self.location = v.into();
13492 self
13493 }
13494
13495 /// Sets the value of [state][crate::model::intercept_endpoint_group_association::LocationDetails::state].
13496 ///
13497 /// # Example
13498 /// ```ignore,no_run
13499 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13500 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::location_details::State;
13501 /// let x0 = LocationDetails::new().set_state(State::Active);
13502 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
13503 /// ```
13504 pub fn set_state<
13505 T: std::convert::Into<
13506 crate::model::intercept_endpoint_group_association::location_details::State,
13507 >,
13508 >(
13509 mut self,
13510 v: T,
13511 ) -> Self {
13512 self.state = v.into();
13513 self
13514 }
13515 }
13516
13517 impl wkt::message::Message for LocationDetails {
13518 fn typename() -> &'static str {
13519 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails"
13520 }
13521 }
13522
13523 /// Defines additional types related to [LocationDetails].
13524 pub mod location_details {
13525 #[allow(unused_imports)]
13526 use super::*;
13527
13528 /// The state of association.
13529 ///
13530 /// # Working with unknown values
13531 ///
13532 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13533 /// additional enum variants at any time. Adding new variants is not considered
13534 /// a breaking change. Applications should write their code in anticipation of:
13535 ///
13536 /// - New values appearing in future releases of the client library, **and**
13537 /// - New values received dynamically, without application changes.
13538 ///
13539 /// Please consult the [Working with enums] section in the user guide for some
13540 /// guidelines.
13541 ///
13542 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13543 #[derive(Clone, Debug, PartialEq)]
13544 #[non_exhaustive]
13545 pub enum State {
13546 /// Not set.
13547 Unspecified,
13548 /// The association is ready and in sync with the linked endpoint group.
13549 Active,
13550 /// The association is out of sync with the linked endpoint group.
13551 /// In most cases, this is a result of a transient issue within the system
13552 /// (e.g. an inaccessible location) and the system is expected to recover
13553 /// automatically.
13554 OutOfSync,
13555 /// If set, the enum was initialized with an unknown value.
13556 ///
13557 /// Applications can examine the value using [State::value] or
13558 /// [State::name].
13559 UnknownValue(state::UnknownValue),
13560 }
13561
13562 #[doc(hidden)]
13563 pub mod state {
13564 #[allow(unused_imports)]
13565 use super::*;
13566 #[derive(Clone, Debug, PartialEq)]
13567 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13568 }
13569
13570 impl State {
13571 /// Gets the enum value.
13572 ///
13573 /// Returns `None` if the enum contains an unknown value deserialized from
13574 /// the string representation of enums.
13575 pub fn value(&self) -> std::option::Option<i32> {
13576 match self {
13577 Self::Unspecified => std::option::Option::Some(0),
13578 Self::Active => std::option::Option::Some(1),
13579 Self::OutOfSync => std::option::Option::Some(2),
13580 Self::UnknownValue(u) => u.0.value(),
13581 }
13582 }
13583
13584 /// Gets the enum value as a string.
13585 ///
13586 /// Returns `None` if the enum contains an unknown value deserialized from
13587 /// the integer representation of enums.
13588 pub fn name(&self) -> std::option::Option<&str> {
13589 match self {
13590 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13591 Self::Active => std::option::Option::Some("ACTIVE"),
13592 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13593 Self::UnknownValue(u) => u.0.name(),
13594 }
13595 }
13596 }
13597
13598 impl std::default::Default for State {
13599 fn default() -> Self {
13600 use std::convert::From;
13601 Self::from(0)
13602 }
13603 }
13604
13605 impl std::fmt::Display for State {
13606 fn fmt(
13607 &self,
13608 f: &mut std::fmt::Formatter<'_>,
13609 ) -> std::result::Result<(), std::fmt::Error> {
13610 wkt::internal::display_enum(f, self.name(), self.value())
13611 }
13612 }
13613
13614 impl std::convert::From<i32> for State {
13615 fn from(value: i32) -> Self {
13616 match value {
13617 0 => Self::Unspecified,
13618 1 => Self::Active,
13619 2 => Self::OutOfSync,
13620 _ => Self::UnknownValue(state::UnknownValue(
13621 wkt::internal::UnknownEnumValue::Integer(value),
13622 )),
13623 }
13624 }
13625 }
13626
13627 impl std::convert::From<&str> for State {
13628 fn from(value: &str) -> Self {
13629 use std::string::ToString;
13630 match value {
13631 "STATE_UNSPECIFIED" => Self::Unspecified,
13632 "ACTIVE" => Self::Active,
13633 "OUT_OF_SYNC" => Self::OutOfSync,
13634 _ => Self::UnknownValue(state::UnknownValue(
13635 wkt::internal::UnknownEnumValue::String(value.to_string()),
13636 )),
13637 }
13638 }
13639 }
13640
13641 impl serde::ser::Serialize for State {
13642 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13643 where
13644 S: serde::Serializer,
13645 {
13646 match self {
13647 Self::Unspecified => serializer.serialize_i32(0),
13648 Self::Active => serializer.serialize_i32(1),
13649 Self::OutOfSync => serializer.serialize_i32(2),
13650 Self::UnknownValue(u) => u.0.serialize(serializer),
13651 }
13652 }
13653 }
13654
13655 impl<'de> serde::de::Deserialize<'de> for State {
13656 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13657 where
13658 D: serde::Deserializer<'de>,
13659 {
13660 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13661 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State"))
13662 }
13663 }
13664 }
13665
13666 /// The state of the association.
13667 ///
13668 /// # Working with unknown values
13669 ///
13670 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13671 /// additional enum variants at any time. Adding new variants is not considered
13672 /// a breaking change. Applications should write their code in anticipation of:
13673 ///
13674 /// - New values appearing in future releases of the client library, **and**
13675 /// - New values received dynamically, without application changes.
13676 ///
13677 /// Please consult the [Working with enums] section in the user guide for some
13678 /// guidelines.
13679 ///
13680 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13681 #[derive(Clone, Debug, PartialEq)]
13682 #[non_exhaustive]
13683 pub enum State {
13684 /// Not set.
13685 Unspecified,
13686 /// The association is ready and in sync with the linked endpoint group.
13687 Active,
13688 /// The association is being created.
13689 Creating,
13690 /// The association is being deleted.
13691 Deleting,
13692 /// The association is disabled due to a breaking change in another resource.
13693 Closed,
13694 /// The association is out of sync with the linked endpoint group.
13695 /// In most cases, this is a result of a transient issue within the system
13696 /// (e.g. an inaccessible location) and the system is expected to recover
13697 /// automatically. Check the `locations_details` field for more details.
13698 OutOfSync,
13699 /// An attempt to delete the association has failed. This is a terminal state
13700 /// and the association is not expected to be usable as some of its resources
13701 /// have been deleted.
13702 /// The only permitted operation is to retry deleting the association.
13703 DeleteFailed,
13704 /// If set, the enum was initialized with an unknown value.
13705 ///
13706 /// Applications can examine the value using [State::value] or
13707 /// [State::name].
13708 UnknownValue(state::UnknownValue),
13709 }
13710
13711 #[doc(hidden)]
13712 pub mod state {
13713 #[allow(unused_imports)]
13714 use super::*;
13715 #[derive(Clone, Debug, PartialEq)]
13716 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13717 }
13718
13719 impl State {
13720 /// Gets the enum value.
13721 ///
13722 /// Returns `None` if the enum contains an unknown value deserialized from
13723 /// the string representation of enums.
13724 pub fn value(&self) -> std::option::Option<i32> {
13725 match self {
13726 Self::Unspecified => std::option::Option::Some(0),
13727 Self::Active => std::option::Option::Some(1),
13728 Self::Creating => std::option::Option::Some(2),
13729 Self::Deleting => std::option::Option::Some(3),
13730 Self::Closed => std::option::Option::Some(4),
13731 Self::OutOfSync => std::option::Option::Some(5),
13732 Self::DeleteFailed => std::option::Option::Some(6),
13733 Self::UnknownValue(u) => u.0.value(),
13734 }
13735 }
13736
13737 /// Gets the enum value as a string.
13738 ///
13739 /// Returns `None` if the enum contains an unknown value deserialized from
13740 /// the integer representation of enums.
13741 pub fn name(&self) -> std::option::Option<&str> {
13742 match self {
13743 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13744 Self::Active => std::option::Option::Some("ACTIVE"),
13745 Self::Creating => std::option::Option::Some("CREATING"),
13746 Self::Deleting => std::option::Option::Some("DELETING"),
13747 Self::Closed => std::option::Option::Some("CLOSED"),
13748 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13749 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
13750 Self::UnknownValue(u) => u.0.name(),
13751 }
13752 }
13753 }
13754
13755 impl std::default::Default for State {
13756 fn default() -> Self {
13757 use std::convert::From;
13758 Self::from(0)
13759 }
13760 }
13761
13762 impl std::fmt::Display for State {
13763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13764 wkt::internal::display_enum(f, self.name(), self.value())
13765 }
13766 }
13767
13768 impl std::convert::From<i32> for State {
13769 fn from(value: i32) -> Self {
13770 match value {
13771 0 => Self::Unspecified,
13772 1 => Self::Active,
13773 2 => Self::Creating,
13774 3 => Self::Deleting,
13775 4 => Self::Closed,
13776 5 => Self::OutOfSync,
13777 6 => Self::DeleteFailed,
13778 _ => Self::UnknownValue(state::UnknownValue(
13779 wkt::internal::UnknownEnumValue::Integer(value),
13780 )),
13781 }
13782 }
13783 }
13784
13785 impl std::convert::From<&str> for State {
13786 fn from(value: &str) -> Self {
13787 use std::string::ToString;
13788 match value {
13789 "STATE_UNSPECIFIED" => Self::Unspecified,
13790 "ACTIVE" => Self::Active,
13791 "CREATING" => Self::Creating,
13792 "DELETING" => Self::Deleting,
13793 "CLOSED" => Self::Closed,
13794 "OUT_OF_SYNC" => Self::OutOfSync,
13795 "DELETE_FAILED" => Self::DeleteFailed,
13796 _ => Self::UnknownValue(state::UnknownValue(
13797 wkt::internal::UnknownEnumValue::String(value.to_string()),
13798 )),
13799 }
13800 }
13801 }
13802
13803 impl serde::ser::Serialize for State {
13804 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13805 where
13806 S: serde::Serializer,
13807 {
13808 match self {
13809 Self::Unspecified => serializer.serialize_i32(0),
13810 Self::Active => serializer.serialize_i32(1),
13811 Self::Creating => serializer.serialize_i32(2),
13812 Self::Deleting => serializer.serialize_i32(3),
13813 Self::Closed => serializer.serialize_i32(4),
13814 Self::OutOfSync => serializer.serialize_i32(5),
13815 Self::DeleteFailed => serializer.serialize_i32(6),
13816 Self::UnknownValue(u) => u.0.serialize(serializer),
13817 }
13818 }
13819 }
13820
13821 impl<'de> serde::de::Deserialize<'de> for State {
13822 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13823 where
13824 D: serde::Deserializer<'de>,
13825 {
13826 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13827 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State",
13828 ))
13829 }
13830 }
13831}
13832
13833/// Request message for ListInterceptEndpointGroupAssociations.
13834#[derive(Clone, Default, PartialEq)]
13835#[non_exhaustive]
13836pub struct ListInterceptEndpointGroupAssociationsRequest {
13837 /// Required. The parent, which owns this collection of associations.
13838 /// Example: `projects/123456789/locations/global`.
13839 /// See <https://google.aip.dev/132> for more details.
13840 pub parent: std::string::String,
13841
13842 /// Optional. Requested page size. Server may return fewer items than
13843 /// requested. If unspecified, server will pick an appropriate default. See
13844 /// <https://google.aip.dev/158> for more details.
13845 pub page_size: i32,
13846
13847 /// Optional. A page token, received from a previous
13848 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
13849 /// page. When paginating, all other parameters provided to
13850 /// `ListInterceptEndpointGroups` must match the call that provided the page
13851 /// token. See <https://google.aip.dev/158> for more details.
13852 pub page_token: std::string::String,
13853
13854 /// Optional. Filter expression.
13855 /// See <https://google.aip.dev/160#filtering> for more details.
13856 pub filter: std::string::String,
13857
13858 /// Optional. Sort expression.
13859 /// See <https://google.aip.dev/132#ordering> for more details.
13860 pub order_by: std::string::String,
13861
13862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13863}
13864
13865impl ListInterceptEndpointGroupAssociationsRequest {
13866 /// Creates a new default instance.
13867 pub fn new() -> Self {
13868 std::default::Default::default()
13869 }
13870
13871 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
13872 ///
13873 /// # Example
13874 /// ```ignore,no_run
13875 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13876 /// # let project_id = "project_id";
13877 /// # let location_id = "location_id";
13878 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13879 /// ```
13880 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13881 self.parent = v.into();
13882 self
13883 }
13884
13885 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
13886 ///
13887 /// # Example
13888 /// ```ignore,no_run
13889 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13890 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_size(42);
13891 /// ```
13892 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13893 self.page_size = v.into();
13894 self
13895 }
13896
13897 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
13898 ///
13899 /// # Example
13900 /// ```ignore,no_run
13901 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13902 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_token("example");
13903 /// ```
13904 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13905 self.page_token = v.into();
13906 self
13907 }
13908
13909 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
13910 ///
13911 /// # Example
13912 /// ```ignore,no_run
13913 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13914 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_filter("example");
13915 /// ```
13916 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13917 self.filter = v.into();
13918 self
13919 }
13920
13921 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
13922 ///
13923 /// # Example
13924 /// ```ignore,no_run
13925 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13926 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_order_by("example");
13927 /// ```
13928 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13929 self.order_by = v.into();
13930 self
13931 }
13932}
13933
13934impl wkt::message::Message for ListInterceptEndpointGroupAssociationsRequest {
13935 fn typename() -> &'static str {
13936 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest"
13937 }
13938}
13939
13940/// Response message for ListInterceptEndpointGroupAssociations.
13941#[derive(Clone, Default, PartialEq)]
13942#[non_exhaustive]
13943pub struct ListInterceptEndpointGroupAssociationsResponse {
13944 /// The associations from the specified parent.
13945 pub intercept_endpoint_group_associations:
13946 std::vec::Vec<crate::model::InterceptEndpointGroupAssociation>,
13947
13948 /// A token that can be sent as `page_token` to retrieve the next page.
13949 /// If this field is omitted, there are no subsequent pages.
13950 /// See <https://google.aip.dev/158> for more details.
13951 pub next_page_token: std::string::String,
13952
13953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13954}
13955
13956impl ListInterceptEndpointGroupAssociationsResponse {
13957 /// Creates a new default instance.
13958 pub fn new() -> Self {
13959 std::default::Default::default()
13960 }
13961
13962 /// Sets the value of [intercept_endpoint_group_associations][crate::model::ListInterceptEndpointGroupAssociationsResponse::intercept_endpoint_group_associations].
13963 ///
13964 /// # Example
13965 /// ```ignore,no_run
13966 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13967 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13968 /// let x = ListInterceptEndpointGroupAssociationsResponse::new()
13969 /// .set_intercept_endpoint_group_associations([
13970 /// InterceptEndpointGroupAssociation::default()/* use setters */,
13971 /// InterceptEndpointGroupAssociation::default()/* use (different) setters */,
13972 /// ]);
13973 /// ```
13974 pub fn set_intercept_endpoint_group_associations<T, V>(mut self, v: T) -> Self
13975 where
13976 T: std::iter::IntoIterator<Item = V>,
13977 V: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13978 {
13979 use std::iter::Iterator;
13980 self.intercept_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
13981 self
13982 }
13983
13984 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupAssociationsResponse::next_page_token].
13985 ///
13986 /// # Example
13987 /// ```ignore,no_run
13988 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13989 /// let x = ListInterceptEndpointGroupAssociationsResponse::new().set_next_page_token("example");
13990 /// ```
13991 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13992 self.next_page_token = v.into();
13993 self
13994 }
13995}
13996
13997impl wkt::message::Message for ListInterceptEndpointGroupAssociationsResponse {
13998 fn typename() -> &'static str {
13999 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse"
14000 }
14001}
14002
14003#[doc(hidden)]
14004impl google_cloud_gax::paginator::internal::PageableResponse
14005 for ListInterceptEndpointGroupAssociationsResponse
14006{
14007 type PageItem = crate::model::InterceptEndpointGroupAssociation;
14008
14009 fn items(self) -> std::vec::Vec<Self::PageItem> {
14010 self.intercept_endpoint_group_associations
14011 }
14012
14013 fn next_page_token(&self) -> std::string::String {
14014 use std::clone::Clone;
14015 self.next_page_token.clone()
14016 }
14017}
14018
14019/// Request message for GetInterceptEndpointGroupAssociation.
14020#[derive(Clone, Default, PartialEq)]
14021#[non_exhaustive]
14022pub struct GetInterceptEndpointGroupAssociationRequest {
14023 /// Required. The name of the association to retrieve.
14024 /// Format:
14025 /// projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}
14026 pub name: std::string::String,
14027
14028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14029}
14030
14031impl GetInterceptEndpointGroupAssociationRequest {
14032 /// Creates a new default instance.
14033 pub fn new() -> Self {
14034 std::default::Default::default()
14035 }
14036
14037 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
14038 ///
14039 /// # Example
14040 /// ```ignore,no_run
14041 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupAssociationRequest;
14042 /// # let project_id = "project_id";
14043 /// # let location_id = "location_id";
14044 /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
14045 /// let x = GetInterceptEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
14046 /// ```
14047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14048 self.name = v.into();
14049 self
14050 }
14051}
14052
14053impl wkt::message::Message for GetInterceptEndpointGroupAssociationRequest {
14054 fn typename() -> &'static str {
14055 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest"
14056 }
14057}
14058
14059/// Request message for CreateInterceptEndpointGroupAssociation.
14060#[derive(Clone, Default, PartialEq)]
14061#[non_exhaustive]
14062pub struct CreateInterceptEndpointGroupAssociationRequest {
14063 /// Required. The parent resource where this association will be created.
14064 /// Format: projects/{project}/locations/{location}
14065 pub parent: std::string::String,
14066
14067 /// Optional. The ID to use for the new association, which will become the
14068 /// final component of the endpoint group's resource name. If not provided, the
14069 /// server will generate a unique ID.
14070 pub intercept_endpoint_group_association_id: std::string::String,
14071
14072 /// Required. The association to create.
14073 pub intercept_endpoint_group_association:
14074 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
14075
14076 /// Optional. A unique identifier for this request. Must be a UUID4.
14077 /// This request is only idempotent if a `request_id` is provided.
14078 /// See <https://google.aip.dev/155> for more details.
14079 pub request_id: std::string::String,
14080
14081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14082}
14083
14084impl CreateInterceptEndpointGroupAssociationRequest {
14085 /// Creates a new default instance.
14086 pub fn new() -> Self {
14087 std::default::Default::default()
14088 }
14089
14090 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
14091 ///
14092 /// # Example
14093 /// ```ignore,no_run
14094 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14095 /// # let project_id = "project_id";
14096 /// # let location_id = "location_id";
14097 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
14098 /// ```
14099 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14100 self.parent = v.into();
14101 self
14102 }
14103
14104 /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
14105 ///
14106 /// # Example
14107 /// ```ignore,no_run
14108 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14109 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association_id("example");
14110 /// ```
14111 pub fn set_intercept_endpoint_group_association_id<
14112 T: std::convert::Into<std::string::String>,
14113 >(
14114 mut self,
14115 v: T,
14116 ) -> Self {
14117 self.intercept_endpoint_group_association_id = v.into();
14118 self
14119 }
14120
14121 /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14122 ///
14123 /// # Example
14124 /// ```ignore,no_run
14125 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14126 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14127 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
14128 /// ```
14129 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
14130 where
14131 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14132 {
14133 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
14134 self
14135 }
14136
14137 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14138 ///
14139 /// # Example
14140 /// ```ignore,no_run
14141 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14142 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14143 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
14144 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
14145 /// ```
14146 pub fn set_or_clear_intercept_endpoint_group_association<T>(
14147 mut self,
14148 v: std::option::Option<T>,
14149 ) -> Self
14150 where
14151 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14152 {
14153 self.intercept_endpoint_group_association = v.map(|x| x.into());
14154 self
14155 }
14156
14157 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
14158 ///
14159 /// # Example
14160 /// ```ignore,no_run
14161 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
14162 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14163 /// ```
14164 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14165 self.request_id = v.into();
14166 self
14167 }
14168}
14169
14170impl wkt::message::Message for CreateInterceptEndpointGroupAssociationRequest {
14171 fn typename() -> &'static str {
14172 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest"
14173 }
14174}
14175
14176/// Request message for UpdateInterceptEndpointGroupAssociation.
14177#[derive(Clone, Default, PartialEq)]
14178#[non_exhaustive]
14179pub struct UpdateInterceptEndpointGroupAssociationRequest {
14180 /// Optional. The list of fields to update.
14181 /// Fields are specified relative to the association
14182 /// (e.g. `description`; *not*
14183 /// `intercept_endpoint_group_association.description`). See
14184 /// <https://google.aip.dev/161> for more details.
14185 pub update_mask: std::option::Option<wkt::FieldMask>,
14186
14187 /// Required. The association to update.
14188 pub intercept_endpoint_group_association:
14189 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
14190
14191 /// Optional. A unique identifier for this request. Must be a UUID4.
14192 /// This request is only idempotent if a `request_id` is provided.
14193 /// See <https://google.aip.dev/155> for more details.
14194 pub request_id: std::string::String,
14195
14196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14197}
14198
14199impl UpdateInterceptEndpointGroupAssociationRequest {
14200 /// Creates a new default instance.
14201 pub fn new() -> Self {
14202 std::default::Default::default()
14203 }
14204
14205 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
14206 ///
14207 /// # Example
14208 /// ```ignore,no_run
14209 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14210 /// use wkt::FieldMask;
14211 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14212 /// ```
14213 pub fn set_update_mask<T>(mut self, v: T) -> Self
14214 where
14215 T: std::convert::Into<wkt::FieldMask>,
14216 {
14217 self.update_mask = std::option::Option::Some(v.into());
14218 self
14219 }
14220
14221 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
14222 ///
14223 /// # Example
14224 /// ```ignore,no_run
14225 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14226 /// use wkt::FieldMask;
14227 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14228 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14229 /// ```
14230 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14231 where
14232 T: std::convert::Into<wkt::FieldMask>,
14233 {
14234 self.update_mask = v.map(|x| x.into());
14235 self
14236 }
14237
14238 /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14239 ///
14240 /// # Example
14241 /// ```ignore,no_run
14242 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14243 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14244 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
14245 /// ```
14246 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
14247 where
14248 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14249 {
14250 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
14251 self
14252 }
14253
14254 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
14255 ///
14256 /// # Example
14257 /// ```ignore,no_run
14258 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14259 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
14260 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
14261 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
14262 /// ```
14263 pub fn set_or_clear_intercept_endpoint_group_association<T>(
14264 mut self,
14265 v: std::option::Option<T>,
14266 ) -> Self
14267 where
14268 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
14269 {
14270 self.intercept_endpoint_group_association = v.map(|x| x.into());
14271 self
14272 }
14273
14274 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
14275 ///
14276 /// # Example
14277 /// ```ignore,no_run
14278 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
14279 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14280 /// ```
14281 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14282 self.request_id = v.into();
14283 self
14284 }
14285}
14286
14287impl wkt::message::Message for UpdateInterceptEndpointGroupAssociationRequest {
14288 fn typename() -> &'static str {
14289 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest"
14290 }
14291}
14292
14293/// Request message for DeleteInterceptEndpointGroupAssociation.
14294#[derive(Clone, Default, PartialEq)]
14295#[non_exhaustive]
14296pub struct DeleteInterceptEndpointGroupAssociationRequest {
14297 /// Required. The association to delete.
14298 pub name: std::string::String,
14299
14300 /// Optional. A unique identifier for this request. Must be a UUID4.
14301 /// This request is only idempotent if a `request_id` is provided.
14302 /// See <https://google.aip.dev/155> for more details.
14303 pub request_id: std::string::String,
14304
14305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14306}
14307
14308impl DeleteInterceptEndpointGroupAssociationRequest {
14309 /// Creates a new default instance.
14310 pub fn new() -> Self {
14311 std::default::Default::default()
14312 }
14313
14314 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
14315 ///
14316 /// # Example
14317 /// ```ignore,no_run
14318 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14319 /// # let project_id = "project_id";
14320 /// # let location_id = "location_id";
14321 /// # let intercept_endpoint_group_association_id = "intercept_endpoint_group_association_id";
14322 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association_id}"));
14323 /// ```
14324 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14325 self.name = v.into();
14326 self
14327 }
14328
14329 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
14330 ///
14331 /// # Example
14332 /// ```ignore,no_run
14333 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
14334 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
14335 /// ```
14336 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14337 self.request_id = v.into();
14338 self
14339 }
14340}
14341
14342impl wkt::message::Message for DeleteInterceptEndpointGroupAssociationRequest {
14343 fn typename() -> &'static str {
14344 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest"
14345 }
14346}
14347
14348/// A deployment group aggregates many zonal intercept backends (deployments)
14349/// into a single global intercept service. Consumers can connect this service
14350/// using an endpoint group.
14351#[derive(Clone, Default, PartialEq)]
14352#[non_exhaustive]
14353pub struct InterceptDeploymentGroup {
14354 /// Immutable. Identifier. The resource name of this deployment group, for
14355 /// example:
14356 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
14357 /// See <https://google.aip.dev/122> for more details.
14358 pub name: std::string::String,
14359
14360 /// Output only. The timestamp when the resource was created.
14361 /// See <https://google.aip.dev/148#timestamps>.
14362 pub create_time: std::option::Option<wkt::Timestamp>,
14363
14364 /// Output only. The timestamp when the resource was most recently updated.
14365 /// See <https://google.aip.dev/148#timestamps>.
14366 pub update_time: std::option::Option<wkt::Timestamp>,
14367
14368 /// Optional. Labels are key/value pairs that help to organize and filter
14369 /// resources.
14370 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14371
14372 /// Required. Immutable. The network that will be used for all child
14373 /// deployments, for example: `projects/{project}/global/networks/{network}`.
14374 /// See <https://google.aip.dev/124>.
14375 pub network: std::string::String,
14376
14377 /// Output only. The list of endpoint groups that are connected to this
14378 /// resource.
14379 pub connected_endpoint_groups:
14380 std::vec::Vec<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14381
14382 /// Output only. The list of Intercept Deployments that belong to this group.
14383 #[deprecated]
14384 pub nested_deployments: std::vec::Vec<crate::model::intercept_deployment_group::Deployment>,
14385
14386 /// Output only. The current state of the deployment group.
14387 /// See <https://google.aip.dev/216>.
14388 pub state: crate::model::intercept_deployment_group::State,
14389
14390 /// Output only. The current state of the resource does not match the user's
14391 /// intended state, and the system is working to reconcile them. This is part
14392 /// of the normal operation (e.g. adding a new deployment to the group) See
14393 /// <https://google.aip.dev/128>.
14394 pub reconciling: bool,
14395
14396 /// Optional. User-provided description of the deployment group.
14397 /// Used as additional context for the deployment group.
14398 pub description: std::string::String,
14399
14400 /// Output only. The list of locations where the deployment group is present.
14401 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
14402
14403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14404}
14405
14406impl InterceptDeploymentGroup {
14407 /// Creates a new default instance.
14408 pub fn new() -> Self {
14409 std::default::Default::default()
14410 }
14411
14412 /// Sets the value of [name][crate::model::InterceptDeploymentGroup::name].
14413 ///
14414 /// # Example
14415 /// ```ignore,no_run
14416 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14417 /// # let project_id = "project_id";
14418 /// # let location_id = "location_id";
14419 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
14420 /// let x = InterceptDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
14421 /// ```
14422 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14423 self.name = v.into();
14424 self
14425 }
14426
14427 /// Sets the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14428 ///
14429 /// # Example
14430 /// ```ignore,no_run
14431 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14432 /// use wkt::Timestamp;
14433 /// let x = InterceptDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
14434 /// ```
14435 pub fn set_create_time<T>(mut self, v: T) -> Self
14436 where
14437 T: std::convert::Into<wkt::Timestamp>,
14438 {
14439 self.create_time = std::option::Option::Some(v.into());
14440 self
14441 }
14442
14443 /// Sets or clears the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14444 ///
14445 /// # Example
14446 /// ```ignore,no_run
14447 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14448 /// use wkt::Timestamp;
14449 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14450 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
14451 /// ```
14452 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14453 where
14454 T: std::convert::Into<wkt::Timestamp>,
14455 {
14456 self.create_time = v.map(|x| x.into());
14457 self
14458 }
14459
14460 /// Sets the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14461 ///
14462 /// # Example
14463 /// ```ignore,no_run
14464 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14465 /// use wkt::Timestamp;
14466 /// let x = InterceptDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
14467 /// ```
14468 pub fn set_update_time<T>(mut self, v: T) -> Self
14469 where
14470 T: std::convert::Into<wkt::Timestamp>,
14471 {
14472 self.update_time = std::option::Option::Some(v.into());
14473 self
14474 }
14475
14476 /// Sets or clears the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14477 ///
14478 /// # Example
14479 /// ```ignore,no_run
14480 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14481 /// use wkt::Timestamp;
14482 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14483 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
14484 /// ```
14485 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14486 where
14487 T: std::convert::Into<wkt::Timestamp>,
14488 {
14489 self.update_time = v.map(|x| x.into());
14490 self
14491 }
14492
14493 /// Sets the value of [labels][crate::model::InterceptDeploymentGroup::labels].
14494 ///
14495 /// # Example
14496 /// ```ignore,no_run
14497 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14498 /// let x = InterceptDeploymentGroup::new().set_labels([
14499 /// ("key0", "abc"),
14500 /// ("key1", "xyz"),
14501 /// ]);
14502 /// ```
14503 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14504 where
14505 T: std::iter::IntoIterator<Item = (K, V)>,
14506 K: std::convert::Into<std::string::String>,
14507 V: std::convert::Into<std::string::String>,
14508 {
14509 use std::iter::Iterator;
14510 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14511 self
14512 }
14513
14514 /// Sets the value of [network][crate::model::InterceptDeploymentGroup::network].
14515 ///
14516 /// # Example
14517 /// ```ignore,no_run
14518 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14519 /// let x = InterceptDeploymentGroup::new().set_network("example");
14520 /// ```
14521 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14522 self.network = v.into();
14523 self
14524 }
14525
14526 /// Sets the value of [connected_endpoint_groups][crate::model::InterceptDeploymentGroup::connected_endpoint_groups].
14527 ///
14528 /// # Example
14529 /// ```ignore,no_run
14530 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14531 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14532 /// let x = InterceptDeploymentGroup::new()
14533 /// .set_connected_endpoint_groups([
14534 /// ConnectedEndpointGroup::default()/* use setters */,
14535 /// ConnectedEndpointGroup::default()/* use (different) setters */,
14536 /// ]);
14537 /// ```
14538 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
14539 where
14540 T: std::iter::IntoIterator<Item = V>,
14541 V: std::convert::Into<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14542 {
14543 use std::iter::Iterator;
14544 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
14545 self
14546 }
14547
14548 /// Sets the value of [nested_deployments][crate::model::InterceptDeploymentGroup::nested_deployments].
14549 ///
14550 /// # Example
14551 /// ```ignore,no_run
14552 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14553 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14554 /// let x = InterceptDeploymentGroup::new()
14555 /// .set_nested_deployments([
14556 /// Deployment::default()/* use setters */,
14557 /// Deployment::default()/* use (different) setters */,
14558 /// ]);
14559 /// ```
14560 #[deprecated]
14561 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
14562 where
14563 T: std::iter::IntoIterator<Item = V>,
14564 V: std::convert::Into<crate::model::intercept_deployment_group::Deployment>,
14565 {
14566 use std::iter::Iterator;
14567 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
14568 self
14569 }
14570
14571 /// Sets the value of [state][crate::model::InterceptDeploymentGroup::state].
14572 ///
14573 /// # Example
14574 /// ```ignore,no_run
14575 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14576 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::State;
14577 /// let x0 = InterceptDeploymentGroup::new().set_state(State::Active);
14578 /// let x1 = InterceptDeploymentGroup::new().set_state(State::Creating);
14579 /// let x2 = InterceptDeploymentGroup::new().set_state(State::Deleting);
14580 /// ```
14581 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment_group::State>>(
14582 mut self,
14583 v: T,
14584 ) -> Self {
14585 self.state = v.into();
14586 self
14587 }
14588
14589 /// Sets the value of [reconciling][crate::model::InterceptDeploymentGroup::reconciling].
14590 ///
14591 /// # Example
14592 /// ```ignore,no_run
14593 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14594 /// let x = InterceptDeploymentGroup::new().set_reconciling(true);
14595 /// ```
14596 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14597 self.reconciling = v.into();
14598 self
14599 }
14600
14601 /// Sets the value of [description][crate::model::InterceptDeploymentGroup::description].
14602 ///
14603 /// # Example
14604 /// ```ignore,no_run
14605 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14606 /// let x = InterceptDeploymentGroup::new().set_description("example");
14607 /// ```
14608 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14609 self.description = v.into();
14610 self
14611 }
14612
14613 /// Sets the value of [locations][crate::model::InterceptDeploymentGroup::locations].
14614 ///
14615 /// # Example
14616 /// ```ignore,no_run
14617 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14618 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
14619 /// let x = InterceptDeploymentGroup::new()
14620 /// .set_locations([
14621 /// InterceptLocation::default()/* use setters */,
14622 /// InterceptLocation::default()/* use (different) setters */,
14623 /// ]);
14624 /// ```
14625 pub fn set_locations<T, V>(mut self, v: T) -> Self
14626 where
14627 T: std::iter::IntoIterator<Item = V>,
14628 V: std::convert::Into<crate::model::InterceptLocation>,
14629 {
14630 use std::iter::Iterator;
14631 self.locations = v.into_iter().map(|i| i.into()).collect();
14632 self
14633 }
14634}
14635
14636impl wkt::message::Message for InterceptDeploymentGroup {
14637 fn typename() -> &'static str {
14638 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup"
14639 }
14640}
14641
14642/// Defines additional types related to [InterceptDeploymentGroup].
14643pub mod intercept_deployment_group {
14644 #[allow(unused_imports)]
14645 use super::*;
14646
14647 /// An endpoint group connected to this deployment group.
14648 #[derive(Clone, Default, PartialEq)]
14649 #[non_exhaustive]
14650 pub struct ConnectedEndpointGroup {
14651 /// Output only. The connected endpoint group's resource name, for example:
14652 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
14653 /// See <https://google.aip.dev/124>.
14654 pub name: std::string::String,
14655
14656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14657 }
14658
14659 impl ConnectedEndpointGroup {
14660 /// Creates a new default instance.
14661 pub fn new() -> Self {
14662 std::default::Default::default()
14663 }
14664
14665 /// Sets the value of [name][crate::model::intercept_deployment_group::ConnectedEndpointGroup::name].
14666 ///
14667 /// # Example
14668 /// ```ignore,no_run
14669 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14670 /// # let project_id = "project_id";
14671 /// # let location_id = "location_id";
14672 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
14673 /// let x = ConnectedEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
14674 /// ```
14675 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14676 self.name = v.into();
14677 self
14678 }
14679 }
14680
14681 impl wkt::message::Message for ConnectedEndpointGroup {
14682 fn typename() -> &'static str {
14683 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup"
14684 }
14685 }
14686
14687 /// A deployment belonging to this deployment group.
14688 #[derive(Clone, Default, PartialEq)]
14689 #[non_exhaustive]
14690 pub struct Deployment {
14691 /// Output only. The name of the Intercept Deployment, in the format:
14692 /// `projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}`.
14693 pub name: std::string::String,
14694
14695 /// Output only. Most recent known state of the deployment.
14696 pub state: crate::model::intercept_deployment::State,
14697
14698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14699 }
14700
14701 impl Deployment {
14702 /// Creates a new default instance.
14703 pub fn new() -> Self {
14704 std::default::Default::default()
14705 }
14706
14707 /// Sets the value of [name][crate::model::intercept_deployment_group::Deployment::name].
14708 ///
14709 /// # Example
14710 /// ```ignore,no_run
14711 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14712 /// # let project_id = "project_id";
14713 /// # let location_id = "location_id";
14714 /// # let intercept_deployment_id = "intercept_deployment_id";
14715 /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
14716 /// ```
14717 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14718 self.name = v.into();
14719 self
14720 }
14721
14722 /// Sets the value of [state][crate::model::intercept_deployment_group::Deployment::state].
14723 ///
14724 /// # Example
14725 /// ```ignore,no_run
14726 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14727 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
14728 /// let x0 = Deployment::new().set_state(State::Active);
14729 /// let x1 = Deployment::new().set_state(State::Creating);
14730 /// let x2 = Deployment::new().set_state(State::Deleting);
14731 /// ```
14732 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
14733 mut self,
14734 v: T,
14735 ) -> Self {
14736 self.state = v.into();
14737 self
14738 }
14739 }
14740
14741 impl wkt::message::Message for Deployment {
14742 fn typename() -> &'static str {
14743 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment"
14744 }
14745 }
14746
14747 /// The current state of the deployment group.
14748 ///
14749 /// # Working with unknown values
14750 ///
14751 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14752 /// additional enum variants at any time. Adding new variants is not considered
14753 /// a breaking change. Applications should write their code in anticipation of:
14754 ///
14755 /// - New values appearing in future releases of the client library, **and**
14756 /// - New values received dynamically, without application changes.
14757 ///
14758 /// Please consult the [Working with enums] section in the user guide for some
14759 /// guidelines.
14760 ///
14761 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14762 #[derive(Clone, Debug, PartialEq)]
14763 #[non_exhaustive]
14764 pub enum State {
14765 /// State not set (this is not a valid state).
14766 Unspecified,
14767 /// The deployment group is ready.
14768 Active,
14769 /// The deployment group is being created.
14770 Creating,
14771 /// The deployment group is being deleted.
14772 Deleting,
14773 /// If set, the enum was initialized with an unknown value.
14774 ///
14775 /// Applications can examine the value using [State::value] or
14776 /// [State::name].
14777 UnknownValue(state::UnknownValue),
14778 }
14779
14780 #[doc(hidden)]
14781 pub mod state {
14782 #[allow(unused_imports)]
14783 use super::*;
14784 #[derive(Clone, Debug, PartialEq)]
14785 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14786 }
14787
14788 impl State {
14789 /// Gets the enum value.
14790 ///
14791 /// Returns `None` if the enum contains an unknown value deserialized from
14792 /// the string representation of enums.
14793 pub fn value(&self) -> std::option::Option<i32> {
14794 match self {
14795 Self::Unspecified => std::option::Option::Some(0),
14796 Self::Active => std::option::Option::Some(1),
14797 Self::Creating => std::option::Option::Some(2),
14798 Self::Deleting => std::option::Option::Some(3),
14799 Self::UnknownValue(u) => u.0.value(),
14800 }
14801 }
14802
14803 /// Gets the enum value as a string.
14804 ///
14805 /// Returns `None` if the enum contains an unknown value deserialized from
14806 /// the integer representation of enums.
14807 pub fn name(&self) -> std::option::Option<&str> {
14808 match self {
14809 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14810 Self::Active => std::option::Option::Some("ACTIVE"),
14811 Self::Creating => std::option::Option::Some("CREATING"),
14812 Self::Deleting => std::option::Option::Some("DELETING"),
14813 Self::UnknownValue(u) => u.0.name(),
14814 }
14815 }
14816 }
14817
14818 impl std::default::Default for State {
14819 fn default() -> Self {
14820 use std::convert::From;
14821 Self::from(0)
14822 }
14823 }
14824
14825 impl std::fmt::Display for State {
14826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14827 wkt::internal::display_enum(f, self.name(), self.value())
14828 }
14829 }
14830
14831 impl std::convert::From<i32> for State {
14832 fn from(value: i32) -> Self {
14833 match value {
14834 0 => Self::Unspecified,
14835 1 => Self::Active,
14836 2 => Self::Creating,
14837 3 => Self::Deleting,
14838 _ => Self::UnknownValue(state::UnknownValue(
14839 wkt::internal::UnknownEnumValue::Integer(value),
14840 )),
14841 }
14842 }
14843 }
14844
14845 impl std::convert::From<&str> for State {
14846 fn from(value: &str) -> Self {
14847 use std::string::ToString;
14848 match value {
14849 "STATE_UNSPECIFIED" => Self::Unspecified,
14850 "ACTIVE" => Self::Active,
14851 "CREATING" => Self::Creating,
14852 "DELETING" => Self::Deleting,
14853 _ => Self::UnknownValue(state::UnknownValue(
14854 wkt::internal::UnknownEnumValue::String(value.to_string()),
14855 )),
14856 }
14857 }
14858 }
14859
14860 impl serde::ser::Serialize for State {
14861 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14862 where
14863 S: serde::Serializer,
14864 {
14865 match self {
14866 Self::Unspecified => serializer.serialize_i32(0),
14867 Self::Active => serializer.serialize_i32(1),
14868 Self::Creating => serializer.serialize_i32(2),
14869 Self::Deleting => serializer.serialize_i32(3),
14870 Self::UnknownValue(u) => u.0.serialize(serializer),
14871 }
14872 }
14873 }
14874
14875 impl<'de> serde::de::Deserialize<'de> for State {
14876 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14877 where
14878 D: serde::Deserializer<'de>,
14879 {
14880 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14881 ".google.cloud.networksecurity.v1.InterceptDeploymentGroup.State",
14882 ))
14883 }
14884 }
14885}
14886
14887/// Request message for ListInterceptDeploymentGroups.
14888#[derive(Clone, Default, PartialEq)]
14889#[non_exhaustive]
14890pub struct ListInterceptDeploymentGroupsRequest {
14891 /// Required. The parent, which owns this collection of deployment groups.
14892 /// Example: `projects/123456789/locations/global`.
14893 /// See <https://google.aip.dev/132> for more details.
14894 pub parent: std::string::String,
14895
14896 /// Optional. Requested page size. Server may return fewer items than
14897 /// requested. If unspecified, server will pick an appropriate default. See
14898 /// <https://google.aip.dev/158> for more details.
14899 pub page_size: i32,
14900
14901 /// Optional. A page token, received from a previous
14902 /// `ListInterceptDeploymentGroups` call. Provide this to retrieve the
14903 /// subsequent page. When paginating, all other parameters provided to
14904 /// `ListInterceptDeploymentGroups` must match the call that provided the page
14905 /// token. See <https://google.aip.dev/158> for more details.
14906 pub page_token: std::string::String,
14907
14908 /// Optional. Filter expression.
14909 /// See <https://google.aip.dev/160#filtering> for more details.
14910 pub filter: std::string::String,
14911
14912 /// Optional. Sort expression.
14913 /// See <https://google.aip.dev/132#ordering> for more details.
14914 pub order_by: std::string::String,
14915
14916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14917}
14918
14919impl ListInterceptDeploymentGroupsRequest {
14920 /// Creates a new default instance.
14921 pub fn new() -> Self {
14922 std::default::Default::default()
14923 }
14924
14925 /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
14926 ///
14927 /// # Example
14928 /// ```ignore,no_run
14929 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14930 /// # let project_id = "project_id";
14931 /// # let location_id = "location_id";
14932 /// let x = ListInterceptDeploymentGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
14933 /// ```
14934 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14935 self.parent = v.into();
14936 self
14937 }
14938
14939 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
14940 ///
14941 /// # Example
14942 /// ```ignore,no_run
14943 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14944 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_size(42);
14945 /// ```
14946 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14947 self.page_size = v.into();
14948 self
14949 }
14950
14951 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
14952 ///
14953 /// # Example
14954 /// ```ignore,no_run
14955 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14956 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_token("example");
14957 /// ```
14958 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14959 self.page_token = v.into();
14960 self
14961 }
14962
14963 /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
14964 ///
14965 /// # Example
14966 /// ```ignore,no_run
14967 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14968 /// let x = ListInterceptDeploymentGroupsRequest::new().set_filter("example");
14969 /// ```
14970 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14971 self.filter = v.into();
14972 self
14973 }
14974
14975 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
14976 ///
14977 /// # Example
14978 /// ```ignore,no_run
14979 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14980 /// let x = ListInterceptDeploymentGroupsRequest::new().set_order_by("example");
14981 /// ```
14982 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14983 self.order_by = v.into();
14984 self
14985 }
14986}
14987
14988impl wkt::message::Message for ListInterceptDeploymentGroupsRequest {
14989 fn typename() -> &'static str {
14990 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest"
14991 }
14992}
14993
14994/// Response message for ListInterceptDeploymentGroups.
14995#[derive(Clone, Default, PartialEq)]
14996#[non_exhaustive]
14997pub struct ListInterceptDeploymentGroupsResponse {
14998 /// The deployment groups from the specified parent.
14999 pub intercept_deployment_groups: std::vec::Vec<crate::model::InterceptDeploymentGroup>,
15000
15001 /// A token that can be sent as `page_token` to retrieve the next page.
15002 /// If this field is omitted, there are no subsequent pages.
15003 /// See <https://google.aip.dev/158> for more details.
15004 pub next_page_token: std::string::String,
15005
15006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15007}
15008
15009impl ListInterceptDeploymentGroupsResponse {
15010 /// Creates a new default instance.
15011 pub fn new() -> Self {
15012 std::default::Default::default()
15013 }
15014
15015 /// Sets the value of [intercept_deployment_groups][crate::model::ListInterceptDeploymentGroupsResponse::intercept_deployment_groups].
15016 ///
15017 /// # Example
15018 /// ```ignore,no_run
15019 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
15020 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15021 /// let x = ListInterceptDeploymentGroupsResponse::new()
15022 /// .set_intercept_deployment_groups([
15023 /// InterceptDeploymentGroup::default()/* use setters */,
15024 /// InterceptDeploymentGroup::default()/* use (different) setters */,
15025 /// ]);
15026 /// ```
15027 pub fn set_intercept_deployment_groups<T, V>(mut self, v: T) -> Self
15028 where
15029 T: std::iter::IntoIterator<Item = V>,
15030 V: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15031 {
15032 use std::iter::Iterator;
15033 self.intercept_deployment_groups = v.into_iter().map(|i| i.into()).collect();
15034 self
15035 }
15036
15037 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentGroupsResponse::next_page_token].
15038 ///
15039 /// # Example
15040 /// ```ignore,no_run
15041 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
15042 /// let x = ListInterceptDeploymentGroupsResponse::new().set_next_page_token("example");
15043 /// ```
15044 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15045 self.next_page_token = v.into();
15046 self
15047 }
15048}
15049
15050impl wkt::message::Message for ListInterceptDeploymentGroupsResponse {
15051 fn typename() -> &'static str {
15052 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse"
15053 }
15054}
15055
15056#[doc(hidden)]
15057impl google_cloud_gax::paginator::internal::PageableResponse
15058 for ListInterceptDeploymentGroupsResponse
15059{
15060 type PageItem = crate::model::InterceptDeploymentGroup;
15061
15062 fn items(self) -> std::vec::Vec<Self::PageItem> {
15063 self.intercept_deployment_groups
15064 }
15065
15066 fn next_page_token(&self) -> std::string::String {
15067 use std::clone::Clone;
15068 self.next_page_token.clone()
15069 }
15070}
15071
15072/// Request message for GetInterceptDeploymentGroup.
15073#[derive(Clone, Default, PartialEq)]
15074#[non_exhaustive]
15075pub struct GetInterceptDeploymentGroupRequest {
15076 /// Required. The name of the deployment group to retrieve.
15077 /// Format:
15078 /// projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}
15079 pub name: std::string::String,
15080
15081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15082}
15083
15084impl GetInterceptDeploymentGroupRequest {
15085 /// Creates a new default instance.
15086 pub fn new() -> Self {
15087 std::default::Default::default()
15088 }
15089
15090 /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
15091 ///
15092 /// # Example
15093 /// ```ignore,no_run
15094 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentGroupRequest;
15095 /// # let project_id = "project_id";
15096 /// # let location_id = "location_id";
15097 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15098 /// let x = GetInterceptDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15099 /// ```
15100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15101 self.name = v.into();
15102 self
15103 }
15104}
15105
15106impl wkt::message::Message for GetInterceptDeploymentGroupRequest {
15107 fn typename() -> &'static str {
15108 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest"
15109 }
15110}
15111
15112/// Request message for CreateInterceptDeploymentGroup.
15113#[derive(Clone, Default, PartialEq)]
15114#[non_exhaustive]
15115pub struct CreateInterceptDeploymentGroupRequest {
15116 /// Required. The parent resource where this deployment group will be created.
15117 /// Format: projects/{project}/locations/{location}
15118 pub parent: std::string::String,
15119
15120 /// Required. The ID to use for the new deployment group, which will become the
15121 /// final component of the deployment group's resource name.
15122 pub intercept_deployment_group_id: std::string::String,
15123
15124 /// Required. The deployment group to create.
15125 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
15126
15127 /// Optional. A unique identifier for this request. Must be a UUID4.
15128 /// This request is only idempotent if a `request_id` is provided.
15129 /// See <https://google.aip.dev/155> for more details.
15130 pub request_id: std::string::String,
15131
15132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15133}
15134
15135impl CreateInterceptDeploymentGroupRequest {
15136 /// Creates a new default instance.
15137 pub fn new() -> Self {
15138 std::default::Default::default()
15139 }
15140
15141 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
15142 ///
15143 /// # Example
15144 /// ```ignore,no_run
15145 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15146 /// # let project_id = "project_id";
15147 /// # let location_id = "location_id";
15148 /// let x = CreateInterceptDeploymentGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
15149 /// ```
15150 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15151 self.parent = v.into();
15152 self
15153 }
15154
15155 /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
15156 ///
15157 /// # Example
15158 /// ```ignore,no_run
15159 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15160 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group_id("example");
15161 /// ```
15162 pub fn set_intercept_deployment_group_id<T: std::convert::Into<std::string::String>>(
15163 mut self,
15164 v: T,
15165 ) -> Self {
15166 self.intercept_deployment_group_id = v.into();
15167 self
15168 }
15169
15170 /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
15171 ///
15172 /// # Example
15173 /// ```ignore,no_run
15174 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15175 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15176 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
15177 /// ```
15178 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
15179 where
15180 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15181 {
15182 self.intercept_deployment_group = std::option::Option::Some(v.into());
15183 self
15184 }
15185
15186 /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
15187 ///
15188 /// # Example
15189 /// ```ignore,no_run
15190 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15191 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15192 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
15193 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
15194 /// ```
15195 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
15196 where
15197 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15198 {
15199 self.intercept_deployment_group = v.map(|x| x.into());
15200 self
15201 }
15202
15203 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
15204 ///
15205 /// # Example
15206 /// ```ignore,no_run
15207 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
15208 /// let x = CreateInterceptDeploymentGroupRequest::new().set_request_id("example");
15209 /// ```
15210 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15211 self.request_id = v.into();
15212 self
15213 }
15214}
15215
15216impl wkt::message::Message for CreateInterceptDeploymentGroupRequest {
15217 fn typename() -> &'static str {
15218 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest"
15219 }
15220}
15221
15222/// Request message for UpdateInterceptDeploymentGroup.
15223#[derive(Clone, Default, PartialEq)]
15224#[non_exhaustive]
15225pub struct UpdateInterceptDeploymentGroupRequest {
15226 /// Optional. The list of fields to update.
15227 /// Fields are specified relative to the deployment group
15228 /// (e.g. `description`; *not*
15229 /// `intercept_deployment_group.description`). See
15230 /// <https://google.aip.dev/161> for more details.
15231 pub update_mask: std::option::Option<wkt::FieldMask>,
15232
15233 /// Required. The deployment group to update.
15234 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
15235
15236 /// Optional. A unique identifier for this request. Must be a UUID4.
15237 /// This request is only idempotent if a `request_id` is provided.
15238 /// See <https://google.aip.dev/155> for more details.
15239 pub request_id: std::string::String,
15240
15241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15242}
15243
15244impl UpdateInterceptDeploymentGroupRequest {
15245 /// Creates a new default instance.
15246 pub fn new() -> Self {
15247 std::default::Default::default()
15248 }
15249
15250 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
15251 ///
15252 /// # Example
15253 /// ```ignore,no_run
15254 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15255 /// use wkt::FieldMask;
15256 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15257 /// ```
15258 pub fn set_update_mask<T>(mut self, v: T) -> Self
15259 where
15260 T: std::convert::Into<wkt::FieldMask>,
15261 {
15262 self.update_mask = std::option::Option::Some(v.into());
15263 self
15264 }
15265
15266 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
15267 ///
15268 /// # Example
15269 /// ```ignore,no_run
15270 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15271 /// use wkt::FieldMask;
15272 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15273 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15274 /// ```
15275 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15276 where
15277 T: std::convert::Into<wkt::FieldMask>,
15278 {
15279 self.update_mask = v.map(|x| x.into());
15280 self
15281 }
15282
15283 /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15284 ///
15285 /// # Example
15286 /// ```ignore,no_run
15287 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15288 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15289 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
15290 /// ```
15291 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
15292 where
15293 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15294 {
15295 self.intercept_deployment_group = std::option::Option::Some(v.into());
15296 self
15297 }
15298
15299 /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
15300 ///
15301 /// # Example
15302 /// ```ignore,no_run
15303 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15304 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
15305 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
15306 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
15307 /// ```
15308 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
15309 where
15310 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
15311 {
15312 self.intercept_deployment_group = v.map(|x| x.into());
15313 self
15314 }
15315
15316 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
15317 ///
15318 /// # Example
15319 /// ```ignore,no_run
15320 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
15321 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_request_id("example");
15322 /// ```
15323 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15324 self.request_id = v.into();
15325 self
15326 }
15327}
15328
15329impl wkt::message::Message for UpdateInterceptDeploymentGroupRequest {
15330 fn typename() -> &'static str {
15331 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest"
15332 }
15333}
15334
15335/// Request message for DeleteInterceptDeploymentGroup.
15336#[derive(Clone, Default, PartialEq)]
15337#[non_exhaustive]
15338pub struct DeleteInterceptDeploymentGroupRequest {
15339 /// Required. The deployment group to delete.
15340 pub name: std::string::String,
15341
15342 /// Optional. A unique identifier for this request. Must be a UUID4.
15343 /// This request is only idempotent if a `request_id` is provided.
15344 /// See <https://google.aip.dev/155> for more details.
15345 pub request_id: std::string::String,
15346
15347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15348}
15349
15350impl DeleteInterceptDeploymentGroupRequest {
15351 /// Creates a new default instance.
15352 pub fn new() -> Self {
15353 std::default::Default::default()
15354 }
15355
15356 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
15357 ///
15358 /// # Example
15359 /// ```ignore,no_run
15360 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15361 /// # let project_id = "project_id";
15362 /// # let location_id = "location_id";
15363 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15364 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15365 /// ```
15366 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15367 self.name = v.into();
15368 self
15369 }
15370
15371 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
15372 ///
15373 /// # Example
15374 /// ```ignore,no_run
15375 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
15376 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_request_id("example");
15377 /// ```
15378 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15379 self.request_id = v.into();
15380 self
15381 }
15382}
15383
15384impl wkt::message::Message for DeleteInterceptDeploymentGroupRequest {
15385 fn typename() -> &'static str {
15386 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest"
15387 }
15388}
15389
15390/// A deployment represents a zonal intercept backend ready to accept
15391/// GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an
15392/// internal passthrough load balancer. Deployments are always part of a
15393/// global deployment group which represents a global intercept service.
15394#[derive(Clone, Default, PartialEq)]
15395#[non_exhaustive]
15396pub struct InterceptDeployment {
15397 /// Immutable. Identifier. The resource name of this deployment, for example:
15398 /// `projects/123456789/locations/us-central1-a/interceptDeployments/my-dep`.
15399 /// See <https://google.aip.dev/122> for more details.
15400 pub name: std::string::String,
15401
15402 /// Output only. The timestamp when the resource was created.
15403 /// See <https://google.aip.dev/148#timestamps>.
15404 pub create_time: std::option::Option<wkt::Timestamp>,
15405
15406 /// Output only. The timestamp when the resource was most recently updated.
15407 /// See <https://google.aip.dev/148#timestamps>.
15408 pub update_time: std::option::Option<wkt::Timestamp>,
15409
15410 /// Optional. Labels are key/value pairs that help to organize and filter
15411 /// resources.
15412 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15413
15414 /// Required. Immutable. The regional forwarding rule that fronts the
15415 /// interceptors, for example:
15416 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`.
15417 /// See <https://google.aip.dev/124>.
15418 pub forwarding_rule: std::string::String,
15419
15420 /// Required. Immutable. The deployment group that this deployment is a part
15421 /// of, for example:
15422 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
15423 /// See <https://google.aip.dev/124>.
15424 pub intercept_deployment_group: std::string::String,
15425
15426 /// Output only. The current state of the deployment.
15427 /// See <https://google.aip.dev/216>.
15428 pub state: crate::model::intercept_deployment::State,
15429
15430 /// Output only. The current state of the resource does not match the user's
15431 /// intended state, and the system is working to reconcile them. This part of
15432 /// the normal operation (e.g. linking a new association to the parent group).
15433 /// See <https://google.aip.dev/128>.
15434 pub reconciling: bool,
15435
15436 /// Optional. User-provided description of the deployment.
15437 /// Used as additional context for the deployment.
15438 pub description: std::string::String,
15439
15440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15441}
15442
15443impl InterceptDeployment {
15444 /// Creates a new default instance.
15445 pub fn new() -> Self {
15446 std::default::Default::default()
15447 }
15448
15449 /// Sets the value of [name][crate::model::InterceptDeployment::name].
15450 ///
15451 /// # Example
15452 /// ```ignore,no_run
15453 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15454 /// # let project_id = "project_id";
15455 /// # let location_id = "location_id";
15456 /// # let intercept_deployment_id = "intercept_deployment_id";
15457 /// let x = InterceptDeployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
15458 /// ```
15459 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15460 self.name = v.into();
15461 self
15462 }
15463
15464 /// Sets the value of [create_time][crate::model::InterceptDeployment::create_time].
15465 ///
15466 /// # Example
15467 /// ```ignore,no_run
15468 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15469 /// use wkt::Timestamp;
15470 /// let x = InterceptDeployment::new().set_create_time(Timestamp::default()/* use setters */);
15471 /// ```
15472 pub fn set_create_time<T>(mut self, v: T) -> Self
15473 where
15474 T: std::convert::Into<wkt::Timestamp>,
15475 {
15476 self.create_time = std::option::Option::Some(v.into());
15477 self
15478 }
15479
15480 /// Sets or clears the value of [create_time][crate::model::InterceptDeployment::create_time].
15481 ///
15482 /// # Example
15483 /// ```ignore,no_run
15484 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15485 /// use wkt::Timestamp;
15486 /// let x = InterceptDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15487 /// let x = InterceptDeployment::new().set_or_clear_create_time(None::<Timestamp>);
15488 /// ```
15489 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15490 where
15491 T: std::convert::Into<wkt::Timestamp>,
15492 {
15493 self.create_time = v.map(|x| x.into());
15494 self
15495 }
15496
15497 /// Sets the value of [update_time][crate::model::InterceptDeployment::update_time].
15498 ///
15499 /// # Example
15500 /// ```ignore,no_run
15501 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15502 /// use wkt::Timestamp;
15503 /// let x = InterceptDeployment::new().set_update_time(Timestamp::default()/* use setters */);
15504 /// ```
15505 pub fn set_update_time<T>(mut self, v: T) -> Self
15506 where
15507 T: std::convert::Into<wkt::Timestamp>,
15508 {
15509 self.update_time = std::option::Option::Some(v.into());
15510 self
15511 }
15512
15513 /// Sets or clears the value of [update_time][crate::model::InterceptDeployment::update_time].
15514 ///
15515 /// # Example
15516 /// ```ignore,no_run
15517 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15518 /// use wkt::Timestamp;
15519 /// let x = InterceptDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15520 /// let x = InterceptDeployment::new().set_or_clear_update_time(None::<Timestamp>);
15521 /// ```
15522 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15523 where
15524 T: std::convert::Into<wkt::Timestamp>,
15525 {
15526 self.update_time = v.map(|x| x.into());
15527 self
15528 }
15529
15530 /// Sets the value of [labels][crate::model::InterceptDeployment::labels].
15531 ///
15532 /// # Example
15533 /// ```ignore,no_run
15534 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15535 /// let x = InterceptDeployment::new().set_labels([
15536 /// ("key0", "abc"),
15537 /// ("key1", "xyz"),
15538 /// ]);
15539 /// ```
15540 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15541 where
15542 T: std::iter::IntoIterator<Item = (K, V)>,
15543 K: std::convert::Into<std::string::String>,
15544 V: std::convert::Into<std::string::String>,
15545 {
15546 use std::iter::Iterator;
15547 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15548 self
15549 }
15550
15551 /// Sets the value of [forwarding_rule][crate::model::InterceptDeployment::forwarding_rule].
15552 ///
15553 /// # Example
15554 /// ```ignore,no_run
15555 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15556 /// let x = InterceptDeployment::new().set_forwarding_rule("example");
15557 /// ```
15558 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15559 self.forwarding_rule = v.into();
15560 self
15561 }
15562
15563 /// Sets the value of [intercept_deployment_group][crate::model::InterceptDeployment::intercept_deployment_group].
15564 ///
15565 /// # Example
15566 /// ```ignore,no_run
15567 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15568 /// # let project_id = "project_id";
15569 /// # let location_id = "location_id";
15570 /// # let intercept_deployment_group_id = "intercept_deployment_group_id";
15571 /// let x = InterceptDeployment::new().set_intercept_deployment_group(format!("projects/{project_id}/locations/{location_id}/interceptDeploymentGroups/{intercept_deployment_group_id}"));
15572 /// ```
15573 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
15574 mut self,
15575 v: T,
15576 ) -> Self {
15577 self.intercept_deployment_group = v.into();
15578 self
15579 }
15580
15581 /// Sets the value of [state][crate::model::InterceptDeployment::state].
15582 ///
15583 /// # Example
15584 /// ```ignore,no_run
15585 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15586 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
15587 /// let x0 = InterceptDeployment::new().set_state(State::Active);
15588 /// let x1 = InterceptDeployment::new().set_state(State::Creating);
15589 /// let x2 = InterceptDeployment::new().set_state(State::Deleting);
15590 /// ```
15591 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
15592 mut self,
15593 v: T,
15594 ) -> Self {
15595 self.state = v.into();
15596 self
15597 }
15598
15599 /// Sets the value of [reconciling][crate::model::InterceptDeployment::reconciling].
15600 ///
15601 /// # Example
15602 /// ```ignore,no_run
15603 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15604 /// let x = InterceptDeployment::new().set_reconciling(true);
15605 /// ```
15606 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15607 self.reconciling = v.into();
15608 self
15609 }
15610
15611 /// Sets the value of [description][crate::model::InterceptDeployment::description].
15612 ///
15613 /// # Example
15614 /// ```ignore,no_run
15615 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15616 /// let x = InterceptDeployment::new().set_description("example");
15617 /// ```
15618 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15619 self.description = v.into();
15620 self
15621 }
15622}
15623
15624impl wkt::message::Message for InterceptDeployment {
15625 fn typename() -> &'static str {
15626 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeployment"
15627 }
15628}
15629
15630/// Defines additional types related to [InterceptDeployment].
15631pub mod intercept_deployment {
15632 #[allow(unused_imports)]
15633 use super::*;
15634
15635 /// The current state of the deployment.
15636 ///
15637 /// # Working with unknown values
15638 ///
15639 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15640 /// additional enum variants at any time. Adding new variants is not considered
15641 /// a breaking change. Applications should write their code in anticipation of:
15642 ///
15643 /// - New values appearing in future releases of the client library, **and**
15644 /// - New values received dynamically, without application changes.
15645 ///
15646 /// Please consult the [Working with enums] section in the user guide for some
15647 /// guidelines.
15648 ///
15649 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15650 #[derive(Clone, Debug, PartialEq)]
15651 #[non_exhaustive]
15652 pub enum State {
15653 /// State not set (this is not a valid state).
15654 Unspecified,
15655 /// The deployment is ready and in sync with the parent group.
15656 Active,
15657 /// The deployment is being created.
15658 Creating,
15659 /// The deployment is being deleted.
15660 Deleting,
15661 /// The deployment is out of sync with the parent group.
15662 /// In most cases, this is a result of a transient issue within the system
15663 /// (e.g. a delayed data-path config) and the system is expected to recover
15664 /// automatically. See the parent deployment group's state for more details.
15665 OutOfSync,
15666 /// An attempt to delete the deployment has failed. This is a terminal state
15667 /// and the deployment is not expected to recover. The only permitted
15668 /// operation is to retry deleting the deployment.
15669 DeleteFailed,
15670 /// If set, the enum was initialized with an unknown value.
15671 ///
15672 /// Applications can examine the value using [State::value] or
15673 /// [State::name].
15674 UnknownValue(state::UnknownValue),
15675 }
15676
15677 #[doc(hidden)]
15678 pub mod state {
15679 #[allow(unused_imports)]
15680 use super::*;
15681 #[derive(Clone, Debug, PartialEq)]
15682 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15683 }
15684
15685 impl State {
15686 /// Gets the enum value.
15687 ///
15688 /// Returns `None` if the enum contains an unknown value deserialized from
15689 /// the string representation of enums.
15690 pub fn value(&self) -> std::option::Option<i32> {
15691 match self {
15692 Self::Unspecified => std::option::Option::Some(0),
15693 Self::Active => std::option::Option::Some(1),
15694 Self::Creating => std::option::Option::Some(2),
15695 Self::Deleting => std::option::Option::Some(3),
15696 Self::OutOfSync => std::option::Option::Some(4),
15697 Self::DeleteFailed => std::option::Option::Some(5),
15698 Self::UnknownValue(u) => u.0.value(),
15699 }
15700 }
15701
15702 /// Gets the enum value as a string.
15703 ///
15704 /// Returns `None` if the enum contains an unknown value deserialized from
15705 /// the integer representation of enums.
15706 pub fn name(&self) -> std::option::Option<&str> {
15707 match self {
15708 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15709 Self::Active => std::option::Option::Some("ACTIVE"),
15710 Self::Creating => std::option::Option::Some("CREATING"),
15711 Self::Deleting => std::option::Option::Some("DELETING"),
15712 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
15713 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
15714 Self::UnknownValue(u) => u.0.name(),
15715 }
15716 }
15717 }
15718
15719 impl std::default::Default for State {
15720 fn default() -> Self {
15721 use std::convert::From;
15722 Self::from(0)
15723 }
15724 }
15725
15726 impl std::fmt::Display for State {
15727 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15728 wkt::internal::display_enum(f, self.name(), self.value())
15729 }
15730 }
15731
15732 impl std::convert::From<i32> for State {
15733 fn from(value: i32) -> Self {
15734 match value {
15735 0 => Self::Unspecified,
15736 1 => Self::Active,
15737 2 => Self::Creating,
15738 3 => Self::Deleting,
15739 4 => Self::OutOfSync,
15740 5 => Self::DeleteFailed,
15741 _ => Self::UnknownValue(state::UnknownValue(
15742 wkt::internal::UnknownEnumValue::Integer(value),
15743 )),
15744 }
15745 }
15746 }
15747
15748 impl std::convert::From<&str> for State {
15749 fn from(value: &str) -> Self {
15750 use std::string::ToString;
15751 match value {
15752 "STATE_UNSPECIFIED" => Self::Unspecified,
15753 "ACTIVE" => Self::Active,
15754 "CREATING" => Self::Creating,
15755 "DELETING" => Self::Deleting,
15756 "OUT_OF_SYNC" => Self::OutOfSync,
15757 "DELETE_FAILED" => Self::DeleteFailed,
15758 _ => Self::UnknownValue(state::UnknownValue(
15759 wkt::internal::UnknownEnumValue::String(value.to_string()),
15760 )),
15761 }
15762 }
15763 }
15764
15765 impl serde::ser::Serialize for State {
15766 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15767 where
15768 S: serde::Serializer,
15769 {
15770 match self {
15771 Self::Unspecified => serializer.serialize_i32(0),
15772 Self::Active => serializer.serialize_i32(1),
15773 Self::Creating => serializer.serialize_i32(2),
15774 Self::Deleting => serializer.serialize_i32(3),
15775 Self::OutOfSync => serializer.serialize_i32(4),
15776 Self::DeleteFailed => serializer.serialize_i32(5),
15777 Self::UnknownValue(u) => u.0.serialize(serializer),
15778 }
15779 }
15780 }
15781
15782 impl<'de> serde::de::Deserialize<'de> for State {
15783 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15784 where
15785 D: serde::Deserializer<'de>,
15786 {
15787 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15788 ".google.cloud.networksecurity.v1.InterceptDeployment.State",
15789 ))
15790 }
15791 }
15792}
15793
15794/// Request message for ListInterceptDeployments.
15795#[derive(Clone, Default, PartialEq)]
15796#[non_exhaustive]
15797pub struct ListInterceptDeploymentsRequest {
15798 /// Required. The parent, which owns this collection of deployments.
15799 /// Example: `projects/123456789/locations/us-central1-a`.
15800 /// See <https://google.aip.dev/132> for more details.
15801 pub parent: std::string::String,
15802
15803 /// Optional. Requested page size. Server may return fewer items than
15804 /// requested. If unspecified, server will pick an appropriate default. See
15805 /// <https://google.aip.dev/158> for more details.
15806 pub page_size: i32,
15807
15808 /// Optional. A page token, received from a previous `ListInterceptDeployments`
15809 /// call. Provide this to retrieve the subsequent page. When paginating, all
15810 /// other parameters provided to `ListInterceptDeployments` must match the call
15811 /// that provided the page token. See <https://google.aip.dev/158> for more
15812 /// details.
15813 pub page_token: std::string::String,
15814
15815 /// Optional. Filter expression.
15816 /// See <https://google.aip.dev/160#filtering> for more details.
15817 pub filter: std::string::String,
15818
15819 /// Optional. Sort expression.
15820 /// See <https://google.aip.dev/132#ordering> for more details.
15821 pub order_by: std::string::String,
15822
15823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15824}
15825
15826impl ListInterceptDeploymentsRequest {
15827 /// Creates a new default instance.
15828 pub fn new() -> Self {
15829 std::default::Default::default()
15830 }
15831
15832 /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
15833 ///
15834 /// # Example
15835 /// ```ignore,no_run
15836 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15837 /// # let project_id = "project_id";
15838 /// # let location_id = "location_id";
15839 /// let x = ListInterceptDeploymentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
15840 /// ```
15841 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15842 self.parent = v.into();
15843 self
15844 }
15845
15846 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
15847 ///
15848 /// # Example
15849 /// ```ignore,no_run
15850 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15851 /// let x = ListInterceptDeploymentsRequest::new().set_page_size(42);
15852 /// ```
15853 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15854 self.page_size = v.into();
15855 self
15856 }
15857
15858 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
15859 ///
15860 /// # Example
15861 /// ```ignore,no_run
15862 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15863 /// let x = ListInterceptDeploymentsRequest::new().set_page_token("example");
15864 /// ```
15865 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15866 self.page_token = v.into();
15867 self
15868 }
15869
15870 /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
15871 ///
15872 /// # Example
15873 /// ```ignore,no_run
15874 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15875 /// let x = ListInterceptDeploymentsRequest::new().set_filter("example");
15876 /// ```
15877 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15878 self.filter = v.into();
15879 self
15880 }
15881
15882 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
15883 ///
15884 /// # Example
15885 /// ```ignore,no_run
15886 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15887 /// let x = ListInterceptDeploymentsRequest::new().set_order_by("example");
15888 /// ```
15889 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15890 self.order_by = v.into();
15891 self
15892 }
15893}
15894
15895impl wkt::message::Message for ListInterceptDeploymentsRequest {
15896 fn typename() -> &'static str {
15897 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest"
15898 }
15899}
15900
15901/// Response message for ListInterceptDeployments.
15902#[derive(Clone, Default, PartialEq)]
15903#[non_exhaustive]
15904pub struct ListInterceptDeploymentsResponse {
15905 /// The deployments from the specified parent.
15906 pub intercept_deployments: std::vec::Vec<crate::model::InterceptDeployment>,
15907
15908 /// A token that can be sent as `page_token` to retrieve the next page.
15909 /// If this field is omitted, there are no subsequent pages.
15910 /// See <https://google.aip.dev/158> for more details.
15911 pub next_page_token: std::string::String,
15912
15913 /// Locations that could not be reached.
15914 pub unreachable: std::vec::Vec<std::string::String>,
15915
15916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15917}
15918
15919impl ListInterceptDeploymentsResponse {
15920 /// Creates a new default instance.
15921 pub fn new() -> Self {
15922 std::default::Default::default()
15923 }
15924
15925 /// Sets the value of [intercept_deployments][crate::model::ListInterceptDeploymentsResponse::intercept_deployments].
15926 ///
15927 /// # Example
15928 /// ```ignore,no_run
15929 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15930 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15931 /// let x = ListInterceptDeploymentsResponse::new()
15932 /// .set_intercept_deployments([
15933 /// InterceptDeployment::default()/* use setters */,
15934 /// InterceptDeployment::default()/* use (different) setters */,
15935 /// ]);
15936 /// ```
15937 pub fn set_intercept_deployments<T, V>(mut self, v: T) -> Self
15938 where
15939 T: std::iter::IntoIterator<Item = V>,
15940 V: std::convert::Into<crate::model::InterceptDeployment>,
15941 {
15942 use std::iter::Iterator;
15943 self.intercept_deployments = v.into_iter().map(|i| i.into()).collect();
15944 self
15945 }
15946
15947 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentsResponse::next_page_token].
15948 ///
15949 /// # Example
15950 /// ```ignore,no_run
15951 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15952 /// let x = ListInterceptDeploymentsResponse::new().set_next_page_token("example");
15953 /// ```
15954 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15955 self.next_page_token = v.into();
15956 self
15957 }
15958
15959 /// Sets the value of [unreachable][crate::model::ListInterceptDeploymentsResponse::unreachable].
15960 ///
15961 /// # Example
15962 /// ```ignore,no_run
15963 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15964 /// let x = ListInterceptDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
15965 /// ```
15966 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15967 where
15968 T: std::iter::IntoIterator<Item = V>,
15969 V: std::convert::Into<std::string::String>,
15970 {
15971 use std::iter::Iterator;
15972 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15973 self
15974 }
15975}
15976
15977impl wkt::message::Message for ListInterceptDeploymentsResponse {
15978 fn typename() -> &'static str {
15979 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse"
15980 }
15981}
15982
15983#[doc(hidden)]
15984impl google_cloud_gax::paginator::internal::PageableResponse for ListInterceptDeploymentsResponse {
15985 type PageItem = crate::model::InterceptDeployment;
15986
15987 fn items(self) -> std::vec::Vec<Self::PageItem> {
15988 self.intercept_deployments
15989 }
15990
15991 fn next_page_token(&self) -> std::string::String {
15992 use std::clone::Clone;
15993 self.next_page_token.clone()
15994 }
15995}
15996
15997/// Request message for GetInterceptDeployment.
15998#[derive(Clone, Default, PartialEq)]
15999#[non_exhaustive]
16000pub struct GetInterceptDeploymentRequest {
16001 /// Required. The name of the deployment to retrieve.
16002 /// Format:
16003 /// projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}
16004 pub name: std::string::String,
16005
16006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16007}
16008
16009impl GetInterceptDeploymentRequest {
16010 /// Creates a new default instance.
16011 pub fn new() -> Self {
16012 std::default::Default::default()
16013 }
16014
16015 /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
16016 ///
16017 /// # Example
16018 /// ```ignore,no_run
16019 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentRequest;
16020 /// # let project_id = "project_id";
16021 /// # let location_id = "location_id";
16022 /// # let intercept_deployment_id = "intercept_deployment_id";
16023 /// let x = GetInterceptDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
16024 /// ```
16025 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16026 self.name = v.into();
16027 self
16028 }
16029}
16030
16031impl wkt::message::Message for GetInterceptDeploymentRequest {
16032 fn typename() -> &'static str {
16033 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentRequest"
16034 }
16035}
16036
16037/// Request message for CreateInterceptDeployment.
16038#[derive(Clone, Default, PartialEq)]
16039#[non_exhaustive]
16040pub struct CreateInterceptDeploymentRequest {
16041 /// Required. The parent resource where this deployment will be created.
16042 /// Format: projects/{project}/locations/{location}
16043 pub parent: std::string::String,
16044
16045 /// Required. The ID to use for the new deployment, which will become the final
16046 /// component of the deployment's resource name.
16047 pub intercept_deployment_id: std::string::String,
16048
16049 /// Required. The deployment to create.
16050 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
16051
16052 /// Optional. A unique identifier for this request. Must be a UUID4.
16053 /// This request is only idempotent if a `request_id` is provided.
16054 /// See <https://google.aip.dev/155> for more details.
16055 pub request_id: std::string::String,
16056
16057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16058}
16059
16060impl CreateInterceptDeploymentRequest {
16061 /// Creates a new default instance.
16062 pub fn new() -> Self {
16063 std::default::Default::default()
16064 }
16065
16066 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
16067 ///
16068 /// # Example
16069 /// ```ignore,no_run
16070 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16071 /// # let project_id = "project_id";
16072 /// # let location_id = "location_id";
16073 /// let x = CreateInterceptDeploymentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16074 /// ```
16075 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16076 self.parent = v.into();
16077 self
16078 }
16079
16080 /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
16081 ///
16082 /// # Example
16083 /// ```ignore,no_run
16084 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16085 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment_id("example");
16086 /// ```
16087 pub fn set_intercept_deployment_id<T: std::convert::Into<std::string::String>>(
16088 mut self,
16089 v: T,
16090 ) -> Self {
16091 self.intercept_deployment_id = v.into();
16092 self
16093 }
16094
16095 /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
16096 ///
16097 /// # Example
16098 /// ```ignore,no_run
16099 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16100 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16101 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
16102 /// ```
16103 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
16104 where
16105 T: std::convert::Into<crate::model::InterceptDeployment>,
16106 {
16107 self.intercept_deployment = std::option::Option::Some(v.into());
16108 self
16109 }
16110
16111 /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
16112 ///
16113 /// # Example
16114 /// ```ignore,no_run
16115 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16116 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16117 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
16118 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
16119 /// ```
16120 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
16121 where
16122 T: std::convert::Into<crate::model::InterceptDeployment>,
16123 {
16124 self.intercept_deployment = v.map(|x| x.into());
16125 self
16126 }
16127
16128 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
16129 ///
16130 /// # Example
16131 /// ```ignore,no_run
16132 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
16133 /// let x = CreateInterceptDeploymentRequest::new().set_request_id("example");
16134 /// ```
16135 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16136 self.request_id = v.into();
16137 self
16138 }
16139}
16140
16141impl wkt::message::Message for CreateInterceptDeploymentRequest {
16142 fn typename() -> &'static str {
16143 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest"
16144 }
16145}
16146
16147/// Request message for UpdateInterceptDeployment.
16148#[derive(Clone, Default, PartialEq)]
16149#[non_exhaustive]
16150pub struct UpdateInterceptDeploymentRequest {
16151 /// Optional. The list of fields to update.
16152 /// Fields are specified relative to the deployment
16153 /// (e.g. `description`; *not* `intercept_deployment.description`).
16154 /// See <https://google.aip.dev/161> for more details.
16155 pub update_mask: std::option::Option<wkt::FieldMask>,
16156
16157 /// Required. The deployment to update.
16158 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
16159
16160 /// Optional. A unique identifier for this request. Must be a UUID4.
16161 /// This request is only idempotent if a `request_id` is provided.
16162 /// See <https://google.aip.dev/155> for more details.
16163 pub request_id: std::string::String,
16164
16165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16166}
16167
16168impl UpdateInterceptDeploymentRequest {
16169 /// Creates a new default instance.
16170 pub fn new() -> Self {
16171 std::default::Default::default()
16172 }
16173
16174 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
16175 ///
16176 /// # Example
16177 /// ```ignore,no_run
16178 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16179 /// use wkt::FieldMask;
16180 /// let x = UpdateInterceptDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16181 /// ```
16182 pub fn set_update_mask<T>(mut self, v: T) -> Self
16183 where
16184 T: std::convert::Into<wkt::FieldMask>,
16185 {
16186 self.update_mask = std::option::Option::Some(v.into());
16187 self
16188 }
16189
16190 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
16191 ///
16192 /// # Example
16193 /// ```ignore,no_run
16194 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16195 /// use wkt::FieldMask;
16196 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16197 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16198 /// ```
16199 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16200 where
16201 T: std::convert::Into<wkt::FieldMask>,
16202 {
16203 self.update_mask = v.map(|x| x.into());
16204 self
16205 }
16206
16207 /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
16208 ///
16209 /// # Example
16210 /// ```ignore,no_run
16211 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16212 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16213 /// let x = UpdateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
16214 /// ```
16215 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
16216 where
16217 T: std::convert::Into<crate::model::InterceptDeployment>,
16218 {
16219 self.intercept_deployment = std::option::Option::Some(v.into());
16220 self
16221 }
16222
16223 /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
16224 ///
16225 /// # Example
16226 /// ```ignore,no_run
16227 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16228 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
16229 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
16230 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
16231 /// ```
16232 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
16233 where
16234 T: std::convert::Into<crate::model::InterceptDeployment>,
16235 {
16236 self.intercept_deployment = v.map(|x| x.into());
16237 self
16238 }
16239
16240 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
16241 ///
16242 /// # Example
16243 /// ```ignore,no_run
16244 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
16245 /// let x = UpdateInterceptDeploymentRequest::new().set_request_id("example");
16246 /// ```
16247 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16248 self.request_id = v.into();
16249 self
16250 }
16251}
16252
16253impl wkt::message::Message for UpdateInterceptDeploymentRequest {
16254 fn typename() -> &'static str {
16255 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest"
16256 }
16257}
16258
16259/// Request message for DeleteInterceptDeployment.
16260#[derive(Clone, Default, PartialEq)]
16261#[non_exhaustive]
16262pub struct DeleteInterceptDeploymentRequest {
16263 /// Required. Name of the resource
16264 pub name: std::string::String,
16265
16266 /// Optional. A unique identifier for this request. Must be a UUID4.
16267 /// This request is only idempotent if a `request_id` is provided.
16268 /// See <https://google.aip.dev/155> for more details.
16269 pub request_id: std::string::String,
16270
16271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16272}
16273
16274impl DeleteInterceptDeploymentRequest {
16275 /// Creates a new default instance.
16276 pub fn new() -> Self {
16277 std::default::Default::default()
16278 }
16279
16280 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
16281 ///
16282 /// # Example
16283 /// ```ignore,no_run
16284 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16285 /// # let project_id = "project_id";
16286 /// # let location_id = "location_id";
16287 /// # let intercept_deployment_id = "intercept_deployment_id";
16288 /// let x = DeleteInterceptDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/interceptDeployments/{intercept_deployment_id}"));
16289 /// ```
16290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16291 self.name = v.into();
16292 self
16293 }
16294
16295 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
16296 ///
16297 /// # Example
16298 /// ```ignore,no_run
16299 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
16300 /// let x = DeleteInterceptDeploymentRequest::new().set_request_id("example");
16301 /// ```
16302 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16303 self.request_id = v.into();
16304 self
16305 }
16306}
16307
16308impl wkt::message::Message for DeleteInterceptDeploymentRequest {
16309 fn typename() -> &'static str {
16310 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest"
16311 }
16312}
16313
16314/// Details about intercept in a specific cloud location.
16315#[derive(Clone, Default, PartialEq)]
16316#[non_exhaustive]
16317pub struct InterceptLocation {
16318 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
16319 pub location: std::string::String,
16320
16321 /// Output only. The current state of the association in this location.
16322 pub state: crate::model::intercept_location::State,
16323
16324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16325}
16326
16327impl InterceptLocation {
16328 /// Creates a new default instance.
16329 pub fn new() -> Self {
16330 std::default::Default::default()
16331 }
16332
16333 /// Sets the value of [location][crate::model::InterceptLocation::location].
16334 ///
16335 /// # Example
16336 /// ```ignore,no_run
16337 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16338 /// let x = InterceptLocation::new().set_location("example");
16339 /// ```
16340 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16341 self.location = v.into();
16342 self
16343 }
16344
16345 /// Sets the value of [state][crate::model::InterceptLocation::state].
16346 ///
16347 /// # Example
16348 /// ```ignore,no_run
16349 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
16350 /// use google_cloud_networksecurity_v1::model::intercept_location::State;
16351 /// let x0 = InterceptLocation::new().set_state(State::Active);
16352 /// let x1 = InterceptLocation::new().set_state(State::OutOfSync);
16353 /// ```
16354 pub fn set_state<T: std::convert::Into<crate::model::intercept_location::State>>(
16355 mut self,
16356 v: T,
16357 ) -> Self {
16358 self.state = v.into();
16359 self
16360 }
16361}
16362
16363impl wkt::message::Message for InterceptLocation {
16364 fn typename() -> &'static str {
16365 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptLocation"
16366 }
16367}
16368
16369/// Defines additional types related to [InterceptLocation].
16370pub mod intercept_location {
16371 #[allow(unused_imports)]
16372 use super::*;
16373
16374 /// The current state of a resource in the location.
16375 ///
16376 /// # Working with unknown values
16377 ///
16378 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16379 /// additional enum variants at any time. Adding new variants is not considered
16380 /// a breaking change. Applications should write their code in anticipation of:
16381 ///
16382 /// - New values appearing in future releases of the client library, **and**
16383 /// - New values received dynamically, without application changes.
16384 ///
16385 /// Please consult the [Working with enums] section in the user guide for some
16386 /// guidelines.
16387 ///
16388 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16389 #[derive(Clone, Debug, PartialEq)]
16390 #[non_exhaustive]
16391 pub enum State {
16392 /// State not set (this is not a valid state).
16393 Unspecified,
16394 /// The resource is ready and in sync in the location.
16395 Active,
16396 /// The resource is out of sync in the location.
16397 /// In most cases, this is a result of a transient issue within the system
16398 /// (e.g. an inaccessible location) and the system is expected to recover
16399 /// automatically.
16400 OutOfSync,
16401 /// If set, the enum was initialized with an unknown value.
16402 ///
16403 /// Applications can examine the value using [State::value] or
16404 /// [State::name].
16405 UnknownValue(state::UnknownValue),
16406 }
16407
16408 #[doc(hidden)]
16409 pub mod state {
16410 #[allow(unused_imports)]
16411 use super::*;
16412 #[derive(Clone, Debug, PartialEq)]
16413 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16414 }
16415
16416 impl State {
16417 /// Gets the enum value.
16418 ///
16419 /// Returns `None` if the enum contains an unknown value deserialized from
16420 /// the string representation of enums.
16421 pub fn value(&self) -> std::option::Option<i32> {
16422 match self {
16423 Self::Unspecified => std::option::Option::Some(0),
16424 Self::Active => std::option::Option::Some(1),
16425 Self::OutOfSync => std::option::Option::Some(2),
16426 Self::UnknownValue(u) => u.0.value(),
16427 }
16428 }
16429
16430 /// Gets the enum value as a string.
16431 ///
16432 /// Returns `None` if the enum contains an unknown value deserialized from
16433 /// the integer representation of enums.
16434 pub fn name(&self) -> std::option::Option<&str> {
16435 match self {
16436 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16437 Self::Active => std::option::Option::Some("ACTIVE"),
16438 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16439 Self::UnknownValue(u) => u.0.name(),
16440 }
16441 }
16442 }
16443
16444 impl std::default::Default for State {
16445 fn default() -> Self {
16446 use std::convert::From;
16447 Self::from(0)
16448 }
16449 }
16450
16451 impl std::fmt::Display for State {
16452 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16453 wkt::internal::display_enum(f, self.name(), self.value())
16454 }
16455 }
16456
16457 impl std::convert::From<i32> for State {
16458 fn from(value: i32) -> Self {
16459 match value {
16460 0 => Self::Unspecified,
16461 1 => Self::Active,
16462 2 => Self::OutOfSync,
16463 _ => Self::UnknownValue(state::UnknownValue(
16464 wkt::internal::UnknownEnumValue::Integer(value),
16465 )),
16466 }
16467 }
16468 }
16469
16470 impl std::convert::From<&str> for State {
16471 fn from(value: &str) -> Self {
16472 use std::string::ToString;
16473 match value {
16474 "STATE_UNSPECIFIED" => Self::Unspecified,
16475 "ACTIVE" => Self::Active,
16476 "OUT_OF_SYNC" => Self::OutOfSync,
16477 _ => Self::UnknownValue(state::UnknownValue(
16478 wkt::internal::UnknownEnumValue::String(value.to_string()),
16479 )),
16480 }
16481 }
16482 }
16483
16484 impl serde::ser::Serialize for State {
16485 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16486 where
16487 S: serde::Serializer,
16488 {
16489 match self {
16490 Self::Unspecified => serializer.serialize_i32(0),
16491 Self::Active => serializer.serialize_i32(1),
16492 Self::OutOfSync => serializer.serialize_i32(2),
16493 Self::UnknownValue(u) => u.0.serialize(serializer),
16494 }
16495 }
16496 }
16497
16498 impl<'de> serde::de::Deserialize<'de> for State {
16499 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16500 where
16501 D: serde::Deserializer<'de>,
16502 {
16503 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16504 ".google.cloud.networksecurity.v1.InterceptLocation.State",
16505 ))
16506 }
16507 }
16508}
16509
16510/// An endpoint group is a consumer frontend for a deployment group (backend).
16511/// In order to configure mirroring for a network, consumers must create:
16512///
16513/// - An association between their network and the endpoint group.
16514/// - A security profile that points to the endpoint group.
16515/// - A mirroring rule that references the security profile (group).
16516#[derive(Clone, Default, PartialEq)]
16517#[non_exhaustive]
16518pub struct MirroringEndpointGroup {
16519 /// Immutable. Identifier. The resource name of this endpoint group, for
16520 /// example:
16521 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
16522 /// See <https://google.aip.dev/122> for more details.
16523 pub name: std::string::String,
16524
16525 /// Output only. The timestamp when the resource was created.
16526 /// See <https://google.aip.dev/148#timestamps>.
16527 pub create_time: std::option::Option<wkt::Timestamp>,
16528
16529 /// Output only. The timestamp when the resource was most recently updated.
16530 /// See <https://google.aip.dev/148#timestamps>.
16531 pub update_time: std::option::Option<wkt::Timestamp>,
16532
16533 /// Optional. Labels are key/value pairs that help to organize and filter
16534 /// resources.
16535 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16536
16537 /// Immutable. The deployment group that this DIRECT endpoint group is
16538 /// connected to, for example:
16539 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16540 /// See <https://google.aip.dev/124>.
16541 pub mirroring_deployment_group: std::string::String,
16542
16543 /// Output only. List of details about the connected deployment groups to this
16544 /// endpoint group.
16545 pub connected_deployment_groups:
16546 std::vec::Vec<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16547
16548 /// Output only. The current state of the endpoint group.
16549 /// See <https://google.aip.dev/216>.
16550 pub state: crate::model::mirroring_endpoint_group::State,
16551
16552 /// Output only. The current state of the resource does not match the user's
16553 /// intended state, and the system is working to reconcile them. This is part
16554 /// of the normal operation (e.g. adding a new association to the group). See
16555 /// <https://google.aip.dev/128>.
16556 pub reconciling: bool,
16557
16558 /// Immutable. The type of the endpoint group.
16559 /// If left unspecified, defaults to DIRECT.
16560 pub r#type: crate::model::mirroring_endpoint_group::Type,
16561
16562 /// Output only. List of associations to this endpoint group.
16563 pub associations: std::vec::Vec<crate::model::mirroring_endpoint_group::AssociationDetails>,
16564
16565 /// Optional. User-provided description of the endpoint group.
16566 /// Used as additional context for the endpoint group.
16567 pub description: std::string::String,
16568
16569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16570}
16571
16572impl MirroringEndpointGroup {
16573 /// Creates a new default instance.
16574 pub fn new() -> Self {
16575 std::default::Default::default()
16576 }
16577
16578 /// Sets the value of [name][crate::model::MirroringEndpointGroup::name].
16579 ///
16580 /// # Example
16581 /// ```ignore,no_run
16582 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16583 /// # let project_id = "project_id";
16584 /// # let location_id = "location_id";
16585 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
16586 /// let x = MirroringEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
16587 /// ```
16588 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16589 self.name = v.into();
16590 self
16591 }
16592
16593 /// Sets the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16594 ///
16595 /// # Example
16596 /// ```ignore,no_run
16597 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16598 /// use wkt::Timestamp;
16599 /// let x = MirroringEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
16600 /// ```
16601 pub fn set_create_time<T>(mut self, v: T) -> Self
16602 where
16603 T: std::convert::Into<wkt::Timestamp>,
16604 {
16605 self.create_time = std::option::Option::Some(v.into());
16606 self
16607 }
16608
16609 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16610 ///
16611 /// # Example
16612 /// ```ignore,no_run
16613 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16614 /// use wkt::Timestamp;
16615 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16616 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
16617 /// ```
16618 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16619 where
16620 T: std::convert::Into<wkt::Timestamp>,
16621 {
16622 self.create_time = v.map(|x| x.into());
16623 self
16624 }
16625
16626 /// Sets the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16627 ///
16628 /// # Example
16629 /// ```ignore,no_run
16630 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16631 /// use wkt::Timestamp;
16632 /// let x = MirroringEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
16633 /// ```
16634 pub fn set_update_time<T>(mut self, v: T) -> Self
16635 where
16636 T: std::convert::Into<wkt::Timestamp>,
16637 {
16638 self.update_time = std::option::Option::Some(v.into());
16639 self
16640 }
16641
16642 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16643 ///
16644 /// # Example
16645 /// ```ignore,no_run
16646 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16647 /// use wkt::Timestamp;
16648 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16649 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
16650 /// ```
16651 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16652 where
16653 T: std::convert::Into<wkt::Timestamp>,
16654 {
16655 self.update_time = v.map(|x| x.into());
16656 self
16657 }
16658
16659 /// Sets the value of [labels][crate::model::MirroringEndpointGroup::labels].
16660 ///
16661 /// # Example
16662 /// ```ignore,no_run
16663 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16664 /// let x = MirroringEndpointGroup::new().set_labels([
16665 /// ("key0", "abc"),
16666 /// ("key1", "xyz"),
16667 /// ]);
16668 /// ```
16669 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16670 where
16671 T: std::iter::IntoIterator<Item = (K, V)>,
16672 K: std::convert::Into<std::string::String>,
16673 V: std::convert::Into<std::string::String>,
16674 {
16675 use std::iter::Iterator;
16676 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16677 self
16678 }
16679
16680 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringEndpointGroup::mirroring_deployment_group].
16681 ///
16682 /// # Example
16683 /// ```ignore,no_run
16684 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16685 /// # let project_id = "project_id";
16686 /// # let location_id = "location_id";
16687 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
16688 /// let x = MirroringEndpointGroup::new().set_mirroring_deployment_group(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
16689 /// ```
16690 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
16691 mut self,
16692 v: T,
16693 ) -> Self {
16694 self.mirroring_deployment_group = v.into();
16695 self
16696 }
16697
16698 /// Sets the value of [connected_deployment_groups][crate::model::MirroringEndpointGroup::connected_deployment_groups].
16699 ///
16700 /// # Example
16701 /// ```ignore,no_run
16702 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16703 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16704 /// let x = MirroringEndpointGroup::new()
16705 /// .set_connected_deployment_groups([
16706 /// ConnectedDeploymentGroup::default()/* use setters */,
16707 /// ConnectedDeploymentGroup::default()/* use (different) setters */,
16708 /// ]);
16709 /// ```
16710 pub fn set_connected_deployment_groups<T, V>(mut self, v: T) -> Self
16711 where
16712 T: std::iter::IntoIterator<Item = V>,
16713 V: std::convert::Into<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16714 {
16715 use std::iter::Iterator;
16716 self.connected_deployment_groups = v.into_iter().map(|i| i.into()).collect();
16717 self
16718 }
16719
16720 /// Sets the value of [state][crate::model::MirroringEndpointGroup::state].
16721 ///
16722 /// # Example
16723 /// ```ignore,no_run
16724 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16725 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::State;
16726 /// let x0 = MirroringEndpointGroup::new().set_state(State::Active);
16727 /// let x1 = MirroringEndpointGroup::new().set_state(State::Closed);
16728 /// let x2 = MirroringEndpointGroup::new().set_state(State::Creating);
16729 /// ```
16730 pub fn set_state<T: std::convert::Into<crate::model::mirroring_endpoint_group::State>>(
16731 mut self,
16732 v: T,
16733 ) -> Self {
16734 self.state = v.into();
16735 self
16736 }
16737
16738 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroup::reconciling].
16739 ///
16740 /// # Example
16741 /// ```ignore,no_run
16742 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16743 /// let x = MirroringEndpointGroup::new().set_reconciling(true);
16744 /// ```
16745 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16746 self.reconciling = v.into();
16747 self
16748 }
16749
16750 /// Sets the value of [r#type][crate::model::MirroringEndpointGroup::type].
16751 ///
16752 /// # Example
16753 /// ```ignore,no_run
16754 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16755 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::Type;
16756 /// let x0 = MirroringEndpointGroup::new().set_type(Type::Direct);
16757 /// ```
16758 pub fn set_type<T: std::convert::Into<crate::model::mirroring_endpoint_group::Type>>(
16759 mut self,
16760 v: T,
16761 ) -> Self {
16762 self.r#type = v.into();
16763 self
16764 }
16765
16766 /// Sets the value of [associations][crate::model::MirroringEndpointGroup::associations].
16767 ///
16768 /// # Example
16769 /// ```ignore,no_run
16770 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16771 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16772 /// let x = MirroringEndpointGroup::new()
16773 /// .set_associations([
16774 /// AssociationDetails::default()/* use setters */,
16775 /// AssociationDetails::default()/* use (different) setters */,
16776 /// ]);
16777 /// ```
16778 pub fn set_associations<T, V>(mut self, v: T) -> Self
16779 where
16780 T: std::iter::IntoIterator<Item = V>,
16781 V: std::convert::Into<crate::model::mirroring_endpoint_group::AssociationDetails>,
16782 {
16783 use std::iter::Iterator;
16784 self.associations = v.into_iter().map(|i| i.into()).collect();
16785 self
16786 }
16787
16788 /// Sets the value of [description][crate::model::MirroringEndpointGroup::description].
16789 ///
16790 /// # Example
16791 /// ```ignore,no_run
16792 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16793 /// let x = MirroringEndpointGroup::new().set_description("example");
16794 /// ```
16795 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16796 self.description = v.into();
16797 self
16798 }
16799}
16800
16801impl wkt::message::Message for MirroringEndpointGroup {
16802 fn typename() -> &'static str {
16803 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup"
16804 }
16805}
16806
16807/// Defines additional types related to [MirroringEndpointGroup].
16808pub mod mirroring_endpoint_group {
16809 #[allow(unused_imports)]
16810 use super::*;
16811
16812 /// The endpoint group's view of a connected deployment group.
16813 #[derive(Clone, Default, PartialEq)]
16814 #[non_exhaustive]
16815 pub struct ConnectedDeploymentGroup {
16816 /// Output only. The connected deployment group's resource name, for example:
16817 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16818 /// See <https://google.aip.dev/124>.
16819 pub name: std::string::String,
16820
16821 /// Output only. The list of locations where the deployment group is present.
16822 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
16823
16824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16825 }
16826
16827 impl ConnectedDeploymentGroup {
16828 /// Creates a new default instance.
16829 pub fn new() -> Self {
16830 std::default::Default::default()
16831 }
16832
16833 /// Sets the value of [name][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::name].
16834 ///
16835 /// # Example
16836 /// ```ignore,no_run
16837 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16838 /// # let project_id = "project_id";
16839 /// # let location_id = "location_id";
16840 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
16841 /// let x = ConnectedDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
16842 /// ```
16843 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16844 self.name = v.into();
16845 self
16846 }
16847
16848 /// Sets the value of [locations][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::locations].
16849 ///
16850 /// # Example
16851 /// ```ignore,no_run
16852 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16853 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
16854 /// let x = ConnectedDeploymentGroup::new()
16855 /// .set_locations([
16856 /// MirroringLocation::default()/* use setters */,
16857 /// MirroringLocation::default()/* use (different) setters */,
16858 /// ]);
16859 /// ```
16860 pub fn set_locations<T, V>(mut self, v: T) -> Self
16861 where
16862 T: std::iter::IntoIterator<Item = V>,
16863 V: std::convert::Into<crate::model::MirroringLocation>,
16864 {
16865 use std::iter::Iterator;
16866 self.locations = v.into_iter().map(|i| i.into()).collect();
16867 self
16868 }
16869 }
16870
16871 impl wkt::message::Message for ConnectedDeploymentGroup {
16872 fn typename() -> &'static str {
16873 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup"
16874 }
16875 }
16876
16877 /// The endpoint group's view of a connected association.
16878 #[derive(Clone, Default, PartialEq)]
16879 #[non_exhaustive]
16880 pub struct AssociationDetails {
16881 /// Output only. The connected association's resource name, for example:
16882 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-ega`.
16883 /// See <https://google.aip.dev/124>.
16884 pub name: std::string::String,
16885
16886 /// Output only. The associated network, for example:
16887 /// projects/123456789/global/networks/my-network.
16888 /// See <https://google.aip.dev/124>.
16889 pub network: std::string::String,
16890
16891 /// Output only. Most recent known state of the association.
16892 pub state: crate::model::mirroring_endpoint_group_association::State,
16893
16894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16895 }
16896
16897 impl AssociationDetails {
16898 /// Creates a new default instance.
16899 pub fn new() -> Self {
16900 std::default::Default::default()
16901 }
16902
16903 /// Sets the value of [name][crate::model::mirroring_endpoint_group::AssociationDetails::name].
16904 ///
16905 /// # Example
16906 /// ```ignore,no_run
16907 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16908 /// # let project_id = "project_id";
16909 /// # let location_id = "location_id";
16910 /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
16911 /// let x = AssociationDetails::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
16912 /// ```
16913 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16914 self.name = v.into();
16915 self
16916 }
16917
16918 /// Sets the value of [network][crate::model::mirroring_endpoint_group::AssociationDetails::network].
16919 ///
16920 /// # Example
16921 /// ```ignore,no_run
16922 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16923 /// let x = AssociationDetails::new().set_network("example");
16924 /// ```
16925 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16926 self.network = v.into();
16927 self
16928 }
16929
16930 /// Sets the value of [state][crate::model::mirroring_endpoint_group::AssociationDetails::state].
16931 ///
16932 /// # Example
16933 /// ```ignore,no_run
16934 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16935 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
16936 /// let x0 = AssociationDetails::new().set_state(State::Active);
16937 /// let x1 = AssociationDetails::new().set_state(State::Creating);
16938 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
16939 /// ```
16940 pub fn set_state<
16941 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
16942 >(
16943 mut self,
16944 v: T,
16945 ) -> Self {
16946 self.state = v.into();
16947 self
16948 }
16949 }
16950
16951 impl wkt::message::Message for AssociationDetails {
16952 fn typename() -> &'static str {
16953 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails"
16954 }
16955 }
16956
16957 /// The current state of the endpoint group.
16958 ///
16959 /// # Working with unknown values
16960 ///
16961 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16962 /// additional enum variants at any time. Adding new variants is not considered
16963 /// a breaking change. Applications should write their code in anticipation of:
16964 ///
16965 /// - New values appearing in future releases of the client library, **and**
16966 /// - New values received dynamically, without application changes.
16967 ///
16968 /// Please consult the [Working with enums] section in the user guide for some
16969 /// guidelines.
16970 ///
16971 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16972 #[derive(Clone, Debug, PartialEq)]
16973 #[non_exhaustive]
16974 pub enum State {
16975 /// State not set (this is not a valid state).
16976 Unspecified,
16977 /// The endpoint group is ready and in sync with the target deployment group.
16978 Active,
16979 /// The deployment group backing this endpoint group has been force-deleted.
16980 /// This endpoint group cannot be used and mirroring is effectively disabled.
16981 Closed,
16982 /// The endpoint group is being created.
16983 Creating,
16984 /// The endpoint group is being deleted.
16985 Deleting,
16986 /// The endpoint group is out of sync with the backing deployment group.
16987 /// In most cases, this is a result of a transient issue within the system
16988 /// (e.g. an inaccessible location) and the system is expected to recover
16989 /// automatically. See the associations field for details per network and
16990 /// location.
16991 OutOfSync,
16992 /// An attempt to delete the endpoint group has failed. This is a terminal
16993 /// state and the endpoint group is not expected to recover.
16994 /// The only permitted operation is to retry deleting the endpoint group.
16995 DeleteFailed,
16996 /// If set, the enum was initialized with an unknown value.
16997 ///
16998 /// Applications can examine the value using [State::value] or
16999 /// [State::name].
17000 UnknownValue(state::UnknownValue),
17001 }
17002
17003 #[doc(hidden)]
17004 pub mod state {
17005 #[allow(unused_imports)]
17006 use super::*;
17007 #[derive(Clone, Debug, PartialEq)]
17008 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17009 }
17010
17011 impl State {
17012 /// Gets the enum value.
17013 ///
17014 /// Returns `None` if the enum contains an unknown value deserialized from
17015 /// the string representation of enums.
17016 pub fn value(&self) -> std::option::Option<i32> {
17017 match self {
17018 Self::Unspecified => std::option::Option::Some(0),
17019 Self::Active => std::option::Option::Some(1),
17020 Self::Closed => std::option::Option::Some(2),
17021 Self::Creating => std::option::Option::Some(3),
17022 Self::Deleting => std::option::Option::Some(4),
17023 Self::OutOfSync => std::option::Option::Some(5),
17024 Self::DeleteFailed => std::option::Option::Some(6),
17025 Self::UnknownValue(u) => u.0.value(),
17026 }
17027 }
17028
17029 /// Gets the enum value as a string.
17030 ///
17031 /// Returns `None` if the enum contains an unknown value deserialized from
17032 /// the integer representation of enums.
17033 pub fn name(&self) -> std::option::Option<&str> {
17034 match self {
17035 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17036 Self::Active => std::option::Option::Some("ACTIVE"),
17037 Self::Closed => std::option::Option::Some("CLOSED"),
17038 Self::Creating => std::option::Option::Some("CREATING"),
17039 Self::Deleting => std::option::Option::Some("DELETING"),
17040 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
17041 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
17042 Self::UnknownValue(u) => u.0.name(),
17043 }
17044 }
17045 }
17046
17047 impl std::default::Default for State {
17048 fn default() -> Self {
17049 use std::convert::From;
17050 Self::from(0)
17051 }
17052 }
17053
17054 impl std::fmt::Display for State {
17055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17056 wkt::internal::display_enum(f, self.name(), self.value())
17057 }
17058 }
17059
17060 impl std::convert::From<i32> for State {
17061 fn from(value: i32) -> Self {
17062 match value {
17063 0 => Self::Unspecified,
17064 1 => Self::Active,
17065 2 => Self::Closed,
17066 3 => Self::Creating,
17067 4 => Self::Deleting,
17068 5 => Self::OutOfSync,
17069 6 => Self::DeleteFailed,
17070 _ => Self::UnknownValue(state::UnknownValue(
17071 wkt::internal::UnknownEnumValue::Integer(value),
17072 )),
17073 }
17074 }
17075 }
17076
17077 impl std::convert::From<&str> for State {
17078 fn from(value: &str) -> Self {
17079 use std::string::ToString;
17080 match value {
17081 "STATE_UNSPECIFIED" => Self::Unspecified,
17082 "ACTIVE" => Self::Active,
17083 "CLOSED" => Self::Closed,
17084 "CREATING" => Self::Creating,
17085 "DELETING" => Self::Deleting,
17086 "OUT_OF_SYNC" => Self::OutOfSync,
17087 "DELETE_FAILED" => Self::DeleteFailed,
17088 _ => Self::UnknownValue(state::UnknownValue(
17089 wkt::internal::UnknownEnumValue::String(value.to_string()),
17090 )),
17091 }
17092 }
17093 }
17094
17095 impl serde::ser::Serialize for State {
17096 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17097 where
17098 S: serde::Serializer,
17099 {
17100 match self {
17101 Self::Unspecified => serializer.serialize_i32(0),
17102 Self::Active => serializer.serialize_i32(1),
17103 Self::Closed => serializer.serialize_i32(2),
17104 Self::Creating => serializer.serialize_i32(3),
17105 Self::Deleting => serializer.serialize_i32(4),
17106 Self::OutOfSync => serializer.serialize_i32(5),
17107 Self::DeleteFailed => serializer.serialize_i32(6),
17108 Self::UnknownValue(u) => u.0.serialize(serializer),
17109 }
17110 }
17111 }
17112
17113 impl<'de> serde::de::Deserialize<'de> for State {
17114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17115 where
17116 D: serde::Deserializer<'de>,
17117 {
17118 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17119 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.State",
17120 ))
17121 }
17122 }
17123
17124 /// The type of the endpoint group.
17125 ///
17126 /// # Working with unknown values
17127 ///
17128 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17129 /// additional enum variants at any time. Adding new variants is not considered
17130 /// a breaking change. Applications should write their code in anticipation of:
17131 ///
17132 /// - New values appearing in future releases of the client library, **and**
17133 /// - New values received dynamically, without application changes.
17134 ///
17135 /// Please consult the [Working with enums] section in the user guide for some
17136 /// guidelines.
17137 ///
17138 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17139 #[derive(Clone, Debug, PartialEq)]
17140 #[non_exhaustive]
17141 pub enum Type {
17142 /// Not set.
17143 Unspecified,
17144 /// An endpoint group that sends packets to a single deployment group.
17145 Direct,
17146 /// If set, the enum was initialized with an unknown value.
17147 ///
17148 /// Applications can examine the value using [Type::value] or
17149 /// [Type::name].
17150 UnknownValue(r#type::UnknownValue),
17151 }
17152
17153 #[doc(hidden)]
17154 pub mod r#type {
17155 #[allow(unused_imports)]
17156 use super::*;
17157 #[derive(Clone, Debug, PartialEq)]
17158 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17159 }
17160
17161 impl Type {
17162 /// Gets the enum value.
17163 ///
17164 /// Returns `None` if the enum contains an unknown value deserialized from
17165 /// the string representation of enums.
17166 pub fn value(&self) -> std::option::Option<i32> {
17167 match self {
17168 Self::Unspecified => std::option::Option::Some(0),
17169 Self::Direct => std::option::Option::Some(1),
17170 Self::UnknownValue(u) => u.0.value(),
17171 }
17172 }
17173
17174 /// Gets the enum value as a string.
17175 ///
17176 /// Returns `None` if the enum contains an unknown value deserialized from
17177 /// the integer representation of enums.
17178 pub fn name(&self) -> std::option::Option<&str> {
17179 match self {
17180 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17181 Self::Direct => std::option::Option::Some("DIRECT"),
17182 Self::UnknownValue(u) => u.0.name(),
17183 }
17184 }
17185 }
17186
17187 impl std::default::Default for Type {
17188 fn default() -> Self {
17189 use std::convert::From;
17190 Self::from(0)
17191 }
17192 }
17193
17194 impl std::fmt::Display for Type {
17195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17196 wkt::internal::display_enum(f, self.name(), self.value())
17197 }
17198 }
17199
17200 impl std::convert::From<i32> for Type {
17201 fn from(value: i32) -> Self {
17202 match value {
17203 0 => Self::Unspecified,
17204 1 => Self::Direct,
17205 _ => Self::UnknownValue(r#type::UnknownValue(
17206 wkt::internal::UnknownEnumValue::Integer(value),
17207 )),
17208 }
17209 }
17210 }
17211
17212 impl std::convert::From<&str> for Type {
17213 fn from(value: &str) -> Self {
17214 use std::string::ToString;
17215 match value {
17216 "TYPE_UNSPECIFIED" => Self::Unspecified,
17217 "DIRECT" => Self::Direct,
17218 _ => Self::UnknownValue(r#type::UnknownValue(
17219 wkt::internal::UnknownEnumValue::String(value.to_string()),
17220 )),
17221 }
17222 }
17223 }
17224
17225 impl serde::ser::Serialize for Type {
17226 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17227 where
17228 S: serde::Serializer,
17229 {
17230 match self {
17231 Self::Unspecified => serializer.serialize_i32(0),
17232 Self::Direct => serializer.serialize_i32(1),
17233 Self::UnknownValue(u) => u.0.serialize(serializer),
17234 }
17235 }
17236 }
17237
17238 impl<'de> serde::de::Deserialize<'de> for Type {
17239 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17240 where
17241 D: serde::Deserializer<'de>,
17242 {
17243 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17244 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.Type",
17245 ))
17246 }
17247 }
17248}
17249
17250/// Request message for ListMirroringEndpointGroups.
17251#[derive(Clone, Default, PartialEq)]
17252#[non_exhaustive]
17253pub struct ListMirroringEndpointGroupsRequest {
17254 /// Required. The parent, which owns this collection of endpoint groups.
17255 /// Example: `projects/123456789/locations/global`.
17256 /// See <https://google.aip.dev/132> for more details.
17257 pub parent: std::string::String,
17258
17259 /// Optional. Requested page size. Server may return fewer items than
17260 /// requested. If unspecified, server will pick an appropriate default. See
17261 /// <https://google.aip.dev/158> for more details.
17262 pub page_size: i32,
17263
17264 /// Optional. A page token, received from a previous
17265 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
17266 /// page. When paginating, all other parameters provided to
17267 /// `ListMirroringEndpointGroups` must match the call that provided the page
17268 /// token.
17269 /// See <https://google.aip.dev/158> for more details.
17270 pub page_token: std::string::String,
17271
17272 /// Optional. Filter expression.
17273 /// See <https://google.aip.dev/160#filtering> for more details.
17274 pub filter: std::string::String,
17275
17276 /// Optional. Sort expression.
17277 /// See <https://google.aip.dev/132#ordering> for more details.
17278 pub order_by: std::string::String,
17279
17280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17281}
17282
17283impl ListMirroringEndpointGroupsRequest {
17284 /// Creates a new default instance.
17285 pub fn new() -> Self {
17286 std::default::Default::default()
17287 }
17288
17289 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
17290 ///
17291 /// # Example
17292 /// ```ignore,no_run
17293 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17294 /// # let project_id = "project_id";
17295 /// # let location_id = "location_id";
17296 /// let x = ListMirroringEndpointGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17297 /// ```
17298 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17299 self.parent = v.into();
17300 self
17301 }
17302
17303 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
17304 ///
17305 /// # Example
17306 /// ```ignore,no_run
17307 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17308 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_size(42);
17309 /// ```
17310 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17311 self.page_size = v.into();
17312 self
17313 }
17314
17315 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
17316 ///
17317 /// # Example
17318 /// ```ignore,no_run
17319 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17320 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_token("example");
17321 /// ```
17322 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17323 self.page_token = v.into();
17324 self
17325 }
17326
17327 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
17328 ///
17329 /// # Example
17330 /// ```ignore,no_run
17331 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17332 /// let x = ListMirroringEndpointGroupsRequest::new().set_filter("example");
17333 /// ```
17334 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17335 self.filter = v.into();
17336 self
17337 }
17338
17339 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
17340 ///
17341 /// # Example
17342 /// ```ignore,no_run
17343 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
17344 /// let x = ListMirroringEndpointGroupsRequest::new().set_order_by("example");
17345 /// ```
17346 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17347 self.order_by = v.into();
17348 self
17349 }
17350}
17351
17352impl wkt::message::Message for ListMirroringEndpointGroupsRequest {
17353 fn typename() -> &'static str {
17354 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest"
17355 }
17356}
17357
17358/// Response message for ListMirroringEndpointGroups.
17359#[derive(Clone, Default, PartialEq)]
17360#[non_exhaustive]
17361pub struct ListMirroringEndpointGroupsResponse {
17362 /// The endpoint groups from the specified parent.
17363 pub mirroring_endpoint_groups: std::vec::Vec<crate::model::MirroringEndpointGroup>,
17364
17365 /// A token that can be sent as `page_token` to retrieve the next page.
17366 /// If this field is omitted, there are no subsequent pages.
17367 /// See <https://google.aip.dev/158> for more details.
17368 pub next_page_token: std::string::String,
17369
17370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17371}
17372
17373impl ListMirroringEndpointGroupsResponse {
17374 /// Creates a new default instance.
17375 pub fn new() -> Self {
17376 std::default::Default::default()
17377 }
17378
17379 /// Sets the value of [mirroring_endpoint_groups][crate::model::ListMirroringEndpointGroupsResponse::mirroring_endpoint_groups].
17380 ///
17381 /// # Example
17382 /// ```ignore,no_run
17383 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17384 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17385 /// let x = ListMirroringEndpointGroupsResponse::new()
17386 /// .set_mirroring_endpoint_groups([
17387 /// MirroringEndpointGroup::default()/* use setters */,
17388 /// MirroringEndpointGroup::default()/* use (different) setters */,
17389 /// ]);
17390 /// ```
17391 pub fn set_mirroring_endpoint_groups<T, V>(mut self, v: T) -> Self
17392 where
17393 T: std::iter::IntoIterator<Item = V>,
17394 V: std::convert::Into<crate::model::MirroringEndpointGroup>,
17395 {
17396 use std::iter::Iterator;
17397 self.mirroring_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
17398 self
17399 }
17400
17401 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupsResponse::next_page_token].
17402 ///
17403 /// # Example
17404 /// ```ignore,no_run
17405 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
17406 /// let x = ListMirroringEndpointGroupsResponse::new().set_next_page_token("example");
17407 /// ```
17408 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17409 self.next_page_token = v.into();
17410 self
17411 }
17412}
17413
17414impl wkt::message::Message for ListMirroringEndpointGroupsResponse {
17415 fn typename() -> &'static str {
17416 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse"
17417 }
17418}
17419
17420#[doc(hidden)]
17421impl google_cloud_gax::paginator::internal::PageableResponse
17422 for ListMirroringEndpointGroupsResponse
17423{
17424 type PageItem = crate::model::MirroringEndpointGroup;
17425
17426 fn items(self) -> std::vec::Vec<Self::PageItem> {
17427 self.mirroring_endpoint_groups
17428 }
17429
17430 fn next_page_token(&self) -> std::string::String {
17431 use std::clone::Clone;
17432 self.next_page_token.clone()
17433 }
17434}
17435
17436/// Request message for GetMirroringEndpointGroup.
17437#[derive(Clone, Default, PartialEq)]
17438#[non_exhaustive]
17439pub struct GetMirroringEndpointGroupRequest {
17440 /// Required. The name of the endpoint group to retrieve.
17441 /// Format:
17442 /// projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}
17443 pub name: std::string::String,
17444
17445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17446}
17447
17448impl GetMirroringEndpointGroupRequest {
17449 /// Creates a new default instance.
17450 pub fn new() -> Self {
17451 std::default::Default::default()
17452 }
17453
17454 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
17455 ///
17456 /// # Example
17457 /// ```ignore,no_run
17458 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupRequest;
17459 /// # let project_id = "project_id";
17460 /// # let location_id = "location_id";
17461 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17462 /// let x = GetMirroringEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17463 /// ```
17464 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17465 self.name = v.into();
17466 self
17467 }
17468}
17469
17470impl wkt::message::Message for GetMirroringEndpointGroupRequest {
17471 fn typename() -> &'static str {
17472 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest"
17473 }
17474}
17475
17476/// Request message for CreateMirroringEndpointGroup.
17477#[derive(Clone, Default, PartialEq)]
17478#[non_exhaustive]
17479pub struct CreateMirroringEndpointGroupRequest {
17480 /// Required. The parent resource where this endpoint group will be created.
17481 /// Format: projects/{project}/locations/{location}
17482 pub parent: std::string::String,
17483
17484 /// Required. The ID to use for the endpoint group, which will become the final
17485 /// component of the endpoint group's resource name.
17486 pub mirroring_endpoint_group_id: std::string::String,
17487
17488 /// Required. The endpoint group to create.
17489 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17490
17491 /// Optional. A unique identifier for this request. Must be a UUID4.
17492 /// This request is only idempotent if a `request_id` is provided.
17493 /// See <https://google.aip.dev/155> for more details.
17494 pub request_id: std::string::String,
17495
17496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17497}
17498
17499impl CreateMirroringEndpointGroupRequest {
17500 /// Creates a new default instance.
17501 pub fn new() -> Self {
17502 std::default::Default::default()
17503 }
17504
17505 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
17506 ///
17507 /// # Example
17508 /// ```ignore,no_run
17509 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17510 /// # let project_id = "project_id";
17511 /// # let location_id = "location_id";
17512 /// let x = CreateMirroringEndpointGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17513 /// ```
17514 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17515 self.parent = v.into();
17516 self
17517 }
17518
17519 /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
17520 ///
17521 /// # Example
17522 /// ```ignore,no_run
17523 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17524 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group_id("example");
17525 /// ```
17526 pub fn set_mirroring_endpoint_group_id<T: std::convert::Into<std::string::String>>(
17527 mut self,
17528 v: T,
17529 ) -> Self {
17530 self.mirroring_endpoint_group_id = v.into();
17531 self
17532 }
17533
17534 /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17535 ///
17536 /// # Example
17537 /// ```ignore,no_run
17538 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17539 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17540 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17541 /// ```
17542 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17543 where
17544 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17545 {
17546 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17547 self
17548 }
17549
17550 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17551 ///
17552 /// # Example
17553 /// ```ignore,no_run
17554 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17555 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17556 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17557 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17558 /// ```
17559 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17560 where
17561 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17562 {
17563 self.mirroring_endpoint_group = v.map(|x| x.into());
17564 self
17565 }
17566
17567 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
17568 ///
17569 /// # Example
17570 /// ```ignore,no_run
17571 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17572 /// let x = CreateMirroringEndpointGroupRequest::new().set_request_id("example");
17573 /// ```
17574 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17575 self.request_id = v.into();
17576 self
17577 }
17578}
17579
17580impl wkt::message::Message for CreateMirroringEndpointGroupRequest {
17581 fn typename() -> &'static str {
17582 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest"
17583 }
17584}
17585
17586/// Request message for UpdateMirroringEndpointGroup.
17587#[derive(Clone, Default, PartialEq)]
17588#[non_exhaustive]
17589pub struct UpdateMirroringEndpointGroupRequest {
17590 /// Optional. The list of fields to update.
17591 /// Fields are specified relative to the endpoint group
17592 /// (e.g. `description`; *not* `mirroring_endpoint_group.description`).
17593 /// See <https://google.aip.dev/161> for more details.
17594 pub update_mask: std::option::Option<wkt::FieldMask>,
17595
17596 /// Required. The endpoint group to update.
17597 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17598
17599 /// Optional. A unique identifier for this request. Must be a UUID4.
17600 /// This request is only idempotent if a `request_id` is provided.
17601 /// See <https://google.aip.dev/155> for more details.
17602 pub request_id: std::string::String,
17603
17604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17605}
17606
17607impl UpdateMirroringEndpointGroupRequest {
17608 /// Creates a new default instance.
17609 pub fn new() -> Self {
17610 std::default::Default::default()
17611 }
17612
17613 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17614 ///
17615 /// # Example
17616 /// ```ignore,no_run
17617 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17618 /// use wkt::FieldMask;
17619 /// let x = UpdateMirroringEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17620 /// ```
17621 pub fn set_update_mask<T>(mut self, v: T) -> Self
17622 where
17623 T: std::convert::Into<wkt::FieldMask>,
17624 {
17625 self.update_mask = std::option::Option::Some(v.into());
17626 self
17627 }
17628
17629 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17630 ///
17631 /// # Example
17632 /// ```ignore,no_run
17633 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17634 /// use wkt::FieldMask;
17635 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17636 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17637 /// ```
17638 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17639 where
17640 T: std::convert::Into<wkt::FieldMask>,
17641 {
17642 self.update_mask = v.map(|x| x.into());
17643 self
17644 }
17645
17646 /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17647 ///
17648 /// # Example
17649 /// ```ignore,no_run
17650 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17651 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17652 /// let x = UpdateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17653 /// ```
17654 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17655 where
17656 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17657 {
17658 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17659 self
17660 }
17661
17662 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17663 ///
17664 /// # Example
17665 /// ```ignore,no_run
17666 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17667 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17668 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17669 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17670 /// ```
17671 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17672 where
17673 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17674 {
17675 self.mirroring_endpoint_group = v.map(|x| x.into());
17676 self
17677 }
17678
17679 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
17680 ///
17681 /// # Example
17682 /// ```ignore,no_run
17683 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17684 /// let x = UpdateMirroringEndpointGroupRequest::new().set_request_id("example");
17685 /// ```
17686 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17687 self.request_id = v.into();
17688 self
17689 }
17690}
17691
17692impl wkt::message::Message for UpdateMirroringEndpointGroupRequest {
17693 fn typename() -> &'static str {
17694 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest"
17695 }
17696}
17697
17698/// Request message for DeleteMirroringEndpointGroup.
17699#[derive(Clone, Default, PartialEq)]
17700#[non_exhaustive]
17701pub struct DeleteMirroringEndpointGroupRequest {
17702 /// Required. The endpoint group to delete.
17703 pub name: std::string::String,
17704
17705 /// Optional. A unique identifier for this request. Must be a UUID4.
17706 /// This request is only idempotent if a `request_id` is provided.
17707 /// See <https://google.aip.dev/155> for more details.
17708 pub request_id: std::string::String,
17709
17710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17711}
17712
17713impl DeleteMirroringEndpointGroupRequest {
17714 /// Creates a new default instance.
17715 pub fn new() -> Self {
17716 std::default::Default::default()
17717 }
17718
17719 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
17720 ///
17721 /// # Example
17722 /// ```ignore,no_run
17723 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17724 /// # let project_id = "project_id";
17725 /// # let location_id = "location_id";
17726 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17727 /// let x = DeleteMirroringEndpointGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17728 /// ```
17729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17730 self.name = v.into();
17731 self
17732 }
17733
17734 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
17735 ///
17736 /// # Example
17737 /// ```ignore,no_run
17738 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17739 /// let x = DeleteMirroringEndpointGroupRequest::new().set_request_id("example");
17740 /// ```
17741 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17742 self.request_id = v.into();
17743 self
17744 }
17745}
17746
17747impl wkt::message::Message for DeleteMirroringEndpointGroupRequest {
17748 fn typename() -> &'static str {
17749 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest"
17750 }
17751}
17752
17753/// An endpoint group association represents a link between a network and an
17754/// endpoint group in the organization.
17755///
17756/// Creating an association creates the networking infrastructure linking the
17757/// network to the endpoint group, but does not enable mirroring by itself.
17758/// To enable mirroring, the user must also create a network firewall policy
17759/// containing mirroring rules and associate it with the network.
17760#[derive(Clone, Default, PartialEq)]
17761#[non_exhaustive]
17762pub struct MirroringEndpointGroupAssociation {
17763 /// Immutable. Identifier. The resource name of this endpoint group
17764 /// association, for example:
17765 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-eg-association`.
17766 /// See <https://google.aip.dev/122> for more details.
17767 pub name: std::string::String,
17768
17769 /// Output only. The timestamp when the resource was created.
17770 /// See <https://google.aip.dev/148#timestamps>.
17771 pub create_time: std::option::Option<wkt::Timestamp>,
17772
17773 /// Output only. The timestamp when the resource was most recently updated.
17774 /// See <https://google.aip.dev/148#timestamps>.
17775 pub update_time: std::option::Option<wkt::Timestamp>,
17776
17777 /// Optional. Labels are key/value pairs that help to organize and filter
17778 /// resources.
17779 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17780
17781 /// Immutable. The endpoint group that this association is connected to, for
17782 /// example:
17783 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
17784 /// See <https://google.aip.dev/124>.
17785 pub mirroring_endpoint_group: std::string::String,
17786
17787 /// Immutable. The VPC network that is associated. for example:
17788 /// `projects/123456789/global/networks/my-network`.
17789 /// See <https://google.aip.dev/124>.
17790 pub network: std::string::String,
17791
17792 /// Output only. The list of locations where the association is present. This
17793 /// information is retrieved from the linked endpoint group, and not configured
17794 /// as part of the association itself.
17795 #[deprecated]
17796 pub locations_details:
17797 std::vec::Vec<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17798
17799 /// Output only. Current state of the endpoint group association.
17800 pub state: crate::model::mirroring_endpoint_group_association::State,
17801
17802 /// Output only. The current state of the resource does not match the user's
17803 /// intended state, and the system is working to reconcile them. This part of
17804 /// the normal operation (e.g. adding a new location to the target deployment
17805 /// group). See <https://google.aip.dev/128>.
17806 pub reconciling: bool,
17807
17808 /// Output only. The list of locations where the association is configured.
17809 /// This information is retrieved from the linked endpoint group.
17810 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
17811
17812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17813}
17814
17815impl MirroringEndpointGroupAssociation {
17816 /// Creates a new default instance.
17817 pub fn new() -> Self {
17818 std::default::Default::default()
17819 }
17820
17821 /// Sets the value of [name][crate::model::MirroringEndpointGroupAssociation::name].
17822 ///
17823 /// # Example
17824 /// ```ignore,no_run
17825 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17826 /// # let project_id = "project_id";
17827 /// # let location_id = "location_id";
17828 /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
17829 /// let x = MirroringEndpointGroupAssociation::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
17830 /// ```
17831 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17832 self.name = v.into();
17833 self
17834 }
17835
17836 /// Sets the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17837 ///
17838 /// # Example
17839 /// ```ignore,no_run
17840 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17841 /// use wkt::Timestamp;
17842 /// let x = MirroringEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
17843 /// ```
17844 pub fn set_create_time<T>(mut self, v: T) -> Self
17845 where
17846 T: std::convert::Into<wkt::Timestamp>,
17847 {
17848 self.create_time = std::option::Option::Some(v.into());
17849 self
17850 }
17851
17852 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17853 ///
17854 /// # Example
17855 /// ```ignore,no_run
17856 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17857 /// use wkt::Timestamp;
17858 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17859 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
17860 /// ```
17861 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17862 where
17863 T: std::convert::Into<wkt::Timestamp>,
17864 {
17865 self.create_time = v.map(|x| x.into());
17866 self
17867 }
17868
17869 /// Sets the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17870 ///
17871 /// # Example
17872 /// ```ignore,no_run
17873 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17874 /// use wkt::Timestamp;
17875 /// let x = MirroringEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
17876 /// ```
17877 pub fn set_update_time<T>(mut self, v: T) -> Self
17878 where
17879 T: std::convert::Into<wkt::Timestamp>,
17880 {
17881 self.update_time = std::option::Option::Some(v.into());
17882 self
17883 }
17884
17885 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17886 ///
17887 /// # Example
17888 /// ```ignore,no_run
17889 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17890 /// use wkt::Timestamp;
17891 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17892 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
17893 /// ```
17894 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17895 where
17896 T: std::convert::Into<wkt::Timestamp>,
17897 {
17898 self.update_time = v.map(|x| x.into());
17899 self
17900 }
17901
17902 /// Sets the value of [labels][crate::model::MirroringEndpointGroupAssociation::labels].
17903 ///
17904 /// # Example
17905 /// ```ignore,no_run
17906 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17907 /// let x = MirroringEndpointGroupAssociation::new().set_labels([
17908 /// ("key0", "abc"),
17909 /// ("key1", "xyz"),
17910 /// ]);
17911 /// ```
17912 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17913 where
17914 T: std::iter::IntoIterator<Item = (K, V)>,
17915 K: std::convert::Into<std::string::String>,
17916 V: std::convert::Into<std::string::String>,
17917 {
17918 use std::iter::Iterator;
17919 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17920 self
17921 }
17922
17923 /// Sets the value of [mirroring_endpoint_group][crate::model::MirroringEndpointGroupAssociation::mirroring_endpoint_group].
17924 ///
17925 /// # Example
17926 /// ```ignore,no_run
17927 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17928 /// # let project_id = "project_id";
17929 /// # let location_id = "location_id";
17930 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
17931 /// let x = MirroringEndpointGroupAssociation::new().set_mirroring_endpoint_group(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
17932 /// ```
17933 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
17934 mut self,
17935 v: T,
17936 ) -> Self {
17937 self.mirroring_endpoint_group = v.into();
17938 self
17939 }
17940
17941 /// Sets the value of [network][crate::model::MirroringEndpointGroupAssociation::network].
17942 ///
17943 /// # Example
17944 /// ```ignore,no_run
17945 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17946 /// let x = MirroringEndpointGroupAssociation::new().set_network("example");
17947 /// ```
17948 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17949 self.network = v.into();
17950 self
17951 }
17952
17953 /// Sets the value of [locations_details][crate::model::MirroringEndpointGroupAssociation::locations_details].
17954 ///
17955 /// # Example
17956 /// ```ignore,no_run
17957 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17958 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17959 /// let x = MirroringEndpointGroupAssociation::new()
17960 /// .set_locations_details([
17961 /// LocationDetails::default()/* use setters */,
17962 /// LocationDetails::default()/* use (different) setters */,
17963 /// ]);
17964 /// ```
17965 #[deprecated]
17966 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
17967 where
17968 T: std::iter::IntoIterator<Item = V>,
17969 V: std::convert::Into<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17970 {
17971 use std::iter::Iterator;
17972 self.locations_details = v.into_iter().map(|i| i.into()).collect();
17973 self
17974 }
17975
17976 /// Sets the value of [state][crate::model::MirroringEndpointGroupAssociation::state].
17977 ///
17978 /// # Example
17979 /// ```ignore,no_run
17980 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17981 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
17982 /// let x0 = MirroringEndpointGroupAssociation::new().set_state(State::Active);
17983 /// let x1 = MirroringEndpointGroupAssociation::new().set_state(State::Creating);
17984 /// let x2 = MirroringEndpointGroupAssociation::new().set_state(State::Deleting);
17985 /// ```
17986 pub fn set_state<
17987 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
17988 >(
17989 mut self,
17990 v: T,
17991 ) -> Self {
17992 self.state = v.into();
17993 self
17994 }
17995
17996 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroupAssociation::reconciling].
17997 ///
17998 /// # Example
17999 /// ```ignore,no_run
18000 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18001 /// let x = MirroringEndpointGroupAssociation::new().set_reconciling(true);
18002 /// ```
18003 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18004 self.reconciling = v.into();
18005 self
18006 }
18007
18008 /// Sets the value of [locations][crate::model::MirroringEndpointGroupAssociation::locations].
18009 ///
18010 /// # Example
18011 /// ```ignore,no_run
18012 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18013 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
18014 /// let x = MirroringEndpointGroupAssociation::new()
18015 /// .set_locations([
18016 /// MirroringLocation::default()/* use setters */,
18017 /// MirroringLocation::default()/* use (different) setters */,
18018 /// ]);
18019 /// ```
18020 pub fn set_locations<T, V>(mut self, v: T) -> Self
18021 where
18022 T: std::iter::IntoIterator<Item = V>,
18023 V: std::convert::Into<crate::model::MirroringLocation>,
18024 {
18025 use std::iter::Iterator;
18026 self.locations = v.into_iter().map(|i| i.into()).collect();
18027 self
18028 }
18029}
18030
18031impl wkt::message::Message for MirroringEndpointGroupAssociation {
18032 fn typename() -> &'static str {
18033 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation"
18034 }
18035}
18036
18037/// Defines additional types related to [MirroringEndpointGroupAssociation].
18038pub mod mirroring_endpoint_group_association {
18039 #[allow(unused_imports)]
18040 use super::*;
18041
18042 /// Contains details about the state of an association in a specific cloud
18043 /// location.
18044 #[derive(Clone, Default, PartialEq)]
18045 #[non_exhaustive]
18046 pub struct LocationDetails {
18047 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
18048 pub location: std::string::String,
18049
18050 /// Output only. The current state of the association in this location.
18051 pub state: crate::model::mirroring_endpoint_group_association::location_details::State,
18052
18053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18054 }
18055
18056 impl LocationDetails {
18057 /// Creates a new default instance.
18058 pub fn new() -> Self {
18059 std::default::Default::default()
18060 }
18061
18062 /// Sets the value of [location][crate::model::mirroring_endpoint_group_association::LocationDetails::location].
18063 ///
18064 /// # Example
18065 /// ```ignore,no_run
18066 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
18067 /// let x = LocationDetails::new().set_location("example");
18068 /// ```
18069 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18070 self.location = v.into();
18071 self
18072 }
18073
18074 /// Sets the value of [state][crate::model::mirroring_endpoint_group_association::LocationDetails::state].
18075 ///
18076 /// # Example
18077 /// ```ignore,no_run
18078 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
18079 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::location_details::State;
18080 /// let x0 = LocationDetails::new().set_state(State::Active);
18081 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
18082 /// ```
18083 pub fn set_state<
18084 T: std::convert::Into<
18085 crate::model::mirroring_endpoint_group_association::location_details::State,
18086 >,
18087 >(
18088 mut self,
18089 v: T,
18090 ) -> Self {
18091 self.state = v.into();
18092 self
18093 }
18094 }
18095
18096 impl wkt::message::Message for LocationDetails {
18097 fn typename() -> &'static str {
18098 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails"
18099 }
18100 }
18101
18102 /// Defines additional types related to [LocationDetails].
18103 pub mod location_details {
18104 #[allow(unused_imports)]
18105 use super::*;
18106
18107 /// The state of association.
18108 ///
18109 /// # Working with unknown values
18110 ///
18111 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18112 /// additional enum variants at any time. Adding new variants is not considered
18113 /// a breaking change. Applications should write their code in anticipation of:
18114 ///
18115 /// - New values appearing in future releases of the client library, **and**
18116 /// - New values received dynamically, without application changes.
18117 ///
18118 /// Please consult the [Working with enums] section in the user guide for some
18119 /// guidelines.
18120 ///
18121 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18122 #[derive(Clone, Debug, PartialEq)]
18123 #[non_exhaustive]
18124 pub enum State {
18125 /// Not set.
18126 Unspecified,
18127 /// The association is ready and in sync with the linked endpoint group.
18128 Active,
18129 /// The association is out of sync with the linked endpoint group.
18130 /// In most cases, this is a result of a transient issue within the system
18131 /// (e.g. an inaccessible location) and the system is expected to recover
18132 /// automatically.
18133 OutOfSync,
18134 /// If set, the enum was initialized with an unknown value.
18135 ///
18136 /// Applications can examine the value using [State::value] or
18137 /// [State::name].
18138 UnknownValue(state::UnknownValue),
18139 }
18140
18141 #[doc(hidden)]
18142 pub mod state {
18143 #[allow(unused_imports)]
18144 use super::*;
18145 #[derive(Clone, Debug, PartialEq)]
18146 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18147 }
18148
18149 impl State {
18150 /// Gets the enum value.
18151 ///
18152 /// Returns `None` if the enum contains an unknown value deserialized from
18153 /// the string representation of enums.
18154 pub fn value(&self) -> std::option::Option<i32> {
18155 match self {
18156 Self::Unspecified => std::option::Option::Some(0),
18157 Self::Active => std::option::Option::Some(1),
18158 Self::OutOfSync => std::option::Option::Some(2),
18159 Self::UnknownValue(u) => u.0.value(),
18160 }
18161 }
18162
18163 /// Gets the enum value as a string.
18164 ///
18165 /// Returns `None` if the enum contains an unknown value deserialized from
18166 /// the integer representation of enums.
18167 pub fn name(&self) -> std::option::Option<&str> {
18168 match self {
18169 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18170 Self::Active => std::option::Option::Some("ACTIVE"),
18171 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
18172 Self::UnknownValue(u) => u.0.name(),
18173 }
18174 }
18175 }
18176
18177 impl std::default::Default for State {
18178 fn default() -> Self {
18179 use std::convert::From;
18180 Self::from(0)
18181 }
18182 }
18183
18184 impl std::fmt::Display for State {
18185 fn fmt(
18186 &self,
18187 f: &mut std::fmt::Formatter<'_>,
18188 ) -> std::result::Result<(), std::fmt::Error> {
18189 wkt::internal::display_enum(f, self.name(), self.value())
18190 }
18191 }
18192
18193 impl std::convert::From<i32> for State {
18194 fn from(value: i32) -> Self {
18195 match value {
18196 0 => Self::Unspecified,
18197 1 => Self::Active,
18198 2 => Self::OutOfSync,
18199 _ => Self::UnknownValue(state::UnknownValue(
18200 wkt::internal::UnknownEnumValue::Integer(value),
18201 )),
18202 }
18203 }
18204 }
18205
18206 impl std::convert::From<&str> for State {
18207 fn from(value: &str) -> Self {
18208 use std::string::ToString;
18209 match value {
18210 "STATE_UNSPECIFIED" => Self::Unspecified,
18211 "ACTIVE" => Self::Active,
18212 "OUT_OF_SYNC" => Self::OutOfSync,
18213 _ => Self::UnknownValue(state::UnknownValue(
18214 wkt::internal::UnknownEnumValue::String(value.to_string()),
18215 )),
18216 }
18217 }
18218 }
18219
18220 impl serde::ser::Serialize for State {
18221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18222 where
18223 S: serde::Serializer,
18224 {
18225 match self {
18226 Self::Unspecified => serializer.serialize_i32(0),
18227 Self::Active => serializer.serialize_i32(1),
18228 Self::OutOfSync => serializer.serialize_i32(2),
18229 Self::UnknownValue(u) => u.0.serialize(serializer),
18230 }
18231 }
18232 }
18233
18234 impl<'de> serde::de::Deserialize<'de> for State {
18235 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18236 where
18237 D: serde::Deserializer<'de>,
18238 {
18239 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18240 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State"))
18241 }
18242 }
18243 }
18244
18245 /// The state of the association.
18246 ///
18247 /// # Working with unknown values
18248 ///
18249 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18250 /// additional enum variants at any time. Adding new variants is not considered
18251 /// a breaking change. Applications should write their code in anticipation of:
18252 ///
18253 /// - New values appearing in future releases of the client library, **and**
18254 /// - New values received dynamically, without application changes.
18255 ///
18256 /// Please consult the [Working with enums] section in the user guide for some
18257 /// guidelines.
18258 ///
18259 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18260 #[derive(Clone, Debug, PartialEq)]
18261 #[non_exhaustive]
18262 pub enum State {
18263 /// Not set.
18264 Unspecified,
18265 /// The association is ready and in sync with the linked endpoint group.
18266 Active,
18267 /// The association is being created.
18268 Creating,
18269 /// The association is being deleted.
18270 Deleting,
18271 /// The association is disabled due to a breaking change in another resource.
18272 Closed,
18273 /// The association is out of sync with the linked endpoint group.
18274 /// In most cases, this is a result of a transient issue within the system
18275 /// (e.g. an inaccessible location) and the system is expected to recover
18276 /// automatically. Check the `locations_details` field for more details.
18277 OutOfSync,
18278 /// An attempt to delete the association has failed. This is a terminal state
18279 /// and the association is not expected to be usable as some of its resources
18280 /// have been deleted.
18281 /// The only permitted operation is to retry deleting the association.
18282 DeleteFailed,
18283 /// If set, the enum was initialized with an unknown value.
18284 ///
18285 /// Applications can examine the value using [State::value] or
18286 /// [State::name].
18287 UnknownValue(state::UnknownValue),
18288 }
18289
18290 #[doc(hidden)]
18291 pub mod state {
18292 #[allow(unused_imports)]
18293 use super::*;
18294 #[derive(Clone, Debug, PartialEq)]
18295 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18296 }
18297
18298 impl State {
18299 /// Gets the enum value.
18300 ///
18301 /// Returns `None` if the enum contains an unknown value deserialized from
18302 /// the string representation of enums.
18303 pub fn value(&self) -> std::option::Option<i32> {
18304 match self {
18305 Self::Unspecified => std::option::Option::Some(0),
18306 Self::Active => std::option::Option::Some(1),
18307 Self::Creating => std::option::Option::Some(3),
18308 Self::Deleting => std::option::Option::Some(4),
18309 Self::Closed => std::option::Option::Some(5),
18310 Self::OutOfSync => std::option::Option::Some(6),
18311 Self::DeleteFailed => std::option::Option::Some(7),
18312 Self::UnknownValue(u) => u.0.value(),
18313 }
18314 }
18315
18316 /// Gets the enum value as a string.
18317 ///
18318 /// Returns `None` if the enum contains an unknown value deserialized from
18319 /// the integer representation of enums.
18320 pub fn name(&self) -> std::option::Option<&str> {
18321 match self {
18322 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18323 Self::Active => std::option::Option::Some("ACTIVE"),
18324 Self::Creating => std::option::Option::Some("CREATING"),
18325 Self::Deleting => std::option::Option::Some("DELETING"),
18326 Self::Closed => std::option::Option::Some("CLOSED"),
18327 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
18328 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
18329 Self::UnknownValue(u) => u.0.name(),
18330 }
18331 }
18332 }
18333
18334 impl std::default::Default for State {
18335 fn default() -> Self {
18336 use std::convert::From;
18337 Self::from(0)
18338 }
18339 }
18340
18341 impl std::fmt::Display for State {
18342 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18343 wkt::internal::display_enum(f, self.name(), self.value())
18344 }
18345 }
18346
18347 impl std::convert::From<i32> for State {
18348 fn from(value: i32) -> Self {
18349 match value {
18350 0 => Self::Unspecified,
18351 1 => Self::Active,
18352 3 => Self::Creating,
18353 4 => Self::Deleting,
18354 5 => Self::Closed,
18355 6 => Self::OutOfSync,
18356 7 => Self::DeleteFailed,
18357 _ => Self::UnknownValue(state::UnknownValue(
18358 wkt::internal::UnknownEnumValue::Integer(value),
18359 )),
18360 }
18361 }
18362 }
18363
18364 impl std::convert::From<&str> for State {
18365 fn from(value: &str) -> Self {
18366 use std::string::ToString;
18367 match value {
18368 "STATE_UNSPECIFIED" => Self::Unspecified,
18369 "ACTIVE" => Self::Active,
18370 "CREATING" => Self::Creating,
18371 "DELETING" => Self::Deleting,
18372 "CLOSED" => Self::Closed,
18373 "OUT_OF_SYNC" => Self::OutOfSync,
18374 "DELETE_FAILED" => Self::DeleteFailed,
18375 _ => Self::UnknownValue(state::UnknownValue(
18376 wkt::internal::UnknownEnumValue::String(value.to_string()),
18377 )),
18378 }
18379 }
18380 }
18381
18382 impl serde::ser::Serialize for State {
18383 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18384 where
18385 S: serde::Serializer,
18386 {
18387 match self {
18388 Self::Unspecified => serializer.serialize_i32(0),
18389 Self::Active => serializer.serialize_i32(1),
18390 Self::Creating => serializer.serialize_i32(3),
18391 Self::Deleting => serializer.serialize_i32(4),
18392 Self::Closed => serializer.serialize_i32(5),
18393 Self::OutOfSync => serializer.serialize_i32(6),
18394 Self::DeleteFailed => serializer.serialize_i32(7),
18395 Self::UnknownValue(u) => u.0.serialize(serializer),
18396 }
18397 }
18398 }
18399
18400 impl<'de> serde::de::Deserialize<'de> for State {
18401 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18402 where
18403 D: serde::Deserializer<'de>,
18404 {
18405 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18406 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State",
18407 ))
18408 }
18409 }
18410}
18411
18412/// Request message for ListMirroringEndpointGroupAssociations.
18413#[derive(Clone, Default, PartialEq)]
18414#[non_exhaustive]
18415pub struct ListMirroringEndpointGroupAssociationsRequest {
18416 /// Required. The parent, which owns this collection of associations.
18417 /// Example: `projects/123456789/locations/global`.
18418 /// See <https://google.aip.dev/132> for more details.
18419 pub parent: std::string::String,
18420
18421 /// Optional. Requested page size. Server may return fewer items than
18422 /// requested. If unspecified, server will pick an appropriate default. See
18423 /// <https://google.aip.dev/158> for more details.
18424 pub page_size: i32,
18425
18426 /// Optional. A page token, received from a previous
18427 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
18428 /// page. When paginating, all other parameters provided to
18429 /// `ListMirroringEndpointGroups` must match the call that provided the page
18430 /// token. See <https://google.aip.dev/158> for more details.
18431 pub page_token: std::string::String,
18432
18433 /// Optional. Filter expression.
18434 /// See <https://google.aip.dev/160#filtering> for more details.
18435 pub filter: std::string::String,
18436
18437 /// Optional. Sort expression.
18438 /// See <https://google.aip.dev/132#ordering> for more details.
18439 pub order_by: std::string::String,
18440
18441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18442}
18443
18444impl ListMirroringEndpointGroupAssociationsRequest {
18445 /// Creates a new default instance.
18446 pub fn new() -> Self {
18447 std::default::Default::default()
18448 }
18449
18450 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
18451 ///
18452 /// # Example
18453 /// ```ignore,no_run
18454 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18455 /// # let project_id = "project_id";
18456 /// # let location_id = "location_id";
18457 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18458 /// ```
18459 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18460 self.parent = v.into();
18461 self
18462 }
18463
18464 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
18465 ///
18466 /// # Example
18467 /// ```ignore,no_run
18468 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18469 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_size(42);
18470 /// ```
18471 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18472 self.page_size = v.into();
18473 self
18474 }
18475
18476 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
18477 ///
18478 /// # Example
18479 /// ```ignore,no_run
18480 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18481 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_token("example");
18482 /// ```
18483 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18484 self.page_token = v.into();
18485 self
18486 }
18487
18488 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
18489 ///
18490 /// # Example
18491 /// ```ignore,no_run
18492 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18493 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_filter("example");
18494 /// ```
18495 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18496 self.filter = v.into();
18497 self
18498 }
18499
18500 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
18501 ///
18502 /// # Example
18503 /// ```ignore,no_run
18504 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18505 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_order_by("example");
18506 /// ```
18507 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18508 self.order_by = v.into();
18509 self
18510 }
18511}
18512
18513impl wkt::message::Message for ListMirroringEndpointGroupAssociationsRequest {
18514 fn typename() -> &'static str {
18515 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest"
18516 }
18517}
18518
18519/// Response message for ListMirroringEndpointGroupAssociations.
18520#[derive(Clone, Default, PartialEq)]
18521#[non_exhaustive]
18522pub struct ListMirroringEndpointGroupAssociationsResponse {
18523 /// The associations from the specified parent.
18524 pub mirroring_endpoint_group_associations:
18525 std::vec::Vec<crate::model::MirroringEndpointGroupAssociation>,
18526
18527 /// A token that can be sent as `page_token` to retrieve the next page.
18528 /// If this field is omitted, there are no subsequent pages.
18529 /// See <https://google.aip.dev/158> for more details.
18530 pub next_page_token: std::string::String,
18531
18532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18533}
18534
18535impl ListMirroringEndpointGroupAssociationsResponse {
18536 /// Creates a new default instance.
18537 pub fn new() -> Self {
18538 std::default::Default::default()
18539 }
18540
18541 /// Sets the value of [mirroring_endpoint_group_associations][crate::model::ListMirroringEndpointGroupAssociationsResponse::mirroring_endpoint_group_associations].
18542 ///
18543 /// # Example
18544 /// ```ignore,no_run
18545 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18546 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18547 /// let x = ListMirroringEndpointGroupAssociationsResponse::new()
18548 /// .set_mirroring_endpoint_group_associations([
18549 /// MirroringEndpointGroupAssociation::default()/* use setters */,
18550 /// MirroringEndpointGroupAssociation::default()/* use (different) setters */,
18551 /// ]);
18552 /// ```
18553 pub fn set_mirroring_endpoint_group_associations<T, V>(mut self, v: T) -> Self
18554 where
18555 T: std::iter::IntoIterator<Item = V>,
18556 V: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18557 {
18558 use std::iter::Iterator;
18559 self.mirroring_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
18560 self
18561 }
18562
18563 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupAssociationsResponse::next_page_token].
18564 ///
18565 /// # Example
18566 /// ```ignore,no_run
18567 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18568 /// let x = ListMirroringEndpointGroupAssociationsResponse::new().set_next_page_token("example");
18569 /// ```
18570 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18571 self.next_page_token = v.into();
18572 self
18573 }
18574}
18575
18576impl wkt::message::Message for ListMirroringEndpointGroupAssociationsResponse {
18577 fn typename() -> &'static str {
18578 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse"
18579 }
18580}
18581
18582#[doc(hidden)]
18583impl google_cloud_gax::paginator::internal::PageableResponse
18584 for ListMirroringEndpointGroupAssociationsResponse
18585{
18586 type PageItem = crate::model::MirroringEndpointGroupAssociation;
18587
18588 fn items(self) -> std::vec::Vec<Self::PageItem> {
18589 self.mirroring_endpoint_group_associations
18590 }
18591
18592 fn next_page_token(&self) -> std::string::String {
18593 use std::clone::Clone;
18594 self.next_page_token.clone()
18595 }
18596}
18597
18598/// Request message for GetMirroringEndpointGroupAssociation.
18599#[derive(Clone, Default, PartialEq)]
18600#[non_exhaustive]
18601pub struct GetMirroringEndpointGroupAssociationRequest {
18602 /// Required. The name of the association to retrieve.
18603 /// Format:
18604 /// projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}
18605 pub name: std::string::String,
18606
18607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18608}
18609
18610impl GetMirroringEndpointGroupAssociationRequest {
18611 /// Creates a new default instance.
18612 pub fn new() -> Self {
18613 std::default::Default::default()
18614 }
18615
18616 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
18617 ///
18618 /// # Example
18619 /// ```ignore,no_run
18620 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupAssociationRequest;
18621 /// # let project_id = "project_id";
18622 /// # let location_id = "location_id";
18623 /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
18624 /// let x = GetMirroringEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
18625 /// ```
18626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18627 self.name = v.into();
18628 self
18629 }
18630}
18631
18632impl wkt::message::Message for GetMirroringEndpointGroupAssociationRequest {
18633 fn typename() -> &'static str {
18634 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest"
18635 }
18636}
18637
18638/// Request message for CreateMirroringEndpointGroupAssociation.
18639#[derive(Clone, Default, PartialEq)]
18640#[non_exhaustive]
18641pub struct CreateMirroringEndpointGroupAssociationRequest {
18642 /// Required. The parent resource where this association will be created.
18643 /// Format: projects/{project}/locations/{location}
18644 pub parent: std::string::String,
18645
18646 /// Optional. The ID to use for the new association, which will become the
18647 /// final component of the endpoint group's resource name. If not provided, the
18648 /// server will generate a unique ID.
18649 pub mirroring_endpoint_group_association_id: std::string::String,
18650
18651 /// Required. The association to create.
18652 pub mirroring_endpoint_group_association:
18653 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18654
18655 /// Optional. A unique identifier for this request. Must be a UUID4.
18656 /// This request is only idempotent if a `request_id` is provided.
18657 /// See <https://google.aip.dev/155> for more details.
18658 pub request_id: std::string::String,
18659
18660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18661}
18662
18663impl CreateMirroringEndpointGroupAssociationRequest {
18664 /// Creates a new default instance.
18665 pub fn new() -> Self {
18666 std::default::Default::default()
18667 }
18668
18669 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
18670 ///
18671 /// # Example
18672 /// ```ignore,no_run
18673 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18674 /// # let project_id = "project_id";
18675 /// # let location_id = "location_id";
18676 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
18677 /// ```
18678 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18679 self.parent = v.into();
18680 self
18681 }
18682
18683 /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
18684 ///
18685 /// # Example
18686 /// ```ignore,no_run
18687 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18688 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association_id("example");
18689 /// ```
18690 pub fn set_mirroring_endpoint_group_association_id<
18691 T: std::convert::Into<std::string::String>,
18692 >(
18693 mut self,
18694 v: T,
18695 ) -> Self {
18696 self.mirroring_endpoint_group_association_id = v.into();
18697 self
18698 }
18699
18700 /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18701 ///
18702 /// # Example
18703 /// ```ignore,no_run
18704 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18705 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18706 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18707 /// ```
18708 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18709 where
18710 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18711 {
18712 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18713 self
18714 }
18715
18716 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18717 ///
18718 /// # Example
18719 /// ```ignore,no_run
18720 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18721 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18722 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18723 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18724 /// ```
18725 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18726 mut self,
18727 v: std::option::Option<T>,
18728 ) -> Self
18729 where
18730 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18731 {
18732 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18733 self
18734 }
18735
18736 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
18737 ///
18738 /// # Example
18739 /// ```ignore,no_run
18740 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18741 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18742 /// ```
18743 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18744 self.request_id = v.into();
18745 self
18746 }
18747}
18748
18749impl wkt::message::Message for CreateMirroringEndpointGroupAssociationRequest {
18750 fn typename() -> &'static str {
18751 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest"
18752 }
18753}
18754
18755/// Request message for UpdateMirroringEndpointGroupAssociation.
18756#[derive(Clone, Default, PartialEq)]
18757#[non_exhaustive]
18758pub struct UpdateMirroringEndpointGroupAssociationRequest {
18759 /// Optional. The list of fields to update.
18760 /// Fields are specified relative to the association
18761 /// (e.g. `description`; *not*
18762 /// `mirroring_endpoint_group_association.description`). See
18763 /// <https://google.aip.dev/161> for more details.
18764 pub update_mask: std::option::Option<wkt::FieldMask>,
18765
18766 /// Required. The association to update.
18767 pub mirroring_endpoint_group_association:
18768 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18769
18770 /// Optional. A unique identifier for this request. Must be a UUID4.
18771 /// This request is only idempotent if a `request_id` is provided.
18772 /// See <https://google.aip.dev/155> for more details.
18773 pub request_id: std::string::String,
18774
18775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18776}
18777
18778impl UpdateMirroringEndpointGroupAssociationRequest {
18779 /// Creates a new default instance.
18780 pub fn new() -> Self {
18781 std::default::Default::default()
18782 }
18783
18784 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18785 ///
18786 /// # Example
18787 /// ```ignore,no_run
18788 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18789 /// use wkt::FieldMask;
18790 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
18791 /// ```
18792 pub fn set_update_mask<T>(mut self, v: T) -> Self
18793 where
18794 T: std::convert::Into<wkt::FieldMask>,
18795 {
18796 self.update_mask = std::option::Option::Some(v.into());
18797 self
18798 }
18799
18800 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18801 ///
18802 /// # Example
18803 /// ```ignore,no_run
18804 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18805 /// use wkt::FieldMask;
18806 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
18807 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
18808 /// ```
18809 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18810 where
18811 T: std::convert::Into<wkt::FieldMask>,
18812 {
18813 self.update_mask = v.map(|x| x.into());
18814 self
18815 }
18816
18817 /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18818 ///
18819 /// # Example
18820 /// ```ignore,no_run
18821 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18822 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18823 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18824 /// ```
18825 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18826 where
18827 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18828 {
18829 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18830 self
18831 }
18832
18833 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18834 ///
18835 /// # Example
18836 /// ```ignore,no_run
18837 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18838 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18839 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18840 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18841 /// ```
18842 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18843 mut self,
18844 v: std::option::Option<T>,
18845 ) -> Self
18846 where
18847 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18848 {
18849 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18850 self
18851 }
18852
18853 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
18854 ///
18855 /// # Example
18856 /// ```ignore,no_run
18857 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18858 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18859 /// ```
18860 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18861 self.request_id = v.into();
18862 self
18863 }
18864}
18865
18866impl wkt::message::Message for UpdateMirroringEndpointGroupAssociationRequest {
18867 fn typename() -> &'static str {
18868 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest"
18869 }
18870}
18871
18872/// Request message for DeleteMirroringEndpointGroupAssociation.
18873#[derive(Clone, Default, PartialEq)]
18874#[non_exhaustive]
18875pub struct DeleteMirroringEndpointGroupAssociationRequest {
18876 /// Required. The association to delete.
18877 pub name: std::string::String,
18878
18879 /// Optional. A unique identifier for this request. Must be a UUID4.
18880 /// This request is only idempotent if a `request_id` is provided.
18881 /// See <https://google.aip.dev/155> for more details.
18882 pub request_id: std::string::String,
18883
18884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18885}
18886
18887impl DeleteMirroringEndpointGroupAssociationRequest {
18888 /// Creates a new default instance.
18889 pub fn new() -> Self {
18890 std::default::Default::default()
18891 }
18892
18893 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
18894 ///
18895 /// # Example
18896 /// ```ignore,no_run
18897 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18898 /// # let project_id = "project_id";
18899 /// # let location_id = "location_id";
18900 /// # let mirroring_endpoint_group_association_id = "mirroring_endpoint_group_association_id";
18901 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association_id}"));
18902 /// ```
18903 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18904 self.name = v.into();
18905 self
18906 }
18907
18908 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
18909 ///
18910 /// # Example
18911 /// ```ignore,no_run
18912 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18913 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18914 /// ```
18915 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18916 self.request_id = v.into();
18917 self
18918 }
18919}
18920
18921impl wkt::message::Message for DeleteMirroringEndpointGroupAssociationRequest {
18922 fn typename() -> &'static str {
18923 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest"
18924 }
18925}
18926
18927/// A deployment group aggregates many zonal mirroring backends (deployments)
18928/// into a single global mirroring service. Consumers can connect this service
18929/// using an endpoint group.
18930#[derive(Clone, Default, PartialEq)]
18931#[non_exhaustive]
18932pub struct MirroringDeploymentGroup {
18933 /// Immutable. Identifier. The resource name of this deployment group, for
18934 /// example:
18935 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
18936 /// See <https://google.aip.dev/122> for more details.
18937 pub name: std::string::String,
18938
18939 /// Output only. The timestamp when the resource was created.
18940 /// See <https://google.aip.dev/148#timestamps>.
18941 pub create_time: std::option::Option<wkt::Timestamp>,
18942
18943 /// Output only. The timestamp when the resource was most recently updated.
18944 /// See <https://google.aip.dev/148#timestamps>.
18945 pub update_time: std::option::Option<wkt::Timestamp>,
18946
18947 /// Optional. Labels are key/value pairs that help to organize and filter
18948 /// resources.
18949 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18950
18951 /// Required. Immutable. The network that will be used for all child
18952 /// deployments, for example: `projects/{project}/global/networks/{network}`.
18953 /// See <https://google.aip.dev/124>.
18954 pub network: std::string::String,
18955
18956 /// Output only. The list of endpoint groups that are connected to this
18957 /// resource.
18958 pub connected_endpoint_groups:
18959 std::vec::Vec<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18960
18961 /// Output only. The list of Mirroring Deployments that belong to this group.
18962 #[deprecated]
18963 pub nested_deployments: std::vec::Vec<crate::model::mirroring_deployment_group::Deployment>,
18964
18965 /// Output only. The current state of the deployment group.
18966 /// See <https://google.aip.dev/216>.
18967 pub state: crate::model::mirroring_deployment_group::State,
18968
18969 /// Output only. The current state of the resource does not match the user's
18970 /// intended state, and the system is working to reconcile them. This is part
18971 /// of the normal operation (e.g. adding a new deployment to the group) See
18972 /// <https://google.aip.dev/128>.
18973 pub reconciling: bool,
18974
18975 /// Optional. User-provided description of the deployment group.
18976 /// Used as additional context for the deployment group.
18977 pub description: std::string::String,
18978
18979 /// Output only. The list of locations where the deployment group is present.
18980 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
18981
18982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18983}
18984
18985impl MirroringDeploymentGroup {
18986 /// Creates a new default instance.
18987 pub fn new() -> Self {
18988 std::default::Default::default()
18989 }
18990
18991 /// Sets the value of [name][crate::model::MirroringDeploymentGroup::name].
18992 ///
18993 /// # Example
18994 /// ```ignore,no_run
18995 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18996 /// # let project_id = "project_id";
18997 /// # let location_id = "location_id";
18998 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
18999 /// let x = MirroringDeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19000 /// ```
19001 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19002 self.name = v.into();
19003 self
19004 }
19005
19006 /// Sets the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
19007 ///
19008 /// # Example
19009 /// ```ignore,no_run
19010 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19011 /// use wkt::Timestamp;
19012 /// let x = MirroringDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
19013 /// ```
19014 pub fn set_create_time<T>(mut self, v: T) -> Self
19015 where
19016 T: std::convert::Into<wkt::Timestamp>,
19017 {
19018 self.create_time = std::option::Option::Some(v.into());
19019 self
19020 }
19021
19022 /// Sets or clears the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
19023 ///
19024 /// # Example
19025 /// ```ignore,no_run
19026 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19027 /// use wkt::Timestamp;
19028 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
19029 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
19030 /// ```
19031 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
19032 where
19033 T: std::convert::Into<wkt::Timestamp>,
19034 {
19035 self.create_time = v.map(|x| x.into());
19036 self
19037 }
19038
19039 /// Sets the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
19040 ///
19041 /// # Example
19042 /// ```ignore,no_run
19043 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19044 /// use wkt::Timestamp;
19045 /// let x = MirroringDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
19046 /// ```
19047 pub fn set_update_time<T>(mut self, v: T) -> Self
19048 where
19049 T: std::convert::Into<wkt::Timestamp>,
19050 {
19051 self.update_time = std::option::Option::Some(v.into());
19052 self
19053 }
19054
19055 /// Sets or clears the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
19056 ///
19057 /// # Example
19058 /// ```ignore,no_run
19059 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19060 /// use wkt::Timestamp;
19061 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
19062 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
19063 /// ```
19064 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
19065 where
19066 T: std::convert::Into<wkt::Timestamp>,
19067 {
19068 self.update_time = v.map(|x| x.into());
19069 self
19070 }
19071
19072 /// Sets the value of [labels][crate::model::MirroringDeploymentGroup::labels].
19073 ///
19074 /// # Example
19075 /// ```ignore,no_run
19076 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19077 /// let x = MirroringDeploymentGroup::new().set_labels([
19078 /// ("key0", "abc"),
19079 /// ("key1", "xyz"),
19080 /// ]);
19081 /// ```
19082 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
19083 where
19084 T: std::iter::IntoIterator<Item = (K, V)>,
19085 K: std::convert::Into<std::string::String>,
19086 V: std::convert::Into<std::string::String>,
19087 {
19088 use std::iter::Iterator;
19089 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
19090 self
19091 }
19092
19093 /// Sets the value of [network][crate::model::MirroringDeploymentGroup::network].
19094 ///
19095 /// # Example
19096 /// ```ignore,no_run
19097 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19098 /// let x = MirroringDeploymentGroup::new().set_network("example");
19099 /// ```
19100 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19101 self.network = v.into();
19102 self
19103 }
19104
19105 /// Sets the value of [connected_endpoint_groups][crate::model::MirroringDeploymentGroup::connected_endpoint_groups].
19106 ///
19107 /// # Example
19108 /// ```ignore,no_run
19109 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19110 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
19111 /// let x = MirroringDeploymentGroup::new()
19112 /// .set_connected_endpoint_groups([
19113 /// ConnectedEndpointGroup::default()/* use setters */,
19114 /// ConnectedEndpointGroup::default()/* use (different) setters */,
19115 /// ]);
19116 /// ```
19117 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
19118 where
19119 T: std::iter::IntoIterator<Item = V>,
19120 V: std::convert::Into<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
19121 {
19122 use std::iter::Iterator;
19123 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
19124 self
19125 }
19126
19127 /// Sets the value of [nested_deployments][crate::model::MirroringDeploymentGroup::nested_deployments].
19128 ///
19129 /// # Example
19130 /// ```ignore,no_run
19131 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19132 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19133 /// let x = MirroringDeploymentGroup::new()
19134 /// .set_nested_deployments([
19135 /// Deployment::default()/* use setters */,
19136 /// Deployment::default()/* use (different) setters */,
19137 /// ]);
19138 /// ```
19139 #[deprecated]
19140 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
19141 where
19142 T: std::iter::IntoIterator<Item = V>,
19143 V: std::convert::Into<crate::model::mirroring_deployment_group::Deployment>,
19144 {
19145 use std::iter::Iterator;
19146 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
19147 self
19148 }
19149
19150 /// Sets the value of [state][crate::model::MirroringDeploymentGroup::state].
19151 ///
19152 /// # Example
19153 /// ```ignore,no_run
19154 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19155 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::State;
19156 /// let x0 = MirroringDeploymentGroup::new().set_state(State::Active);
19157 /// let x1 = MirroringDeploymentGroup::new().set_state(State::Creating);
19158 /// let x2 = MirroringDeploymentGroup::new().set_state(State::Deleting);
19159 /// ```
19160 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment_group::State>>(
19161 mut self,
19162 v: T,
19163 ) -> Self {
19164 self.state = v.into();
19165 self
19166 }
19167
19168 /// Sets the value of [reconciling][crate::model::MirroringDeploymentGroup::reconciling].
19169 ///
19170 /// # Example
19171 /// ```ignore,no_run
19172 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19173 /// let x = MirroringDeploymentGroup::new().set_reconciling(true);
19174 /// ```
19175 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19176 self.reconciling = v.into();
19177 self
19178 }
19179
19180 /// Sets the value of [description][crate::model::MirroringDeploymentGroup::description].
19181 ///
19182 /// # Example
19183 /// ```ignore,no_run
19184 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19185 /// let x = MirroringDeploymentGroup::new().set_description("example");
19186 /// ```
19187 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19188 self.description = v.into();
19189 self
19190 }
19191
19192 /// Sets the value of [locations][crate::model::MirroringDeploymentGroup::locations].
19193 ///
19194 /// # Example
19195 /// ```ignore,no_run
19196 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19197 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
19198 /// let x = MirroringDeploymentGroup::new()
19199 /// .set_locations([
19200 /// MirroringLocation::default()/* use setters */,
19201 /// MirroringLocation::default()/* use (different) setters */,
19202 /// ]);
19203 /// ```
19204 pub fn set_locations<T, V>(mut self, v: T) -> Self
19205 where
19206 T: std::iter::IntoIterator<Item = V>,
19207 V: std::convert::Into<crate::model::MirroringLocation>,
19208 {
19209 use std::iter::Iterator;
19210 self.locations = v.into_iter().map(|i| i.into()).collect();
19211 self
19212 }
19213}
19214
19215impl wkt::message::Message for MirroringDeploymentGroup {
19216 fn typename() -> &'static str {
19217 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup"
19218 }
19219}
19220
19221/// Defines additional types related to [MirroringDeploymentGroup].
19222pub mod mirroring_deployment_group {
19223 #[allow(unused_imports)]
19224 use super::*;
19225
19226 /// An endpoint group connected to this deployment group.
19227 #[derive(Clone, Default, PartialEq)]
19228 #[non_exhaustive]
19229 pub struct ConnectedEndpointGroup {
19230 /// Output only. The connected endpoint group's resource name, for example:
19231 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
19232 /// See <https://google.aip.dev/124>.
19233 pub name: std::string::String,
19234
19235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19236 }
19237
19238 impl ConnectedEndpointGroup {
19239 /// Creates a new default instance.
19240 pub fn new() -> Self {
19241 std::default::Default::default()
19242 }
19243
19244 /// Sets the value of [name][crate::model::mirroring_deployment_group::ConnectedEndpointGroup::name].
19245 ///
19246 /// # Example
19247 /// ```ignore,no_run
19248 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
19249 /// # let project_id = "project_id";
19250 /// # let location_id = "location_id";
19251 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
19252 /// let x = ConnectedEndpointGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
19253 /// ```
19254 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19255 self.name = v.into();
19256 self
19257 }
19258 }
19259
19260 impl wkt::message::Message for ConnectedEndpointGroup {
19261 fn typename() -> &'static str {
19262 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup"
19263 }
19264 }
19265
19266 /// A deployment belonging to this deployment group.
19267 #[derive(Clone, Default, PartialEq)]
19268 #[non_exhaustive]
19269 pub struct Deployment {
19270 /// Output only. The name of the Mirroring Deployment, in the format:
19271 /// `projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}`.
19272 pub name: std::string::String,
19273
19274 /// Output only. Most recent known state of the deployment.
19275 pub state: crate::model::mirroring_deployment::State,
19276
19277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19278 }
19279
19280 impl Deployment {
19281 /// Creates a new default instance.
19282 pub fn new() -> Self {
19283 std::default::Default::default()
19284 }
19285
19286 /// Sets the value of [name][crate::model::mirroring_deployment_group::Deployment::name].
19287 ///
19288 /// # Example
19289 /// ```ignore,no_run
19290 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19291 /// # let project_id = "project_id";
19292 /// # let location_id = "location_id";
19293 /// # let mirroring_deployment_id = "mirroring_deployment_id";
19294 /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
19295 /// ```
19296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19297 self.name = v.into();
19298 self
19299 }
19300
19301 /// Sets the value of [state][crate::model::mirroring_deployment_group::Deployment::state].
19302 ///
19303 /// # Example
19304 /// ```ignore,no_run
19305 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
19306 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
19307 /// let x0 = Deployment::new().set_state(State::Active);
19308 /// let x1 = Deployment::new().set_state(State::Creating);
19309 /// let x2 = Deployment::new().set_state(State::Deleting);
19310 /// ```
19311 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
19312 mut self,
19313 v: T,
19314 ) -> Self {
19315 self.state = v.into();
19316 self
19317 }
19318 }
19319
19320 impl wkt::message::Message for Deployment {
19321 fn typename() -> &'static str {
19322 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment"
19323 }
19324 }
19325
19326 /// The current state of the deployment group.
19327 ///
19328 /// # Working with unknown values
19329 ///
19330 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19331 /// additional enum variants at any time. Adding new variants is not considered
19332 /// a breaking change. Applications should write their code in anticipation of:
19333 ///
19334 /// - New values appearing in future releases of the client library, **and**
19335 /// - New values received dynamically, without application changes.
19336 ///
19337 /// Please consult the [Working with enums] section in the user guide for some
19338 /// guidelines.
19339 ///
19340 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19341 #[derive(Clone, Debug, PartialEq)]
19342 #[non_exhaustive]
19343 pub enum State {
19344 /// State not set (this is not a valid state).
19345 Unspecified,
19346 /// The deployment group is ready.
19347 Active,
19348 /// The deployment group is being created.
19349 Creating,
19350 /// The deployment group is being deleted.
19351 Deleting,
19352 /// The deployment group is being wiped out (project deleted).
19353 Closed,
19354 /// If set, the enum was initialized with an unknown value.
19355 ///
19356 /// Applications can examine the value using [State::value] or
19357 /// [State::name].
19358 UnknownValue(state::UnknownValue),
19359 }
19360
19361 #[doc(hidden)]
19362 pub mod state {
19363 #[allow(unused_imports)]
19364 use super::*;
19365 #[derive(Clone, Debug, PartialEq)]
19366 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19367 }
19368
19369 impl State {
19370 /// Gets the enum value.
19371 ///
19372 /// Returns `None` if the enum contains an unknown value deserialized from
19373 /// the string representation of enums.
19374 pub fn value(&self) -> std::option::Option<i32> {
19375 match self {
19376 Self::Unspecified => std::option::Option::Some(0),
19377 Self::Active => std::option::Option::Some(1),
19378 Self::Creating => std::option::Option::Some(2),
19379 Self::Deleting => std::option::Option::Some(3),
19380 Self::Closed => std::option::Option::Some(4),
19381 Self::UnknownValue(u) => u.0.value(),
19382 }
19383 }
19384
19385 /// Gets the enum value as a string.
19386 ///
19387 /// Returns `None` if the enum contains an unknown value deserialized from
19388 /// the integer representation of enums.
19389 pub fn name(&self) -> std::option::Option<&str> {
19390 match self {
19391 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
19392 Self::Active => std::option::Option::Some("ACTIVE"),
19393 Self::Creating => std::option::Option::Some("CREATING"),
19394 Self::Deleting => std::option::Option::Some("DELETING"),
19395 Self::Closed => std::option::Option::Some("CLOSED"),
19396 Self::UnknownValue(u) => u.0.name(),
19397 }
19398 }
19399 }
19400
19401 impl std::default::Default for State {
19402 fn default() -> Self {
19403 use std::convert::From;
19404 Self::from(0)
19405 }
19406 }
19407
19408 impl std::fmt::Display for State {
19409 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19410 wkt::internal::display_enum(f, self.name(), self.value())
19411 }
19412 }
19413
19414 impl std::convert::From<i32> for State {
19415 fn from(value: i32) -> Self {
19416 match value {
19417 0 => Self::Unspecified,
19418 1 => Self::Active,
19419 2 => Self::Creating,
19420 3 => Self::Deleting,
19421 4 => Self::Closed,
19422 _ => Self::UnknownValue(state::UnknownValue(
19423 wkt::internal::UnknownEnumValue::Integer(value),
19424 )),
19425 }
19426 }
19427 }
19428
19429 impl std::convert::From<&str> for State {
19430 fn from(value: &str) -> Self {
19431 use std::string::ToString;
19432 match value {
19433 "STATE_UNSPECIFIED" => Self::Unspecified,
19434 "ACTIVE" => Self::Active,
19435 "CREATING" => Self::Creating,
19436 "DELETING" => Self::Deleting,
19437 "CLOSED" => Self::Closed,
19438 _ => Self::UnknownValue(state::UnknownValue(
19439 wkt::internal::UnknownEnumValue::String(value.to_string()),
19440 )),
19441 }
19442 }
19443 }
19444
19445 impl serde::ser::Serialize for State {
19446 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19447 where
19448 S: serde::Serializer,
19449 {
19450 match self {
19451 Self::Unspecified => serializer.serialize_i32(0),
19452 Self::Active => serializer.serialize_i32(1),
19453 Self::Creating => serializer.serialize_i32(2),
19454 Self::Deleting => serializer.serialize_i32(3),
19455 Self::Closed => serializer.serialize_i32(4),
19456 Self::UnknownValue(u) => u.0.serialize(serializer),
19457 }
19458 }
19459 }
19460
19461 impl<'de> serde::de::Deserialize<'de> for State {
19462 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19463 where
19464 D: serde::Deserializer<'de>,
19465 {
19466 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19467 ".google.cloud.networksecurity.v1.MirroringDeploymentGroup.State",
19468 ))
19469 }
19470 }
19471}
19472
19473/// Request message for ListMirroringDeploymentGroups.
19474#[derive(Clone, Default, PartialEq)]
19475#[non_exhaustive]
19476pub struct ListMirroringDeploymentGroupsRequest {
19477 /// Required. The parent, which owns this collection of deployment groups.
19478 /// Example: `projects/123456789/locations/global`.
19479 /// See <https://google.aip.dev/132> for more details.
19480 pub parent: std::string::String,
19481
19482 /// Optional. Requested page size. Server may return fewer items than
19483 /// requested. If unspecified, server will pick an appropriate default. See
19484 /// <https://google.aip.dev/158> for more details.
19485 pub page_size: i32,
19486
19487 /// Optional. A page token, received from a previous
19488 /// `ListMirroringDeploymentGroups` call. Provide this to retrieve the
19489 /// subsequent page. When paginating, all other parameters provided to
19490 /// `ListMirroringDeploymentGroups` must match the call that provided the page
19491 /// token. See <https://google.aip.dev/158> for more details.
19492 pub page_token: std::string::String,
19493
19494 /// Optional. Filter expression.
19495 /// See <https://google.aip.dev/160#filtering> for more details.
19496 pub filter: std::string::String,
19497
19498 /// Optional. Sort expression.
19499 /// See <https://google.aip.dev/132#ordering> for more details.
19500 pub order_by: std::string::String,
19501
19502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19503}
19504
19505impl ListMirroringDeploymentGroupsRequest {
19506 /// Creates a new default instance.
19507 pub fn new() -> Self {
19508 std::default::Default::default()
19509 }
19510
19511 /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
19512 ///
19513 /// # Example
19514 /// ```ignore,no_run
19515 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19516 /// # let project_id = "project_id";
19517 /// # let location_id = "location_id";
19518 /// let x = ListMirroringDeploymentGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
19519 /// ```
19520 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19521 self.parent = v.into();
19522 self
19523 }
19524
19525 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
19526 ///
19527 /// # Example
19528 /// ```ignore,no_run
19529 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19530 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_size(42);
19531 /// ```
19532 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19533 self.page_size = v.into();
19534 self
19535 }
19536
19537 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
19538 ///
19539 /// # Example
19540 /// ```ignore,no_run
19541 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19542 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_token("example");
19543 /// ```
19544 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19545 self.page_token = v.into();
19546 self
19547 }
19548
19549 /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
19550 ///
19551 /// # Example
19552 /// ```ignore,no_run
19553 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19554 /// let x = ListMirroringDeploymentGroupsRequest::new().set_filter("example");
19555 /// ```
19556 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19557 self.filter = v.into();
19558 self
19559 }
19560
19561 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
19562 ///
19563 /// # Example
19564 /// ```ignore,no_run
19565 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19566 /// let x = ListMirroringDeploymentGroupsRequest::new().set_order_by("example");
19567 /// ```
19568 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19569 self.order_by = v.into();
19570 self
19571 }
19572}
19573
19574impl wkt::message::Message for ListMirroringDeploymentGroupsRequest {
19575 fn typename() -> &'static str {
19576 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest"
19577 }
19578}
19579
19580/// Response message for ListMirroringDeploymentGroups.
19581#[derive(Clone, Default, PartialEq)]
19582#[non_exhaustive]
19583pub struct ListMirroringDeploymentGroupsResponse {
19584 /// The deployment groups from the specified parent.
19585 pub mirroring_deployment_groups: std::vec::Vec<crate::model::MirroringDeploymentGroup>,
19586
19587 /// A token that can be sent as `page_token` to retrieve the next page.
19588 /// If this field is omitted, there are no subsequent pages.
19589 /// See <https://google.aip.dev/158> for more details.
19590 pub next_page_token: std::string::String,
19591
19592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19593}
19594
19595impl ListMirroringDeploymentGroupsResponse {
19596 /// Creates a new default instance.
19597 pub fn new() -> Self {
19598 std::default::Default::default()
19599 }
19600
19601 /// Sets the value of [mirroring_deployment_groups][crate::model::ListMirroringDeploymentGroupsResponse::mirroring_deployment_groups].
19602 ///
19603 /// # Example
19604 /// ```ignore,no_run
19605 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19606 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19607 /// let x = ListMirroringDeploymentGroupsResponse::new()
19608 /// .set_mirroring_deployment_groups([
19609 /// MirroringDeploymentGroup::default()/* use setters */,
19610 /// MirroringDeploymentGroup::default()/* use (different) setters */,
19611 /// ]);
19612 /// ```
19613 pub fn set_mirroring_deployment_groups<T, V>(mut self, v: T) -> Self
19614 where
19615 T: std::iter::IntoIterator<Item = V>,
19616 V: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19617 {
19618 use std::iter::Iterator;
19619 self.mirroring_deployment_groups = v.into_iter().map(|i| i.into()).collect();
19620 self
19621 }
19622
19623 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentGroupsResponse::next_page_token].
19624 ///
19625 /// # Example
19626 /// ```ignore,no_run
19627 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19628 /// let x = ListMirroringDeploymentGroupsResponse::new().set_next_page_token("example");
19629 /// ```
19630 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19631 self.next_page_token = v.into();
19632 self
19633 }
19634}
19635
19636impl wkt::message::Message for ListMirroringDeploymentGroupsResponse {
19637 fn typename() -> &'static str {
19638 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse"
19639 }
19640}
19641
19642#[doc(hidden)]
19643impl google_cloud_gax::paginator::internal::PageableResponse
19644 for ListMirroringDeploymentGroupsResponse
19645{
19646 type PageItem = crate::model::MirroringDeploymentGroup;
19647
19648 fn items(self) -> std::vec::Vec<Self::PageItem> {
19649 self.mirroring_deployment_groups
19650 }
19651
19652 fn next_page_token(&self) -> std::string::String {
19653 use std::clone::Clone;
19654 self.next_page_token.clone()
19655 }
19656}
19657
19658/// Request message for GetMirroringDeploymentGroup.
19659#[derive(Clone, Default, PartialEq)]
19660#[non_exhaustive]
19661pub struct GetMirroringDeploymentGroupRequest {
19662 /// Required. The name of the deployment group to retrieve.
19663 /// Format:
19664 /// projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}
19665 pub name: std::string::String,
19666
19667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19668}
19669
19670impl GetMirroringDeploymentGroupRequest {
19671 /// Creates a new default instance.
19672 pub fn new() -> Self {
19673 std::default::Default::default()
19674 }
19675
19676 /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
19677 ///
19678 /// # Example
19679 /// ```ignore,no_run
19680 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentGroupRequest;
19681 /// # let project_id = "project_id";
19682 /// # let location_id = "location_id";
19683 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
19684 /// let x = GetMirroringDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19685 /// ```
19686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19687 self.name = v.into();
19688 self
19689 }
19690}
19691
19692impl wkt::message::Message for GetMirroringDeploymentGroupRequest {
19693 fn typename() -> &'static str {
19694 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest"
19695 }
19696}
19697
19698/// Request message for CreateMirroringDeploymentGroup.
19699#[derive(Clone, Default, PartialEq)]
19700#[non_exhaustive]
19701pub struct CreateMirroringDeploymentGroupRequest {
19702 /// Required. The parent resource where this deployment group will be created.
19703 /// Format: projects/{project}/locations/{location}
19704 pub parent: std::string::String,
19705
19706 /// Required. The ID to use for the new deployment group, which will become the
19707 /// final component of the deployment group's resource name.
19708 pub mirroring_deployment_group_id: std::string::String,
19709
19710 /// Required. The deployment group to create.
19711 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19712
19713 /// Optional. A unique identifier for this request. Must be a UUID4.
19714 /// This request is only idempotent if a `request_id` is provided.
19715 /// See <https://google.aip.dev/155> for more details.
19716 pub request_id: std::string::String,
19717
19718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19719}
19720
19721impl CreateMirroringDeploymentGroupRequest {
19722 /// Creates a new default instance.
19723 pub fn new() -> Self {
19724 std::default::Default::default()
19725 }
19726
19727 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
19728 ///
19729 /// # Example
19730 /// ```ignore,no_run
19731 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19732 /// # let project_id = "project_id";
19733 /// # let location_id = "location_id";
19734 /// let x = CreateMirroringDeploymentGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
19735 /// ```
19736 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19737 self.parent = v.into();
19738 self
19739 }
19740
19741 /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
19742 ///
19743 /// # Example
19744 /// ```ignore,no_run
19745 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19746 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group_id("example");
19747 /// ```
19748 pub fn set_mirroring_deployment_group_id<T: std::convert::Into<std::string::String>>(
19749 mut self,
19750 v: T,
19751 ) -> Self {
19752 self.mirroring_deployment_group_id = v.into();
19753 self
19754 }
19755
19756 /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19757 ///
19758 /// # Example
19759 /// ```ignore,no_run
19760 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19761 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19762 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19763 /// ```
19764 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19765 where
19766 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19767 {
19768 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19769 self
19770 }
19771
19772 /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19773 ///
19774 /// # Example
19775 /// ```ignore,no_run
19776 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19777 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19778 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19779 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19780 /// ```
19781 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19782 where
19783 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19784 {
19785 self.mirroring_deployment_group = v.map(|x| x.into());
19786 self
19787 }
19788
19789 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
19790 ///
19791 /// # Example
19792 /// ```ignore,no_run
19793 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19794 /// let x = CreateMirroringDeploymentGroupRequest::new().set_request_id("example");
19795 /// ```
19796 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19797 self.request_id = v.into();
19798 self
19799 }
19800}
19801
19802impl wkt::message::Message for CreateMirroringDeploymentGroupRequest {
19803 fn typename() -> &'static str {
19804 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest"
19805 }
19806}
19807
19808/// Request message for UpdateMirroringDeploymentGroup.
19809#[derive(Clone, Default, PartialEq)]
19810#[non_exhaustive]
19811pub struct UpdateMirroringDeploymentGroupRequest {
19812 /// Optional. The list of fields to update.
19813 /// Fields are specified relative to the deployment group
19814 /// (e.g. `description`; *not*
19815 /// `mirroring_deployment_group.description`). See
19816 /// <https://google.aip.dev/161> for more details.
19817 pub update_mask: std::option::Option<wkt::FieldMask>,
19818
19819 /// Required. The deployment group to update.
19820 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19821
19822 /// Optional. A unique identifier for this request. Must be a UUID4.
19823 /// This request is only idempotent if a `request_id` is provided.
19824 /// See <https://google.aip.dev/155> for more details.
19825 pub request_id: std::string::String,
19826
19827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19828}
19829
19830impl UpdateMirroringDeploymentGroupRequest {
19831 /// Creates a new default instance.
19832 pub fn new() -> Self {
19833 std::default::Default::default()
19834 }
19835
19836 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19837 ///
19838 /// # Example
19839 /// ```ignore,no_run
19840 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19841 /// use wkt::FieldMask;
19842 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
19843 /// ```
19844 pub fn set_update_mask<T>(mut self, v: T) -> Self
19845 where
19846 T: std::convert::Into<wkt::FieldMask>,
19847 {
19848 self.update_mask = std::option::Option::Some(v.into());
19849 self
19850 }
19851
19852 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19853 ///
19854 /// # Example
19855 /// ```ignore,no_run
19856 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19857 /// use wkt::FieldMask;
19858 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
19859 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
19860 /// ```
19861 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19862 where
19863 T: std::convert::Into<wkt::FieldMask>,
19864 {
19865 self.update_mask = v.map(|x| x.into());
19866 self
19867 }
19868
19869 /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19870 ///
19871 /// # Example
19872 /// ```ignore,no_run
19873 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19874 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19875 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19876 /// ```
19877 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19878 where
19879 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19880 {
19881 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19882 self
19883 }
19884
19885 /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19886 ///
19887 /// # Example
19888 /// ```ignore,no_run
19889 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19890 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19891 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19892 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19893 /// ```
19894 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19895 where
19896 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19897 {
19898 self.mirroring_deployment_group = v.map(|x| x.into());
19899 self
19900 }
19901
19902 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
19903 ///
19904 /// # Example
19905 /// ```ignore,no_run
19906 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19907 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_request_id("example");
19908 /// ```
19909 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19910 self.request_id = v.into();
19911 self
19912 }
19913}
19914
19915impl wkt::message::Message for UpdateMirroringDeploymentGroupRequest {
19916 fn typename() -> &'static str {
19917 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest"
19918 }
19919}
19920
19921/// Request message for DeleteMirroringDeploymentGroup.
19922#[derive(Clone, Default, PartialEq)]
19923#[non_exhaustive]
19924pub struct DeleteMirroringDeploymentGroupRequest {
19925 /// Required. The deployment group to delete.
19926 pub name: std::string::String,
19927
19928 /// Optional. A unique identifier for this request. Must be a UUID4.
19929 /// This request is only idempotent if a `request_id` is provided.
19930 /// See <https://google.aip.dev/155> for more details.
19931 pub request_id: std::string::String,
19932
19933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19934}
19935
19936impl DeleteMirroringDeploymentGroupRequest {
19937 /// Creates a new default instance.
19938 pub fn new() -> Self {
19939 std::default::Default::default()
19940 }
19941
19942 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
19943 ///
19944 /// # Example
19945 /// ```ignore,no_run
19946 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19947 /// # let project_id = "project_id";
19948 /// # let location_id = "location_id";
19949 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
19950 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
19951 /// ```
19952 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19953 self.name = v.into();
19954 self
19955 }
19956
19957 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
19958 ///
19959 /// # Example
19960 /// ```ignore,no_run
19961 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19962 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_request_id("example");
19963 /// ```
19964 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19965 self.request_id = v.into();
19966 self
19967 }
19968}
19969
19970impl wkt::message::Message for DeleteMirroringDeploymentGroupRequest {
19971 fn typename() -> &'static str {
19972 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest"
19973 }
19974}
19975
19976/// A deployment represents a zonal mirroring backend ready to accept
19977/// GENEVE-encapsulated replica traffic, e.g. a zonal instance group fronted by
19978/// an internal passthrough load balancer. Deployments are always part of a
19979/// global deployment group which represents a global mirroring service.
19980#[derive(Clone, Default, PartialEq)]
19981#[non_exhaustive]
19982pub struct MirroringDeployment {
19983 /// Immutable. Identifier. The resource name of this deployment, for example:
19984 /// `projects/123456789/locations/us-central1-a/mirroringDeployments/my-dep`.
19985 /// See <https://google.aip.dev/122> for more details.
19986 pub name: std::string::String,
19987
19988 /// Output only. The timestamp when the resource was created.
19989 /// See <https://google.aip.dev/148#timestamps>.
19990 pub create_time: std::option::Option<wkt::Timestamp>,
19991
19992 /// Output only. The timestamp when the resource was most recently updated.
19993 /// See <https://google.aip.dev/148#timestamps>.
19994 pub update_time: std::option::Option<wkt::Timestamp>,
19995
19996 /// Optional. Labels are key/value pairs that help to organize and filter
19997 /// resources.
19998 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
19999
20000 /// Required. Immutable. The regional forwarding rule that fronts the mirroring
20001 /// collectors, for example:
20002 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`. See
20003 /// <https://google.aip.dev/124>.
20004 pub forwarding_rule: std::string::String,
20005
20006 /// Required. Immutable. The deployment group that this deployment is a part
20007 /// of, for example:
20008 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
20009 /// See <https://google.aip.dev/124>.
20010 pub mirroring_deployment_group: std::string::String,
20011
20012 /// Output only. The current state of the deployment.
20013 /// See <https://google.aip.dev/216>.
20014 pub state: crate::model::mirroring_deployment::State,
20015
20016 /// Output only. The current state of the resource does not match the user's
20017 /// intended state, and the system is working to reconcile them. This part of
20018 /// the normal operation (e.g. linking a new association to the parent group).
20019 /// See <https://google.aip.dev/128>.
20020 pub reconciling: bool,
20021
20022 /// Optional. User-provided description of the deployment.
20023 /// Used as additional context for the deployment.
20024 pub description: std::string::String,
20025
20026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20027}
20028
20029impl MirroringDeployment {
20030 /// Creates a new default instance.
20031 pub fn new() -> Self {
20032 std::default::Default::default()
20033 }
20034
20035 /// Sets the value of [name][crate::model::MirroringDeployment::name].
20036 ///
20037 /// # Example
20038 /// ```ignore,no_run
20039 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20040 /// # let project_id = "project_id";
20041 /// # let location_id = "location_id";
20042 /// # let mirroring_deployment_id = "mirroring_deployment_id";
20043 /// let x = MirroringDeployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20044 /// ```
20045 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20046 self.name = v.into();
20047 self
20048 }
20049
20050 /// Sets the value of [create_time][crate::model::MirroringDeployment::create_time].
20051 ///
20052 /// # Example
20053 /// ```ignore,no_run
20054 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20055 /// use wkt::Timestamp;
20056 /// let x = MirroringDeployment::new().set_create_time(Timestamp::default()/* use setters */);
20057 /// ```
20058 pub fn set_create_time<T>(mut self, v: T) -> Self
20059 where
20060 T: std::convert::Into<wkt::Timestamp>,
20061 {
20062 self.create_time = std::option::Option::Some(v.into());
20063 self
20064 }
20065
20066 /// Sets or clears the value of [create_time][crate::model::MirroringDeployment::create_time].
20067 ///
20068 /// # Example
20069 /// ```ignore,no_run
20070 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20071 /// use wkt::Timestamp;
20072 /// let x = MirroringDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20073 /// let x = MirroringDeployment::new().set_or_clear_create_time(None::<Timestamp>);
20074 /// ```
20075 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20076 where
20077 T: std::convert::Into<wkt::Timestamp>,
20078 {
20079 self.create_time = v.map(|x| x.into());
20080 self
20081 }
20082
20083 /// Sets the value of [update_time][crate::model::MirroringDeployment::update_time].
20084 ///
20085 /// # Example
20086 /// ```ignore,no_run
20087 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20088 /// use wkt::Timestamp;
20089 /// let x = MirroringDeployment::new().set_update_time(Timestamp::default()/* use setters */);
20090 /// ```
20091 pub fn set_update_time<T>(mut self, v: T) -> Self
20092 where
20093 T: std::convert::Into<wkt::Timestamp>,
20094 {
20095 self.update_time = std::option::Option::Some(v.into());
20096 self
20097 }
20098
20099 /// Sets or clears the value of [update_time][crate::model::MirroringDeployment::update_time].
20100 ///
20101 /// # Example
20102 /// ```ignore,no_run
20103 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20104 /// use wkt::Timestamp;
20105 /// let x = MirroringDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20106 /// let x = MirroringDeployment::new().set_or_clear_update_time(None::<Timestamp>);
20107 /// ```
20108 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20109 where
20110 T: std::convert::Into<wkt::Timestamp>,
20111 {
20112 self.update_time = v.map(|x| x.into());
20113 self
20114 }
20115
20116 /// Sets the value of [labels][crate::model::MirroringDeployment::labels].
20117 ///
20118 /// # Example
20119 /// ```ignore,no_run
20120 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20121 /// let x = MirroringDeployment::new().set_labels([
20122 /// ("key0", "abc"),
20123 /// ("key1", "xyz"),
20124 /// ]);
20125 /// ```
20126 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20127 where
20128 T: std::iter::IntoIterator<Item = (K, V)>,
20129 K: std::convert::Into<std::string::String>,
20130 V: std::convert::Into<std::string::String>,
20131 {
20132 use std::iter::Iterator;
20133 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20134 self
20135 }
20136
20137 /// Sets the value of [forwarding_rule][crate::model::MirroringDeployment::forwarding_rule].
20138 ///
20139 /// # Example
20140 /// ```ignore,no_run
20141 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20142 /// let x = MirroringDeployment::new().set_forwarding_rule("example");
20143 /// ```
20144 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20145 self.forwarding_rule = v.into();
20146 self
20147 }
20148
20149 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringDeployment::mirroring_deployment_group].
20150 ///
20151 /// # Example
20152 /// ```ignore,no_run
20153 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20154 /// # let project_id = "project_id";
20155 /// # let location_id = "location_id";
20156 /// # let mirroring_deployment_group_id = "mirroring_deployment_group_id";
20157 /// let x = MirroringDeployment::new().set_mirroring_deployment_group(format!("projects/{project_id}/locations/{location_id}/mirroringDeploymentGroups/{mirroring_deployment_group_id}"));
20158 /// ```
20159 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
20160 mut self,
20161 v: T,
20162 ) -> Self {
20163 self.mirroring_deployment_group = v.into();
20164 self
20165 }
20166
20167 /// Sets the value of [state][crate::model::MirroringDeployment::state].
20168 ///
20169 /// # Example
20170 /// ```ignore,no_run
20171 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20172 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
20173 /// let x0 = MirroringDeployment::new().set_state(State::Active);
20174 /// let x1 = MirroringDeployment::new().set_state(State::Creating);
20175 /// let x2 = MirroringDeployment::new().set_state(State::Deleting);
20176 /// ```
20177 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
20178 mut self,
20179 v: T,
20180 ) -> Self {
20181 self.state = v.into();
20182 self
20183 }
20184
20185 /// Sets the value of [reconciling][crate::model::MirroringDeployment::reconciling].
20186 ///
20187 /// # Example
20188 /// ```ignore,no_run
20189 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20190 /// let x = MirroringDeployment::new().set_reconciling(true);
20191 /// ```
20192 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20193 self.reconciling = v.into();
20194 self
20195 }
20196
20197 /// Sets the value of [description][crate::model::MirroringDeployment::description].
20198 ///
20199 /// # Example
20200 /// ```ignore,no_run
20201 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
20202 /// let x = MirroringDeployment::new().set_description("example");
20203 /// ```
20204 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20205 self.description = v.into();
20206 self
20207 }
20208}
20209
20210impl wkt::message::Message for MirroringDeployment {
20211 fn typename() -> &'static str {
20212 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeployment"
20213 }
20214}
20215
20216/// Defines additional types related to [MirroringDeployment].
20217pub mod mirroring_deployment {
20218 #[allow(unused_imports)]
20219 use super::*;
20220
20221 /// The current state of the deployment.
20222 ///
20223 /// # Working with unknown values
20224 ///
20225 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20226 /// additional enum variants at any time. Adding new variants is not considered
20227 /// a breaking change. Applications should write their code in anticipation of:
20228 ///
20229 /// - New values appearing in future releases of the client library, **and**
20230 /// - New values received dynamically, without application changes.
20231 ///
20232 /// Please consult the [Working with enums] section in the user guide for some
20233 /// guidelines.
20234 ///
20235 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20236 #[derive(Clone, Debug, PartialEq)]
20237 #[non_exhaustive]
20238 pub enum State {
20239 /// State not set (this is not a valid state).
20240 Unspecified,
20241 /// The deployment is ready and in sync with the parent group.
20242 Active,
20243 /// The deployment is being created.
20244 Creating,
20245 /// The deployment is being deleted.
20246 Deleting,
20247 /// The deployment is out of sync with the parent group.
20248 /// In most cases, this is a result of a transient issue within the system
20249 /// (e.g. a delayed data-path config) and the system is expected to recover
20250 /// automatically. See the parent deployment group's state for more details.
20251 OutOfSync,
20252 /// An attempt to delete the deployment has failed. This is a terminal state
20253 /// and the deployment is not expected to recover. The only permitted
20254 /// operation is to retry deleting the deployment.
20255 DeleteFailed,
20256 /// If set, the enum was initialized with an unknown value.
20257 ///
20258 /// Applications can examine the value using [State::value] or
20259 /// [State::name].
20260 UnknownValue(state::UnknownValue),
20261 }
20262
20263 #[doc(hidden)]
20264 pub mod state {
20265 #[allow(unused_imports)]
20266 use super::*;
20267 #[derive(Clone, Debug, PartialEq)]
20268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20269 }
20270
20271 impl State {
20272 /// Gets the enum value.
20273 ///
20274 /// Returns `None` if the enum contains an unknown value deserialized from
20275 /// the string representation of enums.
20276 pub fn value(&self) -> std::option::Option<i32> {
20277 match self {
20278 Self::Unspecified => std::option::Option::Some(0),
20279 Self::Active => std::option::Option::Some(1),
20280 Self::Creating => std::option::Option::Some(2),
20281 Self::Deleting => std::option::Option::Some(3),
20282 Self::OutOfSync => std::option::Option::Some(4),
20283 Self::DeleteFailed => std::option::Option::Some(5),
20284 Self::UnknownValue(u) => u.0.value(),
20285 }
20286 }
20287
20288 /// Gets the enum value as a string.
20289 ///
20290 /// Returns `None` if the enum contains an unknown value deserialized from
20291 /// the integer representation of enums.
20292 pub fn name(&self) -> std::option::Option<&str> {
20293 match self {
20294 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
20295 Self::Active => std::option::Option::Some("ACTIVE"),
20296 Self::Creating => std::option::Option::Some("CREATING"),
20297 Self::Deleting => std::option::Option::Some("DELETING"),
20298 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
20299 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
20300 Self::UnknownValue(u) => u.0.name(),
20301 }
20302 }
20303 }
20304
20305 impl std::default::Default for State {
20306 fn default() -> Self {
20307 use std::convert::From;
20308 Self::from(0)
20309 }
20310 }
20311
20312 impl std::fmt::Display for State {
20313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20314 wkt::internal::display_enum(f, self.name(), self.value())
20315 }
20316 }
20317
20318 impl std::convert::From<i32> for State {
20319 fn from(value: i32) -> Self {
20320 match value {
20321 0 => Self::Unspecified,
20322 1 => Self::Active,
20323 2 => Self::Creating,
20324 3 => Self::Deleting,
20325 4 => Self::OutOfSync,
20326 5 => Self::DeleteFailed,
20327 _ => Self::UnknownValue(state::UnknownValue(
20328 wkt::internal::UnknownEnumValue::Integer(value),
20329 )),
20330 }
20331 }
20332 }
20333
20334 impl std::convert::From<&str> for State {
20335 fn from(value: &str) -> Self {
20336 use std::string::ToString;
20337 match value {
20338 "STATE_UNSPECIFIED" => Self::Unspecified,
20339 "ACTIVE" => Self::Active,
20340 "CREATING" => Self::Creating,
20341 "DELETING" => Self::Deleting,
20342 "OUT_OF_SYNC" => Self::OutOfSync,
20343 "DELETE_FAILED" => Self::DeleteFailed,
20344 _ => Self::UnknownValue(state::UnknownValue(
20345 wkt::internal::UnknownEnumValue::String(value.to_string()),
20346 )),
20347 }
20348 }
20349 }
20350
20351 impl serde::ser::Serialize for State {
20352 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20353 where
20354 S: serde::Serializer,
20355 {
20356 match self {
20357 Self::Unspecified => serializer.serialize_i32(0),
20358 Self::Active => serializer.serialize_i32(1),
20359 Self::Creating => serializer.serialize_i32(2),
20360 Self::Deleting => serializer.serialize_i32(3),
20361 Self::OutOfSync => serializer.serialize_i32(4),
20362 Self::DeleteFailed => serializer.serialize_i32(5),
20363 Self::UnknownValue(u) => u.0.serialize(serializer),
20364 }
20365 }
20366 }
20367
20368 impl<'de> serde::de::Deserialize<'de> for State {
20369 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20370 where
20371 D: serde::Deserializer<'de>,
20372 {
20373 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
20374 ".google.cloud.networksecurity.v1.MirroringDeployment.State",
20375 ))
20376 }
20377 }
20378}
20379
20380/// Request message for ListMirroringDeployments.
20381#[derive(Clone, Default, PartialEq)]
20382#[non_exhaustive]
20383pub struct ListMirroringDeploymentsRequest {
20384 /// Required. The parent, which owns this collection of deployments.
20385 /// Example: `projects/123456789/locations/us-central1-a`.
20386 /// See <https://google.aip.dev/132> for more details.
20387 pub parent: std::string::String,
20388
20389 /// Optional. Requested page size. Server may return fewer items than
20390 /// requested. If unspecified, server will pick an appropriate default. See
20391 /// <https://google.aip.dev/158> for more details.
20392 pub page_size: i32,
20393
20394 /// Optional. A page token, received from a previous `ListMirroringDeployments`
20395 /// call. Provide this to retrieve the subsequent page. When paginating, all
20396 /// other parameters provided to `ListMirroringDeployments` must match the call
20397 /// that provided the page token. See <https://google.aip.dev/158> for more
20398 /// details.
20399 pub page_token: std::string::String,
20400
20401 /// Optional. Filter expression.
20402 /// See <https://google.aip.dev/160#filtering> for more details.
20403 pub filter: std::string::String,
20404
20405 /// Optional. Sort expression.
20406 /// See <https://google.aip.dev/132#ordering> for more details.
20407 pub order_by: std::string::String,
20408
20409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20410}
20411
20412impl ListMirroringDeploymentsRequest {
20413 /// Creates a new default instance.
20414 pub fn new() -> Self {
20415 std::default::Default::default()
20416 }
20417
20418 /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
20419 ///
20420 /// # Example
20421 /// ```ignore,no_run
20422 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20423 /// # let project_id = "project_id";
20424 /// # let location_id = "location_id";
20425 /// let x = ListMirroringDeploymentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
20426 /// ```
20427 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20428 self.parent = v.into();
20429 self
20430 }
20431
20432 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
20433 ///
20434 /// # Example
20435 /// ```ignore,no_run
20436 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20437 /// let x = ListMirroringDeploymentsRequest::new().set_page_size(42);
20438 /// ```
20439 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20440 self.page_size = v.into();
20441 self
20442 }
20443
20444 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
20445 ///
20446 /// # Example
20447 /// ```ignore,no_run
20448 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20449 /// let x = ListMirroringDeploymentsRequest::new().set_page_token("example");
20450 /// ```
20451 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20452 self.page_token = v.into();
20453 self
20454 }
20455
20456 /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
20457 ///
20458 /// # Example
20459 /// ```ignore,no_run
20460 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20461 /// let x = ListMirroringDeploymentsRequest::new().set_filter("example");
20462 /// ```
20463 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20464 self.filter = v.into();
20465 self
20466 }
20467
20468 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
20469 ///
20470 /// # Example
20471 /// ```ignore,no_run
20472 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
20473 /// let x = ListMirroringDeploymentsRequest::new().set_order_by("example");
20474 /// ```
20475 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20476 self.order_by = v.into();
20477 self
20478 }
20479}
20480
20481impl wkt::message::Message for ListMirroringDeploymentsRequest {
20482 fn typename() -> &'static str {
20483 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest"
20484 }
20485}
20486
20487/// Response message for ListMirroringDeployments.
20488#[derive(Clone, Default, PartialEq)]
20489#[non_exhaustive]
20490pub struct ListMirroringDeploymentsResponse {
20491 /// The deployments from the specified parent.
20492 pub mirroring_deployments: std::vec::Vec<crate::model::MirroringDeployment>,
20493
20494 /// A token that can be sent as `page_token` to retrieve the next page.
20495 /// If this field is omitted, there are no subsequent pages.
20496 /// See <https://google.aip.dev/158> for more details.
20497 pub next_page_token: std::string::String,
20498
20499 /// Locations that could not be reached.
20500 pub unreachable: std::vec::Vec<std::string::String>,
20501
20502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20503}
20504
20505impl ListMirroringDeploymentsResponse {
20506 /// Creates a new default instance.
20507 pub fn new() -> Self {
20508 std::default::Default::default()
20509 }
20510
20511 /// Sets the value of [mirroring_deployments][crate::model::ListMirroringDeploymentsResponse::mirroring_deployments].
20512 ///
20513 /// # Example
20514 /// ```ignore,no_run
20515 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20516 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20517 /// let x = ListMirroringDeploymentsResponse::new()
20518 /// .set_mirroring_deployments([
20519 /// MirroringDeployment::default()/* use setters */,
20520 /// MirroringDeployment::default()/* use (different) setters */,
20521 /// ]);
20522 /// ```
20523 pub fn set_mirroring_deployments<T, V>(mut self, v: T) -> Self
20524 where
20525 T: std::iter::IntoIterator<Item = V>,
20526 V: std::convert::Into<crate::model::MirroringDeployment>,
20527 {
20528 use std::iter::Iterator;
20529 self.mirroring_deployments = v.into_iter().map(|i| i.into()).collect();
20530 self
20531 }
20532
20533 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentsResponse::next_page_token].
20534 ///
20535 /// # Example
20536 /// ```ignore,no_run
20537 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20538 /// let x = ListMirroringDeploymentsResponse::new().set_next_page_token("example");
20539 /// ```
20540 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20541 self.next_page_token = v.into();
20542 self
20543 }
20544
20545 /// Sets the value of [unreachable][crate::model::ListMirroringDeploymentsResponse::unreachable].
20546 ///
20547 /// # Example
20548 /// ```ignore,no_run
20549 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20550 /// let x = ListMirroringDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
20551 /// ```
20552 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20553 where
20554 T: std::iter::IntoIterator<Item = V>,
20555 V: std::convert::Into<std::string::String>,
20556 {
20557 use std::iter::Iterator;
20558 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20559 self
20560 }
20561}
20562
20563impl wkt::message::Message for ListMirroringDeploymentsResponse {
20564 fn typename() -> &'static str {
20565 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse"
20566 }
20567}
20568
20569#[doc(hidden)]
20570impl google_cloud_gax::paginator::internal::PageableResponse for ListMirroringDeploymentsResponse {
20571 type PageItem = crate::model::MirroringDeployment;
20572
20573 fn items(self) -> std::vec::Vec<Self::PageItem> {
20574 self.mirroring_deployments
20575 }
20576
20577 fn next_page_token(&self) -> std::string::String {
20578 use std::clone::Clone;
20579 self.next_page_token.clone()
20580 }
20581}
20582
20583/// Request message for GetMirroringDeployment.
20584#[derive(Clone, Default, PartialEq)]
20585#[non_exhaustive]
20586pub struct GetMirroringDeploymentRequest {
20587 /// Required. The name of the deployment to retrieve.
20588 /// Format:
20589 /// projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}
20590 pub name: std::string::String,
20591
20592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20593}
20594
20595impl GetMirroringDeploymentRequest {
20596 /// Creates a new default instance.
20597 pub fn new() -> Self {
20598 std::default::Default::default()
20599 }
20600
20601 /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
20602 ///
20603 /// # Example
20604 /// ```ignore,no_run
20605 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentRequest;
20606 /// # let project_id = "project_id";
20607 /// # let location_id = "location_id";
20608 /// # let mirroring_deployment_id = "mirroring_deployment_id";
20609 /// let x = GetMirroringDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20610 /// ```
20611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20612 self.name = v.into();
20613 self
20614 }
20615}
20616
20617impl wkt::message::Message for GetMirroringDeploymentRequest {
20618 fn typename() -> &'static str {
20619 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentRequest"
20620 }
20621}
20622
20623/// Request message for CreateMirroringDeployment.
20624#[derive(Clone, Default, PartialEq)]
20625#[non_exhaustive]
20626pub struct CreateMirroringDeploymentRequest {
20627 /// Required. The parent resource where this deployment will be created.
20628 /// Format: projects/{project}/locations/{location}
20629 pub parent: std::string::String,
20630
20631 /// Required. The ID to use for the new deployment, which will become the final
20632 /// component of the deployment's resource name.
20633 pub mirroring_deployment_id: std::string::String,
20634
20635 /// Required. The deployment to create.
20636 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20637
20638 /// Optional. A unique identifier for this request. Must be a UUID4.
20639 /// This request is only idempotent if a `request_id` is provided.
20640 /// See <https://google.aip.dev/155> for more details.
20641 pub request_id: std::string::String,
20642
20643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20644}
20645
20646impl CreateMirroringDeploymentRequest {
20647 /// Creates a new default instance.
20648 pub fn new() -> Self {
20649 std::default::Default::default()
20650 }
20651
20652 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
20653 ///
20654 /// # Example
20655 /// ```ignore,no_run
20656 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20657 /// # let project_id = "project_id";
20658 /// # let location_id = "location_id";
20659 /// let x = CreateMirroringDeploymentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
20660 /// ```
20661 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20662 self.parent = v.into();
20663 self
20664 }
20665
20666 /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
20667 ///
20668 /// # Example
20669 /// ```ignore,no_run
20670 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20671 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment_id("example");
20672 /// ```
20673 pub fn set_mirroring_deployment_id<T: std::convert::Into<std::string::String>>(
20674 mut self,
20675 v: T,
20676 ) -> Self {
20677 self.mirroring_deployment_id = v.into();
20678 self
20679 }
20680
20681 /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20682 ///
20683 /// # Example
20684 /// ```ignore,no_run
20685 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20686 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20687 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20688 /// ```
20689 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20690 where
20691 T: std::convert::Into<crate::model::MirroringDeployment>,
20692 {
20693 self.mirroring_deployment = std::option::Option::Some(v.into());
20694 self
20695 }
20696
20697 /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20698 ///
20699 /// # Example
20700 /// ```ignore,no_run
20701 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20702 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20703 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20704 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20705 /// ```
20706 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20707 where
20708 T: std::convert::Into<crate::model::MirroringDeployment>,
20709 {
20710 self.mirroring_deployment = v.map(|x| x.into());
20711 self
20712 }
20713
20714 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
20715 ///
20716 /// # Example
20717 /// ```ignore,no_run
20718 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20719 /// let x = CreateMirroringDeploymentRequest::new().set_request_id("example");
20720 /// ```
20721 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20722 self.request_id = v.into();
20723 self
20724 }
20725}
20726
20727impl wkt::message::Message for CreateMirroringDeploymentRequest {
20728 fn typename() -> &'static str {
20729 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest"
20730 }
20731}
20732
20733/// Request message for UpdateMirroringDeployment.
20734#[derive(Clone, Default, PartialEq)]
20735#[non_exhaustive]
20736pub struct UpdateMirroringDeploymentRequest {
20737 /// Optional. The list of fields to update.
20738 /// Fields are specified relative to the deployment
20739 /// (e.g. `description`; *not* `mirroring_deployment.description`).
20740 /// See <https://google.aip.dev/161> for more details.
20741 pub update_mask: std::option::Option<wkt::FieldMask>,
20742
20743 /// Required. The deployment to update.
20744 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20745
20746 /// Optional. A unique identifier for this request. Must be a UUID4.
20747 /// This request is only idempotent if a `request_id` is provided.
20748 /// See <https://google.aip.dev/155> for more details.
20749 pub request_id: std::string::String,
20750
20751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20752}
20753
20754impl UpdateMirroringDeploymentRequest {
20755 /// Creates a new default instance.
20756 pub fn new() -> Self {
20757 std::default::Default::default()
20758 }
20759
20760 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20761 ///
20762 /// # Example
20763 /// ```ignore,no_run
20764 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20765 /// use wkt::FieldMask;
20766 /// let x = UpdateMirroringDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20767 /// ```
20768 pub fn set_update_mask<T>(mut self, v: T) -> Self
20769 where
20770 T: std::convert::Into<wkt::FieldMask>,
20771 {
20772 self.update_mask = std::option::Option::Some(v.into());
20773 self
20774 }
20775
20776 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20777 ///
20778 /// # Example
20779 /// ```ignore,no_run
20780 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20781 /// use wkt::FieldMask;
20782 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20783 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20784 /// ```
20785 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20786 where
20787 T: std::convert::Into<wkt::FieldMask>,
20788 {
20789 self.update_mask = v.map(|x| x.into());
20790 self
20791 }
20792
20793 /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20794 ///
20795 /// # Example
20796 /// ```ignore,no_run
20797 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20798 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20799 /// let x = UpdateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20800 /// ```
20801 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20802 where
20803 T: std::convert::Into<crate::model::MirroringDeployment>,
20804 {
20805 self.mirroring_deployment = std::option::Option::Some(v.into());
20806 self
20807 }
20808
20809 /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20810 ///
20811 /// # Example
20812 /// ```ignore,no_run
20813 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20814 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20815 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20816 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20817 /// ```
20818 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20819 where
20820 T: std::convert::Into<crate::model::MirroringDeployment>,
20821 {
20822 self.mirroring_deployment = v.map(|x| x.into());
20823 self
20824 }
20825
20826 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
20827 ///
20828 /// # Example
20829 /// ```ignore,no_run
20830 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20831 /// let x = UpdateMirroringDeploymentRequest::new().set_request_id("example");
20832 /// ```
20833 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20834 self.request_id = v.into();
20835 self
20836 }
20837}
20838
20839impl wkt::message::Message for UpdateMirroringDeploymentRequest {
20840 fn typename() -> &'static str {
20841 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest"
20842 }
20843}
20844
20845/// Request message for DeleteMirroringDeployment.
20846#[derive(Clone, Default, PartialEq)]
20847#[non_exhaustive]
20848pub struct DeleteMirroringDeploymentRequest {
20849 /// Required. Name of the resource
20850 pub name: std::string::String,
20851
20852 /// Optional. A unique identifier for this request. Must be a UUID4.
20853 /// This request is only idempotent if a `request_id` is provided.
20854 /// See <https://google.aip.dev/155> for more details.
20855 pub request_id: std::string::String,
20856
20857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20858}
20859
20860impl DeleteMirroringDeploymentRequest {
20861 /// Creates a new default instance.
20862 pub fn new() -> Self {
20863 std::default::Default::default()
20864 }
20865
20866 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
20867 ///
20868 /// # Example
20869 /// ```ignore,no_run
20870 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20871 /// # let project_id = "project_id";
20872 /// # let location_id = "location_id";
20873 /// # let mirroring_deployment_id = "mirroring_deployment_id";
20874 /// let x = DeleteMirroringDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/mirroringDeployments/{mirroring_deployment_id}"));
20875 /// ```
20876 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20877 self.name = v.into();
20878 self
20879 }
20880
20881 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
20882 ///
20883 /// # Example
20884 /// ```ignore,no_run
20885 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20886 /// let x = DeleteMirroringDeploymentRequest::new().set_request_id("example");
20887 /// ```
20888 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20889 self.request_id = v.into();
20890 self
20891 }
20892}
20893
20894impl wkt::message::Message for DeleteMirroringDeploymentRequest {
20895 fn typename() -> &'static str {
20896 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest"
20897 }
20898}
20899
20900/// Details about mirroring in a specific cloud location.
20901#[derive(Clone, Default, PartialEq)]
20902#[non_exhaustive]
20903pub struct MirroringLocation {
20904 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
20905 pub location: std::string::String,
20906
20907 /// Output only. The current state of the association in this location.
20908 pub state: crate::model::mirroring_location::State,
20909
20910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20911}
20912
20913impl MirroringLocation {
20914 /// Creates a new default instance.
20915 pub fn new() -> Self {
20916 std::default::Default::default()
20917 }
20918
20919 /// Sets the value of [location][crate::model::MirroringLocation::location].
20920 ///
20921 /// # Example
20922 /// ```ignore,no_run
20923 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20924 /// let x = MirroringLocation::new().set_location("example");
20925 /// ```
20926 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20927 self.location = v.into();
20928 self
20929 }
20930
20931 /// Sets the value of [state][crate::model::MirroringLocation::state].
20932 ///
20933 /// # Example
20934 /// ```ignore,no_run
20935 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20936 /// use google_cloud_networksecurity_v1::model::mirroring_location::State;
20937 /// let x0 = MirroringLocation::new().set_state(State::Active);
20938 /// let x1 = MirroringLocation::new().set_state(State::OutOfSync);
20939 /// ```
20940 pub fn set_state<T: std::convert::Into<crate::model::mirroring_location::State>>(
20941 mut self,
20942 v: T,
20943 ) -> Self {
20944 self.state = v.into();
20945 self
20946 }
20947}
20948
20949impl wkt::message::Message for MirroringLocation {
20950 fn typename() -> &'static str {
20951 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringLocation"
20952 }
20953}
20954
20955/// Defines additional types related to [MirroringLocation].
20956pub mod mirroring_location {
20957 #[allow(unused_imports)]
20958 use super::*;
20959
20960 /// The current state of a resource in the location.
20961 ///
20962 /// # Working with unknown values
20963 ///
20964 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20965 /// additional enum variants at any time. Adding new variants is not considered
20966 /// a breaking change. Applications should write their code in anticipation of:
20967 ///
20968 /// - New values appearing in future releases of the client library, **and**
20969 /// - New values received dynamically, without application changes.
20970 ///
20971 /// Please consult the [Working with enums] section in the user guide for some
20972 /// guidelines.
20973 ///
20974 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20975 #[derive(Clone, Debug, PartialEq)]
20976 #[non_exhaustive]
20977 pub enum State {
20978 /// State not set (this is not a valid state).
20979 Unspecified,
20980 /// The resource is ready and in sync in the location.
20981 Active,
20982 /// The resource is out of sync in the location.
20983 /// In most cases, this is a result of a transient issue within the system
20984 /// (e.g. an inaccessible location) and the system is expected to recover
20985 /// automatically.
20986 OutOfSync,
20987 /// If set, the enum was initialized with an unknown value.
20988 ///
20989 /// Applications can examine the value using [State::value] or
20990 /// [State::name].
20991 UnknownValue(state::UnknownValue),
20992 }
20993
20994 #[doc(hidden)]
20995 pub mod state {
20996 #[allow(unused_imports)]
20997 use super::*;
20998 #[derive(Clone, Debug, PartialEq)]
20999 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21000 }
21001
21002 impl State {
21003 /// Gets the enum value.
21004 ///
21005 /// Returns `None` if the enum contains an unknown value deserialized from
21006 /// the string representation of enums.
21007 pub fn value(&self) -> std::option::Option<i32> {
21008 match self {
21009 Self::Unspecified => std::option::Option::Some(0),
21010 Self::Active => std::option::Option::Some(1),
21011 Self::OutOfSync => std::option::Option::Some(2),
21012 Self::UnknownValue(u) => u.0.value(),
21013 }
21014 }
21015
21016 /// Gets the enum value as a string.
21017 ///
21018 /// Returns `None` if the enum contains an unknown value deserialized from
21019 /// the integer representation of enums.
21020 pub fn name(&self) -> std::option::Option<&str> {
21021 match self {
21022 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21023 Self::Active => std::option::Option::Some("ACTIVE"),
21024 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
21025 Self::UnknownValue(u) => u.0.name(),
21026 }
21027 }
21028 }
21029
21030 impl std::default::Default for State {
21031 fn default() -> Self {
21032 use std::convert::From;
21033 Self::from(0)
21034 }
21035 }
21036
21037 impl std::fmt::Display for State {
21038 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21039 wkt::internal::display_enum(f, self.name(), self.value())
21040 }
21041 }
21042
21043 impl std::convert::From<i32> for State {
21044 fn from(value: i32) -> Self {
21045 match value {
21046 0 => Self::Unspecified,
21047 1 => Self::Active,
21048 2 => Self::OutOfSync,
21049 _ => Self::UnknownValue(state::UnknownValue(
21050 wkt::internal::UnknownEnumValue::Integer(value),
21051 )),
21052 }
21053 }
21054 }
21055
21056 impl std::convert::From<&str> for State {
21057 fn from(value: &str) -> Self {
21058 use std::string::ToString;
21059 match value {
21060 "STATE_UNSPECIFIED" => Self::Unspecified,
21061 "ACTIVE" => Self::Active,
21062 "OUT_OF_SYNC" => Self::OutOfSync,
21063 _ => Self::UnknownValue(state::UnknownValue(
21064 wkt::internal::UnknownEnumValue::String(value.to_string()),
21065 )),
21066 }
21067 }
21068 }
21069
21070 impl serde::ser::Serialize for State {
21071 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21072 where
21073 S: serde::Serializer,
21074 {
21075 match self {
21076 Self::Unspecified => serializer.serialize_i32(0),
21077 Self::Active => serializer.serialize_i32(1),
21078 Self::OutOfSync => serializer.serialize_i32(2),
21079 Self::UnknownValue(u) => u.0.serialize(serializer),
21080 }
21081 }
21082 }
21083
21084 impl<'de> serde::de::Deserialize<'de> for State {
21085 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21086 where
21087 D: serde::Deserializer<'de>,
21088 {
21089 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21090 ".google.cloud.networksecurity.v1.MirroringLocation.State",
21091 ))
21092 }
21093 }
21094}
21095
21096/// SecurityProfileGroup is a resource that defines the behavior for various
21097/// ProfileTypes.
21098#[derive(Clone, Default, PartialEq)]
21099#[non_exhaustive]
21100pub struct SecurityProfileGroup {
21101 /// Immutable. Identifier. Name of the SecurityProfileGroup resource. It
21102 /// matches pattern
21103 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
21104 pub name: std::string::String,
21105
21106 /// Optional. An optional description of the profile group. Max length 2048
21107 /// characters.
21108 pub description: std::string::String,
21109
21110 /// Output only. Resource creation timestamp.
21111 pub create_time: std::option::Option<wkt::Timestamp>,
21112
21113 /// Output only. Last resource update timestamp.
21114 pub update_time: std::option::Option<wkt::Timestamp>,
21115
21116 /// Output only. This checksum is computed by the server based on the value of
21117 /// other fields, and may be sent on update and delete requests to ensure the
21118 /// client has an up-to-date value before proceeding.
21119 pub etag: std::string::String,
21120
21121 /// Output only. Identifier used by the data-path. Unique within {container,
21122 /// location}.
21123 pub data_path_id: u64,
21124
21125 /// Optional. Labels as key value pairs.
21126 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
21127
21128 /// Optional. Reference to a SecurityProfile with the ThreatPrevention
21129 /// configuration.
21130 pub threat_prevention_profile: std::string::String,
21131
21132 /// Optional. Reference to a SecurityProfile with the CustomMirroring
21133 /// configuration.
21134 pub custom_mirroring_profile: std::string::String,
21135
21136 /// Optional. Reference to a SecurityProfile with the CustomIntercept
21137 /// configuration.
21138 pub custom_intercept_profile: std::string::String,
21139
21140 /// Optional. Reference to a SecurityProfile with the UrlFiltering
21141 /// configuration.
21142 pub url_filtering_profile: std::string::String,
21143
21144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21145}
21146
21147impl SecurityProfileGroup {
21148 /// Creates a new default instance.
21149 pub fn new() -> Self {
21150 std::default::Default::default()
21151 }
21152
21153 /// Sets the value of [name][crate::model::SecurityProfileGroup::name].
21154 ///
21155 /// # Example
21156 /// ```ignore,no_run
21157 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21158 /// # let organization_id = "organization_id";
21159 /// # let location_id = "location_id";
21160 /// # let security_profile_group_id = "security_profile_group_id";
21161 /// let x = SecurityProfileGroup::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
21162 /// ```
21163 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21164 self.name = v.into();
21165 self
21166 }
21167
21168 /// Sets the value of [description][crate::model::SecurityProfileGroup::description].
21169 ///
21170 /// # Example
21171 /// ```ignore,no_run
21172 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21173 /// let x = SecurityProfileGroup::new().set_description("example");
21174 /// ```
21175 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21176 self.description = v.into();
21177 self
21178 }
21179
21180 /// Sets the value of [create_time][crate::model::SecurityProfileGroup::create_time].
21181 ///
21182 /// # Example
21183 /// ```ignore,no_run
21184 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21185 /// use wkt::Timestamp;
21186 /// let x = SecurityProfileGroup::new().set_create_time(Timestamp::default()/* use setters */);
21187 /// ```
21188 pub fn set_create_time<T>(mut self, v: T) -> Self
21189 where
21190 T: std::convert::Into<wkt::Timestamp>,
21191 {
21192 self.create_time = std::option::Option::Some(v.into());
21193 self
21194 }
21195
21196 /// Sets or clears the value of [create_time][crate::model::SecurityProfileGroup::create_time].
21197 ///
21198 /// # Example
21199 /// ```ignore,no_run
21200 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21201 /// use wkt::Timestamp;
21202 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21203 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(None::<Timestamp>);
21204 /// ```
21205 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21206 where
21207 T: std::convert::Into<wkt::Timestamp>,
21208 {
21209 self.create_time = v.map(|x| x.into());
21210 self
21211 }
21212
21213 /// Sets the value of [update_time][crate::model::SecurityProfileGroup::update_time].
21214 ///
21215 /// # Example
21216 /// ```ignore,no_run
21217 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21218 /// use wkt::Timestamp;
21219 /// let x = SecurityProfileGroup::new().set_update_time(Timestamp::default()/* use setters */);
21220 /// ```
21221 pub fn set_update_time<T>(mut self, v: T) -> Self
21222 where
21223 T: std::convert::Into<wkt::Timestamp>,
21224 {
21225 self.update_time = std::option::Option::Some(v.into());
21226 self
21227 }
21228
21229 /// Sets or clears the value of [update_time][crate::model::SecurityProfileGroup::update_time].
21230 ///
21231 /// # Example
21232 /// ```ignore,no_run
21233 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21234 /// use wkt::Timestamp;
21235 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
21236 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(None::<Timestamp>);
21237 /// ```
21238 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21239 where
21240 T: std::convert::Into<wkt::Timestamp>,
21241 {
21242 self.update_time = v.map(|x| x.into());
21243 self
21244 }
21245
21246 /// Sets the value of [etag][crate::model::SecurityProfileGroup::etag].
21247 ///
21248 /// # Example
21249 /// ```ignore,no_run
21250 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21251 /// let x = SecurityProfileGroup::new().set_etag("example");
21252 /// ```
21253 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21254 self.etag = v.into();
21255 self
21256 }
21257
21258 /// Sets the value of [data_path_id][crate::model::SecurityProfileGroup::data_path_id].
21259 ///
21260 /// # Example
21261 /// ```ignore,no_run
21262 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21263 /// let x = SecurityProfileGroup::new().set_data_path_id(42_u32);
21264 /// ```
21265 pub fn set_data_path_id<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
21266 self.data_path_id = v.into();
21267 self
21268 }
21269
21270 /// Sets the value of [labels][crate::model::SecurityProfileGroup::labels].
21271 ///
21272 /// # Example
21273 /// ```ignore,no_run
21274 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21275 /// let x = SecurityProfileGroup::new().set_labels([
21276 /// ("key0", "abc"),
21277 /// ("key1", "xyz"),
21278 /// ]);
21279 /// ```
21280 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
21281 where
21282 T: std::iter::IntoIterator<Item = (K, V)>,
21283 K: std::convert::Into<std::string::String>,
21284 V: std::convert::Into<std::string::String>,
21285 {
21286 use std::iter::Iterator;
21287 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21288 self
21289 }
21290
21291 /// Sets the value of [threat_prevention_profile][crate::model::SecurityProfileGroup::threat_prevention_profile].
21292 ///
21293 /// # Example
21294 /// ```ignore,no_run
21295 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21296 /// # let organization_id = "organization_id";
21297 /// # let location_id = "location_id";
21298 /// # let security_profile_id = "security_profile_id";
21299 /// let x = SecurityProfileGroup::new().set_threat_prevention_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21300 /// ```
21301 pub fn set_threat_prevention_profile<T: std::convert::Into<std::string::String>>(
21302 mut self,
21303 v: T,
21304 ) -> Self {
21305 self.threat_prevention_profile = v.into();
21306 self
21307 }
21308
21309 /// Sets the value of [custom_mirroring_profile][crate::model::SecurityProfileGroup::custom_mirroring_profile].
21310 ///
21311 /// # Example
21312 /// ```ignore,no_run
21313 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21314 /// # let organization_id = "organization_id";
21315 /// # let location_id = "location_id";
21316 /// # let security_profile_id = "security_profile_id";
21317 /// let x = SecurityProfileGroup::new().set_custom_mirroring_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21318 /// ```
21319 pub fn set_custom_mirroring_profile<T: std::convert::Into<std::string::String>>(
21320 mut self,
21321 v: T,
21322 ) -> Self {
21323 self.custom_mirroring_profile = v.into();
21324 self
21325 }
21326
21327 /// Sets the value of [custom_intercept_profile][crate::model::SecurityProfileGroup::custom_intercept_profile].
21328 ///
21329 /// # Example
21330 /// ```ignore,no_run
21331 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21332 /// # let organization_id = "organization_id";
21333 /// # let location_id = "location_id";
21334 /// # let security_profile_id = "security_profile_id";
21335 /// let x = SecurityProfileGroup::new().set_custom_intercept_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21336 /// ```
21337 pub fn set_custom_intercept_profile<T: std::convert::Into<std::string::String>>(
21338 mut self,
21339 v: T,
21340 ) -> Self {
21341 self.custom_intercept_profile = v.into();
21342 self
21343 }
21344
21345 /// Sets the value of [url_filtering_profile][crate::model::SecurityProfileGroup::url_filtering_profile].
21346 ///
21347 /// # Example
21348 /// ```ignore,no_run
21349 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21350 /// # let organization_id = "organization_id";
21351 /// # let location_id = "location_id";
21352 /// # let security_profile_id = "security_profile_id";
21353 /// let x = SecurityProfileGroup::new().set_url_filtering_profile(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21354 /// ```
21355 pub fn set_url_filtering_profile<T: std::convert::Into<std::string::String>>(
21356 mut self,
21357 v: T,
21358 ) -> Self {
21359 self.url_filtering_profile = v.into();
21360 self
21361 }
21362}
21363
21364impl wkt::message::Message for SecurityProfileGroup {
21365 fn typename() -> &'static str {
21366 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfileGroup"
21367 }
21368}
21369
21370/// SecurityProfile is a resource that defines the behavior for one of many
21371/// ProfileTypes.
21372#[derive(Clone, Default, PartialEq)]
21373#[non_exhaustive]
21374pub struct SecurityProfile {
21375 /// Immutable. Identifier. Name of the SecurityProfile resource. It matches
21376 /// pattern
21377 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile}`.
21378 pub name: std::string::String,
21379
21380 /// Optional. An optional description of the profile. Max length 512
21381 /// characters.
21382 pub description: std::string::String,
21383
21384 /// Output only. Resource creation timestamp.
21385 pub create_time: std::option::Option<wkt::Timestamp>,
21386
21387 /// Output only. Last resource update timestamp.
21388 pub update_time: std::option::Option<wkt::Timestamp>,
21389
21390 /// Output only. This checksum is computed by the server based on the value of
21391 /// other fields, and may be sent on update and delete requests to ensure the
21392 /// client has an up-to-date value before proceeding.
21393 pub etag: std::string::String,
21394
21395 /// Optional. Labels as key value pairs.
21396 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
21397
21398 /// Immutable. The single ProfileType that the SecurityProfile resource
21399 /// configures.
21400 pub r#type: crate::model::security_profile::ProfileType,
21401
21402 /// The behavior for the ProfileType that the SecurityProfile resource is meant
21403 /// to configure. This field must correspond to the ProfileType of the
21404 /// SecurityProfile.
21405 pub profile: std::option::Option<crate::model::security_profile::Profile>,
21406
21407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21408}
21409
21410impl SecurityProfile {
21411 /// Creates a new default instance.
21412 pub fn new() -> Self {
21413 std::default::Default::default()
21414 }
21415
21416 /// Sets the value of [name][crate::model::SecurityProfile::name].
21417 ///
21418 /// # Example
21419 /// ```ignore,no_run
21420 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21421 /// # let organization_id = "organization_id";
21422 /// # let location_id = "location_id";
21423 /// # let security_profile_id = "security_profile_id";
21424 /// let x = SecurityProfile::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
21425 /// ```
21426 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21427 self.name = v.into();
21428 self
21429 }
21430
21431 /// Sets the value of [description][crate::model::SecurityProfile::description].
21432 ///
21433 /// # Example
21434 /// ```ignore,no_run
21435 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21436 /// let x = SecurityProfile::new().set_description("example");
21437 /// ```
21438 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21439 self.description = v.into();
21440 self
21441 }
21442
21443 /// Sets the value of [create_time][crate::model::SecurityProfile::create_time].
21444 ///
21445 /// # Example
21446 /// ```ignore,no_run
21447 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21448 /// use wkt::Timestamp;
21449 /// let x = SecurityProfile::new().set_create_time(Timestamp::default()/* use setters */);
21450 /// ```
21451 pub fn set_create_time<T>(mut self, v: T) -> Self
21452 where
21453 T: std::convert::Into<wkt::Timestamp>,
21454 {
21455 self.create_time = std::option::Option::Some(v.into());
21456 self
21457 }
21458
21459 /// Sets or clears the value of [create_time][crate::model::SecurityProfile::create_time].
21460 ///
21461 /// # Example
21462 /// ```ignore,no_run
21463 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21464 /// use wkt::Timestamp;
21465 /// let x = SecurityProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21466 /// let x = SecurityProfile::new().set_or_clear_create_time(None::<Timestamp>);
21467 /// ```
21468 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21469 where
21470 T: std::convert::Into<wkt::Timestamp>,
21471 {
21472 self.create_time = v.map(|x| x.into());
21473 self
21474 }
21475
21476 /// Sets the value of [update_time][crate::model::SecurityProfile::update_time].
21477 ///
21478 /// # Example
21479 /// ```ignore,no_run
21480 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21481 /// use wkt::Timestamp;
21482 /// let x = SecurityProfile::new().set_update_time(Timestamp::default()/* use setters */);
21483 /// ```
21484 pub fn set_update_time<T>(mut self, v: T) -> Self
21485 where
21486 T: std::convert::Into<wkt::Timestamp>,
21487 {
21488 self.update_time = std::option::Option::Some(v.into());
21489 self
21490 }
21491
21492 /// Sets or clears the value of [update_time][crate::model::SecurityProfile::update_time].
21493 ///
21494 /// # Example
21495 /// ```ignore,no_run
21496 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21497 /// use wkt::Timestamp;
21498 /// let x = SecurityProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
21499 /// let x = SecurityProfile::new().set_or_clear_update_time(None::<Timestamp>);
21500 /// ```
21501 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21502 where
21503 T: std::convert::Into<wkt::Timestamp>,
21504 {
21505 self.update_time = v.map(|x| x.into());
21506 self
21507 }
21508
21509 /// Sets the value of [etag][crate::model::SecurityProfile::etag].
21510 ///
21511 /// # Example
21512 /// ```ignore,no_run
21513 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21514 /// let x = SecurityProfile::new().set_etag("example");
21515 /// ```
21516 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21517 self.etag = v.into();
21518 self
21519 }
21520
21521 /// Sets the value of [labels][crate::model::SecurityProfile::labels].
21522 ///
21523 /// # Example
21524 /// ```ignore,no_run
21525 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21526 /// let x = SecurityProfile::new().set_labels([
21527 /// ("key0", "abc"),
21528 /// ("key1", "xyz"),
21529 /// ]);
21530 /// ```
21531 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
21532 where
21533 T: std::iter::IntoIterator<Item = (K, V)>,
21534 K: std::convert::Into<std::string::String>,
21535 V: std::convert::Into<std::string::String>,
21536 {
21537 use std::iter::Iterator;
21538 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21539 self
21540 }
21541
21542 /// Sets the value of [r#type][crate::model::SecurityProfile::type].
21543 ///
21544 /// # Example
21545 /// ```ignore,no_run
21546 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21547 /// use google_cloud_networksecurity_v1::model::security_profile::ProfileType;
21548 /// let x0 = SecurityProfile::new().set_type(ProfileType::ThreatPrevention);
21549 /// let x1 = SecurityProfile::new().set_type(ProfileType::CustomMirroring);
21550 /// let x2 = SecurityProfile::new().set_type(ProfileType::CustomIntercept);
21551 /// ```
21552 pub fn set_type<T: std::convert::Into<crate::model::security_profile::ProfileType>>(
21553 mut self,
21554 v: T,
21555 ) -> Self {
21556 self.r#type = v.into();
21557 self
21558 }
21559
21560 /// Sets the value of [profile][crate::model::SecurityProfile::profile].
21561 ///
21562 /// Note that all the setters affecting `profile` are mutually
21563 /// exclusive.
21564 ///
21565 /// # Example
21566 /// ```ignore,no_run
21567 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21568 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21569 /// let x = SecurityProfile::new().set_profile(Some(
21570 /// google_cloud_networksecurity_v1::model::security_profile::Profile::ThreatPreventionProfile(ThreatPreventionProfile::default().into())));
21571 /// ```
21572 pub fn set_profile<
21573 T: std::convert::Into<std::option::Option<crate::model::security_profile::Profile>>,
21574 >(
21575 mut self,
21576 v: T,
21577 ) -> Self {
21578 self.profile = v.into();
21579 self
21580 }
21581
21582 /// The value of [profile][crate::model::SecurityProfile::profile]
21583 /// if it holds a `ThreatPreventionProfile`, `None` if the field is not set or
21584 /// holds a different branch.
21585 pub fn threat_prevention_profile(
21586 &self,
21587 ) -> std::option::Option<&std::boxed::Box<crate::model::ThreatPreventionProfile>> {
21588 #[allow(unreachable_patterns)]
21589 self.profile.as_ref().and_then(|v| match v {
21590 crate::model::security_profile::Profile::ThreatPreventionProfile(v) => {
21591 std::option::Option::Some(v)
21592 }
21593 _ => std::option::Option::None,
21594 })
21595 }
21596
21597 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21598 /// to hold a `ThreatPreventionProfile`.
21599 ///
21600 /// Note that all the setters affecting `profile` are
21601 /// mutually exclusive.
21602 ///
21603 /// # Example
21604 /// ```ignore,no_run
21605 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21606 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21607 /// let x = SecurityProfile::new().set_threat_prevention_profile(ThreatPreventionProfile::default()/* use setters */);
21608 /// assert!(x.threat_prevention_profile().is_some());
21609 /// assert!(x.custom_mirroring_profile().is_none());
21610 /// assert!(x.custom_intercept_profile().is_none());
21611 /// assert!(x.url_filtering_profile().is_none());
21612 /// ```
21613 pub fn set_threat_prevention_profile<
21614 T: std::convert::Into<std::boxed::Box<crate::model::ThreatPreventionProfile>>,
21615 >(
21616 mut self,
21617 v: T,
21618 ) -> Self {
21619 self.profile = std::option::Option::Some(
21620 crate::model::security_profile::Profile::ThreatPreventionProfile(v.into()),
21621 );
21622 self
21623 }
21624
21625 /// The value of [profile][crate::model::SecurityProfile::profile]
21626 /// if it holds a `CustomMirroringProfile`, `None` if the field is not set or
21627 /// holds a different branch.
21628 pub fn custom_mirroring_profile(
21629 &self,
21630 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomMirroringProfile>> {
21631 #[allow(unreachable_patterns)]
21632 self.profile.as_ref().and_then(|v| match v {
21633 crate::model::security_profile::Profile::CustomMirroringProfile(v) => {
21634 std::option::Option::Some(v)
21635 }
21636 _ => std::option::Option::None,
21637 })
21638 }
21639
21640 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21641 /// to hold a `CustomMirroringProfile`.
21642 ///
21643 /// Note that all the setters affecting `profile` are
21644 /// mutually exclusive.
21645 ///
21646 /// # Example
21647 /// ```ignore,no_run
21648 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21649 /// use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21650 /// let x = SecurityProfile::new().set_custom_mirroring_profile(CustomMirroringProfile::default()/* use setters */);
21651 /// assert!(x.custom_mirroring_profile().is_some());
21652 /// assert!(x.threat_prevention_profile().is_none());
21653 /// assert!(x.custom_intercept_profile().is_none());
21654 /// assert!(x.url_filtering_profile().is_none());
21655 /// ```
21656 pub fn set_custom_mirroring_profile<
21657 T: std::convert::Into<std::boxed::Box<crate::model::CustomMirroringProfile>>,
21658 >(
21659 mut self,
21660 v: T,
21661 ) -> Self {
21662 self.profile = std::option::Option::Some(
21663 crate::model::security_profile::Profile::CustomMirroringProfile(v.into()),
21664 );
21665 self
21666 }
21667
21668 /// The value of [profile][crate::model::SecurityProfile::profile]
21669 /// if it holds a `CustomInterceptProfile`, `None` if the field is not set or
21670 /// holds a different branch.
21671 pub fn custom_intercept_profile(
21672 &self,
21673 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomInterceptProfile>> {
21674 #[allow(unreachable_patterns)]
21675 self.profile.as_ref().and_then(|v| match v {
21676 crate::model::security_profile::Profile::CustomInterceptProfile(v) => {
21677 std::option::Option::Some(v)
21678 }
21679 _ => std::option::Option::None,
21680 })
21681 }
21682
21683 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21684 /// to hold a `CustomInterceptProfile`.
21685 ///
21686 /// Note that all the setters affecting `profile` are
21687 /// mutually exclusive.
21688 ///
21689 /// # Example
21690 /// ```ignore,no_run
21691 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21692 /// use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21693 /// let x = SecurityProfile::new().set_custom_intercept_profile(CustomInterceptProfile::default()/* use setters */);
21694 /// assert!(x.custom_intercept_profile().is_some());
21695 /// assert!(x.threat_prevention_profile().is_none());
21696 /// assert!(x.custom_mirroring_profile().is_none());
21697 /// assert!(x.url_filtering_profile().is_none());
21698 /// ```
21699 pub fn set_custom_intercept_profile<
21700 T: std::convert::Into<std::boxed::Box<crate::model::CustomInterceptProfile>>,
21701 >(
21702 mut self,
21703 v: T,
21704 ) -> Self {
21705 self.profile = std::option::Option::Some(
21706 crate::model::security_profile::Profile::CustomInterceptProfile(v.into()),
21707 );
21708 self
21709 }
21710
21711 /// The value of [profile][crate::model::SecurityProfile::profile]
21712 /// if it holds a `UrlFilteringProfile`, `None` if the field is not set or
21713 /// holds a different branch.
21714 pub fn url_filtering_profile(
21715 &self,
21716 ) -> std::option::Option<&std::boxed::Box<crate::model::UrlFilteringProfile>> {
21717 #[allow(unreachable_patterns)]
21718 self.profile.as_ref().and_then(|v| match v {
21719 crate::model::security_profile::Profile::UrlFilteringProfile(v) => {
21720 std::option::Option::Some(v)
21721 }
21722 _ => std::option::Option::None,
21723 })
21724 }
21725
21726 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21727 /// to hold a `UrlFilteringProfile`.
21728 ///
21729 /// Note that all the setters affecting `profile` are
21730 /// mutually exclusive.
21731 ///
21732 /// # Example
21733 /// ```ignore,no_run
21734 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21735 /// use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
21736 /// let x = SecurityProfile::new().set_url_filtering_profile(UrlFilteringProfile::default()/* use setters */);
21737 /// assert!(x.url_filtering_profile().is_some());
21738 /// assert!(x.threat_prevention_profile().is_none());
21739 /// assert!(x.custom_mirroring_profile().is_none());
21740 /// assert!(x.custom_intercept_profile().is_none());
21741 /// ```
21742 pub fn set_url_filtering_profile<
21743 T: std::convert::Into<std::boxed::Box<crate::model::UrlFilteringProfile>>,
21744 >(
21745 mut self,
21746 v: T,
21747 ) -> Self {
21748 self.profile = std::option::Option::Some(
21749 crate::model::security_profile::Profile::UrlFilteringProfile(v.into()),
21750 );
21751 self
21752 }
21753}
21754
21755impl wkt::message::Message for SecurityProfile {
21756 fn typename() -> &'static str {
21757 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfile"
21758 }
21759}
21760
21761/// Defines additional types related to [SecurityProfile].
21762pub mod security_profile {
21763 #[allow(unused_imports)]
21764 use super::*;
21765
21766 /// The possible types that the SecurityProfile resource can configure.
21767 ///
21768 /// # Working with unknown values
21769 ///
21770 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21771 /// additional enum variants at any time. Adding new variants is not considered
21772 /// a breaking change. Applications should write their code in anticipation of:
21773 ///
21774 /// - New values appearing in future releases of the client library, **and**
21775 /// - New values received dynamically, without application changes.
21776 ///
21777 /// Please consult the [Working with enums] section in the user guide for some
21778 /// guidelines.
21779 ///
21780 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21781 #[derive(Clone, Debug, PartialEq)]
21782 #[non_exhaustive]
21783 pub enum ProfileType {
21784 /// Profile type not specified.
21785 Unspecified,
21786 /// Profile type for threat prevention.
21787 ThreatPrevention,
21788 /// Profile type for packet mirroring v2
21789 CustomMirroring,
21790 /// Profile type for TPPI.
21791 CustomIntercept,
21792 /// Profile type for URL filtering.
21793 UrlFiltering,
21794 /// If set, the enum was initialized with an unknown value.
21795 ///
21796 /// Applications can examine the value using [ProfileType::value] or
21797 /// [ProfileType::name].
21798 UnknownValue(profile_type::UnknownValue),
21799 }
21800
21801 #[doc(hidden)]
21802 pub mod profile_type {
21803 #[allow(unused_imports)]
21804 use super::*;
21805 #[derive(Clone, Debug, PartialEq)]
21806 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21807 }
21808
21809 impl ProfileType {
21810 /// Gets the enum value.
21811 ///
21812 /// Returns `None` if the enum contains an unknown value deserialized from
21813 /// the string representation of enums.
21814 pub fn value(&self) -> std::option::Option<i32> {
21815 match self {
21816 Self::Unspecified => std::option::Option::Some(0),
21817 Self::ThreatPrevention => std::option::Option::Some(1),
21818 Self::CustomMirroring => std::option::Option::Some(2),
21819 Self::CustomIntercept => std::option::Option::Some(3),
21820 Self::UrlFiltering => std::option::Option::Some(5),
21821 Self::UnknownValue(u) => u.0.value(),
21822 }
21823 }
21824
21825 /// Gets the enum value as a string.
21826 ///
21827 /// Returns `None` if the enum contains an unknown value deserialized from
21828 /// the integer representation of enums.
21829 pub fn name(&self) -> std::option::Option<&str> {
21830 match self {
21831 Self::Unspecified => std::option::Option::Some("PROFILE_TYPE_UNSPECIFIED"),
21832 Self::ThreatPrevention => std::option::Option::Some("THREAT_PREVENTION"),
21833 Self::CustomMirroring => std::option::Option::Some("CUSTOM_MIRRORING"),
21834 Self::CustomIntercept => std::option::Option::Some("CUSTOM_INTERCEPT"),
21835 Self::UrlFiltering => std::option::Option::Some("URL_FILTERING"),
21836 Self::UnknownValue(u) => u.0.name(),
21837 }
21838 }
21839 }
21840
21841 impl std::default::Default for ProfileType {
21842 fn default() -> Self {
21843 use std::convert::From;
21844 Self::from(0)
21845 }
21846 }
21847
21848 impl std::fmt::Display for ProfileType {
21849 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21850 wkt::internal::display_enum(f, self.name(), self.value())
21851 }
21852 }
21853
21854 impl std::convert::From<i32> for ProfileType {
21855 fn from(value: i32) -> Self {
21856 match value {
21857 0 => Self::Unspecified,
21858 1 => Self::ThreatPrevention,
21859 2 => Self::CustomMirroring,
21860 3 => Self::CustomIntercept,
21861 5 => Self::UrlFiltering,
21862 _ => Self::UnknownValue(profile_type::UnknownValue(
21863 wkt::internal::UnknownEnumValue::Integer(value),
21864 )),
21865 }
21866 }
21867 }
21868
21869 impl std::convert::From<&str> for ProfileType {
21870 fn from(value: &str) -> Self {
21871 use std::string::ToString;
21872 match value {
21873 "PROFILE_TYPE_UNSPECIFIED" => Self::Unspecified,
21874 "THREAT_PREVENTION" => Self::ThreatPrevention,
21875 "CUSTOM_MIRRORING" => Self::CustomMirroring,
21876 "CUSTOM_INTERCEPT" => Self::CustomIntercept,
21877 "URL_FILTERING" => Self::UrlFiltering,
21878 _ => Self::UnknownValue(profile_type::UnknownValue(
21879 wkt::internal::UnknownEnumValue::String(value.to_string()),
21880 )),
21881 }
21882 }
21883 }
21884
21885 impl serde::ser::Serialize for ProfileType {
21886 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21887 where
21888 S: serde::Serializer,
21889 {
21890 match self {
21891 Self::Unspecified => serializer.serialize_i32(0),
21892 Self::ThreatPrevention => serializer.serialize_i32(1),
21893 Self::CustomMirroring => serializer.serialize_i32(2),
21894 Self::CustomIntercept => serializer.serialize_i32(3),
21895 Self::UrlFiltering => serializer.serialize_i32(5),
21896 Self::UnknownValue(u) => u.0.serialize(serializer),
21897 }
21898 }
21899 }
21900
21901 impl<'de> serde::de::Deserialize<'de> for ProfileType {
21902 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21903 where
21904 D: serde::Deserializer<'de>,
21905 {
21906 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProfileType>::new(
21907 ".google.cloud.networksecurity.v1.SecurityProfile.ProfileType",
21908 ))
21909 }
21910 }
21911
21912 /// The behavior for the ProfileType that the SecurityProfile resource is meant
21913 /// to configure. This field must correspond to the ProfileType of the
21914 /// SecurityProfile.
21915 #[derive(Clone, Debug, PartialEq)]
21916 #[non_exhaustive]
21917 pub enum Profile {
21918 /// The threat prevention configuration for the SecurityProfile.
21919 ThreatPreventionProfile(std::boxed::Box<crate::model::ThreatPreventionProfile>),
21920 /// The custom Packet Mirroring v2 configuration for the SecurityProfile.
21921 CustomMirroringProfile(std::boxed::Box<crate::model::CustomMirroringProfile>),
21922 /// The custom TPPI configuration for the SecurityProfile.
21923 CustomInterceptProfile(std::boxed::Box<crate::model::CustomInterceptProfile>),
21924 /// The URL filtering configuration for the SecurityProfile.
21925 UrlFilteringProfile(std::boxed::Box<crate::model::UrlFilteringProfile>),
21926 }
21927}
21928
21929/// CustomInterceptProfile defines in-band integration behavior (intercept).
21930/// It is used by firewall rules with an APPLY_SECURITY_PROFILE_GROUP action.
21931#[derive(Clone, Default, PartialEq)]
21932#[non_exhaustive]
21933pub struct CustomInterceptProfile {
21934 /// Required. The target InterceptEndpointGroup.
21935 /// When a firewall rule with this security profile attached matches a packet,
21936 /// the packet will be intercepted to the location-local target in this group.
21937 pub intercept_endpoint_group: std::string::String,
21938
21939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21940}
21941
21942impl CustomInterceptProfile {
21943 /// Creates a new default instance.
21944 pub fn new() -> Self {
21945 std::default::Default::default()
21946 }
21947
21948 /// Sets the value of [intercept_endpoint_group][crate::model::CustomInterceptProfile::intercept_endpoint_group].
21949 ///
21950 /// # Example
21951 /// ```ignore,no_run
21952 /// # use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21953 /// # let project_id = "project_id";
21954 /// # let location_id = "location_id";
21955 /// # let intercept_endpoint_group_id = "intercept_endpoint_group_id";
21956 /// let x = CustomInterceptProfile::new().set_intercept_endpoint_group(format!("projects/{project_id}/locations/{location_id}/interceptEndpointGroups/{intercept_endpoint_group_id}"));
21957 /// ```
21958 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
21959 mut self,
21960 v: T,
21961 ) -> Self {
21962 self.intercept_endpoint_group = v.into();
21963 self
21964 }
21965}
21966
21967impl wkt::message::Message for CustomInterceptProfile {
21968 fn typename() -> &'static str {
21969 "type.googleapis.com/google.cloud.networksecurity.v1.CustomInterceptProfile"
21970 }
21971}
21972
21973/// CustomMirroringProfile defines out-of-band integration behavior (mirroring).
21974/// It is used by mirroring rules with a MIRROR action.
21975#[derive(Clone, Default, PartialEq)]
21976#[non_exhaustive]
21977pub struct CustomMirroringProfile {
21978 /// Required. Immutable. The target MirroringEndpointGroup.
21979 /// When a mirroring rule with this security profile attached matches a packet,
21980 /// a replica will be mirrored to the location-local target in this group.
21981 pub mirroring_endpoint_group: std::string::String,
21982
21983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21984}
21985
21986impl CustomMirroringProfile {
21987 /// Creates a new default instance.
21988 pub fn new() -> Self {
21989 std::default::Default::default()
21990 }
21991
21992 /// Sets the value of [mirroring_endpoint_group][crate::model::CustomMirroringProfile::mirroring_endpoint_group].
21993 ///
21994 /// # Example
21995 /// ```ignore,no_run
21996 /// # use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21997 /// # let project_id = "project_id";
21998 /// # let location_id = "location_id";
21999 /// # let mirroring_endpoint_group_id = "mirroring_endpoint_group_id";
22000 /// let x = CustomMirroringProfile::new().set_mirroring_endpoint_group(format!("projects/{project_id}/locations/{location_id}/mirroringEndpointGroups/{mirroring_endpoint_group_id}"));
22001 /// ```
22002 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
22003 mut self,
22004 v: T,
22005 ) -> Self {
22006 self.mirroring_endpoint_group = v.into();
22007 self
22008 }
22009}
22010
22011impl wkt::message::Message for CustomMirroringProfile {
22012 fn typename() -> &'static str {
22013 "type.googleapis.com/google.cloud.networksecurity.v1.CustomMirroringProfile"
22014 }
22015}
22016
22017/// Request used with the ListSecurityProfileGroups method.
22018#[derive(Clone, Default, PartialEq)]
22019#[non_exhaustive]
22020pub struct ListSecurityProfileGroupsRequest {
22021 /// Required. The project or organization and location from which the
22022 /// SecurityProfileGroups should be listed, specified in the format
22023 /// `projects|organizations/*/locations/{location}`.
22024 pub parent: std::string::String,
22025
22026 /// Optional. Maximum number of SecurityProfileGroups to return per call.
22027 pub page_size: i32,
22028
22029 /// Optional. The value returned by the last
22030 /// `ListSecurityProfileGroupsResponse` Indicates that this is a
22031 /// continuation of a prior `ListSecurityProfileGroups` call, and
22032 /// that the system should return the next page of data.
22033 pub page_token: std::string::String,
22034
22035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22036}
22037
22038impl ListSecurityProfileGroupsRequest {
22039 /// Creates a new default instance.
22040 pub fn new() -> Self {
22041 std::default::Default::default()
22042 }
22043
22044 /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
22045 ///
22046 /// # Example
22047 /// ```ignore,no_run
22048 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22049 /// # let organization_id = "organization_id";
22050 /// # let location_id = "location_id";
22051 /// let x = ListSecurityProfileGroupsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22052 /// ```
22053 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22054 self.parent = v.into();
22055 self
22056 }
22057
22058 /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
22059 ///
22060 /// # Example
22061 /// ```ignore,no_run
22062 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22063 /// let x = ListSecurityProfileGroupsRequest::new().set_page_size(42);
22064 /// ```
22065 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22066 self.page_size = v.into();
22067 self
22068 }
22069
22070 /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
22071 ///
22072 /// # Example
22073 /// ```ignore,no_run
22074 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
22075 /// let x = ListSecurityProfileGroupsRequest::new().set_page_token("example");
22076 /// ```
22077 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22078 self.page_token = v.into();
22079 self
22080 }
22081}
22082
22083impl wkt::message::Message for ListSecurityProfileGroupsRequest {
22084 fn typename() -> &'static str {
22085 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest"
22086 }
22087}
22088
22089/// Response returned by the ListSecurityProfileGroups method.
22090#[derive(Clone, Default, PartialEq)]
22091#[non_exhaustive]
22092pub struct ListSecurityProfileGroupsResponse {
22093 /// List of SecurityProfileGroups resources.
22094 pub security_profile_groups: std::vec::Vec<crate::model::SecurityProfileGroup>,
22095
22096 /// If there might be more results than those appearing in this response, then
22097 /// `next_page_token` is included. To get the next set of results, call this
22098 /// method again using the value of `next_page_token` as `page_token`.
22099 pub next_page_token: std::string::String,
22100
22101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22102}
22103
22104impl ListSecurityProfileGroupsResponse {
22105 /// Creates a new default instance.
22106 pub fn new() -> Self {
22107 std::default::Default::default()
22108 }
22109
22110 /// Sets the value of [security_profile_groups][crate::model::ListSecurityProfileGroupsResponse::security_profile_groups].
22111 ///
22112 /// # Example
22113 /// ```ignore,no_run
22114 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
22115 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22116 /// let x = ListSecurityProfileGroupsResponse::new()
22117 /// .set_security_profile_groups([
22118 /// SecurityProfileGroup::default()/* use setters */,
22119 /// SecurityProfileGroup::default()/* use (different) setters */,
22120 /// ]);
22121 /// ```
22122 pub fn set_security_profile_groups<T, V>(mut self, v: T) -> Self
22123 where
22124 T: std::iter::IntoIterator<Item = V>,
22125 V: std::convert::Into<crate::model::SecurityProfileGroup>,
22126 {
22127 use std::iter::Iterator;
22128 self.security_profile_groups = v.into_iter().map(|i| i.into()).collect();
22129 self
22130 }
22131
22132 /// Sets the value of [next_page_token][crate::model::ListSecurityProfileGroupsResponse::next_page_token].
22133 ///
22134 /// # Example
22135 /// ```ignore,no_run
22136 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
22137 /// let x = ListSecurityProfileGroupsResponse::new().set_next_page_token("example");
22138 /// ```
22139 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22140 self.next_page_token = v.into();
22141 self
22142 }
22143}
22144
22145impl wkt::message::Message for ListSecurityProfileGroupsResponse {
22146 fn typename() -> &'static str {
22147 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse"
22148 }
22149}
22150
22151#[doc(hidden)]
22152impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfileGroupsResponse {
22153 type PageItem = crate::model::SecurityProfileGroup;
22154
22155 fn items(self) -> std::vec::Vec<Self::PageItem> {
22156 self.security_profile_groups
22157 }
22158
22159 fn next_page_token(&self) -> std::string::String {
22160 use std::clone::Clone;
22161 self.next_page_token.clone()
22162 }
22163}
22164
22165/// Request used by the GetSecurityProfileGroup method.
22166#[derive(Clone, Default, PartialEq)]
22167#[non_exhaustive]
22168pub struct GetSecurityProfileGroupRequest {
22169 /// Required. A name of the SecurityProfileGroup to get. Must be in the format
22170 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
22171 pub name: std::string::String,
22172
22173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22174}
22175
22176impl GetSecurityProfileGroupRequest {
22177 /// Creates a new default instance.
22178 pub fn new() -> Self {
22179 std::default::Default::default()
22180 }
22181
22182 /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
22183 ///
22184 /// # Example
22185 /// ```ignore,no_run
22186 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileGroupRequest;
22187 /// # let organization_id = "organization_id";
22188 /// # let location_id = "location_id";
22189 /// # let security_profile_group_id = "security_profile_group_id";
22190 /// let x = GetSecurityProfileGroupRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
22191 /// ```
22192 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22193 self.name = v.into();
22194 self
22195 }
22196}
22197
22198impl wkt::message::Message for GetSecurityProfileGroupRequest {
22199 fn typename() -> &'static str {
22200 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest"
22201 }
22202}
22203
22204/// Request used by the CreateSecurityProfileGroup method.
22205#[derive(Clone, Default, PartialEq)]
22206#[non_exhaustive]
22207pub struct CreateSecurityProfileGroupRequest {
22208 /// Required. The parent resource of the SecurityProfileGroup. Must be in the
22209 /// format `projects|organizations/*/locations/{location}`.
22210 pub parent: std::string::String,
22211
22212 /// Required. Short name of the SecurityProfileGroup resource to be created.
22213 /// This value should be 1-63 characters long, containing only
22214 /// letters, numbers, hyphens, and underscores, and should not start
22215 /// with a number. E.g. "security_profile_group1".
22216 pub security_profile_group_id: std::string::String,
22217
22218 /// Required. SecurityProfileGroup resource to be created.
22219 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
22220
22221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22222}
22223
22224impl CreateSecurityProfileGroupRequest {
22225 /// Creates a new default instance.
22226 pub fn new() -> Self {
22227 std::default::Default::default()
22228 }
22229
22230 /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
22231 ///
22232 /// # Example
22233 /// ```ignore,no_run
22234 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22235 /// # let organization_id = "organization_id";
22236 /// # let location_id = "location_id";
22237 /// let x = CreateSecurityProfileGroupRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22238 /// ```
22239 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22240 self.parent = v.into();
22241 self
22242 }
22243
22244 /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
22245 ///
22246 /// # Example
22247 /// ```ignore,no_run
22248 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22249 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group_id("example");
22250 /// ```
22251 pub fn set_security_profile_group_id<T: std::convert::Into<std::string::String>>(
22252 mut self,
22253 v: T,
22254 ) -> Self {
22255 self.security_profile_group_id = v.into();
22256 self
22257 }
22258
22259 /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22260 ///
22261 /// # Example
22262 /// ```ignore,no_run
22263 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22264 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22265 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
22266 /// ```
22267 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22268 where
22269 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22270 {
22271 self.security_profile_group = std::option::Option::Some(v.into());
22272 self
22273 }
22274
22275 /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
22276 ///
22277 /// # Example
22278 /// ```ignore,no_run
22279 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
22280 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22281 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
22282 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
22283 /// ```
22284 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22285 where
22286 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22287 {
22288 self.security_profile_group = v.map(|x| x.into());
22289 self
22290 }
22291}
22292
22293impl wkt::message::Message for CreateSecurityProfileGroupRequest {
22294 fn typename() -> &'static str {
22295 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest"
22296 }
22297}
22298
22299/// Request used by the UpdateSecurityProfileGroup method.
22300#[derive(Clone, Default, PartialEq)]
22301#[non_exhaustive]
22302pub struct UpdateSecurityProfileGroupRequest {
22303 /// Required. Field mask is used to specify the fields to be overwritten in the
22304 /// SecurityProfileGroup resource by the update.
22305 /// The fields specified in the update_mask are relative to the resource, not
22306 /// the full request. A field will be overwritten if it is in the mask.
22307 pub update_mask: std::option::Option<wkt::FieldMask>,
22308
22309 /// Required. Updated SecurityProfileGroup resource.
22310 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
22311
22312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22313}
22314
22315impl UpdateSecurityProfileGroupRequest {
22316 /// Creates a new default instance.
22317 pub fn new() -> Self {
22318 std::default::Default::default()
22319 }
22320
22321 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22322 ///
22323 /// # Example
22324 /// ```ignore,no_run
22325 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22326 /// use wkt::FieldMask;
22327 /// let x = UpdateSecurityProfileGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22328 /// ```
22329 pub fn set_update_mask<T>(mut self, v: T) -> Self
22330 where
22331 T: std::convert::Into<wkt::FieldMask>,
22332 {
22333 self.update_mask = std::option::Option::Some(v.into());
22334 self
22335 }
22336
22337 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
22338 ///
22339 /// # Example
22340 /// ```ignore,no_run
22341 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22342 /// use wkt::FieldMask;
22343 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22344 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22345 /// ```
22346 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22347 where
22348 T: std::convert::Into<wkt::FieldMask>,
22349 {
22350 self.update_mask = v.map(|x| x.into());
22351 self
22352 }
22353
22354 /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22355 ///
22356 /// # Example
22357 /// ```ignore,no_run
22358 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22359 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22360 /// let x = UpdateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
22361 /// ```
22362 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
22363 where
22364 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22365 {
22366 self.security_profile_group = std::option::Option::Some(v.into());
22367 self
22368 }
22369
22370 /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
22371 ///
22372 /// # Example
22373 /// ```ignore,no_run
22374 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
22375 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
22376 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
22377 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
22378 /// ```
22379 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
22380 where
22381 T: std::convert::Into<crate::model::SecurityProfileGroup>,
22382 {
22383 self.security_profile_group = v.map(|x| x.into());
22384 self
22385 }
22386}
22387
22388impl wkt::message::Message for UpdateSecurityProfileGroupRequest {
22389 fn typename() -> &'static str {
22390 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest"
22391 }
22392}
22393
22394/// Request used by the DeleteSecurityProfileGroup method.
22395#[derive(Clone, Default, PartialEq)]
22396#[non_exhaustive]
22397pub struct DeleteSecurityProfileGroupRequest {
22398 /// Required. A name of the SecurityProfileGroup to delete. Must be in the
22399 /// format
22400 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
22401 pub name: std::string::String,
22402
22403 /// Optional. If client provided etag is out of date, delete will return
22404 /// FAILED_PRECONDITION error.
22405 pub etag: std::string::String,
22406
22407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22408}
22409
22410impl DeleteSecurityProfileGroupRequest {
22411 /// Creates a new default instance.
22412 pub fn new() -> Self {
22413 std::default::Default::default()
22414 }
22415
22416 /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
22417 ///
22418 /// # Example
22419 /// ```ignore,no_run
22420 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22421 /// # let organization_id = "organization_id";
22422 /// # let location_id = "location_id";
22423 /// # let security_profile_group_id = "security_profile_group_id";
22424 /// let x = DeleteSecurityProfileGroupRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfileGroups/{security_profile_group_id}"));
22425 /// ```
22426 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22427 self.name = v.into();
22428 self
22429 }
22430
22431 /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
22432 ///
22433 /// # Example
22434 /// ```ignore,no_run
22435 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
22436 /// let x = DeleteSecurityProfileGroupRequest::new().set_etag("example");
22437 /// ```
22438 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22439 self.etag = v.into();
22440 self
22441 }
22442}
22443
22444impl wkt::message::Message for DeleteSecurityProfileGroupRequest {
22445 fn typename() -> &'static str {
22446 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest"
22447 }
22448}
22449
22450/// Request used with the ListSecurityProfiles method.
22451#[derive(Clone, Default, PartialEq)]
22452#[non_exhaustive]
22453pub struct ListSecurityProfilesRequest {
22454 /// Required. The project or organization and location from which the
22455 /// SecurityProfiles should be listed, specified in the format
22456 /// `projects|organizations/*/locations/{location}`.
22457 pub parent: std::string::String,
22458
22459 /// Optional. Maximum number of SecurityProfiles to return per call.
22460 pub page_size: i32,
22461
22462 /// Optional. The value returned by the last
22463 /// `ListSecurityProfilesResponse` Indicates that this is a continuation of a
22464 /// prior `ListSecurityProfiles` call, and that the system should return the
22465 /// next page of data.
22466 pub page_token: std::string::String,
22467
22468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22469}
22470
22471impl ListSecurityProfilesRequest {
22472 /// Creates a new default instance.
22473 pub fn new() -> Self {
22474 std::default::Default::default()
22475 }
22476
22477 /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
22478 ///
22479 /// # Example
22480 /// ```ignore,no_run
22481 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22482 /// # let organization_id = "organization_id";
22483 /// # let location_id = "location_id";
22484 /// let x = ListSecurityProfilesRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22485 /// ```
22486 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22487 self.parent = v.into();
22488 self
22489 }
22490
22491 /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
22492 ///
22493 /// # Example
22494 /// ```ignore,no_run
22495 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22496 /// let x = ListSecurityProfilesRequest::new().set_page_size(42);
22497 /// ```
22498 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22499 self.page_size = v.into();
22500 self
22501 }
22502
22503 /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
22504 ///
22505 /// # Example
22506 /// ```ignore,no_run
22507 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
22508 /// let x = ListSecurityProfilesRequest::new().set_page_token("example");
22509 /// ```
22510 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22511 self.page_token = v.into();
22512 self
22513 }
22514}
22515
22516impl wkt::message::Message for ListSecurityProfilesRequest {
22517 fn typename() -> &'static str {
22518 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesRequest"
22519 }
22520}
22521
22522/// Response returned by the ListSecurityProfiles method.
22523#[derive(Clone, Default, PartialEq)]
22524#[non_exhaustive]
22525pub struct ListSecurityProfilesResponse {
22526 /// List of SecurityProfile resources.
22527 pub security_profiles: std::vec::Vec<crate::model::SecurityProfile>,
22528
22529 /// If there might be more results than those appearing in this response, then
22530 /// `next_page_token` is included. To get the next set of results, call this
22531 /// method again using the value of `next_page_token` as `page_token`.
22532 pub next_page_token: std::string::String,
22533
22534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22535}
22536
22537impl ListSecurityProfilesResponse {
22538 /// Creates a new default instance.
22539 pub fn new() -> Self {
22540 std::default::Default::default()
22541 }
22542
22543 /// Sets the value of [security_profiles][crate::model::ListSecurityProfilesResponse::security_profiles].
22544 ///
22545 /// # Example
22546 /// ```ignore,no_run
22547 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22548 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22549 /// let x = ListSecurityProfilesResponse::new()
22550 /// .set_security_profiles([
22551 /// SecurityProfile::default()/* use setters */,
22552 /// SecurityProfile::default()/* use (different) setters */,
22553 /// ]);
22554 /// ```
22555 pub fn set_security_profiles<T, V>(mut self, v: T) -> Self
22556 where
22557 T: std::iter::IntoIterator<Item = V>,
22558 V: std::convert::Into<crate::model::SecurityProfile>,
22559 {
22560 use std::iter::Iterator;
22561 self.security_profiles = v.into_iter().map(|i| i.into()).collect();
22562 self
22563 }
22564
22565 /// Sets the value of [next_page_token][crate::model::ListSecurityProfilesResponse::next_page_token].
22566 ///
22567 /// # Example
22568 /// ```ignore,no_run
22569 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
22570 /// let x = ListSecurityProfilesResponse::new().set_next_page_token("example");
22571 /// ```
22572 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22573 self.next_page_token = v.into();
22574 self
22575 }
22576}
22577
22578impl wkt::message::Message for ListSecurityProfilesResponse {
22579 fn typename() -> &'static str {
22580 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesResponse"
22581 }
22582}
22583
22584#[doc(hidden)]
22585impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfilesResponse {
22586 type PageItem = crate::model::SecurityProfile;
22587
22588 fn items(self) -> std::vec::Vec<Self::PageItem> {
22589 self.security_profiles
22590 }
22591
22592 fn next_page_token(&self) -> std::string::String {
22593 use std::clone::Clone;
22594 self.next_page_token.clone()
22595 }
22596}
22597
22598/// Request used by the GetSecurityProfile method.
22599#[derive(Clone, Default, PartialEq)]
22600#[non_exhaustive]
22601pub struct GetSecurityProfileRequest {
22602 /// Required. A name of the SecurityProfile to get. Must be in the format
22603 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22604 pub name: std::string::String,
22605
22606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22607}
22608
22609impl GetSecurityProfileRequest {
22610 /// Creates a new default instance.
22611 pub fn new() -> Self {
22612 std::default::Default::default()
22613 }
22614
22615 /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
22616 ///
22617 /// # Example
22618 /// ```ignore,no_run
22619 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileRequest;
22620 /// # let organization_id = "organization_id";
22621 /// # let location_id = "location_id";
22622 /// # let security_profile_id = "security_profile_id";
22623 /// let x = GetSecurityProfileRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
22624 /// ```
22625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22626 self.name = v.into();
22627 self
22628 }
22629}
22630
22631impl wkt::message::Message for GetSecurityProfileRequest {
22632 fn typename() -> &'static str {
22633 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileRequest"
22634 }
22635}
22636
22637/// Request used by the CreateSecurityProfile method.
22638#[derive(Clone, Default, PartialEq)]
22639#[non_exhaustive]
22640pub struct CreateSecurityProfileRequest {
22641 /// Required. The parent resource of the SecurityProfile. Must be in the format
22642 /// `projects|organizations/*/locations/{location}`.
22643 pub parent: std::string::String,
22644
22645 /// Required. Short name of the SecurityProfile resource to be created. This
22646 /// value should be 1-63 characters long, containing only letters, numbers,
22647 /// hyphens, and underscores, and should not start with a number. E.g.
22648 /// "security_profile1".
22649 pub security_profile_id: std::string::String,
22650
22651 /// Required. SecurityProfile resource to be created.
22652 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22653
22654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22655}
22656
22657impl CreateSecurityProfileRequest {
22658 /// Creates a new default instance.
22659 pub fn new() -> Self {
22660 std::default::Default::default()
22661 }
22662
22663 /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
22664 ///
22665 /// # Example
22666 /// ```ignore,no_run
22667 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22668 /// # let organization_id = "organization_id";
22669 /// # let location_id = "location_id";
22670 /// let x = CreateSecurityProfileRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
22671 /// ```
22672 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22673 self.parent = v.into();
22674 self
22675 }
22676
22677 /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
22678 ///
22679 /// # Example
22680 /// ```ignore,no_run
22681 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22682 /// let x = CreateSecurityProfileRequest::new().set_security_profile_id("example");
22683 /// ```
22684 pub fn set_security_profile_id<T: std::convert::Into<std::string::String>>(
22685 mut self,
22686 v: T,
22687 ) -> Self {
22688 self.security_profile_id = v.into();
22689 self
22690 }
22691
22692 /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22693 ///
22694 /// # Example
22695 /// ```ignore,no_run
22696 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22697 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22698 /// let x = CreateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22699 /// ```
22700 pub fn set_security_profile<T>(mut self, v: T) -> Self
22701 where
22702 T: std::convert::Into<crate::model::SecurityProfile>,
22703 {
22704 self.security_profile = std::option::Option::Some(v.into());
22705 self
22706 }
22707
22708 /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22709 ///
22710 /// # Example
22711 /// ```ignore,no_run
22712 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22713 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22714 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22715 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22716 /// ```
22717 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22718 where
22719 T: std::convert::Into<crate::model::SecurityProfile>,
22720 {
22721 self.security_profile = v.map(|x| x.into());
22722 self
22723 }
22724}
22725
22726impl wkt::message::Message for CreateSecurityProfileRequest {
22727 fn typename() -> &'static str {
22728 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileRequest"
22729 }
22730}
22731
22732/// Request used by the UpdateSecurityProfile method.
22733#[derive(Clone, Default, PartialEq)]
22734#[non_exhaustive]
22735pub struct UpdateSecurityProfileRequest {
22736 /// Required. Field mask is used to specify the fields to be overwritten in the
22737 /// SecurityProfile resource by the update.
22738 /// The fields specified in the update_mask are relative to the resource, not
22739 /// the full request. A field will be overwritten if it is in the mask.
22740 pub update_mask: std::option::Option<wkt::FieldMask>,
22741
22742 /// Required. Updated SecurityProfile resource.
22743 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22744
22745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22746}
22747
22748impl UpdateSecurityProfileRequest {
22749 /// Creates a new default instance.
22750 pub fn new() -> Self {
22751 std::default::Default::default()
22752 }
22753
22754 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22755 ///
22756 /// # Example
22757 /// ```ignore,no_run
22758 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22759 /// use wkt::FieldMask;
22760 /// let x = UpdateSecurityProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22761 /// ```
22762 pub fn set_update_mask<T>(mut self, v: T) -> Self
22763 where
22764 T: std::convert::Into<wkt::FieldMask>,
22765 {
22766 self.update_mask = std::option::Option::Some(v.into());
22767 self
22768 }
22769
22770 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22771 ///
22772 /// # Example
22773 /// ```ignore,no_run
22774 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22775 /// use wkt::FieldMask;
22776 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22777 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22778 /// ```
22779 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22780 where
22781 T: std::convert::Into<wkt::FieldMask>,
22782 {
22783 self.update_mask = v.map(|x| x.into());
22784 self
22785 }
22786
22787 /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22788 ///
22789 /// # Example
22790 /// ```ignore,no_run
22791 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22792 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22793 /// let x = UpdateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22794 /// ```
22795 pub fn set_security_profile<T>(mut self, v: T) -> Self
22796 where
22797 T: std::convert::Into<crate::model::SecurityProfile>,
22798 {
22799 self.security_profile = std::option::Option::Some(v.into());
22800 self
22801 }
22802
22803 /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22804 ///
22805 /// # Example
22806 /// ```ignore,no_run
22807 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22808 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22809 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22810 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22811 /// ```
22812 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22813 where
22814 T: std::convert::Into<crate::model::SecurityProfile>,
22815 {
22816 self.security_profile = v.map(|x| x.into());
22817 self
22818 }
22819}
22820
22821impl wkt::message::Message for UpdateSecurityProfileRequest {
22822 fn typename() -> &'static str {
22823 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileRequest"
22824 }
22825}
22826
22827/// Request used by the DeleteSecurityProfile method.
22828#[derive(Clone, Default, PartialEq)]
22829#[non_exhaustive]
22830pub struct DeleteSecurityProfileRequest {
22831 /// Required. A name of the SecurityProfile to delete. Must be in the format
22832 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22833 pub name: std::string::String,
22834
22835 /// Optional. If client provided etag is out of date, delete will return
22836 /// FAILED_PRECONDITION error.
22837 pub etag: std::string::String,
22838
22839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22840}
22841
22842impl DeleteSecurityProfileRequest {
22843 /// Creates a new default instance.
22844 pub fn new() -> Self {
22845 std::default::Default::default()
22846 }
22847
22848 /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
22849 ///
22850 /// # Example
22851 /// ```ignore,no_run
22852 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22853 /// # let organization_id = "organization_id";
22854 /// # let location_id = "location_id";
22855 /// # let security_profile_id = "security_profile_id";
22856 /// let x = DeleteSecurityProfileRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/securityProfiles/{security_profile_id}"));
22857 /// ```
22858 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22859 self.name = v.into();
22860 self
22861 }
22862
22863 /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
22864 ///
22865 /// # Example
22866 /// ```ignore,no_run
22867 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22868 /// let x = DeleteSecurityProfileRequest::new().set_etag("example");
22869 /// ```
22870 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22871 self.etag = v.into();
22872 self
22873 }
22874}
22875
22876impl wkt::message::Message for DeleteSecurityProfileRequest {
22877 fn typename() -> &'static str {
22878 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileRequest"
22879 }
22880}
22881
22882/// ThreatPreventionProfile defines an action for specific threat signatures or
22883/// severity levels.
22884#[derive(Clone, Default, PartialEq)]
22885#[non_exhaustive]
22886pub struct ThreatPreventionProfile {
22887 /// Optional. Configuration for overriding threats actions by severity match.
22888 pub severity_overrides: std::vec::Vec<crate::model::SeverityOverride>,
22889
22890 /// Optional. Configuration for overriding threats actions by threat_id match.
22891 /// If a threat is matched both by configuration provided in severity_overrides
22892 /// and threat_overrides, the threat_overrides action is applied.
22893 pub threat_overrides: std::vec::Vec<crate::model::ThreatOverride>,
22894
22895 /// Optional. Configuration for overriding antivirus actions per protocol.
22896 pub antivirus_overrides: std::vec::Vec<crate::model::AntivirusOverride>,
22897
22898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22899}
22900
22901impl ThreatPreventionProfile {
22902 /// Creates a new default instance.
22903 pub fn new() -> Self {
22904 std::default::Default::default()
22905 }
22906
22907 /// Sets the value of [severity_overrides][crate::model::ThreatPreventionProfile::severity_overrides].
22908 ///
22909 /// # Example
22910 /// ```ignore,no_run
22911 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22912 /// use google_cloud_networksecurity_v1::model::SeverityOverride;
22913 /// let x = ThreatPreventionProfile::new()
22914 /// .set_severity_overrides([
22915 /// SeverityOverride::default()/* use setters */,
22916 /// SeverityOverride::default()/* use (different) setters */,
22917 /// ]);
22918 /// ```
22919 pub fn set_severity_overrides<T, V>(mut self, v: T) -> Self
22920 where
22921 T: std::iter::IntoIterator<Item = V>,
22922 V: std::convert::Into<crate::model::SeverityOverride>,
22923 {
22924 use std::iter::Iterator;
22925 self.severity_overrides = v.into_iter().map(|i| i.into()).collect();
22926 self
22927 }
22928
22929 /// Sets the value of [threat_overrides][crate::model::ThreatPreventionProfile::threat_overrides].
22930 ///
22931 /// # Example
22932 /// ```ignore,no_run
22933 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22934 /// use google_cloud_networksecurity_v1::model::ThreatOverride;
22935 /// let x = ThreatPreventionProfile::new()
22936 /// .set_threat_overrides([
22937 /// ThreatOverride::default()/* use setters */,
22938 /// ThreatOverride::default()/* use (different) setters */,
22939 /// ]);
22940 /// ```
22941 pub fn set_threat_overrides<T, V>(mut self, v: T) -> Self
22942 where
22943 T: std::iter::IntoIterator<Item = V>,
22944 V: std::convert::Into<crate::model::ThreatOverride>,
22945 {
22946 use std::iter::Iterator;
22947 self.threat_overrides = v.into_iter().map(|i| i.into()).collect();
22948 self
22949 }
22950
22951 /// Sets the value of [antivirus_overrides][crate::model::ThreatPreventionProfile::antivirus_overrides].
22952 ///
22953 /// # Example
22954 /// ```ignore,no_run
22955 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22956 /// use google_cloud_networksecurity_v1::model::AntivirusOverride;
22957 /// let x = ThreatPreventionProfile::new()
22958 /// .set_antivirus_overrides([
22959 /// AntivirusOverride::default()/* use setters */,
22960 /// AntivirusOverride::default()/* use (different) setters */,
22961 /// ]);
22962 /// ```
22963 pub fn set_antivirus_overrides<T, V>(mut self, v: T) -> Self
22964 where
22965 T: std::iter::IntoIterator<Item = V>,
22966 V: std::convert::Into<crate::model::AntivirusOverride>,
22967 {
22968 use std::iter::Iterator;
22969 self.antivirus_overrides = v.into_iter().map(|i| i.into()).collect();
22970 self
22971 }
22972}
22973
22974impl wkt::message::Message for ThreatPreventionProfile {
22975 fn typename() -> &'static str {
22976 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatPreventionProfile"
22977 }
22978}
22979
22980/// Defines what action to take for a specific severity match.
22981#[derive(Clone, Default, PartialEq)]
22982#[non_exhaustive]
22983pub struct SeverityOverride {
22984 /// Required. Severity level to match.
22985 pub severity: crate::model::Severity,
22986
22987 /// Required. Threat action override.
22988 pub action: crate::model::ThreatAction,
22989
22990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22991}
22992
22993impl SeverityOverride {
22994 /// Creates a new default instance.
22995 pub fn new() -> Self {
22996 std::default::Default::default()
22997 }
22998
22999 /// Sets the value of [severity][crate::model::SeverityOverride::severity].
23000 ///
23001 /// # Example
23002 /// ```ignore,no_run
23003 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
23004 /// use google_cloud_networksecurity_v1::model::Severity;
23005 /// let x0 = SeverityOverride::new().set_severity(Severity::Informational);
23006 /// let x1 = SeverityOverride::new().set_severity(Severity::Low);
23007 /// let x2 = SeverityOverride::new().set_severity(Severity::Medium);
23008 /// ```
23009 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
23010 self.severity = v.into();
23011 self
23012 }
23013
23014 /// Sets the value of [action][crate::model::SeverityOverride::action].
23015 ///
23016 /// # Example
23017 /// ```ignore,no_run
23018 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
23019 /// use google_cloud_networksecurity_v1::model::ThreatAction;
23020 /// let x0 = SeverityOverride::new().set_action(ThreatAction::DefaultAction);
23021 /// let x1 = SeverityOverride::new().set_action(ThreatAction::Allow);
23022 /// let x2 = SeverityOverride::new().set_action(ThreatAction::Alert);
23023 /// ```
23024 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23025 self.action = v.into();
23026 self
23027 }
23028}
23029
23030impl wkt::message::Message for SeverityOverride {
23031 fn typename() -> &'static str {
23032 "type.googleapis.com/google.cloud.networksecurity.v1.SeverityOverride"
23033 }
23034}
23035
23036/// Defines what action to take for a specific threat_id match.
23037#[derive(Clone, Default, PartialEq)]
23038#[non_exhaustive]
23039pub struct ThreatOverride {
23040 /// Required. Vendor-specific ID of a threat to override.
23041 pub threat_id: std::string::String,
23042
23043 /// Output only. Type of the threat (read only).
23044 pub r#type: crate::model::ThreatType,
23045
23046 /// Required. Threat action override. For some threat types, only a subset of
23047 /// actions applies.
23048 pub action: crate::model::ThreatAction,
23049
23050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23051}
23052
23053impl ThreatOverride {
23054 /// Creates a new default instance.
23055 pub fn new() -> Self {
23056 std::default::Default::default()
23057 }
23058
23059 /// Sets the value of [threat_id][crate::model::ThreatOverride::threat_id].
23060 ///
23061 /// # Example
23062 /// ```ignore,no_run
23063 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23064 /// let x = ThreatOverride::new().set_threat_id("example");
23065 /// ```
23066 pub fn set_threat_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23067 self.threat_id = v.into();
23068 self
23069 }
23070
23071 /// Sets the value of [r#type][crate::model::ThreatOverride::type].
23072 ///
23073 /// # Example
23074 /// ```ignore,no_run
23075 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23076 /// use google_cloud_networksecurity_v1::model::ThreatType;
23077 /// let x0 = ThreatOverride::new().set_type(ThreatType::Unknown);
23078 /// let x1 = ThreatOverride::new().set_type(ThreatType::Vulnerability);
23079 /// let x2 = ThreatOverride::new().set_type(ThreatType::Antivirus);
23080 /// ```
23081 pub fn set_type<T: std::convert::Into<crate::model::ThreatType>>(mut self, v: T) -> Self {
23082 self.r#type = v.into();
23083 self
23084 }
23085
23086 /// Sets the value of [action][crate::model::ThreatOverride::action].
23087 ///
23088 /// # Example
23089 /// ```ignore,no_run
23090 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
23091 /// use google_cloud_networksecurity_v1::model::ThreatAction;
23092 /// let x0 = ThreatOverride::new().set_action(ThreatAction::DefaultAction);
23093 /// let x1 = ThreatOverride::new().set_action(ThreatAction::Allow);
23094 /// let x2 = ThreatOverride::new().set_action(ThreatAction::Alert);
23095 /// ```
23096 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23097 self.action = v.into();
23098 self
23099 }
23100}
23101
23102impl wkt::message::Message for ThreatOverride {
23103 fn typename() -> &'static str {
23104 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatOverride"
23105 }
23106}
23107
23108/// Defines what action to take for antivirus threats per protocol.
23109#[derive(Clone, Default, PartialEq)]
23110#[non_exhaustive]
23111pub struct AntivirusOverride {
23112 /// Required. Protocol to match.
23113 pub protocol: crate::model::Protocol,
23114
23115 /// Required. Threat action override. For some threat types, only a subset of
23116 /// actions applies.
23117 pub action: crate::model::ThreatAction,
23118
23119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23120}
23121
23122impl AntivirusOverride {
23123 /// Creates a new default instance.
23124 pub fn new() -> Self {
23125 std::default::Default::default()
23126 }
23127
23128 /// Sets the value of [protocol][crate::model::AntivirusOverride::protocol].
23129 ///
23130 /// # Example
23131 /// ```ignore,no_run
23132 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
23133 /// use google_cloud_networksecurity_v1::model::Protocol;
23134 /// let x0 = AntivirusOverride::new().set_protocol(Protocol::Smtp);
23135 /// let x1 = AntivirusOverride::new().set_protocol(Protocol::Smb);
23136 /// let x2 = AntivirusOverride::new().set_protocol(Protocol::Pop3);
23137 /// ```
23138 pub fn set_protocol<T: std::convert::Into<crate::model::Protocol>>(mut self, v: T) -> Self {
23139 self.protocol = v.into();
23140 self
23141 }
23142
23143 /// Sets the value of [action][crate::model::AntivirusOverride::action].
23144 ///
23145 /// # Example
23146 /// ```ignore,no_run
23147 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
23148 /// use google_cloud_networksecurity_v1::model::ThreatAction;
23149 /// let x0 = AntivirusOverride::new().set_action(ThreatAction::DefaultAction);
23150 /// let x1 = AntivirusOverride::new().set_action(ThreatAction::Allow);
23151 /// let x2 = AntivirusOverride::new().set_action(ThreatAction::Alert);
23152 /// ```
23153 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
23154 self.action = v.into();
23155 self
23156 }
23157}
23158
23159impl wkt::message::Message for AntivirusOverride {
23160 fn typename() -> &'static str {
23161 "type.googleapis.com/google.cloud.networksecurity.v1.AntivirusOverride"
23162 }
23163}
23164
23165/// UrlFilteringProfile defines filters based on URL.
23166#[derive(Clone, Default, PartialEq)]
23167#[non_exhaustive]
23168pub struct UrlFilteringProfile {
23169 /// Optional. The list of filtering configs in which each config defines an
23170 /// action to take for some URL match.
23171 pub url_filters: std::vec::Vec<crate::model::UrlFilter>,
23172
23173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23174}
23175
23176impl UrlFilteringProfile {
23177 /// Creates a new default instance.
23178 pub fn new() -> Self {
23179 std::default::Default::default()
23180 }
23181
23182 /// Sets the value of [url_filters][crate::model::UrlFilteringProfile::url_filters].
23183 ///
23184 /// # Example
23185 /// ```ignore,no_run
23186 /// # use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
23187 /// use google_cloud_networksecurity_v1::model::UrlFilter;
23188 /// let x = UrlFilteringProfile::new()
23189 /// .set_url_filters([
23190 /// UrlFilter::default()/* use setters */,
23191 /// UrlFilter::default()/* use (different) setters */,
23192 /// ]);
23193 /// ```
23194 pub fn set_url_filters<T, V>(mut self, v: T) -> Self
23195 where
23196 T: std::iter::IntoIterator<Item = V>,
23197 V: std::convert::Into<crate::model::UrlFilter>,
23198 {
23199 use std::iter::Iterator;
23200 self.url_filters = v.into_iter().map(|i| i.into()).collect();
23201 self
23202 }
23203}
23204
23205impl wkt::message::Message for UrlFilteringProfile {
23206 fn typename() -> &'static str {
23207 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilteringProfile"
23208 }
23209}
23210
23211/// A URL filter defines an action to take for some URL match.
23212#[derive(Clone, Default, PartialEq)]
23213#[non_exhaustive]
23214pub struct UrlFilter {
23215 /// Required. The action taken when this filter is applied.
23216 pub filtering_action: crate::model::url_filter::UrlFilteringAction,
23217
23218 /// Required. The list of strings that a URL must match with for this filter to
23219 /// be applied.
23220 pub urls: std::vec::Vec<std::string::String>,
23221
23222 /// Required. The priority of this filter within the URL Filtering Profile.
23223 /// Lower integers indicate higher priorities. The priority of a filter must be
23224 /// unique within a URL Filtering Profile.
23225 pub priority: std::option::Option<i32>,
23226
23227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23228}
23229
23230impl UrlFilter {
23231 /// Creates a new default instance.
23232 pub fn new() -> Self {
23233 std::default::Default::default()
23234 }
23235
23236 /// Sets the value of [filtering_action][crate::model::UrlFilter::filtering_action].
23237 ///
23238 /// # Example
23239 /// ```ignore,no_run
23240 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23241 /// use google_cloud_networksecurity_v1::model::url_filter::UrlFilteringAction;
23242 /// let x0 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Allow);
23243 /// let x1 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Deny);
23244 /// ```
23245 pub fn set_filtering_action<
23246 T: std::convert::Into<crate::model::url_filter::UrlFilteringAction>,
23247 >(
23248 mut self,
23249 v: T,
23250 ) -> Self {
23251 self.filtering_action = v.into();
23252 self
23253 }
23254
23255 /// Sets the value of [urls][crate::model::UrlFilter::urls].
23256 ///
23257 /// # Example
23258 /// ```ignore,no_run
23259 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23260 /// let x = UrlFilter::new().set_urls(["a", "b", "c"]);
23261 /// ```
23262 pub fn set_urls<T, V>(mut self, v: T) -> Self
23263 where
23264 T: std::iter::IntoIterator<Item = V>,
23265 V: std::convert::Into<std::string::String>,
23266 {
23267 use std::iter::Iterator;
23268 self.urls = v.into_iter().map(|i| i.into()).collect();
23269 self
23270 }
23271
23272 /// Sets the value of [priority][crate::model::UrlFilter::priority].
23273 ///
23274 /// # Example
23275 /// ```ignore,no_run
23276 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23277 /// let x = UrlFilter::new().set_priority(42);
23278 /// ```
23279 pub fn set_priority<T>(mut self, v: T) -> Self
23280 where
23281 T: std::convert::Into<i32>,
23282 {
23283 self.priority = std::option::Option::Some(v.into());
23284 self
23285 }
23286
23287 /// Sets or clears the value of [priority][crate::model::UrlFilter::priority].
23288 ///
23289 /// # Example
23290 /// ```ignore,no_run
23291 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
23292 /// let x = UrlFilter::new().set_or_clear_priority(Some(42));
23293 /// let x = UrlFilter::new().set_or_clear_priority(None::<i32>);
23294 /// ```
23295 pub fn set_or_clear_priority<T>(mut self, v: std::option::Option<T>) -> Self
23296 where
23297 T: std::convert::Into<i32>,
23298 {
23299 self.priority = v.map(|x| x.into());
23300 self
23301 }
23302}
23303
23304impl wkt::message::Message for UrlFilter {
23305 fn typename() -> &'static str {
23306 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilter"
23307 }
23308}
23309
23310/// Defines additional types related to [UrlFilter].
23311pub mod url_filter {
23312 #[allow(unused_imports)]
23313 use super::*;
23314
23315 /// Action to be taken when a URL matches a filter.
23316 ///
23317 /// # Working with unknown values
23318 ///
23319 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23320 /// additional enum variants at any time. Adding new variants is not considered
23321 /// a breaking change. Applications should write their code in anticipation of:
23322 ///
23323 /// - New values appearing in future releases of the client library, **and**
23324 /// - New values received dynamically, without application changes.
23325 ///
23326 /// Please consult the [Working with enums] section in the user guide for some
23327 /// guidelines.
23328 ///
23329 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23330 #[derive(Clone, Debug, PartialEq)]
23331 #[non_exhaustive]
23332 pub enum UrlFilteringAction {
23333 /// Filtering action not specified.
23334 Unspecified,
23335 /// The connection matching this filter will be allowed to transmit.
23336 Allow,
23337 /// The connection matching this filter will be dropped.
23338 Deny,
23339 /// If set, the enum was initialized with an unknown value.
23340 ///
23341 /// Applications can examine the value using [UrlFilteringAction::value] or
23342 /// [UrlFilteringAction::name].
23343 UnknownValue(url_filtering_action::UnknownValue),
23344 }
23345
23346 #[doc(hidden)]
23347 pub mod url_filtering_action {
23348 #[allow(unused_imports)]
23349 use super::*;
23350 #[derive(Clone, Debug, PartialEq)]
23351 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23352 }
23353
23354 impl UrlFilteringAction {
23355 /// Gets the enum value.
23356 ///
23357 /// Returns `None` if the enum contains an unknown value deserialized from
23358 /// the string representation of enums.
23359 pub fn value(&self) -> std::option::Option<i32> {
23360 match self {
23361 Self::Unspecified => std::option::Option::Some(0),
23362 Self::Allow => std::option::Option::Some(1),
23363 Self::Deny => std::option::Option::Some(2),
23364 Self::UnknownValue(u) => u.0.value(),
23365 }
23366 }
23367
23368 /// Gets the enum value as a string.
23369 ///
23370 /// Returns `None` if the enum contains an unknown value deserialized from
23371 /// the integer representation of enums.
23372 pub fn name(&self) -> std::option::Option<&str> {
23373 match self {
23374 Self::Unspecified => std::option::Option::Some("URL_FILTERING_ACTION_UNSPECIFIED"),
23375 Self::Allow => std::option::Option::Some("ALLOW"),
23376 Self::Deny => std::option::Option::Some("DENY"),
23377 Self::UnknownValue(u) => u.0.name(),
23378 }
23379 }
23380 }
23381
23382 impl std::default::Default for UrlFilteringAction {
23383 fn default() -> Self {
23384 use std::convert::From;
23385 Self::from(0)
23386 }
23387 }
23388
23389 impl std::fmt::Display for UrlFilteringAction {
23390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23391 wkt::internal::display_enum(f, self.name(), self.value())
23392 }
23393 }
23394
23395 impl std::convert::From<i32> for UrlFilteringAction {
23396 fn from(value: i32) -> Self {
23397 match value {
23398 0 => Self::Unspecified,
23399 1 => Self::Allow,
23400 2 => Self::Deny,
23401 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23402 wkt::internal::UnknownEnumValue::Integer(value),
23403 )),
23404 }
23405 }
23406 }
23407
23408 impl std::convert::From<&str> for UrlFilteringAction {
23409 fn from(value: &str) -> Self {
23410 use std::string::ToString;
23411 match value {
23412 "URL_FILTERING_ACTION_UNSPECIFIED" => Self::Unspecified,
23413 "ALLOW" => Self::Allow,
23414 "DENY" => Self::Deny,
23415 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
23416 wkt::internal::UnknownEnumValue::String(value.to_string()),
23417 )),
23418 }
23419 }
23420 }
23421
23422 impl serde::ser::Serialize for UrlFilteringAction {
23423 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23424 where
23425 S: serde::Serializer,
23426 {
23427 match self {
23428 Self::Unspecified => serializer.serialize_i32(0),
23429 Self::Allow => serializer.serialize_i32(1),
23430 Self::Deny => serializer.serialize_i32(2),
23431 Self::UnknownValue(u) => u.0.serialize(serializer),
23432 }
23433 }
23434 }
23435
23436 impl<'de> serde::de::Deserialize<'de> for UrlFilteringAction {
23437 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23438 where
23439 D: serde::Deserializer<'de>,
23440 {
23441 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UrlFilteringAction>::new(
23442 ".google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction",
23443 ))
23444 }
23445 }
23446}
23447
23448/// ServerTlsPolicy is a resource that specifies how a server should authenticate
23449/// incoming requests. This resource itself does not affect configuration unless
23450/// it is attached to a target HTTPS proxy or endpoint config selector resource.
23451///
23452/// ServerTlsPolicy in the form accepted by Application Load Balancers can
23453/// be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED`
23454/// or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible
23455/// ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with
23456/// Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme.
23457#[derive(Clone, Default, PartialEq)]
23458#[non_exhaustive]
23459pub struct ServerTlsPolicy {
23460 /// Required. Name of the ServerTlsPolicy resource. It matches the pattern
23461 /// `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
23462 pub name: std::string::String,
23463
23464 /// Free-text description of the resource.
23465 pub description: std::string::String,
23466
23467 /// Output only. The timestamp when the resource was created.
23468 pub create_time: std::option::Option<wkt::Timestamp>,
23469
23470 /// Output only. The timestamp when the resource was updated.
23471 pub update_time: std::option::Option<wkt::Timestamp>,
23472
23473 /// Set of label tags associated with the resource.
23474 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
23475
23476 /// This field applies only for Traffic Director policies. It is must be set to
23477 /// false for Application Load Balancer policies.
23478 ///
23479 /// Determines if server allows plaintext connections. If set to true, server
23480 /// allows plain text connections. By default, it is set to false. This setting
23481 /// is not exclusive of other encryption modes. For example, if `allow_open`
23482 /// and `mtls_policy` are set, server allows both plain text and mTLS
23483 /// connections. See documentation of other encryption modes to confirm
23484 /// compatibility.
23485 ///
23486 /// Consider using it if you wish to upgrade in place your deployment to TLS
23487 /// while having mixed TLS and non-TLS traffic reaching port :80.
23488 pub allow_open: bool,
23489
23490 /// Optional if policy is to be used with Traffic Director. For Application
23491 /// Load Balancers must be empty.
23492 ///
23493 /// Defines a mechanism to provision server identity (public and private keys).
23494 /// Cannot be combined with `allow_open` as a permissive mode that allows both
23495 /// plain text and TLS is not supported.
23496 pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
23497
23498 /// This field is required if the policy is used with Application Load
23499 /// Balancers. This field can be empty for Traffic Director.
23500 ///
23501 /// Defines a mechanism to provision peer validation certificates for peer to
23502 /// peer authentication (Mutual TLS - mTLS). If not specified, client
23503 /// certificate will not be requested. The connection is treated as TLS and not
23504 /// mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
23505 /// text and mTLS connections.
23506 pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
23507
23508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23509}
23510
23511impl ServerTlsPolicy {
23512 /// Creates a new default instance.
23513 pub fn new() -> Self {
23514 std::default::Default::default()
23515 }
23516
23517 /// Sets the value of [name][crate::model::ServerTlsPolicy::name].
23518 ///
23519 /// # Example
23520 /// ```ignore,no_run
23521 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23522 /// # let project_id = "project_id";
23523 /// # let location_id = "location_id";
23524 /// # let server_tls_policy_id = "server_tls_policy_id";
23525 /// let x = ServerTlsPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
23526 /// ```
23527 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23528 self.name = v.into();
23529 self
23530 }
23531
23532 /// Sets the value of [description][crate::model::ServerTlsPolicy::description].
23533 ///
23534 /// # Example
23535 /// ```ignore,no_run
23536 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23537 /// let x = ServerTlsPolicy::new().set_description("example");
23538 /// ```
23539 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23540 self.description = v.into();
23541 self
23542 }
23543
23544 /// Sets the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23545 ///
23546 /// # Example
23547 /// ```ignore,no_run
23548 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23549 /// use wkt::Timestamp;
23550 /// let x = ServerTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
23551 /// ```
23552 pub fn set_create_time<T>(mut self, v: T) -> Self
23553 where
23554 T: std::convert::Into<wkt::Timestamp>,
23555 {
23556 self.create_time = std::option::Option::Some(v.into());
23557 self
23558 }
23559
23560 /// Sets or clears the value of [create_time][crate::model::ServerTlsPolicy::create_time].
23561 ///
23562 /// # Example
23563 /// ```ignore,no_run
23564 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23565 /// use wkt::Timestamp;
23566 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
23567 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
23568 /// ```
23569 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
23570 where
23571 T: std::convert::Into<wkt::Timestamp>,
23572 {
23573 self.create_time = v.map(|x| x.into());
23574 self
23575 }
23576
23577 /// Sets the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23578 ///
23579 /// # Example
23580 /// ```ignore,no_run
23581 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23582 /// use wkt::Timestamp;
23583 /// let x = ServerTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
23584 /// ```
23585 pub fn set_update_time<T>(mut self, v: T) -> Self
23586 where
23587 T: std::convert::Into<wkt::Timestamp>,
23588 {
23589 self.update_time = std::option::Option::Some(v.into());
23590 self
23591 }
23592
23593 /// Sets or clears the value of [update_time][crate::model::ServerTlsPolicy::update_time].
23594 ///
23595 /// # Example
23596 /// ```ignore,no_run
23597 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23598 /// use wkt::Timestamp;
23599 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
23600 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
23601 /// ```
23602 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
23603 where
23604 T: std::convert::Into<wkt::Timestamp>,
23605 {
23606 self.update_time = v.map(|x| x.into());
23607 self
23608 }
23609
23610 /// Sets the value of [labels][crate::model::ServerTlsPolicy::labels].
23611 ///
23612 /// # Example
23613 /// ```ignore,no_run
23614 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23615 /// let x = ServerTlsPolicy::new().set_labels([
23616 /// ("key0", "abc"),
23617 /// ("key1", "xyz"),
23618 /// ]);
23619 /// ```
23620 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
23621 where
23622 T: std::iter::IntoIterator<Item = (K, V)>,
23623 K: std::convert::Into<std::string::String>,
23624 V: std::convert::Into<std::string::String>,
23625 {
23626 use std::iter::Iterator;
23627 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
23628 self
23629 }
23630
23631 /// Sets the value of [allow_open][crate::model::ServerTlsPolicy::allow_open].
23632 ///
23633 /// # Example
23634 /// ```ignore,no_run
23635 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23636 /// let x = ServerTlsPolicy::new().set_allow_open(true);
23637 /// ```
23638 pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23639 self.allow_open = v.into();
23640 self
23641 }
23642
23643 /// Sets the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23644 ///
23645 /// # Example
23646 /// ```ignore,no_run
23647 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23648 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23649 /// let x = ServerTlsPolicy::new().set_server_certificate(CertificateProvider::default()/* use setters */);
23650 /// ```
23651 pub fn set_server_certificate<T>(mut self, v: T) -> Self
23652 where
23653 T: std::convert::Into<crate::model::CertificateProvider>,
23654 {
23655 self.server_certificate = std::option::Option::Some(v.into());
23656 self
23657 }
23658
23659 /// Sets or clears the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23660 ///
23661 /// # Example
23662 /// ```ignore,no_run
23663 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23664 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23665 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(Some(CertificateProvider::default()/* use setters */));
23666 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(None::<CertificateProvider>);
23667 /// ```
23668 pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23669 where
23670 T: std::convert::Into<crate::model::CertificateProvider>,
23671 {
23672 self.server_certificate = v.map(|x| x.into());
23673 self
23674 }
23675
23676 /// Sets the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23677 ///
23678 /// # Example
23679 /// ```ignore,no_run
23680 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23681 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23682 /// let x = ServerTlsPolicy::new().set_mtls_policy(MTLSPolicy::default()/* use setters */);
23683 /// ```
23684 pub fn set_mtls_policy<T>(mut self, v: T) -> Self
23685 where
23686 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23687 {
23688 self.mtls_policy = std::option::Option::Some(v.into());
23689 self
23690 }
23691
23692 /// Sets or clears the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23693 ///
23694 /// # Example
23695 /// ```ignore,no_run
23696 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23697 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23698 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(Some(MTLSPolicy::default()/* use setters */));
23699 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(None::<MTLSPolicy>);
23700 /// ```
23701 pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23702 where
23703 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23704 {
23705 self.mtls_policy = v.map(|x| x.into());
23706 self
23707 }
23708}
23709
23710impl wkt::message::Message for ServerTlsPolicy {
23711 fn typename() -> &'static str {
23712 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
23713 }
23714}
23715
23716/// Defines additional types related to [ServerTlsPolicy].
23717pub mod server_tls_policy {
23718 #[allow(unused_imports)]
23719 use super::*;
23720
23721 /// Specification of the MTLSPolicy.
23722 #[derive(Clone, Default, PartialEq)]
23723 #[non_exhaustive]
23724 pub struct MTLSPolicy {
23725 /// When the client presents an invalid certificate or no certificate to the
23726 /// load balancer, the `client_validation_mode` specifies how the client
23727 /// connection is handled.
23728 ///
23729 /// Required if the policy is to be used with the Application Load
23730 /// Balancers. For Traffic Director it must be empty.
23731 pub client_validation_mode:
23732 crate::model::server_tls_policy::mtls_policy::ClientValidationMode,
23733
23734 /// Required if the policy is to be used with Traffic Director. For
23735 /// Application Load Balancers it must be empty.
23736 ///
23737 /// Defines the mechanism to obtain the Certificate Authority certificate to
23738 /// validate the client certificate.
23739 pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
23740
23741 /// Reference to the TrustConfig from certificatemanager.googleapis.com
23742 /// namespace.
23743 ///
23744 /// If specified, the chain validation will be performed against certificates
23745 /// configured in the given TrustConfig.
23746 ///
23747 /// Allowed only if the policy is to be used with Application Load
23748 /// Balancers.
23749 pub client_validation_trust_config: std::string::String,
23750
23751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23752 }
23753
23754 impl MTLSPolicy {
23755 /// Creates a new default instance.
23756 pub fn new() -> Self {
23757 std::default::Default::default()
23758 }
23759
23760 /// Sets the value of [client_validation_mode][crate::model::server_tls_policy::MTLSPolicy::client_validation_mode].
23761 ///
23762 /// # Example
23763 /// ```ignore,no_run
23764 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23765 /// use google_cloud_networksecurity_v1::model::server_tls_policy::mtls_policy::ClientValidationMode;
23766 /// let x0 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::AllowInvalidOrMissingClientCert);
23767 /// let x1 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::RejectInvalid);
23768 /// ```
23769 pub fn set_client_validation_mode<
23770 T: std::convert::Into<crate::model::server_tls_policy::mtls_policy::ClientValidationMode>,
23771 >(
23772 mut self,
23773 v: T,
23774 ) -> Self {
23775 self.client_validation_mode = v.into();
23776 self
23777 }
23778
23779 /// Sets the value of [client_validation_ca][crate::model::server_tls_policy::MTLSPolicy::client_validation_ca].
23780 ///
23781 /// # Example
23782 /// ```ignore,no_run
23783 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23784 /// use google_cloud_networksecurity_v1::model::ValidationCA;
23785 /// let x = MTLSPolicy::new()
23786 /// .set_client_validation_ca([
23787 /// ValidationCA::default()/* use setters */,
23788 /// ValidationCA::default()/* use (different) setters */,
23789 /// ]);
23790 /// ```
23791 pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
23792 where
23793 T: std::iter::IntoIterator<Item = V>,
23794 V: std::convert::Into<crate::model::ValidationCA>,
23795 {
23796 use std::iter::Iterator;
23797 self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
23798 self
23799 }
23800
23801 /// Sets the value of [client_validation_trust_config][crate::model::server_tls_policy::MTLSPolicy::client_validation_trust_config].
23802 ///
23803 /// # Example
23804 /// ```ignore,no_run
23805 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23806 /// let x = MTLSPolicy::new().set_client_validation_trust_config("example");
23807 /// ```
23808 pub fn set_client_validation_trust_config<T: std::convert::Into<std::string::String>>(
23809 mut self,
23810 v: T,
23811 ) -> Self {
23812 self.client_validation_trust_config = v.into();
23813 self
23814 }
23815 }
23816
23817 impl wkt::message::Message for MTLSPolicy {
23818 fn typename() -> &'static str {
23819 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
23820 }
23821 }
23822
23823 /// Defines additional types related to [MTLSPolicy].
23824 pub mod mtls_policy {
23825 #[allow(unused_imports)]
23826 use super::*;
23827
23828 /// Mutual TLS certificate validation mode.
23829 ///
23830 /// # Working with unknown values
23831 ///
23832 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23833 /// additional enum variants at any time. Adding new variants is not considered
23834 /// a breaking change. Applications should write their code in anticipation of:
23835 ///
23836 /// - New values appearing in future releases of the client library, **and**
23837 /// - New values received dynamically, without application changes.
23838 ///
23839 /// Please consult the [Working with enums] section in the user guide for some
23840 /// guidelines.
23841 ///
23842 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23843 #[derive(Clone, Debug, PartialEq)]
23844 #[non_exhaustive]
23845 pub enum ClientValidationMode {
23846 /// Not allowed.
23847 Unspecified,
23848 /// Allow connection even if certificate chain validation
23849 /// of the client certificate failed or no client certificate was
23850 /// presented. The proof of possession of the private key is always checked
23851 /// if client certificate was presented. This mode requires the backend to
23852 /// implement processing of data extracted from a client certificate to
23853 /// authenticate the peer, or to reject connections if the client
23854 /// certificate fingerprint is missing.
23855 AllowInvalidOrMissingClientCert,
23856 /// Require a client certificate and allow connection to the backend only
23857 /// if validation of the client certificate passed.
23858 ///
23859 /// If set, requires a reference to non-empty TrustConfig specified in
23860 /// `client_validation_trust_config`.
23861 RejectInvalid,
23862 /// If set, the enum was initialized with an unknown value.
23863 ///
23864 /// Applications can examine the value using [ClientValidationMode::value] or
23865 /// [ClientValidationMode::name].
23866 UnknownValue(client_validation_mode::UnknownValue),
23867 }
23868
23869 #[doc(hidden)]
23870 pub mod client_validation_mode {
23871 #[allow(unused_imports)]
23872 use super::*;
23873 #[derive(Clone, Debug, PartialEq)]
23874 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23875 }
23876
23877 impl ClientValidationMode {
23878 /// Gets the enum value.
23879 ///
23880 /// Returns `None` if the enum contains an unknown value deserialized from
23881 /// the string representation of enums.
23882 pub fn value(&self) -> std::option::Option<i32> {
23883 match self {
23884 Self::Unspecified => std::option::Option::Some(0),
23885 Self::AllowInvalidOrMissingClientCert => std::option::Option::Some(1),
23886 Self::RejectInvalid => std::option::Option::Some(2),
23887 Self::UnknownValue(u) => u.0.value(),
23888 }
23889 }
23890
23891 /// Gets the enum value as a string.
23892 ///
23893 /// Returns `None` if the enum contains an unknown value deserialized from
23894 /// the integer representation of enums.
23895 pub fn name(&self) -> std::option::Option<&str> {
23896 match self {
23897 Self::Unspecified => {
23898 std::option::Option::Some("CLIENT_VALIDATION_MODE_UNSPECIFIED")
23899 }
23900 Self::AllowInvalidOrMissingClientCert => {
23901 std::option::Option::Some("ALLOW_INVALID_OR_MISSING_CLIENT_CERT")
23902 }
23903 Self::RejectInvalid => std::option::Option::Some("REJECT_INVALID"),
23904 Self::UnknownValue(u) => u.0.name(),
23905 }
23906 }
23907 }
23908
23909 impl std::default::Default for ClientValidationMode {
23910 fn default() -> Self {
23911 use std::convert::From;
23912 Self::from(0)
23913 }
23914 }
23915
23916 impl std::fmt::Display for ClientValidationMode {
23917 fn fmt(
23918 &self,
23919 f: &mut std::fmt::Formatter<'_>,
23920 ) -> std::result::Result<(), std::fmt::Error> {
23921 wkt::internal::display_enum(f, self.name(), self.value())
23922 }
23923 }
23924
23925 impl std::convert::From<i32> for ClientValidationMode {
23926 fn from(value: i32) -> Self {
23927 match value {
23928 0 => Self::Unspecified,
23929 1 => Self::AllowInvalidOrMissingClientCert,
23930 2 => Self::RejectInvalid,
23931 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23932 wkt::internal::UnknownEnumValue::Integer(value),
23933 )),
23934 }
23935 }
23936 }
23937
23938 impl std::convert::From<&str> for ClientValidationMode {
23939 fn from(value: &str) -> Self {
23940 use std::string::ToString;
23941 match value {
23942 "CLIENT_VALIDATION_MODE_UNSPECIFIED" => Self::Unspecified,
23943 "ALLOW_INVALID_OR_MISSING_CLIENT_CERT" => Self::AllowInvalidOrMissingClientCert,
23944 "REJECT_INVALID" => Self::RejectInvalid,
23945 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23946 wkt::internal::UnknownEnumValue::String(value.to_string()),
23947 )),
23948 }
23949 }
23950 }
23951
23952 impl serde::ser::Serialize for ClientValidationMode {
23953 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23954 where
23955 S: serde::Serializer,
23956 {
23957 match self {
23958 Self::Unspecified => serializer.serialize_i32(0),
23959 Self::AllowInvalidOrMissingClientCert => serializer.serialize_i32(1),
23960 Self::RejectInvalid => serializer.serialize_i32(2),
23961 Self::UnknownValue(u) => u.0.serialize(serializer),
23962 }
23963 }
23964 }
23965
23966 impl<'de> serde::de::Deserialize<'de> for ClientValidationMode {
23967 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23968 where
23969 D: serde::Deserializer<'de>,
23970 {
23971 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClientValidationMode>::new(
23972 ".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode"))
23973 }
23974 }
23975 }
23976}
23977
23978/// Request used by the ListServerTlsPolicies method.
23979#[derive(Clone, Default, PartialEq)]
23980#[non_exhaustive]
23981pub struct ListServerTlsPoliciesRequest {
23982 /// Required. The project and location from which the ServerTlsPolicies should
23983 /// be listed, specified in the format `projects/*/locations/{location}`.
23984 pub parent: std::string::String,
23985
23986 /// Maximum number of ServerTlsPolicies to return per call.
23987 pub page_size: i32,
23988
23989 /// The value returned by the last `ListServerTlsPoliciesResponse`
23990 /// Indicates that this is a continuation of a prior
23991 /// `ListServerTlsPolicies` call, and that the system
23992 /// should return the next page of data.
23993 pub page_token: std::string::String,
23994
23995 /// Optional. Setting this field to `true` will opt the request into returning
23996 /// the resources that are reachable, and into including the names of those
23997 /// that were unreachable in the [ListServerTlsPoliciesResponse.unreachable]
23998 /// field. This can only be `true` when reading across collections e.g. when
23999 /// `parent` is set to `"projects/example/locations/-"`.
24000 pub return_partial_success: bool,
24001
24002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24003}
24004
24005impl ListServerTlsPoliciesRequest {
24006 /// Creates a new default instance.
24007 pub fn new() -> Self {
24008 std::default::Default::default()
24009 }
24010
24011 /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
24012 ///
24013 /// # Example
24014 /// ```ignore,no_run
24015 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24016 /// let x = ListServerTlsPoliciesRequest::new().set_parent("example");
24017 /// ```
24018 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24019 self.parent = v.into();
24020 self
24021 }
24022
24023 /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
24024 ///
24025 /// # Example
24026 /// ```ignore,no_run
24027 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24028 /// let x = ListServerTlsPoliciesRequest::new().set_page_size(42);
24029 /// ```
24030 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24031 self.page_size = v.into();
24032 self
24033 }
24034
24035 /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
24036 ///
24037 /// # Example
24038 /// ```ignore,no_run
24039 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24040 /// let x = ListServerTlsPoliciesRequest::new().set_page_token("example");
24041 /// ```
24042 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24043 self.page_token = v.into();
24044 self
24045 }
24046
24047 /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
24048 ///
24049 /// # Example
24050 /// ```ignore,no_run
24051 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
24052 /// let x = ListServerTlsPoliciesRequest::new().set_return_partial_success(true);
24053 /// ```
24054 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24055 self.return_partial_success = v.into();
24056 self
24057 }
24058}
24059
24060impl wkt::message::Message for ListServerTlsPoliciesRequest {
24061 fn typename() -> &'static str {
24062 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
24063 }
24064}
24065
24066/// Response returned by the ListServerTlsPolicies method.
24067#[derive(Clone, Default, PartialEq)]
24068#[non_exhaustive]
24069pub struct ListServerTlsPoliciesResponse {
24070 /// List of ServerTlsPolicy resources.
24071 pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
24072
24073 /// If there might be more results than those appearing in this response, then
24074 /// `next_page_token` is included. To get the next set of results, call this
24075 /// method again using the value of `next_page_token` as `page_token`.
24076 pub next_page_token: std::string::String,
24077
24078 /// Unreachable resources. Populated when the request opts into
24079 /// `return_partial_success` and reading across collections e.g. when
24080 /// attempting to list all resources across all supported locations.
24081 pub unreachable: std::vec::Vec<std::string::String>,
24082
24083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24084}
24085
24086impl ListServerTlsPoliciesResponse {
24087 /// Creates a new default instance.
24088 pub fn new() -> Self {
24089 std::default::Default::default()
24090 }
24091
24092 /// Sets the value of [server_tls_policies][crate::model::ListServerTlsPoliciesResponse::server_tls_policies].
24093 ///
24094 /// # Example
24095 /// ```ignore,no_run
24096 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24097 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24098 /// let x = ListServerTlsPoliciesResponse::new()
24099 /// .set_server_tls_policies([
24100 /// ServerTlsPolicy::default()/* use setters */,
24101 /// ServerTlsPolicy::default()/* use (different) setters */,
24102 /// ]);
24103 /// ```
24104 pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
24105 where
24106 T: std::iter::IntoIterator<Item = V>,
24107 V: std::convert::Into<crate::model::ServerTlsPolicy>,
24108 {
24109 use std::iter::Iterator;
24110 self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
24111 self
24112 }
24113
24114 /// Sets the value of [next_page_token][crate::model::ListServerTlsPoliciesResponse::next_page_token].
24115 ///
24116 /// # Example
24117 /// ```ignore,no_run
24118 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24119 /// let x = ListServerTlsPoliciesResponse::new().set_next_page_token("example");
24120 /// ```
24121 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24122 self.next_page_token = v.into();
24123 self
24124 }
24125
24126 /// Sets the value of [unreachable][crate::model::ListServerTlsPoliciesResponse::unreachable].
24127 ///
24128 /// # Example
24129 /// ```ignore,no_run
24130 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
24131 /// let x = ListServerTlsPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
24132 /// ```
24133 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
24134 where
24135 T: std::iter::IntoIterator<Item = V>,
24136 V: std::convert::Into<std::string::String>,
24137 {
24138 use std::iter::Iterator;
24139 self.unreachable = v.into_iter().map(|i| i.into()).collect();
24140 self
24141 }
24142}
24143
24144impl wkt::message::Message for ListServerTlsPoliciesResponse {
24145 fn typename() -> &'static str {
24146 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
24147 }
24148}
24149
24150#[doc(hidden)]
24151impl google_cloud_gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
24152 type PageItem = crate::model::ServerTlsPolicy;
24153
24154 fn items(self) -> std::vec::Vec<Self::PageItem> {
24155 self.server_tls_policies
24156 }
24157
24158 fn next_page_token(&self) -> std::string::String {
24159 use std::clone::Clone;
24160 self.next_page_token.clone()
24161 }
24162}
24163
24164/// Request used by the GetServerTlsPolicy method.
24165#[derive(Clone, Default, PartialEq)]
24166#[non_exhaustive]
24167pub struct GetServerTlsPolicyRequest {
24168 /// Required. A name of the ServerTlsPolicy to get. Must be in the format
24169 /// `projects/*/locations/{location}/serverTlsPolicies/*`.
24170 pub name: std::string::String,
24171
24172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24173}
24174
24175impl GetServerTlsPolicyRequest {
24176 /// Creates a new default instance.
24177 pub fn new() -> Self {
24178 std::default::Default::default()
24179 }
24180
24181 /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
24182 ///
24183 /// # Example
24184 /// ```ignore,no_run
24185 /// # use google_cloud_networksecurity_v1::model::GetServerTlsPolicyRequest;
24186 /// # let project_id = "project_id";
24187 /// # let location_id = "location_id";
24188 /// # let server_tls_policy_id = "server_tls_policy_id";
24189 /// let x = GetServerTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
24190 /// ```
24191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24192 self.name = v.into();
24193 self
24194 }
24195}
24196
24197impl wkt::message::Message for GetServerTlsPolicyRequest {
24198 fn typename() -> &'static str {
24199 "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
24200 }
24201}
24202
24203/// Request used by the CreateServerTlsPolicy method.
24204#[derive(Clone, Default, PartialEq)]
24205#[non_exhaustive]
24206pub struct CreateServerTlsPolicyRequest {
24207 /// Required. The parent resource of the ServerTlsPolicy. Must be in
24208 /// the format `projects/*/locations/{location}`.
24209 pub parent: std::string::String,
24210
24211 /// Required. Short name of the ServerTlsPolicy resource to be created. This
24212 /// value should be 1-63 characters long, containing only letters, numbers,
24213 /// hyphens, and underscores, and should not start with a number. E.g.
24214 /// "server_mtls_policy".
24215 pub server_tls_policy_id: std::string::String,
24216
24217 /// Required. ServerTlsPolicy resource to be created.
24218 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
24219
24220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24221}
24222
24223impl CreateServerTlsPolicyRequest {
24224 /// Creates a new default instance.
24225 pub fn new() -> Self {
24226 std::default::Default::default()
24227 }
24228
24229 /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
24230 ///
24231 /// # Example
24232 /// ```ignore,no_run
24233 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24234 /// # let project_id = "project_id";
24235 /// # let location_id = "location_id";
24236 /// let x = CreateServerTlsPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
24237 /// ```
24238 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24239 self.parent = v.into();
24240 self
24241 }
24242
24243 /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
24244 ///
24245 /// # Example
24246 /// ```ignore,no_run
24247 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24248 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy_id("example");
24249 /// ```
24250 pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
24251 mut self,
24252 v: T,
24253 ) -> Self {
24254 self.server_tls_policy_id = v.into();
24255 self
24256 }
24257
24258 /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
24259 ///
24260 /// # Example
24261 /// ```ignore,no_run
24262 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24263 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24264 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
24265 /// ```
24266 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
24267 where
24268 T: std::convert::Into<crate::model::ServerTlsPolicy>,
24269 {
24270 self.server_tls_policy = std::option::Option::Some(v.into());
24271 self
24272 }
24273
24274 /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
24275 ///
24276 /// # Example
24277 /// ```ignore,no_run
24278 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
24279 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24280 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
24281 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
24282 /// ```
24283 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
24284 where
24285 T: std::convert::Into<crate::model::ServerTlsPolicy>,
24286 {
24287 self.server_tls_policy = v.map(|x| x.into());
24288 self
24289 }
24290}
24291
24292impl wkt::message::Message for CreateServerTlsPolicyRequest {
24293 fn typename() -> &'static str {
24294 "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
24295 }
24296}
24297
24298/// Request used by UpdateServerTlsPolicy method.
24299#[derive(Clone, Default, PartialEq)]
24300#[non_exhaustive]
24301pub struct UpdateServerTlsPolicyRequest {
24302 /// Optional. Field mask is used to specify the fields to be overwritten in the
24303 /// ServerTlsPolicy resource by the update. The fields
24304 /// specified in the update_mask are relative to the resource, not
24305 /// the full request. A field will be overwritten if it is in the
24306 /// mask. If the user does not provide a mask then all fields will be
24307 /// overwritten.
24308 pub update_mask: std::option::Option<wkt::FieldMask>,
24309
24310 /// Required. Updated ServerTlsPolicy resource.
24311 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
24312
24313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24314}
24315
24316impl UpdateServerTlsPolicyRequest {
24317 /// Creates a new default instance.
24318 pub fn new() -> Self {
24319 std::default::Default::default()
24320 }
24321
24322 /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
24323 ///
24324 /// # Example
24325 /// ```ignore,no_run
24326 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24327 /// use wkt::FieldMask;
24328 /// let x = UpdateServerTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
24329 /// ```
24330 pub fn set_update_mask<T>(mut self, v: T) -> Self
24331 where
24332 T: std::convert::Into<wkt::FieldMask>,
24333 {
24334 self.update_mask = std::option::Option::Some(v.into());
24335 self
24336 }
24337
24338 /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
24339 ///
24340 /// # Example
24341 /// ```ignore,no_run
24342 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24343 /// use wkt::FieldMask;
24344 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
24345 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
24346 /// ```
24347 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
24348 where
24349 T: std::convert::Into<wkt::FieldMask>,
24350 {
24351 self.update_mask = v.map(|x| x.into());
24352 self
24353 }
24354
24355 /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
24356 ///
24357 /// # Example
24358 /// ```ignore,no_run
24359 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24360 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24361 /// let x = UpdateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
24362 /// ```
24363 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
24364 where
24365 T: std::convert::Into<crate::model::ServerTlsPolicy>,
24366 {
24367 self.server_tls_policy = std::option::Option::Some(v.into());
24368 self
24369 }
24370
24371 /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
24372 ///
24373 /// # Example
24374 /// ```ignore,no_run
24375 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
24376 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
24377 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
24378 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
24379 /// ```
24380 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
24381 where
24382 T: std::convert::Into<crate::model::ServerTlsPolicy>,
24383 {
24384 self.server_tls_policy = v.map(|x| x.into());
24385 self
24386 }
24387}
24388
24389impl wkt::message::Message for UpdateServerTlsPolicyRequest {
24390 fn typename() -> &'static str {
24391 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
24392 }
24393}
24394
24395/// Request used by the DeleteServerTlsPolicy method.
24396#[derive(Clone, Default, PartialEq)]
24397#[non_exhaustive]
24398pub struct DeleteServerTlsPolicyRequest {
24399 /// Required. A name of the ServerTlsPolicy to delete. Must be in
24400 /// the format `projects/*/locations/{location}/serverTlsPolicies/*`.
24401 pub name: std::string::String,
24402
24403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24404}
24405
24406impl DeleteServerTlsPolicyRequest {
24407 /// Creates a new default instance.
24408 pub fn new() -> Self {
24409 std::default::Default::default()
24410 }
24411
24412 /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
24413 ///
24414 /// # Example
24415 /// ```ignore,no_run
24416 /// # use google_cloud_networksecurity_v1::model::DeleteServerTlsPolicyRequest;
24417 /// # let project_id = "project_id";
24418 /// # let location_id = "location_id";
24419 /// # let server_tls_policy_id = "server_tls_policy_id";
24420 /// let x = DeleteServerTlsPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serverTlsPolicies/{server_tls_policy_id}"));
24421 /// ```
24422 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24423 self.name = v.into();
24424 self
24425 }
24426}
24427
24428impl wkt::message::Message for DeleteServerTlsPolicyRequest {
24429 fn typename() -> &'static str {
24430 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
24431 }
24432}
24433
24434/// Represents a Secure Access Connect (SAC) realm resource.
24435///
24436/// A Secure Access Connect realm establishes a connection between your Google
24437/// Cloud project and an SSE service.
24438#[derive(Clone, Default, PartialEq)]
24439#[non_exhaustive]
24440pub struct SACRealm {
24441 /// Identifier. Resource name, in the form
24442 /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
24443 pub name: std::string::String,
24444
24445 /// Output only. Timestamp when the realm was created.
24446 pub create_time: std::option::Option<wkt::Timestamp>,
24447
24448 /// Output only. Timestamp when the realm was last updated.
24449 pub update_time: std::option::Option<wkt::Timestamp>,
24450
24451 /// Optional. Optional list of labels applied to the resource.
24452 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
24453
24454 /// Immutable. SSE service provider associated with the realm.
24455 pub security_service: crate::model::sac_realm::SecurityService,
24456
24457 /// Output only. Key to be shared with SSE service provider during pairing.
24458 pub pairing_key: std::option::Option<crate::model::sac_realm::PairingKey>,
24459
24460 /// Output only. State of the realm.
24461 pub state: crate::model::sac_realm::State,
24462
24463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24464}
24465
24466impl SACRealm {
24467 /// Creates a new default instance.
24468 pub fn new() -> Self {
24469 std::default::Default::default()
24470 }
24471
24472 /// Sets the value of [name][crate::model::SACRealm::name].
24473 ///
24474 /// # Example
24475 /// ```ignore,no_run
24476 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24477 /// # let project_id = "project_id";
24478 /// # let location_id = "location_id";
24479 /// # let sac_realm_id = "sac_realm_id";
24480 /// let x = SACRealm::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
24481 /// ```
24482 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24483 self.name = v.into();
24484 self
24485 }
24486
24487 /// Sets the value of [create_time][crate::model::SACRealm::create_time].
24488 ///
24489 /// # Example
24490 /// ```ignore,no_run
24491 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24492 /// use wkt::Timestamp;
24493 /// let x = SACRealm::new().set_create_time(Timestamp::default()/* use setters */);
24494 /// ```
24495 pub fn set_create_time<T>(mut self, v: T) -> Self
24496 where
24497 T: std::convert::Into<wkt::Timestamp>,
24498 {
24499 self.create_time = std::option::Option::Some(v.into());
24500 self
24501 }
24502
24503 /// Sets or clears the value of [create_time][crate::model::SACRealm::create_time].
24504 ///
24505 /// # Example
24506 /// ```ignore,no_run
24507 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24508 /// use wkt::Timestamp;
24509 /// let x = SACRealm::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
24510 /// let x = SACRealm::new().set_or_clear_create_time(None::<Timestamp>);
24511 /// ```
24512 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24513 where
24514 T: std::convert::Into<wkt::Timestamp>,
24515 {
24516 self.create_time = v.map(|x| x.into());
24517 self
24518 }
24519
24520 /// Sets the value of [update_time][crate::model::SACRealm::update_time].
24521 ///
24522 /// # Example
24523 /// ```ignore,no_run
24524 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24525 /// use wkt::Timestamp;
24526 /// let x = SACRealm::new().set_update_time(Timestamp::default()/* use setters */);
24527 /// ```
24528 pub fn set_update_time<T>(mut self, v: T) -> Self
24529 where
24530 T: std::convert::Into<wkt::Timestamp>,
24531 {
24532 self.update_time = std::option::Option::Some(v.into());
24533 self
24534 }
24535
24536 /// Sets or clears the value of [update_time][crate::model::SACRealm::update_time].
24537 ///
24538 /// # Example
24539 /// ```ignore,no_run
24540 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24541 /// use wkt::Timestamp;
24542 /// let x = SACRealm::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
24543 /// let x = SACRealm::new().set_or_clear_update_time(None::<Timestamp>);
24544 /// ```
24545 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24546 where
24547 T: std::convert::Into<wkt::Timestamp>,
24548 {
24549 self.update_time = v.map(|x| x.into());
24550 self
24551 }
24552
24553 /// Sets the value of [labels][crate::model::SACRealm::labels].
24554 ///
24555 /// # Example
24556 /// ```ignore,no_run
24557 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24558 /// let x = SACRealm::new().set_labels([
24559 /// ("key0", "abc"),
24560 /// ("key1", "xyz"),
24561 /// ]);
24562 /// ```
24563 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
24564 where
24565 T: std::iter::IntoIterator<Item = (K, V)>,
24566 K: std::convert::Into<std::string::String>,
24567 V: std::convert::Into<std::string::String>,
24568 {
24569 use std::iter::Iterator;
24570 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
24571 self
24572 }
24573
24574 /// Sets the value of [security_service][crate::model::SACRealm::security_service].
24575 ///
24576 /// # Example
24577 /// ```ignore,no_run
24578 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24579 /// use google_cloud_networksecurity_v1::model::sac_realm::SecurityService;
24580 /// let x0 = SACRealm::new().set_security_service(SecurityService::PaloAltoPrismaAccess);
24581 /// ```
24582 pub fn set_security_service<T: std::convert::Into<crate::model::sac_realm::SecurityService>>(
24583 mut self,
24584 v: T,
24585 ) -> Self {
24586 self.security_service = v.into();
24587 self
24588 }
24589
24590 /// Sets the value of [pairing_key][crate::model::SACRealm::pairing_key].
24591 ///
24592 /// # Example
24593 /// ```ignore,no_run
24594 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24595 /// use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24596 /// let x = SACRealm::new().set_pairing_key(PairingKey::default()/* use setters */);
24597 /// ```
24598 pub fn set_pairing_key<T>(mut self, v: T) -> Self
24599 where
24600 T: std::convert::Into<crate::model::sac_realm::PairingKey>,
24601 {
24602 self.pairing_key = std::option::Option::Some(v.into());
24603 self
24604 }
24605
24606 /// Sets or clears the value of [pairing_key][crate::model::SACRealm::pairing_key].
24607 ///
24608 /// # Example
24609 /// ```ignore,no_run
24610 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24611 /// use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24612 /// let x = SACRealm::new().set_or_clear_pairing_key(Some(PairingKey::default()/* use setters */));
24613 /// let x = SACRealm::new().set_or_clear_pairing_key(None::<PairingKey>);
24614 /// ```
24615 pub fn set_or_clear_pairing_key<T>(mut self, v: std::option::Option<T>) -> Self
24616 where
24617 T: std::convert::Into<crate::model::sac_realm::PairingKey>,
24618 {
24619 self.pairing_key = v.map(|x| x.into());
24620 self
24621 }
24622
24623 /// Sets the value of [state][crate::model::SACRealm::state].
24624 ///
24625 /// # Example
24626 /// ```ignore,no_run
24627 /// # use google_cloud_networksecurity_v1::model::SACRealm;
24628 /// use google_cloud_networksecurity_v1::model::sac_realm::State;
24629 /// let x0 = SACRealm::new().set_state(State::PendingPartnerAttachment);
24630 /// let x1 = SACRealm::new().set_state(State::PartnerAttached);
24631 /// let x2 = SACRealm::new().set_state(State::PartnerDetached);
24632 /// ```
24633 pub fn set_state<T: std::convert::Into<crate::model::sac_realm::State>>(
24634 mut self,
24635 v: T,
24636 ) -> Self {
24637 self.state = v.into();
24638 self
24639 }
24640}
24641
24642impl wkt::message::Message for SACRealm {
24643 fn typename() -> &'static str {
24644 "type.googleapis.com/google.cloud.networksecurity.v1.SACRealm"
24645 }
24646}
24647
24648/// Defines additional types related to [SACRealm].
24649pub mod sac_realm {
24650 #[allow(unused_imports)]
24651 use super::*;
24652
24653 /// Key to be shared with SSE service provider to establish global handshake.
24654 #[derive(Clone, Default, PartialEq)]
24655 #[non_exhaustive]
24656 pub struct PairingKey {
24657 /// Output only. Key value.
24658 pub key: std::string::String,
24659
24660 /// Output only. Timestamp in UTC of when this resource is considered
24661 /// expired. It expires 7 days after creation.
24662 pub expire_time: std::option::Option<wkt::Timestamp>,
24663
24664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24665 }
24666
24667 impl PairingKey {
24668 /// Creates a new default instance.
24669 pub fn new() -> Self {
24670 std::default::Default::default()
24671 }
24672
24673 /// Sets the value of [key][crate::model::sac_realm::PairingKey::key].
24674 ///
24675 /// # Example
24676 /// ```ignore,no_run
24677 /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24678 /// let x = PairingKey::new().set_key("example");
24679 /// ```
24680 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24681 self.key = v.into();
24682 self
24683 }
24684
24685 /// Sets the value of [expire_time][crate::model::sac_realm::PairingKey::expire_time].
24686 ///
24687 /// # Example
24688 /// ```ignore,no_run
24689 /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24690 /// use wkt::Timestamp;
24691 /// let x = PairingKey::new().set_expire_time(Timestamp::default()/* use setters */);
24692 /// ```
24693 pub fn set_expire_time<T>(mut self, v: T) -> Self
24694 where
24695 T: std::convert::Into<wkt::Timestamp>,
24696 {
24697 self.expire_time = std::option::Option::Some(v.into());
24698 self
24699 }
24700
24701 /// Sets or clears the value of [expire_time][crate::model::sac_realm::PairingKey::expire_time].
24702 ///
24703 /// # Example
24704 /// ```ignore,no_run
24705 /// # use google_cloud_networksecurity_v1::model::sac_realm::PairingKey;
24706 /// use wkt::Timestamp;
24707 /// let x = PairingKey::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
24708 /// let x = PairingKey::new().set_or_clear_expire_time(None::<Timestamp>);
24709 /// ```
24710 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
24711 where
24712 T: std::convert::Into<wkt::Timestamp>,
24713 {
24714 self.expire_time = v.map(|x| x.into());
24715 self
24716 }
24717 }
24718
24719 impl wkt::message::Message for PairingKey {
24720 fn typename() -> &'static str {
24721 "type.googleapis.com/google.cloud.networksecurity.v1.SACRealm.PairingKey"
24722 }
24723 }
24724
24725 /// SSE service provider
24726 ///
24727 /// # Working with unknown values
24728 ///
24729 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24730 /// additional enum variants at any time. Adding new variants is not considered
24731 /// a breaking change. Applications should write their code in anticipation of:
24732 ///
24733 /// - New values appearing in future releases of the client library, **and**
24734 /// - New values received dynamically, without application changes.
24735 ///
24736 /// Please consult the [Working with enums] section in the user guide for some
24737 /// guidelines.
24738 ///
24739 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24740 #[derive(Clone, Debug, PartialEq)]
24741 #[non_exhaustive]
24742 pub enum SecurityService {
24743 /// The default value. This value is used if the state is omitted.
24744 Unspecified,
24745 /// [Palo Alto Networks Prisma
24746 /// Access](https://www.paloaltonetworks.com/sase/access).
24747 PaloAltoPrismaAccess,
24748 /// If set, the enum was initialized with an unknown value.
24749 ///
24750 /// Applications can examine the value using [SecurityService::value] or
24751 /// [SecurityService::name].
24752 UnknownValue(security_service::UnknownValue),
24753 }
24754
24755 #[doc(hidden)]
24756 pub mod security_service {
24757 #[allow(unused_imports)]
24758 use super::*;
24759 #[derive(Clone, Debug, PartialEq)]
24760 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24761 }
24762
24763 impl SecurityService {
24764 /// Gets the enum value.
24765 ///
24766 /// Returns `None` if the enum contains an unknown value deserialized from
24767 /// the string representation of enums.
24768 pub fn value(&self) -> std::option::Option<i32> {
24769 match self {
24770 Self::Unspecified => std::option::Option::Some(0),
24771 Self::PaloAltoPrismaAccess => std::option::Option::Some(1),
24772 Self::UnknownValue(u) => u.0.value(),
24773 }
24774 }
24775
24776 /// Gets the enum value as a string.
24777 ///
24778 /// Returns `None` if the enum contains an unknown value deserialized from
24779 /// the integer representation of enums.
24780 pub fn name(&self) -> std::option::Option<&str> {
24781 match self {
24782 Self::Unspecified => std::option::Option::Some("SECURITY_SERVICE_UNSPECIFIED"),
24783 Self::PaloAltoPrismaAccess => std::option::Option::Some("PALO_ALTO_PRISMA_ACCESS"),
24784 Self::UnknownValue(u) => u.0.name(),
24785 }
24786 }
24787 }
24788
24789 impl std::default::Default for SecurityService {
24790 fn default() -> Self {
24791 use std::convert::From;
24792 Self::from(0)
24793 }
24794 }
24795
24796 impl std::fmt::Display for SecurityService {
24797 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24798 wkt::internal::display_enum(f, self.name(), self.value())
24799 }
24800 }
24801
24802 impl std::convert::From<i32> for SecurityService {
24803 fn from(value: i32) -> Self {
24804 match value {
24805 0 => Self::Unspecified,
24806 1 => Self::PaloAltoPrismaAccess,
24807 _ => Self::UnknownValue(security_service::UnknownValue(
24808 wkt::internal::UnknownEnumValue::Integer(value),
24809 )),
24810 }
24811 }
24812 }
24813
24814 impl std::convert::From<&str> for SecurityService {
24815 fn from(value: &str) -> Self {
24816 use std::string::ToString;
24817 match value {
24818 "SECURITY_SERVICE_UNSPECIFIED" => Self::Unspecified,
24819 "PALO_ALTO_PRISMA_ACCESS" => Self::PaloAltoPrismaAccess,
24820 _ => Self::UnknownValue(security_service::UnknownValue(
24821 wkt::internal::UnknownEnumValue::String(value.to_string()),
24822 )),
24823 }
24824 }
24825 }
24826
24827 impl serde::ser::Serialize for SecurityService {
24828 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24829 where
24830 S: serde::Serializer,
24831 {
24832 match self {
24833 Self::Unspecified => serializer.serialize_i32(0),
24834 Self::PaloAltoPrismaAccess => serializer.serialize_i32(1),
24835 Self::UnknownValue(u) => u.0.serialize(serializer),
24836 }
24837 }
24838 }
24839
24840 impl<'de> serde::de::Deserialize<'de> for SecurityService {
24841 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24842 where
24843 D: serde::Deserializer<'de>,
24844 {
24845 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityService>::new(
24846 ".google.cloud.networksecurity.v1.SACRealm.SecurityService",
24847 ))
24848 }
24849 }
24850
24851 /// State of the realm.
24852 ///
24853 /// # Working with unknown values
24854 ///
24855 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24856 /// additional enum variants at any time. Adding new variants is not considered
24857 /// a breaking change. Applications should write their code in anticipation of:
24858 ///
24859 /// - New values appearing in future releases of the client library, **and**
24860 /// - New values received dynamically, without application changes.
24861 ///
24862 /// Please consult the [Working with enums] section in the user guide for some
24863 /// guidelines.
24864 ///
24865 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24866 #[derive(Clone, Debug, PartialEq)]
24867 #[non_exhaustive]
24868 pub enum State {
24869 /// No state specified. This should not be used.
24870 Unspecified,
24871 /// Has never been attached to a partner.
24872 /// Used only for Prisma Access.
24873 PendingPartnerAttachment,
24874 /// Currently attached to a partner.
24875 PartnerAttached,
24876 /// Was once attached to a partner but has been detached.
24877 PartnerDetached,
24878 /// Is not attached to a partner and has an expired pairing key.
24879 /// Used only for Prisma Access.
24880 KeyExpired,
24881 /// If set, the enum was initialized with an unknown value.
24882 ///
24883 /// Applications can examine the value using [State::value] or
24884 /// [State::name].
24885 UnknownValue(state::UnknownValue),
24886 }
24887
24888 #[doc(hidden)]
24889 pub mod state {
24890 #[allow(unused_imports)]
24891 use super::*;
24892 #[derive(Clone, Debug, PartialEq)]
24893 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24894 }
24895
24896 impl State {
24897 /// Gets the enum value.
24898 ///
24899 /// Returns `None` if the enum contains an unknown value deserialized from
24900 /// the string representation of enums.
24901 pub fn value(&self) -> std::option::Option<i32> {
24902 match self {
24903 Self::Unspecified => std::option::Option::Some(0),
24904 Self::PendingPartnerAttachment => std::option::Option::Some(7),
24905 Self::PartnerAttached => std::option::Option::Some(1),
24906 Self::PartnerDetached => std::option::Option::Some(2),
24907 Self::KeyExpired => std::option::Option::Some(3),
24908 Self::UnknownValue(u) => u.0.value(),
24909 }
24910 }
24911
24912 /// Gets the enum value as a string.
24913 ///
24914 /// Returns `None` if the enum contains an unknown value deserialized from
24915 /// the integer representation of enums.
24916 pub fn name(&self) -> std::option::Option<&str> {
24917 match self {
24918 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
24919 Self::PendingPartnerAttachment => {
24920 std::option::Option::Some("PENDING_PARTNER_ATTACHMENT")
24921 }
24922 Self::PartnerAttached => std::option::Option::Some("PARTNER_ATTACHED"),
24923 Self::PartnerDetached => std::option::Option::Some("PARTNER_DETACHED"),
24924 Self::KeyExpired => std::option::Option::Some("KEY_EXPIRED"),
24925 Self::UnknownValue(u) => u.0.name(),
24926 }
24927 }
24928 }
24929
24930 impl std::default::Default for State {
24931 fn default() -> Self {
24932 use std::convert::From;
24933 Self::from(0)
24934 }
24935 }
24936
24937 impl std::fmt::Display for State {
24938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24939 wkt::internal::display_enum(f, self.name(), self.value())
24940 }
24941 }
24942
24943 impl std::convert::From<i32> for State {
24944 fn from(value: i32) -> Self {
24945 match value {
24946 0 => Self::Unspecified,
24947 1 => Self::PartnerAttached,
24948 2 => Self::PartnerDetached,
24949 3 => Self::KeyExpired,
24950 7 => Self::PendingPartnerAttachment,
24951 _ => Self::UnknownValue(state::UnknownValue(
24952 wkt::internal::UnknownEnumValue::Integer(value),
24953 )),
24954 }
24955 }
24956 }
24957
24958 impl std::convert::From<&str> for State {
24959 fn from(value: &str) -> Self {
24960 use std::string::ToString;
24961 match value {
24962 "STATE_UNSPECIFIED" => Self::Unspecified,
24963 "PENDING_PARTNER_ATTACHMENT" => Self::PendingPartnerAttachment,
24964 "PARTNER_ATTACHED" => Self::PartnerAttached,
24965 "PARTNER_DETACHED" => Self::PartnerDetached,
24966 "KEY_EXPIRED" => Self::KeyExpired,
24967 _ => Self::UnknownValue(state::UnknownValue(
24968 wkt::internal::UnknownEnumValue::String(value.to_string()),
24969 )),
24970 }
24971 }
24972 }
24973
24974 impl serde::ser::Serialize for State {
24975 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24976 where
24977 S: serde::Serializer,
24978 {
24979 match self {
24980 Self::Unspecified => serializer.serialize_i32(0),
24981 Self::PendingPartnerAttachment => serializer.serialize_i32(7),
24982 Self::PartnerAttached => serializer.serialize_i32(1),
24983 Self::PartnerDetached => serializer.serialize_i32(2),
24984 Self::KeyExpired => serializer.serialize_i32(3),
24985 Self::UnknownValue(u) => u.0.serialize(serializer),
24986 }
24987 }
24988 }
24989
24990 impl<'de> serde::de::Deserialize<'de> for State {
24991 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24992 where
24993 D: serde::Deserializer<'de>,
24994 {
24995 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
24996 ".google.cloud.networksecurity.v1.SACRealm.State",
24997 ))
24998 }
24999 }
25000}
25001
25002/// Request for `ListSACRealms` method.
25003#[derive(Clone, Default, PartialEq)]
25004#[non_exhaustive]
25005pub struct ListSACRealmsRequest {
25006 /// Required. The parent, in the form `projects/{project}/locations/global`.
25007 pub parent: std::string::String,
25008
25009 /// Optional. Requested page size. Server may return fewer items than
25010 /// requested. If unspecified, server will pick an appropriate default.
25011 pub page_size: i32,
25012
25013 /// Optional. A token identifying a page of results the server should return.
25014 pub page_token: std::string::String,
25015
25016 /// Optional. An expression that filters the list of results.
25017 pub filter: std::string::String,
25018
25019 /// Optional. Sort the results by a certain order.
25020 pub order_by: std::string::String,
25021
25022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25023}
25024
25025impl ListSACRealmsRequest {
25026 /// Creates a new default instance.
25027 pub fn new() -> Self {
25028 std::default::Default::default()
25029 }
25030
25031 /// Sets the value of [parent][crate::model::ListSACRealmsRequest::parent].
25032 ///
25033 /// # Example
25034 /// ```ignore,no_run
25035 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25036 /// # let project_id = "project_id";
25037 /// # let location_id = "location_id";
25038 /// let x = ListSACRealmsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25039 /// ```
25040 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25041 self.parent = v.into();
25042 self
25043 }
25044
25045 /// Sets the value of [page_size][crate::model::ListSACRealmsRequest::page_size].
25046 ///
25047 /// # Example
25048 /// ```ignore,no_run
25049 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25050 /// let x = ListSACRealmsRequest::new().set_page_size(42);
25051 /// ```
25052 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25053 self.page_size = v.into();
25054 self
25055 }
25056
25057 /// Sets the value of [page_token][crate::model::ListSACRealmsRequest::page_token].
25058 ///
25059 /// # Example
25060 /// ```ignore,no_run
25061 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25062 /// let x = ListSACRealmsRequest::new().set_page_token("example");
25063 /// ```
25064 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25065 self.page_token = v.into();
25066 self
25067 }
25068
25069 /// Sets the value of [filter][crate::model::ListSACRealmsRequest::filter].
25070 ///
25071 /// # Example
25072 /// ```ignore,no_run
25073 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25074 /// let x = ListSACRealmsRequest::new().set_filter("example");
25075 /// ```
25076 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25077 self.filter = v.into();
25078 self
25079 }
25080
25081 /// Sets the value of [order_by][crate::model::ListSACRealmsRequest::order_by].
25082 ///
25083 /// # Example
25084 /// ```ignore,no_run
25085 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsRequest;
25086 /// let x = ListSACRealmsRequest::new().set_order_by("example");
25087 /// ```
25088 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25089 self.order_by = v.into();
25090 self
25091 }
25092}
25093
25094impl wkt::message::Message for ListSACRealmsRequest {
25095 fn typename() -> &'static str {
25096 "type.googleapis.com/google.cloud.networksecurity.v1.ListSACRealmsRequest"
25097 }
25098}
25099
25100/// Response for `ListSACRealms` method.
25101#[derive(Clone, Default, PartialEq)]
25102#[non_exhaustive]
25103pub struct ListSACRealmsResponse {
25104 /// The list of SACRealms.
25105 pub sac_realms: std::vec::Vec<crate::model::SACRealm>,
25106
25107 /// A token identifying a page of results the server should return.
25108 pub next_page_token: std::string::String,
25109
25110 /// Locations that could not be reached.
25111 pub unreachable: std::vec::Vec<std::string::String>,
25112
25113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25114}
25115
25116impl ListSACRealmsResponse {
25117 /// Creates a new default instance.
25118 pub fn new() -> Self {
25119 std::default::Default::default()
25120 }
25121
25122 /// Sets the value of [sac_realms][crate::model::ListSACRealmsResponse::sac_realms].
25123 ///
25124 /// # Example
25125 /// ```ignore,no_run
25126 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25127 /// use google_cloud_networksecurity_v1::model::SACRealm;
25128 /// let x = ListSACRealmsResponse::new()
25129 /// .set_sac_realms([
25130 /// SACRealm::default()/* use setters */,
25131 /// SACRealm::default()/* use (different) setters */,
25132 /// ]);
25133 /// ```
25134 pub fn set_sac_realms<T, V>(mut self, v: T) -> Self
25135 where
25136 T: std::iter::IntoIterator<Item = V>,
25137 V: std::convert::Into<crate::model::SACRealm>,
25138 {
25139 use std::iter::Iterator;
25140 self.sac_realms = v.into_iter().map(|i| i.into()).collect();
25141 self
25142 }
25143
25144 /// Sets the value of [next_page_token][crate::model::ListSACRealmsResponse::next_page_token].
25145 ///
25146 /// # Example
25147 /// ```ignore,no_run
25148 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25149 /// let x = ListSACRealmsResponse::new().set_next_page_token("example");
25150 /// ```
25151 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25152 self.next_page_token = v.into();
25153 self
25154 }
25155
25156 /// Sets the value of [unreachable][crate::model::ListSACRealmsResponse::unreachable].
25157 ///
25158 /// # Example
25159 /// ```ignore,no_run
25160 /// # use google_cloud_networksecurity_v1::model::ListSACRealmsResponse;
25161 /// let x = ListSACRealmsResponse::new().set_unreachable(["a", "b", "c"]);
25162 /// ```
25163 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25164 where
25165 T: std::iter::IntoIterator<Item = V>,
25166 V: std::convert::Into<std::string::String>,
25167 {
25168 use std::iter::Iterator;
25169 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25170 self
25171 }
25172}
25173
25174impl wkt::message::Message for ListSACRealmsResponse {
25175 fn typename() -> &'static str {
25176 "type.googleapis.com/google.cloud.networksecurity.v1.ListSACRealmsResponse"
25177 }
25178}
25179
25180#[doc(hidden)]
25181impl google_cloud_gax::paginator::internal::PageableResponse for ListSACRealmsResponse {
25182 type PageItem = crate::model::SACRealm;
25183
25184 fn items(self) -> std::vec::Vec<Self::PageItem> {
25185 self.sac_realms
25186 }
25187
25188 fn next_page_token(&self) -> std::string::String {
25189 use std::clone::Clone;
25190 self.next_page_token.clone()
25191 }
25192}
25193
25194/// Request for `GetSACRealm` method.
25195#[derive(Clone, Default, PartialEq)]
25196#[non_exhaustive]
25197pub struct GetSACRealmRequest {
25198 /// Required. Name of the resource, in the form
25199 /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
25200 pub name: std::string::String,
25201
25202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25203}
25204
25205impl GetSACRealmRequest {
25206 /// Creates a new default instance.
25207 pub fn new() -> Self {
25208 std::default::Default::default()
25209 }
25210
25211 /// Sets the value of [name][crate::model::GetSACRealmRequest::name].
25212 ///
25213 /// # Example
25214 /// ```ignore,no_run
25215 /// # use google_cloud_networksecurity_v1::model::GetSACRealmRequest;
25216 /// # let project_id = "project_id";
25217 /// # let location_id = "location_id";
25218 /// # let sac_realm_id = "sac_realm_id";
25219 /// let x = GetSACRealmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
25220 /// ```
25221 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25222 self.name = v.into();
25223 self
25224 }
25225}
25226
25227impl wkt::message::Message for GetSACRealmRequest {
25228 fn typename() -> &'static str {
25229 "type.googleapis.com/google.cloud.networksecurity.v1.GetSACRealmRequest"
25230 }
25231}
25232
25233/// Request for `CreateSACRealm` method.
25234#[derive(Clone, Default, PartialEq)]
25235#[non_exhaustive]
25236pub struct CreateSACRealmRequest {
25237 /// Required. The parent, in the form `projects/{project}/locations/global`.
25238 pub parent: std::string::String,
25239
25240 /// Required. ID of the created realm.
25241 /// The ID must be 1-63 characters long, and comply with
25242 /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
25243 /// Specifically, it must be 1-63 characters long and match the regular
25244 /// expression `[a-z]([-a-z0-9]*[a-z0-9])?`
25245 /// which means the first character must be a lowercase letter, and all
25246 /// following characters must be a dash, lowercase letter, or digit, except
25247 /// the last character, which cannot be a dash.
25248 pub sac_realm_id: std::string::String,
25249
25250 /// Required. The resource being created.
25251 pub sac_realm: std::option::Option<crate::model::SACRealm>,
25252
25253 /// Optional. An optional request ID to identify requests. Specify a unique
25254 /// request ID so that if you must retry your request, the server will know to
25255 /// ignore the request if it has already been completed. The server will
25256 /// guarantee that for at least 60 minutes since the first request.
25257 ///
25258 /// For example, consider a situation where you make an initial request and the
25259 /// request times out. If you make the request again with the same request
25260 /// ID, the server can check if original operation with the same request ID
25261 /// was received, and if so, will ignore the second request. This prevents
25262 /// clients from accidentally creating duplicate commitments.
25263 ///
25264 /// The request ID must be a valid UUID with the exception that zero UUID is
25265 /// not supported (00000000-0000-0000-0000-000000000000).
25266 pub request_id: std::string::String,
25267
25268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25269}
25270
25271impl CreateSACRealmRequest {
25272 /// Creates a new default instance.
25273 pub fn new() -> Self {
25274 std::default::Default::default()
25275 }
25276
25277 /// Sets the value of [parent][crate::model::CreateSACRealmRequest::parent].
25278 ///
25279 /// # Example
25280 /// ```ignore,no_run
25281 /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25282 /// # let project_id = "project_id";
25283 /// # let location_id = "location_id";
25284 /// let x = CreateSACRealmRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25285 /// ```
25286 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25287 self.parent = v.into();
25288 self
25289 }
25290
25291 /// Sets the value of [sac_realm_id][crate::model::CreateSACRealmRequest::sac_realm_id].
25292 ///
25293 /// # Example
25294 /// ```ignore,no_run
25295 /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25296 /// let x = CreateSACRealmRequest::new().set_sac_realm_id("example");
25297 /// ```
25298 pub fn set_sac_realm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25299 self.sac_realm_id = v.into();
25300 self
25301 }
25302
25303 /// Sets the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25304 ///
25305 /// # Example
25306 /// ```ignore,no_run
25307 /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25308 /// use google_cloud_networksecurity_v1::model::SACRealm;
25309 /// let x = CreateSACRealmRequest::new().set_sac_realm(SACRealm::default()/* use setters */);
25310 /// ```
25311 pub fn set_sac_realm<T>(mut self, v: T) -> Self
25312 where
25313 T: std::convert::Into<crate::model::SACRealm>,
25314 {
25315 self.sac_realm = std::option::Option::Some(v.into());
25316 self
25317 }
25318
25319 /// Sets or clears the value of [sac_realm][crate::model::CreateSACRealmRequest::sac_realm].
25320 ///
25321 /// # Example
25322 /// ```ignore,no_run
25323 /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25324 /// use google_cloud_networksecurity_v1::model::SACRealm;
25325 /// let x = CreateSACRealmRequest::new().set_or_clear_sac_realm(Some(SACRealm::default()/* use setters */));
25326 /// let x = CreateSACRealmRequest::new().set_or_clear_sac_realm(None::<SACRealm>);
25327 /// ```
25328 pub fn set_or_clear_sac_realm<T>(mut self, v: std::option::Option<T>) -> Self
25329 where
25330 T: std::convert::Into<crate::model::SACRealm>,
25331 {
25332 self.sac_realm = v.map(|x| x.into());
25333 self
25334 }
25335
25336 /// Sets the value of [request_id][crate::model::CreateSACRealmRequest::request_id].
25337 ///
25338 /// # Example
25339 /// ```ignore,no_run
25340 /// # use google_cloud_networksecurity_v1::model::CreateSACRealmRequest;
25341 /// let x = CreateSACRealmRequest::new().set_request_id("example");
25342 /// ```
25343 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25344 self.request_id = v.into();
25345 self
25346 }
25347}
25348
25349impl wkt::message::Message for CreateSACRealmRequest {
25350 fn typename() -> &'static str {
25351 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSACRealmRequest"
25352 }
25353}
25354
25355/// Request for `DeleteSACRealm` method.
25356#[derive(Clone, Default, PartialEq)]
25357#[non_exhaustive]
25358pub struct DeleteSACRealmRequest {
25359 /// Required. Name of the resource, in the form
25360 /// `projects/{project}/locations/global/sacRealms/{sacRealm}`.
25361 pub name: std::string::String,
25362
25363 /// Optional. An optional request ID to identify requests. Specify a unique
25364 /// request ID so that if you must retry your request, the server will know to
25365 /// ignore the request if it has already been completed. The server will
25366 /// guarantee that for at least 60 minutes after the first request.
25367 ///
25368 /// For example, consider a situation where you make an initial request and the
25369 /// request times out. If you make the request again with the same request
25370 /// ID, the server can check if original operation with the same request ID
25371 /// was received, and if so, will ignore the second request. This prevents
25372 /// clients from accidentally creating duplicate commitments.
25373 ///
25374 /// The request ID must be a valid UUID with the exception that zero UUID is
25375 /// not supported (00000000-0000-0000-0000-000000000000).
25376 pub request_id: std::string::String,
25377
25378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25379}
25380
25381impl DeleteSACRealmRequest {
25382 /// Creates a new default instance.
25383 pub fn new() -> Self {
25384 std::default::Default::default()
25385 }
25386
25387 /// Sets the value of [name][crate::model::DeleteSACRealmRequest::name].
25388 ///
25389 /// # Example
25390 /// ```ignore,no_run
25391 /// # use google_cloud_networksecurity_v1::model::DeleteSACRealmRequest;
25392 /// # let project_id = "project_id";
25393 /// # let location_id = "location_id";
25394 /// # let sac_realm_id = "sac_realm_id";
25395 /// let x = DeleteSACRealmRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacRealms/{sac_realm_id}"));
25396 /// ```
25397 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25398 self.name = v.into();
25399 self
25400 }
25401
25402 /// Sets the value of [request_id][crate::model::DeleteSACRealmRequest::request_id].
25403 ///
25404 /// # Example
25405 /// ```ignore,no_run
25406 /// # use google_cloud_networksecurity_v1::model::DeleteSACRealmRequest;
25407 /// let x = DeleteSACRealmRequest::new().set_request_id("example");
25408 /// ```
25409 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25410 self.request_id = v.into();
25411 self
25412 }
25413}
25414
25415impl wkt::message::Message for DeleteSACRealmRequest {
25416 fn typename() -> &'static str {
25417 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSACRealmRequest"
25418 }
25419}
25420
25421/// Represents a Secure Access Connect (SAC) attachment resource.
25422///
25423/// A Secure Access Connect attachment enables NCC Gateway to process traffic
25424/// with an SSE product.
25425#[derive(Clone, Default, PartialEq)]
25426#[non_exhaustive]
25427pub struct SACAttachment {
25428 /// Identifier. Resource name, in the form
25429 /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
25430 pub name: std::string::String,
25431
25432 /// Output only. Timestamp when the attachment was created.
25433 pub create_time: std::option::Option<wkt::Timestamp>,
25434
25435 /// Output only. Timestamp when the attachment was last updated.
25436 pub update_time: std::option::Option<wkt::Timestamp>,
25437
25438 /// Optional. Optional list of labels applied to the resource.
25439 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
25440
25441 /// Required. SAC Realm which owns the attachment. This can be input as an ID
25442 /// or a full resource name. The output always has the form
25443 /// `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`.
25444 pub sac_realm: std::string::String,
25445
25446 /// Required. NCC Gateway associated with the attachment. This can be input as
25447 /// an ID or a full resource name. The output always has the form
25448 /// `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`.
25449 pub ncc_gateway: std::string::String,
25450
25451 /// Output only. State of the attachment.
25452 pub state: crate::model::sac_attachment::State,
25453
25454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25455}
25456
25457impl SACAttachment {
25458 /// Creates a new default instance.
25459 pub fn new() -> Self {
25460 std::default::Default::default()
25461 }
25462
25463 /// Sets the value of [name][crate::model::SACAttachment::name].
25464 ///
25465 /// # Example
25466 /// ```ignore,no_run
25467 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25468 /// # let project_id = "project_id";
25469 /// # let location_id = "location_id";
25470 /// # let sac_attachment_id = "sac_attachment_id";
25471 /// let x = SACAttachment::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
25472 /// ```
25473 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25474 self.name = v.into();
25475 self
25476 }
25477
25478 /// Sets the value of [create_time][crate::model::SACAttachment::create_time].
25479 ///
25480 /// # Example
25481 /// ```ignore,no_run
25482 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25483 /// use wkt::Timestamp;
25484 /// let x = SACAttachment::new().set_create_time(Timestamp::default()/* use setters */);
25485 /// ```
25486 pub fn set_create_time<T>(mut self, v: T) -> Self
25487 where
25488 T: std::convert::Into<wkt::Timestamp>,
25489 {
25490 self.create_time = std::option::Option::Some(v.into());
25491 self
25492 }
25493
25494 /// Sets or clears the value of [create_time][crate::model::SACAttachment::create_time].
25495 ///
25496 /// # Example
25497 /// ```ignore,no_run
25498 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25499 /// use wkt::Timestamp;
25500 /// let x = SACAttachment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
25501 /// let x = SACAttachment::new().set_or_clear_create_time(None::<Timestamp>);
25502 /// ```
25503 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
25504 where
25505 T: std::convert::Into<wkt::Timestamp>,
25506 {
25507 self.create_time = v.map(|x| x.into());
25508 self
25509 }
25510
25511 /// Sets the value of [update_time][crate::model::SACAttachment::update_time].
25512 ///
25513 /// # Example
25514 /// ```ignore,no_run
25515 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25516 /// use wkt::Timestamp;
25517 /// let x = SACAttachment::new().set_update_time(Timestamp::default()/* use setters */);
25518 /// ```
25519 pub fn set_update_time<T>(mut self, v: T) -> Self
25520 where
25521 T: std::convert::Into<wkt::Timestamp>,
25522 {
25523 self.update_time = std::option::Option::Some(v.into());
25524 self
25525 }
25526
25527 /// Sets or clears the value of [update_time][crate::model::SACAttachment::update_time].
25528 ///
25529 /// # Example
25530 /// ```ignore,no_run
25531 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25532 /// use wkt::Timestamp;
25533 /// let x = SACAttachment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
25534 /// let x = SACAttachment::new().set_or_clear_update_time(None::<Timestamp>);
25535 /// ```
25536 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
25537 where
25538 T: std::convert::Into<wkt::Timestamp>,
25539 {
25540 self.update_time = v.map(|x| x.into());
25541 self
25542 }
25543
25544 /// Sets the value of [labels][crate::model::SACAttachment::labels].
25545 ///
25546 /// # Example
25547 /// ```ignore,no_run
25548 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25549 /// let x = SACAttachment::new().set_labels([
25550 /// ("key0", "abc"),
25551 /// ("key1", "xyz"),
25552 /// ]);
25553 /// ```
25554 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
25555 where
25556 T: std::iter::IntoIterator<Item = (K, V)>,
25557 K: std::convert::Into<std::string::String>,
25558 V: std::convert::Into<std::string::String>,
25559 {
25560 use std::iter::Iterator;
25561 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
25562 self
25563 }
25564
25565 /// Sets the value of [sac_realm][crate::model::SACAttachment::sac_realm].
25566 ///
25567 /// # Example
25568 /// ```ignore,no_run
25569 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25570 /// let x = SACAttachment::new().set_sac_realm("example");
25571 /// ```
25572 pub fn set_sac_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25573 self.sac_realm = v.into();
25574 self
25575 }
25576
25577 /// Sets the value of [ncc_gateway][crate::model::SACAttachment::ncc_gateway].
25578 ///
25579 /// # Example
25580 /// ```ignore,no_run
25581 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25582 /// let x = SACAttachment::new().set_ncc_gateway("example");
25583 /// ```
25584 pub fn set_ncc_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25585 self.ncc_gateway = v.into();
25586 self
25587 }
25588
25589 /// Sets the value of [state][crate::model::SACAttachment::state].
25590 ///
25591 /// # Example
25592 /// ```ignore,no_run
25593 /// # use google_cloud_networksecurity_v1::model::SACAttachment;
25594 /// use google_cloud_networksecurity_v1::model::sac_attachment::State;
25595 /// let x0 = SACAttachment::new().set_state(State::PendingPartnerAttachment);
25596 /// let x1 = SACAttachment::new().set_state(State::PartnerAttached);
25597 /// let x2 = SACAttachment::new().set_state(State::PartnerDetached);
25598 /// ```
25599 pub fn set_state<T: std::convert::Into<crate::model::sac_attachment::State>>(
25600 mut self,
25601 v: T,
25602 ) -> Self {
25603 self.state = v.into();
25604 self
25605 }
25606}
25607
25608impl wkt::message::Message for SACAttachment {
25609 fn typename() -> &'static str {
25610 "type.googleapis.com/google.cloud.networksecurity.v1.SACAttachment"
25611 }
25612}
25613
25614/// Defines additional types related to [SACAttachment].
25615pub mod sac_attachment {
25616 #[allow(unused_imports)]
25617 use super::*;
25618
25619 /// State of the attachment.
25620 ///
25621 /// # Working with unknown values
25622 ///
25623 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25624 /// additional enum variants at any time. Adding new variants is not considered
25625 /// a breaking change. Applications should write their code in anticipation of:
25626 ///
25627 /// - New values appearing in future releases of the client library, **and**
25628 /// - New values received dynamically, without application changes.
25629 ///
25630 /// Please consult the [Working with enums] section in the user guide for some
25631 /// guidelines.
25632 ///
25633 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25634 #[derive(Clone, Debug, PartialEq)]
25635 #[non_exhaustive]
25636 pub enum State {
25637 /// No state specified. This should not be used.
25638 Unspecified,
25639 /// Has never been attached to a partner.
25640 PendingPartnerAttachment,
25641 /// Currently attached to a partner.
25642 PartnerAttached,
25643 /// Was once attached to a partner but has been detached.
25644 PartnerDetached,
25645 /// If set, the enum was initialized with an unknown value.
25646 ///
25647 /// Applications can examine the value using [State::value] or
25648 /// [State::name].
25649 UnknownValue(state::UnknownValue),
25650 }
25651
25652 #[doc(hidden)]
25653 pub mod state {
25654 #[allow(unused_imports)]
25655 use super::*;
25656 #[derive(Clone, Debug, PartialEq)]
25657 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25658 }
25659
25660 impl State {
25661 /// Gets the enum value.
25662 ///
25663 /// Returns `None` if the enum contains an unknown value deserialized from
25664 /// the string representation of enums.
25665 pub fn value(&self) -> std::option::Option<i32> {
25666 match self {
25667 Self::Unspecified => std::option::Option::Some(0),
25668 Self::PendingPartnerAttachment => std::option::Option::Some(1),
25669 Self::PartnerAttached => std::option::Option::Some(2),
25670 Self::PartnerDetached => std::option::Option::Some(3),
25671 Self::UnknownValue(u) => u.0.value(),
25672 }
25673 }
25674
25675 /// Gets the enum value as a string.
25676 ///
25677 /// Returns `None` if the enum contains an unknown value deserialized from
25678 /// the integer representation of enums.
25679 pub fn name(&self) -> std::option::Option<&str> {
25680 match self {
25681 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
25682 Self::PendingPartnerAttachment => {
25683 std::option::Option::Some("PENDING_PARTNER_ATTACHMENT")
25684 }
25685 Self::PartnerAttached => std::option::Option::Some("PARTNER_ATTACHED"),
25686 Self::PartnerDetached => std::option::Option::Some("PARTNER_DETACHED"),
25687 Self::UnknownValue(u) => u.0.name(),
25688 }
25689 }
25690 }
25691
25692 impl std::default::Default for State {
25693 fn default() -> Self {
25694 use std::convert::From;
25695 Self::from(0)
25696 }
25697 }
25698
25699 impl std::fmt::Display for State {
25700 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25701 wkt::internal::display_enum(f, self.name(), self.value())
25702 }
25703 }
25704
25705 impl std::convert::From<i32> for State {
25706 fn from(value: i32) -> Self {
25707 match value {
25708 0 => Self::Unspecified,
25709 1 => Self::PendingPartnerAttachment,
25710 2 => Self::PartnerAttached,
25711 3 => Self::PartnerDetached,
25712 _ => Self::UnknownValue(state::UnknownValue(
25713 wkt::internal::UnknownEnumValue::Integer(value),
25714 )),
25715 }
25716 }
25717 }
25718
25719 impl std::convert::From<&str> for State {
25720 fn from(value: &str) -> Self {
25721 use std::string::ToString;
25722 match value {
25723 "STATE_UNSPECIFIED" => Self::Unspecified,
25724 "PENDING_PARTNER_ATTACHMENT" => Self::PendingPartnerAttachment,
25725 "PARTNER_ATTACHED" => Self::PartnerAttached,
25726 "PARTNER_DETACHED" => Self::PartnerDetached,
25727 _ => Self::UnknownValue(state::UnknownValue(
25728 wkt::internal::UnknownEnumValue::String(value.to_string()),
25729 )),
25730 }
25731 }
25732 }
25733
25734 impl serde::ser::Serialize for State {
25735 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25736 where
25737 S: serde::Serializer,
25738 {
25739 match self {
25740 Self::Unspecified => serializer.serialize_i32(0),
25741 Self::PendingPartnerAttachment => serializer.serialize_i32(1),
25742 Self::PartnerAttached => serializer.serialize_i32(2),
25743 Self::PartnerDetached => serializer.serialize_i32(3),
25744 Self::UnknownValue(u) => u.0.serialize(serializer),
25745 }
25746 }
25747 }
25748
25749 impl<'de> serde::de::Deserialize<'de> for State {
25750 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25751 where
25752 D: serde::Deserializer<'de>,
25753 {
25754 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
25755 ".google.cloud.networksecurity.v1.SACAttachment.State",
25756 ))
25757 }
25758 }
25759}
25760
25761/// Request for `ListSACAttachments` method.
25762#[derive(Clone, Default, PartialEq)]
25763#[non_exhaustive]
25764pub struct ListSACAttachmentsRequest {
25765 /// Required. The parent, in the form
25766 /// `projects/{project}/locations/{location}`.
25767 pub parent: std::string::String,
25768
25769 /// Optional. Requested page size. Server may return fewer items than
25770 /// requested. If unspecified, server will pick an appropriate default.
25771 pub page_size: i32,
25772
25773 /// Optional. A token identifying a page of results the server should return.
25774 pub page_token: std::string::String,
25775
25776 /// Optional. An expression that filters the list of results.
25777 pub filter: std::string::String,
25778
25779 /// Optional. Sort the results by a certain order.
25780 pub order_by: std::string::String,
25781
25782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25783}
25784
25785impl ListSACAttachmentsRequest {
25786 /// Creates a new default instance.
25787 pub fn new() -> Self {
25788 std::default::Default::default()
25789 }
25790
25791 /// Sets the value of [parent][crate::model::ListSACAttachmentsRequest::parent].
25792 ///
25793 /// # Example
25794 /// ```ignore,no_run
25795 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25796 /// # let project_id = "project_id";
25797 /// # let location_id = "location_id";
25798 /// let x = ListSACAttachmentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
25799 /// ```
25800 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25801 self.parent = v.into();
25802 self
25803 }
25804
25805 /// Sets the value of [page_size][crate::model::ListSACAttachmentsRequest::page_size].
25806 ///
25807 /// # Example
25808 /// ```ignore,no_run
25809 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25810 /// let x = ListSACAttachmentsRequest::new().set_page_size(42);
25811 /// ```
25812 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25813 self.page_size = v.into();
25814 self
25815 }
25816
25817 /// Sets the value of [page_token][crate::model::ListSACAttachmentsRequest::page_token].
25818 ///
25819 /// # Example
25820 /// ```ignore,no_run
25821 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25822 /// let x = ListSACAttachmentsRequest::new().set_page_token("example");
25823 /// ```
25824 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25825 self.page_token = v.into();
25826 self
25827 }
25828
25829 /// Sets the value of [filter][crate::model::ListSACAttachmentsRequest::filter].
25830 ///
25831 /// # Example
25832 /// ```ignore,no_run
25833 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25834 /// let x = ListSACAttachmentsRequest::new().set_filter("example");
25835 /// ```
25836 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25837 self.filter = v.into();
25838 self
25839 }
25840
25841 /// Sets the value of [order_by][crate::model::ListSACAttachmentsRequest::order_by].
25842 ///
25843 /// # Example
25844 /// ```ignore,no_run
25845 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsRequest;
25846 /// let x = ListSACAttachmentsRequest::new().set_order_by("example");
25847 /// ```
25848 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25849 self.order_by = v.into();
25850 self
25851 }
25852}
25853
25854impl wkt::message::Message for ListSACAttachmentsRequest {
25855 fn typename() -> &'static str {
25856 "type.googleapis.com/google.cloud.networksecurity.v1.ListSACAttachmentsRequest"
25857 }
25858}
25859
25860/// Response for `ListSACAttachments` method.
25861#[derive(Clone, Default, PartialEq)]
25862#[non_exhaustive]
25863pub struct ListSACAttachmentsResponse {
25864 /// The list of SACAttachments.
25865 pub sac_attachments: std::vec::Vec<crate::model::SACAttachment>,
25866
25867 /// A token identifying a page of results the server should return.
25868 pub next_page_token: std::string::String,
25869
25870 /// Locations that could not be reached.
25871 pub unreachable: std::vec::Vec<std::string::String>,
25872
25873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25874}
25875
25876impl ListSACAttachmentsResponse {
25877 /// Creates a new default instance.
25878 pub fn new() -> Self {
25879 std::default::Default::default()
25880 }
25881
25882 /// Sets the value of [sac_attachments][crate::model::ListSACAttachmentsResponse::sac_attachments].
25883 ///
25884 /// # Example
25885 /// ```ignore,no_run
25886 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25887 /// use google_cloud_networksecurity_v1::model::SACAttachment;
25888 /// let x = ListSACAttachmentsResponse::new()
25889 /// .set_sac_attachments([
25890 /// SACAttachment::default()/* use setters */,
25891 /// SACAttachment::default()/* use (different) setters */,
25892 /// ]);
25893 /// ```
25894 pub fn set_sac_attachments<T, V>(mut self, v: T) -> Self
25895 where
25896 T: std::iter::IntoIterator<Item = V>,
25897 V: std::convert::Into<crate::model::SACAttachment>,
25898 {
25899 use std::iter::Iterator;
25900 self.sac_attachments = v.into_iter().map(|i| i.into()).collect();
25901 self
25902 }
25903
25904 /// Sets the value of [next_page_token][crate::model::ListSACAttachmentsResponse::next_page_token].
25905 ///
25906 /// # Example
25907 /// ```ignore,no_run
25908 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25909 /// let x = ListSACAttachmentsResponse::new().set_next_page_token("example");
25910 /// ```
25911 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25912 self.next_page_token = v.into();
25913 self
25914 }
25915
25916 /// Sets the value of [unreachable][crate::model::ListSACAttachmentsResponse::unreachable].
25917 ///
25918 /// # Example
25919 /// ```ignore,no_run
25920 /// # use google_cloud_networksecurity_v1::model::ListSACAttachmentsResponse;
25921 /// let x = ListSACAttachmentsResponse::new().set_unreachable(["a", "b", "c"]);
25922 /// ```
25923 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25924 where
25925 T: std::iter::IntoIterator<Item = V>,
25926 V: std::convert::Into<std::string::String>,
25927 {
25928 use std::iter::Iterator;
25929 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25930 self
25931 }
25932}
25933
25934impl wkt::message::Message for ListSACAttachmentsResponse {
25935 fn typename() -> &'static str {
25936 "type.googleapis.com/google.cloud.networksecurity.v1.ListSACAttachmentsResponse"
25937 }
25938}
25939
25940#[doc(hidden)]
25941impl google_cloud_gax::paginator::internal::PageableResponse for ListSACAttachmentsResponse {
25942 type PageItem = crate::model::SACAttachment;
25943
25944 fn items(self) -> std::vec::Vec<Self::PageItem> {
25945 self.sac_attachments
25946 }
25947
25948 fn next_page_token(&self) -> std::string::String {
25949 use std::clone::Clone;
25950 self.next_page_token.clone()
25951 }
25952}
25953
25954/// Request for `GetSACAttachment` method.
25955#[derive(Clone, Default, PartialEq)]
25956#[non_exhaustive]
25957pub struct GetSACAttachmentRequest {
25958 /// Required. Name of the resource, in the form
25959 /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
25960 pub name: std::string::String,
25961
25962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25963}
25964
25965impl GetSACAttachmentRequest {
25966 /// Creates a new default instance.
25967 pub fn new() -> Self {
25968 std::default::Default::default()
25969 }
25970
25971 /// Sets the value of [name][crate::model::GetSACAttachmentRequest::name].
25972 ///
25973 /// # Example
25974 /// ```ignore,no_run
25975 /// # use google_cloud_networksecurity_v1::model::GetSACAttachmentRequest;
25976 /// # let project_id = "project_id";
25977 /// # let location_id = "location_id";
25978 /// # let sac_attachment_id = "sac_attachment_id";
25979 /// let x = GetSACAttachmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
25980 /// ```
25981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25982 self.name = v.into();
25983 self
25984 }
25985}
25986
25987impl wkt::message::Message for GetSACAttachmentRequest {
25988 fn typename() -> &'static str {
25989 "type.googleapis.com/google.cloud.networksecurity.v1.GetSACAttachmentRequest"
25990 }
25991}
25992
25993/// Request for `CreateSACAttachment` method.
25994#[derive(Clone, Default, PartialEq)]
25995#[non_exhaustive]
25996pub struct CreateSACAttachmentRequest {
25997 /// Required. The parent, in the form
25998 /// `projects/{project}/locations/{location}`.
25999 pub parent: std::string::String,
26000
26001 /// Required. ID of the created attachment.
26002 /// The ID must be 1-63 characters long, and comply with
26003 /// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
26004 /// Specifically, it must be 1-63 characters long and match the regular
26005 /// expression `[a-z]([-a-z0-9]*[a-z0-9])?`
26006 /// which means the first character must be a lowercase letter, and all
26007 /// following characters must be a dash, lowercase letter, or digit, except
26008 /// the last character, which cannot be a dash.
26009 pub sac_attachment_id: std::string::String,
26010
26011 /// Required. The resource being created.
26012 pub sac_attachment: std::option::Option<crate::model::SACAttachment>,
26013
26014 /// Optional. An optional request ID to identify requests. Specify a unique
26015 /// request ID so that if you must retry your request, the server will know to
26016 /// ignore the request if it has already been completed. The server will
26017 /// guarantee that for at least 60 minutes since the first request.
26018 ///
26019 /// For example, consider a situation where you make an initial request and the
26020 /// request times out. If you make the request again with the same request
26021 /// ID, the server can check if original operation with the same request ID
26022 /// was received, and if so, will ignore the second request. This prevents
26023 /// clients from accidentally creating duplicate commitments.
26024 ///
26025 /// The request ID must be a valid UUID with the exception that zero UUID is
26026 /// not supported (00000000-0000-0000-0000-000000000000).
26027 pub request_id: std::string::String,
26028
26029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26030}
26031
26032impl CreateSACAttachmentRequest {
26033 /// Creates a new default instance.
26034 pub fn new() -> Self {
26035 std::default::Default::default()
26036 }
26037
26038 /// Sets the value of [parent][crate::model::CreateSACAttachmentRequest::parent].
26039 ///
26040 /// # Example
26041 /// ```ignore,no_run
26042 /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26043 /// # let project_id = "project_id";
26044 /// # let location_id = "location_id";
26045 /// let x = CreateSACAttachmentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
26046 /// ```
26047 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26048 self.parent = v.into();
26049 self
26050 }
26051
26052 /// Sets the value of [sac_attachment_id][crate::model::CreateSACAttachmentRequest::sac_attachment_id].
26053 ///
26054 /// # Example
26055 /// ```ignore,no_run
26056 /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26057 /// let x = CreateSACAttachmentRequest::new().set_sac_attachment_id("example");
26058 /// ```
26059 pub fn set_sac_attachment_id<T: std::convert::Into<std::string::String>>(
26060 mut self,
26061 v: T,
26062 ) -> Self {
26063 self.sac_attachment_id = v.into();
26064 self
26065 }
26066
26067 /// Sets the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
26068 ///
26069 /// # Example
26070 /// ```ignore,no_run
26071 /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26072 /// use google_cloud_networksecurity_v1::model::SACAttachment;
26073 /// let x = CreateSACAttachmentRequest::new().set_sac_attachment(SACAttachment::default()/* use setters */);
26074 /// ```
26075 pub fn set_sac_attachment<T>(mut self, v: T) -> Self
26076 where
26077 T: std::convert::Into<crate::model::SACAttachment>,
26078 {
26079 self.sac_attachment = std::option::Option::Some(v.into());
26080 self
26081 }
26082
26083 /// Sets or clears the value of [sac_attachment][crate::model::CreateSACAttachmentRequest::sac_attachment].
26084 ///
26085 /// # Example
26086 /// ```ignore,no_run
26087 /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26088 /// use google_cloud_networksecurity_v1::model::SACAttachment;
26089 /// let x = CreateSACAttachmentRequest::new().set_or_clear_sac_attachment(Some(SACAttachment::default()/* use setters */));
26090 /// let x = CreateSACAttachmentRequest::new().set_or_clear_sac_attachment(None::<SACAttachment>);
26091 /// ```
26092 pub fn set_or_clear_sac_attachment<T>(mut self, v: std::option::Option<T>) -> Self
26093 where
26094 T: std::convert::Into<crate::model::SACAttachment>,
26095 {
26096 self.sac_attachment = v.map(|x| x.into());
26097 self
26098 }
26099
26100 /// Sets the value of [request_id][crate::model::CreateSACAttachmentRequest::request_id].
26101 ///
26102 /// # Example
26103 /// ```ignore,no_run
26104 /// # use google_cloud_networksecurity_v1::model::CreateSACAttachmentRequest;
26105 /// let x = CreateSACAttachmentRequest::new().set_request_id("example");
26106 /// ```
26107 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26108 self.request_id = v.into();
26109 self
26110 }
26111}
26112
26113impl wkt::message::Message for CreateSACAttachmentRequest {
26114 fn typename() -> &'static str {
26115 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSACAttachmentRequest"
26116 }
26117}
26118
26119/// Request for `DeleteSACAttachment` method.
26120#[derive(Clone, Default, PartialEq)]
26121#[non_exhaustive]
26122pub struct DeleteSACAttachmentRequest {
26123 /// Required. Name of the resource, in the form
26124 /// `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`.
26125 pub name: std::string::String,
26126
26127 /// Optional. An optional request ID to identify requests. Specify a unique
26128 /// request ID so that if you must retry your request, the server will know to
26129 /// ignore the request if it has already been completed. The server will
26130 /// guarantee that for at least 60 minutes after the first request.
26131 ///
26132 /// For example, consider a situation where you make an initial request and the
26133 /// request times out. If you make the request again with the same request
26134 /// ID, the server can check if original operation with the same request ID
26135 /// was received, and if so, will ignore the second request. This prevents
26136 /// clients from accidentally creating duplicate commitments.
26137 ///
26138 /// The request ID must be a valid UUID with the exception that zero UUID is
26139 /// not supported (00000000-0000-0000-0000-000000000000).
26140 pub request_id: std::string::String,
26141
26142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26143}
26144
26145impl DeleteSACAttachmentRequest {
26146 /// Creates a new default instance.
26147 pub fn new() -> Self {
26148 std::default::Default::default()
26149 }
26150
26151 /// Sets the value of [name][crate::model::DeleteSACAttachmentRequest::name].
26152 ///
26153 /// # Example
26154 /// ```ignore,no_run
26155 /// # use google_cloud_networksecurity_v1::model::DeleteSACAttachmentRequest;
26156 /// # let project_id = "project_id";
26157 /// # let location_id = "location_id";
26158 /// # let sac_attachment_id = "sac_attachment_id";
26159 /// let x = DeleteSACAttachmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/sacAttachments/{sac_attachment_id}"));
26160 /// ```
26161 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26162 self.name = v.into();
26163 self
26164 }
26165
26166 /// Sets the value of [request_id][crate::model::DeleteSACAttachmentRequest::request_id].
26167 ///
26168 /// # Example
26169 /// ```ignore,no_run
26170 /// # use google_cloud_networksecurity_v1::model::DeleteSACAttachmentRequest;
26171 /// let x = DeleteSACAttachmentRequest::new().set_request_id("example");
26172 /// ```
26173 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26174 self.request_id = v.into();
26175 self
26176 }
26177}
26178
26179impl wkt::message::Message for DeleteSACAttachmentRequest {
26180 fn typename() -> &'static str {
26181 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSACAttachmentRequest"
26182 }
26183}
26184
26185/// Specification of the GRPC Endpoint.
26186#[derive(Clone, Default, PartialEq)]
26187#[non_exhaustive]
26188pub struct GrpcEndpoint {
26189 /// Required. The target URI of the gRPC endpoint. Only UDS path is supported,
26190 /// and should start with "unix:".
26191 pub target_uri: std::string::String,
26192
26193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26194}
26195
26196impl GrpcEndpoint {
26197 /// Creates a new default instance.
26198 pub fn new() -> Self {
26199 std::default::Default::default()
26200 }
26201
26202 /// Sets the value of [target_uri][crate::model::GrpcEndpoint::target_uri].
26203 ///
26204 /// # Example
26205 /// ```ignore,no_run
26206 /// # use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26207 /// let x = GrpcEndpoint::new().set_target_uri("example");
26208 /// ```
26209 pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26210 self.target_uri = v.into();
26211 self
26212 }
26213}
26214
26215impl wkt::message::Message for GrpcEndpoint {
26216 fn typename() -> &'static str {
26217 "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
26218 }
26219}
26220
26221/// Specification of ValidationCA. Defines the mechanism to obtain the
26222/// Certificate Authority certificate to validate the peer certificate.
26223#[derive(Clone, Default, PartialEq)]
26224#[non_exhaustive]
26225pub struct ValidationCA {
26226 /// The type of certificate provider which provides the CA certificate.
26227 pub r#type: std::option::Option<crate::model::validation_ca::Type>,
26228
26229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26230}
26231
26232impl ValidationCA {
26233 /// Creates a new default instance.
26234 pub fn new() -> Self {
26235 std::default::Default::default()
26236 }
26237
26238 /// Sets the value of [r#type][crate::model::ValidationCA::type].
26239 ///
26240 /// Note that all the setters affecting `r#type` are mutually
26241 /// exclusive.
26242 ///
26243 /// # Example
26244 /// ```ignore,no_run
26245 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26246 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26247 /// let x = ValidationCA::new().set_type(Some(
26248 /// google_cloud_networksecurity_v1::model::validation_ca::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
26249 /// ```
26250 pub fn set_type<
26251 T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
26252 >(
26253 mut self,
26254 v: T,
26255 ) -> Self {
26256 self.r#type = v.into();
26257 self
26258 }
26259
26260 /// The value of [r#type][crate::model::ValidationCA::r#type]
26261 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
26262 /// holds a different branch.
26263 pub fn grpc_endpoint(
26264 &self,
26265 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
26266 #[allow(unreachable_patterns)]
26267 self.r#type.as_ref().and_then(|v| match v {
26268 crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
26269 _ => std::option::Option::None,
26270 })
26271 }
26272
26273 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
26274 /// to hold a `GrpcEndpoint`.
26275 ///
26276 /// Note that all the setters affecting `r#type` are
26277 /// mutually exclusive.
26278 ///
26279 /// # Example
26280 /// ```ignore,no_run
26281 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26282 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26283 /// let x = ValidationCA::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
26284 /// assert!(x.grpc_endpoint().is_some());
26285 /// assert!(x.certificate_provider_instance().is_none());
26286 /// ```
26287 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
26288 mut self,
26289 v: T,
26290 ) -> Self {
26291 self.r#type =
26292 std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
26293 self
26294 }
26295
26296 /// The value of [r#type][crate::model::ValidationCA::r#type]
26297 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
26298 /// holds a different branch.
26299 pub fn certificate_provider_instance(
26300 &self,
26301 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
26302 #[allow(unreachable_patterns)]
26303 self.r#type.as_ref().and_then(|v| match v {
26304 crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
26305 std::option::Option::Some(v)
26306 }
26307 _ => std::option::Option::None,
26308 })
26309 }
26310
26311 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
26312 /// to hold a `CertificateProviderInstance`.
26313 ///
26314 /// Note that all the setters affecting `r#type` are
26315 /// mutually exclusive.
26316 ///
26317 /// # Example
26318 /// ```ignore,no_run
26319 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
26320 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26321 /// let x = ValidationCA::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
26322 /// assert!(x.certificate_provider_instance().is_some());
26323 /// assert!(x.grpc_endpoint().is_none());
26324 /// ```
26325 pub fn set_certificate_provider_instance<
26326 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
26327 >(
26328 mut self,
26329 v: T,
26330 ) -> Self {
26331 self.r#type = std::option::Option::Some(
26332 crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
26333 );
26334 self
26335 }
26336}
26337
26338impl wkt::message::Message for ValidationCA {
26339 fn typename() -> &'static str {
26340 "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
26341 }
26342}
26343
26344/// Defines additional types related to [ValidationCA].
26345pub mod validation_ca {
26346 #[allow(unused_imports)]
26347 use super::*;
26348
26349 /// The type of certificate provider which provides the CA certificate.
26350 #[derive(Clone, Debug, PartialEq)]
26351 #[non_exhaustive]
26352 pub enum Type {
26353 /// gRPC specific configuration to access the gRPC server to
26354 /// obtain the CA certificate.
26355 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
26356 /// The certificate provider instance specification that will be passed to
26357 /// the data plane, which will be used to load necessary credential
26358 /// information.
26359 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
26360 }
26361}
26362
26363/// Specification of a TLS certificate provider instance. Workloads may have one
26364/// or more CertificateProvider instances (plugins) and one of them is enabled
26365/// and configured by specifying this message. Workloads use the values from this
26366/// message to locate and load the CertificateProvider instance configuration.
26367#[derive(Clone, Default, PartialEq)]
26368#[non_exhaustive]
26369pub struct CertificateProviderInstance {
26370 /// Required. Plugin instance name, used to locate and load CertificateProvider
26371 /// instance configuration. Set to "google_cloud_private_spiffe" to use
26372 /// Certificate Authority Service certificate provider instance.
26373 pub plugin_instance: std::string::String,
26374
26375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26376}
26377
26378impl CertificateProviderInstance {
26379 /// Creates a new default instance.
26380 pub fn new() -> Self {
26381 std::default::Default::default()
26382 }
26383
26384 /// Sets the value of [plugin_instance][crate::model::CertificateProviderInstance::plugin_instance].
26385 ///
26386 /// # Example
26387 /// ```ignore,no_run
26388 /// # use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26389 /// let x = CertificateProviderInstance::new().set_plugin_instance("example");
26390 /// ```
26391 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26392 self.plugin_instance = v.into();
26393 self
26394 }
26395}
26396
26397impl wkt::message::Message for CertificateProviderInstance {
26398 fn typename() -> &'static str {
26399 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
26400 }
26401}
26402
26403/// Specification of certificate provider. Defines the mechanism to obtain the
26404/// certificate and private key for peer to peer authentication.
26405#[derive(Clone, Default, PartialEq)]
26406#[non_exhaustive]
26407pub struct CertificateProvider {
26408 /// The type of certificate provider which provides the certificates and
26409 /// private keys.
26410 pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
26411
26412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26413}
26414
26415impl CertificateProvider {
26416 /// Creates a new default instance.
26417 pub fn new() -> Self {
26418 std::default::Default::default()
26419 }
26420
26421 /// Sets the value of [r#type][crate::model::CertificateProvider::type].
26422 ///
26423 /// Note that all the setters affecting `r#type` are mutually
26424 /// exclusive.
26425 ///
26426 /// # Example
26427 /// ```ignore,no_run
26428 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26429 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26430 /// let x = CertificateProvider::new().set_type(Some(
26431 /// google_cloud_networksecurity_v1::model::certificate_provider::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
26432 /// ```
26433 pub fn set_type<
26434 T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
26435 >(
26436 mut self,
26437 v: T,
26438 ) -> Self {
26439 self.r#type = v.into();
26440 self
26441 }
26442
26443 /// The value of [r#type][crate::model::CertificateProvider::r#type]
26444 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
26445 /// holds a different branch.
26446 pub fn grpc_endpoint(
26447 &self,
26448 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
26449 #[allow(unreachable_patterns)]
26450 self.r#type.as_ref().and_then(|v| match v {
26451 crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
26452 std::option::Option::Some(v)
26453 }
26454 _ => std::option::Option::None,
26455 })
26456 }
26457
26458 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
26459 /// to hold a `GrpcEndpoint`.
26460 ///
26461 /// Note that all the setters affecting `r#type` are
26462 /// mutually exclusive.
26463 ///
26464 /// # Example
26465 /// ```ignore,no_run
26466 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26467 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
26468 /// let x = CertificateProvider::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
26469 /// assert!(x.grpc_endpoint().is_some());
26470 /// assert!(x.certificate_provider_instance().is_none());
26471 /// ```
26472 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
26473 mut self,
26474 v: T,
26475 ) -> Self {
26476 self.r#type = std::option::Option::Some(
26477 crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
26478 );
26479 self
26480 }
26481
26482 /// The value of [r#type][crate::model::CertificateProvider::r#type]
26483 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
26484 /// holds a different branch.
26485 pub fn certificate_provider_instance(
26486 &self,
26487 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
26488 #[allow(unreachable_patterns)]
26489 self.r#type.as_ref().and_then(|v| match v {
26490 crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
26491 std::option::Option::Some(v)
26492 }
26493 _ => std::option::Option::None,
26494 })
26495 }
26496
26497 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
26498 /// to hold a `CertificateProviderInstance`.
26499 ///
26500 /// Note that all the setters affecting `r#type` are
26501 /// mutually exclusive.
26502 ///
26503 /// # Example
26504 /// ```ignore,no_run
26505 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
26506 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
26507 /// let x = CertificateProvider::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
26508 /// assert!(x.certificate_provider_instance().is_some());
26509 /// assert!(x.grpc_endpoint().is_none());
26510 /// ```
26511 pub fn set_certificate_provider_instance<
26512 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
26513 >(
26514 mut self,
26515 v: T,
26516 ) -> Self {
26517 self.r#type = std::option::Option::Some(
26518 crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
26519 );
26520 self
26521 }
26522}
26523
26524impl wkt::message::Message for CertificateProvider {
26525 fn typename() -> &'static str {
26526 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
26527 }
26528}
26529
26530/// Defines additional types related to [CertificateProvider].
26531pub mod certificate_provider {
26532 #[allow(unused_imports)]
26533 use super::*;
26534
26535 /// The type of certificate provider which provides the certificates and
26536 /// private keys.
26537 #[derive(Clone, Debug, PartialEq)]
26538 #[non_exhaustive]
26539 pub enum Type {
26540 /// gRPC specific configuration to access the gRPC server to
26541 /// obtain the cert and private key.
26542 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
26543 /// The certificate provider instance specification that will be passed to
26544 /// the data plane, which will be used to load necessary credential
26545 /// information.
26546 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
26547 }
26548}
26549
26550/// The TlsInspectionPolicy resource contains references to CA pools in
26551/// Certificate Authority Service and associated metadata.
26552#[derive(Clone, Default, PartialEq)]
26553#[non_exhaustive]
26554pub struct TlsInspectionPolicy {
26555 /// Required. Name of the resource. Name is of the form
26556 /// projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}
26557 /// tls_inspection_policy should match the
26558 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
26559 pub name: std::string::String,
26560
26561 /// Optional. Free-text description of the resource.
26562 pub description: std::string::String,
26563
26564 /// Output only. The timestamp when the resource was created.
26565 pub create_time: std::option::Option<wkt::Timestamp>,
26566
26567 /// Output only. The timestamp when the resource was updated.
26568 pub update_time: std::option::Option<wkt::Timestamp>,
26569
26570 /// Required. A CA pool resource used to issue interception certificates.
26571 /// The CA pool string has a relative resource path following the form
26572 /// "projects/{project}/locations/{location}/caPools/{ca_pool}".
26573 pub ca_pool: std::string::String,
26574
26575 /// Optional. A TrustConfig resource used when making a connection to the TLS
26576 /// server. This is a relative resource path following the form
26577 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This
26578 /// is necessary to intercept TLS connections to servers with certificates
26579 /// signed by a private CA or self-signed certificates.
26580 /// Note that Secure Web Proxy does not yet honor this field.
26581 pub trust_config: std::string::String,
26582
26583 /// Optional. If FALSE (the default), use our default set of public CAs in
26584 /// addition to any CAs specified in trust_config. These public CAs are
26585 /// currently based on the Mozilla Root Program and are subject to change over
26586 /// time. If TRUE, do not accept our default set of public CAs. Only CAs
26587 /// specified in trust_config will be accepted. This defaults to FALSE (use
26588 /// public CAs in addition to trust_config) for backwards compatibility, but
26589 /// trusting public root CAs is *not recommended* unless the traffic in
26590 /// question is outbound to public web servers. When possible, prefer setting
26591 /// this to "false" and explicitly specifying trusted CAs and certificates in a
26592 /// TrustConfig. Note that Secure Web Proxy does not yet honor this field.
26593 pub exclude_public_ca_set: std::option::Option<bool>,
26594
26595 /// Optional. Minimum TLS version that the firewall should use when negotiating
26596 /// connections with both clients and servers. If this is not set, then the
26597 /// default value is to allow the broadest set of clients and servers (TLS 1.0
26598 /// or higher). Setting this to more restrictive values may improve security,
26599 /// but may also prevent the firewall from connecting to some clients or
26600 /// servers.
26601 /// Note that Secure Web Proxy does not yet honor this field.
26602 pub min_tls_version: crate::model::tls_inspection_policy::TlsVersion,
26603
26604 /// Optional. The selected Profile. If this is not set, then the default value
26605 /// is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE").
26606 /// Setting this to more restrictive values may improve security, but may also
26607 /// prevent the TLS inspection proxy from connecting to some clients or
26608 /// servers. Note that Secure Web Proxy does not yet honor this field.
26609 pub tls_feature_profile: crate::model::tls_inspection_policy::Profile,
26610
26611 /// Optional. List of custom TLS cipher suites selected.
26612 /// This field is valid only if the selected tls_feature_profile is CUSTOM.
26613 /// The [compute.SslPoliciesService.ListAvailableFeatures][] method returns the
26614 /// set of features that can be specified in this list.
26615 /// Note that Secure Web Proxy does not yet honor this field.
26616 pub custom_tls_features: std::vec::Vec<std::string::String>,
26617
26618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26619}
26620
26621impl TlsInspectionPolicy {
26622 /// Creates a new default instance.
26623 pub fn new() -> Self {
26624 std::default::Default::default()
26625 }
26626
26627 /// Sets the value of [name][crate::model::TlsInspectionPolicy::name].
26628 ///
26629 /// # Example
26630 /// ```ignore,no_run
26631 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26632 /// # let project_id = "project_id";
26633 /// # let location_id = "location_id";
26634 /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
26635 /// let x = TlsInspectionPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
26636 /// ```
26637 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26638 self.name = v.into();
26639 self
26640 }
26641
26642 /// Sets the value of [description][crate::model::TlsInspectionPolicy::description].
26643 ///
26644 /// # Example
26645 /// ```ignore,no_run
26646 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26647 /// let x = TlsInspectionPolicy::new().set_description("example");
26648 /// ```
26649 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26650 self.description = v.into();
26651 self
26652 }
26653
26654 /// Sets the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
26655 ///
26656 /// # Example
26657 /// ```ignore,no_run
26658 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26659 /// use wkt::Timestamp;
26660 /// let x = TlsInspectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
26661 /// ```
26662 pub fn set_create_time<T>(mut self, v: T) -> Self
26663 where
26664 T: std::convert::Into<wkt::Timestamp>,
26665 {
26666 self.create_time = std::option::Option::Some(v.into());
26667 self
26668 }
26669
26670 /// Sets or clears the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
26671 ///
26672 /// # Example
26673 /// ```ignore,no_run
26674 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26675 /// use wkt::Timestamp;
26676 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
26677 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
26678 /// ```
26679 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
26680 where
26681 T: std::convert::Into<wkt::Timestamp>,
26682 {
26683 self.create_time = v.map(|x| x.into());
26684 self
26685 }
26686
26687 /// Sets the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
26688 ///
26689 /// # Example
26690 /// ```ignore,no_run
26691 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26692 /// use wkt::Timestamp;
26693 /// let x = TlsInspectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
26694 /// ```
26695 pub fn set_update_time<T>(mut self, v: T) -> Self
26696 where
26697 T: std::convert::Into<wkt::Timestamp>,
26698 {
26699 self.update_time = std::option::Option::Some(v.into());
26700 self
26701 }
26702
26703 /// Sets or clears the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
26704 ///
26705 /// # Example
26706 /// ```ignore,no_run
26707 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26708 /// use wkt::Timestamp;
26709 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
26710 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
26711 /// ```
26712 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
26713 where
26714 T: std::convert::Into<wkt::Timestamp>,
26715 {
26716 self.update_time = v.map(|x| x.into());
26717 self
26718 }
26719
26720 /// Sets the value of [ca_pool][crate::model::TlsInspectionPolicy::ca_pool].
26721 ///
26722 /// # Example
26723 /// ```ignore,no_run
26724 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26725 /// let x = TlsInspectionPolicy::new().set_ca_pool("example");
26726 /// ```
26727 pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26728 self.ca_pool = v.into();
26729 self
26730 }
26731
26732 /// Sets the value of [trust_config][crate::model::TlsInspectionPolicy::trust_config].
26733 ///
26734 /// # Example
26735 /// ```ignore,no_run
26736 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26737 /// let x = TlsInspectionPolicy::new().set_trust_config("example");
26738 /// ```
26739 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26740 self.trust_config = v.into();
26741 self
26742 }
26743
26744 /// Sets the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
26745 ///
26746 /// # Example
26747 /// ```ignore,no_run
26748 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26749 /// let x = TlsInspectionPolicy::new().set_exclude_public_ca_set(true);
26750 /// ```
26751 pub fn set_exclude_public_ca_set<T>(mut self, v: T) -> Self
26752 where
26753 T: std::convert::Into<bool>,
26754 {
26755 self.exclude_public_ca_set = std::option::Option::Some(v.into());
26756 self
26757 }
26758
26759 /// Sets or clears the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
26760 ///
26761 /// # Example
26762 /// ```ignore,no_run
26763 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26764 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(Some(false));
26765 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(None::<bool>);
26766 /// ```
26767 pub fn set_or_clear_exclude_public_ca_set<T>(mut self, v: std::option::Option<T>) -> Self
26768 where
26769 T: std::convert::Into<bool>,
26770 {
26771 self.exclude_public_ca_set = v.map(|x| x.into());
26772 self
26773 }
26774
26775 /// Sets the value of [min_tls_version][crate::model::TlsInspectionPolicy::min_tls_version].
26776 ///
26777 /// # Example
26778 /// ```ignore,no_run
26779 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26780 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::TlsVersion;
26781 /// let x0 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls10);
26782 /// let x1 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls11);
26783 /// let x2 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls12);
26784 /// ```
26785 pub fn set_min_tls_version<
26786 T: std::convert::Into<crate::model::tls_inspection_policy::TlsVersion>,
26787 >(
26788 mut self,
26789 v: T,
26790 ) -> Self {
26791 self.min_tls_version = v.into();
26792 self
26793 }
26794
26795 /// Sets the value of [tls_feature_profile][crate::model::TlsInspectionPolicy::tls_feature_profile].
26796 ///
26797 /// # Example
26798 /// ```ignore,no_run
26799 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26800 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::Profile;
26801 /// let x0 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Compatible);
26802 /// let x1 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Modern);
26803 /// let x2 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Restricted);
26804 /// ```
26805 pub fn set_tls_feature_profile<
26806 T: std::convert::Into<crate::model::tls_inspection_policy::Profile>,
26807 >(
26808 mut self,
26809 v: T,
26810 ) -> Self {
26811 self.tls_feature_profile = v.into();
26812 self
26813 }
26814
26815 /// Sets the value of [custom_tls_features][crate::model::TlsInspectionPolicy::custom_tls_features].
26816 ///
26817 /// # Example
26818 /// ```ignore,no_run
26819 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
26820 /// let x = TlsInspectionPolicy::new().set_custom_tls_features(["a", "b", "c"]);
26821 /// ```
26822 pub fn set_custom_tls_features<T, V>(mut self, v: T) -> Self
26823 where
26824 T: std::iter::IntoIterator<Item = V>,
26825 V: std::convert::Into<std::string::String>,
26826 {
26827 use std::iter::Iterator;
26828 self.custom_tls_features = v.into_iter().map(|i| i.into()).collect();
26829 self
26830 }
26831}
26832
26833impl wkt::message::Message for TlsInspectionPolicy {
26834 fn typename() -> &'static str {
26835 "type.googleapis.com/google.cloud.networksecurity.v1.TlsInspectionPolicy"
26836 }
26837}
26838
26839/// Defines additional types related to [TlsInspectionPolicy].
26840pub mod tls_inspection_policy {
26841 #[allow(unused_imports)]
26842 use super::*;
26843
26844 /// The minimum version of TLS protocol that can be used by clients or servers
26845 /// to establish a connection with the TLS inspection proxy.
26846 ///
26847 /// # Working with unknown values
26848 ///
26849 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26850 /// additional enum variants at any time. Adding new variants is not considered
26851 /// a breaking change. Applications should write their code in anticipation of:
26852 ///
26853 /// - New values appearing in future releases of the client library, **and**
26854 /// - New values received dynamically, without application changes.
26855 ///
26856 /// Please consult the [Working with enums] section in the user guide for some
26857 /// guidelines.
26858 ///
26859 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26860 #[derive(Clone, Debug, PartialEq)]
26861 #[non_exhaustive]
26862 pub enum TlsVersion {
26863 /// Indicates no TLS version was specified.
26864 Unspecified,
26865 /// TLS 1.0
26866 Tls10,
26867 /// TLS 1.1
26868 Tls11,
26869 /// TLS 1.2
26870 Tls12,
26871 /// TLS 1.3
26872 Tls13,
26873 /// If set, the enum was initialized with an unknown value.
26874 ///
26875 /// Applications can examine the value using [TlsVersion::value] or
26876 /// [TlsVersion::name].
26877 UnknownValue(tls_version::UnknownValue),
26878 }
26879
26880 #[doc(hidden)]
26881 pub mod tls_version {
26882 #[allow(unused_imports)]
26883 use super::*;
26884 #[derive(Clone, Debug, PartialEq)]
26885 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26886 }
26887
26888 impl TlsVersion {
26889 /// Gets the enum value.
26890 ///
26891 /// Returns `None` if the enum contains an unknown value deserialized from
26892 /// the string representation of enums.
26893 pub fn value(&self) -> std::option::Option<i32> {
26894 match self {
26895 Self::Unspecified => std::option::Option::Some(0),
26896 Self::Tls10 => std::option::Option::Some(1),
26897 Self::Tls11 => std::option::Option::Some(2),
26898 Self::Tls12 => std::option::Option::Some(3),
26899 Self::Tls13 => std::option::Option::Some(4),
26900 Self::UnknownValue(u) => u.0.value(),
26901 }
26902 }
26903
26904 /// Gets the enum value as a string.
26905 ///
26906 /// Returns `None` if the enum contains an unknown value deserialized from
26907 /// the integer representation of enums.
26908 pub fn name(&self) -> std::option::Option<&str> {
26909 match self {
26910 Self::Unspecified => std::option::Option::Some("TLS_VERSION_UNSPECIFIED"),
26911 Self::Tls10 => std::option::Option::Some("TLS_1_0"),
26912 Self::Tls11 => std::option::Option::Some("TLS_1_1"),
26913 Self::Tls12 => std::option::Option::Some("TLS_1_2"),
26914 Self::Tls13 => std::option::Option::Some("TLS_1_3"),
26915 Self::UnknownValue(u) => u.0.name(),
26916 }
26917 }
26918 }
26919
26920 impl std::default::Default for TlsVersion {
26921 fn default() -> Self {
26922 use std::convert::From;
26923 Self::from(0)
26924 }
26925 }
26926
26927 impl std::fmt::Display for TlsVersion {
26928 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26929 wkt::internal::display_enum(f, self.name(), self.value())
26930 }
26931 }
26932
26933 impl std::convert::From<i32> for TlsVersion {
26934 fn from(value: i32) -> Self {
26935 match value {
26936 0 => Self::Unspecified,
26937 1 => Self::Tls10,
26938 2 => Self::Tls11,
26939 3 => Self::Tls12,
26940 4 => Self::Tls13,
26941 _ => Self::UnknownValue(tls_version::UnknownValue(
26942 wkt::internal::UnknownEnumValue::Integer(value),
26943 )),
26944 }
26945 }
26946 }
26947
26948 impl std::convert::From<&str> for TlsVersion {
26949 fn from(value: &str) -> Self {
26950 use std::string::ToString;
26951 match value {
26952 "TLS_VERSION_UNSPECIFIED" => Self::Unspecified,
26953 "TLS_1_0" => Self::Tls10,
26954 "TLS_1_1" => Self::Tls11,
26955 "TLS_1_2" => Self::Tls12,
26956 "TLS_1_3" => Self::Tls13,
26957 _ => Self::UnknownValue(tls_version::UnknownValue(
26958 wkt::internal::UnknownEnumValue::String(value.to_string()),
26959 )),
26960 }
26961 }
26962 }
26963
26964 impl serde::ser::Serialize for TlsVersion {
26965 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26966 where
26967 S: serde::Serializer,
26968 {
26969 match self {
26970 Self::Unspecified => serializer.serialize_i32(0),
26971 Self::Tls10 => serializer.serialize_i32(1),
26972 Self::Tls11 => serializer.serialize_i32(2),
26973 Self::Tls12 => serializer.serialize_i32(3),
26974 Self::Tls13 => serializer.serialize_i32(4),
26975 Self::UnknownValue(u) => u.0.serialize(serializer),
26976 }
26977 }
26978 }
26979
26980 impl<'de> serde::de::Deserialize<'de> for TlsVersion {
26981 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26982 where
26983 D: serde::Deserializer<'de>,
26984 {
26985 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TlsVersion>::new(
26986 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion",
26987 ))
26988 }
26989 }
26990
26991 /// Profile specifies the set of TLS cipher suites (and possibly
26992 /// other features in the future) that can be used by the firewall when
26993 /// negotiating TLS connections with clients and servers. The meaning of these
26994 /// fields is identical to the load balancers' SSLPolicy resource.
26995 ///
26996 /// # Working with unknown values
26997 ///
26998 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26999 /// additional enum variants at any time. Adding new variants is not considered
27000 /// a breaking change. Applications should write their code in anticipation of:
27001 ///
27002 /// - New values appearing in future releases of the client library, **and**
27003 /// - New values received dynamically, without application changes.
27004 ///
27005 /// Please consult the [Working with enums] section in the user guide for some
27006 /// guidelines.
27007 ///
27008 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27009 #[derive(Clone, Debug, PartialEq)]
27010 #[non_exhaustive]
27011 pub enum Profile {
27012 /// Indicates no profile was specified.
27013 Unspecified,
27014 /// Compatible profile. Allows the broadest set of clients, even those
27015 /// which support only out-of-date SSL features to negotiate with the TLS
27016 /// inspection proxy.
27017 Compatible,
27018 /// Modern profile. Supports a wide set of SSL features, allowing modern
27019 /// clients to negotiate SSL with the TLS inspection proxy.
27020 Modern,
27021 /// Restricted profile. Supports a reduced set of SSL features, intended to
27022 /// meet stricter compliance requirements.
27023 Restricted,
27024 /// Custom profile. Allow only the set of allowed SSL features specified in
27025 /// the custom_features field of SslPolicy.
27026 Custom,
27027 /// If set, the enum was initialized with an unknown value.
27028 ///
27029 /// Applications can examine the value using [Profile::value] or
27030 /// [Profile::name].
27031 UnknownValue(profile::UnknownValue),
27032 }
27033
27034 #[doc(hidden)]
27035 pub mod profile {
27036 #[allow(unused_imports)]
27037 use super::*;
27038 #[derive(Clone, Debug, PartialEq)]
27039 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27040 }
27041
27042 impl Profile {
27043 /// Gets the enum value.
27044 ///
27045 /// Returns `None` if the enum contains an unknown value deserialized from
27046 /// the string representation of enums.
27047 pub fn value(&self) -> std::option::Option<i32> {
27048 match self {
27049 Self::Unspecified => std::option::Option::Some(0),
27050 Self::Compatible => std::option::Option::Some(1),
27051 Self::Modern => std::option::Option::Some(2),
27052 Self::Restricted => std::option::Option::Some(3),
27053 Self::Custom => std::option::Option::Some(4),
27054 Self::UnknownValue(u) => u.0.value(),
27055 }
27056 }
27057
27058 /// Gets the enum value as a string.
27059 ///
27060 /// Returns `None` if the enum contains an unknown value deserialized from
27061 /// the integer representation of enums.
27062 pub fn name(&self) -> std::option::Option<&str> {
27063 match self {
27064 Self::Unspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
27065 Self::Compatible => std::option::Option::Some("PROFILE_COMPATIBLE"),
27066 Self::Modern => std::option::Option::Some("PROFILE_MODERN"),
27067 Self::Restricted => std::option::Option::Some("PROFILE_RESTRICTED"),
27068 Self::Custom => std::option::Option::Some("PROFILE_CUSTOM"),
27069 Self::UnknownValue(u) => u.0.name(),
27070 }
27071 }
27072 }
27073
27074 impl std::default::Default for Profile {
27075 fn default() -> Self {
27076 use std::convert::From;
27077 Self::from(0)
27078 }
27079 }
27080
27081 impl std::fmt::Display for Profile {
27082 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27083 wkt::internal::display_enum(f, self.name(), self.value())
27084 }
27085 }
27086
27087 impl std::convert::From<i32> for Profile {
27088 fn from(value: i32) -> Self {
27089 match value {
27090 0 => Self::Unspecified,
27091 1 => Self::Compatible,
27092 2 => Self::Modern,
27093 3 => Self::Restricted,
27094 4 => Self::Custom,
27095 _ => Self::UnknownValue(profile::UnknownValue(
27096 wkt::internal::UnknownEnumValue::Integer(value),
27097 )),
27098 }
27099 }
27100 }
27101
27102 impl std::convert::From<&str> for Profile {
27103 fn from(value: &str) -> Self {
27104 use std::string::ToString;
27105 match value {
27106 "PROFILE_UNSPECIFIED" => Self::Unspecified,
27107 "PROFILE_COMPATIBLE" => Self::Compatible,
27108 "PROFILE_MODERN" => Self::Modern,
27109 "PROFILE_RESTRICTED" => Self::Restricted,
27110 "PROFILE_CUSTOM" => Self::Custom,
27111 _ => Self::UnknownValue(profile::UnknownValue(
27112 wkt::internal::UnknownEnumValue::String(value.to_string()),
27113 )),
27114 }
27115 }
27116 }
27117
27118 impl serde::ser::Serialize for Profile {
27119 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27120 where
27121 S: serde::Serializer,
27122 {
27123 match self {
27124 Self::Unspecified => serializer.serialize_i32(0),
27125 Self::Compatible => serializer.serialize_i32(1),
27126 Self::Modern => serializer.serialize_i32(2),
27127 Self::Restricted => serializer.serialize_i32(3),
27128 Self::Custom => serializer.serialize_i32(4),
27129 Self::UnknownValue(u) => u.0.serialize(serializer),
27130 }
27131 }
27132 }
27133
27134 impl<'de> serde::de::Deserialize<'de> for Profile {
27135 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27136 where
27137 D: serde::Deserializer<'de>,
27138 {
27139 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Profile>::new(
27140 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile",
27141 ))
27142 }
27143 }
27144}
27145
27146/// Request used by the CreateTlsInspectionPolicy method.
27147#[derive(Clone, Default, PartialEq)]
27148#[non_exhaustive]
27149pub struct CreateTlsInspectionPolicyRequest {
27150 /// Required. The parent resource of the TlsInspectionPolicy. Must be in the
27151 /// format `projects/{project}/locations/{location}`.
27152 pub parent: std::string::String,
27153
27154 /// Required. Short name of the TlsInspectionPolicy resource to be created.
27155 /// This value should be 1-63 characters long, containing only
27156 /// letters, numbers, hyphens, and underscores, and should not start
27157 /// with a number. E.g. "tls_inspection_policy1".
27158 pub tls_inspection_policy_id: std::string::String,
27159
27160 /// Required. TlsInspectionPolicy resource to be created.
27161 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
27162
27163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27164}
27165
27166impl CreateTlsInspectionPolicyRequest {
27167 /// Creates a new default instance.
27168 pub fn new() -> Self {
27169 std::default::Default::default()
27170 }
27171
27172 /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
27173 ///
27174 /// # Example
27175 /// ```ignore,no_run
27176 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27177 /// # let project_id = "project_id";
27178 /// # let location_id = "location_id";
27179 /// let x = CreateTlsInspectionPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
27180 /// ```
27181 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27182 self.parent = v.into();
27183 self
27184 }
27185
27186 /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
27187 ///
27188 /// # Example
27189 /// ```ignore,no_run
27190 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27191 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy_id("example");
27192 /// ```
27193 pub fn set_tls_inspection_policy_id<T: std::convert::Into<std::string::String>>(
27194 mut self,
27195 v: T,
27196 ) -> Self {
27197 self.tls_inspection_policy_id = v.into();
27198 self
27199 }
27200
27201 /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
27202 ///
27203 /// # Example
27204 /// ```ignore,no_run
27205 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27206 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27207 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
27208 /// ```
27209 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
27210 where
27211 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27212 {
27213 self.tls_inspection_policy = std::option::Option::Some(v.into());
27214 self
27215 }
27216
27217 /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
27218 ///
27219 /// # Example
27220 /// ```ignore,no_run
27221 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
27222 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27223 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
27224 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
27225 /// ```
27226 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
27227 where
27228 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27229 {
27230 self.tls_inspection_policy = v.map(|x| x.into());
27231 self
27232 }
27233}
27234
27235impl wkt::message::Message for CreateTlsInspectionPolicyRequest {
27236 fn typename() -> &'static str {
27237 "type.googleapis.com/google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest"
27238 }
27239}
27240
27241/// Request used with the ListTlsInspectionPolicies method.
27242#[derive(Clone, Default, PartialEq)]
27243#[non_exhaustive]
27244pub struct ListTlsInspectionPoliciesRequest {
27245 /// Required. The project and location from which the TlsInspectionPolicies
27246 /// should be listed, specified in the format
27247 /// `projects/{project}/locations/{location}`.
27248 pub parent: std::string::String,
27249
27250 /// Maximum number of TlsInspectionPolicies to return per call.
27251 pub page_size: i32,
27252
27253 /// The value returned by the last
27254 /// 'ListTlsInspectionPoliciesResponse' Indicates that this is a
27255 /// continuation of a prior 'ListTlsInspectionPolicies' call, and
27256 /// that the system should return the next page of data.
27257 pub page_token: std::string::String,
27258
27259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27260}
27261
27262impl ListTlsInspectionPoliciesRequest {
27263 /// Creates a new default instance.
27264 pub fn new() -> Self {
27265 std::default::Default::default()
27266 }
27267
27268 /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
27269 ///
27270 /// # Example
27271 /// ```ignore,no_run
27272 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27273 /// let x = ListTlsInspectionPoliciesRequest::new().set_parent("example");
27274 /// ```
27275 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27276 self.parent = v.into();
27277 self
27278 }
27279
27280 /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
27281 ///
27282 /// # Example
27283 /// ```ignore,no_run
27284 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27285 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_size(42);
27286 /// ```
27287 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
27288 self.page_size = v.into();
27289 self
27290 }
27291
27292 /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
27293 ///
27294 /// # Example
27295 /// ```ignore,no_run
27296 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
27297 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_token("example");
27298 /// ```
27299 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27300 self.page_token = v.into();
27301 self
27302 }
27303}
27304
27305impl wkt::message::Message for ListTlsInspectionPoliciesRequest {
27306 fn typename() -> &'static str {
27307 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest"
27308 }
27309}
27310
27311/// Response returned by the ListTlsInspectionPolicies method.
27312#[derive(Clone, Default, PartialEq)]
27313#[non_exhaustive]
27314pub struct ListTlsInspectionPoliciesResponse {
27315 /// List of TlsInspectionPolicies resources.
27316 pub tls_inspection_policies: std::vec::Vec<crate::model::TlsInspectionPolicy>,
27317
27318 /// If there might be more results than those appearing in this response, then
27319 /// 'next_page_token' is included. To get the next set of results, call this
27320 /// method again using the value of 'next_page_token' as 'page_token'.
27321 pub next_page_token: std::string::String,
27322
27323 /// Locations that could not be reached.
27324 pub unreachable: std::vec::Vec<std::string::String>,
27325
27326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27327}
27328
27329impl ListTlsInspectionPoliciesResponse {
27330 /// Creates a new default instance.
27331 pub fn new() -> Self {
27332 std::default::Default::default()
27333 }
27334
27335 /// Sets the value of [tls_inspection_policies][crate::model::ListTlsInspectionPoliciesResponse::tls_inspection_policies].
27336 ///
27337 /// # Example
27338 /// ```ignore,no_run
27339 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27340 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27341 /// let x = ListTlsInspectionPoliciesResponse::new()
27342 /// .set_tls_inspection_policies([
27343 /// TlsInspectionPolicy::default()/* use setters */,
27344 /// TlsInspectionPolicy::default()/* use (different) setters */,
27345 /// ]);
27346 /// ```
27347 pub fn set_tls_inspection_policies<T, V>(mut self, v: T) -> Self
27348 where
27349 T: std::iter::IntoIterator<Item = V>,
27350 V: std::convert::Into<crate::model::TlsInspectionPolicy>,
27351 {
27352 use std::iter::Iterator;
27353 self.tls_inspection_policies = v.into_iter().map(|i| i.into()).collect();
27354 self
27355 }
27356
27357 /// Sets the value of [next_page_token][crate::model::ListTlsInspectionPoliciesResponse::next_page_token].
27358 ///
27359 /// # Example
27360 /// ```ignore,no_run
27361 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27362 /// let x = ListTlsInspectionPoliciesResponse::new().set_next_page_token("example");
27363 /// ```
27364 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27365 self.next_page_token = v.into();
27366 self
27367 }
27368
27369 /// Sets the value of [unreachable][crate::model::ListTlsInspectionPoliciesResponse::unreachable].
27370 ///
27371 /// # Example
27372 /// ```ignore,no_run
27373 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
27374 /// let x = ListTlsInspectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
27375 /// ```
27376 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
27377 where
27378 T: std::iter::IntoIterator<Item = V>,
27379 V: std::convert::Into<std::string::String>,
27380 {
27381 use std::iter::Iterator;
27382 self.unreachable = v.into_iter().map(|i| i.into()).collect();
27383 self
27384 }
27385}
27386
27387impl wkt::message::Message for ListTlsInspectionPoliciesResponse {
27388 fn typename() -> &'static str {
27389 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse"
27390 }
27391}
27392
27393#[doc(hidden)]
27394impl google_cloud_gax::paginator::internal::PageableResponse for ListTlsInspectionPoliciesResponse {
27395 type PageItem = crate::model::TlsInspectionPolicy;
27396
27397 fn items(self) -> std::vec::Vec<Self::PageItem> {
27398 self.tls_inspection_policies
27399 }
27400
27401 fn next_page_token(&self) -> std::string::String {
27402 use std::clone::Clone;
27403 self.next_page_token.clone()
27404 }
27405}
27406
27407/// Request used by the GetTlsInspectionPolicy method.
27408#[derive(Clone, Default, PartialEq)]
27409#[non_exhaustive]
27410pub struct GetTlsInspectionPolicyRequest {
27411 /// Required. A name of the TlsInspectionPolicy to get. Must be in the format
27412 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
27413 pub name: std::string::String,
27414
27415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27416}
27417
27418impl GetTlsInspectionPolicyRequest {
27419 /// Creates a new default instance.
27420 pub fn new() -> Self {
27421 std::default::Default::default()
27422 }
27423
27424 /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
27425 ///
27426 /// # Example
27427 /// ```ignore,no_run
27428 /// # use google_cloud_networksecurity_v1::model::GetTlsInspectionPolicyRequest;
27429 /// # let project_id = "project_id";
27430 /// # let location_id = "location_id";
27431 /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
27432 /// let x = GetTlsInspectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
27433 /// ```
27434 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27435 self.name = v.into();
27436 self
27437 }
27438}
27439
27440impl wkt::message::Message for GetTlsInspectionPolicyRequest {
27441 fn typename() -> &'static str {
27442 "type.googleapis.com/google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest"
27443 }
27444}
27445
27446/// Request used by the DeleteTlsInspectionPolicy method.
27447#[derive(Clone, Default, PartialEq)]
27448#[non_exhaustive]
27449pub struct DeleteTlsInspectionPolicyRequest {
27450 /// Required. A name of the TlsInspectionPolicy to delete. Must be in the
27451 /// format
27452 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
27453 pub name: std::string::String,
27454
27455 /// If set to true, any rules for this TlsInspectionPolicy will also be
27456 /// deleted. (Otherwise, the request will only work if the TlsInspectionPolicy
27457 /// has no rules.)
27458 pub force: bool,
27459
27460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27461}
27462
27463impl DeleteTlsInspectionPolicyRequest {
27464 /// Creates a new default instance.
27465 pub fn new() -> Self {
27466 std::default::Default::default()
27467 }
27468
27469 /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
27470 ///
27471 /// # Example
27472 /// ```ignore,no_run
27473 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
27474 /// # let project_id = "project_id";
27475 /// # let location_id = "location_id";
27476 /// # let tls_inspection_policy_id = "tls_inspection_policy_id";
27477 /// let x = DeleteTlsInspectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/tlsInspectionPolicies/{tls_inspection_policy_id}"));
27478 /// ```
27479 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27480 self.name = v.into();
27481 self
27482 }
27483
27484 /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
27485 ///
27486 /// # Example
27487 /// ```ignore,no_run
27488 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
27489 /// let x = DeleteTlsInspectionPolicyRequest::new().set_force(true);
27490 /// ```
27491 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
27492 self.force = v.into();
27493 self
27494 }
27495}
27496
27497impl wkt::message::Message for DeleteTlsInspectionPolicyRequest {
27498 fn typename() -> &'static str {
27499 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest"
27500 }
27501}
27502
27503/// Request used by the UpdateTlsInspectionPolicy method.
27504#[derive(Clone, Default, PartialEq)]
27505#[non_exhaustive]
27506pub struct UpdateTlsInspectionPolicyRequest {
27507 /// Optional. Field mask is used to specify the fields to be overwritten in the
27508 /// TlsInspectionPolicy resource by the update.
27509 /// The fields specified in the update_mask are relative to the resource, not
27510 /// the full request. A field will be overwritten if it is in the mask. If the
27511 /// user does not provide a mask then all fields will be overwritten.
27512 pub update_mask: std::option::Option<wkt::FieldMask>,
27513
27514 /// Required. Updated TlsInspectionPolicy resource.
27515 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
27516
27517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27518}
27519
27520impl UpdateTlsInspectionPolicyRequest {
27521 /// Creates a new default instance.
27522 pub fn new() -> Self {
27523 std::default::Default::default()
27524 }
27525
27526 /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
27527 ///
27528 /// # Example
27529 /// ```ignore,no_run
27530 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27531 /// use wkt::FieldMask;
27532 /// let x = UpdateTlsInspectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
27533 /// ```
27534 pub fn set_update_mask<T>(mut self, v: T) -> Self
27535 where
27536 T: std::convert::Into<wkt::FieldMask>,
27537 {
27538 self.update_mask = std::option::Option::Some(v.into());
27539 self
27540 }
27541
27542 /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
27543 ///
27544 /// # Example
27545 /// ```ignore,no_run
27546 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27547 /// use wkt::FieldMask;
27548 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
27549 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
27550 /// ```
27551 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
27552 where
27553 T: std::convert::Into<wkt::FieldMask>,
27554 {
27555 self.update_mask = v.map(|x| x.into());
27556 self
27557 }
27558
27559 /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
27560 ///
27561 /// # Example
27562 /// ```ignore,no_run
27563 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27564 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27565 /// let x = UpdateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
27566 /// ```
27567 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
27568 where
27569 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27570 {
27571 self.tls_inspection_policy = std::option::Option::Some(v.into());
27572 self
27573 }
27574
27575 /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
27576 ///
27577 /// # Example
27578 /// ```ignore,no_run
27579 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
27580 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
27581 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
27582 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
27583 /// ```
27584 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
27585 where
27586 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
27587 {
27588 self.tls_inspection_policy = v.map(|x| x.into());
27589 self
27590 }
27591}
27592
27593impl wkt::message::Message for UpdateTlsInspectionPolicyRequest {
27594 fn typename() -> &'static str {
27595 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest"
27596 }
27597}
27598
27599/// UrlList proto helps users to set reusable, independently manageable lists
27600/// of hosts, host patterns, URLs, URL patterns.
27601#[derive(Clone, Default, PartialEq)]
27602#[non_exhaustive]
27603pub struct UrlList {
27604 /// Required. Name of the resource provided by the user.
27605 /// Name is of the form
27606 /// projects/{project}/locations/{location}/urlLists/{url_list}
27607 /// url_list should match the
27608 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
27609 pub name: std::string::String,
27610
27611 /// Output only. Time when the security policy was created.
27612 pub create_time: std::option::Option<wkt::Timestamp>,
27613
27614 /// Output only. Time when the security policy was updated.
27615 pub update_time: std::option::Option<wkt::Timestamp>,
27616
27617 /// Optional. Free-text description of the resource.
27618 pub description: std::string::String,
27619
27620 /// Required. FQDNs and URLs.
27621 pub values: std::vec::Vec<std::string::String>,
27622
27623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27624}
27625
27626impl UrlList {
27627 /// Creates a new default instance.
27628 pub fn new() -> Self {
27629 std::default::Default::default()
27630 }
27631
27632 /// Sets the value of [name][crate::model::UrlList::name].
27633 ///
27634 /// # Example
27635 /// ```ignore,no_run
27636 /// # use google_cloud_networksecurity_v1::model::UrlList;
27637 /// # let project_id = "project_id";
27638 /// # let location_id = "location_id";
27639 /// # let url_list_id = "url_list_id";
27640 /// let x = UrlList::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
27641 /// ```
27642 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27643 self.name = v.into();
27644 self
27645 }
27646
27647 /// Sets the value of [create_time][crate::model::UrlList::create_time].
27648 ///
27649 /// # Example
27650 /// ```ignore,no_run
27651 /// # use google_cloud_networksecurity_v1::model::UrlList;
27652 /// use wkt::Timestamp;
27653 /// let x = UrlList::new().set_create_time(Timestamp::default()/* use setters */);
27654 /// ```
27655 pub fn set_create_time<T>(mut self, v: T) -> Self
27656 where
27657 T: std::convert::Into<wkt::Timestamp>,
27658 {
27659 self.create_time = std::option::Option::Some(v.into());
27660 self
27661 }
27662
27663 /// Sets or clears the value of [create_time][crate::model::UrlList::create_time].
27664 ///
27665 /// # Example
27666 /// ```ignore,no_run
27667 /// # use google_cloud_networksecurity_v1::model::UrlList;
27668 /// use wkt::Timestamp;
27669 /// let x = UrlList::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
27670 /// let x = UrlList::new().set_or_clear_create_time(None::<Timestamp>);
27671 /// ```
27672 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
27673 where
27674 T: std::convert::Into<wkt::Timestamp>,
27675 {
27676 self.create_time = v.map(|x| x.into());
27677 self
27678 }
27679
27680 /// Sets the value of [update_time][crate::model::UrlList::update_time].
27681 ///
27682 /// # Example
27683 /// ```ignore,no_run
27684 /// # use google_cloud_networksecurity_v1::model::UrlList;
27685 /// use wkt::Timestamp;
27686 /// let x = UrlList::new().set_update_time(Timestamp::default()/* use setters */);
27687 /// ```
27688 pub fn set_update_time<T>(mut self, v: T) -> Self
27689 where
27690 T: std::convert::Into<wkt::Timestamp>,
27691 {
27692 self.update_time = std::option::Option::Some(v.into());
27693 self
27694 }
27695
27696 /// Sets or clears the value of [update_time][crate::model::UrlList::update_time].
27697 ///
27698 /// # Example
27699 /// ```ignore,no_run
27700 /// # use google_cloud_networksecurity_v1::model::UrlList;
27701 /// use wkt::Timestamp;
27702 /// let x = UrlList::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
27703 /// let x = UrlList::new().set_or_clear_update_time(None::<Timestamp>);
27704 /// ```
27705 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
27706 where
27707 T: std::convert::Into<wkt::Timestamp>,
27708 {
27709 self.update_time = v.map(|x| x.into());
27710 self
27711 }
27712
27713 /// Sets the value of [description][crate::model::UrlList::description].
27714 ///
27715 /// # Example
27716 /// ```ignore,no_run
27717 /// # use google_cloud_networksecurity_v1::model::UrlList;
27718 /// let x = UrlList::new().set_description("example");
27719 /// ```
27720 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27721 self.description = v.into();
27722 self
27723 }
27724
27725 /// Sets the value of [values][crate::model::UrlList::values].
27726 ///
27727 /// # Example
27728 /// ```ignore,no_run
27729 /// # use google_cloud_networksecurity_v1::model::UrlList;
27730 /// let x = UrlList::new().set_values(["a", "b", "c"]);
27731 /// ```
27732 pub fn set_values<T, V>(mut self, v: T) -> Self
27733 where
27734 T: std::iter::IntoIterator<Item = V>,
27735 V: std::convert::Into<std::string::String>,
27736 {
27737 use std::iter::Iterator;
27738 self.values = v.into_iter().map(|i| i.into()).collect();
27739 self
27740 }
27741}
27742
27743impl wkt::message::Message for UrlList {
27744 fn typename() -> &'static str {
27745 "type.googleapis.com/google.cloud.networksecurity.v1.UrlList"
27746 }
27747}
27748
27749/// Request used by the ListUrlList method.
27750#[derive(Clone, Default, PartialEq)]
27751#[non_exhaustive]
27752pub struct ListUrlListsRequest {
27753 /// Required. The project and location from which the UrlLists should
27754 /// be listed, specified in the format
27755 /// `projects/{project}/locations/{location}`.
27756 pub parent: std::string::String,
27757
27758 /// Maximum number of UrlLists to return per call.
27759 pub page_size: i32,
27760
27761 /// The value returned by the last `ListUrlListsResponse`
27762 /// Indicates that this is a continuation of a prior
27763 /// `ListUrlLists` call, and that the system
27764 /// should return the next page of data.
27765 pub page_token: std::string::String,
27766
27767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27768}
27769
27770impl ListUrlListsRequest {
27771 /// Creates a new default instance.
27772 pub fn new() -> Self {
27773 std::default::Default::default()
27774 }
27775
27776 /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
27777 ///
27778 /// # Example
27779 /// ```ignore,no_run
27780 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27781 /// let x = ListUrlListsRequest::new().set_parent("example");
27782 /// ```
27783 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27784 self.parent = v.into();
27785 self
27786 }
27787
27788 /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
27789 ///
27790 /// # Example
27791 /// ```ignore,no_run
27792 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27793 /// let x = ListUrlListsRequest::new().set_page_size(42);
27794 /// ```
27795 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
27796 self.page_size = v.into();
27797 self
27798 }
27799
27800 /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
27801 ///
27802 /// # Example
27803 /// ```ignore,no_run
27804 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
27805 /// let x = ListUrlListsRequest::new().set_page_token("example");
27806 /// ```
27807 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27808 self.page_token = v.into();
27809 self
27810 }
27811}
27812
27813impl wkt::message::Message for ListUrlListsRequest {
27814 fn typename() -> &'static str {
27815 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsRequest"
27816 }
27817}
27818
27819/// Response returned by the ListUrlLists method.
27820#[derive(Clone, Default, PartialEq)]
27821#[non_exhaustive]
27822pub struct ListUrlListsResponse {
27823 /// List of UrlList resources.
27824 pub url_lists: std::vec::Vec<crate::model::UrlList>,
27825
27826 /// If there might be more results than those appearing in this response, then
27827 /// `next_page_token` is included. To get the next set of results, call this
27828 /// method again using the value of `next_page_token` as `page_token`.
27829 pub next_page_token: std::string::String,
27830
27831 /// Locations that could not be reached.
27832 pub unreachable: std::vec::Vec<std::string::String>,
27833
27834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27835}
27836
27837impl ListUrlListsResponse {
27838 /// Creates a new default instance.
27839 pub fn new() -> Self {
27840 std::default::Default::default()
27841 }
27842
27843 /// Sets the value of [url_lists][crate::model::ListUrlListsResponse::url_lists].
27844 ///
27845 /// # Example
27846 /// ```ignore,no_run
27847 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27848 /// use google_cloud_networksecurity_v1::model::UrlList;
27849 /// let x = ListUrlListsResponse::new()
27850 /// .set_url_lists([
27851 /// UrlList::default()/* use setters */,
27852 /// UrlList::default()/* use (different) setters */,
27853 /// ]);
27854 /// ```
27855 pub fn set_url_lists<T, V>(mut self, v: T) -> Self
27856 where
27857 T: std::iter::IntoIterator<Item = V>,
27858 V: std::convert::Into<crate::model::UrlList>,
27859 {
27860 use std::iter::Iterator;
27861 self.url_lists = v.into_iter().map(|i| i.into()).collect();
27862 self
27863 }
27864
27865 /// Sets the value of [next_page_token][crate::model::ListUrlListsResponse::next_page_token].
27866 ///
27867 /// # Example
27868 /// ```ignore,no_run
27869 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27870 /// let x = ListUrlListsResponse::new().set_next_page_token("example");
27871 /// ```
27872 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27873 self.next_page_token = v.into();
27874 self
27875 }
27876
27877 /// Sets the value of [unreachable][crate::model::ListUrlListsResponse::unreachable].
27878 ///
27879 /// # Example
27880 /// ```ignore,no_run
27881 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
27882 /// let x = ListUrlListsResponse::new().set_unreachable(["a", "b", "c"]);
27883 /// ```
27884 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
27885 where
27886 T: std::iter::IntoIterator<Item = V>,
27887 V: std::convert::Into<std::string::String>,
27888 {
27889 use std::iter::Iterator;
27890 self.unreachable = v.into_iter().map(|i| i.into()).collect();
27891 self
27892 }
27893}
27894
27895impl wkt::message::Message for ListUrlListsResponse {
27896 fn typename() -> &'static str {
27897 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsResponse"
27898 }
27899}
27900
27901#[doc(hidden)]
27902impl google_cloud_gax::paginator::internal::PageableResponse for ListUrlListsResponse {
27903 type PageItem = crate::model::UrlList;
27904
27905 fn items(self) -> std::vec::Vec<Self::PageItem> {
27906 self.url_lists
27907 }
27908
27909 fn next_page_token(&self) -> std::string::String {
27910 use std::clone::Clone;
27911 self.next_page_token.clone()
27912 }
27913}
27914
27915/// Request used by the GetUrlList method.
27916#[derive(Clone, Default, PartialEq)]
27917#[non_exhaustive]
27918pub struct GetUrlListRequest {
27919 /// Required. A name of the UrlList to get. Must be in the format
27920 /// `projects/*/locations/{location}/urlLists/*`.
27921 pub name: std::string::String,
27922
27923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27924}
27925
27926impl GetUrlListRequest {
27927 /// Creates a new default instance.
27928 pub fn new() -> Self {
27929 std::default::Default::default()
27930 }
27931
27932 /// Sets the value of [name][crate::model::GetUrlListRequest::name].
27933 ///
27934 /// # Example
27935 /// ```ignore,no_run
27936 /// # use google_cloud_networksecurity_v1::model::GetUrlListRequest;
27937 /// # let project_id = "project_id";
27938 /// # let location_id = "location_id";
27939 /// # let url_list_id = "url_list_id";
27940 /// let x = GetUrlListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
27941 /// ```
27942 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27943 self.name = v.into();
27944 self
27945 }
27946}
27947
27948impl wkt::message::Message for GetUrlListRequest {
27949 fn typename() -> &'static str {
27950 "type.googleapis.com/google.cloud.networksecurity.v1.GetUrlListRequest"
27951 }
27952}
27953
27954/// Request used by the CreateUrlList method.
27955#[derive(Clone, Default, PartialEq)]
27956#[non_exhaustive]
27957pub struct CreateUrlListRequest {
27958 /// Required. The parent resource of the UrlList. Must be in
27959 /// the format `projects/*/locations/{location}`.
27960 pub parent: std::string::String,
27961
27962 /// Required. Short name of the UrlList resource to be created. This value
27963 /// should be 1-63 characters long, containing only letters, numbers, hyphens,
27964 /// and underscores, and should not start with a number. E.g. "url_list".
27965 pub url_list_id: std::string::String,
27966
27967 /// Required. UrlList resource to be created.
27968 pub url_list: std::option::Option<crate::model::UrlList>,
27969
27970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27971}
27972
27973impl CreateUrlListRequest {
27974 /// Creates a new default instance.
27975 pub fn new() -> Self {
27976 std::default::Default::default()
27977 }
27978
27979 /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
27980 ///
27981 /// # Example
27982 /// ```ignore,no_run
27983 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
27984 /// # let project_id = "project_id";
27985 /// # let location_id = "location_id";
27986 /// let x = CreateUrlListRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
27987 /// ```
27988 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27989 self.parent = v.into();
27990 self
27991 }
27992
27993 /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
27994 ///
27995 /// # Example
27996 /// ```ignore,no_run
27997 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
27998 /// let x = CreateUrlListRequest::new().set_url_list_id("example");
27999 /// ```
28000 pub fn set_url_list_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28001 self.url_list_id = v.into();
28002 self
28003 }
28004
28005 /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
28006 ///
28007 /// # Example
28008 /// ```ignore,no_run
28009 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
28010 /// use google_cloud_networksecurity_v1::model::UrlList;
28011 /// let x = CreateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
28012 /// ```
28013 pub fn set_url_list<T>(mut self, v: T) -> Self
28014 where
28015 T: std::convert::Into<crate::model::UrlList>,
28016 {
28017 self.url_list = std::option::Option::Some(v.into());
28018 self
28019 }
28020
28021 /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
28022 ///
28023 /// # Example
28024 /// ```ignore,no_run
28025 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
28026 /// use google_cloud_networksecurity_v1::model::UrlList;
28027 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
28028 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
28029 /// ```
28030 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
28031 where
28032 T: std::convert::Into<crate::model::UrlList>,
28033 {
28034 self.url_list = v.map(|x| x.into());
28035 self
28036 }
28037}
28038
28039impl wkt::message::Message for CreateUrlListRequest {
28040 fn typename() -> &'static str {
28041 "type.googleapis.com/google.cloud.networksecurity.v1.CreateUrlListRequest"
28042 }
28043}
28044
28045/// Request used by UpdateUrlList method.
28046#[derive(Clone, Default, PartialEq)]
28047#[non_exhaustive]
28048pub struct UpdateUrlListRequest {
28049 /// Optional. Field mask is used to specify the fields to be overwritten in the
28050 /// UrlList resource by the update. The fields
28051 /// specified in the update_mask are relative to the resource, not
28052 /// the full request. A field will be overwritten if it is in the
28053 /// mask. If the user does not provide a mask then all fields will be
28054 /// overwritten.
28055 pub update_mask: std::option::Option<wkt::FieldMask>,
28056
28057 /// Required. Updated UrlList resource.
28058 pub url_list: std::option::Option<crate::model::UrlList>,
28059
28060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28061}
28062
28063impl UpdateUrlListRequest {
28064 /// Creates a new default instance.
28065 pub fn new() -> Self {
28066 std::default::Default::default()
28067 }
28068
28069 /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
28070 ///
28071 /// # Example
28072 /// ```ignore,no_run
28073 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28074 /// use wkt::FieldMask;
28075 /// let x = UpdateUrlListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
28076 /// ```
28077 pub fn set_update_mask<T>(mut self, v: T) -> Self
28078 where
28079 T: std::convert::Into<wkt::FieldMask>,
28080 {
28081 self.update_mask = std::option::Option::Some(v.into());
28082 self
28083 }
28084
28085 /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
28086 ///
28087 /// # Example
28088 /// ```ignore,no_run
28089 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28090 /// use wkt::FieldMask;
28091 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
28092 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
28093 /// ```
28094 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
28095 where
28096 T: std::convert::Into<wkt::FieldMask>,
28097 {
28098 self.update_mask = v.map(|x| x.into());
28099 self
28100 }
28101
28102 /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
28103 ///
28104 /// # Example
28105 /// ```ignore,no_run
28106 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28107 /// use google_cloud_networksecurity_v1::model::UrlList;
28108 /// let x = UpdateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
28109 /// ```
28110 pub fn set_url_list<T>(mut self, v: T) -> Self
28111 where
28112 T: std::convert::Into<crate::model::UrlList>,
28113 {
28114 self.url_list = std::option::Option::Some(v.into());
28115 self
28116 }
28117
28118 /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
28119 ///
28120 /// # Example
28121 /// ```ignore,no_run
28122 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
28123 /// use google_cloud_networksecurity_v1::model::UrlList;
28124 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
28125 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
28126 /// ```
28127 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
28128 where
28129 T: std::convert::Into<crate::model::UrlList>,
28130 {
28131 self.url_list = v.map(|x| x.into());
28132 self
28133 }
28134}
28135
28136impl wkt::message::Message for UpdateUrlListRequest {
28137 fn typename() -> &'static str {
28138 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateUrlListRequest"
28139 }
28140}
28141
28142/// Request used by the DeleteUrlList method.
28143#[derive(Clone, Default, PartialEq)]
28144#[non_exhaustive]
28145pub struct DeleteUrlListRequest {
28146 /// Required. A name of the UrlList to delete. Must be in
28147 /// the format `projects/*/locations/{location}/urlLists/*`.
28148 pub name: std::string::String,
28149
28150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28151}
28152
28153impl DeleteUrlListRequest {
28154 /// Creates a new default instance.
28155 pub fn new() -> Self {
28156 std::default::Default::default()
28157 }
28158
28159 /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
28160 ///
28161 /// # Example
28162 /// ```ignore,no_run
28163 /// # use google_cloud_networksecurity_v1::model::DeleteUrlListRequest;
28164 /// # let project_id = "project_id";
28165 /// # let location_id = "location_id";
28166 /// # let url_list_id = "url_list_id";
28167 /// let x = DeleteUrlListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/urlLists/{url_list_id}"));
28168 /// ```
28169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28170 self.name = v.into();
28171 self
28172 }
28173}
28174
28175impl wkt::message::Message for DeleteUrlListRequest {
28176 fn typename() -> &'static str {
28177 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteUrlListRequest"
28178 }
28179}
28180
28181/// Severity level.
28182///
28183/// # Working with unknown values
28184///
28185/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28186/// additional enum variants at any time. Adding new variants is not considered
28187/// a breaking change. Applications should write their code in anticipation of:
28188///
28189/// - New values appearing in future releases of the client library, **and**
28190/// - New values received dynamically, without application changes.
28191///
28192/// Please consult the [Working with enums] section in the user guide for some
28193/// guidelines.
28194///
28195/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28196#[derive(Clone, Debug, PartialEq)]
28197#[non_exhaustive]
28198pub enum Severity {
28199 /// Severity level not specified.
28200 Unspecified,
28201 /// Suspicious events that do not pose an immediate threat, but that are
28202 /// reported to call attention to deeper problems that could possibly exist.
28203 Informational,
28204 /// Warning-level threats that have very little impact on an organization's
28205 /// infrastructure. They usually require local or physical system access and
28206 /// may often result in victim privacy issues and information leakage.
28207 Low,
28208 /// Minor threats in which impact is minimized, that do not compromise the
28209 /// target or exploits that require an attacker to reside on the same local
28210 /// network as the victim, affect only non-standard configurations or obscure
28211 /// applications, or provide very limited access.
28212 Medium,
28213 /// Threats that have the ability to become critical but have mitigating
28214 /// factors; for example, they may be difficult to exploit, do not result in
28215 /// elevated privileges, or do not have a large victim pool.
28216 High,
28217 /// Serious threats, such as those that affect default installations of widely
28218 /// deployed software, result in root compromise of servers, and the exploit
28219 /// code is widely available to attackers. The attacker usually does not need
28220 /// any special authentication credentials or knowledge about the individual
28221 /// victims and the target does not need to be manipulated into performing any
28222 /// special functions.
28223 Critical,
28224 /// If set, the enum was initialized with an unknown value.
28225 ///
28226 /// Applications can examine the value using [Severity::value] or
28227 /// [Severity::name].
28228 UnknownValue(severity::UnknownValue),
28229}
28230
28231#[doc(hidden)]
28232pub mod severity {
28233 #[allow(unused_imports)]
28234 use super::*;
28235 #[derive(Clone, Debug, PartialEq)]
28236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28237}
28238
28239impl Severity {
28240 /// Gets the enum value.
28241 ///
28242 /// Returns `None` if the enum contains an unknown value deserialized from
28243 /// the string representation of enums.
28244 pub fn value(&self) -> std::option::Option<i32> {
28245 match self {
28246 Self::Unspecified => std::option::Option::Some(0),
28247 Self::Informational => std::option::Option::Some(1),
28248 Self::Low => std::option::Option::Some(2),
28249 Self::Medium => std::option::Option::Some(3),
28250 Self::High => std::option::Option::Some(4),
28251 Self::Critical => std::option::Option::Some(5),
28252 Self::UnknownValue(u) => u.0.value(),
28253 }
28254 }
28255
28256 /// Gets the enum value as a string.
28257 ///
28258 /// Returns `None` if the enum contains an unknown value deserialized from
28259 /// the integer representation of enums.
28260 pub fn name(&self) -> std::option::Option<&str> {
28261 match self {
28262 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
28263 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
28264 Self::Low => std::option::Option::Some("LOW"),
28265 Self::Medium => std::option::Option::Some("MEDIUM"),
28266 Self::High => std::option::Option::Some("HIGH"),
28267 Self::Critical => std::option::Option::Some("CRITICAL"),
28268 Self::UnknownValue(u) => u.0.name(),
28269 }
28270 }
28271}
28272
28273impl std::default::Default for Severity {
28274 fn default() -> Self {
28275 use std::convert::From;
28276 Self::from(0)
28277 }
28278}
28279
28280impl std::fmt::Display for Severity {
28281 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28282 wkt::internal::display_enum(f, self.name(), self.value())
28283 }
28284}
28285
28286impl std::convert::From<i32> for Severity {
28287 fn from(value: i32) -> Self {
28288 match value {
28289 0 => Self::Unspecified,
28290 1 => Self::Informational,
28291 2 => Self::Low,
28292 3 => Self::Medium,
28293 4 => Self::High,
28294 5 => Self::Critical,
28295 _ => Self::UnknownValue(severity::UnknownValue(
28296 wkt::internal::UnknownEnumValue::Integer(value),
28297 )),
28298 }
28299 }
28300}
28301
28302impl std::convert::From<&str> for Severity {
28303 fn from(value: &str) -> Self {
28304 use std::string::ToString;
28305 match value {
28306 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
28307 "INFORMATIONAL" => Self::Informational,
28308 "LOW" => Self::Low,
28309 "MEDIUM" => Self::Medium,
28310 "HIGH" => Self::High,
28311 "CRITICAL" => Self::Critical,
28312 _ => Self::UnknownValue(severity::UnknownValue(
28313 wkt::internal::UnknownEnumValue::String(value.to_string()),
28314 )),
28315 }
28316 }
28317}
28318
28319impl serde::ser::Serialize for Severity {
28320 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28321 where
28322 S: serde::Serializer,
28323 {
28324 match self {
28325 Self::Unspecified => serializer.serialize_i32(0),
28326 Self::Informational => serializer.serialize_i32(1),
28327 Self::Low => serializer.serialize_i32(2),
28328 Self::Medium => serializer.serialize_i32(3),
28329 Self::High => serializer.serialize_i32(4),
28330 Self::Critical => serializer.serialize_i32(5),
28331 Self::UnknownValue(u) => u.0.serialize(serializer),
28332 }
28333 }
28334}
28335
28336impl<'de> serde::de::Deserialize<'de> for Severity {
28337 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28338 where
28339 D: serde::Deserializer<'de>,
28340 {
28341 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
28342 ".google.cloud.networksecurity.v1.Severity",
28343 ))
28344 }
28345}
28346
28347/// Type of threat.
28348///
28349/// # Working with unknown values
28350///
28351/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28352/// additional enum variants at any time. Adding new variants is not considered
28353/// a breaking change. Applications should write their code in anticipation of:
28354///
28355/// - New values appearing in future releases of the client library, **and**
28356/// - New values received dynamically, without application changes.
28357///
28358/// Please consult the [Working with enums] section in the user guide for some
28359/// guidelines.
28360///
28361/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28362#[derive(Clone, Debug, PartialEq)]
28363#[non_exhaustive]
28364pub enum ThreatType {
28365 /// Type of threat not specified.
28366 Unspecified,
28367 /// Type of threat is not derivable from threat ID. An override will be
28368 /// created for all types. Firewall will ignore overridden signature ID's
28369 /// that don't exist in the specific type.
28370 Unknown,
28371 /// Threats related to system flaws that an attacker might otherwise attempt
28372 /// to exploit.
28373 Vulnerability,
28374 /// Threats related to viruses and malware found in executables and file
28375 /// types.
28376 Antivirus,
28377 /// Threats related to command-and-control (C2) activity, where spyware on an
28378 /// infected client is collecting data without the user's consent and/or
28379 /// communicating with a remote attacker.
28380 Spyware,
28381 /// Threats related to DNS.
28382 Dns,
28383 /// If set, the enum was initialized with an unknown value.
28384 ///
28385 /// Applications can examine the value using [ThreatType::value] or
28386 /// [ThreatType::name].
28387 UnknownValue(threat_type::UnknownValue),
28388}
28389
28390#[doc(hidden)]
28391pub mod threat_type {
28392 #[allow(unused_imports)]
28393 use super::*;
28394 #[derive(Clone, Debug, PartialEq)]
28395 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28396}
28397
28398impl ThreatType {
28399 /// Gets the enum value.
28400 ///
28401 /// Returns `None` if the enum contains an unknown value deserialized from
28402 /// the string representation of enums.
28403 pub fn value(&self) -> std::option::Option<i32> {
28404 match self {
28405 Self::Unspecified => std::option::Option::Some(0),
28406 Self::Unknown => std::option::Option::Some(1),
28407 Self::Vulnerability => std::option::Option::Some(2),
28408 Self::Antivirus => std::option::Option::Some(3),
28409 Self::Spyware => std::option::Option::Some(4),
28410 Self::Dns => std::option::Option::Some(5),
28411 Self::UnknownValue(u) => u.0.value(),
28412 }
28413 }
28414
28415 /// Gets the enum value as a string.
28416 ///
28417 /// Returns `None` if the enum contains an unknown value deserialized from
28418 /// the integer representation of enums.
28419 pub fn name(&self) -> std::option::Option<&str> {
28420 match self {
28421 Self::Unspecified => std::option::Option::Some("THREAT_TYPE_UNSPECIFIED"),
28422 Self::Unknown => std::option::Option::Some("UNKNOWN"),
28423 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
28424 Self::Antivirus => std::option::Option::Some("ANTIVIRUS"),
28425 Self::Spyware => std::option::Option::Some("SPYWARE"),
28426 Self::Dns => std::option::Option::Some("DNS"),
28427 Self::UnknownValue(u) => u.0.name(),
28428 }
28429 }
28430}
28431
28432impl std::default::Default for ThreatType {
28433 fn default() -> Self {
28434 use std::convert::From;
28435 Self::from(0)
28436 }
28437}
28438
28439impl std::fmt::Display for ThreatType {
28440 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28441 wkt::internal::display_enum(f, self.name(), self.value())
28442 }
28443}
28444
28445impl std::convert::From<i32> for ThreatType {
28446 fn from(value: i32) -> Self {
28447 match value {
28448 0 => Self::Unspecified,
28449 1 => Self::Unknown,
28450 2 => Self::Vulnerability,
28451 3 => Self::Antivirus,
28452 4 => Self::Spyware,
28453 5 => Self::Dns,
28454 _ => Self::UnknownValue(threat_type::UnknownValue(
28455 wkt::internal::UnknownEnumValue::Integer(value),
28456 )),
28457 }
28458 }
28459}
28460
28461impl std::convert::From<&str> for ThreatType {
28462 fn from(value: &str) -> Self {
28463 use std::string::ToString;
28464 match value {
28465 "THREAT_TYPE_UNSPECIFIED" => Self::Unspecified,
28466 "UNKNOWN" => Self::Unknown,
28467 "VULNERABILITY" => Self::Vulnerability,
28468 "ANTIVIRUS" => Self::Antivirus,
28469 "SPYWARE" => Self::Spyware,
28470 "DNS" => Self::Dns,
28471 _ => Self::UnknownValue(threat_type::UnknownValue(
28472 wkt::internal::UnknownEnumValue::String(value.to_string()),
28473 )),
28474 }
28475 }
28476}
28477
28478impl serde::ser::Serialize for ThreatType {
28479 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28480 where
28481 S: serde::Serializer,
28482 {
28483 match self {
28484 Self::Unspecified => serializer.serialize_i32(0),
28485 Self::Unknown => serializer.serialize_i32(1),
28486 Self::Vulnerability => serializer.serialize_i32(2),
28487 Self::Antivirus => serializer.serialize_i32(3),
28488 Self::Spyware => serializer.serialize_i32(4),
28489 Self::Dns => serializer.serialize_i32(5),
28490 Self::UnknownValue(u) => u.0.serialize(serializer),
28491 }
28492 }
28493}
28494
28495impl<'de> serde::de::Deserialize<'de> for ThreatType {
28496 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28497 where
28498 D: serde::Deserializer<'de>,
28499 {
28500 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatType>::new(
28501 ".google.cloud.networksecurity.v1.ThreatType",
28502 ))
28503 }
28504}
28505
28506/// Threat action override.
28507///
28508/// # Working with unknown values
28509///
28510/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28511/// additional enum variants at any time. Adding new variants is not considered
28512/// a breaking change. Applications should write their code in anticipation of:
28513///
28514/// - New values appearing in future releases of the client library, **and**
28515/// - New values received dynamically, without application changes.
28516///
28517/// Please consult the [Working with enums] section in the user guide for some
28518/// guidelines.
28519///
28520/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28521#[derive(Clone, Debug, PartialEq)]
28522#[non_exhaustive]
28523pub enum ThreatAction {
28524 /// Threat action not specified.
28525 Unspecified,
28526 /// The default action (as specified by the vendor) is taken.
28527 DefaultAction,
28528 /// The packet matching this rule will be allowed to transmit.
28529 Allow,
28530 /// The packet matching this rule will be allowed to transmit, but a threat_log
28531 /// entry will be sent to the consumer project.
28532 Alert,
28533 /// The packet matching this rule will be dropped, and a threat_log entry will
28534 /// be sent to the consumer project.
28535 Deny,
28536 /// If set, the enum was initialized with an unknown value.
28537 ///
28538 /// Applications can examine the value using [ThreatAction::value] or
28539 /// [ThreatAction::name].
28540 UnknownValue(threat_action::UnknownValue),
28541}
28542
28543#[doc(hidden)]
28544pub mod threat_action {
28545 #[allow(unused_imports)]
28546 use super::*;
28547 #[derive(Clone, Debug, PartialEq)]
28548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28549}
28550
28551impl ThreatAction {
28552 /// Gets the enum value.
28553 ///
28554 /// Returns `None` if the enum contains an unknown value deserialized from
28555 /// the string representation of enums.
28556 pub fn value(&self) -> std::option::Option<i32> {
28557 match self {
28558 Self::Unspecified => std::option::Option::Some(0),
28559 Self::DefaultAction => std::option::Option::Some(4),
28560 Self::Allow => std::option::Option::Some(1),
28561 Self::Alert => std::option::Option::Some(2),
28562 Self::Deny => std::option::Option::Some(3),
28563 Self::UnknownValue(u) => u.0.value(),
28564 }
28565 }
28566
28567 /// Gets the enum value as a string.
28568 ///
28569 /// Returns `None` if the enum contains an unknown value deserialized from
28570 /// the integer representation of enums.
28571 pub fn name(&self) -> std::option::Option<&str> {
28572 match self {
28573 Self::Unspecified => std::option::Option::Some("THREAT_ACTION_UNSPECIFIED"),
28574 Self::DefaultAction => std::option::Option::Some("DEFAULT_ACTION"),
28575 Self::Allow => std::option::Option::Some("ALLOW"),
28576 Self::Alert => std::option::Option::Some("ALERT"),
28577 Self::Deny => std::option::Option::Some("DENY"),
28578 Self::UnknownValue(u) => u.0.name(),
28579 }
28580 }
28581}
28582
28583impl std::default::Default for ThreatAction {
28584 fn default() -> Self {
28585 use std::convert::From;
28586 Self::from(0)
28587 }
28588}
28589
28590impl std::fmt::Display for ThreatAction {
28591 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28592 wkt::internal::display_enum(f, self.name(), self.value())
28593 }
28594}
28595
28596impl std::convert::From<i32> for ThreatAction {
28597 fn from(value: i32) -> Self {
28598 match value {
28599 0 => Self::Unspecified,
28600 1 => Self::Allow,
28601 2 => Self::Alert,
28602 3 => Self::Deny,
28603 4 => Self::DefaultAction,
28604 _ => Self::UnknownValue(threat_action::UnknownValue(
28605 wkt::internal::UnknownEnumValue::Integer(value),
28606 )),
28607 }
28608 }
28609}
28610
28611impl std::convert::From<&str> for ThreatAction {
28612 fn from(value: &str) -> Self {
28613 use std::string::ToString;
28614 match value {
28615 "THREAT_ACTION_UNSPECIFIED" => Self::Unspecified,
28616 "DEFAULT_ACTION" => Self::DefaultAction,
28617 "ALLOW" => Self::Allow,
28618 "ALERT" => Self::Alert,
28619 "DENY" => Self::Deny,
28620 _ => Self::UnknownValue(threat_action::UnknownValue(
28621 wkt::internal::UnknownEnumValue::String(value.to_string()),
28622 )),
28623 }
28624 }
28625}
28626
28627impl serde::ser::Serialize for ThreatAction {
28628 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28629 where
28630 S: serde::Serializer,
28631 {
28632 match self {
28633 Self::Unspecified => serializer.serialize_i32(0),
28634 Self::DefaultAction => serializer.serialize_i32(4),
28635 Self::Allow => serializer.serialize_i32(1),
28636 Self::Alert => serializer.serialize_i32(2),
28637 Self::Deny => serializer.serialize_i32(3),
28638 Self::UnknownValue(u) => u.0.serialize(serializer),
28639 }
28640 }
28641}
28642
28643impl<'de> serde::de::Deserialize<'de> for ThreatAction {
28644 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28645 where
28646 D: serde::Deserializer<'de>,
28647 {
28648 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatAction>::new(
28649 ".google.cloud.networksecurity.v1.ThreatAction",
28650 ))
28651 }
28652}
28653
28654/// Antivirus protocol.
28655///
28656/// # Working with unknown values
28657///
28658/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28659/// additional enum variants at any time. Adding new variants is not considered
28660/// a breaking change. Applications should write their code in anticipation of:
28661///
28662/// - New values appearing in future releases of the client library, **and**
28663/// - New values received dynamically, without application changes.
28664///
28665/// Please consult the [Working with enums] section in the user guide for some
28666/// guidelines.
28667///
28668/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28669#[derive(Clone, Debug, PartialEq)]
28670#[non_exhaustive]
28671pub enum Protocol {
28672 /// Protocol not specified.
28673 Unspecified,
28674 /// SMTP protocol
28675 Smtp,
28676 /// SMB protocol
28677 Smb,
28678 /// POP3 protocol
28679 Pop3,
28680 /// IMAP protocol
28681 Imap,
28682 /// HTTP2 protocol
28683 Http2,
28684 /// HTTP protocol
28685 Http,
28686 /// FTP protocol
28687 Ftp,
28688 /// If set, the enum was initialized with an unknown value.
28689 ///
28690 /// Applications can examine the value using [Protocol::value] or
28691 /// [Protocol::name].
28692 UnknownValue(protocol::UnknownValue),
28693}
28694
28695#[doc(hidden)]
28696pub mod protocol {
28697 #[allow(unused_imports)]
28698 use super::*;
28699 #[derive(Clone, Debug, PartialEq)]
28700 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28701}
28702
28703impl Protocol {
28704 /// Gets the enum value.
28705 ///
28706 /// Returns `None` if the enum contains an unknown value deserialized from
28707 /// the string representation of enums.
28708 pub fn value(&self) -> std::option::Option<i32> {
28709 match self {
28710 Self::Unspecified => std::option::Option::Some(0),
28711 Self::Smtp => std::option::Option::Some(1),
28712 Self::Smb => std::option::Option::Some(2),
28713 Self::Pop3 => std::option::Option::Some(3),
28714 Self::Imap => std::option::Option::Some(4),
28715 Self::Http2 => std::option::Option::Some(5),
28716 Self::Http => std::option::Option::Some(6),
28717 Self::Ftp => std::option::Option::Some(7),
28718 Self::UnknownValue(u) => u.0.value(),
28719 }
28720 }
28721
28722 /// Gets the enum value as a string.
28723 ///
28724 /// Returns `None` if the enum contains an unknown value deserialized from
28725 /// the integer representation of enums.
28726 pub fn name(&self) -> std::option::Option<&str> {
28727 match self {
28728 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
28729 Self::Smtp => std::option::Option::Some("SMTP"),
28730 Self::Smb => std::option::Option::Some("SMB"),
28731 Self::Pop3 => std::option::Option::Some("POP3"),
28732 Self::Imap => std::option::Option::Some("IMAP"),
28733 Self::Http2 => std::option::Option::Some("HTTP2"),
28734 Self::Http => std::option::Option::Some("HTTP"),
28735 Self::Ftp => std::option::Option::Some("FTP"),
28736 Self::UnknownValue(u) => u.0.name(),
28737 }
28738 }
28739}
28740
28741impl std::default::Default for Protocol {
28742 fn default() -> Self {
28743 use std::convert::From;
28744 Self::from(0)
28745 }
28746}
28747
28748impl std::fmt::Display for Protocol {
28749 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28750 wkt::internal::display_enum(f, self.name(), self.value())
28751 }
28752}
28753
28754impl std::convert::From<i32> for Protocol {
28755 fn from(value: i32) -> Self {
28756 match value {
28757 0 => Self::Unspecified,
28758 1 => Self::Smtp,
28759 2 => Self::Smb,
28760 3 => Self::Pop3,
28761 4 => Self::Imap,
28762 5 => Self::Http2,
28763 6 => Self::Http,
28764 7 => Self::Ftp,
28765 _ => Self::UnknownValue(protocol::UnknownValue(
28766 wkt::internal::UnknownEnumValue::Integer(value),
28767 )),
28768 }
28769 }
28770}
28771
28772impl std::convert::From<&str> for Protocol {
28773 fn from(value: &str) -> Self {
28774 use std::string::ToString;
28775 match value {
28776 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
28777 "SMTP" => Self::Smtp,
28778 "SMB" => Self::Smb,
28779 "POP3" => Self::Pop3,
28780 "IMAP" => Self::Imap,
28781 "HTTP2" => Self::Http2,
28782 "HTTP" => Self::Http,
28783 "FTP" => Self::Ftp,
28784 _ => Self::UnknownValue(protocol::UnknownValue(
28785 wkt::internal::UnknownEnumValue::String(value.to_string()),
28786 )),
28787 }
28788 }
28789}
28790
28791impl serde::ser::Serialize for Protocol {
28792 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28793 where
28794 S: serde::Serializer,
28795 {
28796 match self {
28797 Self::Unspecified => serializer.serialize_i32(0),
28798 Self::Smtp => serializer.serialize_i32(1),
28799 Self::Smb => serializer.serialize_i32(2),
28800 Self::Pop3 => serializer.serialize_i32(3),
28801 Self::Imap => serializer.serialize_i32(4),
28802 Self::Http2 => serializer.serialize_i32(5),
28803 Self::Http => serializer.serialize_i32(6),
28804 Self::Ftp => serializer.serialize_i32(7),
28805 Self::UnknownValue(u) => u.0.serialize(serializer),
28806 }
28807 }
28808}
28809
28810impl<'de> serde::de::Deserialize<'de> for Protocol {
28811 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28812 where
28813 D: serde::Deserializer<'de>,
28814 {
28815 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
28816 ".google.cloud.networksecurity.v1.Protocol",
28817 ))
28818 }
28819}