aws_sdk_rds/operation/modify_db_snapshot_attribute/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_db_snapshot_attribute::_modify_db_snapshot_attribute_output::ModifyDbSnapshotAttributeOutputBuilder;
3
4pub use crate::operation::modify_db_snapshot_attribute::_modify_db_snapshot_attribute_input::ModifyDbSnapshotAttributeInputBuilder;
5
6impl crate::operation::modify_db_snapshot_attribute::builders::ModifyDbSnapshotAttributeInputBuilder {
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::modify_db_snapshot_attribute::ModifyDbSnapshotAttributeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttributeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_db_snapshot_attribute();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyDBSnapshotAttribute`.
24///
25/// <p>Adds an attribute and values to, or removes an attribute and values from, a manual DB snapshot.</p>
26/// <p>To share a manual DB snapshot with other Amazon Web Services accounts, specify <code>restore</code> as the <code>AttributeName</code> and use the <code>ValuesToAdd</code> parameter to add a list of IDs of the Amazon Web Services accounts that are authorized to restore the manual DB snapshot. Uses the value <code>all</code> to make the manual DB snapshot public, which means it can be copied or restored by all Amazon Web Services accounts.</p><note>
27/// <p>Don't add the <code>all</code> value for any manual DB snapshots that contain private information that you don't want available to all Amazon Web Services accounts.</p>
28/// </note>
29/// <p>If the manual DB snapshot is encrypted, it can be shared, but only by specifying a list of authorized Amazon Web Services account IDs for the <code>ValuesToAdd</code> parameter. You can't use <code>all</code> as a value for that parameter in this case.</p>
30/// <p>To view which Amazon Web Services accounts have access to copy or restore a manual DB snapshot, or whether a manual DB snapshot public or private, use the <code>DescribeDBSnapshotAttributes</code> API operation. The accounts are returned as values for the <code>restore</code> attribute.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct ModifyDBSnapshotAttributeFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::modify_db_snapshot_attribute::builders::ModifyDbSnapshotAttributeInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::modify_db_snapshot_attribute::ModifyDbSnapshotAttributeOutput,
40        crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttributeError,
41    > for ModifyDBSnapshotAttributeFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::modify_db_snapshot_attribute::ModifyDbSnapshotAttributeOutput,
49            crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttributeError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl ModifyDBSnapshotAttributeFluentBuilder {
56    /// Creates a new `ModifyDBSnapshotAttributeFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the ModifyDBSnapshotAttribute as a reference.
65    pub fn as_input(&self) -> &crate::operation::modify_db_snapshot_attribute::builders::ModifyDbSnapshotAttributeInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::modify_db_snapshot_attribute::ModifyDbSnapshotAttributeOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttributeError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttribute::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttribute::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::modify_db_snapshot_attribute::ModifyDbSnapshotAttributeOutput,
102        crate::operation::modify_db_snapshot_attribute::ModifyDBSnapshotAttributeError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The identifier for the DB snapshot to modify the attributes for.</p>
117    pub fn db_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.db_snapshot_identifier(input.into());
119        self
120    }
121    /// <p>The identifier for the DB snapshot to modify the attributes for.</p>
122    pub fn set_db_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_db_snapshot_identifier(input);
124        self
125    }
126    /// <p>The identifier for the DB snapshot to modify the attributes for.</p>
127    pub fn get_db_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_db_snapshot_identifier()
129    }
130    /// <p>The name of the DB snapshot attribute to modify.</p>
131    /// <p>To manage authorization for other Amazon Web Services accounts to copy or restore a manual DB snapshot, set this value to <code>restore</code>.</p><note>
132    /// <p>To view the list of attributes available to modify, use the <code>DescribeDBSnapshotAttributes</code> API operation.</p>
133    /// </note>
134    pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.attribute_name(input.into());
136        self
137    }
138    /// <p>The name of the DB snapshot attribute to modify.</p>
139    /// <p>To manage authorization for other Amazon Web Services accounts to copy or restore a manual DB snapshot, set this value to <code>restore</code>.</p><note>
140    /// <p>To view the list of attributes available to modify, use the <code>DescribeDBSnapshotAttributes</code> API operation.</p>
141    /// </note>
142    pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_attribute_name(input);
144        self
145    }
146    /// <p>The name of the DB snapshot attribute to modify.</p>
147    /// <p>To manage authorization for other Amazon Web Services accounts to copy or restore a manual DB snapshot, set this value to <code>restore</code>.</p><note>
148    /// <p>To view the list of attributes available to modify, use the <code>DescribeDBSnapshotAttributes</code> API operation.</p>
149    /// </note>
150    pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_attribute_name()
152    }
153    ///
154    /// Appends an item to `ValuesToAdd`.
155    ///
156    /// To override the contents of this collection use [`set_values_to_add`](Self::set_values_to_add).
157    ///
158    /// <p>A list of DB snapshot attributes to add to the attribute specified by <code>AttributeName</code>.</p>
159    /// <p>To authorize other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account IDs, or <code>all</code> to make the manual DB snapshot restorable by any Amazon Web Services account. Do not add the <code>all</code> value for any manual DB snapshots that contain private information that you don't want available to all Amazon Web Services accounts.</p>
160    pub fn values_to_add(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.values_to_add(input.into());
162        self
163    }
164    /// <p>A list of DB snapshot attributes to add to the attribute specified by <code>AttributeName</code>.</p>
165    /// <p>To authorize other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account IDs, or <code>all</code> to make the manual DB snapshot restorable by any Amazon Web Services account. Do not add the <code>all</code> value for any manual DB snapshots that contain private information that you don't want available to all Amazon Web Services accounts.</p>
166    pub fn set_values_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
167        self.inner = self.inner.set_values_to_add(input);
168        self
169    }
170    /// <p>A list of DB snapshot attributes to add to the attribute specified by <code>AttributeName</code>.</p>
171    /// <p>To authorize other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account IDs, or <code>all</code> to make the manual DB snapshot restorable by any Amazon Web Services account. Do not add the <code>all</code> value for any manual DB snapshots that contain private information that you don't want available to all Amazon Web Services accounts.</p>
172    pub fn get_values_to_add(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
173        self.inner.get_values_to_add()
174    }
175    ///
176    /// Appends an item to `ValuesToRemove`.
177    ///
178    /// To override the contents of this collection use [`set_values_to_remove`](Self::set_values_to_remove).
179    ///
180    /// <p>A list of DB snapshot attributes to remove from the attribute specified by <code>AttributeName</code>.</p>
181    /// <p>To remove authorization for other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account identifiers, or <code>all</code> to remove authorization for any Amazon Web Services account to copy or restore the DB snapshot. If you specify <code>all</code>, an Amazon Web Services account whose account ID is explicitly added to the <code>restore</code> attribute can still copy or restore the manual DB snapshot.</p>
182    pub fn values_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.values_to_remove(input.into());
184        self
185    }
186    /// <p>A list of DB snapshot attributes to remove from the attribute specified by <code>AttributeName</code>.</p>
187    /// <p>To remove authorization for other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account identifiers, or <code>all</code> to remove authorization for any Amazon Web Services account to copy or restore the DB snapshot. If you specify <code>all</code>, an Amazon Web Services account whose account ID is explicitly added to the <code>restore</code> attribute can still copy or restore the manual DB snapshot.</p>
188    pub fn set_values_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
189        self.inner = self.inner.set_values_to_remove(input);
190        self
191    }
192    /// <p>A list of DB snapshot attributes to remove from the attribute specified by <code>AttributeName</code>.</p>
193    /// <p>To remove authorization for other Amazon Web Services accounts to copy or restore a manual snapshot, set this list to include one or more Amazon Web Services account identifiers, or <code>all</code> to remove authorization for any Amazon Web Services account to copy or restore the DB snapshot. If you specify <code>all</code>, an Amazon Web Services account whose account ID is explicitly added to the <code>restore</code> attribute can still copy or restore the manual DB snapshot.</p>
194    pub fn get_values_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
195        self.inner.get_values_to_remove()
196    }
197}