// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_lifecycle_configuration::_put_lifecycle_configuration_output::PutLifecycleConfigurationOutputBuilder;
pub use crate::operation::put_lifecycle_configuration::_put_lifecycle_configuration_input::PutLifecycleConfigurationInputBuilder;
impl PutLifecycleConfigurationInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.put_lifecycle_configuration();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `PutLifecycleConfiguration`.
///
/// <p>Use this action to manage EFS lifecycle management and EFS Intelligent-Tiering. A <code>LifecycleConfiguration</code> consists of one or more <code>LifecyclePolicy</code> objects that define the following:</p>
/// <ul>
/// <li> <p> <b>EFS Lifecycle management</b> - When Amazon EFS automatically transitions files in a file system into the lower-cost EFS Infrequent Access (IA) storage class.</p> <p>To enable EFS Lifecycle management, set the value of <code>TransitionToIA</code> to one of the available options.</p> </li>
/// <li> <p> <b>EFS Intelligent-Tiering</b> - When Amazon EFS automatically transitions files from IA back into the file system's primary storage class (EFS Standard or EFS One Zone Standard).</p> <p>To enable EFS Intelligent-Tiering, set the value of <code>TransitionToPrimaryStorageClass</code> to <code>AFTER_1_ACCESS</code>.</p> </li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html">EFS Lifecycle Management</a>.</p>
/// <p>Each Amazon EFS file system supports one lifecycle configuration, which applies to all files in the file system. If a <code>LifecycleConfiguration</code> object already exists for the specified file system, a <code>PutLifecycleConfiguration</code> call modifies the existing configuration. A <code>PutLifecycleConfiguration</code> call with an empty <code>LifecyclePolicies</code> array in the request body deletes any existing <code>LifecycleConfiguration</code> and turns off lifecycle management and EFS Intelligent-Tiering for the file system.</p>
/// <p>In the request, specify the following: </p>
/// <ul>
/// <li> <p>The ID for the file system for which you are enabling, disabling, or modifying lifecycle management and EFS Intelligent-Tiering.</p> </li>
/// <li> <p>A <code>LifecyclePolicies</code> array of <code>LifecyclePolicy</code> objects that define when files are moved into IA storage, and when they are moved back to Standard storage.</p> <note>
/// <p>Amazon EFS requires that each <code>LifecyclePolicy</code> object have only have a single transition, so the <code>LifecyclePolicies</code> array needs to be structured with separate <code>LifecyclePolicy</code> objects. See the example requests in the following section for more information.</p>
/// </note> </li>
/// </ul>
/// <p>This operation requires permissions for the <code>elasticfilesystem:PutLifecycleConfiguration</code> operation.</p>
/// <p>To apply a <code>LifecycleConfiguration</code> object to an encrypted file system, you need the same Key Management Service permissions as when you created the encrypted file system.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutLifecycleConfigurationFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::put_lifecycle_configuration::builders::PutLifecycleConfigurationInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationOutput,
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationError,
> for PutLifecycleConfigurationFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationOutput,
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl PutLifecycleConfigurationFluentBuilder {
/// Creates a new `PutLifecycleConfiguration`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the PutLifecycleConfiguration as a reference.
pub fn as_input(&self) -> &crate::operation::put_lifecycle_configuration::builders::PutLifecycleConfigurationInputBuilder {
&self.inner
}
/// 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::put_lifecycle_configuration::PutLifecycleConfigurationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::put_lifecycle_configuration::PutLifecycleConfiguration::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::put_lifecycle_configuration::PutLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationOutput,
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl Into<crate::config::Builder>) -> Self {
self.set_config_override(Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</p>
pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.file_system_id(input.into());
self
}
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</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
}
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</p>
pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_file_system_id()
}
/// Appends an item to `LifecyclePolicies`.
///
/// To override the contents of this collection use [`set_lifecycle_policies`](Self::set_lifecycle_policies).
///
/// <p>An array of <code>LifecyclePolicy</code> objects that define the file system's <code>LifecycleConfiguration</code> object. A <code>LifecycleConfiguration</code> object informs EFS lifecycle management and EFS Intelligent-Tiering of the following:</p>
/// <ul>
/// <li> <p>When to move files in the file system from primary storage to the IA storage class.</p> </li>
/// <li> <p>When to move files that are in IA storage to primary storage.</p> </li>
/// </ul> <note>
/// <p>When using the <code>put-lifecycle-configuration</code> CLI command or the <code>PutLifecycleConfiguration</code> API action, Amazon EFS requires that each <code>LifecyclePolicy</code> object have only a single transition. This means that in a request body, <code>LifecyclePolicies</code> must be structured as an array of <code>LifecyclePolicy</code> objects, one object for each transition, <code>TransitionToIA</code>, <code>TransitionToPrimaryStorageClass</code>. See the example requests in the following section for more information.</p>
/// </note>
pub fn lifecycle_policies(mut self, input: crate::types::LifecyclePolicy) -> Self {
self.inner = self.inner.lifecycle_policies(input);
self
}
/// <p>An array of <code>LifecyclePolicy</code> objects that define the file system's <code>LifecycleConfiguration</code> object. A <code>LifecycleConfiguration</code> object informs EFS lifecycle management and EFS Intelligent-Tiering of the following:</p>
/// <ul>
/// <li> <p>When to move files in the file system from primary storage to the IA storage class.</p> </li>
/// <li> <p>When to move files that are in IA storage to primary storage.</p> </li>
/// </ul> <note>
/// <p>When using the <code>put-lifecycle-configuration</code> CLI command or the <code>PutLifecycleConfiguration</code> API action, Amazon EFS requires that each <code>LifecyclePolicy</code> object have only a single transition. This means that in a request body, <code>LifecyclePolicies</code> must be structured as an array of <code>LifecyclePolicy</code> objects, one object for each transition, <code>TransitionToIA</code>, <code>TransitionToPrimaryStorageClass</code>. See the example requests in the following section for more information.</p>
/// </note>
pub fn set_lifecycle_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LifecyclePolicy>>) -> Self {
self.inner = self.inner.set_lifecycle_policies(input);
self
}
/// <p>An array of <code>LifecyclePolicy</code> objects that define the file system's <code>LifecycleConfiguration</code> object. A <code>LifecycleConfiguration</code> object informs EFS lifecycle management and EFS Intelligent-Tiering of the following:</p>
/// <ul>
/// <li> <p>When to move files in the file system from primary storage to the IA storage class.</p> </li>
/// <li> <p>When to move files that are in IA storage to primary storage.</p> </li>
/// </ul> <note>
/// <p>When using the <code>put-lifecycle-configuration</code> CLI command or the <code>PutLifecycleConfiguration</code> API action, Amazon EFS requires that each <code>LifecyclePolicy</code> object have only a single transition. This means that in a request body, <code>LifecyclePolicies</code> must be structured as an array of <code>LifecyclePolicy</code> objects, one object for each transition, <code>TransitionToIA</code>, <code>TransitionToPrimaryStorageClass</code>. See the example requests in the following section for more information.</p>
/// </note>
pub fn get_lifecycle_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LifecyclePolicy>> {
self.inner.get_lifecycle_policies()
}
}