// 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 PutLifecycleConfigurationInput {
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</p>
pub file_system_id: ::std::option::Option<::std::string::String>,
/// <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 lifecycle_policies: ::std::option::Option<::std::vec::Vec<crate::types::LifecyclePolicy>>,
}
impl PutLifecycleConfigurationInput {
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</p>
pub fn file_system_id(&self) -> ::std::option::Option<&str> {
self.file_system_id.as_deref()
}
/// <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>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.lifecycle_policies.is_none()`.
pub fn lifecycle_policies(&self) -> &[crate::types::LifecyclePolicy] {
self.lifecycle_policies.as_deref().unwrap_or_default()
}
}
impl PutLifecycleConfigurationInput {
/// Creates a new builder-style object to manufacture [`PutLifecycleConfigurationInput`](crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput).
pub fn builder() -> crate::operation::put_lifecycle_configuration::builders::PutLifecycleConfigurationInputBuilder {
crate::operation::put_lifecycle_configuration::builders::PutLifecycleConfigurationInputBuilder::default()
}
}
/// A builder for [`PutLifecycleConfigurationInput`](crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PutLifecycleConfigurationInputBuilder {
pub(crate) file_system_id: ::std::option::Option<::std::string::String>,
pub(crate) lifecycle_policies: ::std::option::Option<::std::vec::Vec<crate::types::LifecyclePolicy>>,
}
impl PutLifecycleConfigurationInputBuilder {
/// <p>The ID of the file system for which you are creating the <code>LifecycleConfiguration</code> object (String).</p>
/// This field is required.
pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.file_system_id = ::std::option::Option::Some(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.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.file_system_id
}
/// Appends an item to `lifecycle_policies`.
///
/// 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 {
let mut v = self.lifecycle_policies.unwrap_or_default();
v.push(input);
self.lifecycle_policies = ::std::option::Option::Some(v);
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.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.lifecycle_policies
}
/// Consumes the builder and constructs a [`PutLifecycleConfigurationInput`](crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput {
file_system_id: self.file_system_id,
lifecycle_policies: self.lifecycle_policies,
})
}
}