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 gtype;
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
37#[serde_with::serde_as]
39#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
40#[serde(default, rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct PolicyRule {
43 #[serde(skip_serializing_if = "std::option::Option::is_none")]
56 pub condition: std::option::Option<gtype::model::Expr>,
57
58 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
59 pub kind: std::option::Option<crate::model::policy_rule::Kind>,
60
61 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
62 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
63}
64
65impl PolicyRule {
66 pub fn new() -> Self {
67 std::default::Default::default()
68 }
69
70 pub fn set_condition<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
72 mut self,
73 v: T,
74 ) -> Self {
75 self.condition = v.into();
76 self
77 }
78
79 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Kind>>>(
84 mut self,
85 v: T,
86 ) -> Self {
87 self.kind = v.into();
88 self
89 }
90
91 pub fn values(
95 &self,
96 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_rule::StringValues>> {
97 #[allow(unreachable_patterns)]
98 self.kind.as_ref().and_then(|v| match v {
99 crate::model::policy_rule::Kind::Values(v) => std::option::Option::Some(v),
100 _ => std::option::Option::None,
101 })
102 }
103
104 pub fn set_values<
110 T: std::convert::Into<std::boxed::Box<crate::model::policy_rule::StringValues>>,
111 >(
112 mut self,
113 v: T,
114 ) -> Self {
115 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Values(v.into()));
116 self
117 }
118
119 pub fn allow_all(&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::AllowAll(v) => std::option::Option::Some(v),
126 _ => std::option::Option::None,
127 })
128 }
129
130 pub fn set_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
136 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::AllowAll(v.into()));
137 self
138 }
139
140 pub fn deny_all(&self) -> std::option::Option<&bool> {
144 #[allow(unreachable_patterns)]
145 self.kind.as_ref().and_then(|v| match v {
146 crate::model::policy_rule::Kind::DenyAll(v) => std::option::Option::Some(v),
147 _ => std::option::Option::None,
148 })
149 }
150
151 pub fn set_deny_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
157 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::DenyAll(v.into()));
158 self
159 }
160
161 pub fn enforce(&self) -> std::option::Option<&bool> {
165 #[allow(unreachable_patterns)]
166 self.kind.as_ref().and_then(|v| match v {
167 crate::model::policy_rule::Kind::Enforce(v) => std::option::Option::Some(v),
168 _ => std::option::Option::None,
169 })
170 }
171
172 pub fn set_enforce<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
178 self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Enforce(v.into()));
179 self
180 }
181}
182
183impl wkt::message::Message for PolicyRule {
184 fn typename() -> &'static str {
185 "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule"
186 }
187}
188
189pub mod policy_rule {
191 #[allow(unused_imports)]
192 use super::*;
193
194 #[serde_with::serde_as]
212 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
213 #[serde(default, rename_all = "camelCase")]
214 #[non_exhaustive]
215 pub struct StringValues {
216 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
218 pub allowed_values: std::vec::Vec<std::string::String>,
219
220 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
222 pub denied_values: std::vec::Vec<std::string::String>,
223
224 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
225 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
226 }
227
228 impl StringValues {
229 pub fn new() -> Self {
230 std::default::Default::default()
231 }
232
233 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
235 where
236 T: std::iter::IntoIterator<Item = V>,
237 V: std::convert::Into<std::string::String>,
238 {
239 use std::iter::Iterator;
240 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
241 self
242 }
243
244 pub fn set_denied_values<T, V>(mut self, v: T) -> Self
246 where
247 T: std::iter::IntoIterator<Item = V>,
248 V: std::convert::Into<std::string::String>,
249 {
250 use std::iter::Iterator;
251 self.denied_values = v.into_iter().map(|i| i.into()).collect();
252 self
253 }
254 }
255
256 impl wkt::message::Message for StringValues {
257 fn typename() -> &'static str {
258 "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule.StringValues"
259 }
260 }
261
262 #[serde_with::serde_as]
263 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
264 #[serde(rename_all = "camelCase")]
265 #[non_exhaustive]
266 pub enum Kind {
267 Values(std::boxed::Box<crate::model::policy_rule::StringValues>),
270 AllowAll(bool),
273 DenyAll(bool),
276 Enforce(bool),
280 }
281}
282
283#[serde_with::serde_as]
290#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
291#[serde(default, rename_all = "camelCase")]
292#[non_exhaustive]
293pub struct CustomConstraint {
294 #[serde(skip_serializing_if = "std::string::String::is_empty")]
305 pub name: std::string::String,
306
307 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
312 pub resource_types: std::vec::Vec<std::string::String>,
313
314 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
316 pub method_types: std::vec::Vec<crate::model::custom_constraint::MethodType>,
317
318 #[serde(skip_serializing_if = "std::string::String::is_empty")]
324 pub condition: std::string::String,
325
326 pub action_type: crate::model::custom_constraint::ActionType,
328
329 #[serde(skip_serializing_if = "std::string::String::is_empty")]
332 pub display_name: std::string::String,
333
334 #[serde(skip_serializing_if = "std::string::String::is_empty")]
337 pub description: std::string::String,
338
339 #[serde(skip_serializing_if = "std::option::Option::is_none")]
343 pub update_time: std::option::Option<wkt::Timestamp>,
344
345 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
346 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
347}
348
349impl CustomConstraint {
350 pub fn new() -> Self {
351 std::default::Default::default()
352 }
353
354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
356 self.name = v.into();
357 self
358 }
359
360 pub fn set_resource_types<T, V>(mut self, v: T) -> Self
362 where
363 T: std::iter::IntoIterator<Item = V>,
364 V: std::convert::Into<std::string::String>,
365 {
366 use std::iter::Iterator;
367 self.resource_types = v.into_iter().map(|i| i.into()).collect();
368 self
369 }
370
371 pub fn set_method_types<T, V>(mut self, v: T) -> Self
373 where
374 T: std::iter::IntoIterator<Item = V>,
375 V: std::convert::Into<crate::model::custom_constraint::MethodType>,
376 {
377 use std::iter::Iterator;
378 self.method_types = v.into_iter().map(|i| i.into()).collect();
379 self
380 }
381
382 pub fn set_condition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
384 self.condition = v.into();
385 self
386 }
387
388 pub fn set_action_type<T: std::convert::Into<crate::model::custom_constraint::ActionType>>(
390 mut self,
391 v: T,
392 ) -> Self {
393 self.action_type = v.into();
394 self
395 }
396
397 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
399 self.display_name = v.into();
400 self
401 }
402
403 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
405 self.description = v.into();
406 self
407 }
408
409 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
411 mut self,
412 v: T,
413 ) -> Self {
414 self.update_time = v.into();
415 self
416 }
417}
418
419impl wkt::message::Message for CustomConstraint {
420 fn typename() -> &'static str {
421 "type.googleapis.com/google.cloud.securityposture.v1.CustomConstraint"
422 }
423}
424
425pub mod custom_constraint {
427 #[allow(unused_imports)]
428 use super::*;
429
430 #[derive(Clone, Debug, PartialEq)]
452 #[non_exhaustive]
453 pub enum MethodType {
454 Unspecified,
456 Create,
458 Update,
460 Delete,
463 UnknownValue(method_type::UnknownValue),
468 }
469
470 #[doc(hidden)]
471 pub mod method_type {
472 #[allow(unused_imports)]
473 use super::*;
474 #[derive(Clone, Debug, PartialEq)]
475 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
476 }
477
478 impl MethodType {
479 pub fn value(&self) -> std::option::Option<i32> {
484 match self {
485 Self::Unspecified => std::option::Option::Some(0),
486 Self::Create => std::option::Option::Some(1),
487 Self::Update => std::option::Option::Some(2),
488 Self::Delete => std::option::Option::Some(3),
489 Self::UnknownValue(u) => u.0.value(),
490 }
491 }
492
493 pub fn name(&self) -> std::option::Option<&str> {
498 match self {
499 Self::Unspecified => std::option::Option::Some("METHOD_TYPE_UNSPECIFIED"),
500 Self::Create => std::option::Option::Some("CREATE"),
501 Self::Update => std::option::Option::Some("UPDATE"),
502 Self::Delete => std::option::Option::Some("DELETE"),
503 Self::UnknownValue(u) => u.0.name(),
504 }
505 }
506 }
507
508 impl std::default::Default for MethodType {
509 fn default() -> Self {
510 use std::convert::From;
511 Self::from(0)
512 }
513 }
514
515 impl std::fmt::Display for MethodType {
516 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
517 wkt::internal::display_enum(f, self.name(), self.value())
518 }
519 }
520
521 impl std::convert::From<i32> for MethodType {
522 fn from(value: i32) -> Self {
523 match value {
524 0 => Self::Unspecified,
525 1 => Self::Create,
526 2 => Self::Update,
527 3 => Self::Delete,
528 _ => Self::UnknownValue(method_type::UnknownValue(
529 wkt::internal::UnknownEnumValue::Integer(value),
530 )),
531 }
532 }
533 }
534
535 impl std::convert::From<&str> for MethodType {
536 fn from(value: &str) -> Self {
537 use std::string::ToString;
538 match value {
539 "METHOD_TYPE_UNSPECIFIED" => Self::Unspecified,
540 "CREATE" => Self::Create,
541 "UPDATE" => Self::Update,
542 "DELETE" => Self::Delete,
543 _ => Self::UnknownValue(method_type::UnknownValue(
544 wkt::internal::UnknownEnumValue::String(value.to_string()),
545 )),
546 }
547 }
548 }
549
550 impl serde::ser::Serialize for MethodType {
551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
552 where
553 S: serde::Serializer,
554 {
555 match self {
556 Self::Unspecified => serializer.serialize_i32(0),
557 Self::Create => serializer.serialize_i32(1),
558 Self::Update => serializer.serialize_i32(2),
559 Self::Delete => serializer.serialize_i32(3),
560 Self::UnknownValue(u) => u.0.serialize(serializer),
561 }
562 }
563 }
564
565 impl<'de> serde::de::Deserialize<'de> for MethodType {
566 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
567 where
568 D: serde::Deserializer<'de>,
569 {
570 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MethodType>::new(
571 ".google.cloud.securityposture.v1.CustomConstraint.MethodType",
572 ))
573 }
574 }
575
576 #[derive(Clone, Debug, PartialEq)]
592 #[non_exhaustive]
593 pub enum ActionType {
594 Unspecified,
596 Allow,
598 Deny,
600 UnknownValue(action_type::UnknownValue),
605 }
606
607 #[doc(hidden)]
608 pub mod action_type {
609 #[allow(unused_imports)]
610 use super::*;
611 #[derive(Clone, Debug, PartialEq)]
612 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
613 }
614
615 impl ActionType {
616 pub fn value(&self) -> std::option::Option<i32> {
621 match self {
622 Self::Unspecified => std::option::Option::Some(0),
623 Self::Allow => std::option::Option::Some(1),
624 Self::Deny => std::option::Option::Some(2),
625 Self::UnknownValue(u) => u.0.value(),
626 }
627 }
628
629 pub fn name(&self) -> std::option::Option<&str> {
634 match self {
635 Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
636 Self::Allow => std::option::Option::Some("ALLOW"),
637 Self::Deny => std::option::Option::Some("DENY"),
638 Self::UnknownValue(u) => u.0.name(),
639 }
640 }
641 }
642
643 impl std::default::Default for ActionType {
644 fn default() -> Self {
645 use std::convert::From;
646 Self::from(0)
647 }
648 }
649
650 impl std::fmt::Display for ActionType {
651 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
652 wkt::internal::display_enum(f, self.name(), self.value())
653 }
654 }
655
656 impl std::convert::From<i32> for ActionType {
657 fn from(value: i32) -> Self {
658 match value {
659 0 => Self::Unspecified,
660 1 => Self::Allow,
661 2 => Self::Deny,
662 _ => Self::UnknownValue(action_type::UnknownValue(
663 wkt::internal::UnknownEnumValue::Integer(value),
664 )),
665 }
666 }
667 }
668
669 impl std::convert::From<&str> for ActionType {
670 fn from(value: &str) -> Self {
671 use std::string::ToString;
672 match value {
673 "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
674 "ALLOW" => Self::Allow,
675 "DENY" => Self::Deny,
676 _ => Self::UnknownValue(action_type::UnknownValue(
677 wkt::internal::UnknownEnumValue::String(value.to_string()),
678 )),
679 }
680 }
681 }
682
683 impl serde::ser::Serialize for ActionType {
684 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
685 where
686 S: serde::Serializer,
687 {
688 match self {
689 Self::Unspecified => serializer.serialize_i32(0),
690 Self::Allow => serializer.serialize_i32(1),
691 Self::Deny => serializer.serialize_i32(2),
692 Self::UnknownValue(u) => u.0.serialize(serializer),
693 }
694 }
695 }
696
697 impl<'de> serde::de::Deserialize<'de> for ActionType {
698 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
699 where
700 D: serde::Deserializer<'de>,
701 {
702 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
703 ".google.cloud.securityposture.v1.CustomConstraint.ActionType",
704 ))
705 }
706 }
707}
708
709#[serde_with::serde_as]
711#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
712#[serde(default, rename_all = "camelCase")]
713#[non_exhaustive]
714pub struct OrgPolicyConstraint {
715 #[serde(skip_serializing_if = "std::string::String::is_empty")]
717 pub canned_constraint_id: std::string::String,
718
719 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
721 pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
722
723 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
724 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
725}
726
727impl OrgPolicyConstraint {
728 pub fn new() -> Self {
729 std::default::Default::default()
730 }
731
732 pub fn set_canned_constraint_id<T: std::convert::Into<std::string::String>>(
734 mut self,
735 v: T,
736 ) -> Self {
737 self.canned_constraint_id = v.into();
738 self
739 }
740
741 pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
743 where
744 T: std::iter::IntoIterator<Item = V>,
745 V: std::convert::Into<crate::model::PolicyRule>,
746 {
747 use std::iter::Iterator;
748 self.policy_rules = v.into_iter().map(|i| i.into()).collect();
749 self
750 }
751}
752
753impl wkt::message::Message for OrgPolicyConstraint {
754 fn typename() -> &'static str {
755 "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraint"
756 }
757}
758
759#[serde_with::serde_as]
761#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
762#[serde(default, rename_all = "camelCase")]
763#[non_exhaustive]
764pub struct OrgPolicyConstraintCustom {
765 #[serde(skip_serializing_if = "std::option::Option::is_none")]
767 pub custom_constraint: std::option::Option<crate::model::CustomConstraint>,
768
769 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
771 pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
772
773 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
774 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
775}
776
777impl OrgPolicyConstraintCustom {
778 pub fn new() -> Self {
779 std::default::Default::default()
780 }
781
782 pub fn set_custom_constraint<
784 T: std::convert::Into<std::option::Option<crate::model::CustomConstraint>>,
785 >(
786 mut self,
787 v: T,
788 ) -> Self {
789 self.custom_constraint = v.into();
790 self
791 }
792
793 pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
795 where
796 T: std::iter::IntoIterator<Item = V>,
797 V: std::convert::Into<crate::model::PolicyRule>,
798 {
799 use std::iter::Iterator;
800 self.policy_rules = v.into_iter().map(|i| i.into()).collect();
801 self
802 }
803}
804
805impl wkt::message::Message for OrgPolicyConstraintCustom {
806 fn typename() -> &'static str {
807 "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraintCustom"
808 }
809}
810
811#[serde_with::serde_as]
813#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
814#[serde(default, rename_all = "camelCase")]
815#[non_exhaustive]
816pub struct OperationMetadata {
817 #[serde(skip_serializing_if = "std::option::Option::is_none")]
819 pub create_time: std::option::Option<wkt::Timestamp>,
820
821 #[serde(skip_serializing_if = "std::option::Option::is_none")]
823 pub end_time: std::option::Option<wkt::Timestamp>,
824
825 #[serde(skip_serializing_if = "std::string::String::is_empty")]
827 pub target: std::string::String,
828
829 #[serde(skip_serializing_if = "std::string::String::is_empty")]
831 pub verb: std::string::String,
832
833 #[serde(skip_serializing_if = "std::string::String::is_empty")]
835 pub status_message: std::string::String,
836
837 #[serde(skip_serializing_if = "wkt::internal::is_default")]
845 pub requested_cancellation: bool,
846
847 #[serde(skip_serializing_if = "std::string::String::is_empty")]
849 pub api_version: std::string::String,
850
851 #[serde(skip_serializing_if = "std::string::String::is_empty")]
855 pub error_message: std::string::String,
856
857 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
858 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
859}
860
861impl OperationMetadata {
862 pub fn new() -> Self {
863 std::default::Default::default()
864 }
865
866 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
868 mut self,
869 v: T,
870 ) -> Self {
871 self.create_time = v.into();
872 self
873 }
874
875 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
877 mut self,
878 v: T,
879 ) -> Self {
880 self.end_time = v.into();
881 self
882 }
883
884 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
886 self.target = v.into();
887 self
888 }
889
890 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
892 self.verb = v.into();
893 self
894 }
895
896 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
898 self.status_message = v.into();
899 self
900 }
901
902 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
904 self.requested_cancellation = v.into();
905 self
906 }
907
908 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
910 self.api_version = v.into();
911 self
912 }
913
914 pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
916 self.error_message = v.into();
917 self
918 }
919}
920
921impl wkt::message::Message for OperationMetadata {
922 fn typename() -> &'static str {
923 "type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata"
924 }
925}
926
927#[serde_with::serde_as]
930#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
931#[serde(default, rename_all = "camelCase")]
932#[non_exhaustive]
933pub struct Posture {
934 #[serde(skip_serializing_if = "std::string::String::is_empty")]
937 pub name: std::string::String,
938
939 pub state: crate::model::posture::State,
941
942 #[serde(skip_serializing_if = "std::string::String::is_empty")]
946 pub revision_id: std::string::String,
947
948 #[serde(skip_serializing_if = "std::option::Option::is_none")]
950 pub create_time: std::option::Option<wkt::Timestamp>,
951
952 #[serde(skip_serializing_if = "std::option::Option::is_none")]
954 pub update_time: std::option::Option<wkt::Timestamp>,
955
956 #[serde(skip_serializing_if = "std::string::String::is_empty")]
958 pub description: std::string::String,
959
960 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
962 pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
963
964 #[serde(skip_serializing_if = "std::string::String::is_empty")]
975 pub etag: std::string::String,
976
977 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
981 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
982
983 #[serde(skip_serializing_if = "wkt::internal::is_default")]
986 pub reconciling: bool,
987
988 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
989 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990}
991
992impl Posture {
993 pub fn new() -> Self {
994 std::default::Default::default()
995 }
996
997 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999 self.name = v.into();
1000 self
1001 }
1002
1003 pub fn set_state<T: std::convert::Into<crate::model::posture::State>>(mut self, v: T) -> Self {
1005 self.state = v.into();
1006 self
1007 }
1008
1009 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.revision_id = v.into();
1012 self
1013 }
1014
1015 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1017 mut self,
1018 v: T,
1019 ) -> Self {
1020 self.create_time = v.into();
1021 self
1022 }
1023
1024 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1026 mut self,
1027 v: T,
1028 ) -> Self {
1029 self.update_time = v.into();
1030 self
1031 }
1032
1033 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1035 self.description = v.into();
1036 self
1037 }
1038
1039 pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
1041 where
1042 T: std::iter::IntoIterator<Item = V>,
1043 V: std::convert::Into<crate::model::PolicySet>,
1044 {
1045 use std::iter::Iterator;
1046 self.policy_sets = v.into_iter().map(|i| i.into()).collect();
1047 self
1048 }
1049
1050 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.etag = v.into();
1053 self
1054 }
1055
1056 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1058 where
1059 T: std::iter::IntoIterator<Item = (K, V)>,
1060 K: std::convert::Into<std::string::String>,
1061 V: std::convert::Into<std::string::String>,
1062 {
1063 use std::iter::Iterator;
1064 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1065 self
1066 }
1067
1068 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1070 self.reconciling = v.into();
1071 self
1072 }
1073}
1074
1075impl wkt::message::Message for Posture {
1076 fn typename() -> &'static str {
1077 "type.googleapis.com/google.cloud.securityposture.v1.Posture"
1078 }
1079}
1080
1081pub mod posture {
1083 #[allow(unused_imports)]
1084 use super::*;
1085
1086 #[derive(Clone, Debug, PartialEq)]
1102 #[non_exhaustive]
1103 pub enum State {
1104 Unspecified,
1106 Deprecated,
1108 Draft,
1110 Active,
1112 UnknownValue(state::UnknownValue),
1117 }
1118
1119 #[doc(hidden)]
1120 pub mod state {
1121 #[allow(unused_imports)]
1122 use super::*;
1123 #[derive(Clone, Debug, PartialEq)]
1124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1125 }
1126
1127 impl State {
1128 pub fn value(&self) -> std::option::Option<i32> {
1133 match self {
1134 Self::Unspecified => std::option::Option::Some(0),
1135 Self::Deprecated => std::option::Option::Some(1),
1136 Self::Draft => std::option::Option::Some(2),
1137 Self::Active => std::option::Option::Some(3),
1138 Self::UnknownValue(u) => u.0.value(),
1139 }
1140 }
1141
1142 pub fn name(&self) -> std::option::Option<&str> {
1147 match self {
1148 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1149 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
1150 Self::Draft => std::option::Option::Some("DRAFT"),
1151 Self::Active => std::option::Option::Some("ACTIVE"),
1152 Self::UnknownValue(u) => u.0.name(),
1153 }
1154 }
1155 }
1156
1157 impl std::default::Default for State {
1158 fn default() -> Self {
1159 use std::convert::From;
1160 Self::from(0)
1161 }
1162 }
1163
1164 impl std::fmt::Display for State {
1165 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1166 wkt::internal::display_enum(f, self.name(), self.value())
1167 }
1168 }
1169
1170 impl std::convert::From<i32> for State {
1171 fn from(value: i32) -> Self {
1172 match value {
1173 0 => Self::Unspecified,
1174 1 => Self::Deprecated,
1175 2 => Self::Draft,
1176 3 => Self::Active,
1177 _ => Self::UnknownValue(state::UnknownValue(
1178 wkt::internal::UnknownEnumValue::Integer(value),
1179 )),
1180 }
1181 }
1182 }
1183
1184 impl std::convert::From<&str> for State {
1185 fn from(value: &str) -> Self {
1186 use std::string::ToString;
1187 match value {
1188 "STATE_UNSPECIFIED" => Self::Unspecified,
1189 "DEPRECATED" => Self::Deprecated,
1190 "DRAFT" => Self::Draft,
1191 "ACTIVE" => Self::Active,
1192 _ => Self::UnknownValue(state::UnknownValue(
1193 wkt::internal::UnknownEnumValue::String(value.to_string()),
1194 )),
1195 }
1196 }
1197 }
1198
1199 impl serde::ser::Serialize for State {
1200 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1201 where
1202 S: serde::Serializer,
1203 {
1204 match self {
1205 Self::Unspecified => serializer.serialize_i32(0),
1206 Self::Deprecated => serializer.serialize_i32(1),
1207 Self::Draft => serializer.serialize_i32(2),
1208 Self::Active => serializer.serialize_i32(3),
1209 Self::UnknownValue(u) => u.0.serialize(serializer),
1210 }
1211 }
1212 }
1213
1214 impl<'de> serde::de::Deserialize<'de> for State {
1215 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1216 where
1217 D: serde::Deserializer<'de>,
1218 {
1219 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1220 ".google.cloud.securityposture.v1.Posture.State",
1221 ))
1222 }
1223 }
1224}
1225
1226#[serde_with::serde_as]
1228#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1229#[serde(default, rename_all = "camelCase")]
1230#[non_exhaustive]
1231pub struct PolicySet {
1232 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1234 pub policy_set_id: std::string::String,
1235
1236 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1238 pub description: std::string::String,
1239
1240 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1242 pub policies: std::vec::Vec<crate::model::Policy>,
1243
1244 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1245 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1246}
1247
1248impl PolicySet {
1249 pub fn new() -> Self {
1250 std::default::Default::default()
1251 }
1252
1253 pub fn set_policy_set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1255 self.policy_set_id = v.into();
1256 self
1257 }
1258
1259 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.description = v.into();
1262 self
1263 }
1264
1265 pub fn set_policies<T, V>(mut self, v: T) -> Self
1267 where
1268 T: std::iter::IntoIterator<Item = V>,
1269 V: std::convert::Into<crate::model::Policy>,
1270 {
1271 use std::iter::Iterator;
1272 self.policies = v.into_iter().map(|i| i.into()).collect();
1273 self
1274 }
1275}
1276
1277impl wkt::message::Message for PolicySet {
1278 fn typename() -> &'static str {
1279 "type.googleapis.com/google.cloud.securityposture.v1.PolicySet"
1280 }
1281}
1282
1283#[serde_with::serde_as]
1285#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1286#[serde(default, rename_all = "camelCase")]
1287#[non_exhaustive]
1288pub struct Policy {
1289 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1292 pub policy_id: std::string::String,
1293
1294 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1296 pub compliance_standards: std::vec::Vec<crate::model::policy::ComplianceStandard>,
1297
1298 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1300 pub constraint: std::option::Option<crate::model::Constraint>,
1301
1302 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1304 pub description: std::string::String,
1305
1306 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1307 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1308}
1309
1310impl Policy {
1311 pub fn new() -> Self {
1312 std::default::Default::default()
1313 }
1314
1315 pub fn set_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1317 self.policy_id = v.into();
1318 self
1319 }
1320
1321 pub fn set_compliance_standards<T, V>(mut self, v: T) -> Self
1323 where
1324 T: std::iter::IntoIterator<Item = V>,
1325 V: std::convert::Into<crate::model::policy::ComplianceStandard>,
1326 {
1327 use std::iter::Iterator;
1328 self.compliance_standards = v.into_iter().map(|i| i.into()).collect();
1329 self
1330 }
1331
1332 pub fn set_constraint<T: std::convert::Into<std::option::Option<crate::model::Constraint>>>(
1334 mut self,
1335 v: T,
1336 ) -> Self {
1337 self.constraint = v.into();
1338 self
1339 }
1340
1341 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1343 self.description = v.into();
1344 self
1345 }
1346}
1347
1348impl wkt::message::Message for Policy {
1349 fn typename() -> &'static str {
1350 "type.googleapis.com/google.cloud.securityposture.v1.Policy"
1351 }
1352}
1353
1354pub mod policy {
1356 #[allow(unused_imports)]
1357 use super::*;
1358
1359 #[serde_with::serde_as]
1361 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1362 #[serde(default, rename_all = "camelCase")]
1363 #[non_exhaustive]
1364 pub struct ComplianceStandard {
1365 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1367 pub standard: std::string::String,
1368
1369 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1371 pub control: std::string::String,
1372
1373 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1374 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1375 }
1376
1377 impl ComplianceStandard {
1378 pub fn new() -> Self {
1379 std::default::Default::default()
1380 }
1381
1382 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1384 self.standard = v.into();
1385 self
1386 }
1387
1388 pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1390 self.control = v.into();
1391 self
1392 }
1393 }
1394
1395 impl wkt::message::Message for ComplianceStandard {
1396 fn typename() -> &'static str {
1397 "type.googleapis.com/google.cloud.securityposture.v1.Policy.ComplianceStandard"
1398 }
1399 }
1400}
1401
1402#[serde_with::serde_as]
1404#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1405#[serde(default, rename_all = "camelCase")]
1406#[non_exhaustive]
1407pub struct Constraint {
1408 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1409 pub implementation: std::option::Option<crate::model::constraint::Implementation>,
1410
1411 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1412 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1413}
1414
1415impl Constraint {
1416 pub fn new() -> Self {
1417 std::default::Default::default()
1418 }
1419
1420 pub fn set_implementation<
1425 T: std::convert::Into<std::option::Option<crate::model::constraint::Implementation>>,
1426 >(
1427 mut self,
1428 v: T,
1429 ) -> Self {
1430 self.implementation = v.into();
1431 self
1432 }
1433
1434 pub fn security_health_analytics_module(
1438 &self,
1439 ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>> {
1440 #[allow(unreachable_patterns)]
1441 self.implementation.as_ref().and_then(|v| match v {
1442 crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v) => {
1443 std::option::Option::Some(v)
1444 }
1445 _ => std::option::Option::None,
1446 })
1447 }
1448
1449 pub fn set_security_health_analytics_module<
1455 T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>>,
1456 >(
1457 mut self,
1458 v: T,
1459 ) -> Self {
1460 self.implementation = std::option::Option::Some(
1461 crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v.into()),
1462 );
1463 self
1464 }
1465
1466 pub fn security_health_analytics_custom_module(
1470 &self,
1471 ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>
1472 {
1473 #[allow(unreachable_patterns)]
1474 self.implementation.as_ref().and_then(|v| match v {
1475 crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v) => {
1476 std::option::Option::Some(v)
1477 }
1478 _ => std::option::Option::None,
1479 })
1480 }
1481
1482 pub fn set_security_health_analytics_custom_module<
1488 T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>,
1489 >(
1490 mut self,
1491 v: T,
1492 ) -> Self {
1493 self.implementation = std::option::Option::Some(
1494 crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v.into()),
1495 );
1496 self
1497 }
1498
1499 pub fn org_policy_constraint(
1503 &self,
1504 ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraint>> {
1505 #[allow(unreachable_patterns)]
1506 self.implementation.as_ref().and_then(|v| match v {
1507 crate::model::constraint::Implementation::OrgPolicyConstraint(v) => {
1508 std::option::Option::Some(v)
1509 }
1510 _ => std::option::Option::None,
1511 })
1512 }
1513
1514 pub fn set_org_policy_constraint<
1520 T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraint>>,
1521 >(
1522 mut self,
1523 v: T,
1524 ) -> Self {
1525 self.implementation = std::option::Option::Some(
1526 crate::model::constraint::Implementation::OrgPolicyConstraint(v.into()),
1527 );
1528 self
1529 }
1530
1531 pub fn org_policy_constraint_custom(
1535 &self,
1536 ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraintCustom>> {
1537 #[allow(unreachable_patterns)]
1538 self.implementation.as_ref().and_then(|v| match v {
1539 crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v) => {
1540 std::option::Option::Some(v)
1541 }
1542 _ => std::option::Option::None,
1543 })
1544 }
1545
1546 pub fn set_org_policy_constraint_custom<
1552 T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraintCustom>>,
1553 >(
1554 mut self,
1555 v: T,
1556 ) -> Self {
1557 self.implementation = std::option::Option::Some(
1558 crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v.into()),
1559 );
1560 self
1561 }
1562}
1563
1564impl wkt::message::Message for Constraint {
1565 fn typename() -> &'static str {
1566 "type.googleapis.com/google.cloud.securityposture.v1.Constraint"
1567 }
1568}
1569
1570pub mod constraint {
1572 #[allow(unused_imports)]
1573 use super::*;
1574
1575 #[serde_with::serde_as]
1576 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1577 #[serde(rename_all = "camelCase")]
1578 #[non_exhaustive]
1579 pub enum Implementation {
1580 SecurityHealthAnalyticsModule(std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>),
1582 SecurityHealthAnalyticsCustomModule(
1584 std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>,
1585 ),
1586 OrgPolicyConstraint(std::boxed::Box<crate::model::OrgPolicyConstraint>),
1588 OrgPolicyConstraintCustom(std::boxed::Box<crate::model::OrgPolicyConstraintCustom>),
1590 }
1591}
1592
1593#[serde_with::serde_as]
1595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1596#[serde(default, rename_all = "camelCase")]
1597#[non_exhaustive]
1598pub struct ListPosturesRequest {
1599 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1601 pub parent: std::string::String,
1602
1603 #[serde(skip_serializing_if = "wkt::internal::is_default")]
1606 pub page_size: i32,
1607
1608 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1610 pub page_token: std::string::String,
1611
1612 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1613 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1614}
1615
1616impl ListPosturesRequest {
1617 pub fn new() -> Self {
1618 std::default::Default::default()
1619 }
1620
1621 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.parent = v.into();
1624 self
1625 }
1626
1627 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1629 self.page_size = v.into();
1630 self
1631 }
1632
1633 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.page_token = v.into();
1636 self
1637 }
1638}
1639
1640impl wkt::message::Message for ListPosturesRequest {
1641 fn typename() -> &'static str {
1642 "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesRequest"
1643 }
1644}
1645
1646#[serde_with::serde_as]
1648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1649#[serde(default, rename_all = "camelCase")]
1650#[non_exhaustive]
1651pub struct ListPosturesResponse {
1652 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1654 pub postures: std::vec::Vec<crate::model::Posture>,
1655
1656 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1658 pub next_page_token: std::string::String,
1659
1660 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1662 pub unreachable: std::vec::Vec<std::string::String>,
1663
1664 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1665 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1666}
1667
1668impl ListPosturesResponse {
1669 pub fn new() -> Self {
1670 std::default::Default::default()
1671 }
1672
1673 pub fn set_postures<T, V>(mut self, v: T) -> Self
1675 where
1676 T: std::iter::IntoIterator<Item = V>,
1677 V: std::convert::Into<crate::model::Posture>,
1678 {
1679 use std::iter::Iterator;
1680 self.postures = v.into_iter().map(|i| i.into()).collect();
1681 self
1682 }
1683
1684 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1686 self.next_page_token = v.into();
1687 self
1688 }
1689
1690 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1692 where
1693 T: std::iter::IntoIterator<Item = V>,
1694 V: std::convert::Into<std::string::String>,
1695 {
1696 use std::iter::Iterator;
1697 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1698 self
1699 }
1700}
1701
1702impl wkt::message::Message for ListPosturesResponse {
1703 fn typename() -> &'static str {
1704 "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesResponse"
1705 }
1706}
1707
1708#[doc(hidden)]
1709impl gax::paginator::internal::PageableResponse for ListPosturesResponse {
1710 type PageItem = crate::model::Posture;
1711
1712 fn items(self) -> std::vec::Vec<Self::PageItem> {
1713 self.postures
1714 }
1715
1716 fn next_page_token(&self) -> std::string::String {
1717 use std::clone::Clone;
1718 self.next_page_token.clone()
1719 }
1720}
1721
1722#[serde_with::serde_as]
1724#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1725#[serde(default, rename_all = "camelCase")]
1726#[non_exhaustive]
1727pub struct ListPostureRevisionsRequest {
1728 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1730 pub name: std::string::String,
1731
1732 #[serde(skip_serializing_if = "wkt::internal::is_default")]
1735 pub page_size: i32,
1736
1737 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1739 pub page_token: std::string::String,
1740
1741 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1742 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1743}
1744
1745impl ListPostureRevisionsRequest {
1746 pub fn new() -> Self {
1747 std::default::Default::default()
1748 }
1749
1750 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1752 self.name = v.into();
1753 self
1754 }
1755
1756 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1758 self.page_size = v.into();
1759 self
1760 }
1761
1762 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.page_token = v.into();
1765 self
1766 }
1767}
1768
1769impl wkt::message::Message for ListPostureRevisionsRequest {
1770 fn typename() -> &'static str {
1771 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsRequest"
1772 }
1773}
1774
1775#[serde_with::serde_as]
1777#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1778#[serde(default, rename_all = "camelCase")]
1779#[non_exhaustive]
1780pub struct ListPostureRevisionsResponse {
1781 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1783 pub revisions: std::vec::Vec<crate::model::Posture>,
1784
1785 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1787 pub next_page_token: std::string::String,
1788
1789 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1790 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1791}
1792
1793impl ListPostureRevisionsResponse {
1794 pub fn new() -> Self {
1795 std::default::Default::default()
1796 }
1797
1798 pub fn set_revisions<T, V>(mut self, v: T) -> Self
1800 where
1801 T: std::iter::IntoIterator<Item = V>,
1802 V: std::convert::Into<crate::model::Posture>,
1803 {
1804 use std::iter::Iterator;
1805 self.revisions = v.into_iter().map(|i| i.into()).collect();
1806 self
1807 }
1808
1809 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.next_page_token = v.into();
1812 self
1813 }
1814}
1815
1816impl wkt::message::Message for ListPostureRevisionsResponse {
1817 fn typename() -> &'static str {
1818 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsResponse"
1819 }
1820}
1821
1822#[doc(hidden)]
1823impl gax::paginator::internal::PageableResponse for ListPostureRevisionsResponse {
1824 type PageItem = crate::model::Posture;
1825
1826 fn items(self) -> std::vec::Vec<Self::PageItem> {
1827 self.revisions
1828 }
1829
1830 fn next_page_token(&self) -> std::string::String {
1831 use std::clone::Clone;
1832 self.next_page_token.clone()
1833 }
1834}
1835
1836#[serde_with::serde_as]
1838#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1839#[serde(default, rename_all = "camelCase")]
1840#[non_exhaustive]
1841pub struct GetPostureRequest {
1842 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1844 pub name: std::string::String,
1845
1846 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1848 pub revision_id: std::string::String,
1849
1850 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1851 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1852}
1853
1854impl GetPostureRequest {
1855 pub fn new() -> Self {
1856 std::default::Default::default()
1857 }
1858
1859 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1861 self.name = v.into();
1862 self
1863 }
1864
1865 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1867 self.revision_id = v.into();
1868 self
1869 }
1870}
1871
1872impl wkt::message::Message for GetPostureRequest {
1873 fn typename() -> &'static str {
1874 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureRequest"
1875 }
1876}
1877
1878#[serde_with::serde_as]
1880#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1881#[serde(default, rename_all = "camelCase")]
1882#[non_exhaustive]
1883pub struct CreatePostureRequest {
1884 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1886 pub parent: std::string::String,
1887
1888 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1891 pub posture_id: std::string::String,
1892
1893 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1895 pub posture: std::option::Option<crate::model::Posture>,
1896
1897 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1898 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1899}
1900
1901impl CreatePostureRequest {
1902 pub fn new() -> Self {
1903 std::default::Default::default()
1904 }
1905
1906 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1908 self.parent = v.into();
1909 self
1910 }
1911
1912 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1914 self.posture_id = v.into();
1915 self
1916 }
1917
1918 pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1920 mut self,
1921 v: T,
1922 ) -> Self {
1923 self.posture = v.into();
1924 self
1925 }
1926}
1927
1928impl wkt::message::Message for CreatePostureRequest {
1929 fn typename() -> &'static str {
1930 "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureRequest"
1931 }
1932}
1933
1934#[serde_with::serde_as]
1936#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1937#[serde(default, rename_all = "camelCase")]
1938#[non_exhaustive]
1939pub struct UpdatePostureRequest {
1940 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1946 pub update_mask: std::option::Option<wkt::FieldMask>,
1947
1948 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1950 pub posture: std::option::Option<crate::model::Posture>,
1951
1952 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1954 pub revision_id: std::string::String,
1955
1956 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1957 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1958}
1959
1960impl UpdatePostureRequest {
1961 pub fn new() -> Self {
1962 std::default::Default::default()
1963 }
1964
1965 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1967 mut self,
1968 v: T,
1969 ) -> Self {
1970 self.update_mask = v.into();
1971 self
1972 }
1973
1974 pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1976 mut self,
1977 v: T,
1978 ) -> Self {
1979 self.posture = v.into();
1980 self
1981 }
1982
1983 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1985 self.revision_id = v.into();
1986 self
1987 }
1988}
1989
1990impl wkt::message::Message for UpdatePostureRequest {
1991 fn typename() -> &'static str {
1992 "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureRequest"
1993 }
1994}
1995
1996#[serde_with::serde_as]
1998#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1999#[serde(default, rename_all = "camelCase")]
2000#[non_exhaustive]
2001pub struct DeletePostureRequest {
2002 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2004 pub name: std::string::String,
2005
2006 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2008 pub etag: std::string::String,
2009
2010 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2011 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2012}
2013
2014impl DeletePostureRequest {
2015 pub fn new() -> Self {
2016 std::default::Default::default()
2017 }
2018
2019 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.name = v.into();
2022 self
2023 }
2024
2025 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2027 self.etag = v.into();
2028 self
2029 }
2030}
2031
2032impl wkt::message::Message for DeletePostureRequest {
2033 fn typename() -> &'static str {
2034 "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureRequest"
2035 }
2036}
2037
2038#[serde_with::serde_as]
2040#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2041#[serde(default, rename_all = "camelCase")]
2042#[non_exhaustive]
2043pub struct ExtractPostureRequest {
2044 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2047 pub parent: std::string::String,
2048
2049 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2052 pub posture_id: std::string::String,
2053
2054 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2062 pub workload: std::string::String,
2063
2064 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2065 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2066}
2067
2068impl ExtractPostureRequest {
2069 pub fn new() -> Self {
2070 std::default::Default::default()
2071 }
2072
2073 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2075 self.parent = v.into();
2076 self
2077 }
2078
2079 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2081 self.posture_id = v.into();
2082 self
2083 }
2084
2085 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2087 self.workload = v.into();
2088 self
2089 }
2090}
2091
2092impl wkt::message::Message for ExtractPostureRequest {
2093 fn typename() -> &'static str {
2094 "type.googleapis.com/google.cloud.securityposture.v1.ExtractPostureRequest"
2095 }
2096}
2097
2098#[serde_with::serde_as]
2101#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2102#[serde(default, rename_all = "camelCase")]
2103#[non_exhaustive]
2104pub struct PostureDeployment {
2105 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2108 pub name: std::string::String,
2109
2110 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2114 pub target_resource: std::string::String,
2115
2116 pub state: crate::model::posture_deployment::State,
2118
2119 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2125 pub posture_id: std::string::String,
2126
2127 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2129 pub posture_revision_id: std::string::String,
2130
2131 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2133 pub create_time: std::option::Option<wkt::Timestamp>,
2134
2135 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2137 pub update_time: std::option::Option<wkt::Timestamp>,
2138
2139 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2141 pub description: std::string::String,
2142
2143 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2155 pub etag: std::string::String,
2156
2157 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2161 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2162
2163 #[serde(skip_serializing_if = "wkt::internal::is_default")]
2166 pub reconciling: bool,
2167
2168 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2172 pub desired_posture_id: std::string::String,
2173
2174 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2177 pub desired_posture_revision_id: std::string::String,
2178
2179 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2183 pub failure_message: std::string::String,
2184
2185 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2186 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2187}
2188
2189impl PostureDeployment {
2190 pub fn new() -> Self {
2191 std::default::Default::default()
2192 }
2193
2194 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.name = v.into();
2197 self
2198 }
2199
2200 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2202 self.target_resource = v.into();
2203 self
2204 }
2205
2206 pub fn set_state<T: std::convert::Into<crate::model::posture_deployment::State>>(
2208 mut self,
2209 v: T,
2210 ) -> Self {
2211 self.state = v.into();
2212 self
2213 }
2214
2215 pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2217 self.posture_id = v.into();
2218 self
2219 }
2220
2221 pub fn set_posture_revision_id<T: std::convert::Into<std::string::String>>(
2223 mut self,
2224 v: T,
2225 ) -> Self {
2226 self.posture_revision_id = v.into();
2227 self
2228 }
2229
2230 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2232 mut self,
2233 v: T,
2234 ) -> Self {
2235 self.create_time = v.into();
2236 self
2237 }
2238
2239 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2241 mut self,
2242 v: T,
2243 ) -> Self {
2244 self.update_time = v.into();
2245 self
2246 }
2247
2248 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2250 self.description = v.into();
2251 self
2252 }
2253
2254 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2256 self.etag = v.into();
2257 self
2258 }
2259
2260 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2262 where
2263 T: std::iter::IntoIterator<Item = (K, V)>,
2264 K: std::convert::Into<std::string::String>,
2265 V: std::convert::Into<std::string::String>,
2266 {
2267 use std::iter::Iterator;
2268 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2269 self
2270 }
2271
2272 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2274 self.reconciling = v.into();
2275 self
2276 }
2277
2278 pub fn set_desired_posture_id<T: std::convert::Into<std::string::String>>(
2280 mut self,
2281 v: T,
2282 ) -> Self {
2283 self.desired_posture_id = v.into();
2284 self
2285 }
2286
2287 pub fn set_desired_posture_revision_id<T: std::convert::Into<std::string::String>>(
2289 mut self,
2290 v: T,
2291 ) -> Self {
2292 self.desired_posture_revision_id = v.into();
2293 self
2294 }
2295
2296 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.failure_message = v.into();
2299 self
2300 }
2301}
2302
2303impl wkt::message::Message for PostureDeployment {
2304 fn typename() -> &'static str {
2305 "type.googleapis.com/google.cloud.securityposture.v1.PostureDeployment"
2306 }
2307}
2308
2309pub mod posture_deployment {
2311 #[allow(unused_imports)]
2312 use super::*;
2313
2314 #[derive(Clone, Debug, PartialEq)]
2330 #[non_exhaustive]
2331 pub enum State {
2332 Unspecified,
2334 Creating,
2336 Deleting,
2338 Updating,
2340 Active,
2342 CreateFailed,
2344 UpdateFailed,
2346 DeleteFailed,
2348 UnknownValue(state::UnknownValue),
2353 }
2354
2355 #[doc(hidden)]
2356 pub mod state {
2357 #[allow(unused_imports)]
2358 use super::*;
2359 #[derive(Clone, Debug, PartialEq)]
2360 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2361 }
2362
2363 impl State {
2364 pub fn value(&self) -> std::option::Option<i32> {
2369 match self {
2370 Self::Unspecified => std::option::Option::Some(0),
2371 Self::Creating => std::option::Option::Some(1),
2372 Self::Deleting => std::option::Option::Some(2),
2373 Self::Updating => std::option::Option::Some(3),
2374 Self::Active => std::option::Option::Some(4),
2375 Self::CreateFailed => std::option::Option::Some(5),
2376 Self::UpdateFailed => std::option::Option::Some(6),
2377 Self::DeleteFailed => std::option::Option::Some(7),
2378 Self::UnknownValue(u) => u.0.value(),
2379 }
2380 }
2381
2382 pub fn name(&self) -> std::option::Option<&str> {
2387 match self {
2388 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2389 Self::Creating => std::option::Option::Some("CREATING"),
2390 Self::Deleting => std::option::Option::Some("DELETING"),
2391 Self::Updating => std::option::Option::Some("UPDATING"),
2392 Self::Active => std::option::Option::Some("ACTIVE"),
2393 Self::CreateFailed => std::option::Option::Some("CREATE_FAILED"),
2394 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
2395 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
2396 Self::UnknownValue(u) => u.0.name(),
2397 }
2398 }
2399 }
2400
2401 impl std::default::Default for State {
2402 fn default() -> Self {
2403 use std::convert::From;
2404 Self::from(0)
2405 }
2406 }
2407
2408 impl std::fmt::Display for State {
2409 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2410 wkt::internal::display_enum(f, self.name(), self.value())
2411 }
2412 }
2413
2414 impl std::convert::From<i32> for State {
2415 fn from(value: i32) -> Self {
2416 match value {
2417 0 => Self::Unspecified,
2418 1 => Self::Creating,
2419 2 => Self::Deleting,
2420 3 => Self::Updating,
2421 4 => Self::Active,
2422 5 => Self::CreateFailed,
2423 6 => Self::UpdateFailed,
2424 7 => Self::DeleteFailed,
2425 _ => Self::UnknownValue(state::UnknownValue(
2426 wkt::internal::UnknownEnumValue::Integer(value),
2427 )),
2428 }
2429 }
2430 }
2431
2432 impl std::convert::From<&str> for State {
2433 fn from(value: &str) -> Self {
2434 use std::string::ToString;
2435 match value {
2436 "STATE_UNSPECIFIED" => Self::Unspecified,
2437 "CREATING" => Self::Creating,
2438 "DELETING" => Self::Deleting,
2439 "UPDATING" => Self::Updating,
2440 "ACTIVE" => Self::Active,
2441 "CREATE_FAILED" => Self::CreateFailed,
2442 "UPDATE_FAILED" => Self::UpdateFailed,
2443 "DELETE_FAILED" => Self::DeleteFailed,
2444 _ => Self::UnknownValue(state::UnknownValue(
2445 wkt::internal::UnknownEnumValue::String(value.to_string()),
2446 )),
2447 }
2448 }
2449 }
2450
2451 impl serde::ser::Serialize for State {
2452 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2453 where
2454 S: serde::Serializer,
2455 {
2456 match self {
2457 Self::Unspecified => serializer.serialize_i32(0),
2458 Self::Creating => serializer.serialize_i32(1),
2459 Self::Deleting => serializer.serialize_i32(2),
2460 Self::Updating => serializer.serialize_i32(3),
2461 Self::Active => serializer.serialize_i32(4),
2462 Self::CreateFailed => serializer.serialize_i32(5),
2463 Self::UpdateFailed => serializer.serialize_i32(6),
2464 Self::DeleteFailed => serializer.serialize_i32(7),
2465 Self::UnknownValue(u) => u.0.serialize(serializer),
2466 }
2467 }
2468 }
2469
2470 impl<'de> serde::de::Deserialize<'de> for State {
2471 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2472 where
2473 D: serde::Deserializer<'de>,
2474 {
2475 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2476 ".google.cloud.securityposture.v1.PostureDeployment.State",
2477 ))
2478 }
2479 }
2480}
2481
2482#[serde_with::serde_as]
2484#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2485#[serde(default, rename_all = "camelCase")]
2486#[non_exhaustive]
2487pub struct ListPostureDeploymentsRequest {
2488 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2490 pub parent: std::string::String,
2491
2492 #[serde(skip_serializing_if = "wkt::internal::is_default")]
2495 pub page_size: i32,
2496
2497 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2499 pub page_token: std::string::String,
2500
2501 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2504 pub filter: std::string::String,
2505
2506 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2507 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2508}
2509
2510impl ListPostureDeploymentsRequest {
2511 pub fn new() -> Self {
2512 std::default::Default::default()
2513 }
2514
2515 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2517 self.parent = v.into();
2518 self
2519 }
2520
2521 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2523 self.page_size = v.into();
2524 self
2525 }
2526
2527 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2529 self.page_token = v.into();
2530 self
2531 }
2532
2533 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2535 self.filter = v.into();
2536 self
2537 }
2538}
2539
2540impl wkt::message::Message for ListPostureDeploymentsRequest {
2541 fn typename() -> &'static str {
2542 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsRequest"
2543 }
2544}
2545
2546#[serde_with::serde_as]
2548#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2549#[serde(default, rename_all = "camelCase")]
2550#[non_exhaustive]
2551pub struct ListPostureDeploymentsResponse {
2552 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2554 pub posture_deployments: std::vec::Vec<crate::model::PostureDeployment>,
2555
2556 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2558 pub next_page_token: std::string::String,
2559
2560 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2562 pub unreachable: std::vec::Vec<std::string::String>,
2563
2564 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2565 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2566}
2567
2568impl ListPostureDeploymentsResponse {
2569 pub fn new() -> Self {
2570 std::default::Default::default()
2571 }
2572
2573 pub fn set_posture_deployments<T, V>(mut self, v: T) -> Self
2575 where
2576 T: std::iter::IntoIterator<Item = V>,
2577 V: std::convert::Into<crate::model::PostureDeployment>,
2578 {
2579 use std::iter::Iterator;
2580 self.posture_deployments = v.into_iter().map(|i| i.into()).collect();
2581 self
2582 }
2583
2584 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2586 self.next_page_token = v.into();
2587 self
2588 }
2589
2590 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2592 where
2593 T: std::iter::IntoIterator<Item = V>,
2594 V: std::convert::Into<std::string::String>,
2595 {
2596 use std::iter::Iterator;
2597 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2598 self
2599 }
2600}
2601
2602impl wkt::message::Message for ListPostureDeploymentsResponse {
2603 fn typename() -> &'static str {
2604 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsResponse"
2605 }
2606}
2607
2608#[doc(hidden)]
2609impl gax::paginator::internal::PageableResponse for ListPostureDeploymentsResponse {
2610 type PageItem = crate::model::PostureDeployment;
2611
2612 fn items(self) -> std::vec::Vec<Self::PageItem> {
2613 self.posture_deployments
2614 }
2615
2616 fn next_page_token(&self) -> std::string::String {
2617 use std::clone::Clone;
2618 self.next_page_token.clone()
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 GetPostureDeploymentRequest {
2628 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2630 pub name: std::string::String,
2631
2632 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2633 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2634}
2635
2636impl GetPostureDeploymentRequest {
2637 pub fn new() -> Self {
2638 std::default::Default::default()
2639 }
2640
2641 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2643 self.name = v.into();
2644 self
2645 }
2646}
2647
2648impl wkt::message::Message for GetPostureDeploymentRequest {
2649 fn typename() -> &'static str {
2650 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureDeploymentRequest"
2651 }
2652}
2653
2654#[serde_with::serde_as]
2656#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2657#[serde(default, rename_all = "camelCase")]
2658#[non_exhaustive]
2659pub struct CreatePostureDeploymentRequest {
2660 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2663 pub parent: std::string::String,
2664
2665 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2668 pub posture_deployment_id: std::string::String,
2669
2670 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2672 pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2673
2674 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2675 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2676}
2677
2678impl CreatePostureDeploymentRequest {
2679 pub fn new() -> Self {
2680 std::default::Default::default()
2681 }
2682
2683 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.parent = v.into();
2686 self
2687 }
2688
2689 pub fn set_posture_deployment_id<T: std::convert::Into<std::string::String>>(
2691 mut self,
2692 v: T,
2693 ) -> Self {
2694 self.posture_deployment_id = v.into();
2695 self
2696 }
2697
2698 pub fn set_posture_deployment<
2700 T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2701 >(
2702 mut self,
2703 v: T,
2704 ) -> Self {
2705 self.posture_deployment = v.into();
2706 self
2707 }
2708}
2709
2710impl wkt::message::Message for CreatePostureDeploymentRequest {
2711 fn typename() -> &'static str {
2712 "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureDeploymentRequest"
2713 }
2714}
2715
2716#[serde_with::serde_as]
2718#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2719#[serde(default, rename_all = "camelCase")]
2720#[non_exhaustive]
2721pub struct UpdatePostureDeploymentRequest {
2722 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2728 pub update_mask: std::option::Option<wkt::FieldMask>,
2729
2730 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2732 pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2733
2734 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2735 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2736}
2737
2738impl UpdatePostureDeploymentRequest {
2739 pub fn new() -> Self {
2740 std::default::Default::default()
2741 }
2742
2743 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2745 mut self,
2746 v: T,
2747 ) -> Self {
2748 self.update_mask = v.into();
2749 self
2750 }
2751
2752 pub fn set_posture_deployment<
2754 T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2755 >(
2756 mut self,
2757 v: T,
2758 ) -> Self {
2759 self.posture_deployment = v.into();
2760 self
2761 }
2762}
2763
2764impl wkt::message::Message for UpdatePostureDeploymentRequest {
2765 fn typename() -> &'static str {
2766 "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureDeploymentRequest"
2767 }
2768}
2769
2770#[serde_with::serde_as]
2772#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2773#[serde(default, rename_all = "camelCase")]
2774#[non_exhaustive]
2775pub struct DeletePostureDeploymentRequest {
2776 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778 pub name: std::string::String,
2779
2780 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2782 pub etag: std::string::String,
2783
2784 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2785 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2786}
2787
2788impl DeletePostureDeploymentRequest {
2789 pub fn new() -> Self {
2790 std::default::Default::default()
2791 }
2792
2793 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2795 self.name = v.into();
2796 self
2797 }
2798
2799 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2801 self.etag = v.into();
2802 self
2803 }
2804}
2805
2806impl wkt::message::Message for DeletePostureDeploymentRequest {
2807 fn typename() -> &'static str {
2808 "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureDeploymentRequest"
2809 }
2810}
2811
2812#[serde_with::serde_as]
2815#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2816#[serde(default, rename_all = "camelCase")]
2817#[non_exhaustive]
2818pub struct PostureTemplate {
2819 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2823 pub name: std::string::String,
2824
2825 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2827 pub revision_id: std::string::String,
2828
2829 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2831 pub description: std::string::String,
2832
2833 pub state: crate::model::posture_template::State,
2835
2836 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2838 pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
2839
2840 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2841 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2842}
2843
2844impl PostureTemplate {
2845 pub fn new() -> Self {
2846 std::default::Default::default()
2847 }
2848
2849 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2851 self.name = v.into();
2852 self
2853 }
2854
2855 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2857 self.revision_id = v.into();
2858 self
2859 }
2860
2861 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2863 self.description = v.into();
2864 self
2865 }
2866
2867 pub fn set_state<T: std::convert::Into<crate::model::posture_template::State>>(
2869 mut self,
2870 v: T,
2871 ) -> Self {
2872 self.state = v.into();
2873 self
2874 }
2875
2876 pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
2878 where
2879 T: std::iter::IntoIterator<Item = V>,
2880 V: std::convert::Into<crate::model::PolicySet>,
2881 {
2882 use std::iter::Iterator;
2883 self.policy_sets = v.into_iter().map(|i| i.into()).collect();
2884 self
2885 }
2886}
2887
2888impl wkt::message::Message for PostureTemplate {
2889 fn typename() -> &'static str {
2890 "type.googleapis.com/google.cloud.securityposture.v1.PostureTemplate"
2891 }
2892}
2893
2894pub mod posture_template {
2896 #[allow(unused_imports)]
2897 use super::*;
2898
2899 #[derive(Clone, Debug, PartialEq)]
2915 #[non_exhaustive]
2916 pub enum State {
2917 Unspecified,
2919 Active,
2921 Deprecated,
2924 UnknownValue(state::UnknownValue),
2929 }
2930
2931 #[doc(hidden)]
2932 pub mod state {
2933 #[allow(unused_imports)]
2934 use super::*;
2935 #[derive(Clone, Debug, PartialEq)]
2936 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2937 }
2938
2939 impl State {
2940 pub fn value(&self) -> std::option::Option<i32> {
2945 match self {
2946 Self::Unspecified => std::option::Option::Some(0),
2947 Self::Active => std::option::Option::Some(1),
2948 Self::Deprecated => std::option::Option::Some(2),
2949 Self::UnknownValue(u) => u.0.value(),
2950 }
2951 }
2952
2953 pub fn name(&self) -> std::option::Option<&str> {
2958 match self {
2959 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2960 Self::Active => std::option::Option::Some("ACTIVE"),
2961 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
2962 Self::UnknownValue(u) => u.0.name(),
2963 }
2964 }
2965 }
2966
2967 impl std::default::Default for State {
2968 fn default() -> Self {
2969 use std::convert::From;
2970 Self::from(0)
2971 }
2972 }
2973
2974 impl std::fmt::Display for State {
2975 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2976 wkt::internal::display_enum(f, self.name(), self.value())
2977 }
2978 }
2979
2980 impl std::convert::From<i32> for State {
2981 fn from(value: i32) -> Self {
2982 match value {
2983 0 => Self::Unspecified,
2984 1 => Self::Active,
2985 2 => Self::Deprecated,
2986 _ => Self::UnknownValue(state::UnknownValue(
2987 wkt::internal::UnknownEnumValue::Integer(value),
2988 )),
2989 }
2990 }
2991 }
2992
2993 impl std::convert::From<&str> for State {
2994 fn from(value: &str) -> Self {
2995 use std::string::ToString;
2996 match value {
2997 "STATE_UNSPECIFIED" => Self::Unspecified,
2998 "ACTIVE" => Self::Active,
2999 "DEPRECATED" => Self::Deprecated,
3000 _ => Self::UnknownValue(state::UnknownValue(
3001 wkt::internal::UnknownEnumValue::String(value.to_string()),
3002 )),
3003 }
3004 }
3005 }
3006
3007 impl serde::ser::Serialize for State {
3008 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3009 where
3010 S: serde::Serializer,
3011 {
3012 match self {
3013 Self::Unspecified => serializer.serialize_i32(0),
3014 Self::Active => serializer.serialize_i32(1),
3015 Self::Deprecated => serializer.serialize_i32(2),
3016 Self::UnknownValue(u) => u.0.serialize(serializer),
3017 }
3018 }
3019 }
3020
3021 impl<'de> serde::de::Deserialize<'de> for State {
3022 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3023 where
3024 D: serde::Deserializer<'de>,
3025 {
3026 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3027 ".google.cloud.securityposture.v1.PostureTemplate.State",
3028 ))
3029 }
3030 }
3031}
3032
3033#[serde_with::serde_as]
3035#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3036#[serde(default, rename_all = "camelCase")]
3037#[non_exhaustive]
3038pub struct ListPostureTemplatesRequest {
3039 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3041 pub parent: std::string::String,
3042
3043 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3046 pub page_size: i32,
3047
3048 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3050 pub page_token: std::string::String,
3051
3052 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3055 pub filter: std::string::String,
3056
3057 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3058 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3059}
3060
3061impl ListPostureTemplatesRequest {
3062 pub fn new() -> Self {
3063 std::default::Default::default()
3064 }
3065
3066 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3068 self.parent = v.into();
3069 self
3070 }
3071
3072 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3074 self.page_size = v.into();
3075 self
3076 }
3077
3078 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080 self.page_token = v.into();
3081 self
3082 }
3083
3084 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086 self.filter = v.into();
3087 self
3088 }
3089}
3090
3091impl wkt::message::Message for ListPostureTemplatesRequest {
3092 fn typename() -> &'static str {
3093 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesRequest"
3094 }
3095}
3096
3097#[serde_with::serde_as]
3099#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3100#[serde(default, rename_all = "camelCase")]
3101#[non_exhaustive]
3102pub struct ListPostureTemplatesResponse {
3103 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3105 pub posture_templates: std::vec::Vec<crate::model::PostureTemplate>,
3106
3107 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3109 pub next_page_token: std::string::String,
3110
3111 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3112 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3113}
3114
3115impl ListPostureTemplatesResponse {
3116 pub fn new() -> Self {
3117 std::default::Default::default()
3118 }
3119
3120 pub fn set_posture_templates<T, V>(mut self, v: T) -> Self
3122 where
3123 T: std::iter::IntoIterator<Item = V>,
3124 V: std::convert::Into<crate::model::PostureTemplate>,
3125 {
3126 use std::iter::Iterator;
3127 self.posture_templates = v.into_iter().map(|i| i.into()).collect();
3128 self
3129 }
3130
3131 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3133 self.next_page_token = v.into();
3134 self
3135 }
3136}
3137
3138impl wkt::message::Message for ListPostureTemplatesResponse {
3139 fn typename() -> &'static str {
3140 "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesResponse"
3141 }
3142}
3143
3144#[doc(hidden)]
3145impl gax::paginator::internal::PageableResponse for ListPostureTemplatesResponse {
3146 type PageItem = crate::model::PostureTemplate;
3147
3148 fn items(self) -> std::vec::Vec<Self::PageItem> {
3149 self.posture_templates
3150 }
3151
3152 fn next_page_token(&self) -> std::string::String {
3153 use std::clone::Clone;
3154 self.next_page_token.clone()
3155 }
3156}
3157
3158#[serde_with::serde_as]
3160#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3161#[serde(default, rename_all = "camelCase")]
3162#[non_exhaustive]
3163pub struct GetPostureTemplateRequest {
3164 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3166 pub name: std::string::String,
3167
3168 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3171 pub revision_id: std::string::String,
3172
3173 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3174 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3175}
3176
3177impl GetPostureTemplateRequest {
3178 pub fn new() -> Self {
3179 std::default::Default::default()
3180 }
3181
3182 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3184 self.name = v.into();
3185 self
3186 }
3187
3188 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3190 self.revision_id = v.into();
3191 self
3192 }
3193}
3194
3195impl wkt::message::Message for GetPostureTemplateRequest {
3196 fn typename() -> &'static str {
3197 "type.googleapis.com/google.cloud.securityposture.v1.GetPostureTemplateRequest"
3198 }
3199}
3200
3201#[serde_with::serde_as]
3203#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3204#[serde(default, rename_all = "camelCase")]
3205#[non_exhaustive]
3206pub struct SecurityHealthAnalyticsModule {
3207 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3209 pub module_name: std::string::String,
3210
3211 pub module_enablement_state: crate::model::EnablementState,
3214
3215 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3216 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3217}
3218
3219impl SecurityHealthAnalyticsModule {
3220 pub fn new() -> Self {
3221 std::default::Default::default()
3222 }
3223
3224 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3226 self.module_name = v.into();
3227 self
3228 }
3229
3230 pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
3232 mut self,
3233 v: T,
3234 ) -> Self {
3235 self.module_enablement_state = v.into();
3236 self
3237 }
3238}
3239
3240impl wkt::message::Message for SecurityHealthAnalyticsModule {
3241 fn typename() -> &'static str {
3242 "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsModule"
3243 }
3244}
3245
3246#[serde_with::serde_as]
3248#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3249#[serde(default, rename_all = "camelCase")]
3250#[non_exhaustive]
3251pub struct SecurityHealthAnalyticsCustomModule {
3252 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3256 pub id: std::string::String,
3257
3258 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3264 pub display_name: std::string::String,
3265
3266 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3268 pub config: std::option::Option<crate::model::CustomConfig>,
3269
3270 pub module_enablement_state: crate::model::EnablementState,
3273
3274 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3275 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3276}
3277
3278impl SecurityHealthAnalyticsCustomModule {
3279 pub fn new() -> Self {
3280 std::default::Default::default()
3281 }
3282
3283 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3285 self.id = v.into();
3286 self
3287 }
3288
3289 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3291 self.display_name = v.into();
3292 self
3293 }
3294
3295 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::CustomConfig>>>(
3297 mut self,
3298 v: T,
3299 ) -> Self {
3300 self.config = v.into();
3301 self
3302 }
3303
3304 pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
3306 mut self,
3307 v: T,
3308 ) -> Self {
3309 self.module_enablement_state = v.into();
3310 self
3311 }
3312}
3313
3314impl wkt::message::Message for SecurityHealthAnalyticsCustomModule {
3315 fn typename() -> &'static str {
3316 "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule"
3317 }
3318}
3319
3320#[serde_with::serde_as]
3324#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3325#[serde(default, rename_all = "camelCase")]
3326#[non_exhaustive]
3327pub struct CustomConfig {
3328 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3331 pub predicate: std::option::Option<gtype::model::Expr>,
3332
3333 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3335 pub custom_output: std::option::Option<crate::model::custom_config::CustomOutputSpec>,
3336
3337 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3340 pub resource_selector: std::option::Option<crate::model::custom_config::ResourceSelector>,
3341
3342 pub severity: crate::model::custom_config::Severity,
3344
3345 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3350 pub description: std::string::String,
3351
3352 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3357 pub recommendation: std::string::String,
3358
3359 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3360 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3361}
3362
3363impl CustomConfig {
3364 pub fn new() -> Self {
3365 std::default::Default::default()
3366 }
3367
3368 pub fn set_predicate<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
3370 mut self,
3371 v: T,
3372 ) -> Self {
3373 self.predicate = v.into();
3374 self
3375 }
3376
3377 pub fn set_custom_output<
3379 T: std::convert::Into<std::option::Option<crate::model::custom_config::CustomOutputSpec>>,
3380 >(
3381 mut self,
3382 v: T,
3383 ) -> Self {
3384 self.custom_output = v.into();
3385 self
3386 }
3387
3388 pub fn set_resource_selector<
3390 T: std::convert::Into<std::option::Option<crate::model::custom_config::ResourceSelector>>,
3391 >(
3392 mut self,
3393 v: T,
3394 ) -> Self {
3395 self.resource_selector = v.into();
3396 self
3397 }
3398
3399 pub fn set_severity<T: std::convert::Into<crate::model::custom_config::Severity>>(
3401 mut self,
3402 v: T,
3403 ) -> Self {
3404 self.severity = v.into();
3405 self
3406 }
3407
3408 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3410 self.description = v.into();
3411 self
3412 }
3413
3414 pub fn set_recommendation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3416 self.recommendation = v.into();
3417 self
3418 }
3419}
3420
3421impl wkt::message::Message for CustomConfig {
3422 fn typename() -> &'static str {
3423 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig"
3424 }
3425}
3426
3427pub mod custom_config {
3429 #[allow(unused_imports)]
3430 use super::*;
3431
3432 #[serde_with::serde_as]
3437 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3438 #[serde(default, rename_all = "camelCase")]
3439 #[non_exhaustive]
3440 pub struct CustomOutputSpec {
3441 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3443 pub properties: std::vec::Vec<crate::model::custom_config::custom_output_spec::Property>,
3444
3445 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3446 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3447 }
3448
3449 impl CustomOutputSpec {
3450 pub fn new() -> Self {
3451 std::default::Default::default()
3452 }
3453
3454 pub fn set_properties<T, V>(mut self, v: T) -> Self
3456 where
3457 T: std::iter::IntoIterator<Item = V>,
3458 V: std::convert::Into<crate::model::custom_config::custom_output_spec::Property>,
3459 {
3460 use std::iter::Iterator;
3461 self.properties = v.into_iter().map(|i| i.into()).collect();
3462 self
3463 }
3464 }
3465
3466 impl wkt::message::Message for CustomOutputSpec {
3467 fn typename() -> &'static str {
3468 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec"
3469 }
3470 }
3471
3472 pub mod custom_output_spec {
3474 #[allow(unused_imports)]
3475 use super::*;
3476
3477 #[serde_with::serde_as]
3479 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3480 #[serde(default, rename_all = "camelCase")]
3481 #[non_exhaustive]
3482 pub struct Property {
3483 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3485 pub name: std::string::String,
3486
3487 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3491 pub value_expression: std::option::Option<gtype::model::Expr>,
3492
3493 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3494 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3495 }
3496
3497 impl Property {
3498 pub fn new() -> Self {
3499 std::default::Default::default()
3500 }
3501
3502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3504 self.name = v.into();
3505 self
3506 }
3507
3508 pub fn set_value_expression<
3510 T: std::convert::Into<std::option::Option<gtype::model::Expr>>,
3511 >(
3512 mut self,
3513 v: T,
3514 ) -> Self {
3515 self.value_expression = v.into();
3516 self
3517 }
3518 }
3519
3520 impl wkt::message::Message for Property {
3521 fn typename() -> &'static str {
3522 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property"
3523 }
3524 }
3525 }
3526
3527 #[serde_with::serde_as]
3529 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3530 #[serde(default, rename_all = "camelCase")]
3531 #[non_exhaustive]
3532 pub struct ResourceSelector {
3533 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3535 pub resource_types: std::vec::Vec<std::string::String>,
3536
3537 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3538 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3539 }
3540
3541 impl ResourceSelector {
3542 pub fn new() -> Self {
3543 std::default::Default::default()
3544 }
3545
3546 pub fn set_resource_types<T, V>(mut self, v: T) -> Self
3548 where
3549 T: std::iter::IntoIterator<Item = V>,
3550 V: std::convert::Into<std::string::String>,
3551 {
3552 use std::iter::Iterator;
3553 self.resource_types = v.into_iter().map(|i| i.into()).collect();
3554 self
3555 }
3556 }
3557
3558 impl wkt::message::Message for ResourceSelector {
3559 fn typename() -> &'static str {
3560 "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.ResourceSelector"
3561 }
3562 }
3563
3564 #[derive(Clone, Debug, PartialEq)]
3580 #[non_exhaustive]
3581 pub enum Severity {
3582 Unspecified,
3584 Critical,
3586 High,
3588 Medium,
3590 Low,
3592 UnknownValue(severity::UnknownValue),
3597 }
3598
3599 #[doc(hidden)]
3600 pub mod severity {
3601 #[allow(unused_imports)]
3602 use super::*;
3603 #[derive(Clone, Debug, PartialEq)]
3604 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3605 }
3606
3607 impl Severity {
3608 pub fn value(&self) -> std::option::Option<i32> {
3613 match self {
3614 Self::Unspecified => std::option::Option::Some(0),
3615 Self::Critical => std::option::Option::Some(1),
3616 Self::High => std::option::Option::Some(2),
3617 Self::Medium => std::option::Option::Some(3),
3618 Self::Low => std::option::Option::Some(4),
3619 Self::UnknownValue(u) => u.0.value(),
3620 }
3621 }
3622
3623 pub fn name(&self) -> std::option::Option<&str> {
3628 match self {
3629 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
3630 Self::Critical => std::option::Option::Some("CRITICAL"),
3631 Self::High => std::option::Option::Some("HIGH"),
3632 Self::Medium => std::option::Option::Some("MEDIUM"),
3633 Self::Low => std::option::Option::Some("LOW"),
3634 Self::UnknownValue(u) => u.0.name(),
3635 }
3636 }
3637 }
3638
3639 impl std::default::Default for Severity {
3640 fn default() -> Self {
3641 use std::convert::From;
3642 Self::from(0)
3643 }
3644 }
3645
3646 impl std::fmt::Display for Severity {
3647 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3648 wkt::internal::display_enum(f, self.name(), self.value())
3649 }
3650 }
3651
3652 impl std::convert::From<i32> for Severity {
3653 fn from(value: i32) -> Self {
3654 match value {
3655 0 => Self::Unspecified,
3656 1 => Self::Critical,
3657 2 => Self::High,
3658 3 => Self::Medium,
3659 4 => Self::Low,
3660 _ => Self::UnknownValue(severity::UnknownValue(
3661 wkt::internal::UnknownEnumValue::Integer(value),
3662 )),
3663 }
3664 }
3665 }
3666
3667 impl std::convert::From<&str> for Severity {
3668 fn from(value: &str) -> Self {
3669 use std::string::ToString;
3670 match value {
3671 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
3672 "CRITICAL" => Self::Critical,
3673 "HIGH" => Self::High,
3674 "MEDIUM" => Self::Medium,
3675 "LOW" => Self::Low,
3676 _ => Self::UnknownValue(severity::UnknownValue(
3677 wkt::internal::UnknownEnumValue::String(value.to_string()),
3678 )),
3679 }
3680 }
3681 }
3682
3683 impl serde::ser::Serialize for Severity {
3684 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3685 where
3686 S: serde::Serializer,
3687 {
3688 match self {
3689 Self::Unspecified => serializer.serialize_i32(0),
3690 Self::Critical => serializer.serialize_i32(1),
3691 Self::High => serializer.serialize_i32(2),
3692 Self::Medium => serializer.serialize_i32(3),
3693 Self::Low => serializer.serialize_i32(4),
3694 Self::UnknownValue(u) => u.0.serialize(serializer),
3695 }
3696 }
3697 }
3698
3699 impl<'de> serde::de::Deserialize<'de> for Severity {
3700 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3701 where
3702 D: serde::Deserializer<'de>,
3703 {
3704 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
3705 ".google.cloud.securityposture.v1.CustomConfig.Severity",
3706 ))
3707 }
3708 }
3709}
3710
3711#[derive(Clone, Debug, PartialEq)]
3727#[non_exhaustive]
3728pub enum EnablementState {
3729 Unspecified,
3731 Enabled,
3733 Disabled,
3735 UnknownValue(enablement_state::UnknownValue),
3740}
3741
3742#[doc(hidden)]
3743pub mod enablement_state {
3744 #[allow(unused_imports)]
3745 use super::*;
3746 #[derive(Clone, Debug, PartialEq)]
3747 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3748}
3749
3750impl EnablementState {
3751 pub fn value(&self) -> std::option::Option<i32> {
3756 match self {
3757 Self::Unspecified => std::option::Option::Some(0),
3758 Self::Enabled => std::option::Option::Some(1),
3759 Self::Disabled => std::option::Option::Some(2),
3760 Self::UnknownValue(u) => u.0.value(),
3761 }
3762 }
3763
3764 pub fn name(&self) -> std::option::Option<&str> {
3769 match self {
3770 Self::Unspecified => std::option::Option::Some("ENABLEMENT_STATE_UNSPECIFIED"),
3771 Self::Enabled => std::option::Option::Some("ENABLED"),
3772 Self::Disabled => std::option::Option::Some("DISABLED"),
3773 Self::UnknownValue(u) => u.0.name(),
3774 }
3775 }
3776}
3777
3778impl std::default::Default for EnablementState {
3779 fn default() -> Self {
3780 use std::convert::From;
3781 Self::from(0)
3782 }
3783}
3784
3785impl std::fmt::Display for EnablementState {
3786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3787 wkt::internal::display_enum(f, self.name(), self.value())
3788 }
3789}
3790
3791impl std::convert::From<i32> for EnablementState {
3792 fn from(value: i32) -> Self {
3793 match value {
3794 0 => Self::Unspecified,
3795 1 => Self::Enabled,
3796 2 => Self::Disabled,
3797 _ => Self::UnknownValue(enablement_state::UnknownValue(
3798 wkt::internal::UnknownEnumValue::Integer(value),
3799 )),
3800 }
3801 }
3802}
3803
3804impl std::convert::From<&str> for EnablementState {
3805 fn from(value: &str) -> Self {
3806 use std::string::ToString;
3807 match value {
3808 "ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
3809 "ENABLED" => Self::Enabled,
3810 "DISABLED" => Self::Disabled,
3811 _ => Self::UnknownValue(enablement_state::UnknownValue(
3812 wkt::internal::UnknownEnumValue::String(value.to_string()),
3813 )),
3814 }
3815 }
3816}
3817
3818impl serde::ser::Serialize for EnablementState {
3819 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3820 where
3821 S: serde::Serializer,
3822 {
3823 match self {
3824 Self::Unspecified => serializer.serialize_i32(0),
3825 Self::Enabled => serializer.serialize_i32(1),
3826 Self::Disabled => serializer.serialize_i32(2),
3827 Self::UnknownValue(u) => u.0.serialize(serializer),
3828 }
3829 }
3830}
3831
3832impl<'de> serde::de::Deserialize<'de> for EnablementState {
3833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3834 where
3835 D: serde::Deserializer<'de>,
3836 {
3837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
3838 ".google.cloud.securityposture.v1.EnablementState",
3839 ))
3840 }
3841}