aws_sdk_dynamodb/types/_backup_details.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the details of the backup created for the table.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BackupDetails {
7 /// <p>ARN associated with the backup.</p>
8 pub backup_arn: ::std::string::String,
9 /// <p>Name of the requested backup.</p>
10 pub backup_name: ::std::string::String,
11 /// <p>Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.</p>
12 pub backup_size_bytes: ::std::option::Option<i64>,
13 /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
14 pub backup_status: crate::types::BackupStatus,
15 /// <p>BackupType:</p>
16 /// <ul>
17 /// <li>
18 /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
19 /// <li>
20 /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
21 /// <li>
22 /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from Backup service.</p></li>
23 /// </ul>
24 pub backup_type: crate::types::BackupType,
25 /// <p>Time at which the backup was created. This is the request time of the backup.</p>
26 pub backup_creation_date_time: ::aws_smithy_types::DateTime,
27 /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
28 pub backup_expiry_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
29}
30impl BackupDetails {
31 /// <p>ARN associated with the backup.</p>
32 pub fn backup_arn(&self) -> &str {
33 use std::ops::Deref;
34 self.backup_arn.deref()
35 }
36 /// <p>Name of the requested backup.</p>
37 pub fn backup_name(&self) -> &str {
38 use std::ops::Deref;
39 self.backup_name.deref()
40 }
41 /// <p>Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.</p>
42 pub fn backup_size_bytes(&self) -> ::std::option::Option<i64> {
43 self.backup_size_bytes
44 }
45 /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
46 pub fn backup_status(&self) -> &crate::types::BackupStatus {
47 &self.backup_status
48 }
49 /// <p>BackupType:</p>
50 /// <ul>
51 /// <li>
52 /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
53 /// <li>
54 /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
55 /// <li>
56 /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from Backup service.</p></li>
57 /// </ul>
58 pub fn backup_type(&self) -> &crate::types::BackupType {
59 &self.backup_type
60 }
61 /// <p>Time at which the backup was created. This is the request time of the backup.</p>
62 pub fn backup_creation_date_time(&self) -> &::aws_smithy_types::DateTime {
63 &self.backup_creation_date_time
64 }
65 /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
66 pub fn backup_expiry_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67 self.backup_expiry_date_time.as_ref()
68 }
69}
70impl BackupDetails {
71 /// Creates a new builder-style object to manufacture [`BackupDetails`](crate::types::BackupDetails).
72 pub fn builder() -> crate::types::builders::BackupDetailsBuilder {
73 crate::types::builders::BackupDetailsBuilder::default()
74 }
75}
76
77/// A builder for [`BackupDetails`](crate::types::BackupDetails).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct BackupDetailsBuilder {
81 pub(crate) backup_arn: ::std::option::Option<::std::string::String>,
82 pub(crate) backup_name: ::std::option::Option<::std::string::String>,
83 pub(crate) backup_size_bytes: ::std::option::Option<i64>,
84 pub(crate) backup_status: ::std::option::Option<crate::types::BackupStatus>,
85 pub(crate) backup_type: ::std::option::Option<crate::types::BackupType>,
86 pub(crate) backup_creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
87 pub(crate) backup_expiry_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
88}
89impl BackupDetailsBuilder {
90 /// <p>ARN associated with the backup.</p>
91 /// This field is required.
92 pub fn backup_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.backup_arn = ::std::option::Option::Some(input.into());
94 self
95 }
96 /// <p>ARN associated with the backup.</p>
97 pub fn set_backup_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98 self.backup_arn = input;
99 self
100 }
101 /// <p>ARN associated with the backup.</p>
102 pub fn get_backup_arn(&self) -> &::std::option::Option<::std::string::String> {
103 &self.backup_arn
104 }
105 /// <p>Name of the requested backup.</p>
106 /// This field is required.
107 pub fn backup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.backup_name = ::std::option::Option::Some(input.into());
109 self
110 }
111 /// <p>Name of the requested backup.</p>
112 pub fn set_backup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.backup_name = input;
114 self
115 }
116 /// <p>Name of the requested backup.</p>
117 pub fn get_backup_name(&self) -> &::std::option::Option<::std::string::String> {
118 &self.backup_name
119 }
120 /// <p>Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.</p>
121 pub fn backup_size_bytes(mut self, input: i64) -> Self {
122 self.backup_size_bytes = ::std::option::Option::Some(input);
123 self
124 }
125 /// <p>Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.</p>
126 pub fn set_backup_size_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
127 self.backup_size_bytes = input;
128 self
129 }
130 /// <p>Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.</p>
131 pub fn get_backup_size_bytes(&self) -> &::std::option::Option<i64> {
132 &self.backup_size_bytes
133 }
134 /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
135 /// This field is required.
136 pub fn backup_status(mut self, input: crate::types::BackupStatus) -> Self {
137 self.backup_status = ::std::option::Option::Some(input);
138 self
139 }
140 /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
141 pub fn set_backup_status(mut self, input: ::std::option::Option<crate::types::BackupStatus>) -> Self {
142 self.backup_status = input;
143 self
144 }
145 /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
146 pub fn get_backup_status(&self) -> &::std::option::Option<crate::types::BackupStatus> {
147 &self.backup_status
148 }
149 /// <p>BackupType:</p>
150 /// <ul>
151 /// <li>
152 /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
153 /// <li>
154 /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
155 /// <li>
156 /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from Backup service.</p></li>
157 /// </ul>
158 /// This field is required.
159 pub fn backup_type(mut self, input: crate::types::BackupType) -> Self {
160 self.backup_type = ::std::option::Option::Some(input);
161 self
162 }
163 /// <p>BackupType:</p>
164 /// <ul>
165 /// <li>
166 /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
167 /// <li>
168 /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
169 /// <li>
170 /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from Backup service.</p></li>
171 /// </ul>
172 pub fn set_backup_type(mut self, input: ::std::option::Option<crate::types::BackupType>) -> Self {
173 self.backup_type = input;
174 self
175 }
176 /// <p>BackupType:</p>
177 /// <ul>
178 /// <li>
179 /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
180 /// <li>
181 /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
182 /// <li>
183 /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from Backup service.</p></li>
184 /// </ul>
185 pub fn get_backup_type(&self) -> &::std::option::Option<crate::types::BackupType> {
186 &self.backup_type
187 }
188 /// <p>Time at which the backup was created. This is the request time of the backup.</p>
189 /// This field is required.
190 pub fn backup_creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
191 self.backup_creation_date_time = ::std::option::Option::Some(input);
192 self
193 }
194 /// <p>Time at which the backup was created. This is the request time of the backup.</p>
195 pub fn set_backup_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
196 self.backup_creation_date_time = input;
197 self
198 }
199 /// <p>Time at which the backup was created. This is the request time of the backup.</p>
200 pub fn get_backup_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
201 &self.backup_creation_date_time
202 }
203 /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
204 pub fn backup_expiry_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
205 self.backup_expiry_date_time = ::std::option::Option::Some(input);
206 self
207 }
208 /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
209 pub fn set_backup_expiry_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210 self.backup_expiry_date_time = input;
211 self
212 }
213 /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
214 pub fn get_backup_expiry_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
215 &self.backup_expiry_date_time
216 }
217 /// Consumes the builder and constructs a [`BackupDetails`](crate::types::BackupDetails).
218 /// This method will fail if any of the following fields are not set:
219 /// - [`backup_arn`](crate::types::builders::BackupDetailsBuilder::backup_arn)
220 /// - [`backup_name`](crate::types::builders::BackupDetailsBuilder::backup_name)
221 /// - [`backup_status`](crate::types::builders::BackupDetailsBuilder::backup_status)
222 /// - [`backup_type`](crate::types::builders::BackupDetailsBuilder::backup_type)
223 /// - [`backup_creation_date_time`](crate::types::builders::BackupDetailsBuilder::backup_creation_date_time)
224 pub fn build(self) -> ::std::result::Result<crate::types::BackupDetails, ::aws_smithy_types::error::operation::BuildError> {
225 ::std::result::Result::Ok(crate::types::BackupDetails {
226 backup_arn: self.backup_arn.ok_or_else(|| {
227 ::aws_smithy_types::error::operation::BuildError::missing_field(
228 "backup_arn",
229 "backup_arn was not specified but it is required when building BackupDetails",
230 )
231 })?,
232 backup_name: self.backup_name.ok_or_else(|| {
233 ::aws_smithy_types::error::operation::BuildError::missing_field(
234 "backup_name",
235 "backup_name was not specified but it is required when building BackupDetails",
236 )
237 })?,
238 backup_size_bytes: self.backup_size_bytes,
239 backup_status: self.backup_status.ok_or_else(|| {
240 ::aws_smithy_types::error::operation::BuildError::missing_field(
241 "backup_status",
242 "backup_status was not specified but it is required when building BackupDetails",
243 )
244 })?,
245 backup_type: self.backup_type.ok_or_else(|| {
246 ::aws_smithy_types::error::operation::BuildError::missing_field(
247 "backup_type",
248 "backup_type was not specified but it is required when building BackupDetails",
249 )
250 })?,
251 backup_creation_date_time: self.backup_creation_date_time.ok_or_else(|| {
252 ::aws_smithy_types::error::operation::BuildError::missing_field(
253 "backup_creation_date_time",
254 "backup_creation_date_time was not specified but it is required when building BackupDetails",
255 )
256 })?,
257 backup_expiry_date_time: self.backup_expiry_date_time,
258 })
259 }
260}