aws_sdk_lightsail/operation/update_relational_database/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_relational_database::_update_relational_database_output::UpdateRelationalDatabaseOutputBuilder;
3
4pub use crate::operation::update_relational_database::_update_relational_database_input::UpdateRelationalDatabaseInputBuilder;
5
6impl crate::operation::update_relational_database::builders::UpdateRelationalDatabaseInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_relational_database::UpdateRelationalDatabaseOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_relational_database::UpdateRelationalDatabaseError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_relational_database();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateRelationalDatabase`.
24///
25/// <p>Allows the update of one or more attributes of a database in Amazon Lightsail.</p>
26/// <p>Updates are applied immediately, or in cases where the updates could result in an outage, are applied during the database's predefined maintenance window.</p>
27/// <p>The <code>update relational database</code> operation supports tag-based access control via resource tags applied to the resource identified by relationalDatabaseName. For more information, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags">Amazon Lightsail Developer Guide</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateRelationalDatabaseFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::update_relational_database::builders::UpdateRelationalDatabaseInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::update_relational_database::UpdateRelationalDatabaseOutput,
37 crate::operation::update_relational_database::UpdateRelationalDatabaseError,
38 > for UpdateRelationalDatabaseFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::update_relational_database::UpdateRelationalDatabaseOutput,
46 crate::operation::update_relational_database::UpdateRelationalDatabaseError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl UpdateRelationalDatabaseFluentBuilder {
53 /// Creates a new `UpdateRelationalDatabaseFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the UpdateRelationalDatabase as a reference.
62 pub fn as_input(&self) -> &crate::operation::update_relational_database::builders::UpdateRelationalDatabaseInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::update_relational_database::UpdateRelationalDatabaseOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::update_relational_database::UpdateRelationalDatabaseError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::update_relational_database::UpdateRelationalDatabase::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::update_relational_database::UpdateRelationalDatabase::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::update_relational_database::UpdateRelationalDatabaseOutput,
99 crate::operation::update_relational_database::UpdateRelationalDatabaseError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>The name of your Lightsail database resource to update.</p>
114 pub fn relational_database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.relational_database_name(input.into());
116 self
117 }
118 /// <p>The name of your Lightsail database resource to update.</p>
119 pub fn set_relational_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_relational_database_name(input);
121 self
122 }
123 /// <p>The name of your Lightsail database resource to update.</p>
124 pub fn get_relational_database_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_relational_database_name()
126 }
127 /// <p>The password for the master user. The password can include any printable ASCII character except "/", """, or "@".</p>
128 /// <p>My<b>SQL</b></p>
129 /// <p>Constraints: Must contain from 8 to 41 characters.</p>
130 /// <p><b>PostgreSQL</b></p>
131 /// <p>Constraints: Must contain from 8 to 128 characters.</p>
132 pub fn master_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.master_user_password(input.into());
134 self
135 }
136 /// <p>The password for the master user. The password can include any printable ASCII character except "/", """, or "@".</p>
137 /// <p>My<b>SQL</b></p>
138 /// <p>Constraints: Must contain from 8 to 41 characters.</p>
139 /// <p><b>PostgreSQL</b></p>
140 /// <p>Constraints: Must contain from 8 to 128 characters.</p>
141 pub fn set_master_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_master_user_password(input);
143 self
144 }
145 /// <p>The password for the master user. The password can include any printable ASCII character except "/", """, or "@".</p>
146 /// <p>My<b>SQL</b></p>
147 /// <p>Constraints: Must contain from 8 to 41 characters.</p>
148 /// <p><b>PostgreSQL</b></p>
149 /// <p>Constraints: Must contain from 8 to 128 characters.</p>
150 pub fn get_master_user_password(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_master_user_password()
152 }
153 /// <p>When <code>true</code>, the master user password is changed to a new strong password generated by Lightsail.</p>
154 /// <p>Use the <code>get relational database master user password</code> operation to get the new password.</p>
155 pub fn rotate_master_user_password(mut self, input: bool) -> Self {
156 self.inner = self.inner.rotate_master_user_password(input);
157 self
158 }
159 /// <p>When <code>true</code>, the master user password is changed to a new strong password generated by Lightsail.</p>
160 /// <p>Use the <code>get relational database master user password</code> operation to get the new password.</p>
161 pub fn set_rotate_master_user_password(mut self, input: ::std::option::Option<bool>) -> Self {
162 self.inner = self.inner.set_rotate_master_user_password(input);
163 self
164 }
165 /// <p>When <code>true</code>, the master user password is changed to a new strong password generated by Lightsail.</p>
166 /// <p>Use the <code>get relational database master user password</code> operation to get the new password.</p>
167 pub fn get_rotate_master_user_password(&self) -> &::std::option::Option<bool> {
168 self.inner.get_rotate_master_user_password()
169 }
170 /// <p>The daily time range during which automated backups are created for your database if automated backups are enabled.</p>
171 /// <p>Constraints:</p>
172 /// <ul>
173 /// <li>
174 /// <p>Must be in the <code>hh24:mi-hh24:mi</code> format.</p>
175 /// <p>Example: <code>16:00-16:30</code></p></li>
176 /// <li>
177 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
178 /// <li>
179 /// <p>Must not conflict with the preferred maintenance window.</p></li>
180 /// <li>
181 /// <p>Must be at least 30 minutes.</p></li>
182 /// </ul>
183 pub fn preferred_backup_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.inner = self.inner.preferred_backup_window(input.into());
185 self
186 }
187 /// <p>The daily time range during which automated backups are created for your database if automated backups are enabled.</p>
188 /// <p>Constraints:</p>
189 /// <ul>
190 /// <li>
191 /// <p>Must be in the <code>hh24:mi-hh24:mi</code> format.</p>
192 /// <p>Example: <code>16:00-16:30</code></p></li>
193 /// <li>
194 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
195 /// <li>
196 /// <p>Must not conflict with the preferred maintenance window.</p></li>
197 /// <li>
198 /// <p>Must be at least 30 minutes.</p></li>
199 /// </ul>
200 pub fn set_preferred_backup_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201 self.inner = self.inner.set_preferred_backup_window(input);
202 self
203 }
204 /// <p>The daily time range during which automated backups are created for your database if automated backups are enabled.</p>
205 /// <p>Constraints:</p>
206 /// <ul>
207 /// <li>
208 /// <p>Must be in the <code>hh24:mi-hh24:mi</code> format.</p>
209 /// <p>Example: <code>16:00-16:30</code></p></li>
210 /// <li>
211 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
212 /// <li>
213 /// <p>Must not conflict with the preferred maintenance window.</p></li>
214 /// <li>
215 /// <p>Must be at least 30 minutes.</p></li>
216 /// </ul>
217 pub fn get_preferred_backup_window(&self) -> &::std::option::Option<::std::string::String> {
218 self.inner.get_preferred_backup_window()
219 }
220 /// <p>The weekly time range during which system maintenance can occur on your database.</p>
221 /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
222 /// <p>Constraints:</p>
223 /// <ul>
224 /// <li>
225 /// <p>Must be in the <code>ddd:hh24:mi-ddd:hh24:mi</code> format.</p></li>
226 /// <li>
227 /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.</p></li>
228 /// <li>
229 /// <p>Must be at least 30 minutes.</p></li>
230 /// <li>
231 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
232 /// <li>
233 /// <p>Example: <code>Tue:17:00-Tue:17:30</code></p></li>
234 /// </ul>
235 pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236 self.inner = self.inner.preferred_maintenance_window(input.into());
237 self
238 }
239 /// <p>The weekly time range during which system maintenance can occur on your database.</p>
240 /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
241 /// <p>Constraints:</p>
242 /// <ul>
243 /// <li>
244 /// <p>Must be in the <code>ddd:hh24:mi-ddd:hh24:mi</code> format.</p></li>
245 /// <li>
246 /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.</p></li>
247 /// <li>
248 /// <p>Must be at least 30 minutes.</p></li>
249 /// <li>
250 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
251 /// <li>
252 /// <p>Example: <code>Tue:17:00-Tue:17:30</code></p></li>
253 /// </ul>
254 pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255 self.inner = self.inner.set_preferred_maintenance_window(input);
256 self
257 }
258 /// <p>The weekly time range during which system maintenance can occur on your database.</p>
259 /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
260 /// <p>Constraints:</p>
261 /// <ul>
262 /// <li>
263 /// <p>Must be in the <code>ddd:hh24:mi-ddd:hh24:mi</code> format.</p></li>
264 /// <li>
265 /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.</p></li>
266 /// <li>
267 /// <p>Must be at least 30 minutes.</p></li>
268 /// <li>
269 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
270 /// <li>
271 /// <p>Example: <code>Tue:17:00-Tue:17:30</code></p></li>
272 /// </ul>
273 pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
274 self.inner.get_preferred_maintenance_window()
275 }
276 /// <p>When <code>true</code>, enables automated backup retention for your database.</p>
277 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
278 pub fn enable_backup_retention(mut self, input: bool) -> Self {
279 self.inner = self.inner.enable_backup_retention(input);
280 self
281 }
282 /// <p>When <code>true</code>, enables automated backup retention for your database.</p>
283 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
284 pub fn set_enable_backup_retention(mut self, input: ::std::option::Option<bool>) -> Self {
285 self.inner = self.inner.set_enable_backup_retention(input);
286 self
287 }
288 /// <p>When <code>true</code>, enables automated backup retention for your database.</p>
289 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
290 pub fn get_enable_backup_retention(&self) -> &::std::option::Option<bool> {
291 self.inner.get_enable_backup_retention()
292 }
293 /// <p>When <code>true</code>, disables automated backup retention for your database.</p>
294 /// <p>Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database using the <code>create relational database snapshot</code> operation.</p>
295 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
296 pub fn disable_backup_retention(mut self, input: bool) -> Self {
297 self.inner = self.inner.disable_backup_retention(input);
298 self
299 }
300 /// <p>When <code>true</code>, disables automated backup retention for your database.</p>
301 /// <p>Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database using the <code>create relational database snapshot</code> operation.</p>
302 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
303 pub fn set_disable_backup_retention(mut self, input: ::std::option::Option<bool>) -> Self {
304 self.inner = self.inner.set_disable_backup_retention(input);
305 self
306 }
307 /// <p>When <code>true</code>, disables automated backup retention for your database.</p>
308 /// <p>Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database using the <code>create relational database snapshot</code> operation.</p>
309 /// <p>Updates are applied during the next maintenance window because this can result in an outage.</p>
310 pub fn get_disable_backup_retention(&self) -> &::std::option::Option<bool> {
311 self.inner.get_disable_backup_retention()
312 }
313 /// <p>Specifies the accessibility options for your database. A value of <code>true</code> specifies a database that is available to resources outside of your Lightsail account. A value of <code>false</code> specifies a database that is available only to your Lightsail resources in the same region as your database.</p>
314 pub fn publicly_accessible(mut self, input: bool) -> Self {
315 self.inner = self.inner.publicly_accessible(input);
316 self
317 }
318 /// <p>Specifies the accessibility options for your database. A value of <code>true</code> specifies a database that is available to resources outside of your Lightsail account. A value of <code>false</code> specifies a database that is available only to your Lightsail resources in the same region as your database.</p>
319 pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
320 self.inner = self.inner.set_publicly_accessible(input);
321 self
322 }
323 /// <p>Specifies the accessibility options for your database. A value of <code>true</code> specifies a database that is available to resources outside of your Lightsail account. A value of <code>false</code> specifies a database that is available only to your Lightsail resources in the same region as your database.</p>
324 pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
325 self.inner.get_publicly_accessible()
326 }
327 /// <p>When <code>true</code>, applies changes immediately. When <code>false</code>, applies changes during the preferred maintenance window. Some changes may cause an outage.</p>
328 /// <p>Default: <code>false</code></p>
329 pub fn apply_immediately(mut self, input: bool) -> Self {
330 self.inner = self.inner.apply_immediately(input);
331 self
332 }
333 /// <p>When <code>true</code>, applies changes immediately. When <code>false</code>, applies changes during the preferred maintenance window. Some changes may cause an outage.</p>
334 /// <p>Default: <code>false</code></p>
335 pub fn set_apply_immediately(mut self, input: ::std::option::Option<bool>) -> Self {
336 self.inner = self.inner.set_apply_immediately(input);
337 self
338 }
339 /// <p>When <code>true</code>, applies changes immediately. When <code>false</code>, applies changes during the preferred maintenance window. Some changes may cause an outage.</p>
340 /// <p>Default: <code>false</code></p>
341 pub fn get_apply_immediately(&self) -> &::std::option::Option<bool> {
342 self.inner.get_apply_immediately()
343 }
344 /// <p>Indicates the certificate that needs to be associated with the database.</p>
345 pub fn ca_certificate_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346 self.inner = self.inner.ca_certificate_identifier(input.into());
347 self
348 }
349 /// <p>Indicates the certificate that needs to be associated with the database.</p>
350 pub fn set_ca_certificate_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351 self.inner = self.inner.set_ca_certificate_identifier(input);
352 self
353 }
354 /// <p>Indicates the certificate that needs to be associated with the database.</p>
355 pub fn get_ca_certificate_identifier(&self) -> &::std::option::Option<::std::string::String> {
356 self.inner.get_ca_certificate_identifier()
357 }
358 /// <p>This parameter is used to update the major version of the database. Enter the <code>blueprintId</code> for the major version that you want to update to.</p>
359 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRelationalDatabaseBlueprints.html">GetRelationalDatabaseBlueprints</a> action to get a list of available blueprint IDs.</p>
360 pub fn relational_database_blueprint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361 self.inner = self.inner.relational_database_blueprint_id(input.into());
362 self
363 }
364 /// <p>This parameter is used to update the major version of the database. Enter the <code>blueprintId</code> for the major version that you want to update to.</p>
365 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRelationalDatabaseBlueprints.html">GetRelationalDatabaseBlueprints</a> action to get a list of available blueprint IDs.</p>
366 pub fn set_relational_database_blueprint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
367 self.inner = self.inner.set_relational_database_blueprint_id(input);
368 self
369 }
370 /// <p>This parameter is used to update the major version of the database. Enter the <code>blueprintId</code> for the major version that you want to update to.</p>
371 /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRelationalDatabaseBlueprints.html">GetRelationalDatabaseBlueprints</a> action to get a list of available blueprint IDs.</p>
372 pub fn get_relational_database_blueprint_id(&self) -> &::std::option::Option<::std::string::String> {
373 self.inner.get_relational_database_blueprint_id()
374 }
375}