#[non_exhaustive]pub struct Policy {
pub policy_id: String,
pub compliance_standards: Vec<ComplianceStandard>,
pub constraint: Option<Constraint>,
pub description: String,
/* private fields */
}Expand description
Policy representation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.policy_id: StringRequired. ID of the Policy that is user generated, immutable and unique within the scope of a policy set.
compliance_standards: Vec<ComplianceStandard>Optional. Contains list of mapping for a Policy to a standard and control.
constraint: Option<Constraint>Required. Constraint details.
description: StringOptional. Description of the Policy.
Implementations§
Source§impl Policy
impl Policy
pub fn new() -> Self
Sourcepub fn set_policy_id<T: Into<String>>(self, v: T) -> Self
pub fn set_policy_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_compliance_standards<T, V>(self, v: T) -> Self
pub fn set_compliance_standards<T, V>(self, v: T) -> Self
Sets the value of compliance_standards.
§Example
ⓘ
use google_cloud_securityposture_v1::model::policy::ComplianceStandard;
let x = Policy::new()
.set_compliance_standards([
ComplianceStandard::default()/* use setters */,
ComplianceStandard::default()/* use (different) setters */,
]);Sourcepub fn set_constraint<T>(self, v: T) -> Selfwhere
T: Into<Constraint>,
pub fn set_constraint<T>(self, v: T) -> Selfwhere
T: Into<Constraint>,
Sets the value of constraint.
§Example
ⓘ
use google_cloud_securityposture_v1::model::Constraint;
let x = Policy::new().set_constraint(Constraint::default()/* use setters */);Sourcepub fn set_or_clear_constraint<T>(self, v: Option<T>) -> Selfwhere
T: Into<Constraint>,
pub fn set_or_clear_constraint<T>(self, v: Option<T>) -> Selfwhere
T: Into<Constraint>,
Sets or clears the value of constraint.
§Example
ⓘ
use google_cloud_securityposture_v1::model::Constraint;
let x = Policy::new().set_or_clear_constraint(Some(Constraint::default()/* use setters */));
let x = Policy::new().set_or_clear_constraint(None::<Constraint>);Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more