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.
#[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>
    #[doc(hidden)]
    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>
    #[doc(hidden)]
    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>
    pub fn lifecycle_policies(&self) -> std::option::Option<&[crate::types::LifecyclePolicy]> {
        self.lifecycle_policies.as_deref()
    }
}
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>
    pub fn file_system_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.file_system_id = 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
    }
    /// 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 = 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
    }
    /// Consumes the builder and constructs a [`PutLifecycleConfigurationInput`](crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::put_lifecycle_configuration::PutLifecycleConfigurationInput {
                file_system_id: self.file_system_id,
                lifecycle_policies: self.lifecycle_policies,
            },
        )
    }
}