1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PromoteReadReplicaInput {
/// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must match the identifier of an existing read replica DB instance.</p></li>
/// </ul>
/// <p>Example: <code>mydbinstance</code></p>
pub db_instance_identifier: ::std::option::Option<::std::string::String>,
/// <p>The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.</p>
/// <p>Default: 1</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be a value from 0 to 35.</p></li>
/// <li>
/// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
/// </ul>
pub backup_retention_period: ::std::option::Option<i32>,
/// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
/// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i></p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p></li>
/// <li>
/// <p>Must be in Universal Coordinated Time (UTC).</p></li>
/// <li>
/// <p>Must not conflict with the preferred maintenance window.</p></li>
/// <li>
/// <p>Must be at least 30 minutes.</p></li>
/// </ul>
pub preferred_backup_window: ::std::option::Option<::std::string::String>,
/// <p>Tags to assign to resources associated with the DB instance.</p>
/// <p>Valid Values:</p>
/// <ul>
/// <li>
/// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
/// </ul>
pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl PromoteReadReplicaInput {
/// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must match the identifier of an existing read replica DB instance.</p></li>
/// </ul>
/// <p>Example: <code>mydbinstance</code></p>
pub fn db_instance_identifier(&self) -> ::std::option::Option<&str> {
self.db_instance_identifier.as_deref()
}
/// <p>The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.</p>
/// <p>Default: 1</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be a value from 0 to 35.</p></li>
/// <li>
/// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
/// </ul>
pub fn backup_retention_period(&self) -> ::std::option::Option<i32> {
self.backup_retention_period
}
/// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
/// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i></p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p></li>
/// <li>
/// <p>Must be in Universal Coordinated Time (UTC).</p></li>
/// <li>
/// <p>Must not conflict with the preferred maintenance window.</p></li>
/// <li>
/// <p>Must be at least 30 minutes.</p></li>
/// </ul>
pub fn preferred_backup_window(&self) -> ::std::option::Option<&str> {
self.preferred_backup_window.as_deref()
}
/// <p>Tags to assign to resources associated with the DB instance.</p>
/// <p>Valid Values:</p>
/// <ul>
/// <li>
/// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
/// </ul>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
self.tag_specifications.as_deref().unwrap_or_default()
}
}
impl PromoteReadReplicaInput {
/// Creates a new builder-style object to manufacture [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
pub fn builder() -> crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder {
crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder::default()
}
}
/// A builder for [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PromoteReadReplicaInputBuilder {
pub(crate) db_instance_identifier: ::std::option::Option<::std::string::String>,
pub(crate) backup_retention_period: ::std::option::Option<i32>,
pub(crate) preferred_backup_window: ::std::option::Option<::std::string::String>,
pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl PromoteReadReplicaInputBuilder {
/// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must match the identifier of an existing read replica DB instance.</p></li>
/// </ul>
/// <p>Example: <code>mydbinstance</code></p>
/// This field is required.
pub fn db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.db_instance_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must match the identifier of an existing read replica DB instance.</p></li>
/// </ul>
/// <p>Example: <code>mydbinstance</code></p>
pub fn set_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.db_instance_identifier = input;
self
}
/// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must match the identifier of an existing read replica DB instance.</p></li>
/// </ul>
/// <p>Example: <code>mydbinstance</code></p>
pub fn get_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.db_instance_identifier
}
/// <p>The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.</p>
/// <p>Default: 1</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be a value from 0 to 35.</p></li>
/// <li>
/// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
/// </ul>
pub fn backup_retention_period(mut self, input: i32) -> Self {
self.backup_retention_period = ::std::option::Option::Some(input);
self
}
/// <p>The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.</p>
/// <p>Default: 1</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be a value from 0 to 35.</p></li>
/// <li>
/// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
/// </ul>
pub fn set_backup_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
self.backup_retention_period = input;
self
}
/// <p>The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.</p>
/// <p>Default: 1</p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be a value from 0 to 35.</p></li>
/// <li>
/// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
/// </ul>
pub fn get_backup_retention_period(&self) -> &::std::option::Option<i32> {
&self.backup_retention_period
}
/// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
/// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i></p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p></li>
/// <li>
/// <p>Must be in Universal Coordinated Time (UTC).</p></li>
/// <li>
/// <p>Must not conflict with the preferred maintenance window.</p></li>
/// <li>
/// <p>Must be at least 30 minutes.</p></li>
/// </ul>
pub fn preferred_backup_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.preferred_backup_window = ::std::option::Option::Some(input.into());
self
}
/// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
/// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i></p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p></li>
/// <li>
/// <p>Must be in Universal Coordinated Time (UTC).</p></li>
/// <li>
/// <p>Must not conflict with the preferred maintenance window.</p></li>
/// <li>
/// <p>Must be at least 30 minutes.</p></li>
/// </ul>
pub fn set_preferred_backup_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.preferred_backup_window = input;
self
}
/// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
/// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i></p>
/// <p>Constraints:</p>
/// <ul>
/// <li>
/// <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p></li>
/// <li>
/// <p>Must be in Universal Coordinated Time (UTC).</p></li>
/// <li>
/// <p>Must not conflict with the preferred maintenance window.</p></li>
/// <li>
/// <p>Must be at least 30 minutes.</p></li>
/// </ul>
pub fn get_preferred_backup_window(&self) -> &::std::option::Option<::std::string::String> {
&self.preferred_backup_window
}
/// Appends an item to `tag_specifications`.
///
/// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
///
/// <p>Tags to assign to resources associated with the DB instance.</p>
/// <p>Valid Values:</p>
/// <ul>
/// <li>
/// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
/// </ul>
pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
let mut v = self.tag_specifications.unwrap_or_default();
v.push(input);
self.tag_specifications = ::std::option::Option::Some(v);
self
}
/// <p>Tags to assign to resources associated with the DB instance.</p>
/// <p>Valid Values:</p>
/// <ul>
/// <li>
/// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
/// </ul>
pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
self.tag_specifications = input;
self
}
/// <p>Tags to assign to resources associated with the DB instance.</p>
/// <p>Valid Values:</p>
/// <ul>
/// <li>
/// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
/// </ul>
pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
&self.tag_specifications
}
/// Consumes the builder and constructs a [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::promote_read_replica::PromoteReadReplicaInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::promote_read_replica::PromoteReadReplicaInput {
db_instance_identifier: self.db_instance_identifier,
backup_retention_period: self.backup_retention_period,
preferred_backup_window: self.preferred_backup_window,
tag_specifications: self.tag_specifications,
})
}
}