aws_sdk_rdsdata/operation/batch_execute_statement/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_execute_statement::_batch_execute_statement_output::BatchExecuteStatementOutputBuilder;
3
4pub use crate::operation::batch_execute_statement::_batch_execute_statement_input::BatchExecuteStatementInputBuilder;
5
6impl crate::operation::batch_execute_statement::builders::BatchExecuteStatementInputBuilder {
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::batch_execute_statement::BatchExecuteStatementOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::batch_execute_statement::BatchExecuteStatementError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.batch_execute_statement();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `BatchExecuteStatement`.
24///
25/// <p>Runs a batch SQL statement over an array of data.</p>
26/// <p>You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.</p><note>
27/// <p>If a call isn't part of a transaction because it doesn't include the <code>transactionID</code> parameter, changes that result from the call are committed automatically.</p>
28/// <p>There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set.</p>
29/// <p>The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.</p>
30/// </note>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct BatchExecuteStatementFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::batch_execute_statement::builders::BatchExecuteStatementInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::batch_execute_statement::BatchExecuteStatementOutput,
40 crate::operation::batch_execute_statement::BatchExecuteStatementError,
41 > for BatchExecuteStatementFluentBuilder
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::batch_execute_statement::BatchExecuteStatementOutput,
49 crate::operation::batch_execute_statement::BatchExecuteStatementError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl BatchExecuteStatementFluentBuilder {
56 /// Creates a new `BatchExecuteStatementFluentBuilder`.
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 BatchExecuteStatement as a reference.
65 pub fn as_input(&self) -> &crate::operation::batch_execute_statement::builders::BatchExecuteStatementInputBuilder {
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::batch_execute_statement::BatchExecuteStatementOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::batch_execute_statement::BatchExecuteStatementError,
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::batch_execute_statement::BatchExecuteStatement::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::batch_execute_statement::BatchExecuteStatement::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::batch_execute_statement::BatchExecuteStatementOutput,
102 crate::operation::batch_execute_statement::BatchExecuteStatementError,
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 Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
117 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.resource_arn(input.into());
119 self
120 }
121 /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
122 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_resource_arn(input);
124 self
125 }
126 /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
127 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_resource_arn()
129 }
130 /// <p>The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
131 /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
132 pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.secret_arn(input.into());
134 self
135 }
136 /// <p>The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
137 /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
138 pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_secret_arn(input);
140 self
141 }
142 /// <p>The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
143 /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
144 pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_secret_arn()
146 }
147 /// <p>The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.</p>
148 pub fn sql(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.inner = self.inner.sql(input.into());
150 self
151 }
152 /// <p>The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.</p>
153 pub fn set_sql(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_sql(input);
155 self
156 }
157 /// <p>The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.</p>
158 pub fn get_sql(&self) -> &::std::option::Option<::std::string::String> {
159 self.inner.get_sql()
160 }
161 /// <p>The name of the database.</p>
162 pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.inner = self.inner.database(input.into());
164 self
165 }
166 /// <p>The name of the database.</p>
167 pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.inner = self.inner.set_database(input);
169 self
170 }
171 /// <p>The name of the database.</p>
172 pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_database()
174 }
175 /// <p>The name of the database schema.</p><note>
176 /// <p>Currently, the <code>schema</code> parameter isn't supported.</p>
177 /// </note>
178 pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.inner = self.inner.schema(input.into());
180 self
181 }
182 /// <p>The name of the database schema.</p><note>
183 /// <p>Currently, the <code>schema</code> parameter isn't supported.</p>
184 /// </note>
185 pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.inner = self.inner.set_schema(input);
187 self
188 }
189 /// <p>The name of the database schema.</p><note>
190 /// <p>Currently, the <code>schema</code> parameter isn't supported.</p>
191 /// </note>
192 pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
193 self.inner.get_schema()
194 }
195 ///
196 /// Appends an item to `parameterSets`.
197 ///
198 /// To override the contents of this collection use [`set_parameter_sets`](Self::set_parameter_sets).
199 ///
200 /// <p>The parameter set for the batch operation.</p>
201 /// <p>The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:</p>
202 /// <ul>
203 /// <li>
204 /// <p>Specify one or more empty parameter sets.</p></li>
205 /// <li>
206 /// <p>Use the <code>ExecuteStatement</code> operation instead of the <code>BatchExecuteStatement</code> operation.</p></li>
207 /// </ul><note>
208 /// <p>Array parameters are not supported.</p>
209 /// </note>
210 pub fn parameter_sets(mut self, input: ::std::vec::Vec<crate::types::SqlParameter>) -> Self {
211 self.inner = self.inner.parameter_sets(input);
212 self
213 }
214 /// <p>The parameter set for the batch operation.</p>
215 /// <p>The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:</p>
216 /// <ul>
217 /// <li>
218 /// <p>Specify one or more empty parameter sets.</p></li>
219 /// <li>
220 /// <p>Use the <code>ExecuteStatement</code> operation instead of the <code>BatchExecuteStatement</code> operation.</p></li>
221 /// </ul><note>
222 /// <p>Array parameters are not supported.</p>
223 /// </note>
224 pub fn set_parameter_sets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::SqlParameter>>>) -> Self {
225 self.inner = self.inner.set_parameter_sets(input);
226 self
227 }
228 /// <p>The parameter set for the batch operation.</p>
229 /// <p>The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:</p>
230 /// <ul>
231 /// <li>
232 /// <p>Specify one or more empty parameter sets.</p></li>
233 /// <li>
234 /// <p>Use the <code>ExecuteStatement</code> operation instead of the <code>BatchExecuteStatement</code> operation.</p></li>
235 /// </ul><note>
236 /// <p>Array parameters are not supported.</p>
237 /// </note>
238 pub fn get_parameter_sets(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::SqlParameter>>> {
239 self.inner.get_parameter_sets()
240 }
241 /// <p>The identifier of a transaction that was started by using the <code>BeginTransaction</code> operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.</p>
242 /// <p>If the SQL statement is not part of a transaction, don't set this parameter.</p>
243 pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.transaction_id(input.into());
245 self
246 }
247 /// <p>The identifier of a transaction that was started by using the <code>BeginTransaction</code> operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.</p>
248 /// <p>If the SQL statement is not part of a transaction, don't set this parameter.</p>
249 pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250 self.inner = self.inner.set_transaction_id(input);
251 self
252 }
253 /// <p>The identifier of a transaction that was started by using the <code>BeginTransaction</code> operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.</p>
254 /// <p>If the SQL statement is not part of a transaction, don't set this parameter.</p>
255 pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
256 self.inner.get_transaction_id()
257 }
258}