google_cloud_securityposture_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gtype;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// A rule used to express this policy.
37#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct PolicyRule {
42    /// A condition which determines whether this rule is used
43    /// in the evaluation of the policy. When set, the `expression` field in
44    /// the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
45    /// or "&&" operators. Each subexpression must be of the form
46    /// "resource.matchTag('<ORG_ID>/tag_key_short_name,
47    /// 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
48    /// 'tagValues/value_id')" where key_name and value_name are the resource
49    /// names for Label Keys and Values. These names are available from the Tag
50    /// Manager Service. An example expression is:
51    /// "resource.matchTag('123456789/environment,
52    /// 'prod')" or "resource.matchTagId('tagKeys/123',
53    /// 'tagValues/456')".
54    #[serde(skip_serializing_if = "std::option::Option::is_none")]
55    pub condition: std::option::Option<gtype::model::Expr>,
56
57    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
58    pub kind: std::option::Option<crate::model::policy_rule::Kind>,
59}
60
61impl PolicyRule {
62    pub fn new() -> Self {
63        std::default::Default::default()
64    }
65
66    /// Sets the value of [condition][crate::model::PolicyRule::condition].
67    pub fn set_condition<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
68        mut self,
69        v: T,
70    ) -> Self {
71        self.condition = v.into();
72        self
73    }
74
75    /// Sets the value of `kind`.
76    pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Kind>>>(
77        mut self,
78        v: T,
79    ) -> Self {
80        self.kind = v.into();
81        self
82    }
83
84    /// The value of [kind][crate::model::PolicyRule::kind]
85    /// if it holds a `Values`, `None` if the field is not set or
86    /// holds a different branch.
87    pub fn get_values(
88        &self,
89    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_rule::StringValues>> {
90        #[allow(unreachable_patterns)]
91        self.kind.as_ref().and_then(|v| match v {
92            crate::model::policy_rule::Kind::Values(v) => std::option::Option::Some(v),
93            _ => std::option::Option::None,
94        })
95    }
96
97    /// The value of [kind][crate::model::PolicyRule::kind]
98    /// if it holds a `AllowAll`, `None` if the field is not set or
99    /// holds a different branch.
100    pub fn get_allow_all(&self) -> std::option::Option<&bool> {
101        #[allow(unreachable_patterns)]
102        self.kind.as_ref().and_then(|v| match v {
103            crate::model::policy_rule::Kind::AllowAll(v) => std::option::Option::Some(v),
104            _ => std::option::Option::None,
105        })
106    }
107
108    /// The value of [kind][crate::model::PolicyRule::kind]
109    /// if it holds a `DenyAll`, `None` if the field is not set or
110    /// holds a different branch.
111    pub fn get_deny_all(&self) -> std::option::Option<&bool> {
112        #[allow(unreachable_patterns)]
113        self.kind.as_ref().and_then(|v| match v {
114            crate::model::policy_rule::Kind::DenyAll(v) => std::option::Option::Some(v),
115            _ => std::option::Option::None,
116        })
117    }
118
119    /// The value of [kind][crate::model::PolicyRule::kind]
120    /// if it holds a `Enforce`, `None` if the field is not set or
121    /// holds a different branch.
122    pub fn get_enforce(&self) -> std::option::Option<&bool> {
123        #[allow(unreachable_patterns)]
124        self.kind.as_ref().and_then(|v| match v {
125            crate::model::policy_rule::Kind::Enforce(v) => std::option::Option::Some(v),
126            _ => std::option::Option::None,
127        })
128    }
129
130    /// Sets the value of [kind][crate::model::PolicyRule::kind]
131    /// to hold a `Values`.
132    ///
133    /// Note that all the setters affecting `kind` are
134    /// mutually exclusive.
135    pub fn set_values<
136        T: std::convert::Into<std::boxed::Box<crate::model::policy_rule::StringValues>>,
137    >(
138        mut self,
139        v: T,
140    ) -> Self {
141        self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Values(v.into()));
142        self
143    }
144
145    /// Sets the value of [kind][crate::model::PolicyRule::kind]
146    /// to hold a `AllowAll`.
147    ///
148    /// Note that all the setters affecting `kind` are
149    /// mutually exclusive.
150    pub fn set_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
151        self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::AllowAll(v.into()));
152        self
153    }
154
155    /// Sets the value of [kind][crate::model::PolicyRule::kind]
156    /// to hold a `DenyAll`.
157    ///
158    /// Note that all the setters affecting `kind` are
159    /// mutually exclusive.
160    pub fn set_deny_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
161        self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::DenyAll(v.into()));
162        self
163    }
164
165    /// Sets the value of [kind][crate::model::PolicyRule::kind]
166    /// to hold a `Enforce`.
167    ///
168    /// Note that all the setters affecting `kind` are
169    /// mutually exclusive.
170    pub fn set_enforce<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
171        self.kind = std::option::Option::Some(crate::model::policy_rule::Kind::Enforce(v.into()));
172        self
173    }
174}
175
176impl wkt::message::Message for PolicyRule {
177    fn typename() -> &'static str {
178        "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule"
179    }
180}
181
182/// Defines additional types related to PolicyRule
183pub mod policy_rule {
184    #[allow(unused_imports)]
185    use super::*;
186
187    /// A message that holds specific allowed and denied values.
188    /// This message can define specific values and subtrees of the Resource
189    /// Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
190    /// are allowed or denied. This is achieved by using the `under:` and
191    /// optional `is:` prefixes.
192    /// The `under:` prefix is used to denote resource subtree values.
193    /// The `is:` prefix is used to denote specific values, and is required only
194    /// if the value contains a ":". Values prefixed with "is:" are treated the
195    /// same as values with no prefix.
196    /// Ancestry subtrees must be in one of the following formats:
197    ///
198    /// - `projects/<project-id>` (for example, `projects/tokyo-rain-123`)
199    /// - `folders/<folder-id>` (for example, `folders/1234`)
200    /// - `organizations/<organization-id>` (for example, `organizations/1234`)
201    ///
202    /// The `supports_under` field of the associated `Constraint`  defines
203    /// whether ancestry prefixes can be used.
204    #[serde_with::serde_as]
205    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
206    #[serde(default, rename_all = "camelCase")]
207    #[non_exhaustive]
208    pub struct StringValues {
209        /// List of values allowed at this resource.
210        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
211        pub allowed_values: std::vec::Vec<std::string::String>,
212
213        /// List of values denied at this resource.
214        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
215        pub denied_values: std::vec::Vec<std::string::String>,
216    }
217
218    impl StringValues {
219        pub fn new() -> Self {
220            std::default::Default::default()
221        }
222
223        /// Sets the value of [allowed_values][crate::model::policy_rule::StringValues::allowed_values].
224        pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
225        where
226            T: std::iter::IntoIterator<Item = V>,
227            V: std::convert::Into<std::string::String>,
228        {
229            use std::iter::Iterator;
230            self.allowed_values = v.into_iter().map(|i| i.into()).collect();
231            self
232        }
233
234        /// Sets the value of [denied_values][crate::model::policy_rule::StringValues::denied_values].
235        pub fn set_denied_values<T, V>(mut self, v: T) -> Self
236        where
237            T: std::iter::IntoIterator<Item = V>,
238            V: std::convert::Into<std::string::String>,
239        {
240            use std::iter::Iterator;
241            self.denied_values = v.into_iter().map(|i| i.into()).collect();
242            self
243        }
244    }
245
246    impl wkt::message::Message for StringValues {
247        fn typename() -> &'static str {
248            "type.googleapis.com/google.cloud.securityposture.v1.PolicyRule.StringValues"
249        }
250    }
251
252    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
253    #[serde(rename_all = "camelCase")]
254    #[non_exhaustive]
255    pub enum Kind {
256        /// List of values to be used for this policy rule. This field can be set
257        /// only in policies for list constraints.
258        Values(std::boxed::Box<crate::model::policy_rule::StringValues>),
259        /// Setting this to true means that all values are allowed. This field can
260        /// be set only in policies for list constraints.
261        AllowAll(bool),
262        /// Setting this to true means that all values are denied. This field can
263        /// be set only in policies for list constraints.
264        DenyAll(bool),
265        /// If `true`, then the policy is enforced. If `false`, then any
266        /// configuration is acceptable.
267        /// This field can be set only in policies for boolean constraints.
268        Enforce(bool),
269    }
270}
271
272/// A custom constraint defined by customers which can *only* be applied to the
273/// given resource types and organization.
274///
275/// By creating a custom constraint, customers can apply policies of this
276/// custom constraint. *Creating a custom constraint itself does NOT apply any
277/// policy enforcement*.
278#[serde_with::serde_as]
279#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
280#[serde(default, rename_all = "camelCase")]
281#[non_exhaustive]
282pub struct CustomConstraint {
283    /// Immutable. Name of the constraint. This is unique within the organization.
284    /// Format of the name should be
285    ///
286    ///
287    /// `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
288    ///
289    /// Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
290    ///
291    /// The max length is 70 characters and the minimum length is 1. Note that the
292    /// prefix `organizations/{organization_id}/customConstraints/` is not counted.
293    #[serde(skip_serializing_if = "std::string::String::is_empty")]
294    pub name: std::string::String,
295
296    /// Immutable. The resource instance type on which this policy applies. Format
297    /// will be of the form : `<canonical service name>/<type>` Example:
298    ///
299    /// - `compute.googleapis.com/Instance`.
300    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
301    pub resource_types: std::vec::Vec<std::string::String>,
302
303    /// All the operations being applied for this constraint.
304    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
305    pub method_types: std::vec::Vec<crate::model::custom_constraint::MethodType>,
306
307    /// Org policy condition/expression. For example:
308    /// `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
309    /// `resource.management.auto_upgrade == true`
310    ///
311    /// The max length of the condition is 1000 characters.
312    #[serde(skip_serializing_if = "std::string::String::is_empty")]
313    pub condition: std::string::String,
314
315    /// Allow or deny type.
316    pub action_type: crate::model::custom_constraint::ActionType,
317
318    /// One line display name for the UI.
319    /// The max length of the display_name is 200 characters.
320    #[serde(skip_serializing_if = "std::string::String::is_empty")]
321    pub display_name: std::string::String,
322
323    /// Detailed information about this custom policy constraint.
324    /// The max length of the description is 2000 characters.
325    #[serde(skip_serializing_if = "std::string::String::is_empty")]
326    pub description: std::string::String,
327
328    /// Output only. The last time this custom constraint was updated. This
329    /// represents the last time that the `CreateCustomConstraint` or
330    /// `UpdateCustomConstraint` RPC was called
331    #[serde(skip_serializing_if = "std::option::Option::is_none")]
332    pub update_time: std::option::Option<wkt::Timestamp>,
333}
334
335impl CustomConstraint {
336    pub fn new() -> Self {
337        std::default::Default::default()
338    }
339
340    /// Sets the value of [name][crate::model::CustomConstraint::name].
341    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
342        self.name = v.into();
343        self
344    }
345
346    /// Sets the value of [condition][crate::model::CustomConstraint::condition].
347    pub fn set_condition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
348        self.condition = v.into();
349        self
350    }
351
352    /// Sets the value of [action_type][crate::model::CustomConstraint::action_type].
353    pub fn set_action_type<T: std::convert::Into<crate::model::custom_constraint::ActionType>>(
354        mut self,
355        v: T,
356    ) -> Self {
357        self.action_type = v.into();
358        self
359    }
360
361    /// Sets the value of [display_name][crate::model::CustomConstraint::display_name].
362    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363        self.display_name = v.into();
364        self
365    }
366
367    /// Sets the value of [description][crate::model::CustomConstraint::description].
368    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
369        self.description = v.into();
370        self
371    }
372
373    /// Sets the value of [update_time][crate::model::CustomConstraint::update_time].
374    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
375        mut self,
376        v: T,
377    ) -> Self {
378        self.update_time = v.into();
379        self
380    }
381
382    /// Sets the value of [resource_types][crate::model::CustomConstraint::resource_types].
383    pub fn set_resource_types<T, V>(mut self, v: T) -> Self
384    where
385        T: std::iter::IntoIterator<Item = V>,
386        V: std::convert::Into<std::string::String>,
387    {
388        use std::iter::Iterator;
389        self.resource_types = v.into_iter().map(|i| i.into()).collect();
390        self
391    }
392
393    /// Sets the value of [method_types][crate::model::CustomConstraint::method_types].
394    pub fn set_method_types<T, V>(mut self, v: T) -> Self
395    where
396        T: std::iter::IntoIterator<Item = V>,
397        V: std::convert::Into<crate::model::custom_constraint::MethodType>,
398    {
399        use std::iter::Iterator;
400        self.method_types = v.into_iter().map(|i| i.into()).collect();
401        self
402    }
403}
404
405impl wkt::message::Message for CustomConstraint {
406    fn typename() -> &'static str {
407        "type.googleapis.com/google.cloud.securityposture.v1.CustomConstraint"
408    }
409}
410
411/// Defines additional types related to CustomConstraint
412pub mod custom_constraint {
413    #[allow(unused_imports)]
414    use super::*;
415
416    /// The operation for which this constraint will be applied. To apply this
417    /// constraint only when creating new VMs, the `method_types` should be
418    /// `CREATE` only. To apply this constraint when creating or deleting
419    /// VMs, the `method_types` should be `CREATE` and `DELETE`.
420    ///
421    /// `UPDATE` only custom constraints are not supported. Use `CREATE` or
422    /// `CREATE, UPDATE`.
423    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
424    pub struct MethodType(std::borrow::Cow<'static, str>);
425
426    impl MethodType {
427        /// Creates a new MethodType instance.
428        pub const fn new(v: &'static str) -> Self {
429            Self(std::borrow::Cow::Borrowed(v))
430        }
431
432        /// Gets the enum value.
433        pub fn value(&self) -> &str {
434            &self.0
435        }
436    }
437
438    /// Useful constants to work with [MethodType](MethodType)
439    pub mod method_type {
440        use super::MethodType;
441
442        /// Unspecified. Results in an error.
443        pub const METHOD_TYPE_UNSPECIFIED: MethodType = MethodType::new("METHOD_TYPE_UNSPECIFIED");
444
445        /// Constraint applied when creating the resource.
446        pub const CREATE: MethodType = MethodType::new("CREATE");
447
448        /// Constraint applied when updating the resource.
449        pub const UPDATE: MethodType = MethodType::new("UPDATE");
450
451        /// Constraint applied when deleting the resource.
452        /// Not supported yet.
453        pub const DELETE: MethodType = MethodType::new("DELETE");
454    }
455
456    impl std::convert::From<std::string::String> for MethodType {
457        fn from(value: std::string::String) -> Self {
458            Self(std::borrow::Cow::Owned(value))
459        }
460    }
461
462    /// Allow or deny type.
463    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
464    pub struct ActionType(std::borrow::Cow<'static, str>);
465
466    impl ActionType {
467        /// Creates a new ActionType instance.
468        pub const fn new(v: &'static str) -> Self {
469            Self(std::borrow::Cow::Borrowed(v))
470        }
471
472        /// Gets the enum value.
473        pub fn value(&self) -> &str {
474            &self.0
475        }
476    }
477
478    /// Useful constants to work with [ActionType](ActionType)
479    pub mod action_type {
480        use super::ActionType;
481
482        /// Unspecified. Results in an error.
483        pub const ACTION_TYPE_UNSPECIFIED: ActionType = ActionType::new("ACTION_TYPE_UNSPECIFIED");
484
485        /// Allowed action type.
486        pub const ALLOW: ActionType = ActionType::new("ALLOW");
487
488        /// Deny action type.
489        pub const DENY: ActionType = ActionType::new("DENY");
490    }
491
492    impl std::convert::From<std::string::String> for ActionType {
493        fn from(value: std::string::String) -> Self {
494            Self(std::borrow::Cow::Owned(value))
495        }
496    }
497}
498
499/// Message for Org Policy Canned Constraint.
500#[serde_with::serde_as]
501#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
502#[serde(default, rename_all = "camelCase")]
503#[non_exhaustive]
504pub struct OrgPolicyConstraint {
505    /// Required. Org Policy Canned Constraint id.
506    #[serde(skip_serializing_if = "std::string::String::is_empty")]
507    pub canned_constraint_id: std::string::String,
508
509    /// Required. Org PolicySpec rules.
510    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
511    pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
512}
513
514impl OrgPolicyConstraint {
515    pub fn new() -> Self {
516        std::default::Default::default()
517    }
518
519    /// Sets the value of [canned_constraint_id][crate::model::OrgPolicyConstraint::canned_constraint_id].
520    pub fn set_canned_constraint_id<T: std::convert::Into<std::string::String>>(
521        mut self,
522        v: T,
523    ) -> Self {
524        self.canned_constraint_id = v.into();
525        self
526    }
527
528    /// Sets the value of [policy_rules][crate::model::OrgPolicyConstraint::policy_rules].
529    pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
530    where
531        T: std::iter::IntoIterator<Item = V>,
532        V: std::convert::Into<crate::model::PolicyRule>,
533    {
534        use std::iter::Iterator;
535        self.policy_rules = v.into_iter().map(|i| i.into()).collect();
536        self
537    }
538}
539
540impl wkt::message::Message for OrgPolicyConstraint {
541    fn typename() -> &'static str {
542        "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraint"
543    }
544}
545
546/// Message for Org Policy Custom Constraint.
547#[serde_with::serde_as]
548#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
549#[serde(default, rename_all = "camelCase")]
550#[non_exhaustive]
551pub struct OrgPolicyConstraintCustom {
552    /// Required. Org Policy Custom Constraint.
553    #[serde(skip_serializing_if = "std::option::Option::is_none")]
554    pub custom_constraint: std::option::Option<crate::model::CustomConstraint>,
555
556    /// Required. Org Policyspec rules.
557    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
558    pub policy_rules: std::vec::Vec<crate::model::PolicyRule>,
559}
560
561impl OrgPolicyConstraintCustom {
562    pub fn new() -> Self {
563        std::default::Default::default()
564    }
565
566    /// Sets the value of [custom_constraint][crate::model::OrgPolicyConstraintCustom::custom_constraint].
567    pub fn set_custom_constraint<
568        T: std::convert::Into<std::option::Option<crate::model::CustomConstraint>>,
569    >(
570        mut self,
571        v: T,
572    ) -> Self {
573        self.custom_constraint = v.into();
574        self
575    }
576
577    /// Sets the value of [policy_rules][crate::model::OrgPolicyConstraintCustom::policy_rules].
578    pub fn set_policy_rules<T, V>(mut self, v: T) -> Self
579    where
580        T: std::iter::IntoIterator<Item = V>,
581        V: std::convert::Into<crate::model::PolicyRule>,
582    {
583        use std::iter::Iterator;
584        self.policy_rules = v.into_iter().map(|i| i.into()).collect();
585        self
586    }
587}
588
589impl wkt::message::Message for OrgPolicyConstraintCustom {
590    fn typename() -> &'static str {
591        "type.googleapis.com/google.cloud.securityposture.v1.OrgPolicyConstraintCustom"
592    }
593}
594
595/// Represents the metadata of the long-running operation.
596#[serde_with::serde_as]
597#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
598#[serde(default, rename_all = "camelCase")]
599#[non_exhaustive]
600pub struct OperationMetadata {
601    /// Output only. The time the operation was created.
602    #[serde(skip_serializing_if = "std::option::Option::is_none")]
603    pub create_time: std::option::Option<wkt::Timestamp>,
604
605    /// Output only. The time the operation finished running.
606    #[serde(skip_serializing_if = "std::option::Option::is_none")]
607    pub end_time: std::option::Option<wkt::Timestamp>,
608
609    /// Output only. Server-defined resource path for the target of the operation.
610    #[serde(skip_serializing_if = "std::string::String::is_empty")]
611    pub target: std::string::String,
612
613    /// Output only. Name of the verb executed by the operation.
614    #[serde(skip_serializing_if = "std::string::String::is_empty")]
615    pub verb: std::string::String,
616
617    /// Output only. Human-readable status of the operation, if any.
618    #[serde(skip_serializing_if = "std::string::String::is_empty")]
619    pub status_message: std::string::String,
620
621    /// Output only. Identifies whether the user has requested cancellation
622    /// of the operation. Operations that have been cancelled successfully
623    /// have [Operation.error][] value with a
624    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
625    /// `Code.CANCELLED`.
626    ///
627    /// [google.rpc.Status.code]: rpc::model::Status::code
628    pub requested_cancellation: bool,
629
630    /// Output only. API version used to start the operation.
631    #[serde(skip_serializing_if = "std::string::String::is_empty")]
632    pub api_version: std::string::String,
633
634    /// Output only. This is a output only optional field which will be filled only
635    /// in cases where PostureDeployments enter failure states like UPDATE_FAILED
636    /// or CREATE_FAILED or DELETE_FAILED.
637    #[serde(skip_serializing_if = "std::string::String::is_empty")]
638    pub error_message: std::string::String,
639}
640
641impl OperationMetadata {
642    pub fn new() -> Self {
643        std::default::Default::default()
644    }
645
646    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
647    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
648        mut self,
649        v: T,
650    ) -> Self {
651        self.create_time = v.into();
652        self
653    }
654
655    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
656    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
657        mut self,
658        v: T,
659    ) -> Self {
660        self.end_time = v.into();
661        self
662    }
663
664    /// Sets the value of [target][crate::model::OperationMetadata::target].
665    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
666        self.target = v.into();
667        self
668    }
669
670    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
671    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672        self.verb = v.into();
673        self
674    }
675
676    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
677    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
678        self.status_message = v.into();
679        self
680    }
681
682    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
683    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
684        self.requested_cancellation = v.into();
685        self
686    }
687
688    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
689    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690        self.api_version = v.into();
691        self
692    }
693
694    /// Sets the value of [error_message][crate::model::OperationMetadata::error_message].
695    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696        self.error_message = v.into();
697        self
698    }
699}
700
701impl wkt::message::Message for OperationMetadata {
702    fn typename() -> &'static str {
703        "type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata"
704    }
705}
706
707/// Postures
708/// Definition of a Posture.
709#[serde_with::serde_as]
710#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
711#[serde(default, rename_all = "camelCase")]
712#[non_exhaustive]
713pub struct Posture {
714    /// Required. Identifier. The name of this Posture resource, in the format of
715    /// organizations/{org_id}/locations/{location_id}/postures/{posture}.
716    #[serde(skip_serializing_if = "std::string::String::is_empty")]
717    pub name: std::string::String,
718
719    /// Required. State of Posture resource.
720    pub state: crate::model::posture::State,
721
722    /// Output only. Immutable. The revision ID of the posture.
723    /// The format is an 8-character hexadecimal string.
724    /// <https://google.aip.dev/162>
725    #[serde(skip_serializing_if = "std::string::String::is_empty")]
726    pub revision_id: std::string::String,
727
728    /// Output only. The timestamp that the posture was created.
729    #[serde(skip_serializing_if = "std::option::Option::is_none")]
730    pub create_time: std::option::Option<wkt::Timestamp>,
731
732    /// Output only. The timestamp that the posture was updated.
733    #[serde(skip_serializing_if = "std::option::Option::is_none")]
734    pub update_time: std::option::Option<wkt::Timestamp>,
735
736    /// Optional. User provided description of the posture.
737    #[serde(skip_serializing_if = "std::string::String::is_empty")]
738    pub description: std::string::String,
739
740    /// Required. List of Policy sets.
741    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
742    pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
743
744    /// Optional. An opaque tag indicating the current version of the Posture, used
745    /// for concurrency control. When the `Posture` is returned from either a
746    /// `GetPosture` or a `ListPostures` request, this `etag` indicates the version
747    /// of the current `Posture` to use when executing a read-modify-write loop.
748    ///
749    /// When the `Posture` is used in a `UpdatePosture` method, use the `etag`
750    /// value that was returned from a `GetPosture` request as part of a
751    /// read-modify-write loop for concurrency control. Not setting the `etag` in a
752    /// `UpdatePosture` request will result in an unconditional write of the
753    /// `Posture`.
754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
755    pub etag: std::string::String,
756
757    /// Optional. User annotations. These attributes can only be set and used by
758    /// the user, and not by Google Security Postures.
759    /// .
760    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
761    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
762
763    /// Output only. Whether or not this Posture is in the process of being
764    /// updated.
765    pub reconciling: bool,
766}
767
768impl Posture {
769    pub fn new() -> Self {
770        std::default::Default::default()
771    }
772
773    /// Sets the value of [name][crate::model::Posture::name].
774    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775        self.name = v.into();
776        self
777    }
778
779    /// Sets the value of [state][crate::model::Posture::state].
780    pub fn set_state<T: std::convert::Into<crate::model::posture::State>>(mut self, v: T) -> Self {
781        self.state = v.into();
782        self
783    }
784
785    /// Sets the value of [revision_id][crate::model::Posture::revision_id].
786    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
787        self.revision_id = v.into();
788        self
789    }
790
791    /// Sets the value of [create_time][crate::model::Posture::create_time].
792    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
793        mut self,
794        v: T,
795    ) -> Self {
796        self.create_time = v.into();
797        self
798    }
799
800    /// Sets the value of [update_time][crate::model::Posture::update_time].
801    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
802        mut self,
803        v: T,
804    ) -> Self {
805        self.update_time = v.into();
806        self
807    }
808
809    /// Sets the value of [description][crate::model::Posture::description].
810    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811        self.description = v.into();
812        self
813    }
814
815    /// Sets the value of [etag][crate::model::Posture::etag].
816    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
817        self.etag = v.into();
818        self
819    }
820
821    /// Sets the value of [reconciling][crate::model::Posture::reconciling].
822    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
823        self.reconciling = v.into();
824        self
825    }
826
827    /// Sets the value of [policy_sets][crate::model::Posture::policy_sets].
828    pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
829    where
830        T: std::iter::IntoIterator<Item = V>,
831        V: std::convert::Into<crate::model::PolicySet>,
832    {
833        use std::iter::Iterator;
834        self.policy_sets = v.into_iter().map(|i| i.into()).collect();
835        self
836    }
837
838    /// Sets the value of [annotations][crate::model::Posture::annotations].
839    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
840    where
841        T: std::iter::IntoIterator<Item = (K, V)>,
842        K: std::convert::Into<std::string::String>,
843        V: std::convert::Into<std::string::String>,
844    {
845        use std::iter::Iterator;
846        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
847        self
848    }
849}
850
851impl wkt::message::Message for Posture {
852    fn typename() -> &'static str {
853        "type.googleapis.com/google.cloud.securityposture.v1.Posture"
854    }
855}
856
857/// Defines additional types related to Posture
858pub mod posture {
859    #[allow(unused_imports)]
860    use super::*;
861
862    /// State of a Posture.
863    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
864    pub struct State(std::borrow::Cow<'static, str>);
865
866    impl State {
867        /// Creates a new State instance.
868        pub const fn new(v: &'static str) -> Self {
869            Self(std::borrow::Cow::Borrowed(v))
870        }
871
872        /// Gets the enum value.
873        pub fn value(&self) -> &str {
874            &self.0
875        }
876    }
877
878    /// Useful constants to work with [State](State)
879    pub mod state {
880        use super::State;
881
882        /// Unspecified operation state.
883        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
884
885        /// The Posture is marked deprecated when it is not in use by the user.
886        pub const DEPRECATED: State = State::new("DEPRECATED");
887
888        /// The Posture is created successfully but is not yet ready for usage.
889        pub const DRAFT: State = State::new("DRAFT");
890
891        /// The Posture state is active. Ready for use/deployments.
892        pub const ACTIVE: State = State::new("ACTIVE");
893    }
894
895    impl std::convert::From<std::string::String> for State {
896        fn from(value: std::string::String) -> Self {
897            Self(std::borrow::Cow::Owned(value))
898        }
899    }
900}
901
902/// PolicySet representation.
903#[serde_with::serde_as]
904#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
905#[serde(default, rename_all = "camelCase")]
906#[non_exhaustive]
907pub struct PolicySet {
908    /// Required. ID of the Policy set.
909    #[serde(skip_serializing_if = "std::string::String::is_empty")]
910    pub policy_set_id: std::string::String,
911
912    /// Optional. Description of the Policy set.
913    #[serde(skip_serializing_if = "std::string::String::is_empty")]
914    pub description: std::string::String,
915
916    /// Required. List of policies.
917    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
918    pub policies: std::vec::Vec<crate::model::Policy>,
919}
920
921impl PolicySet {
922    pub fn new() -> Self {
923        std::default::Default::default()
924    }
925
926    /// Sets the value of [policy_set_id][crate::model::PolicySet::policy_set_id].
927    pub fn set_policy_set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
928        self.policy_set_id = v.into();
929        self
930    }
931
932    /// Sets the value of [description][crate::model::PolicySet::description].
933    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
934        self.description = v.into();
935        self
936    }
937
938    /// Sets the value of [policies][crate::model::PolicySet::policies].
939    pub fn set_policies<T, V>(mut self, v: T) -> Self
940    where
941        T: std::iter::IntoIterator<Item = V>,
942        V: std::convert::Into<crate::model::Policy>,
943    {
944        use std::iter::Iterator;
945        self.policies = v.into_iter().map(|i| i.into()).collect();
946        self
947    }
948}
949
950impl wkt::message::Message for PolicySet {
951    fn typename() -> &'static str {
952        "type.googleapis.com/google.cloud.securityposture.v1.PolicySet"
953    }
954}
955
956/// Policy representation.
957#[serde_with::serde_as]
958#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
959#[serde(default, rename_all = "camelCase")]
960#[non_exhaustive]
961pub struct Policy {
962    /// Required. ID of the Policy that is user generated, immutable and unique
963    /// within the scope of a policy set.
964    #[serde(skip_serializing_if = "std::string::String::is_empty")]
965    pub policy_id: std::string::String,
966
967    /// Optional. Contains list of mapping for a Policy to a standard and control.
968    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
969    pub compliance_standards: std::vec::Vec<crate::model::policy::ComplianceStandard>,
970
971    /// Required. Constraint details.
972    #[serde(skip_serializing_if = "std::option::Option::is_none")]
973    pub constraint: std::option::Option<crate::model::Constraint>,
974
975    /// Optional. Description of the Policy.
976    #[serde(skip_serializing_if = "std::string::String::is_empty")]
977    pub description: std::string::String,
978}
979
980impl Policy {
981    pub fn new() -> Self {
982        std::default::Default::default()
983    }
984
985    /// Sets the value of [policy_id][crate::model::Policy::policy_id].
986    pub fn set_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
987        self.policy_id = v.into();
988        self
989    }
990
991    /// Sets the value of [constraint][crate::model::Policy::constraint].
992    pub fn set_constraint<T: std::convert::Into<std::option::Option<crate::model::Constraint>>>(
993        mut self,
994        v: T,
995    ) -> Self {
996        self.constraint = v.into();
997        self
998    }
999
1000    /// Sets the value of [description][crate::model::Policy::description].
1001    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002        self.description = v.into();
1003        self
1004    }
1005
1006    /// Sets the value of [compliance_standards][crate::model::Policy::compliance_standards].
1007    pub fn set_compliance_standards<T, V>(mut self, v: T) -> Self
1008    where
1009        T: std::iter::IntoIterator<Item = V>,
1010        V: std::convert::Into<crate::model::policy::ComplianceStandard>,
1011    {
1012        use std::iter::Iterator;
1013        self.compliance_standards = v.into_iter().map(|i| i.into()).collect();
1014        self
1015    }
1016}
1017
1018impl wkt::message::Message for Policy {
1019    fn typename() -> &'static str {
1020        "type.googleapis.com/google.cloud.securityposture.v1.Policy"
1021    }
1022}
1023
1024/// Defines additional types related to Policy
1025pub mod policy {
1026    #[allow(unused_imports)]
1027    use super::*;
1028
1029    /// Mapping for a Policy to standard and control.
1030    #[serde_with::serde_as]
1031    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1032    #[serde(default, rename_all = "camelCase")]
1033    #[non_exhaustive]
1034    pub struct ComplianceStandard {
1035        /// Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
1036        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1037        pub standard: std::string::String,
1038
1039        /// Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
1040        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1041        pub control: std::string::String,
1042    }
1043
1044    impl ComplianceStandard {
1045        pub fn new() -> Self {
1046            std::default::Default::default()
1047        }
1048
1049        /// Sets the value of [standard][crate::model::policy::ComplianceStandard::standard].
1050        pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1051            self.standard = v.into();
1052            self
1053        }
1054
1055        /// Sets the value of [control][crate::model::policy::ComplianceStandard::control].
1056        pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057            self.control = v.into();
1058            self
1059        }
1060    }
1061
1062    impl wkt::message::Message for ComplianceStandard {
1063        fn typename() -> &'static str {
1064            "type.googleapis.com/google.cloud.securityposture.v1.Policy.ComplianceStandard"
1065        }
1066    }
1067}
1068
1069/// Representation of a Constraint.
1070#[serde_with::serde_as]
1071#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1072#[serde(default, rename_all = "camelCase")]
1073#[non_exhaustive]
1074pub struct Constraint {
1075    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1076    pub implementation: std::option::Option<crate::model::constraint::Implementation>,
1077}
1078
1079impl Constraint {
1080    pub fn new() -> Self {
1081        std::default::Default::default()
1082    }
1083
1084    /// Sets the value of `implementation`.
1085    pub fn set_implementation<
1086        T: std::convert::Into<std::option::Option<crate::model::constraint::Implementation>>,
1087    >(
1088        mut self,
1089        v: T,
1090    ) -> Self {
1091        self.implementation = v.into();
1092        self
1093    }
1094
1095    /// The value of [implementation][crate::model::Constraint::implementation]
1096    /// if it holds a `SecurityHealthAnalyticsModule`, `None` if the field is not set or
1097    /// holds a different branch.
1098    pub fn get_security_health_analytics_module(
1099        &self,
1100    ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>> {
1101        #[allow(unreachable_patterns)]
1102        self.implementation.as_ref().and_then(|v| match v {
1103            crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v) => {
1104                std::option::Option::Some(v)
1105            }
1106            _ => std::option::Option::None,
1107        })
1108    }
1109
1110    /// The value of [implementation][crate::model::Constraint::implementation]
1111    /// if it holds a `SecurityHealthAnalyticsCustomModule`, `None` if the field is not set or
1112    /// holds a different branch.
1113    pub fn get_security_health_analytics_custom_module(
1114        &self,
1115    ) -> std::option::Option<&std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>
1116    {
1117        #[allow(unreachable_patterns)]
1118        self.implementation.as_ref().and_then(|v| match v {
1119            crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v) => {
1120                std::option::Option::Some(v)
1121            }
1122            _ => std::option::Option::None,
1123        })
1124    }
1125
1126    /// The value of [implementation][crate::model::Constraint::implementation]
1127    /// if it holds a `OrgPolicyConstraint`, `None` if the field is not set or
1128    /// holds a different branch.
1129    pub fn get_org_policy_constraint(
1130        &self,
1131    ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraint>> {
1132        #[allow(unreachable_patterns)]
1133        self.implementation.as_ref().and_then(|v| match v {
1134            crate::model::constraint::Implementation::OrgPolicyConstraint(v) => {
1135                std::option::Option::Some(v)
1136            }
1137            _ => std::option::Option::None,
1138        })
1139    }
1140
1141    /// The value of [implementation][crate::model::Constraint::implementation]
1142    /// if it holds a `OrgPolicyConstraintCustom`, `None` if the field is not set or
1143    /// holds a different branch.
1144    pub fn get_org_policy_constraint_custom(
1145        &self,
1146    ) -> std::option::Option<&std::boxed::Box<crate::model::OrgPolicyConstraintCustom>> {
1147        #[allow(unreachable_patterns)]
1148        self.implementation.as_ref().and_then(|v| match v {
1149            crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v) => {
1150                std::option::Option::Some(v)
1151            }
1152            _ => std::option::Option::None,
1153        })
1154    }
1155
1156    /// Sets the value of [implementation][crate::model::Constraint::implementation]
1157    /// to hold a `SecurityHealthAnalyticsModule`.
1158    ///
1159    /// Note that all the setters affecting `implementation` are
1160    /// mutually exclusive.
1161    pub fn set_security_health_analytics_module<
1162        T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>>,
1163    >(
1164        mut self,
1165        v: T,
1166    ) -> Self {
1167        self.implementation = std::option::Option::Some(
1168            crate::model::constraint::Implementation::SecurityHealthAnalyticsModule(v.into()),
1169        );
1170        self
1171    }
1172
1173    /// Sets the value of [implementation][crate::model::Constraint::implementation]
1174    /// to hold a `SecurityHealthAnalyticsCustomModule`.
1175    ///
1176    /// Note that all the setters affecting `implementation` are
1177    /// mutually exclusive.
1178    pub fn set_security_health_analytics_custom_module<
1179        T: std::convert::Into<std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>>,
1180    >(
1181        mut self,
1182        v: T,
1183    ) -> Self {
1184        self.implementation = std::option::Option::Some(
1185            crate::model::constraint::Implementation::SecurityHealthAnalyticsCustomModule(v.into()),
1186        );
1187        self
1188    }
1189
1190    /// Sets the value of [implementation][crate::model::Constraint::implementation]
1191    /// to hold a `OrgPolicyConstraint`.
1192    ///
1193    /// Note that all the setters affecting `implementation` are
1194    /// mutually exclusive.
1195    pub fn set_org_policy_constraint<
1196        T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraint>>,
1197    >(
1198        mut self,
1199        v: T,
1200    ) -> Self {
1201        self.implementation = std::option::Option::Some(
1202            crate::model::constraint::Implementation::OrgPolicyConstraint(v.into()),
1203        );
1204        self
1205    }
1206
1207    /// Sets the value of [implementation][crate::model::Constraint::implementation]
1208    /// to hold a `OrgPolicyConstraintCustom`.
1209    ///
1210    /// Note that all the setters affecting `implementation` are
1211    /// mutually exclusive.
1212    pub fn set_org_policy_constraint_custom<
1213        T: std::convert::Into<std::boxed::Box<crate::model::OrgPolicyConstraintCustom>>,
1214    >(
1215        mut self,
1216        v: T,
1217    ) -> Self {
1218        self.implementation = std::option::Option::Some(
1219            crate::model::constraint::Implementation::OrgPolicyConstraintCustom(v.into()),
1220        );
1221        self
1222    }
1223}
1224
1225impl wkt::message::Message for Constraint {
1226    fn typename() -> &'static str {
1227        "type.googleapis.com/google.cloud.securityposture.v1.Constraint"
1228    }
1229}
1230
1231/// Defines additional types related to Constraint
1232pub mod constraint {
1233    #[allow(unused_imports)]
1234    use super::*;
1235
1236    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1237    #[serde(rename_all = "camelCase")]
1238    #[non_exhaustive]
1239    pub enum Implementation {
1240        /// Optional. SHA built-in detector.
1241        SecurityHealthAnalyticsModule(std::boxed::Box<crate::model::SecurityHealthAnalyticsModule>),
1242        /// Optional. SHA custom detector.
1243        SecurityHealthAnalyticsCustomModule(
1244            std::boxed::Box<crate::model::SecurityHealthAnalyticsCustomModule>,
1245        ),
1246        /// Optional. Org Policy builtin constraint.
1247        OrgPolicyConstraint(std::boxed::Box<crate::model::OrgPolicyConstraint>),
1248        /// Optional. Org Policy custom constraint.
1249        OrgPolicyConstraintCustom(std::boxed::Box<crate::model::OrgPolicyConstraintCustom>),
1250    }
1251}
1252
1253/// Message for requesting list of Postures.
1254#[serde_with::serde_as]
1255#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1256#[serde(default, rename_all = "camelCase")]
1257#[non_exhaustive]
1258pub struct ListPosturesRequest {
1259    /// Required. Parent value for ListPosturesRequest.
1260    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1261    pub parent: std::string::String,
1262
1263    /// Requested page size. Server may return fewer items than requested.
1264    /// If unspecified, server will pick an appropriate default.
1265    pub page_size: i32,
1266
1267    /// A token identifying a page of results the server should return.
1268    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1269    pub page_token: std::string::String,
1270}
1271
1272impl ListPosturesRequest {
1273    pub fn new() -> Self {
1274        std::default::Default::default()
1275    }
1276
1277    /// Sets the value of [parent][crate::model::ListPosturesRequest::parent].
1278    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1279        self.parent = v.into();
1280        self
1281    }
1282
1283    /// Sets the value of [page_size][crate::model::ListPosturesRequest::page_size].
1284    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1285        self.page_size = v.into();
1286        self
1287    }
1288
1289    /// Sets the value of [page_token][crate::model::ListPosturesRequest::page_token].
1290    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1291        self.page_token = v.into();
1292        self
1293    }
1294}
1295
1296impl wkt::message::Message for ListPosturesRequest {
1297    fn typename() -> &'static str {
1298        "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesRequest"
1299    }
1300}
1301
1302/// Message for response to listing Postures.
1303#[serde_with::serde_as]
1304#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1305#[serde(default, rename_all = "camelCase")]
1306#[non_exhaustive]
1307pub struct ListPosturesResponse {
1308    /// The list of Posture.
1309    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1310    pub postures: std::vec::Vec<crate::model::Posture>,
1311
1312    /// A token identifying a page of results the server should return.
1313    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1314    pub next_page_token: std::string::String,
1315
1316    /// Unreachable resources.
1317    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1318    pub unreachable: std::vec::Vec<std::string::String>,
1319}
1320
1321impl ListPosturesResponse {
1322    pub fn new() -> Self {
1323        std::default::Default::default()
1324    }
1325
1326    /// Sets the value of [next_page_token][crate::model::ListPosturesResponse::next_page_token].
1327    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1328        self.next_page_token = v.into();
1329        self
1330    }
1331
1332    /// Sets the value of [postures][crate::model::ListPosturesResponse::postures].
1333    pub fn set_postures<T, V>(mut self, v: T) -> Self
1334    where
1335        T: std::iter::IntoIterator<Item = V>,
1336        V: std::convert::Into<crate::model::Posture>,
1337    {
1338        use std::iter::Iterator;
1339        self.postures = v.into_iter().map(|i| i.into()).collect();
1340        self
1341    }
1342
1343    /// Sets the value of [unreachable][crate::model::ListPosturesResponse::unreachable].
1344    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1345    where
1346        T: std::iter::IntoIterator<Item = V>,
1347        V: std::convert::Into<std::string::String>,
1348    {
1349        use std::iter::Iterator;
1350        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1351        self
1352    }
1353}
1354
1355impl wkt::message::Message for ListPosturesResponse {
1356    fn typename() -> &'static str {
1357        "type.googleapis.com/google.cloud.securityposture.v1.ListPosturesResponse"
1358    }
1359}
1360
1361#[cfg(feature = "unstable-stream")]
1362impl gax::paginator::PageableResponse for ListPosturesResponse {
1363    type PageItem = crate::model::Posture;
1364
1365    fn items(self) -> std::vec::Vec<Self::PageItem> {
1366        self.postures
1367    }
1368
1369    fn next_page_token(&self) -> std::string::String {
1370        gax::paginator::extract_token(&self.next_page_token)
1371    }
1372}
1373
1374/// Message for requesting list of Posture revisions.
1375#[serde_with::serde_as]
1376#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1377#[serde(default, rename_all = "camelCase")]
1378#[non_exhaustive]
1379pub struct ListPostureRevisionsRequest {
1380    /// Required. Name value for ListPostureRevisionsRequest.
1381    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1382    pub name: std::string::String,
1383
1384    /// Optional. Requested page size. Server may return fewer items than
1385    /// requested. If unspecified, server will pick 100 as default.
1386    pub page_size: i32,
1387
1388    /// Optional. A token identifying a page of results the server should return.
1389    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1390    pub page_token: std::string::String,
1391}
1392
1393impl ListPostureRevisionsRequest {
1394    pub fn new() -> Self {
1395        std::default::Default::default()
1396    }
1397
1398    /// Sets the value of [name][crate::model::ListPostureRevisionsRequest::name].
1399    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1400        self.name = v.into();
1401        self
1402    }
1403
1404    /// Sets the value of [page_size][crate::model::ListPostureRevisionsRequest::page_size].
1405    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1406        self.page_size = v.into();
1407        self
1408    }
1409
1410    /// Sets the value of [page_token][crate::model::ListPostureRevisionsRequest::page_token].
1411    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1412        self.page_token = v.into();
1413        self
1414    }
1415}
1416
1417impl wkt::message::Message for ListPostureRevisionsRequest {
1418    fn typename() -> &'static str {
1419        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsRequest"
1420    }
1421}
1422
1423/// Message for response to listing PostureRevisions.
1424#[serde_with::serde_as]
1425#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1426#[serde(default, rename_all = "camelCase")]
1427#[non_exhaustive]
1428pub struct ListPostureRevisionsResponse {
1429    /// The list of Posture revisions.
1430    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1431    pub revisions: std::vec::Vec<crate::model::Posture>,
1432
1433    /// A token identifying a page of results the server should return.
1434    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1435    pub next_page_token: std::string::String,
1436}
1437
1438impl ListPostureRevisionsResponse {
1439    pub fn new() -> Self {
1440        std::default::Default::default()
1441    }
1442
1443    /// Sets the value of [next_page_token][crate::model::ListPostureRevisionsResponse::next_page_token].
1444    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1445        self.next_page_token = v.into();
1446        self
1447    }
1448
1449    /// Sets the value of [revisions][crate::model::ListPostureRevisionsResponse::revisions].
1450    pub fn set_revisions<T, V>(mut self, v: T) -> Self
1451    where
1452        T: std::iter::IntoIterator<Item = V>,
1453        V: std::convert::Into<crate::model::Posture>,
1454    {
1455        use std::iter::Iterator;
1456        self.revisions = v.into_iter().map(|i| i.into()).collect();
1457        self
1458    }
1459}
1460
1461impl wkt::message::Message for ListPostureRevisionsResponse {
1462    fn typename() -> &'static str {
1463        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureRevisionsResponse"
1464    }
1465}
1466
1467#[cfg(feature = "unstable-stream")]
1468impl gax::paginator::PageableResponse for ListPostureRevisionsResponse {
1469    type PageItem = crate::model::Posture;
1470
1471    fn items(self) -> std::vec::Vec<Self::PageItem> {
1472        self.revisions
1473    }
1474
1475    fn next_page_token(&self) -> std::string::String {
1476        gax::paginator::extract_token(&self.next_page_token)
1477    }
1478}
1479
1480/// Message for getting a Posture.
1481#[serde_with::serde_as]
1482#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1483#[serde(default, rename_all = "camelCase")]
1484#[non_exhaustive]
1485pub struct GetPostureRequest {
1486    /// Required. Name of the resource.
1487    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1488    pub name: std::string::String,
1489
1490    /// Optional. Posture revision which needs to be retrieved.
1491    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1492    pub revision_id: std::string::String,
1493}
1494
1495impl GetPostureRequest {
1496    pub fn new() -> Self {
1497        std::default::Default::default()
1498    }
1499
1500    /// Sets the value of [name][crate::model::GetPostureRequest::name].
1501    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.name = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [revision_id][crate::model::GetPostureRequest::revision_id].
1507    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1508        self.revision_id = v.into();
1509        self
1510    }
1511}
1512
1513impl wkt::message::Message for GetPostureRequest {
1514    fn typename() -> &'static str {
1515        "type.googleapis.com/google.cloud.securityposture.v1.GetPostureRequest"
1516    }
1517}
1518
1519/// Message for creating a Posture.
1520#[serde_with::serde_as]
1521#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1522#[serde(default, rename_all = "camelCase")]
1523#[non_exhaustive]
1524pub struct CreatePostureRequest {
1525    /// Required. Value for parent.
1526    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1527    pub parent: std::string::String,
1528
1529    /// Required. User provided identifier. It should be unique in scope of an
1530    /// Organization and location.
1531    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1532    pub posture_id: std::string::String,
1533
1534    /// Required. The resource being created.
1535    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1536    pub posture: std::option::Option<crate::model::Posture>,
1537}
1538
1539impl CreatePostureRequest {
1540    pub fn new() -> Self {
1541        std::default::Default::default()
1542    }
1543
1544    /// Sets the value of [parent][crate::model::CreatePostureRequest::parent].
1545    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546        self.parent = v.into();
1547        self
1548    }
1549
1550    /// Sets the value of [posture_id][crate::model::CreatePostureRequest::posture_id].
1551    pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1552        self.posture_id = v.into();
1553        self
1554    }
1555
1556    /// Sets the value of [posture][crate::model::CreatePostureRequest::posture].
1557    pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1558        mut self,
1559        v: T,
1560    ) -> Self {
1561        self.posture = v.into();
1562        self
1563    }
1564}
1565
1566impl wkt::message::Message for CreatePostureRequest {
1567    fn typename() -> &'static str {
1568        "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureRequest"
1569    }
1570}
1571
1572/// Message for updating a Posture.
1573#[serde_with::serde_as]
1574#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1575#[serde(default, rename_all = "camelCase")]
1576#[non_exhaustive]
1577pub struct UpdatePostureRequest {
1578    /// Required. Field mask is used to specify the fields to be overwritten in the
1579    /// Posture resource by the update.
1580    /// The fields specified in the update_mask are relative to the resource, not
1581    /// the full request. A field will be overwritten if it is in the mask. If the
1582    /// user does not provide a mask then all fields will be overwritten.
1583    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1584    pub update_mask: std::option::Option<wkt::FieldMask>,
1585
1586    /// Required. The resource being updated.
1587    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1588    pub posture: std::option::Option<crate::model::Posture>,
1589
1590    /// Required. Posture revision which needs to be updated.
1591    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1592    pub revision_id: std::string::String,
1593}
1594
1595impl UpdatePostureRequest {
1596    pub fn new() -> Self {
1597        std::default::Default::default()
1598    }
1599
1600    /// Sets the value of [update_mask][crate::model::UpdatePostureRequest::update_mask].
1601    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1602        mut self,
1603        v: T,
1604    ) -> Self {
1605        self.update_mask = v.into();
1606        self
1607    }
1608
1609    /// Sets the value of [posture][crate::model::UpdatePostureRequest::posture].
1610    pub fn set_posture<T: std::convert::Into<std::option::Option<crate::model::Posture>>>(
1611        mut self,
1612        v: T,
1613    ) -> Self {
1614        self.posture = v.into();
1615        self
1616    }
1617
1618    /// Sets the value of [revision_id][crate::model::UpdatePostureRequest::revision_id].
1619    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620        self.revision_id = v.into();
1621        self
1622    }
1623}
1624
1625impl wkt::message::Message for UpdatePostureRequest {
1626    fn typename() -> &'static str {
1627        "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureRequest"
1628    }
1629}
1630
1631/// Message for deleting a Posture.
1632#[serde_with::serde_as]
1633#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1634#[serde(default, rename_all = "camelCase")]
1635#[non_exhaustive]
1636pub struct DeletePostureRequest {
1637    /// Required. Name of the resource.
1638    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1639    pub name: std::string::String,
1640
1641    /// Optional. Etag value of the Posture to be deleted.
1642    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1643    pub etag: std::string::String,
1644}
1645
1646impl DeletePostureRequest {
1647    pub fn new() -> Self {
1648        std::default::Default::default()
1649    }
1650
1651    /// Sets the value of [name][crate::model::DeletePostureRequest::name].
1652    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1653        self.name = v.into();
1654        self
1655    }
1656
1657    /// Sets the value of [etag][crate::model::DeletePostureRequest::etag].
1658    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1659        self.etag = v.into();
1660        self
1661    }
1662}
1663
1664impl wkt::message::Message for DeletePostureRequest {
1665    fn typename() -> &'static str {
1666        "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureRequest"
1667    }
1668}
1669
1670/// Message for extracting existing policies on a workload as a Posture.
1671#[serde_with::serde_as]
1672#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1673#[serde(default, rename_all = "camelCase")]
1674#[non_exhaustive]
1675pub struct ExtractPostureRequest {
1676    /// Required. The parent resource name. The format of this value is as follows:
1677    /// `organizations/{organization}/locations/{location}`
1678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1679    pub parent: std::string::String,
1680
1681    /// Required. User provided identifier. It should be unique in scope of an
1682    /// Organization and location.
1683    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1684    pub posture_id: std::string::String,
1685
1686    /// Required. Workload from which the policies are to be extracted, it should
1687    /// belong to the same organization defined in parent. The format of this value
1688    /// varies depending on the scope of the request:
1689    ///
1690    /// - `folder/folderNumber`
1691    /// - `project/projectNumber`
1692    /// - `organization/organizationNumber`
1693    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1694    pub workload: std::string::String,
1695}
1696
1697impl ExtractPostureRequest {
1698    pub fn new() -> Self {
1699        std::default::Default::default()
1700    }
1701
1702    /// Sets the value of [parent][crate::model::ExtractPostureRequest::parent].
1703    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1704        self.parent = v.into();
1705        self
1706    }
1707
1708    /// Sets the value of [posture_id][crate::model::ExtractPostureRequest::posture_id].
1709    pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1710        self.posture_id = v.into();
1711        self
1712    }
1713
1714    /// Sets the value of [workload][crate::model::ExtractPostureRequest::workload].
1715    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1716        self.workload = v.into();
1717        self
1718    }
1719}
1720
1721impl wkt::message::Message for ExtractPostureRequest {
1722    fn typename() -> &'static str {
1723        "type.googleapis.com/google.cloud.securityposture.v1.ExtractPostureRequest"
1724    }
1725}
1726
1727/// ========================== PostureDeployments ==========================
1728/// Message describing PostureDeployment resource.
1729#[serde_with::serde_as]
1730#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1731#[serde(default, rename_all = "camelCase")]
1732#[non_exhaustive]
1733pub struct PostureDeployment {
1734    /// Required. The name of this PostureDeployment resource, in the format of
1735    /// organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
1736    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1737    pub name: std::string::String,
1738
1739    /// Required. Target resource where the Posture will be deployed. Currently
1740    /// supported resources are of types: projects/projectNumber,
1741    /// folders/folderNumber, organizations/organizationNumber.
1742    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1743    pub target_resource: std::string::String,
1744
1745    /// Output only. State of PostureDeployment resource.
1746    pub state: crate::model::posture_deployment::State,
1747
1748    /// Required. Posture that needs to be deployed.
1749    /// Format:
1750    /// organizations/{org_id}/locations/{location_id}/postures/\<posture\>
1751    /// Example:
1752    /// organizations/99/locations/global/postures/les-miserables.
1753    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1754    pub posture_id: std::string::String,
1755
1756    /// Required. Revision_id of the Posture that is to be deployed.
1757    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1758    pub posture_revision_id: std::string::String,
1759
1760    /// Output only. The timestamp that the PostureDeployment was created.
1761    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1762    pub create_time: std::option::Option<wkt::Timestamp>,
1763
1764    /// Output only. The timestamp that the PostureDeployment was updated.
1765    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1766    pub update_time: std::option::Option<wkt::Timestamp>,
1767
1768    /// Optional. User provided description of the PostureDeployment.
1769    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770    pub description: std::string::String,
1771
1772    /// Optional. An opaque tag indicating the current version of the
1773    /// PostureDeployment, used for concurrency control. When the
1774    /// `PostureDeployment` is returned from either a `GetPostureDeployment` or a
1775    /// `ListPostureDeployments` request, this `etag` indicates the version of the
1776    /// current `PostureDeployment` to use when executing a read-modify-write loop.
1777    ///
1778    /// When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
1779    /// use the `etag` value that was returned from a `GetPostureDeployment`
1780    /// request as part of a read-modify-write loop for concurrency control. Not
1781    /// setting the `etag` in a `UpdatePostureDeployment` request will result in an
1782    /// unconditional write of the `PostureDeployment`.
1783    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1784    pub etag: std::string::String,
1785
1786    /// Optional. User annotations. These attributes can only be set and used by
1787    /// the user, and not by Google Security Postures.
1788    /// .
1789    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1790    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1791
1792    /// Output only. Whether or not this Posture is in the process of being
1793    /// updated.
1794    pub reconciling: bool,
1795
1796    /// Output only. This is a output only optional field which will be filled in
1797    /// case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
1798    /// DELETE_FAILED. It denotes the desired Posture.
1799    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1800    pub desired_posture_id: std::string::String,
1801
1802    /// Output only. Output only optional field which provides revision_id of the
1803    /// desired_posture_id.
1804    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1805    pub desired_posture_revision_id: std::string::String,
1806
1807    /// Output only. This is a output only optional field which will be filled in
1808    /// case where PostureDeployment enters a failure state like UPDATE_FAILED or
1809    /// CREATE_FAILED or DELETE_FAILED.
1810    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1811    pub failure_message: std::string::String,
1812}
1813
1814impl PostureDeployment {
1815    pub fn new() -> Self {
1816        std::default::Default::default()
1817    }
1818
1819    /// Sets the value of [name][crate::model::PostureDeployment::name].
1820    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1821        self.name = v.into();
1822        self
1823    }
1824
1825    /// Sets the value of [target_resource][crate::model::PostureDeployment::target_resource].
1826    pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1827        self.target_resource = v.into();
1828        self
1829    }
1830
1831    /// Sets the value of [state][crate::model::PostureDeployment::state].
1832    pub fn set_state<T: std::convert::Into<crate::model::posture_deployment::State>>(
1833        mut self,
1834        v: T,
1835    ) -> Self {
1836        self.state = v.into();
1837        self
1838    }
1839
1840    /// Sets the value of [posture_id][crate::model::PostureDeployment::posture_id].
1841    pub fn set_posture_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1842        self.posture_id = v.into();
1843        self
1844    }
1845
1846    /// Sets the value of [posture_revision_id][crate::model::PostureDeployment::posture_revision_id].
1847    pub fn set_posture_revision_id<T: std::convert::Into<std::string::String>>(
1848        mut self,
1849        v: T,
1850    ) -> Self {
1851        self.posture_revision_id = v.into();
1852        self
1853    }
1854
1855    /// Sets the value of [create_time][crate::model::PostureDeployment::create_time].
1856    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1857        mut self,
1858        v: T,
1859    ) -> Self {
1860        self.create_time = v.into();
1861        self
1862    }
1863
1864    /// Sets the value of [update_time][crate::model::PostureDeployment::update_time].
1865    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1866        mut self,
1867        v: T,
1868    ) -> Self {
1869        self.update_time = v.into();
1870        self
1871    }
1872
1873    /// Sets the value of [description][crate::model::PostureDeployment::description].
1874    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875        self.description = v.into();
1876        self
1877    }
1878
1879    /// Sets the value of [etag][crate::model::PostureDeployment::etag].
1880    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1881        self.etag = v.into();
1882        self
1883    }
1884
1885    /// Sets the value of [reconciling][crate::model::PostureDeployment::reconciling].
1886    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1887        self.reconciling = v.into();
1888        self
1889    }
1890
1891    /// Sets the value of [desired_posture_id][crate::model::PostureDeployment::desired_posture_id].
1892    pub fn set_desired_posture_id<T: std::convert::Into<std::string::String>>(
1893        mut self,
1894        v: T,
1895    ) -> Self {
1896        self.desired_posture_id = v.into();
1897        self
1898    }
1899
1900    /// Sets the value of [desired_posture_revision_id][crate::model::PostureDeployment::desired_posture_revision_id].
1901    pub fn set_desired_posture_revision_id<T: std::convert::Into<std::string::String>>(
1902        mut self,
1903        v: T,
1904    ) -> Self {
1905        self.desired_posture_revision_id = v.into();
1906        self
1907    }
1908
1909    /// Sets the value of [failure_message][crate::model::PostureDeployment::failure_message].
1910    pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911        self.failure_message = v.into();
1912        self
1913    }
1914
1915    /// Sets the value of [annotations][crate::model::PostureDeployment::annotations].
1916    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1917    where
1918        T: std::iter::IntoIterator<Item = (K, V)>,
1919        K: std::convert::Into<std::string::String>,
1920        V: std::convert::Into<std::string::String>,
1921    {
1922        use std::iter::Iterator;
1923        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1924        self
1925    }
1926}
1927
1928impl wkt::message::Message for PostureDeployment {
1929    fn typename() -> &'static str {
1930        "type.googleapis.com/google.cloud.securityposture.v1.PostureDeployment"
1931    }
1932}
1933
1934/// Defines additional types related to PostureDeployment
1935pub mod posture_deployment {
1936    #[allow(unused_imports)]
1937    use super::*;
1938
1939    /// State of a PostureDeployment.
1940    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1941    pub struct State(std::borrow::Cow<'static, str>);
1942
1943    impl State {
1944        /// Creates a new State instance.
1945        pub const fn new(v: &'static str) -> Self {
1946            Self(std::borrow::Cow::Borrowed(v))
1947        }
1948
1949        /// Gets the enum value.
1950        pub fn value(&self) -> &str {
1951            &self.0
1952        }
1953    }
1954
1955    /// Useful constants to work with [State](State)
1956    pub mod state {
1957        use super::State;
1958
1959        /// Unspecified operation state.
1960        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
1961
1962        /// The PostureDeployment is being created.
1963        pub const CREATING: State = State::new("CREATING");
1964
1965        /// The PostureDeployment is being deleted.
1966        pub const DELETING: State = State::new("DELETING");
1967
1968        /// The PostureDeployment state is being updated.
1969        pub const UPDATING: State = State::new("UPDATING");
1970
1971        /// The PostureDeployment state is active and in use.
1972        pub const ACTIVE: State = State::new("ACTIVE");
1973
1974        /// The PostureDeployment creation failed.
1975        pub const CREATE_FAILED: State = State::new("CREATE_FAILED");
1976
1977        /// The PostureDeployment update failed.
1978        pub const UPDATE_FAILED: State = State::new("UPDATE_FAILED");
1979
1980        /// The PostureDeployment deletion failed.
1981        pub const DELETE_FAILED: State = State::new("DELETE_FAILED");
1982    }
1983
1984    impl std::convert::From<std::string::String> for State {
1985        fn from(value: std::string::String) -> Self {
1986            Self(std::borrow::Cow::Owned(value))
1987        }
1988    }
1989}
1990
1991/// Message for requesting list of PostureDeployments.
1992#[serde_with::serde_as]
1993#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1994#[serde(default, rename_all = "camelCase")]
1995#[non_exhaustive]
1996pub struct ListPostureDeploymentsRequest {
1997    /// Required. Parent value for ListPostureDeploymentsRequest.
1998    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1999    pub parent: std::string::String,
2000
2001    /// Optional. Requested page size. Server may return fewer items than
2002    /// requested. If unspecified, server will pick an appropriate default.
2003    pub page_size: i32,
2004
2005    /// Optional. A token identifying a page of results the server should return.
2006    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2007    pub page_token: std::string::String,
2008
2009    /// Optional. Filter to be applied on the resource, defined by EBNF grammar
2010    /// <https://google.aip.dev/assets/misc/ebnf-filtering.txt>.
2011    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2012    pub filter: std::string::String,
2013}
2014
2015impl ListPostureDeploymentsRequest {
2016    pub fn new() -> Self {
2017        std::default::Default::default()
2018    }
2019
2020    /// Sets the value of [parent][crate::model::ListPostureDeploymentsRequest::parent].
2021    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2022        self.parent = v.into();
2023        self
2024    }
2025
2026    /// Sets the value of [page_size][crate::model::ListPostureDeploymentsRequest::page_size].
2027    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2028        self.page_size = v.into();
2029        self
2030    }
2031
2032    /// Sets the value of [page_token][crate::model::ListPostureDeploymentsRequest::page_token].
2033    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2034        self.page_token = v.into();
2035        self
2036    }
2037
2038    /// Sets the value of [filter][crate::model::ListPostureDeploymentsRequest::filter].
2039    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040        self.filter = v.into();
2041        self
2042    }
2043}
2044
2045impl wkt::message::Message for ListPostureDeploymentsRequest {
2046    fn typename() -> &'static str {
2047        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsRequest"
2048    }
2049}
2050
2051/// Message for response to listing PostureDeployments.
2052#[serde_with::serde_as]
2053#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2054#[serde(default, rename_all = "camelCase")]
2055#[non_exhaustive]
2056pub struct ListPostureDeploymentsResponse {
2057    /// The list of PostureDeployment.
2058    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2059    pub posture_deployments: std::vec::Vec<crate::model::PostureDeployment>,
2060
2061    /// A token identifying a page of results the server should return.
2062    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2063    pub next_page_token: std::string::String,
2064
2065    /// Locations that could not be reached.
2066    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2067    pub unreachable: std::vec::Vec<std::string::String>,
2068}
2069
2070impl ListPostureDeploymentsResponse {
2071    pub fn new() -> Self {
2072        std::default::Default::default()
2073    }
2074
2075    /// Sets the value of [next_page_token][crate::model::ListPostureDeploymentsResponse::next_page_token].
2076    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2077        self.next_page_token = v.into();
2078        self
2079    }
2080
2081    /// Sets the value of [posture_deployments][crate::model::ListPostureDeploymentsResponse::posture_deployments].
2082    pub fn set_posture_deployments<T, V>(mut self, v: T) -> Self
2083    where
2084        T: std::iter::IntoIterator<Item = V>,
2085        V: std::convert::Into<crate::model::PostureDeployment>,
2086    {
2087        use std::iter::Iterator;
2088        self.posture_deployments = v.into_iter().map(|i| i.into()).collect();
2089        self
2090    }
2091
2092    /// Sets the value of [unreachable][crate::model::ListPostureDeploymentsResponse::unreachable].
2093    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2094    where
2095        T: std::iter::IntoIterator<Item = V>,
2096        V: std::convert::Into<std::string::String>,
2097    {
2098        use std::iter::Iterator;
2099        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2100        self
2101    }
2102}
2103
2104impl wkt::message::Message for ListPostureDeploymentsResponse {
2105    fn typename() -> &'static str {
2106        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureDeploymentsResponse"
2107    }
2108}
2109
2110#[cfg(feature = "unstable-stream")]
2111impl gax::paginator::PageableResponse for ListPostureDeploymentsResponse {
2112    type PageItem = crate::model::PostureDeployment;
2113
2114    fn items(self) -> std::vec::Vec<Self::PageItem> {
2115        self.posture_deployments
2116    }
2117
2118    fn next_page_token(&self) -> std::string::String {
2119        gax::paginator::extract_token(&self.next_page_token)
2120    }
2121}
2122
2123/// Message for getting a PostureDeployment.
2124#[serde_with::serde_as]
2125#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2126#[serde(default, rename_all = "camelCase")]
2127#[non_exhaustive]
2128pub struct GetPostureDeploymentRequest {
2129    /// Required. Name of the resource.
2130    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2131    pub name: std::string::String,
2132}
2133
2134impl GetPostureDeploymentRequest {
2135    pub fn new() -> Self {
2136        std::default::Default::default()
2137    }
2138
2139    /// Sets the value of [name][crate::model::GetPostureDeploymentRequest::name].
2140    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2141        self.name = v.into();
2142        self
2143    }
2144}
2145
2146impl wkt::message::Message for GetPostureDeploymentRequest {
2147    fn typename() -> &'static str {
2148        "type.googleapis.com/google.cloud.securityposture.v1.GetPostureDeploymentRequest"
2149    }
2150}
2151
2152/// Message for creating a PostureDeployment.
2153#[serde_with::serde_as]
2154#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2155#[serde(default, rename_all = "camelCase")]
2156#[non_exhaustive]
2157pub struct CreatePostureDeploymentRequest {
2158    /// Required. Value for parent.
2159    /// Format: organizations/{org_id}/locations/{location}
2160    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2161    pub parent: std::string::String,
2162
2163    /// Required. User provided identifier. It should be unique in scope of an
2164    /// Organization and location.
2165    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2166    pub posture_deployment_id: std::string::String,
2167
2168    /// Required. The resource being created.
2169    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2170    pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2171}
2172
2173impl CreatePostureDeploymentRequest {
2174    pub fn new() -> Self {
2175        std::default::Default::default()
2176    }
2177
2178    /// Sets the value of [parent][crate::model::CreatePostureDeploymentRequest::parent].
2179    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180        self.parent = v.into();
2181        self
2182    }
2183
2184    /// Sets the value of [posture_deployment_id][crate::model::CreatePostureDeploymentRequest::posture_deployment_id].
2185    pub fn set_posture_deployment_id<T: std::convert::Into<std::string::String>>(
2186        mut self,
2187        v: T,
2188    ) -> Self {
2189        self.posture_deployment_id = v.into();
2190        self
2191    }
2192
2193    /// Sets the value of [posture_deployment][crate::model::CreatePostureDeploymentRequest::posture_deployment].
2194    pub fn set_posture_deployment<
2195        T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2196    >(
2197        mut self,
2198        v: T,
2199    ) -> Self {
2200        self.posture_deployment = v.into();
2201        self
2202    }
2203}
2204
2205impl wkt::message::Message for CreatePostureDeploymentRequest {
2206    fn typename() -> &'static str {
2207        "type.googleapis.com/google.cloud.securityposture.v1.CreatePostureDeploymentRequest"
2208    }
2209}
2210
2211/// Message for updating a PostureDeployment.
2212#[serde_with::serde_as]
2213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2214#[serde(default, rename_all = "camelCase")]
2215#[non_exhaustive]
2216pub struct UpdatePostureDeploymentRequest {
2217    /// Required. Field mask is used to specify the fields to be overwritten in the
2218    /// PostureDeployment resource by the update.
2219    /// The fields specified in the update_mask are relative to the resource, not
2220    /// the full request. A field will be overwritten if it is in the mask. If the
2221    /// user does not provide a mask then all fields will be overwritten.
2222    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2223    pub update_mask: std::option::Option<wkt::FieldMask>,
2224
2225    /// Required. The resource being updated.
2226    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2227    pub posture_deployment: std::option::Option<crate::model::PostureDeployment>,
2228}
2229
2230impl UpdatePostureDeploymentRequest {
2231    pub fn new() -> Self {
2232        std::default::Default::default()
2233    }
2234
2235    /// Sets the value of [update_mask][crate::model::UpdatePostureDeploymentRequest::update_mask].
2236    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2237        mut self,
2238        v: T,
2239    ) -> Self {
2240        self.update_mask = v.into();
2241        self
2242    }
2243
2244    /// Sets the value of [posture_deployment][crate::model::UpdatePostureDeploymentRequest::posture_deployment].
2245    pub fn set_posture_deployment<
2246        T: std::convert::Into<std::option::Option<crate::model::PostureDeployment>>,
2247    >(
2248        mut self,
2249        v: T,
2250    ) -> Self {
2251        self.posture_deployment = v.into();
2252        self
2253    }
2254}
2255
2256impl wkt::message::Message for UpdatePostureDeploymentRequest {
2257    fn typename() -> &'static str {
2258        "type.googleapis.com/google.cloud.securityposture.v1.UpdatePostureDeploymentRequest"
2259    }
2260}
2261
2262/// Message for deleting a PostureDeployment.
2263#[serde_with::serde_as]
2264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2265#[serde(default, rename_all = "camelCase")]
2266#[non_exhaustive]
2267pub struct DeletePostureDeploymentRequest {
2268    /// Required. Name of the resource.
2269    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2270    pub name: std::string::String,
2271
2272    /// Optional. Etag value of the PostureDeployment to be deleted.
2273    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2274    pub etag: std::string::String,
2275}
2276
2277impl DeletePostureDeploymentRequest {
2278    pub fn new() -> Self {
2279        std::default::Default::default()
2280    }
2281
2282    /// Sets the value of [name][crate::model::DeletePostureDeploymentRequest::name].
2283    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2284        self.name = v.into();
2285        self
2286    }
2287
2288    /// Sets the value of [etag][crate::model::DeletePostureDeploymentRequest::etag].
2289    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2290        self.etag = v.into();
2291        self
2292    }
2293}
2294
2295impl wkt::message::Message for DeletePostureDeploymentRequest {
2296    fn typename() -> &'static str {
2297        "type.googleapis.com/google.cloud.securityposture.v1.DeletePostureDeploymentRequest"
2298    }
2299}
2300
2301/// PostureTemplates
2302/// Message describing PostureTemplate object.
2303#[serde_with::serde_as]
2304#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2305#[serde(default, rename_all = "camelCase")]
2306#[non_exhaustive]
2307pub struct PostureTemplate {
2308    /// Output only. Identifier. The name of the Posture template will be of the
2309    /// format
2310    /// organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
2311    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2312    pub name: std::string::String,
2313
2314    /// Output only. The revision_id of a PostureTemplate.
2315    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2316    pub revision_id: std::string::String,
2317
2318    /// Output only. Description of the Posture template.
2319    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2320    pub description: std::string::String,
2321
2322    /// Output only. State of PostureTemplate resource.
2323    pub state: crate::model::posture_template::State,
2324
2325    /// Output only. Policy_sets to be used by the user.
2326    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2327    pub policy_sets: std::vec::Vec<crate::model::PolicySet>,
2328}
2329
2330impl PostureTemplate {
2331    pub fn new() -> Self {
2332        std::default::Default::default()
2333    }
2334
2335    /// Sets the value of [name][crate::model::PostureTemplate::name].
2336    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337        self.name = v.into();
2338        self
2339    }
2340
2341    /// Sets the value of [revision_id][crate::model::PostureTemplate::revision_id].
2342    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2343        self.revision_id = v.into();
2344        self
2345    }
2346
2347    /// Sets the value of [description][crate::model::PostureTemplate::description].
2348    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2349        self.description = v.into();
2350        self
2351    }
2352
2353    /// Sets the value of [state][crate::model::PostureTemplate::state].
2354    pub fn set_state<T: std::convert::Into<crate::model::posture_template::State>>(
2355        mut self,
2356        v: T,
2357    ) -> Self {
2358        self.state = v.into();
2359        self
2360    }
2361
2362    /// Sets the value of [policy_sets][crate::model::PostureTemplate::policy_sets].
2363    pub fn set_policy_sets<T, V>(mut self, v: T) -> Self
2364    where
2365        T: std::iter::IntoIterator<Item = V>,
2366        V: std::convert::Into<crate::model::PolicySet>,
2367    {
2368        use std::iter::Iterator;
2369        self.policy_sets = v.into_iter().map(|i| i.into()).collect();
2370        self
2371    }
2372}
2373
2374impl wkt::message::Message for PostureTemplate {
2375    fn typename() -> &'static str {
2376        "type.googleapis.com/google.cloud.securityposture.v1.PostureTemplate"
2377    }
2378}
2379
2380/// Defines additional types related to PostureTemplate
2381pub mod posture_template {
2382    #[allow(unused_imports)]
2383    use super::*;
2384
2385    /// State of a PostureTemplate
2386    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2387    pub struct State(std::borrow::Cow<'static, str>);
2388
2389    impl State {
2390        /// Creates a new State instance.
2391        pub const fn new(v: &'static str) -> Self {
2392            Self(std::borrow::Cow::Borrowed(v))
2393        }
2394
2395        /// Gets the enum value.
2396        pub fn value(&self) -> &str {
2397            &self.0
2398        }
2399    }
2400
2401    /// Useful constants to work with [State](State)
2402    pub mod state {
2403        use super::State;
2404
2405        /// Unspecified state
2406        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
2407
2408        /// If the Posture template is adhering to the latest controls and standards.
2409        pub const ACTIVE: State = State::new("ACTIVE");
2410
2411        /// If the Posture template controls and standards are outdated and not
2412        /// recommended for use.
2413        pub const DEPRECATED: State = State::new("DEPRECATED");
2414    }
2415
2416    impl std::convert::From<std::string::String> for State {
2417        fn from(value: std::string::String) -> Self {
2418            Self(std::borrow::Cow::Owned(value))
2419        }
2420    }
2421}
2422
2423/// Message for requesting list of Posture Templates.
2424#[serde_with::serde_as]
2425#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2426#[serde(default, rename_all = "camelCase")]
2427#[non_exhaustive]
2428pub struct ListPostureTemplatesRequest {
2429    /// Required. Parent value for ListPostureTemplatesRequest.
2430    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2431    pub parent: std::string::String,
2432
2433    /// Optional. Requested page size. Server may return fewer items than
2434    /// requested. If unspecified, server will pick an appropriate default.
2435    pub page_size: i32,
2436
2437    /// Optional. A token identifying a page of results the server should return.
2438    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2439    pub page_token: std::string::String,
2440
2441    /// Optional. Filter to be applied on the resource, defined by EBNF grammar
2442    /// <https://google.aip.dev/assets/misc/ebnf-filtering.txt>.
2443    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2444    pub filter: std::string::String,
2445}
2446
2447impl ListPostureTemplatesRequest {
2448    pub fn new() -> Self {
2449        std::default::Default::default()
2450    }
2451
2452    /// Sets the value of [parent][crate::model::ListPostureTemplatesRequest::parent].
2453    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454        self.parent = v.into();
2455        self
2456    }
2457
2458    /// Sets the value of [page_size][crate::model::ListPostureTemplatesRequest::page_size].
2459    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2460        self.page_size = v.into();
2461        self
2462    }
2463
2464    /// Sets the value of [page_token][crate::model::ListPostureTemplatesRequest::page_token].
2465    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2466        self.page_token = v.into();
2467        self
2468    }
2469
2470    /// Sets the value of [filter][crate::model::ListPostureTemplatesRequest::filter].
2471    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2472        self.filter = v.into();
2473        self
2474    }
2475}
2476
2477impl wkt::message::Message for ListPostureTemplatesRequest {
2478    fn typename() -> &'static str {
2479        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesRequest"
2480    }
2481}
2482
2483/// Message for response to listing PostureTemplates.
2484#[serde_with::serde_as]
2485#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2486#[serde(default, rename_all = "camelCase")]
2487#[non_exhaustive]
2488pub struct ListPostureTemplatesResponse {
2489    /// The list of PostureTemplate.
2490    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2491    pub posture_templates: std::vec::Vec<crate::model::PostureTemplate>,
2492
2493    /// A token identifying a page of results the server should return.
2494    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2495    pub next_page_token: std::string::String,
2496}
2497
2498impl ListPostureTemplatesResponse {
2499    pub fn new() -> Self {
2500        std::default::Default::default()
2501    }
2502
2503    /// Sets the value of [next_page_token][crate::model::ListPostureTemplatesResponse::next_page_token].
2504    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2505        self.next_page_token = v.into();
2506        self
2507    }
2508
2509    /// Sets the value of [posture_templates][crate::model::ListPostureTemplatesResponse::posture_templates].
2510    pub fn set_posture_templates<T, V>(mut self, v: T) -> Self
2511    where
2512        T: std::iter::IntoIterator<Item = V>,
2513        V: std::convert::Into<crate::model::PostureTemplate>,
2514    {
2515        use std::iter::Iterator;
2516        self.posture_templates = v.into_iter().map(|i| i.into()).collect();
2517        self
2518    }
2519}
2520
2521impl wkt::message::Message for ListPostureTemplatesResponse {
2522    fn typename() -> &'static str {
2523        "type.googleapis.com/google.cloud.securityposture.v1.ListPostureTemplatesResponse"
2524    }
2525}
2526
2527#[cfg(feature = "unstable-stream")]
2528impl gax::paginator::PageableResponse for ListPostureTemplatesResponse {
2529    type PageItem = crate::model::PostureTemplate;
2530
2531    fn items(self) -> std::vec::Vec<Self::PageItem> {
2532        self.posture_templates
2533    }
2534
2535    fn next_page_token(&self) -> std::string::String {
2536        gax::paginator::extract_token(&self.next_page_token)
2537    }
2538}
2539
2540/// Message for getting a Posture Template.
2541#[serde_with::serde_as]
2542#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2543#[serde(default, rename_all = "camelCase")]
2544#[non_exhaustive]
2545pub struct GetPostureTemplateRequest {
2546    /// Required. Name of the resource.
2547    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2548    pub name: std::string::String,
2549
2550    /// Optional. Specific revision_id of a Posture Template.
2551    /// PostureTemplate revision_id which needs to be retrieved.
2552    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2553    pub revision_id: std::string::String,
2554}
2555
2556impl GetPostureTemplateRequest {
2557    pub fn new() -> Self {
2558        std::default::Default::default()
2559    }
2560
2561    /// Sets the value of [name][crate::model::GetPostureTemplateRequest::name].
2562    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2563        self.name = v.into();
2564        self
2565    }
2566
2567    /// Sets the value of [revision_id][crate::model::GetPostureTemplateRequest::revision_id].
2568    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2569        self.revision_id = v.into();
2570        self
2571    }
2572}
2573
2574impl wkt::message::Message for GetPostureTemplateRequest {
2575    fn typename() -> &'static str {
2576        "type.googleapis.com/google.cloud.securityposture.v1.GetPostureTemplateRequest"
2577    }
2578}
2579
2580/// Message for Security Health Analytics built-in detector.
2581#[serde_with::serde_as]
2582#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2583#[serde(default, rename_all = "camelCase")]
2584#[non_exhaustive]
2585pub struct SecurityHealthAnalyticsModule {
2586    /// Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
2587    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2588    pub module_name: std::string::String,
2589
2590    /// The state of enablement for the module at its level of the resource
2591    /// hierarchy.
2592    pub module_enablement_state: crate::model::EnablementState,
2593}
2594
2595impl SecurityHealthAnalyticsModule {
2596    pub fn new() -> Self {
2597        std::default::Default::default()
2598    }
2599
2600    /// Sets the value of [module_name][crate::model::SecurityHealthAnalyticsModule::module_name].
2601    pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2602        self.module_name = v.into();
2603        self
2604    }
2605
2606    /// Sets the value of [module_enablement_state][crate::model::SecurityHealthAnalyticsModule::module_enablement_state].
2607    pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
2608        mut self,
2609        v: T,
2610    ) -> Self {
2611        self.module_enablement_state = v.into();
2612        self
2613    }
2614}
2615
2616impl wkt::message::Message for SecurityHealthAnalyticsModule {
2617    fn typename() -> &'static str {
2618        "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsModule"
2619    }
2620}
2621
2622/// Message for SHA Custom Module
2623#[serde_with::serde_as]
2624#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2625#[serde(default, rename_all = "camelCase")]
2626#[non_exhaustive]
2627pub struct SecurityHealthAnalyticsCustomModule {
2628    /// Output only. Immutable. The id of the custom module.
2629    /// The id is server-generated and is not user settable.
2630    /// It will be a numeric id containing 1-20 digits.
2631    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2632    pub id: std::string::String,
2633
2634    /// Optional. The display name of the Security Health Analytics custom module.
2635    /// This display name becomes the finding category for all findings that are
2636    /// returned by this custom module. The display name must be between 1 and
2637    /// 128 characters, start with a lowercase letter, and contain alphanumeric
2638    /// characters or underscores only.
2639    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2640    pub display_name: std::string::String,
2641
2642    /// Required. custom module details
2643    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2644    pub config: std::option::Option<crate::model::CustomConfig>,
2645
2646    /// The state of enablement for the module at its level of the resource
2647    /// hierarchy.
2648    pub module_enablement_state: crate::model::EnablementState,
2649}
2650
2651impl SecurityHealthAnalyticsCustomModule {
2652    pub fn new() -> Self {
2653        std::default::Default::default()
2654    }
2655
2656    /// Sets the value of [id][crate::model::SecurityHealthAnalyticsCustomModule::id].
2657    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2658        self.id = v.into();
2659        self
2660    }
2661
2662    /// Sets the value of [display_name][crate::model::SecurityHealthAnalyticsCustomModule::display_name].
2663    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2664        self.display_name = v.into();
2665        self
2666    }
2667
2668    /// Sets the value of [config][crate::model::SecurityHealthAnalyticsCustomModule::config].
2669    pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::CustomConfig>>>(
2670        mut self,
2671        v: T,
2672    ) -> Self {
2673        self.config = v.into();
2674        self
2675    }
2676
2677    /// Sets the value of [module_enablement_state][crate::model::SecurityHealthAnalyticsCustomModule::module_enablement_state].
2678    pub fn set_module_enablement_state<T: std::convert::Into<crate::model::EnablementState>>(
2679        mut self,
2680        v: T,
2681    ) -> Self {
2682        self.module_enablement_state = v.into();
2683        self
2684    }
2685}
2686
2687impl wkt::message::Message for SecurityHealthAnalyticsCustomModule {
2688    fn typename() -> &'static str {
2689        "type.googleapis.com/google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule"
2690    }
2691}
2692
2693/// Defines the properties in a custom module configuration for Security
2694/// Health Analytics. Use the custom module configuration to create custom
2695/// detectors that generate custom findings for resources that you specify.
2696#[serde_with::serde_as]
2697#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2698#[serde(default, rename_all = "camelCase")]
2699#[non_exhaustive]
2700pub struct CustomConfig {
2701    /// Required. The CEL expression to evaluate to produce findings. When the
2702    /// expression evaluates to true against a resource, a finding is generated.
2703    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2704    pub predicate: std::option::Option<gtype::model::Expr>,
2705
2706    /// Optional. Custom output properties.
2707    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2708    pub custom_output: std::option::Option<crate::model::custom_config::CustomOutputSpec>,
2709
2710    /// Required. The resource types that the custom module operates on. Each
2711    /// custom module can specify up to 5 resource types.
2712    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2713    pub resource_selector: std::option::Option<crate::model::custom_config::ResourceSelector>,
2714
2715    /// Required. The severity to assign to findings generated by the module.
2716    pub severity: crate::model::custom_config::Severity,
2717
2718    /// Optional. Text that describes the vulnerability or misconfiguration that
2719    /// the custom module detects. This explanation is returned with each finding
2720    /// instance to help investigators understand the detected issue. The text must
2721    /// be enclosed in quotation marks.
2722    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2723    pub description: std::string::String,
2724
2725    /// Optional. An explanation of the recommended steps that security teams can
2726    /// take to resolve the detected issue. This explanation is returned with each
2727    /// finding generated by this module in the `nextSteps` property of the finding
2728    /// JSON.
2729    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2730    pub recommendation: std::string::String,
2731}
2732
2733impl CustomConfig {
2734    pub fn new() -> Self {
2735        std::default::Default::default()
2736    }
2737
2738    /// Sets the value of [predicate][crate::model::CustomConfig::predicate].
2739    pub fn set_predicate<T: std::convert::Into<std::option::Option<gtype::model::Expr>>>(
2740        mut self,
2741        v: T,
2742    ) -> Self {
2743        self.predicate = v.into();
2744        self
2745    }
2746
2747    /// Sets the value of [custom_output][crate::model::CustomConfig::custom_output].
2748    pub fn set_custom_output<
2749        T: std::convert::Into<std::option::Option<crate::model::custom_config::CustomOutputSpec>>,
2750    >(
2751        mut self,
2752        v: T,
2753    ) -> Self {
2754        self.custom_output = v.into();
2755        self
2756    }
2757
2758    /// Sets the value of [resource_selector][crate::model::CustomConfig::resource_selector].
2759    pub fn set_resource_selector<
2760        T: std::convert::Into<std::option::Option<crate::model::custom_config::ResourceSelector>>,
2761    >(
2762        mut self,
2763        v: T,
2764    ) -> Self {
2765        self.resource_selector = v.into();
2766        self
2767    }
2768
2769    /// Sets the value of [severity][crate::model::CustomConfig::severity].
2770    pub fn set_severity<T: std::convert::Into<crate::model::custom_config::Severity>>(
2771        mut self,
2772        v: T,
2773    ) -> Self {
2774        self.severity = v.into();
2775        self
2776    }
2777
2778    /// Sets the value of [description][crate::model::CustomConfig::description].
2779    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2780        self.description = v.into();
2781        self
2782    }
2783
2784    /// Sets the value of [recommendation][crate::model::CustomConfig::recommendation].
2785    pub fn set_recommendation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2786        self.recommendation = v.into();
2787        self
2788    }
2789}
2790
2791impl wkt::message::Message for CustomConfig {
2792    fn typename() -> &'static str {
2793        "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig"
2794    }
2795}
2796
2797/// Defines additional types related to CustomConfig
2798pub mod custom_config {
2799    #[allow(unused_imports)]
2800    use super::*;
2801
2802    /// A set of optional name-value pairs that define custom source properties to
2803    /// return with each finding that is generated by the custom module. The custom
2804    /// source properties that are defined here are included in the finding JSON
2805    /// under `sourceProperties`.
2806    #[serde_with::serde_as]
2807    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2808    #[serde(default, rename_all = "camelCase")]
2809    #[non_exhaustive]
2810    pub struct CustomOutputSpec {
2811        /// Optional. A list of custom output properties to add to the finding.
2812        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2813        pub properties: std::vec::Vec<crate::model::custom_config::custom_output_spec::Property>,
2814    }
2815
2816    impl CustomOutputSpec {
2817        pub fn new() -> Self {
2818            std::default::Default::default()
2819        }
2820
2821        /// Sets the value of [properties][crate::model::custom_config::CustomOutputSpec::properties].
2822        pub fn set_properties<T, V>(mut self, v: T) -> Self
2823        where
2824            T: std::iter::IntoIterator<Item = V>,
2825            V: std::convert::Into<crate::model::custom_config::custom_output_spec::Property>,
2826        {
2827            use std::iter::Iterator;
2828            self.properties = v.into_iter().map(|i| i.into()).collect();
2829            self
2830        }
2831    }
2832
2833    impl wkt::message::Message for CustomOutputSpec {
2834        fn typename() -> &'static str {
2835            "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec"
2836        }
2837    }
2838
2839    /// Defines additional types related to CustomOutputSpec
2840    pub mod custom_output_spec {
2841        #[allow(unused_imports)]
2842        use super::*;
2843
2844        /// An individual name-value pair that defines a custom source property.
2845        #[serde_with::serde_as]
2846        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2847        #[serde(default, rename_all = "camelCase")]
2848        #[non_exhaustive]
2849        pub struct Property {
2850            /// Required. Name of the property for the custom output.
2851            #[serde(skip_serializing_if = "std::string::String::is_empty")]
2852            pub name: std::string::String,
2853
2854            /// Optional. The CEL expression for the custom output. A resource property
2855            /// can be specified to return the value of the property or a text string
2856            /// enclosed in quotation marks.
2857            #[serde(skip_serializing_if = "std::option::Option::is_none")]
2858            pub value_expression: std::option::Option<gtype::model::Expr>,
2859        }
2860
2861        impl Property {
2862            pub fn new() -> Self {
2863                std::default::Default::default()
2864            }
2865
2866            /// Sets the value of [name][crate::model::custom_config::custom_output_spec::Property::name].
2867            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2868                self.name = v.into();
2869                self
2870            }
2871
2872            /// Sets the value of [value_expression][crate::model::custom_config::custom_output_spec::Property::value_expression].
2873            pub fn set_value_expression<
2874                T: std::convert::Into<std::option::Option<gtype::model::Expr>>,
2875            >(
2876                mut self,
2877                v: T,
2878            ) -> Self {
2879                self.value_expression = v.into();
2880                self
2881            }
2882        }
2883
2884        impl wkt::message::Message for Property {
2885            fn typename() -> &'static str {
2886                "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property"
2887            }
2888        }
2889    }
2890
2891    /// Resource for selecting resource type.
2892    #[serde_with::serde_as]
2893    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2894    #[serde(default, rename_all = "camelCase")]
2895    #[non_exhaustive]
2896    pub struct ResourceSelector {
2897        /// Required. The resource types to run the detector on.
2898        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2899        pub resource_types: std::vec::Vec<std::string::String>,
2900    }
2901
2902    impl ResourceSelector {
2903        pub fn new() -> Self {
2904            std::default::Default::default()
2905        }
2906
2907        /// Sets the value of [resource_types][crate::model::custom_config::ResourceSelector::resource_types].
2908        pub fn set_resource_types<T, V>(mut self, v: T) -> Self
2909        where
2910            T: std::iter::IntoIterator<Item = V>,
2911            V: std::convert::Into<std::string::String>,
2912        {
2913            use std::iter::Iterator;
2914            self.resource_types = v.into_iter().map(|i| i.into()).collect();
2915            self
2916        }
2917    }
2918
2919    impl wkt::message::Message for ResourceSelector {
2920        fn typename() -> &'static str {
2921            "type.googleapis.com/google.cloud.securityposture.v1.CustomConfig.ResourceSelector"
2922        }
2923    }
2924
2925    /// Defines the valid value options for the severity of a finding.
2926    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2927    pub struct Severity(std::borrow::Cow<'static, str>);
2928
2929    impl Severity {
2930        /// Creates a new Severity instance.
2931        pub const fn new(v: &'static str) -> Self {
2932            Self(std::borrow::Cow::Borrowed(v))
2933        }
2934
2935        /// Gets the enum value.
2936        pub fn value(&self) -> &str {
2937            &self.0
2938        }
2939    }
2940
2941    /// Useful constants to work with [Severity](Severity)
2942    pub mod severity {
2943        use super::Severity;
2944
2945        /// Unspecified severity.
2946        pub const SEVERITY_UNSPECIFIED: Severity = Severity::new("SEVERITY_UNSPECIFIED");
2947
2948        /// Critical severity.
2949        pub const CRITICAL: Severity = Severity::new("CRITICAL");
2950
2951        /// High severity.
2952        pub const HIGH: Severity = Severity::new("HIGH");
2953
2954        /// Medium severity.
2955        pub const MEDIUM: Severity = Severity::new("MEDIUM");
2956
2957        /// Low severity.
2958        pub const LOW: Severity = Severity::new("LOW");
2959    }
2960
2961    impl std::convert::From<std::string::String> for Severity {
2962        fn from(value: std::string::String) -> Self {
2963            Self(std::borrow::Cow::Owned(value))
2964        }
2965    }
2966}
2967
2968/// Possible enablement states of a service or module.
2969#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2970pub struct EnablementState(std::borrow::Cow<'static, str>);
2971
2972impl EnablementState {
2973    /// Creates a new EnablementState instance.
2974    pub const fn new(v: &'static str) -> Self {
2975        Self(std::borrow::Cow::Borrowed(v))
2976    }
2977
2978    /// Gets the enum value.
2979    pub fn value(&self) -> &str {
2980        &self.0
2981    }
2982}
2983
2984/// Useful constants to work with [EnablementState](EnablementState)
2985pub mod enablement_state {
2986    use super::EnablementState;
2987
2988    /// Default value. This value is unused.
2989    pub const ENABLEMENT_STATE_UNSPECIFIED: EnablementState =
2990        EnablementState::new("ENABLEMENT_STATE_UNSPECIFIED");
2991
2992    /// State is enabled.
2993    pub const ENABLED: EnablementState = EnablementState::new("ENABLED");
2994
2995    /// State is disabled.
2996    pub const DISABLED: EnablementState = EnablementState::new("DISABLED");
2997}
2998
2999impl std::convert::From<std::string::String> for EnablementState {
3000    fn from(value: std::string::String) -> Self {
3001        Self(std::borrow::Cow::Owned(value))
3002    }
3003}