1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct AddressGroup {
46 pub name: std::string::String,
49
50 pub description: std::string::String,
52
53 pub create_time: std::option::Option<wkt::Timestamp>,
55
56 pub update_time: std::option::Option<wkt::Timestamp>,
58
59 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
61
62 pub r#type: crate::model::address_group::Type,
65
66 pub items: std::vec::Vec<std::string::String>,
68
69 pub capacity: i32,
71
72 pub self_link: std::string::String,
74
75 pub purpose: std::vec::Vec<crate::model::address_group::Purpose>,
77
78 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl AddressGroup {
82 pub fn new() -> Self {
83 std::default::Default::default()
84 }
85
86 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88 self.name = v.into();
89 self
90 }
91
92 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94 self.description = v.into();
95 self
96 }
97
98 pub fn set_create_time<T>(mut self, v: T) -> Self
100 where
101 T: std::convert::Into<wkt::Timestamp>,
102 {
103 self.create_time = std::option::Option::Some(v.into());
104 self
105 }
106
107 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
109 where
110 T: std::convert::Into<wkt::Timestamp>,
111 {
112 self.create_time = v.map(|x| x.into());
113 self
114 }
115
116 pub fn set_update_time<T>(mut self, v: T) -> Self
118 where
119 T: std::convert::Into<wkt::Timestamp>,
120 {
121 self.update_time = std::option::Option::Some(v.into());
122 self
123 }
124
125 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
127 where
128 T: std::convert::Into<wkt::Timestamp>,
129 {
130 self.update_time = v.map(|x| x.into());
131 self
132 }
133
134 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
136 where
137 T: std::iter::IntoIterator<Item = (K, V)>,
138 K: std::convert::Into<std::string::String>,
139 V: std::convert::Into<std::string::String>,
140 {
141 use std::iter::Iterator;
142 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
143 self
144 }
145
146 pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
148 mut self,
149 v: T,
150 ) -> Self {
151 self.r#type = v.into();
152 self
153 }
154
155 pub fn set_items<T, V>(mut self, v: T) -> Self
157 where
158 T: std::iter::IntoIterator<Item = V>,
159 V: std::convert::Into<std::string::String>,
160 {
161 use std::iter::Iterator;
162 self.items = v.into_iter().map(|i| i.into()).collect();
163 self
164 }
165
166 pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
168 self.capacity = v.into();
169 self
170 }
171
172 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
174 self.self_link = v.into();
175 self
176 }
177
178 pub fn set_purpose<T, V>(mut self, v: T) -> Self
180 where
181 T: std::iter::IntoIterator<Item = V>,
182 V: std::convert::Into<crate::model::address_group::Purpose>,
183 {
184 use std::iter::Iterator;
185 self.purpose = v.into_iter().map(|i| i.into()).collect();
186 self
187 }
188}
189
190impl wkt::message::Message for AddressGroup {
191 fn typename() -> &'static str {
192 "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
193 }
194}
195
196pub mod address_group {
198 #[allow(unused_imports)]
199 use super::*;
200
201 #[derive(Clone, Debug, PartialEq)]
217 #[non_exhaustive]
218 pub enum Type {
219 Unspecified,
221 Ipv4,
223 Ipv6,
225 UnknownValue(r#type::UnknownValue),
230 }
231
232 #[doc(hidden)]
233 pub mod r#type {
234 #[allow(unused_imports)]
235 use super::*;
236 #[derive(Clone, Debug, PartialEq)]
237 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
238 }
239
240 impl Type {
241 pub fn value(&self) -> std::option::Option<i32> {
246 match self {
247 Self::Unspecified => std::option::Option::Some(0),
248 Self::Ipv4 => std::option::Option::Some(1),
249 Self::Ipv6 => std::option::Option::Some(2),
250 Self::UnknownValue(u) => u.0.value(),
251 }
252 }
253
254 pub fn name(&self) -> std::option::Option<&str> {
259 match self {
260 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
261 Self::Ipv4 => std::option::Option::Some("IPV4"),
262 Self::Ipv6 => std::option::Option::Some("IPV6"),
263 Self::UnknownValue(u) => u.0.name(),
264 }
265 }
266 }
267
268 impl std::default::Default for Type {
269 fn default() -> Self {
270 use std::convert::From;
271 Self::from(0)
272 }
273 }
274
275 impl std::fmt::Display for Type {
276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
277 wkt::internal::display_enum(f, self.name(), self.value())
278 }
279 }
280
281 impl std::convert::From<i32> for Type {
282 fn from(value: i32) -> Self {
283 match value {
284 0 => Self::Unspecified,
285 1 => Self::Ipv4,
286 2 => Self::Ipv6,
287 _ => Self::UnknownValue(r#type::UnknownValue(
288 wkt::internal::UnknownEnumValue::Integer(value),
289 )),
290 }
291 }
292 }
293
294 impl std::convert::From<&str> for Type {
295 fn from(value: &str) -> Self {
296 use std::string::ToString;
297 match value {
298 "TYPE_UNSPECIFIED" => Self::Unspecified,
299 "IPV4" => Self::Ipv4,
300 "IPV6" => Self::Ipv6,
301 _ => Self::UnknownValue(r#type::UnknownValue(
302 wkt::internal::UnknownEnumValue::String(value.to_string()),
303 )),
304 }
305 }
306 }
307
308 impl serde::ser::Serialize for Type {
309 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
310 where
311 S: serde::Serializer,
312 {
313 match self {
314 Self::Unspecified => serializer.serialize_i32(0),
315 Self::Ipv4 => serializer.serialize_i32(1),
316 Self::Ipv6 => serializer.serialize_i32(2),
317 Self::UnknownValue(u) => u.0.serialize(serializer),
318 }
319 }
320 }
321
322 impl<'de> serde::de::Deserialize<'de> for Type {
323 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
324 where
325 D: serde::Deserializer<'de>,
326 {
327 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
328 ".google.cloud.networksecurity.v1.AddressGroup.Type",
329 ))
330 }
331 }
332
333 #[derive(Clone, Debug, PartialEq)]
349 #[non_exhaustive]
350 pub enum Purpose {
351 Unspecified,
353 Default,
356 CloudArmor,
358 UnknownValue(purpose::UnknownValue),
363 }
364
365 #[doc(hidden)]
366 pub mod purpose {
367 #[allow(unused_imports)]
368 use super::*;
369 #[derive(Clone, Debug, PartialEq)]
370 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
371 }
372
373 impl Purpose {
374 pub fn value(&self) -> std::option::Option<i32> {
379 match self {
380 Self::Unspecified => std::option::Option::Some(0),
381 Self::Default => std::option::Option::Some(1),
382 Self::CloudArmor => std::option::Option::Some(2),
383 Self::UnknownValue(u) => u.0.value(),
384 }
385 }
386
387 pub fn name(&self) -> std::option::Option<&str> {
392 match self {
393 Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
394 Self::Default => std::option::Option::Some("DEFAULT"),
395 Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
396 Self::UnknownValue(u) => u.0.name(),
397 }
398 }
399 }
400
401 impl std::default::Default for Purpose {
402 fn default() -> Self {
403 use std::convert::From;
404 Self::from(0)
405 }
406 }
407
408 impl std::fmt::Display for Purpose {
409 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
410 wkt::internal::display_enum(f, self.name(), self.value())
411 }
412 }
413
414 impl std::convert::From<i32> for Purpose {
415 fn from(value: i32) -> Self {
416 match value {
417 0 => Self::Unspecified,
418 1 => Self::Default,
419 2 => Self::CloudArmor,
420 _ => Self::UnknownValue(purpose::UnknownValue(
421 wkt::internal::UnknownEnumValue::Integer(value),
422 )),
423 }
424 }
425 }
426
427 impl std::convert::From<&str> for Purpose {
428 fn from(value: &str) -> Self {
429 use std::string::ToString;
430 match value {
431 "PURPOSE_UNSPECIFIED" => Self::Unspecified,
432 "DEFAULT" => Self::Default,
433 "CLOUD_ARMOR" => Self::CloudArmor,
434 _ => Self::UnknownValue(purpose::UnknownValue(
435 wkt::internal::UnknownEnumValue::String(value.to_string()),
436 )),
437 }
438 }
439 }
440
441 impl serde::ser::Serialize for Purpose {
442 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
443 where
444 S: serde::Serializer,
445 {
446 match self {
447 Self::Unspecified => serializer.serialize_i32(0),
448 Self::Default => serializer.serialize_i32(1),
449 Self::CloudArmor => serializer.serialize_i32(2),
450 Self::UnknownValue(u) => u.0.serialize(serializer),
451 }
452 }
453 }
454
455 impl<'de> serde::de::Deserialize<'de> for Purpose {
456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
457 where
458 D: serde::Deserializer<'de>,
459 {
460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
461 ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
462 ))
463 }
464 }
465}
466
467#[derive(Clone, Default, PartialEq)]
469#[non_exhaustive]
470pub struct ListAddressGroupsRequest {
471 pub parent: std::string::String,
475
476 pub page_size: i32,
478
479 pub page_token: std::string::String,
484
485 pub return_partial_success: bool,
488
489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
490}
491
492impl ListAddressGroupsRequest {
493 pub fn new() -> Self {
494 std::default::Default::default()
495 }
496
497 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
499 self.parent = v.into();
500 self
501 }
502
503 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
505 self.page_size = v.into();
506 self
507 }
508
509 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
511 self.page_token = v.into();
512 self
513 }
514
515 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
517 self.return_partial_success = v.into();
518 self
519 }
520}
521
522impl wkt::message::Message for ListAddressGroupsRequest {
523 fn typename() -> &'static str {
524 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
525 }
526}
527
528#[derive(Clone, Default, PartialEq)]
530#[non_exhaustive]
531pub struct ListAddressGroupsResponse {
532 pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
534
535 pub next_page_token: std::string::String,
539
540 pub unreachable: std::vec::Vec<std::string::String>,
542
543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
544}
545
546impl ListAddressGroupsResponse {
547 pub fn new() -> Self {
548 std::default::Default::default()
549 }
550
551 pub fn set_address_groups<T, V>(mut self, v: T) -> Self
553 where
554 T: std::iter::IntoIterator<Item = V>,
555 V: std::convert::Into<crate::model::AddressGroup>,
556 {
557 use std::iter::Iterator;
558 self.address_groups = v.into_iter().map(|i| i.into()).collect();
559 self
560 }
561
562 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
564 self.next_page_token = v.into();
565 self
566 }
567
568 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
570 where
571 T: std::iter::IntoIterator<Item = V>,
572 V: std::convert::Into<std::string::String>,
573 {
574 use std::iter::Iterator;
575 self.unreachable = v.into_iter().map(|i| i.into()).collect();
576 self
577 }
578}
579
580impl wkt::message::Message for ListAddressGroupsResponse {
581 fn typename() -> &'static str {
582 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
583 }
584}
585
586#[doc(hidden)]
587impl gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
588 type PageItem = crate::model::AddressGroup;
589
590 fn items(self) -> std::vec::Vec<Self::PageItem> {
591 self.address_groups
592 }
593
594 fn next_page_token(&self) -> std::string::String {
595 use std::clone::Clone;
596 self.next_page_token.clone()
597 }
598}
599
600#[derive(Clone, Default, PartialEq)]
602#[non_exhaustive]
603pub struct GetAddressGroupRequest {
604 pub name: std::string::String,
607
608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
609}
610
611impl GetAddressGroupRequest {
612 pub fn new() -> Self {
613 std::default::Default::default()
614 }
615
616 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
618 self.name = v.into();
619 self
620 }
621}
622
623impl wkt::message::Message for GetAddressGroupRequest {
624 fn typename() -> &'static str {
625 "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
626 }
627}
628
629#[derive(Clone, Default, PartialEq)]
631#[non_exhaustive]
632pub struct CreateAddressGroupRequest {
633 pub parent: std::string::String,
636
637 pub address_group_id: std::string::String,
642
643 pub address_group: std::option::Option<crate::model::AddressGroup>,
645
646 pub request_id: std::string::String,
660
661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
662}
663
664impl CreateAddressGroupRequest {
665 pub fn new() -> Self {
666 std::default::Default::default()
667 }
668
669 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671 self.parent = v.into();
672 self
673 }
674
675 pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
677 mut self,
678 v: T,
679 ) -> Self {
680 self.address_group_id = v.into();
681 self
682 }
683
684 pub fn set_address_group<T>(mut self, v: T) -> Self
686 where
687 T: std::convert::Into<crate::model::AddressGroup>,
688 {
689 self.address_group = std::option::Option::Some(v.into());
690 self
691 }
692
693 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
695 where
696 T: std::convert::Into<crate::model::AddressGroup>,
697 {
698 self.address_group = v.map(|x| x.into());
699 self
700 }
701
702 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
704 self.request_id = v.into();
705 self
706 }
707}
708
709impl wkt::message::Message for CreateAddressGroupRequest {
710 fn typename() -> &'static str {
711 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
712 }
713}
714
715#[derive(Clone, Default, PartialEq)]
717#[non_exhaustive]
718pub struct UpdateAddressGroupRequest {
719 pub update_mask: std::option::Option<wkt::FieldMask>,
725
726 pub address_group: std::option::Option<crate::model::AddressGroup>,
728
729 pub request_id: std::string::String,
743
744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
745}
746
747impl UpdateAddressGroupRequest {
748 pub fn new() -> Self {
749 std::default::Default::default()
750 }
751
752 pub fn set_update_mask<T>(mut self, v: T) -> Self
754 where
755 T: std::convert::Into<wkt::FieldMask>,
756 {
757 self.update_mask = std::option::Option::Some(v.into());
758 self
759 }
760
761 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
763 where
764 T: std::convert::Into<wkt::FieldMask>,
765 {
766 self.update_mask = v.map(|x| x.into());
767 self
768 }
769
770 pub fn set_address_group<T>(mut self, v: T) -> Self
772 where
773 T: std::convert::Into<crate::model::AddressGroup>,
774 {
775 self.address_group = std::option::Option::Some(v.into());
776 self
777 }
778
779 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
781 where
782 T: std::convert::Into<crate::model::AddressGroup>,
783 {
784 self.address_group = v.map(|x| x.into());
785 self
786 }
787
788 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790 self.request_id = v.into();
791 self
792 }
793}
794
795impl wkt::message::Message for UpdateAddressGroupRequest {
796 fn typename() -> &'static str {
797 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
798 }
799}
800
801#[derive(Clone, Default, PartialEq)]
803#[non_exhaustive]
804pub struct DeleteAddressGroupRequest {
805 pub name: std::string::String,
808
809 pub request_id: std::string::String,
823
824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
825}
826
827impl DeleteAddressGroupRequest {
828 pub fn new() -> Self {
829 std::default::Default::default()
830 }
831
832 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
834 self.name = v.into();
835 self
836 }
837
838 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
840 self.request_id = v.into();
841 self
842 }
843}
844
845impl wkt::message::Message for DeleteAddressGroupRequest {
846 fn typename() -> &'static str {
847 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
848 }
849}
850
851#[derive(Clone, Default, PartialEq)]
853#[non_exhaustive]
854pub struct AddAddressGroupItemsRequest {
855 pub address_group: std::string::String,
858
859 pub items: std::vec::Vec<std::string::String>,
861
862 pub request_id: std::string::String,
876
877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
878}
879
880impl AddAddressGroupItemsRequest {
881 pub fn new() -> Self {
882 std::default::Default::default()
883 }
884
885 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
887 self.address_group = v.into();
888 self
889 }
890
891 pub fn set_items<T, V>(mut self, v: T) -> Self
893 where
894 T: std::iter::IntoIterator<Item = V>,
895 V: std::convert::Into<std::string::String>,
896 {
897 use std::iter::Iterator;
898 self.items = v.into_iter().map(|i| i.into()).collect();
899 self
900 }
901
902 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
904 self.request_id = v.into();
905 self
906 }
907}
908
909impl wkt::message::Message for AddAddressGroupItemsRequest {
910 fn typename() -> &'static str {
911 "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
912 }
913}
914
915#[derive(Clone, Default, PartialEq)]
917#[non_exhaustive]
918pub struct RemoveAddressGroupItemsRequest {
919 pub address_group: std::string::String,
922
923 pub items: std::vec::Vec<std::string::String>,
925
926 pub request_id: std::string::String,
940
941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
942}
943
944impl RemoveAddressGroupItemsRequest {
945 pub fn new() -> Self {
946 std::default::Default::default()
947 }
948
949 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
951 self.address_group = v.into();
952 self
953 }
954
955 pub fn set_items<T, V>(mut self, v: T) -> Self
957 where
958 T: std::iter::IntoIterator<Item = V>,
959 V: std::convert::Into<std::string::String>,
960 {
961 use std::iter::Iterator;
962 self.items = v.into_iter().map(|i| i.into()).collect();
963 self
964 }
965
966 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
968 self.request_id = v.into();
969 self
970 }
971}
972
973impl wkt::message::Message for RemoveAddressGroupItemsRequest {
974 fn typename() -> &'static str {
975 "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
976 }
977}
978
979#[derive(Clone, Default, PartialEq)]
981#[non_exhaustive]
982pub struct CloneAddressGroupItemsRequest {
983 pub address_group: std::string::String,
986
987 pub source_address_group: std::string::String,
989
990 pub request_id: std::string::String,
1004
1005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1006}
1007
1008impl CloneAddressGroupItemsRequest {
1009 pub fn new() -> Self {
1010 std::default::Default::default()
1011 }
1012
1013 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.address_group = v.into();
1016 self
1017 }
1018
1019 pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1021 mut self,
1022 v: T,
1023 ) -> Self {
1024 self.source_address_group = v.into();
1025 self
1026 }
1027
1028 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.request_id = v.into();
1031 self
1032 }
1033}
1034
1035impl wkt::message::Message for CloneAddressGroupItemsRequest {
1036 fn typename() -> &'static str {
1037 "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1038 }
1039}
1040
1041#[derive(Clone, Default, PartialEq)]
1043#[non_exhaustive]
1044pub struct ListAddressGroupReferencesRequest {
1045 pub address_group: std::string::String,
1048
1049 pub page_size: i32,
1057
1058 pub page_token: std::string::String,
1061
1062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063}
1064
1065impl ListAddressGroupReferencesRequest {
1066 pub fn new() -> Self {
1067 std::default::Default::default()
1068 }
1069
1070 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.address_group = v.into();
1073 self
1074 }
1075
1076 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1078 self.page_size = v.into();
1079 self
1080 }
1081
1082 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1084 self.page_token = v.into();
1085 self
1086 }
1087}
1088
1089impl wkt::message::Message for ListAddressGroupReferencesRequest {
1090 fn typename() -> &'static str {
1091 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1092 }
1093}
1094
1095#[derive(Clone, Default, PartialEq)]
1097#[non_exhaustive]
1098pub struct ListAddressGroupReferencesResponse {
1099 pub address_group_references:
1101 std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1102
1103 pub next_page_token: std::string::String,
1107
1108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1109}
1110
1111impl ListAddressGroupReferencesResponse {
1112 pub fn new() -> Self {
1113 std::default::Default::default()
1114 }
1115
1116 pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1118 where
1119 T: std::iter::IntoIterator<Item = V>,
1120 V: std::convert::Into<
1121 crate::model::list_address_group_references_response::AddressGroupReference,
1122 >,
1123 {
1124 use std::iter::Iterator;
1125 self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1126 self
1127 }
1128
1129 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.next_page_token = v.into();
1132 self
1133 }
1134}
1135
1136impl wkt::message::Message for ListAddressGroupReferencesResponse {
1137 fn typename() -> &'static str {
1138 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1139 }
1140}
1141
1142#[doc(hidden)]
1143impl gax::paginator::internal::PageableResponse for ListAddressGroupReferencesResponse {
1144 type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1145
1146 fn items(self) -> std::vec::Vec<Self::PageItem> {
1147 self.address_group_references
1148 }
1149
1150 fn next_page_token(&self) -> std::string::String {
1151 use std::clone::Clone;
1152 self.next_page_token.clone()
1153 }
1154}
1155
1156pub mod list_address_group_references_response {
1158 #[allow(unused_imports)]
1159 use super::*;
1160
1161 #[derive(Clone, Default, PartialEq)]
1163 #[non_exhaustive]
1164 pub struct AddressGroupReference {
1165 pub firewall_policy: std::string::String,
1167
1168 pub security_policy: std::string::String,
1170
1171 pub rule_priority: i32,
1173
1174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1175 }
1176
1177 impl AddressGroupReference {
1178 pub fn new() -> Self {
1179 std::default::Default::default()
1180 }
1181
1182 pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1184 mut self,
1185 v: T,
1186 ) -> Self {
1187 self.firewall_policy = v.into();
1188 self
1189 }
1190
1191 pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1193 mut self,
1194 v: T,
1195 ) -> Self {
1196 self.security_policy = v.into();
1197 self
1198 }
1199
1200 pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1202 self.rule_priority = v.into();
1203 self
1204 }
1205 }
1206
1207 impl wkt::message::Message for AddressGroupReference {
1208 fn typename() -> &'static str {
1209 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1210 }
1211 }
1212}
1213
1214#[derive(Clone, Default, PartialEq)]
1219#[non_exhaustive]
1220pub struct AuthorizationPolicy {
1221 pub name: std::string::String,
1224
1225 pub description: std::string::String,
1227
1228 pub create_time: std::option::Option<wkt::Timestamp>,
1230
1231 pub update_time: std::option::Option<wkt::Timestamp>,
1233
1234 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1236
1237 pub action: crate::model::authorization_policy::Action,
1240
1241 pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1246
1247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1248}
1249
1250impl AuthorizationPolicy {
1251 pub fn new() -> Self {
1252 std::default::Default::default()
1253 }
1254
1255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.name = v.into();
1258 self
1259 }
1260
1261 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.description = v.into();
1264 self
1265 }
1266
1267 pub fn set_create_time<T>(mut self, v: T) -> Self
1269 where
1270 T: std::convert::Into<wkt::Timestamp>,
1271 {
1272 self.create_time = std::option::Option::Some(v.into());
1273 self
1274 }
1275
1276 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1278 where
1279 T: std::convert::Into<wkt::Timestamp>,
1280 {
1281 self.create_time = v.map(|x| x.into());
1282 self
1283 }
1284
1285 pub fn set_update_time<T>(mut self, v: T) -> Self
1287 where
1288 T: std::convert::Into<wkt::Timestamp>,
1289 {
1290 self.update_time = std::option::Option::Some(v.into());
1291 self
1292 }
1293
1294 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1296 where
1297 T: std::convert::Into<wkt::Timestamp>,
1298 {
1299 self.update_time = v.map(|x| x.into());
1300 self
1301 }
1302
1303 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1305 where
1306 T: std::iter::IntoIterator<Item = (K, V)>,
1307 K: std::convert::Into<std::string::String>,
1308 V: std::convert::Into<std::string::String>,
1309 {
1310 use std::iter::Iterator;
1311 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1312 self
1313 }
1314
1315 pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1317 mut self,
1318 v: T,
1319 ) -> Self {
1320 self.action = v.into();
1321 self
1322 }
1323
1324 pub fn set_rules<T, V>(mut self, v: T) -> Self
1326 where
1327 T: std::iter::IntoIterator<Item = V>,
1328 V: std::convert::Into<crate::model::authorization_policy::Rule>,
1329 {
1330 use std::iter::Iterator;
1331 self.rules = v.into_iter().map(|i| i.into()).collect();
1332 self
1333 }
1334}
1335
1336impl wkt::message::Message for AuthorizationPolicy {
1337 fn typename() -> &'static str {
1338 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1339 }
1340}
1341
1342pub mod authorization_policy {
1344 #[allow(unused_imports)]
1345 use super::*;
1346
1347 #[derive(Clone, Default, PartialEq)]
1349 #[non_exhaustive]
1350 pub struct Rule {
1351 pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1356
1357 pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1363
1364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1365 }
1366
1367 impl Rule {
1368 pub fn new() -> Self {
1369 std::default::Default::default()
1370 }
1371
1372 pub fn set_sources<T, V>(mut self, v: T) -> Self
1374 where
1375 T: std::iter::IntoIterator<Item = V>,
1376 V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1377 {
1378 use std::iter::Iterator;
1379 self.sources = v.into_iter().map(|i| i.into()).collect();
1380 self
1381 }
1382
1383 pub fn set_destinations<T, V>(mut self, v: T) -> Self
1385 where
1386 T: std::iter::IntoIterator<Item = V>,
1387 V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1388 {
1389 use std::iter::Iterator;
1390 self.destinations = v.into_iter().map(|i| i.into()).collect();
1391 self
1392 }
1393 }
1394
1395 impl wkt::message::Message for Rule {
1396 fn typename() -> &'static str {
1397 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1398 }
1399 }
1400
1401 pub mod rule {
1403 #[allow(unused_imports)]
1404 use super::*;
1405
1406 #[derive(Clone, Default, PartialEq)]
1408 #[non_exhaustive]
1409 pub struct Source {
1410 pub principals: std::vec::Vec<std::string::String>,
1417
1418 pub ip_blocks: std::vec::Vec<std::string::String>,
1424
1425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426 }
1427
1428 impl Source {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 pub fn set_principals<T, V>(mut self, v: T) -> Self
1435 where
1436 T: std::iter::IntoIterator<Item = V>,
1437 V: std::convert::Into<std::string::String>,
1438 {
1439 use std::iter::Iterator;
1440 self.principals = v.into_iter().map(|i| i.into()).collect();
1441 self
1442 }
1443
1444 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1446 where
1447 T: std::iter::IntoIterator<Item = V>,
1448 V: std::convert::Into<std::string::String>,
1449 {
1450 use std::iter::Iterator;
1451 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1452 self
1453 }
1454 }
1455
1456 impl wkt::message::Message for Source {
1457 fn typename() -> &'static str {
1458 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1459 }
1460 }
1461
1462 #[derive(Clone, Default, PartialEq)]
1464 #[non_exhaustive]
1465 pub struct Destination {
1466 pub hosts: std::vec::Vec<std::string::String>,
1471
1472 pub ports: std::vec::Vec<u32>,
1474
1475 pub methods: std::vec::Vec<std::string::String>,
1478
1479 pub http_header_match: std::option::Option<
1485 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1486 >,
1487
1488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1489 }
1490
1491 impl Destination {
1492 pub fn new() -> Self {
1493 std::default::Default::default()
1494 }
1495
1496 pub fn set_hosts<T, V>(mut self, v: T) -> Self
1498 where
1499 T: std::iter::IntoIterator<Item = V>,
1500 V: std::convert::Into<std::string::String>,
1501 {
1502 use std::iter::Iterator;
1503 self.hosts = v.into_iter().map(|i| i.into()).collect();
1504 self
1505 }
1506
1507 pub fn set_ports<T, V>(mut self, v: T) -> Self
1509 where
1510 T: std::iter::IntoIterator<Item = V>,
1511 V: std::convert::Into<u32>,
1512 {
1513 use std::iter::Iterator;
1514 self.ports = v.into_iter().map(|i| i.into()).collect();
1515 self
1516 }
1517
1518 pub fn set_methods<T, V>(mut self, v: T) -> Self
1520 where
1521 T: std::iter::IntoIterator<Item = V>,
1522 V: std::convert::Into<std::string::String>,
1523 {
1524 use std::iter::Iterator;
1525 self.methods = v.into_iter().map(|i| i.into()).collect();
1526 self
1527 }
1528
1529 pub fn set_http_header_match<T>(mut self, v: T) -> Self
1531 where
1532 T: std::convert::Into<
1533 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1534 >,
1535 {
1536 self.http_header_match = std::option::Option::Some(v.into());
1537 self
1538 }
1539
1540 pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
1542 where
1543 T: std::convert::Into<
1544 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1545 >,
1546 {
1547 self.http_header_match = v.map(|x| x.into());
1548 self
1549 }
1550 }
1551
1552 impl wkt::message::Message for Destination {
1553 fn typename() -> &'static str {
1554 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
1555 }
1556 }
1557
1558 pub mod destination {
1560 #[allow(unused_imports)]
1561 use super::*;
1562
1563 #[derive(Clone, Default, PartialEq)]
1565 #[non_exhaustive]
1566 pub struct HttpHeaderMatch {
1567 pub header_name: std::string::String,
1572
1573 pub r#type: std::option::Option<
1574 crate::model::authorization_policy::rule::destination::http_header_match::Type,
1575 >,
1576
1577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1578 }
1579
1580 impl HttpHeaderMatch {
1581 pub fn new() -> Self {
1582 std::default::Default::default()
1583 }
1584
1585 pub fn set_header_name<T: std::convert::Into<std::string::String>>(
1587 mut self,
1588 v: T,
1589 ) -> Self {
1590 self.header_name = v.into();
1591 self
1592 }
1593
1594 pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::authorization_policy::rule::destination::http_header_match::Type>>>(mut self, v: T) -> Self
1599 {
1600 self.r#type = v.into();
1601 self
1602 }
1603
1604 pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
1608 #[allow(unreachable_patterns)]
1609 self.r#type.as_ref().and_then(|v| match v {
1610 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
1611 _ => std::option::Option::None,
1612 })
1613 }
1614
1615 pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
1621 mut self,
1622 v: T,
1623 ) -> Self {
1624 self.r#type = std::option::Option::Some(
1625 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
1626 v.into()
1627 )
1628 );
1629 self
1630 }
1631 }
1632
1633 impl wkt::message::Message for HttpHeaderMatch {
1634 fn typename() -> &'static str {
1635 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
1636 }
1637 }
1638
1639 pub mod http_header_match {
1641 #[allow(unused_imports)]
1642 use super::*;
1643
1644 #[derive(Clone, Debug, PartialEq)]
1645 #[non_exhaustive]
1646 pub enum Type {
1647 RegexMatch(std::string::String),
1655 }
1656 }
1657 }
1658 }
1659
1660 #[derive(Clone, Debug, PartialEq)]
1676 #[non_exhaustive]
1677 pub enum Action {
1678 Unspecified,
1680 Allow,
1682 Deny,
1686 UnknownValue(action::UnknownValue),
1691 }
1692
1693 #[doc(hidden)]
1694 pub mod action {
1695 #[allow(unused_imports)]
1696 use super::*;
1697 #[derive(Clone, Debug, PartialEq)]
1698 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1699 }
1700
1701 impl Action {
1702 pub fn value(&self) -> std::option::Option<i32> {
1707 match self {
1708 Self::Unspecified => std::option::Option::Some(0),
1709 Self::Allow => std::option::Option::Some(1),
1710 Self::Deny => std::option::Option::Some(2),
1711 Self::UnknownValue(u) => u.0.value(),
1712 }
1713 }
1714
1715 pub fn name(&self) -> std::option::Option<&str> {
1720 match self {
1721 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
1722 Self::Allow => std::option::Option::Some("ALLOW"),
1723 Self::Deny => std::option::Option::Some("DENY"),
1724 Self::UnknownValue(u) => u.0.name(),
1725 }
1726 }
1727 }
1728
1729 impl std::default::Default for Action {
1730 fn default() -> Self {
1731 use std::convert::From;
1732 Self::from(0)
1733 }
1734 }
1735
1736 impl std::fmt::Display for Action {
1737 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1738 wkt::internal::display_enum(f, self.name(), self.value())
1739 }
1740 }
1741
1742 impl std::convert::From<i32> for Action {
1743 fn from(value: i32) -> Self {
1744 match value {
1745 0 => Self::Unspecified,
1746 1 => Self::Allow,
1747 2 => Self::Deny,
1748 _ => Self::UnknownValue(action::UnknownValue(
1749 wkt::internal::UnknownEnumValue::Integer(value),
1750 )),
1751 }
1752 }
1753 }
1754
1755 impl std::convert::From<&str> for Action {
1756 fn from(value: &str) -> Self {
1757 use std::string::ToString;
1758 match value {
1759 "ACTION_UNSPECIFIED" => Self::Unspecified,
1760 "ALLOW" => Self::Allow,
1761 "DENY" => Self::Deny,
1762 _ => Self::UnknownValue(action::UnknownValue(
1763 wkt::internal::UnknownEnumValue::String(value.to_string()),
1764 )),
1765 }
1766 }
1767 }
1768
1769 impl serde::ser::Serialize for Action {
1770 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1771 where
1772 S: serde::Serializer,
1773 {
1774 match self {
1775 Self::Unspecified => serializer.serialize_i32(0),
1776 Self::Allow => serializer.serialize_i32(1),
1777 Self::Deny => serializer.serialize_i32(2),
1778 Self::UnknownValue(u) => u.0.serialize(serializer),
1779 }
1780 }
1781 }
1782
1783 impl<'de> serde::de::Deserialize<'de> for Action {
1784 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1785 where
1786 D: serde::Deserializer<'de>,
1787 {
1788 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
1789 ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
1790 ))
1791 }
1792 }
1793}
1794
1795#[derive(Clone, Default, PartialEq)]
1797#[non_exhaustive]
1798pub struct ListAuthorizationPoliciesRequest {
1799 pub parent: std::string::String,
1803
1804 pub page_size: i32,
1806
1807 pub page_token: std::string::String,
1812
1813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1814}
1815
1816impl ListAuthorizationPoliciesRequest {
1817 pub fn new() -> Self {
1818 std::default::Default::default()
1819 }
1820
1821 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1823 self.parent = v.into();
1824 self
1825 }
1826
1827 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1829 self.page_size = v.into();
1830 self
1831 }
1832
1833 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.page_token = v.into();
1836 self
1837 }
1838}
1839
1840impl wkt::message::Message for ListAuthorizationPoliciesRequest {
1841 fn typename() -> &'static str {
1842 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
1843 }
1844}
1845
1846#[derive(Clone, Default, PartialEq)]
1848#[non_exhaustive]
1849pub struct ListAuthorizationPoliciesResponse {
1850 pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
1852
1853 pub next_page_token: std::string::String,
1857
1858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859}
1860
1861impl ListAuthorizationPoliciesResponse {
1862 pub fn new() -> Self {
1863 std::default::Default::default()
1864 }
1865
1866 pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
1868 where
1869 T: std::iter::IntoIterator<Item = V>,
1870 V: std::convert::Into<crate::model::AuthorizationPolicy>,
1871 {
1872 use std::iter::Iterator;
1873 self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
1874 self
1875 }
1876
1877 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1879 self.next_page_token = v.into();
1880 self
1881 }
1882}
1883
1884impl wkt::message::Message for ListAuthorizationPoliciesResponse {
1885 fn typename() -> &'static str {
1886 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
1887 }
1888}
1889
1890#[doc(hidden)]
1891impl gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
1892 type PageItem = crate::model::AuthorizationPolicy;
1893
1894 fn items(self) -> std::vec::Vec<Self::PageItem> {
1895 self.authorization_policies
1896 }
1897
1898 fn next_page_token(&self) -> std::string::String {
1899 use std::clone::Clone;
1900 self.next_page_token.clone()
1901 }
1902}
1903
1904#[derive(Clone, Default, PartialEq)]
1906#[non_exhaustive]
1907pub struct GetAuthorizationPolicyRequest {
1908 pub name: std::string::String,
1911
1912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1913}
1914
1915impl GetAuthorizationPolicyRequest {
1916 pub fn new() -> Self {
1917 std::default::Default::default()
1918 }
1919
1920 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1922 self.name = v.into();
1923 self
1924 }
1925}
1926
1927impl wkt::message::Message for GetAuthorizationPolicyRequest {
1928 fn typename() -> &'static str {
1929 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
1930 }
1931}
1932
1933#[derive(Clone, Default, PartialEq)]
1935#[non_exhaustive]
1936pub struct CreateAuthorizationPolicyRequest {
1937 pub parent: std::string::String,
1940
1941 pub authorization_policy_id: std::string::String,
1946
1947 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
1949
1950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1951}
1952
1953impl CreateAuthorizationPolicyRequest {
1954 pub fn new() -> Self {
1955 std::default::Default::default()
1956 }
1957
1958 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1960 self.parent = v.into();
1961 self
1962 }
1963
1964 pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
1966 mut self,
1967 v: T,
1968 ) -> Self {
1969 self.authorization_policy_id = v.into();
1970 self
1971 }
1972
1973 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
1975 where
1976 T: std::convert::Into<crate::model::AuthorizationPolicy>,
1977 {
1978 self.authorization_policy = std::option::Option::Some(v.into());
1979 self
1980 }
1981
1982 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
1984 where
1985 T: std::convert::Into<crate::model::AuthorizationPolicy>,
1986 {
1987 self.authorization_policy = v.map(|x| x.into());
1988 self
1989 }
1990}
1991
1992impl wkt::message::Message for CreateAuthorizationPolicyRequest {
1993 fn typename() -> &'static str {
1994 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
1995 }
1996}
1997
1998#[derive(Clone, Default, PartialEq)]
2000#[non_exhaustive]
2001pub struct UpdateAuthorizationPolicyRequest {
2002 pub update_mask: std::option::Option<wkt::FieldMask>,
2008
2009 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2011
2012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2013}
2014
2015impl UpdateAuthorizationPolicyRequest {
2016 pub fn new() -> Self {
2017 std::default::Default::default()
2018 }
2019
2020 pub fn set_update_mask<T>(mut self, v: T) -> Self
2022 where
2023 T: std::convert::Into<wkt::FieldMask>,
2024 {
2025 self.update_mask = std::option::Option::Some(v.into());
2026 self
2027 }
2028
2029 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2031 where
2032 T: std::convert::Into<wkt::FieldMask>,
2033 {
2034 self.update_mask = v.map(|x| x.into());
2035 self
2036 }
2037
2038 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2040 where
2041 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2042 {
2043 self.authorization_policy = std::option::Option::Some(v.into());
2044 self
2045 }
2046
2047 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2049 where
2050 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2051 {
2052 self.authorization_policy = v.map(|x| x.into());
2053 self
2054 }
2055}
2056
2057impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2058 fn typename() -> &'static str {
2059 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2060 }
2061}
2062
2063#[derive(Clone, Default, PartialEq)]
2065#[non_exhaustive]
2066pub struct DeleteAuthorizationPolicyRequest {
2067 pub name: std::string::String,
2070
2071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2072}
2073
2074impl DeleteAuthorizationPolicyRequest {
2075 pub fn new() -> Self {
2076 std::default::Default::default()
2077 }
2078
2079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2081 self.name = v.into();
2082 self
2083 }
2084}
2085
2086impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2087 fn typename() -> &'static str {
2088 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2089 }
2090}
2091
2092#[derive(Clone, Default, PartialEq)]
2096#[non_exhaustive]
2097pub struct ClientTlsPolicy {
2098 pub name: std::string::String,
2101
2102 pub description: std::string::String,
2104
2105 pub create_time: std::option::Option<wkt::Timestamp>,
2107
2108 pub update_time: std::option::Option<wkt::Timestamp>,
2110
2111 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2113
2114 pub sni: std::string::String,
2117
2118 pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
2121
2122 pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
2126
2127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl ClientTlsPolicy {
2131 pub fn new() -> Self {
2132 std::default::Default::default()
2133 }
2134
2135 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2137 self.name = v.into();
2138 self
2139 }
2140
2141 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2143 self.description = v.into();
2144 self
2145 }
2146
2147 pub fn set_create_time<T>(mut self, v: T) -> Self
2149 where
2150 T: std::convert::Into<wkt::Timestamp>,
2151 {
2152 self.create_time = std::option::Option::Some(v.into());
2153 self
2154 }
2155
2156 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2158 where
2159 T: std::convert::Into<wkt::Timestamp>,
2160 {
2161 self.create_time = v.map(|x| x.into());
2162 self
2163 }
2164
2165 pub fn set_update_time<T>(mut self, v: T) -> Self
2167 where
2168 T: std::convert::Into<wkt::Timestamp>,
2169 {
2170 self.update_time = std::option::Option::Some(v.into());
2171 self
2172 }
2173
2174 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2176 where
2177 T: std::convert::Into<wkt::Timestamp>,
2178 {
2179 self.update_time = v.map(|x| x.into());
2180 self
2181 }
2182
2183 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2185 where
2186 T: std::iter::IntoIterator<Item = (K, V)>,
2187 K: std::convert::Into<std::string::String>,
2188 V: std::convert::Into<std::string::String>,
2189 {
2190 use std::iter::Iterator;
2191 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2192 self
2193 }
2194
2195 pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2197 self.sni = v.into();
2198 self
2199 }
2200
2201 pub fn set_client_certificate<T>(mut self, v: T) -> Self
2203 where
2204 T: std::convert::Into<crate::model::CertificateProvider>,
2205 {
2206 self.client_certificate = std::option::Option::Some(v.into());
2207 self
2208 }
2209
2210 pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
2212 where
2213 T: std::convert::Into<crate::model::CertificateProvider>,
2214 {
2215 self.client_certificate = v.map(|x| x.into());
2216 self
2217 }
2218
2219 pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
2221 where
2222 T: std::iter::IntoIterator<Item = V>,
2223 V: std::convert::Into<crate::model::ValidationCA>,
2224 {
2225 use std::iter::Iterator;
2226 self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
2227 self
2228 }
2229}
2230
2231impl wkt::message::Message for ClientTlsPolicy {
2232 fn typename() -> &'static str {
2233 "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
2234 }
2235}
2236
2237#[derive(Clone, Default, PartialEq)]
2239#[non_exhaustive]
2240pub struct ListClientTlsPoliciesRequest {
2241 pub parent: std::string::String,
2244
2245 pub page_size: i32,
2247
2248 pub page_token: std::string::String,
2253
2254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2255}
2256
2257impl ListClientTlsPoliciesRequest {
2258 pub fn new() -> Self {
2259 std::default::Default::default()
2260 }
2261
2262 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.parent = v.into();
2265 self
2266 }
2267
2268 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2270 self.page_size = v.into();
2271 self
2272 }
2273
2274 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2276 self.page_token = v.into();
2277 self
2278 }
2279}
2280
2281impl wkt::message::Message for ListClientTlsPoliciesRequest {
2282 fn typename() -> &'static str {
2283 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
2284 }
2285}
2286
2287#[derive(Clone, Default, PartialEq)]
2289#[non_exhaustive]
2290pub struct ListClientTlsPoliciesResponse {
2291 pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
2293
2294 pub next_page_token: std::string::String,
2298
2299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2300}
2301
2302impl ListClientTlsPoliciesResponse {
2303 pub fn new() -> Self {
2304 std::default::Default::default()
2305 }
2306
2307 pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
2309 where
2310 T: std::iter::IntoIterator<Item = V>,
2311 V: std::convert::Into<crate::model::ClientTlsPolicy>,
2312 {
2313 use std::iter::Iterator;
2314 self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
2315 self
2316 }
2317
2318 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.next_page_token = v.into();
2321 self
2322 }
2323}
2324
2325impl wkt::message::Message for ListClientTlsPoliciesResponse {
2326 fn typename() -> &'static str {
2327 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
2328 }
2329}
2330
2331#[doc(hidden)]
2332impl gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
2333 type PageItem = crate::model::ClientTlsPolicy;
2334
2335 fn items(self) -> std::vec::Vec<Self::PageItem> {
2336 self.client_tls_policies
2337 }
2338
2339 fn next_page_token(&self) -> std::string::String {
2340 use std::clone::Clone;
2341 self.next_page_token.clone()
2342 }
2343}
2344
2345#[derive(Clone, Default, PartialEq)]
2347#[non_exhaustive]
2348pub struct GetClientTlsPolicyRequest {
2349 pub name: std::string::String,
2352
2353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2354}
2355
2356impl GetClientTlsPolicyRequest {
2357 pub fn new() -> Self {
2358 std::default::Default::default()
2359 }
2360
2361 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2363 self.name = v.into();
2364 self
2365 }
2366}
2367
2368impl wkt::message::Message for GetClientTlsPolicyRequest {
2369 fn typename() -> &'static str {
2370 "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
2371 }
2372}
2373
2374#[derive(Clone, Default, PartialEq)]
2376#[non_exhaustive]
2377pub struct CreateClientTlsPolicyRequest {
2378 pub parent: std::string::String,
2381
2382 pub client_tls_policy_id: std::string::String,
2386
2387 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
2389
2390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2391}
2392
2393impl CreateClientTlsPolicyRequest {
2394 pub fn new() -> Self {
2395 std::default::Default::default()
2396 }
2397
2398 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2400 self.parent = v.into();
2401 self
2402 }
2403
2404 pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
2406 mut self,
2407 v: T,
2408 ) -> Self {
2409 self.client_tls_policy_id = v.into();
2410 self
2411 }
2412
2413 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
2415 where
2416 T: std::convert::Into<crate::model::ClientTlsPolicy>,
2417 {
2418 self.client_tls_policy = std::option::Option::Some(v.into());
2419 self
2420 }
2421
2422 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2424 where
2425 T: std::convert::Into<crate::model::ClientTlsPolicy>,
2426 {
2427 self.client_tls_policy = v.map(|x| x.into());
2428 self
2429 }
2430}
2431
2432impl wkt::message::Message for CreateClientTlsPolicyRequest {
2433 fn typename() -> &'static str {
2434 "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
2435 }
2436}
2437
2438#[derive(Clone, Default, PartialEq)]
2440#[non_exhaustive]
2441pub struct UpdateClientTlsPolicyRequest {
2442 pub update_mask: std::option::Option<wkt::FieldMask>,
2449
2450 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
2452
2453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2454}
2455
2456impl UpdateClientTlsPolicyRequest {
2457 pub fn new() -> Self {
2458 std::default::Default::default()
2459 }
2460
2461 pub fn set_update_mask<T>(mut self, v: T) -> Self
2463 where
2464 T: std::convert::Into<wkt::FieldMask>,
2465 {
2466 self.update_mask = std::option::Option::Some(v.into());
2467 self
2468 }
2469
2470 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2472 where
2473 T: std::convert::Into<wkt::FieldMask>,
2474 {
2475 self.update_mask = v.map(|x| x.into());
2476 self
2477 }
2478
2479 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
2481 where
2482 T: std::convert::Into<crate::model::ClientTlsPolicy>,
2483 {
2484 self.client_tls_policy = std::option::Option::Some(v.into());
2485 self
2486 }
2487
2488 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2490 where
2491 T: std::convert::Into<crate::model::ClientTlsPolicy>,
2492 {
2493 self.client_tls_policy = v.map(|x| x.into());
2494 self
2495 }
2496}
2497
2498impl wkt::message::Message for UpdateClientTlsPolicyRequest {
2499 fn typename() -> &'static str {
2500 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
2501 }
2502}
2503
2504#[derive(Clone, Default, PartialEq)]
2506#[non_exhaustive]
2507pub struct DeleteClientTlsPolicyRequest {
2508 pub name: std::string::String,
2511
2512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2513}
2514
2515impl DeleteClientTlsPolicyRequest {
2516 pub fn new() -> Self {
2517 std::default::Default::default()
2518 }
2519
2520 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2522 self.name = v.into();
2523 self
2524 }
2525}
2526
2527impl wkt::message::Message for DeleteClientTlsPolicyRequest {
2528 fn typename() -> &'static str {
2529 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
2530 }
2531}
2532
2533#[derive(Clone, Default, PartialEq)]
2535#[non_exhaustive]
2536pub struct OperationMetadata {
2537 pub create_time: std::option::Option<wkt::Timestamp>,
2539
2540 pub end_time: std::option::Option<wkt::Timestamp>,
2542
2543 pub target: std::string::String,
2545
2546 pub verb: std::string::String,
2548
2549 pub status_message: std::string::String,
2551
2552 pub requested_cancellation: bool,
2559
2560 pub api_version: std::string::String,
2562
2563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl OperationMetadata {
2567 pub fn new() -> Self {
2568 std::default::Default::default()
2569 }
2570
2571 pub fn set_create_time<T>(mut self, v: T) -> Self
2573 where
2574 T: std::convert::Into<wkt::Timestamp>,
2575 {
2576 self.create_time = std::option::Option::Some(v.into());
2577 self
2578 }
2579
2580 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2582 where
2583 T: std::convert::Into<wkt::Timestamp>,
2584 {
2585 self.create_time = v.map(|x| x.into());
2586 self
2587 }
2588
2589 pub fn set_end_time<T>(mut self, v: T) -> Self
2591 where
2592 T: std::convert::Into<wkt::Timestamp>,
2593 {
2594 self.end_time = std::option::Option::Some(v.into());
2595 self
2596 }
2597
2598 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2600 where
2601 T: std::convert::Into<wkt::Timestamp>,
2602 {
2603 self.end_time = v.map(|x| x.into());
2604 self
2605 }
2606
2607 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2609 self.target = v.into();
2610 self
2611 }
2612
2613 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2615 self.verb = v.into();
2616 self
2617 }
2618
2619 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2621 self.status_message = v.into();
2622 self
2623 }
2624
2625 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2627 self.requested_cancellation = v.into();
2628 self
2629 }
2630
2631 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2633 self.api_version = v.into();
2634 self
2635 }
2636}
2637
2638impl wkt::message::Message for OperationMetadata {
2639 fn typename() -> &'static str {
2640 "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
2641 }
2642}
2643
2644#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct ServerTlsPolicy {
2650 pub name: std::string::String,
2653
2654 pub description: std::string::String,
2656
2657 pub create_time: std::option::Option<wkt::Timestamp>,
2659
2660 pub update_time: std::option::Option<wkt::Timestamp>,
2662
2663 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2665
2666 pub allow_open: bool,
2676
2677 pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
2681
2682 pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
2688
2689 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2690}
2691
2692impl ServerTlsPolicy {
2693 pub fn new() -> Self {
2694 std::default::Default::default()
2695 }
2696
2697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2699 self.name = v.into();
2700 self
2701 }
2702
2703 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.description = v.into();
2706 self
2707 }
2708
2709 pub fn set_create_time<T>(mut self, v: T) -> Self
2711 where
2712 T: std::convert::Into<wkt::Timestamp>,
2713 {
2714 self.create_time = std::option::Option::Some(v.into());
2715 self
2716 }
2717
2718 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2720 where
2721 T: std::convert::Into<wkt::Timestamp>,
2722 {
2723 self.create_time = v.map(|x| x.into());
2724 self
2725 }
2726
2727 pub fn set_update_time<T>(mut self, v: T) -> Self
2729 where
2730 T: std::convert::Into<wkt::Timestamp>,
2731 {
2732 self.update_time = std::option::Option::Some(v.into());
2733 self
2734 }
2735
2736 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2738 where
2739 T: std::convert::Into<wkt::Timestamp>,
2740 {
2741 self.update_time = v.map(|x| x.into());
2742 self
2743 }
2744
2745 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2747 where
2748 T: std::iter::IntoIterator<Item = (K, V)>,
2749 K: std::convert::Into<std::string::String>,
2750 V: std::convert::Into<std::string::String>,
2751 {
2752 use std::iter::Iterator;
2753 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2754 self
2755 }
2756
2757 pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2759 self.allow_open = v.into();
2760 self
2761 }
2762
2763 pub fn set_server_certificate<T>(mut self, v: T) -> Self
2765 where
2766 T: std::convert::Into<crate::model::CertificateProvider>,
2767 {
2768 self.server_certificate = std::option::Option::Some(v.into());
2769 self
2770 }
2771
2772 pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
2774 where
2775 T: std::convert::Into<crate::model::CertificateProvider>,
2776 {
2777 self.server_certificate = v.map(|x| x.into());
2778 self
2779 }
2780
2781 pub fn set_mtls_policy<T>(mut self, v: T) -> Self
2783 where
2784 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
2785 {
2786 self.mtls_policy = std::option::Option::Some(v.into());
2787 self
2788 }
2789
2790 pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
2792 where
2793 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
2794 {
2795 self.mtls_policy = v.map(|x| x.into());
2796 self
2797 }
2798}
2799
2800impl wkt::message::Message for ServerTlsPolicy {
2801 fn typename() -> &'static str {
2802 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
2803 }
2804}
2805
2806pub mod server_tls_policy {
2808 #[allow(unused_imports)]
2809 use super::*;
2810
2811 #[derive(Clone, Default, PartialEq)]
2813 #[non_exhaustive]
2814 pub struct MTLSPolicy {
2815 pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
2818
2819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2820 }
2821
2822 impl MTLSPolicy {
2823 pub fn new() -> Self {
2824 std::default::Default::default()
2825 }
2826
2827 pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
2829 where
2830 T: std::iter::IntoIterator<Item = V>,
2831 V: std::convert::Into<crate::model::ValidationCA>,
2832 {
2833 use std::iter::Iterator;
2834 self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
2835 self
2836 }
2837 }
2838
2839 impl wkt::message::Message for MTLSPolicy {
2840 fn typename() -> &'static str {
2841 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
2842 }
2843 }
2844}
2845
2846#[derive(Clone, Default, PartialEq)]
2848#[non_exhaustive]
2849pub struct ListServerTlsPoliciesRequest {
2850 pub parent: std::string::String,
2853
2854 pub page_size: i32,
2856
2857 pub page_token: std::string::String,
2862
2863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864}
2865
2866impl ListServerTlsPoliciesRequest {
2867 pub fn new() -> Self {
2868 std::default::Default::default()
2869 }
2870
2871 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873 self.parent = v.into();
2874 self
2875 }
2876
2877 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2879 self.page_size = v.into();
2880 self
2881 }
2882
2883 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2885 self.page_token = v.into();
2886 self
2887 }
2888}
2889
2890impl wkt::message::Message for ListServerTlsPoliciesRequest {
2891 fn typename() -> &'static str {
2892 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
2893 }
2894}
2895
2896#[derive(Clone, Default, PartialEq)]
2898#[non_exhaustive]
2899pub struct ListServerTlsPoliciesResponse {
2900 pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
2902
2903 pub next_page_token: std::string::String,
2907
2908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2909}
2910
2911impl ListServerTlsPoliciesResponse {
2912 pub fn new() -> Self {
2913 std::default::Default::default()
2914 }
2915
2916 pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
2918 where
2919 T: std::iter::IntoIterator<Item = V>,
2920 V: std::convert::Into<crate::model::ServerTlsPolicy>,
2921 {
2922 use std::iter::Iterator;
2923 self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
2924 self
2925 }
2926
2927 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2929 self.next_page_token = v.into();
2930 self
2931 }
2932}
2933
2934impl wkt::message::Message for ListServerTlsPoliciesResponse {
2935 fn typename() -> &'static str {
2936 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
2937 }
2938}
2939
2940#[doc(hidden)]
2941impl gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
2942 type PageItem = crate::model::ServerTlsPolicy;
2943
2944 fn items(self) -> std::vec::Vec<Self::PageItem> {
2945 self.server_tls_policies
2946 }
2947
2948 fn next_page_token(&self) -> std::string::String {
2949 use std::clone::Clone;
2950 self.next_page_token.clone()
2951 }
2952}
2953
2954#[derive(Clone, Default, PartialEq)]
2956#[non_exhaustive]
2957pub struct GetServerTlsPolicyRequest {
2958 pub name: std::string::String,
2961
2962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2963}
2964
2965impl GetServerTlsPolicyRequest {
2966 pub fn new() -> Self {
2967 std::default::Default::default()
2968 }
2969
2970 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2972 self.name = v.into();
2973 self
2974 }
2975}
2976
2977impl wkt::message::Message for GetServerTlsPolicyRequest {
2978 fn typename() -> &'static str {
2979 "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
2980 }
2981}
2982
2983#[derive(Clone, Default, PartialEq)]
2985#[non_exhaustive]
2986pub struct CreateServerTlsPolicyRequest {
2987 pub parent: std::string::String,
2990
2991 pub server_tls_policy_id: std::string::String,
2995
2996 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
2998
2999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3000}
3001
3002impl CreateServerTlsPolicyRequest {
3003 pub fn new() -> Self {
3004 std::default::Default::default()
3005 }
3006
3007 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.parent = v.into();
3010 self
3011 }
3012
3013 pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
3015 mut self,
3016 v: T,
3017 ) -> Self {
3018 self.server_tls_policy_id = v.into();
3019 self
3020 }
3021
3022 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
3024 where
3025 T: std::convert::Into<crate::model::ServerTlsPolicy>,
3026 {
3027 self.server_tls_policy = std::option::Option::Some(v.into());
3028 self
3029 }
3030
3031 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
3033 where
3034 T: std::convert::Into<crate::model::ServerTlsPolicy>,
3035 {
3036 self.server_tls_policy = v.map(|x| x.into());
3037 self
3038 }
3039}
3040
3041impl wkt::message::Message for CreateServerTlsPolicyRequest {
3042 fn typename() -> &'static str {
3043 "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
3044 }
3045}
3046
3047#[derive(Clone, Default, PartialEq)]
3049#[non_exhaustive]
3050pub struct UpdateServerTlsPolicyRequest {
3051 pub update_mask: std::option::Option<wkt::FieldMask>,
3058
3059 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
3061
3062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3063}
3064
3065impl UpdateServerTlsPolicyRequest {
3066 pub fn new() -> Self {
3067 std::default::Default::default()
3068 }
3069
3070 pub fn set_update_mask<T>(mut self, v: T) -> Self
3072 where
3073 T: std::convert::Into<wkt::FieldMask>,
3074 {
3075 self.update_mask = std::option::Option::Some(v.into());
3076 self
3077 }
3078
3079 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3081 where
3082 T: std::convert::Into<wkt::FieldMask>,
3083 {
3084 self.update_mask = v.map(|x| x.into());
3085 self
3086 }
3087
3088 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
3090 where
3091 T: std::convert::Into<crate::model::ServerTlsPolicy>,
3092 {
3093 self.server_tls_policy = std::option::Option::Some(v.into());
3094 self
3095 }
3096
3097 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
3099 where
3100 T: std::convert::Into<crate::model::ServerTlsPolicy>,
3101 {
3102 self.server_tls_policy = v.map(|x| x.into());
3103 self
3104 }
3105}
3106
3107impl wkt::message::Message for UpdateServerTlsPolicyRequest {
3108 fn typename() -> &'static str {
3109 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
3110 }
3111}
3112
3113#[derive(Clone, Default, PartialEq)]
3115#[non_exhaustive]
3116pub struct DeleteServerTlsPolicyRequest {
3117 pub name: std::string::String,
3120
3121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3122}
3123
3124impl DeleteServerTlsPolicyRequest {
3125 pub fn new() -> Self {
3126 std::default::Default::default()
3127 }
3128
3129 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131 self.name = v.into();
3132 self
3133 }
3134}
3135
3136impl wkt::message::Message for DeleteServerTlsPolicyRequest {
3137 fn typename() -> &'static str {
3138 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
3139 }
3140}
3141
3142#[derive(Clone, Default, PartialEq)]
3144#[non_exhaustive]
3145pub struct GrpcEndpoint {
3146 pub target_uri: std::string::String,
3149
3150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3151}
3152
3153impl GrpcEndpoint {
3154 pub fn new() -> Self {
3155 std::default::Default::default()
3156 }
3157
3158 pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.target_uri = v.into();
3161 self
3162 }
3163}
3164
3165impl wkt::message::Message for GrpcEndpoint {
3166 fn typename() -> &'static str {
3167 "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
3168 }
3169}
3170
3171#[derive(Clone, Default, PartialEq)]
3174#[non_exhaustive]
3175pub struct ValidationCA {
3176 pub r#type: std::option::Option<crate::model::validation_ca::Type>,
3178
3179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3180}
3181
3182impl ValidationCA {
3183 pub fn new() -> Self {
3184 std::default::Default::default()
3185 }
3186
3187 pub fn set_type<
3192 T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
3193 >(
3194 mut self,
3195 v: T,
3196 ) -> Self {
3197 self.r#type = v.into();
3198 self
3199 }
3200
3201 pub fn grpc_endpoint(
3205 &self,
3206 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
3207 #[allow(unreachable_patterns)]
3208 self.r#type.as_ref().and_then(|v| match v {
3209 crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
3210 _ => std::option::Option::None,
3211 })
3212 }
3213
3214 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
3220 mut self,
3221 v: T,
3222 ) -> Self {
3223 self.r#type =
3224 std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
3225 self
3226 }
3227
3228 pub fn certificate_provider_instance(
3232 &self,
3233 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
3234 #[allow(unreachable_patterns)]
3235 self.r#type.as_ref().and_then(|v| match v {
3236 crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
3237 std::option::Option::Some(v)
3238 }
3239 _ => std::option::Option::None,
3240 })
3241 }
3242
3243 pub fn set_certificate_provider_instance<
3249 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
3250 >(
3251 mut self,
3252 v: T,
3253 ) -> Self {
3254 self.r#type = std::option::Option::Some(
3255 crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
3256 );
3257 self
3258 }
3259}
3260
3261impl wkt::message::Message for ValidationCA {
3262 fn typename() -> &'static str {
3263 "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
3264 }
3265}
3266
3267pub mod validation_ca {
3269 #[allow(unused_imports)]
3270 use super::*;
3271
3272 #[derive(Clone, Debug, PartialEq)]
3274 #[non_exhaustive]
3275 pub enum Type {
3276 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
3279 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
3283 }
3284}
3285
3286#[derive(Clone, Default, PartialEq)]
3291#[non_exhaustive]
3292pub struct CertificateProviderInstance {
3293 pub plugin_instance: std::string::String,
3297
3298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3299}
3300
3301impl CertificateProviderInstance {
3302 pub fn new() -> Self {
3303 std::default::Default::default()
3304 }
3305
3306 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3308 self.plugin_instance = v.into();
3309 self
3310 }
3311}
3312
3313impl wkt::message::Message for CertificateProviderInstance {
3314 fn typename() -> &'static str {
3315 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
3316 }
3317}
3318
3319#[derive(Clone, Default, PartialEq)]
3322#[non_exhaustive]
3323pub struct CertificateProvider {
3324 pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
3327
3328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3329}
3330
3331impl CertificateProvider {
3332 pub fn new() -> Self {
3333 std::default::Default::default()
3334 }
3335
3336 pub fn set_type<
3341 T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
3342 >(
3343 mut self,
3344 v: T,
3345 ) -> Self {
3346 self.r#type = v.into();
3347 self
3348 }
3349
3350 pub fn grpc_endpoint(
3354 &self,
3355 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
3356 #[allow(unreachable_patterns)]
3357 self.r#type.as_ref().and_then(|v| match v {
3358 crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
3359 std::option::Option::Some(v)
3360 }
3361 _ => std::option::Option::None,
3362 })
3363 }
3364
3365 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
3371 mut self,
3372 v: T,
3373 ) -> Self {
3374 self.r#type = std::option::Option::Some(
3375 crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
3376 );
3377 self
3378 }
3379
3380 pub fn certificate_provider_instance(
3384 &self,
3385 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
3386 #[allow(unreachable_patterns)]
3387 self.r#type.as_ref().and_then(|v| match v {
3388 crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
3389 std::option::Option::Some(v)
3390 }
3391 _ => std::option::Option::None,
3392 })
3393 }
3394
3395 pub fn set_certificate_provider_instance<
3401 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
3402 >(
3403 mut self,
3404 v: T,
3405 ) -> Self {
3406 self.r#type = std::option::Option::Some(
3407 crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
3408 );
3409 self
3410 }
3411}
3412
3413impl wkt::message::Message for CertificateProvider {
3414 fn typename() -> &'static str {
3415 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
3416 }
3417}
3418
3419pub mod certificate_provider {
3421 #[allow(unused_imports)]
3422 use super::*;
3423
3424 #[derive(Clone, Debug, PartialEq)]
3427 #[non_exhaustive]
3428 pub enum Type {
3429 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
3432 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
3436 }
3437}