[][src]Struct aws_iam::model::types::Statement

pub struct Statement {
    pub sid: Option<String>,
    pub principal: Option<Principal>,
    pub effect: Effect,
    pub action: Action,
    pub resource: Resource,
    pub condition: Option<HashMap<ConditionOperator, HashMap<QString, OneOrAll<ConditionValue>>>>,
}

The Statement element is the main element for a policy. This element is required. It can include multiple elements (see the subsequent sections in this page). The Statement element contains an array of individual statements. Each individual statement is a JSON block enclosed in braces { }.

From IAM JSON Policy Elements: Statement.

Fields

sid: Option<String>

The Sid (statement ID) is an optional identifier that you provide for the policy statement. You can assign a Sid value to each statement in a statement array. In services that let you specify an ID element, such as SQS and SNS, the Sid value is just a sub-ID of the policy document's ID. In IAM, the Sid value must be unique within a JSON policy

In IAM, the Sid is not exposed in the IAM API. You can't retrieve a particular statement based on this ID.

From IAM JSON Policy Elements: Sid.

principal: Option<Principal>

The principals, or not-principals to match as part of this statement.

effect: Effect

The effect, outcome, if this statement is matched.

action: Action

The actions, or not-actions to match as part of this statement.

resource: Resource

The resources, or not-resources to match as part of this statement.

condition: Option<HashMap<ConditionOperator, HashMap<QString, OneOrAll<ConditionValue>>>>

Any condition(s) attached to this statement.

Methods

impl Statement[src]

pub fn new(effect: Effect, action: Action, resource: Resource) -> Self[src]

Create a minimal Statement with only required fields.

Example

use aws_iam::model::*;
use aws_iam::model::builder::*;
use std::str::FromStr;

let statement = Statement::new(
    Effect::Allow,
    Action::Action(OneOrAny::One("s3:ListBucket".parse().unwrap())),
    Resource::this("arn:aws:s3:::example_bucket".to_string()),
);

pub fn new_sid() -> String[src]

Construct a new, random, unique, ID for a Statement.

Trait Implementations

impl<'_> From<&'_ mut StatementBuilder> for Statement[src]

impl Clone for Statement[src]

impl Debug for Statement[src]

impl Serialize for Statement[src]

impl<'de> Deserialize<'de> for Statement[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,