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