aws-sdk-accessanalyzer 1.106.0

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

/// <p>Access control configuration structures for your resource. You specify the configuration as a type-value pair. You can specify only one type of access control configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Configuration {
    /// <p>The access control configuration is for a DynamoDB stream.</p>
    DynamodbStream(crate::types::DynamodbStreamConfiguration),
    /// <p>The access control configuration is for a DynamoDB table or index.</p>
    DynamodbTable(crate::types::DynamodbTableConfiguration),
    /// <p>The access control configuration is for an Amazon EBS volume snapshot.</p>
    EbsSnapshot(crate::types::EbsSnapshotConfiguration),
    /// <p>The access control configuration is for an Amazon ECR repository.</p>
    EcrRepository(crate::types::EcrRepositoryConfiguration),
    /// <p>The access control configuration is for an Amazon EFS file system.</p>
    EfsFileSystem(crate::types::EfsFileSystemConfiguration),
    /// <p>The access control configuration is for an IAM role.</p>
    IamRole(crate::types::IamRoleConfiguration),
    /// <p>The access control configuration is for a KMS key.</p>
    KmsKey(crate::types::KmsKeyConfiguration),
    /// <p>The access control configuration is for an Amazon RDS DB cluster snapshot.</p>
    RdsDbClusterSnapshot(crate::types::RdsDbClusterSnapshotConfiguration),
    /// <p>The access control configuration is for an Amazon RDS DB snapshot.</p>
    RdsDbSnapshot(crate::types::RdsDbSnapshotConfiguration),
    /// <p>The access control configuration is for an Amazon S3 bucket.</p>
    S3Bucket(crate::types::S3BucketConfiguration),
    /// <p>The access control configuration is for an Amazon S3 directory bucket.</p>
    S3ExpressDirectoryBucket(crate::types::S3ExpressDirectoryBucketConfiguration),
    /// <p>The access control configuration is for a Secrets Manager secret.</p>
    SecretsManagerSecret(crate::types::SecretsManagerSecretConfiguration),
    /// <p>The access control configuration is for an Amazon SNS topic</p>
    SnsTopic(crate::types::SnsTopicConfiguration),
    /// <p>The access control configuration is for an Amazon SQS queue.</p>
    SqsQueue(crate::types::SqsQueueConfiguration),
    /// 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.
    #[non_exhaustive]
    Unknown,
}
impl Configuration {
    /// Tries to convert the enum instance into [`DynamodbStream`](crate::types::Configuration::DynamodbStream), extracting the inner [`DynamodbStreamConfiguration`](crate::types::DynamodbStreamConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_dynamodb_stream(&self) -> ::std::result::Result<&crate::types::DynamodbStreamConfiguration, &Self> {
        if let Configuration::DynamodbStream(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`DynamodbStream`](crate::types::Configuration::DynamodbStream).
    pub fn is_dynamodb_stream(&self) -> bool {
        self.as_dynamodb_stream().is_ok()
    }
    /// Tries to convert the enum instance into [`DynamodbTable`](crate::types::Configuration::DynamodbTable), extracting the inner [`DynamodbTableConfiguration`](crate::types::DynamodbTableConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_dynamodb_table(&self) -> ::std::result::Result<&crate::types::DynamodbTableConfiguration, &Self> {
        if let Configuration::DynamodbTable(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`DynamodbTable`](crate::types::Configuration::DynamodbTable).
    pub fn is_dynamodb_table(&self) -> bool {
        self.as_dynamodb_table().is_ok()
    }
    /// Tries to convert the enum instance into [`EbsSnapshot`](crate::types::Configuration::EbsSnapshot), extracting the inner [`EbsSnapshotConfiguration`](crate::types::EbsSnapshotConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_ebs_snapshot(&self) -> ::std::result::Result<&crate::types::EbsSnapshotConfiguration, &Self> {
        if let Configuration::EbsSnapshot(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`EbsSnapshot`](crate::types::Configuration::EbsSnapshot).
    pub fn is_ebs_snapshot(&self) -> bool {
        self.as_ebs_snapshot().is_ok()
    }
    /// Tries to convert the enum instance into [`EcrRepository`](crate::types::Configuration::EcrRepository), extracting the inner [`EcrRepositoryConfiguration`](crate::types::EcrRepositoryConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_ecr_repository(&self) -> ::std::result::Result<&crate::types::EcrRepositoryConfiguration, &Self> {
        if let Configuration::EcrRepository(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`EcrRepository`](crate::types::Configuration::EcrRepository).
    pub fn is_ecr_repository(&self) -> bool {
        self.as_ecr_repository().is_ok()
    }
    /// Tries to convert the enum instance into [`EfsFileSystem`](crate::types::Configuration::EfsFileSystem), extracting the inner [`EfsFileSystemConfiguration`](crate::types::EfsFileSystemConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_efs_file_system(&self) -> ::std::result::Result<&crate::types::EfsFileSystemConfiguration, &Self> {
        if let Configuration::EfsFileSystem(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`EfsFileSystem`](crate::types::Configuration::EfsFileSystem).
    pub fn is_efs_file_system(&self) -> bool {
        self.as_efs_file_system().is_ok()
    }
    /// Tries to convert the enum instance into [`IamRole`](crate::types::Configuration::IamRole), extracting the inner [`IamRoleConfiguration`](crate::types::IamRoleConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_iam_role(&self) -> ::std::result::Result<&crate::types::IamRoleConfiguration, &Self> {
        if let Configuration::IamRole(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`IamRole`](crate::types::Configuration::IamRole).
    pub fn is_iam_role(&self) -> bool {
        self.as_iam_role().is_ok()
    }
    /// Tries to convert the enum instance into [`KmsKey`](crate::types::Configuration::KmsKey), extracting the inner [`KmsKeyConfiguration`](crate::types::KmsKeyConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_kms_key(&self) -> ::std::result::Result<&crate::types::KmsKeyConfiguration, &Self> {
        if let Configuration::KmsKey(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`KmsKey`](crate::types::Configuration::KmsKey).
    pub fn is_kms_key(&self) -> bool {
        self.as_kms_key().is_ok()
    }
    /// Tries to convert the enum instance into [`RdsDbClusterSnapshot`](crate::types::Configuration::RdsDbClusterSnapshot), extracting the inner [`RdsDbClusterSnapshotConfiguration`](crate::types::RdsDbClusterSnapshotConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_rds_db_cluster_snapshot(&self) -> ::std::result::Result<&crate::types::RdsDbClusterSnapshotConfiguration, &Self> {
        if let Configuration::RdsDbClusterSnapshot(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`RdsDbClusterSnapshot`](crate::types::Configuration::RdsDbClusterSnapshot).
    pub fn is_rds_db_cluster_snapshot(&self) -> bool {
        self.as_rds_db_cluster_snapshot().is_ok()
    }
    /// Tries to convert the enum instance into [`RdsDbSnapshot`](crate::types::Configuration::RdsDbSnapshot), extracting the inner [`RdsDbSnapshotConfiguration`](crate::types::RdsDbSnapshotConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_rds_db_snapshot(&self) -> ::std::result::Result<&crate::types::RdsDbSnapshotConfiguration, &Self> {
        if let Configuration::RdsDbSnapshot(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`RdsDbSnapshot`](crate::types::Configuration::RdsDbSnapshot).
    pub fn is_rds_db_snapshot(&self) -> bool {
        self.as_rds_db_snapshot().is_ok()
    }
    /// Tries to convert the enum instance into [`S3Bucket`](crate::types::Configuration::S3Bucket), extracting the inner [`S3BucketConfiguration`](crate::types::S3BucketConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_s3_bucket(&self) -> ::std::result::Result<&crate::types::S3BucketConfiguration, &Self> {
        if let Configuration::S3Bucket(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`S3Bucket`](crate::types::Configuration::S3Bucket).
    pub fn is_s3_bucket(&self) -> bool {
        self.as_s3_bucket().is_ok()
    }
    /// Tries to convert the enum instance into [`S3ExpressDirectoryBucket`](crate::types::Configuration::S3ExpressDirectoryBucket), extracting the inner [`S3ExpressDirectoryBucketConfiguration`](crate::types::S3ExpressDirectoryBucketConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_s3_express_directory_bucket(&self) -> ::std::result::Result<&crate::types::S3ExpressDirectoryBucketConfiguration, &Self> {
        if let Configuration::S3ExpressDirectoryBucket(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`S3ExpressDirectoryBucket`](crate::types::Configuration::S3ExpressDirectoryBucket).
    pub fn is_s3_express_directory_bucket(&self) -> bool {
        self.as_s3_express_directory_bucket().is_ok()
    }
    /// Tries to convert the enum instance into [`SecretsManagerSecret`](crate::types::Configuration::SecretsManagerSecret), extracting the inner [`SecretsManagerSecretConfiguration`](crate::types::SecretsManagerSecretConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_secrets_manager_secret(&self) -> ::std::result::Result<&crate::types::SecretsManagerSecretConfiguration, &Self> {
        if let Configuration::SecretsManagerSecret(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`SecretsManagerSecret`](crate::types::Configuration::SecretsManagerSecret).
    pub fn is_secrets_manager_secret(&self) -> bool {
        self.as_secrets_manager_secret().is_ok()
    }
    /// Tries to convert the enum instance into [`SnsTopic`](crate::types::Configuration::SnsTopic), extracting the inner [`SnsTopicConfiguration`](crate::types::SnsTopicConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_sns_topic(&self) -> ::std::result::Result<&crate::types::SnsTopicConfiguration, &Self> {
        if let Configuration::SnsTopic(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`SnsTopic`](crate::types::Configuration::SnsTopic).
    pub fn is_sns_topic(&self) -> bool {
        self.as_sns_topic().is_ok()
    }
    /// Tries to convert the enum instance into [`SqsQueue`](crate::types::Configuration::SqsQueue), extracting the inner [`SqsQueueConfiguration`](crate::types::SqsQueueConfiguration).
    /// Returns `Err(&Self)` if it can't be converted.
    pub fn as_sqs_queue(&self) -> ::std::result::Result<&crate::types::SqsQueueConfiguration, &Self> {
        if let Configuration::SqsQueue(val) = &self {
            ::std::result::Result::Ok(val)
        } else {
            ::std::result::Result::Err(self)
        }
    }
    /// Returns true if this is a [`SqsQueue`](crate::types::Configuration::SqsQueue).
    pub fn is_sqs_queue(&self) -> bool {
        self.as_sqs_queue().is_ok()
    }
    /// Returns true if the enum instance is the `Unknown` variant.
    pub fn is_unknown(&self) -> bool {
        matches!(self, Self::Unknown)
    }
}