aws_sdk_s3/types/_transition.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html">Transitioning Objects Using Amazon S3 Lifecycle</a> in the <i>Amazon S3 User Guide</i>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Transition {
7 /// <p>Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.</p>
8 pub date: ::std::option::Option<::aws_smithy_types::DateTime>,
9 /// <p>Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is <code>INTELLIGENT_TIERING</code>, <code>GLACIER_IR</code>, <code>GLACIER</code>, or <code>DEEP_ARCHIVE</code>, valid values are <code>0</code> or positive integers. If the specified storage class is <code>STANDARD_IA</code> or <code>ONEZONE_IA</code>, valid values are positive integers greater than <code>30</code>. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints"> Constraints and considerations for transitions</a> in the <i>Amazon S3 User Guide</i>.</p>
10 pub days: ::std::option::Option<i32>,
11 /// <p>The storage class to which you want the object to transition.</p>
12 pub storage_class: ::std::option::Option<crate::types::TransitionStorageClass>,
13}
14impl Transition {
15 /// <p>Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.</p>
16 pub fn date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
17 self.date.as_ref()
18 }
19 /// <p>Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is <code>INTELLIGENT_TIERING</code>, <code>GLACIER_IR</code>, <code>GLACIER</code>, or <code>DEEP_ARCHIVE</code>, valid values are <code>0</code> or positive integers. If the specified storage class is <code>STANDARD_IA</code> or <code>ONEZONE_IA</code>, valid values are positive integers greater than <code>30</code>. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints"> Constraints and considerations for transitions</a> in the <i>Amazon S3 User Guide</i>.</p>
20 pub fn days(&self) -> ::std::option::Option<i32> {
21 self.days
22 }
23 /// <p>The storage class to which you want the object to transition.</p>
24 pub fn storage_class(&self) -> ::std::option::Option<&crate::types::TransitionStorageClass> {
25 self.storage_class.as_ref()
26 }
27}
28impl Transition {
29 /// Creates a new builder-style object to manufacture [`Transition`](crate::types::Transition).
30 pub fn builder() -> crate::types::builders::TransitionBuilder {
31 crate::types::builders::TransitionBuilder::default()
32 }
33}
34
35/// A builder for [`Transition`](crate::types::Transition).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct TransitionBuilder {
39 pub(crate) date: ::std::option::Option<::aws_smithy_types::DateTime>,
40 pub(crate) days: ::std::option::Option<i32>,
41 pub(crate) storage_class: ::std::option::Option<crate::types::TransitionStorageClass>,
42}
43impl TransitionBuilder {
44 /// <p>Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.</p>
45 pub fn date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
46 self.date = ::std::option::Option::Some(input);
47 self
48 }
49 /// <p>Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.</p>
50 pub fn set_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
51 self.date = input;
52 self
53 }
54 /// <p>Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.</p>
55 pub fn get_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
56 &self.date
57 }
58 /// <p>Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is <code>INTELLIGENT_TIERING</code>, <code>GLACIER_IR</code>, <code>GLACIER</code>, or <code>DEEP_ARCHIVE</code>, valid values are <code>0</code> or positive integers. If the specified storage class is <code>STANDARD_IA</code> or <code>ONEZONE_IA</code>, valid values are positive integers greater than <code>30</code>. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints"> Constraints and considerations for transitions</a> in the <i>Amazon S3 User Guide</i>.</p>
59 pub fn days(mut self, input: i32) -> Self {
60 self.days = ::std::option::Option::Some(input);
61 self
62 }
63 /// <p>Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is <code>INTELLIGENT_TIERING</code>, <code>GLACIER_IR</code>, <code>GLACIER</code>, or <code>DEEP_ARCHIVE</code>, valid values are <code>0</code> or positive integers. If the specified storage class is <code>STANDARD_IA</code> or <code>ONEZONE_IA</code>, valid values are positive integers greater than <code>30</code>. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints"> Constraints and considerations for transitions</a> in the <i>Amazon S3 User Guide</i>.</p>
64 pub fn set_days(mut self, input: ::std::option::Option<i32>) -> Self {
65 self.days = input;
66 self
67 }
68 /// <p>Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is <code>INTELLIGENT_TIERING</code>, <code>GLACIER_IR</code>, <code>GLACIER</code>, or <code>DEEP_ARCHIVE</code>, valid values are <code>0</code> or positive integers. If the specified storage class is <code>STANDARD_IA</code> or <code>ONEZONE_IA</code>, valid values are positive integers greater than <code>30</code>. Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html#lifecycle-configuration-constraints"> Constraints and considerations for transitions</a> in the <i>Amazon S3 User Guide</i>.</p>
69 pub fn get_days(&self) -> &::std::option::Option<i32> {
70 &self.days
71 }
72 /// <p>The storage class to which you want the object to transition.</p>
73 pub fn storage_class(mut self, input: crate::types::TransitionStorageClass) -> Self {
74 self.storage_class = ::std::option::Option::Some(input);
75 self
76 }
77 /// <p>The storage class to which you want the object to transition.</p>
78 pub fn set_storage_class(mut self, input: ::std::option::Option<crate::types::TransitionStorageClass>) -> Self {
79 self.storage_class = input;
80 self
81 }
82 /// <p>The storage class to which you want the object to transition.</p>
83 pub fn get_storage_class(&self) -> &::std::option::Option<crate::types::TransitionStorageClass> {
84 &self.storage_class
85 }
86 /// Consumes the builder and constructs a [`Transition`](crate::types::Transition).
87 pub fn build(self) -> crate::types::Transition {
88 crate::types::Transition {
89 date: self.date,
90 days: self.days,
91 storage_class: self.storage_class,
92 }
93 }
94}