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 gtype;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct PolicyRule {
42 #[serde(skip_serializing_if = "std::option::Option::is_none")]
55 pub condition: std::option::Option<gtype::model::Expr>,
56
57 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
58 pub kind: std::option::Option<crate::model::policy_rule::Kind>,
59}
60
61impl PolicyRule {
62 pub fn new() -> Self {
63 std::default::Default::default()
64 }
65
66 pub fn set_condition<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
68 mut self,
69 v: T,
70 ) -> Self {
71 self.condition = v.into();
72 self
73 }
74
75 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Kind>>>(
77 mut self,
78 v: T,
79 ) -> Self {
80 self.kind = v.into();
81 self
82 }
83
84 pub fn get_values(
88 &self,
89 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_rule::StringValues>> {
90 #[allow(unreachable_patterns)]
91 self.kind.as_ref().and_then(|v| match v {
92 crate::model::policy_rule::Kind::Values(v) => std::option::Option::Some(v),
93 _ => std::option::Option::None,
94 })
95 }
96
97 pub fn get_allow_all(&self) -> std::option::Option<&bool> {
101 #[allow(unreachable_patterns)]
102 self.kind.as_ref().and_then(|v| match v {
103 crate::model::policy_rule::Kind::AllowAll(v) => std::option::Option::Some(v),
104 _ => std::option::Option::None,
105 })
106 }
107
108 pub fn get_deny_all(&self) -> std::option::Option<&bool> {
112 #[allow(unreachable_patterns)]
113 self.kind.as_ref().and_then(|v| match v {
114 crate::model::policy_rule::Kind::DenyAll(v) => std::option::Option::Some(v),
115 _ => std::option::Option::None,
116 })
117 }
118
119 pub fn get_enforce(&self) -> std::option::Option<&bool> {
123 #[allow(unreachable_patterns)]
124 self.kind.as_ref().and_then(|v| match v {
125 crate::model::policy_rule::Kind::Enforce(v) => std::option::Option::Some(v),
126 _ => std::option::Option::None,
127 })
128 }
129
130 pub fn set_values<
136 T: std::convert::Into<std::boxed::Box<crate::model::policy_rule::StringValues>>,
137 >(
138 mut self,
139 v: T,
140 ) -> Self {
141 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Values(v.into()));
142 self
143 }
144
145 pub fn set_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
151 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::AllowAll(v.into()));
152 self
153 }
154
155 pub fn set_deny_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
161 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::DenyAll(v.into()));
162 self
163 }
164
165 pub fn set_enforce<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
171 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Enforce(v.into()));
172 self
173 }
174}
175
176impl wkt::message::Message for PolicyRule {
177 fn typename() -> &'static str {
178 "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule"
179 }
180}
181
182pub mod policy_rule {
184 #[allow(unused_imports)]
185 use super::*;
186
187 #[serde_with::serde_as]
205 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
206 #[serde(default, rename_all = "camelCase")]
207 #[non_exhaustive]
208 pub struct StringValues {
209 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
211 pub allowed_values: std::vec::Vec<std::string::String>,
212
213 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
215 pub denied_values: std::vec::Vec<std::string::String>,
216 }
217
218 impl StringValues {
219 pub fn new() -> Self {
220 std::default::Default::default()
221 }
222
223 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
225 where
226 T: std::iter::IntoIterator<Item = V>,
227 V: std::convert::Into<std::string::String>,
228 {
229 use std::iter::Iterator;
230 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
231 self
232 }
233
234 pub fn set_denied_values<T, V>(mut self, v: T) -> Self
236 where
237 T: std::iter::IntoIterator<Item = V>,
238 V: std::convert::Into<std::string::String>,
239 {
240 use std::iter::Iterator;
241 self.denied_values = v.into_iter().map(|i| i.into()).collect();
242 self
243 }
244 }
245
246 impl wkt::message::Message for StringValues {
247 fn typename() -> &'static str {
248 "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule.StringValues"
249 }
250 }
251
252 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
253 #[serde(rename_all = "camelCase")]
254 #[non_exhaustive]
255 pub enum Kind {
256 Values(std::boxed::Box<crate::model::policy_rule::StringValues>),
259 AllowAll(bool),
262 DenyAll(bool),
265 Enforce(bool),
269 }
270}
271
272#[serde_with::serde_as]
279#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
280#[serde(default, rename_all = "camelCase")]
281#[non_exhaustive]
282pub struct CustomConstraint {
283 #[serde(skip_serializing_if = "std::string::String::is_empty")]
294 pub name: std::string::String,
295
296 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
301 pub resource_types: std::vec::Vec<std::string::String>,
302
303 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
305 pub method_types: std::vec::Vec<crate::model::custom_constraint::MethodType>,
306
307 #[serde(skip_serializing_if = "std::string::String::is_empty")]
313 pub condition: std::string::String,
314
315 pub action_type: crate::model::custom_constraint::ActionType,
317
318 #[serde(skip_serializing_if = "std::string::String::is_empty")]
321 pub display_name: std::string::String,
322
323 #[serde(skip_serializing_if = "std::string::String::is_empty")]
326 pub description: std::string::String,
327
328 #[serde(skip_serializing_if = "std::option::Option::is_none")]
332 pub update_time: std::option::Option<wkt::Timestamp>,
333}
334
335impl CustomConstraint {
336 pub fn new() -> Self {
337 std::default::Default::default()
338 }
339
340 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
342 self.name = v.into();
343 self
344 }
345
346 pub fn set_condition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
348 self.condition = v.into();
349 self
350 }
351
352 pub fn set_action_type<T: std::convert::Into<crate::model::custom_constraint::ActionType>>(
354 mut self,
355 v: T,
356 ) -> Self {
357 self.action_type = v.into();
358 self
359 }
360
361 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363 self.display_name = v.into();
364 self
365 }
366
367 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
369 self.description = v.into();
370 self
371 }
372
373 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
375 mut self,
376 v: T,
377 ) -> Self {
378 self.update_time = v.into();
379 self
380 }
381
382 pub fn set_resource_types<T, V>(mut self, v: T) -> Self
384 where
385 T: std::iter::IntoIterator<Item = V>,
386 V: std::convert::Into<std::string::String>,
387 {
388 use std::iter::Iterator;
389 self.resource_types = v.into_iter().map(|i| i.into()).collect();
390 self
391 }
392
393 pub fn set_method_types<T, V>(mut self, v: T) -> Self
395 where
396 T: std::iter::IntoIterator<Item = V>,
397 V: std::convert::Into<crate::model::custom_constraint::MethodType>,
398 {
399 use std::iter::Iterator;
400 self.method_types = v.into_iter().map(|i| i.into()).collect();
401 self
402 }
403}
404
405impl wkt::message::Message for CustomConstraint {
406 fn typename() -> &'static str {
407 "type.googleapis.com/google.cloud.securityposture.v1.CustomConstraint"
408 }
409}
410
411pub mod custom_constraint {
413 #[allow(unused_imports)]
414 use super::*;
415
416 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
424 pub struct MethodType(std::borrow::Cow<'static, str>);
425
426 impl MethodType {
427 pub const fn new(v: &'static str) -> Self {
429 Self(std::borrow::Cow::Borrowed(v))
430 }
431
432 pub fn value(&self) -> &str {
434 &self.0
435 }
436 }
437
438 pub mod method_type {
440 use super::MethodType;
441
442 pub const METHOD_TYPE_UNSPECIFIED: MethodType = MethodType::new("METHOD_TYPE_UNSPECIFIED");
444
445 pub const CREATE: MethodType = MethodType::new("CREATE");
447
448 pub const UPDATE: MethodType = MethodType::new("UPDATE");
450
451 pub const DELETE: MethodType = MethodType::new("DELETE");
454 }
455
456 impl std::convert::From<std::string::String> for MethodType {
457 fn from(value: std::string::String) -> Self {
458 Self(std::borrow::Cow::Owned(value))
459 }
460 }
461
462 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
464 pub struct ActionType(std::borrow::Cow<'static, str>);
465
466 impl ActionType {
467 pub const fn new(v: &'static str) -> Self {
469 Self(std::borrow::Cow::Borrowed(v))
470 }
471
472 pub fn value(&self) -> &str {
474 &self.0
475 }
476 }
477
478 pub mod action_type {
480 use super::ActionType;
481
482 pub const ACTION_TYPE_UNSPECIFIED: ActionType = ActionType::new("ACTION_TYPE_UNSPECIFIED");
484
485 pub const ALLOW: ActionType = ActionType::new("ALLOW");
487
488 pub const DENY: ActionType = ActionType::new("DENY");
490 }
491
492 impl std::convert::From<std::string::String> for ActionType {
493 fn from(value: std::string::String) -> Self {
494 Self(std::borrow::Cow::Owned(value))
495 }
496 }
497}
498
499#[serde_with::serde_as]
501#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
502#[serde(default, rename_all = "camelCase")]
503#[non_exhaustive]
504pub struct OrgPolicyConstraint {
505 #[serde(skip_serializing_if = "std::string::String::is_empty")]
507 pub canned_constraint_id: std::string::String,
508
509 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
511 pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
512}
513
514impl OrgPolicyConstraint {
515 pub fn new() -> Self {
516 std::default::Default::default()
517 }
518
519 pub fn set_canned_constraint_id<T: std::convert::Into<std::string::String>>(
521 mut self,
522 v: T,
523 ) -> Self {
524 self.canned_constraint_id = v.into();
525 self
526 }
527
528 pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
530 where
531 T: std::iter::IntoIterator<Item = V>,
532 V: std::convert::Into<crate::model::PolicyRule>,
533 {
534 use std::iter::Iterator;
535 self.policy_rules = v.into_iter().map(|i| i.into()).collect();
536 self
537 }
538}
539
540impl wkt::message::Message for OrgPolicyConstraint {
541 fn typename() -> &'static str {
542 "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraint"
543 }
544}
545
546#[serde_with::serde_as]
548#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
549#[serde(default, rename_all = "camelCase")]
550#[non_exhaustive]
551pub struct OrgPolicyConstraintCustom {
552 #[serde(skip_serializing_if = "std::option::Option::is_none")]
554 pub custom_constraint: std::option::Option<crate::model::CustomConstraint>,
555
556 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
558 pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
559}
560
561impl OrgPolicyConstraintCustom {
562 pub fn new() -> Self {
563 std::default::Default::default()
564 }
565
566 pub fn set_custom_constraint<
568 T: std::convert::Into<std::option::Option<crate::model::CustomConstraint>>,
569 >(
570 mut self,
571 v: T,
572 ) -> Self {
573 self.custom_constraint = v.into();
574 self
575 }
576
577 pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
579 where
580 T: std::iter::IntoIterator<Item = V>,
581 V: std::convert::Into<crate::model::PolicyRule>,
582 {
583 use std::iter::Iterator;
584 self.policy_rules = v.into_iter().map(|i| i.into()).collect();
585 self
586 }
587}
588
589impl wkt::message::Message for OrgPolicyConstraintCustom {
590 fn typename() -> &'static str {
591 "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraintCustom"
592 }
593}
594
595#[serde_with::serde_as]
597#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
598#[serde(default, rename_all = "camelCase")]
599#[non_exhaustive]
600pub struct OperationMetadata {
601 #[serde(skip_serializing_if = "std::option::Option::is_none")]
603 pub create_time: std::option::Option<wkt::Timestamp>,
604
605 #[serde(skip_serializing_if = "std::option::Option::is_none")]
607 pub end_time: std::option::Option<wkt::Timestamp>,
608
609 #[serde(skip_serializing_if = "std::string::String::is_empty")]
611 pub target: std::string::String,
612
613 #[serde(skip_serializing_if = "std::string::String::is_empty")]
615 pub verb: std::string::String,
616
617 #[serde(skip_serializing_if = "std::string::String::is_empty")]
619 pub status_message: std::string::String,
620
621 pub requested_cancellation: bool,
629
630 #[serde(skip_serializing_if = "std::string::String::is_empty")]
632 pub api_version: std::string::String,
633
634 #[serde(skip_serializing_if = "std::string::String::is_empty")]
638 pub error_message: std::string::String,
639}
640
641impl OperationMetadata {
642 pub fn new() -> Self {
643 std::default::Default::default()
644 }
645
646 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
648 mut self,
649 v: T,
650 ) -> Self {
651 self.create_time = v.into();
652 self
653 }
654
655 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
657 mut self,
658 v: T,
659 ) -> Self {
660 self.end_time = v.into();
661 self
662 }
663
664 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
666 self.target = v.into();
667 self
668 }
669
670 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672 self.verb = v.into();
673 self
674 }
675
676 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
678 self.status_message = v.into();
679 self
680 }
681
682 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
684 self.requested_cancellation = v.into();
685 self
686 }
687
688 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690 self.api_version = v.into();
691 self
692 }
693
694 pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696 self.error_message = v.into();
697 self
698 }
699}
700
701impl wkt::message::Message for OperationMetadata {
702 fn typename() -> &'static str {
703 "type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata"
704 }
705}
706
707#[serde_with::serde_as]
710#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
711#[serde(default, rename_all = "camelCase")]
712#[non_exhaustive]
713pub struct Posture {
714 #[serde(skip_serializing_if = "std::string::String::is_empty")]
717 pub name: std::string::String,
718
719 pub state: crate::model::posture::State,
721
722 #[serde(skip_serializing_if = "std::string::String::is_empty")]
726 pub revision_id: std::string::String,
727
728 #[serde(skip_serializing_if = "std::option::Option::is_none")]
730 pub create_time: std::option::Option<wkt::Timestamp>,
731
732 #[serde(skip_serializing_if = "std::option::Option::is_none")]
734 pub update_time: std::option::Option<wkt::Timestamp>,
735
736 #[serde(skip_serializing_if = "std::string::String::is_empty")]
738 pub description: std::string::String,
739
740 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
742 pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
743
744 #[serde(skip_serializing_if = "std::string::String::is_empty")]
755 pub etag: std::string::String,
756
757 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
761 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
762
763 pub reconciling: bool,
766}
767
768impl Posture {
769 pub fn new() -> Self {
770 std::default::Default::default()
771 }
772
773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775 self.name = v.into();
776 self
777 }
778
779 pub fn set_state<T: std::convert::Into<crate::model::posture::State>>(mut self, v: T) -> Self {
781 self.state = v.into();
782 self
783 }
784
785 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
787 self.revision_id = v.into();
788 self
789 }
790
791 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
793 mut self,
794 v: T,
795 ) -> Self {
796 self.create_time = v.into();
797 self
798 }
799
800 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
802 mut self,
803 v: T,
804 ) -> Self {
805 self.update_time = v.into();
806 self
807 }
808
809 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811 self.description = v.into();
812 self
813 }
814
815 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
817 self.etag = v.into();
818 self
819 }
820
821 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
823 self.reconciling = v.into();
824 self
825 }
826
827 pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
829 where
830 T: std::iter::IntoIterator<Item = V>,
831 V: std::convert::Into<crate::model::PolicySet>,
832 {
833 use std::iter::Iterator;
834 self.policy_sets = v.into_iter().map(|i| i.into()).collect();
835 self
836 }
837
838 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
840 where
841 T: std::iter::IntoIterator<Item = (K, V)>,
842 K: std::convert::Into<std::string::String>,
843 V: std::convert::Into<std::string::String>,
844 {
845 use std::iter::Iterator;
846 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
847 self
848 }
849}
850
851impl wkt::message::Message for Posture {
852 fn typename() -> &'static str {
853 "type.googleapis.com/google.cloud.securityposture.v1.Posture"
854 }
855}
856
857pub mod posture {
859 #[allow(unused_imports)]
860 use super::*;
861
862 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
864 pub struct State(std::borrow::Cow<'static, str>);
865
866 impl State {
867 pub const fn new(v: &'static str) -> Self {
869 Self(std::borrow::Cow::Borrowed(v))
870 }
871
872 pub fn value(&self) -> &str {
874 &self.0
875 }
876 }
877
878 pub mod state {
880 use super::State;
881
882 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
884
885 pub const DEPRECATED: State = State::new("DEPRECATED");
887
888 pub const DRAFT: State = State::new("DRAFT");
890
891 pub const ACTIVE: State = State::new("ACTIVE");
893 }
894
895 impl std::convert::From<std::string::String> for State {
896 fn from(value: std::string::String) -> Self {
897 Self(std::borrow::Cow::Owned(value))
898 }
899 }
900}
901
902#[serde_with::serde_as]
904#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
905#[serde(default, rename_all = "camelCase")]
906#[non_exhaustive]
907pub struct PolicySet {
908 #[serde(skip_serializing_if = "std::string::String::is_empty")]
910 pub policy_set_id: std::string::String,
911
912 #[serde(skip_serializing_if = "std::string::String::is_empty")]
914 pub description: std::string::String,
915
916 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
918 pub policies: std::vec::Vec<crate::model::Policy>,
919}
920
921impl PolicySet {
922 pub fn new() -> Self {
923 std::default::Default::default()
924 }
925
926 pub fn set_policy_set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
928 self.policy_set_id = v.into();
929 self
930 }
931
932 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
934 self.description = v.into();
935 self
936 }
937
938 pub fn set_policies<T, V>(mut self, v: T) -> Self
940 where
941 T: std::iter::IntoIterator<Item = V>,
942 V: std::convert::Into<crate::model::Policy>,
943 {
944 use std::iter::Iterator;
945 self.policies = v.into_iter().map(|i| i.into()).collect();
946 self
947 }
948}
949
950impl wkt::message::Message for PolicySet {
951 fn typename() -> &'static str {
952 "type.googleapis.com/google.cloud.securityposture.v1.PolicySet"
953 }
954}
955
956#[serde_with::serde_as]
958#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
959#[serde(default, rename_all = "camelCase")]
960#[non_exhaustive]
961pub struct Policy {
962 #[serde(skip_serializing_if = "std::string::String::is_empty")]
965 pub policy_id: std::string::String,
966
967 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
969 pub compliance_standards: std::vec::Vec<crate::model::policy::ComplianceStandard>,
970
971 #[serde(skip_serializing_if = "std::option::Option::is_none")]
973 pub constraint: std::option::Option<crate::model::Constraint>,
974
975 #[serde(skip_serializing_if = "std::string::String::is_empty")]
977 pub description: std::string::String,
978}
979
980impl Policy {
981 pub fn new() -> Self {
982 std::default::Default::default()
983 }
984
985 pub fn set_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
987 self.policy_id = v.into();
988 self
989 }
990
991 pub fn set_constraint<T: std::convert::Into<std::option::Option<crate::model::Constraint>>>(
993 mut self,
994 v: T,
995 ) -> Self {
996 self.constraint = v.into();
997 self
998 }
999
1000 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.description = v.into();
1003 self
1004 }
1005
1006 pub fn set_compliance_standards<T, V>(mut self, v: T) -> Self
1008 where
1009 T: std::iter::IntoIterator<Item = V>,
1010 V: std::convert::Into<crate::model::policy::ComplianceStandard>,
1011 {
1012 use std::iter::Iterator;
1013 self.compliance_standards = v.into_iter().map(|i| i.into()).collect();
1014 self
1015 }
1016}
1017
1018impl wkt::message::Message for Policy {
1019 fn typename() -> &'static str {
1020 "type.googleapis.com/google.cloud.securityposture.v1.Policy"
1021 }
1022}
1023
1024pub mod policy {
1026 #[allow(unused_imports)]
1027 use super::*;
1028
1029 #[serde_with::serde_as]
1031 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1032 #[serde(default, rename_all = "camelCase")]
1033 #[non_exhaustive]
1034 pub struct ComplianceStandard {
1035 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1037 pub standard: std::string::String,
1038
1039 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1041 pub control: std::string::String,
1042 }
1043
1044 impl ComplianceStandard {
1045 pub fn new() -> Self {
1046 std::default::Default::default()
1047 }
1048
1049 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.standard = v.into();
1052 self
1053 }
1054
1055 pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.control = v.into();
1058 self
1059 }
1060 }
1061
1062 impl wkt::message::Message for ComplianceStandard {
1063 fn typename() -> &'static str {
1064 "type.googleapis.com/google.cloud.securityposture.v1.Policy.ComplianceStandard"
1065 }
1066 }
1067}
1068
1069#[serde_with::serde_as]
1071#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1072#[serde(default, rename_all = "camelCase")]
1073#[non_exhaustive]
1074pub struct Constraint {
1075 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1076 pub implementation: std::option::Option<crate::model::constraint::Implementation>,
1077}
1078
1079impl Constraint {
1080 pub fn new() -> Self {
1081 std::default::Default::default()
1082 }
1083
1084 pub fn set_implementation<
1086 T: std::convert::Into<std::option::Option<crate::model::constraint::Implementation>>,
1087 >(
1088 mut self,
1089 v: T,
1090 ) -> Self {
1091 self.implementation = v.into();
1092 self
1093 }
1094
1095 pub fn get_security_health_analytics_module(
1099 &self,
1100 ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>> {
1101 #[allow(unreachable_patterns)]
1102 self.implementation.as_ref().and_then(|v| match v {
1103 crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v) => {
1104 std::option::Option::Some(v)
1105 }
1106 _ => std::option::Option::None,
1107 })
1108 }
1109
1110 pub fn get_security_health_analytics_custom_module(
1114 &self,
1115 ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>
1116 {
1117 #[allow(unreachable_patterns)]
1118 self.implementation.as_ref().and_then(|v| match v {
1119 crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v) => {
1120 std::option::Option::Some(v)
1121 }
1122 _ => std::option::Option::None,
1123 })
1124 }
1125
1126 pub fn get_org_policy_constraint(
1130 &self,
1131 ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraint>> {
1132 #[allow(unreachable_patterns)]
1133 self.implementation.as_ref().and_then(|v| match v {
1134 crate::model::constraint::Implementation::OrgPolicyConstraint(v) => {
1135 std::option::Option::Some(v)
1136 }
1137 _ => std::option::Option::None,
1138 })
1139 }
1140
1141 pub fn get_org_policy_constraint_custom(
1145 &self,
1146 ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraintCustom>> {
1147 #[allow(unreachable_patterns)]
1148 self.implementation.as_ref().and_then(|v| match v {
1149 crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v) => {
1150 std::option::Option::Some(v)
1151 }
1152 _ => std::option::Option::None,
1153 })
1154 }
1155
1156 pub fn set_security_health_analytics_module<
1162 T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>>,
1163 >(
1164 mut self,
1165 v: T,
1166 ) -> Self {
1167 self.implementation = std::option::Option::Some(
1168 crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v.into()),
1169 );
1170 self
1171 }
1172
1173 pub fn set_security_health_analytics_custom_module<
1179 T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>,
1180 >(
1181 mut self,
1182 v: T,
1183 ) -> Self {
1184 self.implementation = std::option::Option::Some(
1185 crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v.into()),
1186 );
1187 self
1188 }
1189
1190 pub fn set_org_policy_constraint<
1196 T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraint>>,
1197 >(
1198 mut self,
1199 v: T,
1200 ) -> Self {
1201 self.implementation = std::option::Option::Some(
1202 crate::model::constraint::Implementation::OrgPolicyConstraint(v.into()),
1203 );
1204 self
1205 }
1206
1207 pub fn set_org_policy_constraint_custom<
1213 T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraintCustom>>,
1214 >(
1215 mut self,
1216 v: T,
1217 ) -> Self {
1218 self.implementation = std::option::Option::Some(
1219 crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v.into()),
1220 );
1221 self
1222 }
1223}
1224
1225impl wkt::message::Message for Constraint {
1226 fn typename() -> &'static str {
1227 "type.googleapis.com/google.cloud.securityposture.v1.Constraint"
1228 }
1229}
1230
1231pub mod constraint {
1233 #[allow(unused_imports)]
1234 use super::*;
1235
1236 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1237 #[serde(rename_all = "camelCase")]
1238 #[non_exhaustive]
1239 pub enum Implementation {
1240 SecurityHealthAnalyticsModule(std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>),
1242 SecurityHealthAnalyticsCustomModule(
1244 std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>,
1245 ),
1246 OrgPolicyConstraint(std::boxed::Box<crate::model::OrgPolicyConstraint>),
1248 OrgPolicyConstraintCustom(std::boxed::Box<crate::model::OrgPolicyConstraintCustom>),
1250 }
1251}
1252
1253#[serde_with::serde_as]
1255#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1256#[serde(default, rename_all = "camelCase")]
1257#[non_exhaustive]
1258pub struct ListPosturesRequest {
1259 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1261 pub parent: std::string::String,
1262
1263 pub page_size: i32,
1266
1267 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1269 pub page_token: std::string::String,
1270}
1271
1272impl ListPosturesRequest {
1273 pub fn new() -> Self {
1274 std::default::Default::default()
1275 }
1276
1277 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.parent = v.into();
1280 self
1281 }
1282
1283 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1285 self.page_size = v.into();
1286 self
1287 }
1288
1289 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1291 self.page_token = v.into();
1292 self
1293 }
1294}
1295
1296impl wkt::message::Message for ListPosturesRequest {
1297 fn typename() -> &'static str {
1298 "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesRequest"
1299 }
1300}
1301
1302#[serde_with::serde_as]
1304#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1305#[serde(default, rename_all = "camelCase")]
1306#[non_exhaustive]
1307pub struct ListPosturesResponse {
1308 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1310 pub postures: std::vec::Vec<crate::model::Posture>,
1311
1312 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1314 pub next_page_token: std::string::String,
1315
1316 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1318 pub unreachable: std::vec::Vec<std::string::String>,
1319}
1320
1321impl ListPosturesResponse {
1322 pub fn new() -> Self {
1323 std::default::Default::default()
1324 }
1325
1326 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1328 self.next_page_token = v.into();
1329 self
1330 }
1331
1332 pub fn set_postures<T, V>(mut self, v: T) -> Self
1334 where
1335 T: std::iter::IntoIterator<Item = V>,
1336 V: std::convert::Into<crate::model::Posture>,
1337 {
1338 use std::iter::Iterator;
1339 self.postures = v.into_iter().map(|i| i.into()).collect();
1340 self
1341 }
1342
1343 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1345 where
1346 T: std::iter::IntoIterator<Item = V>,
1347 V: std::convert::Into<std::string::String>,
1348 {
1349 use std::iter::Iterator;
1350 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1351 self
1352 }
1353}
1354
1355impl wkt::message::Message for ListPosturesResponse {
1356 fn typename() -> &'static str {
1357 "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesResponse"
1358 }
1359}
1360
1361#[cfg(feature = "unstable-stream")]
1362impl gax::paginator::PageableResponse for ListPosturesResponse {
1363 type PageItem = crate::model::Posture;
1364
1365 fn items(self) -> std::vec::Vec<Self::PageItem> {
1366 self.postures
1367 }
1368
1369 fn next_page_token(&self) -> std::string::String {
1370 gax::paginator::extract_token(&self.next_page_token)
1371 }
1372}
1373
1374#[serde_with::serde_as]
1376#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1377#[serde(default, rename_all = "camelCase")]
1378#[non_exhaustive]
1379pub struct ListPostureRevisionsRequest {
1380 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1382 pub name: std::string::String,
1383
1384 pub page_size: i32,
1387
1388 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1390 pub page_token: std::string::String,
1391}
1392
1393impl ListPostureRevisionsRequest {
1394 pub fn new() -> Self {
1395 std::default::Default::default()
1396 }
1397
1398 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.name = v.into();
1401 self
1402 }
1403
1404 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1406 self.page_size = v.into();
1407 self
1408 }
1409
1410 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 ListPostureRevisionsRequest {
1418 fn typename() -> &'static str {
1419 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsRequest"
1420 }
1421}
1422
1423#[serde_with::serde_as]
1425#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1426#[serde(default, rename_all = "camelCase")]
1427#[non_exhaustive]
1428pub struct ListPostureRevisionsResponse {
1429 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1431 pub revisions: std::vec::Vec<crate::model::Posture>,
1432
1433 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1435 pub next_page_token: std::string::String,
1436}
1437
1438impl ListPostureRevisionsResponse {
1439 pub fn new() -> Self {
1440 std::default::Default::default()
1441 }
1442
1443 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1445 self.next_page_token = v.into();
1446 self
1447 }
1448
1449 pub fn set_revisions<T, V>(mut self, v: T) -> Self
1451 where
1452 T: std::iter::IntoIterator<Item = V>,
1453 V: std::convert::Into<crate::model::Posture>,
1454 {
1455 use std::iter::Iterator;
1456 self.revisions = v.into_iter().map(|i| i.into()).collect();
1457 self
1458 }
1459}
1460
1461impl wkt::message::Message for ListPostureRevisionsResponse {
1462 fn typename() -> &'static str {
1463 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsResponse"
1464 }
1465}
1466
1467#[cfg(feature = "unstable-stream")]
1468impl gax::paginator::PageableResponse for ListPostureRevisionsResponse {
1469 type PageItem = crate::model::Posture;
1470
1471 fn items(self) -> std::vec::Vec<Self::PageItem> {
1472 self.revisions
1473 }
1474
1475 fn next_page_token(&self) -> std::string::String {
1476 gax::paginator::extract_token(&self.next_page_token)
1477 }
1478}
1479
1480#[serde_with::serde_as]
1482#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1483#[serde(default, rename_all = "camelCase")]
1484#[non_exhaustive]
1485pub struct GetPostureRequest {
1486 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1488 pub name: std::string::String,
1489
1490 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1492 pub revision_id: std::string::String,
1493}
1494
1495impl GetPostureRequest {
1496 pub fn new() -> Self {
1497 std::default::Default::default()
1498 }
1499
1500 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502 self.name = v.into();
1503 self
1504 }
1505
1506 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1508 self.revision_id = v.into();
1509 self
1510 }
1511}
1512
1513impl wkt::message::Message for GetPostureRequest {
1514 fn typename() -> &'static str {
1515 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureRequest"
1516 }
1517}
1518
1519#[serde_with::serde_as]
1521#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1522#[serde(default, rename_all = "camelCase")]
1523#[non_exhaustive]
1524pub struct CreatePostureRequest {
1525 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1527 pub parent: std::string::String,
1528
1529 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1532 pub posture_id: std::string::String,
1533
1534 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1536 pub posture: std::option::Option<crate::model::Posture>,
1537}
1538
1539impl CreatePostureRequest {
1540 pub fn new() -> Self {
1541 std::default::Default::default()
1542 }
1543
1544 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.parent = v.into();
1547 self
1548 }
1549
1550 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1552 self.posture_id = v.into();
1553 self
1554 }
1555
1556 pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1558 mut self,
1559 v: T,
1560 ) -> Self {
1561 self.posture = v.into();
1562 self
1563 }
1564}
1565
1566impl wkt::message::Message for CreatePostureRequest {
1567 fn typename() -> &'static str {
1568 "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureRequest"
1569 }
1570}
1571
1572#[serde_with::serde_as]
1574#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1575#[serde(default, rename_all = "camelCase")]
1576#[non_exhaustive]
1577pub struct UpdatePostureRequest {
1578 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1584 pub update_mask: std::option::Option<wkt::FieldMask>,
1585
1586 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1588 pub posture: std::option::Option<crate::model::Posture>,
1589
1590 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1592 pub revision_id: std::string::String,
1593}
1594
1595impl UpdatePostureRequest {
1596 pub fn new() -> Self {
1597 std::default::Default::default()
1598 }
1599
1600 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1602 mut self,
1603 v: T,
1604 ) -> Self {
1605 self.update_mask = v.into();
1606 self
1607 }
1608
1609 pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1611 mut self,
1612 v: T,
1613 ) -> Self {
1614 self.posture = v.into();
1615 self
1616 }
1617
1618 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620 self.revision_id = v.into();
1621 self
1622 }
1623}
1624
1625impl wkt::message::Message for UpdatePostureRequest {
1626 fn typename() -> &'static str {
1627 "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureRequest"
1628 }
1629}
1630
1631#[serde_with::serde_as]
1633#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1634#[serde(default, rename_all = "camelCase")]
1635#[non_exhaustive]
1636pub struct DeletePostureRequest {
1637 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1639 pub name: std::string::String,
1640
1641 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1643 pub etag: std::string::String,
1644}
1645
1646impl DeletePostureRequest {
1647 pub fn new() -> Self {
1648 std::default::Default::default()
1649 }
1650
1651 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.name = v.into();
1654 self
1655 }
1656
1657 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1659 self.etag = v.into();
1660 self
1661 }
1662}
1663
1664impl wkt::message::Message for DeletePostureRequest {
1665 fn typename() -> &'static str {
1666 "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureRequest"
1667 }
1668}
1669
1670#[serde_with::serde_as]
1672#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1673#[serde(default, rename_all = "camelCase")]
1674#[non_exhaustive]
1675pub struct ExtractPostureRequest {
1676 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1679 pub parent: std::string::String,
1680
1681 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1684 pub posture_id: std::string::String,
1685
1686 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1694 pub workload: std::string::String,
1695}
1696
1697impl ExtractPostureRequest {
1698 pub fn new() -> Self {
1699 std::default::Default::default()
1700 }
1701
1702 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1704 self.parent = v.into();
1705 self
1706 }
1707
1708 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1710 self.posture_id = v.into();
1711 self
1712 }
1713
1714 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1716 self.workload = v.into();
1717 self
1718 }
1719}
1720
1721impl wkt::message::Message for ExtractPostureRequest {
1722 fn typename() -> &'static str {
1723 "type.googleapis.com/google.cloud.securityposture.v1.ExtractPostureRequest"
1724 }
1725}
1726
1727#[serde_with::serde_as]
1730#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1731#[serde(default, rename_all = "camelCase")]
1732#[non_exhaustive]
1733pub struct PostureDeployment {
1734 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1737 pub name: std::string::String,
1738
1739 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1743 pub target_resource: std::string::String,
1744
1745 pub state: crate::model::posture_deployment::State,
1747
1748 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1754 pub posture_id: std::string::String,
1755
1756 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1758 pub posture_revision_id: std::string::String,
1759
1760 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1762 pub create_time: std::option::Option<wkt::Timestamp>,
1763
1764 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1766 pub update_time: std::option::Option<wkt::Timestamp>,
1767
1768 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770 pub description: std::string::String,
1771
1772 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1784 pub etag: std::string::String,
1785
1786 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1790 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1791
1792 pub reconciling: bool,
1795
1796 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1800 pub desired_posture_id: std::string::String,
1801
1802 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1805 pub desired_posture_revision_id: std::string::String,
1806
1807 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1811 pub failure_message: std::string::String,
1812}
1813
1814impl PostureDeployment {
1815 pub fn new() -> Self {
1816 std::default::Default::default()
1817 }
1818
1819 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.name = v.into();
1822 self
1823 }
1824
1825 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.target_resource = v.into();
1828 self
1829 }
1830
1831 pub fn set_state<T: std::convert::Into<crate::model::posture_deployment::State>>(
1833 mut self,
1834 v: T,
1835 ) -> Self {
1836 self.state = v.into();
1837 self
1838 }
1839
1840 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.posture_id = v.into();
1843 self
1844 }
1845
1846 pub fn set_posture_revision_id<T: std::convert::Into<std::string::String>>(
1848 mut self,
1849 v: T,
1850 ) -> Self {
1851 self.posture_revision_id = v.into();
1852 self
1853 }
1854
1855 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1857 mut self,
1858 v: T,
1859 ) -> Self {
1860 self.create_time = v.into();
1861 self
1862 }
1863
1864 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1866 mut self,
1867 v: T,
1868 ) -> Self {
1869 self.update_time = v.into();
1870 self
1871 }
1872
1873 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.description = v.into();
1876 self
1877 }
1878
1879 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1881 self.etag = v.into();
1882 self
1883 }
1884
1885 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1887 self.reconciling = v.into();
1888 self
1889 }
1890
1891 pub fn set_desired_posture_id<T: std::convert::Into<std::string::String>>(
1893 mut self,
1894 v: T,
1895 ) -> Self {
1896 self.desired_posture_id = v.into();
1897 self
1898 }
1899
1900 pub fn set_desired_posture_revision_id<T: std::convert::Into<std::string::String>>(
1902 mut self,
1903 v: T,
1904 ) -> Self {
1905 self.desired_posture_revision_id = v.into();
1906 self
1907 }
1908
1909 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911 self.failure_message = v.into();
1912 self
1913 }
1914
1915 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1917 where
1918 T: std::iter::IntoIterator<Item = (K, V)>,
1919 K: std::convert::Into<std::string::String>,
1920 V: std::convert::Into<std::string::String>,
1921 {
1922 use std::iter::Iterator;
1923 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1924 self
1925 }
1926}
1927
1928impl wkt::message::Message for PostureDeployment {
1929 fn typename() -> &'static str {
1930 "type.googleapis.com/google.cloud.securityposture.v1.PostureDeployment"
1931 }
1932}
1933
1934pub mod posture_deployment {
1936 #[allow(unused_imports)]
1937 use super::*;
1938
1939 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1941 pub struct State(std::borrow::Cow<'static, str>);
1942
1943 impl State {
1944 pub const fn new(v: &'static str) -> Self {
1946 Self(std::borrow::Cow::Borrowed(v))
1947 }
1948
1949 pub fn value(&self) -> &str {
1951 &self.0
1952 }
1953 }
1954
1955 pub mod state {
1957 use super::State;
1958
1959 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
1961
1962 pub const CREATING: State = State::new("CREATING");
1964
1965 pub const DELETING: State = State::new("DELETING");
1967
1968 pub const UPDATING: State = State::new("UPDATING");
1970
1971 pub const ACTIVE: State = State::new("ACTIVE");
1973
1974 pub const CREATE_FAILED: State = State::new("CREATE_FAILED");
1976
1977 pub const UPDATE_FAILED: State = State::new("UPDATE_FAILED");
1979
1980 pub const DELETE_FAILED: State = State::new("DELETE_FAILED");
1982 }
1983
1984 impl std::convert::From<std::string::String> for State {
1985 fn from(value: std::string::String) -> Self {
1986 Self(std::borrow::Cow::Owned(value))
1987 }
1988 }
1989}
1990
1991#[serde_with::serde_as]
1993#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1994#[serde(default, rename_all = "camelCase")]
1995#[non_exhaustive]
1996pub struct ListPostureDeploymentsRequest {
1997 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1999 pub parent: std::string::String,
2000
2001 pub page_size: i32,
2004
2005 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2007 pub page_token: std::string::String,
2008
2009 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2012 pub filter: std::string::String,
2013}
2014
2015impl ListPostureDeploymentsRequest {
2016 pub fn new() -> Self {
2017 std::default::Default::default()
2018 }
2019
2020 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2022 self.parent = v.into();
2023 self
2024 }
2025
2026 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2028 self.page_size = v.into();
2029 self
2030 }
2031
2032 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2034 self.page_token = v.into();
2035 self
2036 }
2037
2038 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.filter = v.into();
2041 self
2042 }
2043}
2044
2045impl wkt::message::Message for ListPostureDeploymentsRequest {
2046 fn typename() -> &'static str {
2047 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsRequest"
2048 }
2049}
2050
2051#[serde_with::serde_as]
2053#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2054#[serde(default, rename_all = "camelCase")]
2055#[non_exhaustive]
2056pub struct ListPostureDeploymentsResponse {
2057 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2059 pub posture_deployments: std::vec::Vec<crate::model::PostureDeployment>,
2060
2061 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2063 pub next_page_token: std::string::String,
2064
2065 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2067 pub unreachable: std::vec::Vec<std::string::String>,
2068}
2069
2070impl ListPostureDeploymentsResponse {
2071 pub fn new() -> Self {
2072 std::default::Default::default()
2073 }
2074
2075 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2077 self.next_page_token = v.into();
2078 self
2079 }
2080
2081 pub fn set_posture_deployments<T, V>(mut self, v: T) -> Self
2083 where
2084 T: std::iter::IntoIterator<Item = V>,
2085 V: std::convert::Into<crate::model::PostureDeployment>,
2086 {
2087 use std::iter::Iterator;
2088 self.posture_deployments = v.into_iter().map(|i| i.into()).collect();
2089 self
2090 }
2091
2092 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2094 where
2095 T: std::iter::IntoIterator<Item = V>,
2096 V: std::convert::Into<std::string::String>,
2097 {
2098 use std::iter::Iterator;
2099 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2100 self
2101 }
2102}
2103
2104impl wkt::message::Message for ListPostureDeploymentsResponse {
2105 fn typename() -> &'static str {
2106 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsResponse"
2107 }
2108}
2109
2110#[cfg(feature = "unstable-stream")]
2111impl gax::paginator::PageableResponse for ListPostureDeploymentsResponse {
2112 type PageItem = crate::model::PostureDeployment;
2113
2114 fn items(self) -> std::vec::Vec<Self::PageItem> {
2115 self.posture_deployments
2116 }
2117
2118 fn next_page_token(&self) -> std::string::String {
2119 gax::paginator::extract_token(&self.next_page_token)
2120 }
2121}
2122
2123#[serde_with::serde_as]
2125#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2126#[serde(default, rename_all = "camelCase")]
2127#[non_exhaustive]
2128pub struct GetPostureDeploymentRequest {
2129 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2131 pub name: std::string::String,
2132}
2133
2134impl GetPostureDeploymentRequest {
2135 pub fn new() -> Self {
2136 std::default::Default::default()
2137 }
2138
2139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2141 self.name = v.into();
2142 self
2143 }
2144}
2145
2146impl wkt::message::Message for GetPostureDeploymentRequest {
2147 fn typename() -> &'static str {
2148 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureDeploymentRequest"
2149 }
2150}
2151
2152#[serde_with::serde_as]
2154#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2155#[serde(default, rename_all = "camelCase")]
2156#[non_exhaustive]
2157pub struct CreatePostureDeploymentRequest {
2158 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2161 pub parent: std::string::String,
2162
2163 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2166 pub posture_deployment_id: std::string::String,
2167
2168 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2170 pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2171}
2172
2173impl CreatePostureDeploymentRequest {
2174 pub fn new() -> Self {
2175 std::default::Default::default()
2176 }
2177
2178 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180 self.parent = v.into();
2181 self
2182 }
2183
2184 pub fn set_posture_deployment_id<T: std::convert::Into<std::string::String>>(
2186 mut self,
2187 v: T,
2188 ) -> Self {
2189 self.posture_deployment_id = v.into();
2190 self
2191 }
2192
2193 pub fn set_posture_deployment<
2195 T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2196 >(
2197 mut self,
2198 v: T,
2199 ) -> Self {
2200 self.posture_deployment = v.into();
2201 self
2202 }
2203}
2204
2205impl wkt::message::Message for CreatePostureDeploymentRequest {
2206 fn typename() -> &'static str {
2207 "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureDeploymentRequest"
2208 }
2209}
2210
2211#[serde_with::serde_as]
2213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2214#[serde(default, rename_all = "camelCase")]
2215#[non_exhaustive]
2216pub struct UpdatePostureDeploymentRequest {
2217 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2223 pub update_mask: std::option::Option<wkt::FieldMask>,
2224
2225 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2227 pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2228}
2229
2230impl UpdatePostureDeploymentRequest {
2231 pub fn new() -> Self {
2232 std::default::Default::default()
2233 }
2234
2235 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2237 mut self,
2238 v: T,
2239 ) -> Self {
2240 self.update_mask = v.into();
2241 self
2242 }
2243
2244 pub fn set_posture_deployment<
2246 T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2247 >(
2248 mut self,
2249 v: T,
2250 ) -> Self {
2251 self.posture_deployment = v.into();
2252 self
2253 }
2254}
2255
2256impl wkt::message::Message for UpdatePostureDeploymentRequest {
2257 fn typename() -> &'static str {
2258 "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureDeploymentRequest"
2259 }
2260}
2261
2262#[serde_with::serde_as]
2264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2265#[serde(default, rename_all = "camelCase")]
2266#[non_exhaustive]
2267pub struct DeletePostureDeploymentRequest {
2268 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2270 pub name: std::string::String,
2271
2272 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2274 pub etag: std::string::String,
2275}
2276
2277impl DeletePostureDeploymentRequest {
2278 pub fn new() -> Self {
2279 std::default::Default::default()
2280 }
2281
2282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2284 self.name = v.into();
2285 self
2286 }
2287
2288 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.etag = v.into();
2291 self
2292 }
2293}
2294
2295impl wkt::message::Message for DeletePostureDeploymentRequest {
2296 fn typename() -> &'static str {
2297 "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureDeploymentRequest"
2298 }
2299}
2300
2301#[serde_with::serde_as]
2304#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2305#[serde(default, rename_all = "camelCase")]
2306#[non_exhaustive]
2307pub struct PostureTemplate {
2308 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2312 pub name: std::string::String,
2313
2314 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2316 pub revision_id: std::string::String,
2317
2318 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2320 pub description: std::string::String,
2321
2322 pub state: crate::model::posture_template::State,
2324
2325 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2327 pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
2328}
2329
2330impl PostureTemplate {
2331 pub fn new() -> Self {
2332 std::default::Default::default()
2333 }
2334
2335 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337 self.name = v.into();
2338 self
2339 }
2340
2341 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2343 self.revision_id = v.into();
2344 self
2345 }
2346
2347 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.description = v.into();
2350 self
2351 }
2352
2353 pub fn set_state<T: std::convert::Into<crate::model::posture_template::State>>(
2355 mut self,
2356 v: T,
2357 ) -> Self {
2358 self.state = v.into();
2359 self
2360 }
2361
2362 pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
2364 where
2365 T: std::iter::IntoIterator<Item = V>,
2366 V: std::convert::Into<crate::model::PolicySet>,
2367 {
2368 use std::iter::Iterator;
2369 self.policy_sets = v.into_iter().map(|i| i.into()).collect();
2370 self
2371 }
2372}
2373
2374impl wkt::message::Message for PostureTemplate {
2375 fn typename() -> &'static str {
2376 "type.googleapis.com/google.cloud.securityposture.v1.PostureTemplate"
2377 }
2378}
2379
2380pub mod posture_template {
2382 #[allow(unused_imports)]
2383 use super::*;
2384
2385 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2387 pub struct State(std::borrow::Cow<'static, str>);
2388
2389 impl State {
2390 pub const fn new(v: &'static str) -> Self {
2392 Self(std::borrow::Cow::Borrowed(v))
2393 }
2394
2395 pub fn value(&self) -> &str {
2397 &self.0
2398 }
2399 }
2400
2401 pub mod state {
2403 use super::State;
2404
2405 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
2407
2408 pub const ACTIVE: State = State::new("ACTIVE");
2410
2411 pub const DEPRECATED: State = State::new("DEPRECATED");
2414 }
2415
2416 impl std::convert::From<std::string::String> for State {
2417 fn from(value: std::string::String) -> Self {
2418 Self(std::borrow::Cow::Owned(value))
2419 }
2420 }
2421}
2422
2423#[serde_with::serde_as]
2425#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2426#[serde(default, rename_all = "camelCase")]
2427#[non_exhaustive]
2428pub struct ListPostureTemplatesRequest {
2429 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2431 pub parent: std::string::String,
2432
2433 pub page_size: i32,
2436
2437 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2439 pub page_token: std::string::String,
2440
2441 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2444 pub filter: std::string::String,
2445}
2446
2447impl ListPostureTemplatesRequest {
2448 pub fn new() -> Self {
2449 std::default::Default::default()
2450 }
2451
2452 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454 self.parent = v.into();
2455 self
2456 }
2457
2458 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2460 self.page_size = v.into();
2461 self
2462 }
2463
2464 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2466 self.page_token = v.into();
2467 self
2468 }
2469
2470 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2472 self.filter = v.into();
2473 self
2474 }
2475}
2476
2477impl wkt::message::Message for ListPostureTemplatesRequest {
2478 fn typename() -> &'static str {
2479 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesRequest"
2480 }
2481}
2482
2483#[serde_with::serde_as]
2485#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2486#[serde(default, rename_all = "camelCase")]
2487#[non_exhaustive]
2488pub struct ListPostureTemplatesResponse {
2489 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2491 pub posture_templates: std::vec::Vec<crate::model::PostureTemplate>,
2492
2493 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2495 pub next_page_token: std::string::String,
2496}
2497
2498impl ListPostureTemplatesResponse {
2499 pub fn new() -> Self {
2500 std::default::Default::default()
2501 }
2502
2503 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2505 self.next_page_token = v.into();
2506 self
2507 }
2508
2509 pub fn set_posture_templates<T, V>(mut self, v: T) -> Self
2511 where
2512 T: std::iter::IntoIterator<Item = V>,
2513 V: std::convert::Into<crate::model::PostureTemplate>,
2514 {
2515 use std::iter::Iterator;
2516 self.posture_templates = v.into_iter().map(|i| i.into()).collect();
2517 self
2518 }
2519}
2520
2521impl wkt::message::Message for ListPostureTemplatesResponse {
2522 fn typename() -> &'static str {
2523 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesResponse"
2524 }
2525}
2526
2527#[cfg(feature = "unstable-stream")]
2528impl gax::paginator::PageableResponse for ListPostureTemplatesResponse {
2529 type PageItem = crate::model::PostureTemplate;
2530
2531 fn items(self) -> std::vec::Vec<Self::PageItem> {
2532 self.posture_templates
2533 }
2534
2535 fn next_page_token(&self) -> std::string::String {
2536 gax::paginator::extract_token(&self.next_page_token)
2537 }
2538}
2539
2540#[serde_with::serde_as]
2542#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2543#[serde(default, rename_all = "camelCase")]
2544#[non_exhaustive]
2545pub struct GetPostureTemplateRequest {
2546 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2548 pub name: std::string::String,
2549
2550 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2553 pub revision_id: std::string::String,
2554}
2555
2556impl GetPostureTemplateRequest {
2557 pub fn new() -> Self {
2558 std::default::Default::default()
2559 }
2560
2561 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2563 self.name = v.into();
2564 self
2565 }
2566
2567 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.revision_id = v.into();
2570 self
2571 }
2572}
2573
2574impl wkt::message::Message for GetPostureTemplateRequest {
2575 fn typename() -> &'static str {
2576 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureTemplateRequest"
2577 }
2578}
2579
2580#[serde_with::serde_as]
2582#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2583#[serde(default, rename_all = "camelCase")]
2584#[non_exhaustive]
2585pub struct SecurityHealthAnalyticsModule {
2586 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2588 pub module_name: std::string::String,
2589
2590 pub module_enablement_state: crate::model::EnablementState,
2593}
2594
2595impl SecurityHealthAnalyticsModule {
2596 pub fn new() -> Self {
2597 std::default::Default::default()
2598 }
2599
2600 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2602 self.module_name = v.into();
2603 self
2604 }
2605
2606 pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
2608 mut self,
2609 v: T,
2610 ) -> Self {
2611 self.module_enablement_state = v.into();
2612 self
2613 }
2614}
2615
2616impl wkt::message::Message for SecurityHealthAnalyticsModule {
2617 fn typename() -> &'static str {
2618 "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsModule"
2619 }
2620}
2621
2622#[serde_with::serde_as]
2624#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2625#[serde(default, rename_all = "camelCase")]
2626#[non_exhaustive]
2627pub struct SecurityHealthAnalyticsCustomModule {
2628 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2632 pub id: std::string::String,
2633
2634 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2640 pub display_name: std::string::String,
2641
2642 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2644 pub config: std::option::Option<crate::model::CustomConfig>,
2645
2646 pub module_enablement_state: crate::model::EnablementState,
2649}
2650
2651impl SecurityHealthAnalyticsCustomModule {
2652 pub fn new() -> Self {
2653 std::default::Default::default()
2654 }
2655
2656 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2658 self.id = v.into();
2659 self
2660 }
2661
2662 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2664 self.display_name = v.into();
2665 self
2666 }
2667
2668 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::CustomConfig>>>(
2670 mut self,
2671 v: T,
2672 ) -> Self {
2673 self.config = v.into();
2674 self
2675 }
2676
2677 pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
2679 mut self,
2680 v: T,
2681 ) -> Self {
2682 self.module_enablement_state = v.into();
2683 self
2684 }
2685}
2686
2687impl wkt::message::Message for SecurityHealthAnalyticsCustomModule {
2688 fn typename() -> &'static str {
2689 "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule"
2690 }
2691}
2692
2693#[serde_with::serde_as]
2697#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2698#[serde(default, rename_all = "camelCase")]
2699#[non_exhaustive]
2700pub struct CustomConfig {
2701 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2704 pub predicate: std::option::Option<gtype::model::Expr>,
2705
2706 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2708 pub custom_output: std::option::Option<crate::model::custom_config::CustomOutputSpec>,
2709
2710 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2713 pub resource_selector: std::option::Option<crate::model::custom_config::ResourceSelector>,
2714
2715 pub severity: crate::model::custom_config::Severity,
2717
2718 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2723 pub description: std::string::String,
2724
2725 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2730 pub recommendation: std::string::String,
2731}
2732
2733impl CustomConfig {
2734 pub fn new() -> Self {
2735 std::default::Default::default()
2736 }
2737
2738 pub fn set_predicate<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
2740 mut self,
2741 v: T,
2742 ) -> Self {
2743 self.predicate = v.into();
2744 self
2745 }
2746
2747 pub fn set_custom_output<
2749 T: std::convert::Into<std::option::Option<crate::model::custom_config::CustomOutputSpec>>,
2750 >(
2751 mut self,
2752 v: T,
2753 ) -> Self {
2754 self.custom_output = v.into();
2755 self
2756 }
2757
2758 pub fn set_resource_selector<
2760 T: std::convert::Into<std::option::Option<crate::model::custom_config::ResourceSelector>>,
2761 >(
2762 mut self,
2763 v: T,
2764 ) -> Self {
2765 self.resource_selector = v.into();
2766 self
2767 }
2768
2769 pub fn set_severity<T: std::convert::Into<crate::model::custom_config::Severity>>(
2771 mut self,
2772 v: T,
2773 ) -> Self {
2774 self.severity = v.into();
2775 self
2776 }
2777
2778 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2780 self.description = v.into();
2781 self
2782 }
2783
2784 pub fn set_recommendation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.recommendation = v.into();
2787 self
2788 }
2789}
2790
2791impl wkt::message::Message for CustomConfig {
2792 fn typename() -> &'static str {
2793 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig"
2794 }
2795}
2796
2797pub mod custom_config {
2799 #[allow(unused_imports)]
2800 use super::*;
2801
2802 #[serde_with::serde_as]
2807 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2808 #[serde(default, rename_all = "camelCase")]
2809 #[non_exhaustive]
2810 pub struct CustomOutputSpec {
2811 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2813 pub properties: std::vec::Vec<crate::model::custom_config::custom_output_spec::Property>,
2814 }
2815
2816 impl CustomOutputSpec {
2817 pub fn new() -> Self {
2818 std::default::Default::default()
2819 }
2820
2821 pub fn set_properties<T, V>(mut self, v: T) -> Self
2823 where
2824 T: std::iter::IntoIterator<Item = V>,
2825 V: std::convert::Into<crate::model::custom_config::custom_output_spec::Property>,
2826 {
2827 use std::iter::Iterator;
2828 self.properties = v.into_iter().map(|i| i.into()).collect();
2829 self
2830 }
2831 }
2832
2833 impl wkt::message::Message for CustomOutputSpec {
2834 fn typename() -> &'static str {
2835 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec"
2836 }
2837 }
2838
2839 pub mod custom_output_spec {
2841 #[allow(unused_imports)]
2842 use super::*;
2843
2844 #[serde_with::serde_as]
2846 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2847 #[serde(default, rename_all = "camelCase")]
2848 #[non_exhaustive]
2849 pub struct Property {
2850 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2852 pub name: std::string::String,
2853
2854 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2858 pub value_expression: std::option::Option<gtype::model::Expr>,
2859 }
2860
2861 impl Property {
2862 pub fn new() -> Self {
2863 std::default::Default::default()
2864 }
2865
2866 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2868 self.name = v.into();
2869 self
2870 }
2871
2872 pub fn set_value_expression<
2874 T: std::convert::Into<std::option::Option<gtype::model::Expr>>,
2875 >(
2876 mut self,
2877 v: T,
2878 ) -> Self {
2879 self.value_expression = v.into();
2880 self
2881 }
2882 }
2883
2884 impl wkt::message::Message for Property {
2885 fn typename() -> &'static str {
2886 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property"
2887 }
2888 }
2889 }
2890
2891 #[serde_with::serde_as]
2893 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2894 #[serde(default, rename_all = "camelCase")]
2895 #[non_exhaustive]
2896 pub struct ResourceSelector {
2897 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2899 pub resource_types: std::vec::Vec<std::string::String>,
2900 }
2901
2902 impl ResourceSelector {
2903 pub fn new() -> Self {
2904 std::default::Default::default()
2905 }
2906
2907 pub fn set_resource_types<T, V>(mut self, v: T) -> Self
2909 where
2910 T: std::iter::IntoIterator<Item = V>,
2911 V: std::convert::Into<std::string::String>,
2912 {
2913 use std::iter::Iterator;
2914 self.resource_types = v.into_iter().map(|i| i.into()).collect();
2915 self
2916 }
2917 }
2918
2919 impl wkt::message::Message for ResourceSelector {
2920 fn typename() -> &'static str {
2921 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.ResourceSelector"
2922 }
2923 }
2924
2925 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2927 pub struct Severity(std::borrow::Cow<'static, str>);
2928
2929 impl Severity {
2930 pub const fn new(v: &'static str) -> Self {
2932 Self(std::borrow::Cow::Borrowed(v))
2933 }
2934
2935 pub fn value(&self) -> &str {
2937 &self.0
2938 }
2939 }
2940
2941 pub mod severity {
2943 use super::Severity;
2944
2945 pub const SEVERITY_UNSPECIFIED: Severity = Severity::new("SEVERITY_UNSPECIFIED");
2947
2948 pub const CRITICAL: Severity = Severity::new("CRITICAL");
2950
2951 pub const HIGH: Severity = Severity::new("HIGH");
2953
2954 pub const MEDIUM: Severity = Severity::new("MEDIUM");
2956
2957 pub const LOW: Severity = Severity::new("LOW");
2959 }
2960
2961 impl std::convert::From<std::string::String> for Severity {
2962 fn from(value: std::string::String) -> Self {
2963 Self(std::borrow::Cow::Owned(value))
2964 }
2965 }
2966}
2967
2968#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2970pub struct EnablementState(std::borrow::Cow<'static, str>);
2971
2972impl EnablementState {
2973 pub const fn new(v: &'static str) -> Self {
2975 Self(std::borrow::Cow::Borrowed(v))
2976 }
2977
2978 pub fn value(&self) -> &str {
2980 &self.0
2981 }
2982}
2983
2984pub mod enablement_state {
2986 use super::EnablementState;
2987
2988 pub const ENABLEMENT_STATE_UNSPECIFIED: EnablementState =
2990 EnablementState::new("ENABLEMENT_STATE_UNSPECIFIED");
2991
2992 pub const ENABLED: EnablementState = EnablementState::new("ENABLED");
2994
2995 pub const DISABLED: EnablementState = EnablementState::new("DISABLED");
2997}
2998
2999impl std::convert::From<std::string::String> for EnablementState {
3000 fn from(value: std::string::String) -> Self {
3001 Self(std::borrow::Cow::Owned(value))
3002 }
3003}