pub struct ConditionBlock {
pub conditions: HashMap<Operator, HashMap<String, Value>>,
}
Expand description
Represents a condition block in an IAM policy This is a collection of conditions grouped by operator
Fields§
§conditions: HashMap<Operator, HashMap<String, Value>>
Map of operators to their key-value pairs
Implementations§
Source§impl ConditionBlock
impl ConditionBlock
Sourcepub fn add_condition(&mut self, condition: Condition)
pub fn add_condition(&mut self, condition: Condition)
Adds a condition to the block
Sourcepub fn with_condition(self, condition: Condition) -> Self
pub fn with_condition(self, condition: Condition) -> Self
Adds a condition using the builder pattern
Sourcepub fn with_condition_direct<K: Into<String>>(
self,
operator: Operator,
key: K,
value: Value,
) -> Self
pub fn with_condition_direct<K: Into<String>>( self, operator: Operator, key: K, value: Value, ) -> Self
Adds a condition directly with operator, key, and value
Sourcepub fn get_conditions_for_operator(
&self,
operator: &Operator,
) -> Option<&HashMap<String, Value>>
pub fn get_conditions_for_operator( &self, operator: &Operator, ) -> Option<&HashMap<String, Value>>
Gets all conditions for a specific operator
Sourcepub fn get_condition_value(
&self,
operator: &Operator,
key: &str,
) -> Option<&Value>
pub fn get_condition_value( &self, operator: &Operator, key: &str, ) -> Option<&Value>
Gets a specific condition value
Sourcepub fn has_condition(&self, operator: &Operator, key: &str) -> bool
pub fn has_condition(&self, operator: &Operator, key: &str) -> bool
Checks if a condition exists
Trait Implementations§
Source§impl Clone for ConditionBlock
impl Clone for ConditionBlock
Source§fn clone(&self) -> ConditionBlock
fn clone(&self) -> ConditionBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConditionBlock
impl Debug for ConditionBlock
Source§impl Default for ConditionBlock
impl Default for ConditionBlock
Source§impl<'de> Deserialize<'de> for ConditionBlock
impl<'de> Deserialize<'de> for ConditionBlock
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConditionBlock
impl PartialEq for ConditionBlock
Source§impl Serialize for ConditionBlock
impl Serialize for ConditionBlock
Source§impl Validate for ConditionBlock
impl Validate for ConditionBlock
Source§fn validate(&self, context: &mut ValidationContext) -> ValidationResult
fn validate(&self, context: &mut ValidationContext) -> ValidationResult
Validate the component within the given context Read more
Source§fn validate_result(&self) -> ValidationResult
fn validate_result(&self) -> ValidationResult
Validate with detailed errors (same as regular validation) Read more
impl Eq for ConditionBlock
impl StructuralPartialEq for ConditionBlock
Auto Trait Implementations§
impl Freeze for ConditionBlock
impl RefUnwindSafe for ConditionBlock
impl Send for ConditionBlock
impl Sync for ConditionBlock
impl Unpin for ConditionBlock
impl UnwindSafe for ConditionBlock
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