aws-sdk-efs 0.27.0

AWS SDK for Amazon Elastic File System
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::delete_file_system::_delete_file_system_output::DeleteFileSystemOutputBuilder;

pub use crate::operation::delete_file_system::_delete_file_system_input::DeleteFileSystemInputBuilder;

/// Fluent builder constructing a request to `DeleteFileSystem`.
///
/// <p>Deletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system.</p>
/// <p>You need to manually delete mount targets attached to a file system before you can delete an EFS file system. This step is performed for you when you use the Amazon Web Services console to delete a file system.</p> <note>
/// <p>You cannot delete a file system that is part of an EFS Replication configuration. You need to delete the replication configuration first.</p>
/// </note>
/// <p> You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them. For more information, see <code>DescribeMountTargets</code> and <code>DeleteMountTarget</code>. </p> <note>
/// <p>The <code>DeleteFileSystem</code> call returns while the file system state is still <code>deleting</code>. You can check the file system deletion status by calling the <code>DescribeFileSystems</code> operation, which returns a list of file systems in your account. If you pass file system ID or creation token for the deleted file system, the <code>DescribeFileSystems</code> returns a <code>404 FileSystemNotFound</code> error.</p>
/// </note>
/// <p>This operation requires permissions for the <code>elasticfilesystem:DeleteFileSystem</code> action.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteFileSystemFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder,
}
impl DeleteFileSystemFluentBuilder {
    /// Creates a new `DeleteFileSystem`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }
    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::delete_file_system::DeleteFileSystem,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::delete_file_system::DeleteFileSystemError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> std::result::Result<
        crate::operation::delete_file_system::DeleteFileSystemOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::delete_file_system::DeleteFileSystemError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The ID of the file system you want to delete.</p>
    pub fn file_system_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.file_system_id(input.into());
        self
    }
    /// <p>The ID of the file system you want to delete.</p>
    pub fn set_file_system_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_file_system_id(input);
        self
    }
}