aws-sdk-s3control 1.108.0

AWS SDK for AWS S3 Control
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetAccessGrantOutput {
    /// <p>The date and time when you created the access grant.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>
    pub access_grant_id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the access grant.</p>
    pub access_grant_arn: ::std::option::Option<::std::string::String>,
    /// <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 a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
    pub grantee: ::std::option::Option<crate::types::Grantee>,
    /// <p>The type of permission that was granted in the access grant. Can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
    /// </ul>
    pub permission: ::std::option::Option<crate::types::Permission>,
    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
    pub access_grants_location_id: ::std::option::Option<::std::string::String>,
    /// <p>The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.</p>
    pub access_grants_location_configuration: ::std::option::Option<crate::types::AccessGrantsLocationConfiguration>,
    /// <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
    pub grant_scope: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.</p>
    pub application_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetAccessGrantOutput {
    /// <p>The date and time when you created the access grant.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>
    pub fn access_grant_id(&self) -> ::std::option::Option<&str> {
        self.access_grant_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the access grant.</p>
    pub fn access_grant_arn(&self) -> ::std::option::Option<&str> {
        self.access_grant_arn.as_deref()
    }
    /// <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 a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
    pub fn grantee(&self) -> ::std::option::Option<&crate::types::Grantee> {
        self.grantee.as_ref()
    }
    /// <p>The type of permission that was granted in the access grant. Can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
    /// </ul>
    pub fn permission(&self) -> ::std::option::Option<&crate::types::Permission> {
        self.permission.as_ref()
    }
    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
    pub fn access_grants_location_id(&self) -> ::std::option::Option<&str> {
        self.access_grants_location_id.as_deref()
    }
    /// <p>The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.</p>
    pub fn access_grants_location_configuration(&self) -> ::std::option::Option<&crate::types::AccessGrantsLocationConfiguration> {
        self.access_grants_location_configuration.as_ref()
    }
    /// <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
    pub fn grant_scope(&self) -> ::std::option::Option<&str> {
        self.grant_scope.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.</p>
    pub fn application_arn(&self) -> ::std::option::Option<&str> {
        self.application_arn.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetAccessGrantOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAccessGrantOutput {
    /// Creates a new builder-style object to manufacture [`GetAccessGrantOutput`](crate::operation::get_access_grant::GetAccessGrantOutput).
    pub fn builder() -> crate::operation::get_access_grant::builders::GetAccessGrantOutputBuilder {
        crate::operation::get_access_grant::builders::GetAccessGrantOutputBuilder::default()
    }
}

/// A builder for [`GetAccessGrantOutput`](crate::operation::get_access_grant::GetAccessGrantOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAccessGrantOutputBuilder {
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) access_grant_id: ::std::option::Option<::std::string::String>,
    pub(crate) access_grant_arn: ::std::option::Option<::std::string::String>,
    pub(crate) grantee: ::std::option::Option<crate::types::Grantee>,
    pub(crate) permission: ::std::option::Option<crate::types::Permission>,
    pub(crate) access_grants_location_id: ::std::option::Option<::std::string::String>,
    pub(crate) access_grants_location_configuration: ::std::option::Option<crate::types::AccessGrantsLocationConfiguration>,
    pub(crate) grant_scope: ::std::option::Option<::std::string::String>,
    pub(crate) application_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetAccessGrantOutputBuilder {
    /// <p>The date and time when you created the access grant.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when you created the access grant.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time when you created the access grant.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>
    pub fn access_grant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_grant_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>
    pub fn set_access_grant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_grant_id = input;
        self
    }
    /// <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>
    pub fn get_access_grant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_grant_id
    }
    /// <p>The Amazon Resource Name (ARN) of the access grant.</p>
    pub fn access_grant_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_grant_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the access grant.</p>
    pub fn set_access_grant_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_grant_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the access grant.</p>
    pub fn get_access_grant_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_grant_arn
    }
    /// <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 a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
    pub fn grantee(mut self, input: crate::types::Grantee) -> Self {
        self.grantee = ::std::option::Option::Some(input);
        self
    }
    /// <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 a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
    pub fn set_grantee(mut self, input: ::std::option::Option<crate::types::Grantee>) -> Self {
        self.grantee = input;
        self
    }
    /// <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 a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.</p>
    pub fn get_grantee(&self) -> &::std::option::Option<crate::types::Grantee> {
        &self.grantee
    }
    /// <p>The type of permission that was granted in the access grant. Can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
    /// </ul>
    pub fn permission(mut self, input: crate::types::Permission) -> Self {
        self.permission = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of permission that was granted in the access grant. Can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
    /// </ul>
    pub fn set_permission(mut self, input: ::std::option::Option<crate::types::Permission>) -> Self {
        self.permission = input;
        self
    }
    /// <p>The type of permission that was granted in the access grant. Can be one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>READ</code> – Grant read-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>WRITE</code> – Grant write-only access to the S3 data.</p></li>
    /// <li>
    /// <p><code>READWRITE</code> – Grant both read and write access to the S3 data.</p></li>
    /// </ul>
    pub fn get_permission(&self) -> &::std::option::Option<crate::types::Permission> {
        &self.permission
    }
    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
    pub fn access_grants_location_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_grants_location_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
    pub fn set_access_grants_location_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_grants_location_id = input;
        self
    }
    /// <p>The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register.</p>
    pub fn get_access_grants_location_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_grants_location_id
    }
    /// <p>The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.</p>
    pub fn access_grants_location_configuration(mut self, input: crate::types::AccessGrantsLocationConfiguration) -> Self {
        self.access_grants_location_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.</p>
    pub fn set_access_grants_location_configuration(mut self, input: ::std::option::Option<crate::types::AccessGrantsLocationConfiguration>) -> Self {
        self.access_grants_location_configuration = input;
        self
    }
    /// <p>The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access.</p>
    pub fn get_access_grants_location_configuration(&self) -> &::std::option::Option<crate::types::AccessGrantsLocationConfiguration> {
        &self.access_grants_location_configuration
    }
    /// <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
    pub fn grant_scope(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.grant_scope = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
    pub fn set_grant_scope(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.grant_scope = input;
        self
    }
    /// <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
    pub fn get_grant_scope(&self) -> &::std::option::Option<::std::string::String> {
        &self.grant_scope
    }
    /// <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.</p>
    pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.</p>
    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.</p>
    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_arn
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetAccessGrantOutput`](crate::operation::get_access_grant::GetAccessGrantOutput).
    pub fn build(self) -> crate::operation::get_access_grant::GetAccessGrantOutput {
        crate::operation::get_access_grant::GetAccessGrantOutput {
            created_at: self.created_at,
            access_grant_id: self.access_grant_id,
            access_grant_arn: self.access_grant_arn,
            grantee: self.grantee,
            permission: self.permission,
            access_grants_location_id: self.access_grants_location_id,
            access_grants_location_configuration: self.access_grants_location_configuration,
            grant_scope: self.grant_scope,
            application_arn: self.application_arn,
            _request_id: self._request_id,
        }
    }
}