aws_sdk_s3/types/
_tiering.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Tiering {
7    /// <p>The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).</p>
8    pub days: i32,
9    /// <p>S3 Intelligent-Tiering access tier. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a> for a list of access tiers in the S3 Intelligent-Tiering storage class.</p>
10    pub access_tier: crate::types::IntelligentTieringAccessTier,
11}
12impl Tiering {
13    /// <p>The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).</p>
14    pub fn days(&self) -> i32 {
15        self.days
16    }
17    /// <p>S3 Intelligent-Tiering access tier. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a> for a list of access tiers in the S3 Intelligent-Tiering storage class.</p>
18    pub fn access_tier(&self) -> &crate::types::IntelligentTieringAccessTier {
19        &self.access_tier
20    }
21}
22impl Tiering {
23    /// Creates a new builder-style object to manufacture [`Tiering`](crate::types::Tiering).
24    pub fn builder() -> crate::types::builders::TieringBuilder {
25        crate::types::builders::TieringBuilder::default()
26    }
27}
28
29/// A builder for [`Tiering`](crate::types::Tiering).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct TieringBuilder {
33    pub(crate) days: ::std::option::Option<i32>,
34    pub(crate) access_tier: ::std::option::Option<crate::types::IntelligentTieringAccessTier>,
35}
36impl TieringBuilder {
37    /// <p>The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).</p>
38    /// This field is required.
39    pub fn days(mut self, input: i32) -> Self {
40        self.days = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).</p>
44    pub fn set_days(mut self, input: ::std::option::Option<i32>) -> Self {
45        self.days = input;
46        self
47    }
48    /// <p>The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).</p>
49    pub fn get_days(&self) -> &::std::option::Option<i32> {
50        &self.days
51    }
52    /// <p>S3 Intelligent-Tiering access tier. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a> for a list of access tiers in the S3 Intelligent-Tiering storage class.</p>
53    /// This field is required.
54    pub fn access_tier(mut self, input: crate::types::IntelligentTieringAccessTier) -> Self {
55        self.access_tier = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>S3 Intelligent-Tiering access tier. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a> for a list of access tiers in the S3 Intelligent-Tiering storage class.</p>
59    pub fn set_access_tier(mut self, input: ::std::option::Option<crate::types::IntelligentTieringAccessTier>) -> Self {
60        self.access_tier = input;
61        self
62    }
63    /// <p>S3 Intelligent-Tiering access tier. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a> for a list of access tiers in the S3 Intelligent-Tiering storage class.</p>
64    pub fn get_access_tier(&self) -> &::std::option::Option<crate::types::IntelligentTieringAccessTier> {
65        &self.access_tier
66    }
67    /// Consumes the builder and constructs a [`Tiering`](crate::types::Tiering).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`days`](crate::types::builders::TieringBuilder::days)
70    /// - [`access_tier`](crate::types::builders::TieringBuilder::access_tier)
71    pub fn build(self) -> ::std::result::Result<crate::types::Tiering, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::types::Tiering {
73            days: self.days.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "days",
76                    "days was not specified but it is required when building Tiering",
77                )
78            })?,
79            access_tier: self.access_tier.ok_or_else(|| {
80                ::aws_smithy_types::error::operation::BuildError::missing_field(
81                    "access_tier",
82                    "access_tier was not specified but it is required when building Tiering",
83                )
84            })?,
85        })
86    }
87}