#[non_exhaustive]pub struct PolicyRule {
pub condition: Option<Expr>,
pub kind: Option<Kind>,
/* private fields */
}Expand description
A rule used to express this policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.condition: Option<Expr>A condition which determines whether this rule is used
in the evaluation of the policy. When set, the expression field in
the `Expr’ must include from 1 to 10 subexpressions, joined by the “||”
or “&&” operators. Each subexpression must be of the form
“resource.matchTag(’<ORG_ID>/tag_key_short_name,
‘tag_value_short_name’)” or “resource.matchTagId(‘tagKeys/key_id’,
‘tagValues/value_id’)” where key_name and value_name are the resource
names for Label Keys and Values. These names are available from the Tag
Manager Service. An example expression is:
“resource.matchTag(’123456789/environment,
‘prod’)” or “resource.matchTagId(‘tagKeys/123’,
‘tagValues/456’)”.
kind: Option<Kind>Implementations§
Source§impl PolicyRule
impl PolicyRule
Sourcepub fn set_condition<T>(self, v: T) -> Self
pub fn set_condition<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_condition<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_condition<T>(self, v: Option<T>) -> Self
Sourcepub fn values(&self) -> Option<&Box<StringValues>>
pub fn values(&self) -> Option<&Box<StringValues>>
The value of kind
if it holds a Values, None if the field is not set or
holds a different branch.
Sourcepub fn set_values<T: Into<Box<StringValues>>>(self, v: T) -> Self
pub fn set_values<T: Into<Box<StringValues>>>(self, v: T) -> Self
Sets the value of kind
to hold a Values.
Note that all the setters affecting kind are
mutually exclusive.
§Example
use google_cloud_securityposture_v1::model::policy_rule::StringValues;
let x = PolicyRule::new().set_values(StringValues::default()/* use setters */);
assert!(x.values().is_some());
assert!(x.allow_all().is_none());
assert!(x.deny_all().is_none());
assert!(x.enforce().is_none());Sourcepub fn allow_all(&self) -> Option<&bool>
pub fn allow_all(&self) -> Option<&bool>
The value of kind
if it holds a AllowAll, None if the field is not set or
holds a different branch.
Sourcepub fn set_allow_all<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_all<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn deny_all(&self) -> Option<&bool>
pub fn deny_all(&self) -> Option<&bool>
The value of kind
if it holds a DenyAll, None if the field is not set or
holds a different branch.
Sourcepub fn set_deny_all<T: Into<bool>>(self, v: T) -> Self
pub fn set_deny_all<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn enforce(&self) -> Option<&bool>
pub fn enforce(&self) -> Option<&bool>
The value of kind
if it holds a Enforce, None if the field is not set or
holds a different branch.
Sourcepub fn set_enforce<T: Into<bool>>(self, v: T) -> Self
pub fn set_enforce<T: Into<bool>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for PolicyRule
impl Clone for PolicyRule
Source§fn clone(&self) -> PolicyRule
fn clone(&self) -> PolicyRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyRule
impl Debug for PolicyRule
Source§impl Default for PolicyRule
impl Default for PolicyRule
Source§fn default() -> PolicyRule
fn default() -> PolicyRule
Source§impl PartialEq for PolicyRule
impl PartialEq for PolicyRule
impl StructuralPartialEq for PolicyRule
Auto Trait Implementations§
impl Freeze for PolicyRule
impl RefUnwindSafe for PolicyRule
impl Send for PolicyRule
impl Sync for PolicyRule
impl Unpin for PolicyRule
impl UnsafeUnpin for PolicyRule
impl UnwindSafe for PolicyRule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request