#[non_exhaustive]pub enum PolicyDefinition {
Static(StaticPolicyDefinition),
TemplateLinked(TemplateLinkedPolicyDefinition),
Unknown,
}Expand description
A structure that contains the details for a Cedar policy definition. It includes the policy type, a description, and a policy body. This is a top level data type used to create a policy.
This data type is used as a request parameter for the CreatePolicy operation. This structure must always have either an static or a templateLinked element.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Static(StaticPolicyDefinition)
A structure that describes a static policy. An static policy doesn't use a template or allow placeholders for entities.
TemplateLinked(TemplateLinkedPolicyDefinition)
A structure that describes a policy that was instantiated from a template. The template can specify placeholders for principal and resource. When you use CreatePolicy to create a policy from a template, you specify the exact principal and resource to use for the instantiated policy.
Unknown
The Unknown variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
An unknown enum variant
Note: If you encounter this error, consider upgrading your SDK to the latest version.
The Unknown variant represents cases where the server sent a value that wasn’t recognized
by the client. This can happen when the server adds new functionality, but the client has not been updated.
To investigate this, consider turning on debug logging to print the raw HTTP response.
Implementations§
source§impl PolicyDefinition
impl PolicyDefinition
sourcepub fn as_static(&self) -> Result<&StaticPolicyDefinition, &Self>
pub fn as_static(&self) -> Result<&StaticPolicyDefinition, &Self>
Tries to convert the enum instance into Static, extracting the inner StaticPolicyDefinition.
Returns Err(&Self) if it can’t be converted.
sourcepub fn as_template_linked(
&self
) -> Result<&TemplateLinkedPolicyDefinition, &Self>
pub fn as_template_linked( &self ) -> Result<&TemplateLinkedPolicyDefinition, &Self>
Tries to convert the enum instance into TemplateLinked, extracting the inner TemplateLinkedPolicyDefinition.
Returns Err(&Self) if it can’t be converted.
sourcepub fn is_template_linked(&self) -> bool
pub fn is_template_linked(&self) -> bool
Returns true if this is a TemplateLinked.
sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if the enum instance is the Unknown variant.
Trait Implementations§
source§impl Clone for PolicyDefinition
impl Clone for PolicyDefinition
source§fn clone(&self) -> PolicyDefinition
fn clone(&self) -> PolicyDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PolicyDefinition
impl Debug for PolicyDefinition
source§impl PartialEq for PolicyDefinition
impl PartialEq for PolicyDefinition
source§fn eq(&self, other: &PolicyDefinition) -> bool
fn eq(&self, other: &PolicyDefinition) -> bool
self and other values to be equal, and is used
by ==.