aws-sdk-s3control 1.117.0

AWS SDK for AWS S3 Control
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Grantee {
    /// <p>The type of the grantee to which access has been granted. It can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>IAM</code> - An IAM user or role.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// </ul>
    pub grantee_type: ::std::option::Option<crate::types::GranteeType>,
    /// <p>The unique identifier of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
    pub grantee_identifier: ::std::option::Option<::std::string::String>,
}
impl Grantee {
    /// <p>The type of the grantee to which access has been granted. It can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>IAM</code> - An IAM user or role.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// </ul>
    pub fn grantee_type(&self) -> ::std::option::Option<&crate::types::GranteeType> {
        self.grantee_type.as_ref()
    }
    /// <p>The unique identifier of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
    pub fn grantee_identifier(&self) -> ::std::option::Option<&str> {
        self.grantee_identifier.as_deref()
    }
}
impl Grantee {
    /// Creates a new builder-style object to manufacture [`Grantee`](crate::types::Grantee).
    pub fn builder() -> crate::types::builders::GranteeBuilder {
        crate::types::builders::GranteeBuilder::default()
    }
}

/// A builder for [`Grantee`](crate::types::Grantee).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GranteeBuilder {
    pub(crate) grantee_type: ::std::option::Option<crate::types::GranteeType>,
    pub(crate) grantee_identifier: ::std::option::Option<::std::string::String>,
}
impl GranteeBuilder {
    /// <p>The type of the grantee to which access has been granted. It can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>IAM</code> - An IAM user or role.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// </ul>
    pub fn grantee_type(mut self, input: crate::types::GranteeType) -> Self {
        self.grantee_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the grantee to which access has been granted. It can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>IAM</code> - An IAM user or role.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// </ul>
    pub fn set_grantee_type(mut self, input: ::std::option::Option<crate::types::GranteeType>) -> Self {
        self.grantee_type = input;
        self
    }
    /// <p>The type of the grantee to which access has been granted. It can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>IAM</code> - An IAM user or role.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// <li>
    /// <p><code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p></li>
    /// </ul>
    pub fn get_grantee_type(&self) -> &::std::option::Option<crate::types::GranteeType> {
        &self.grantee_type
    }
    /// <p>The unique identifier of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
    pub fn grantee_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.grantee_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
    pub fn set_grantee_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.grantee_identifier = input;
        self
    }
    /// <p>The unique identifier of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
    pub fn get_grantee_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.grantee_identifier
    }
    /// Consumes the builder and constructs a [`Grantee`](crate::types::Grantee).
    pub fn build(self) -> crate::types::Grantee {
        crate::types::Grantee {
            grantee_type: self.grantee_type,
            grantee_identifier: self.grantee_identifier,
        }
    }
}