aws_sdk_rdsdata/operation/execute_sql/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::execute_sql::_execute_sql_output::ExecuteSqlOutputBuilder;
3
4pub use crate::operation::execute_sql::_execute_sql_input::ExecuteSqlInputBuilder;
5
6impl crate::operation::execute_sql::builders::ExecuteSqlInputBuilder {
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::execute_sql::ExecuteSqlOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::execute_sql::ExecuteSqlError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.execute_sql();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExecuteSql`.
24///
25/// <p>Runs one or more SQL statements.</p><note>
26/// <p>This operation isn't supported for Aurora Serverless v2 and provisioned DB clusters. For Aurora Serverless v1 DB clusters, the operation is deprecated. Use the <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> operation.</p>
27/// </note>
28#[deprecated(note = "The ExecuteSql API is deprecated, please use the ExecuteStatement API.", since = "2019-03-21")]
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct ExecuteSqlFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::execute_sql::builders::ExecuteSqlInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::execute_sql::ExecuteSqlOutput,
38        crate::operation::execute_sql::ExecuteSqlError,
39    > for ExecuteSqlFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::execute_sql::ExecuteSqlOutput,
47            crate::operation::execute_sql::ExecuteSqlError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl ExecuteSqlFluentBuilder {
54    /// Creates a new `ExecuteSqlFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the ExecuteSql as a reference.
63    pub fn as_input(&self) -> &crate::operation::execute_sql::builders::ExecuteSqlInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::execute_sql::ExecuteSqlOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::execute_sql::ExecuteSqlError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::execute_sql::ExecuteSql::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::execute_sql::ExecuteSql::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::execute_sql::ExecuteSqlOutput,
100        crate::operation::execute_sql::ExecuteSqlError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
115    pub fn db_cluster_or_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.db_cluster_or_instance_arn(input.into());
117        self
118    }
119    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
120    pub fn set_db_cluster_or_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_db_cluster_or_instance_arn(input);
122        self
123    }
124    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
125    pub fn get_db_cluster_or_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_db_cluster_or_instance_arn()
127    }
128    /// <p>The Amazon Resource Name (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>
129    /// <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>
130    pub fn aws_secret_store_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.aws_secret_store_arn(input.into());
132        self
133    }
134    /// <p>The Amazon Resource Name (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>
135    /// <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>
136    pub fn set_aws_secret_store_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_aws_secret_store_arn(input);
138        self
139    }
140    /// <p>The Amazon Resource Name (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>
141    /// <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>
142    pub fn get_aws_secret_store_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_aws_secret_store_arn()
144    }
145    /// <p>One or more SQL statements to run on the DB cluster.</p>
146    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
147    pub fn sql_statements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.sql_statements(input.into());
149        self
150    }
151    /// <p>One or more SQL statements to run on the DB cluster.</p>
152    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
153    pub fn set_sql_statements(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_sql_statements(input);
155        self
156    }
157    /// <p>One or more SQL statements to run on the DB cluster.</p>
158    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
159    pub fn get_sql_statements(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_sql_statements()
161    }
162    /// <p>The name of the database.</p>
163    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.database(input.into());
165        self
166    }
167    /// <p>The name of the database.</p>
168    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_database(input);
170        self
171    }
172    /// <p>The name of the database.</p>
173    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_database()
175    }
176    /// <p>The name of the database schema.</p>
177    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.schema(input.into());
179        self
180    }
181    /// <p>The name of the database schema.</p>
182    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_schema(input);
184        self
185    }
186    /// <p>The name of the database schema.</p>
187    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_schema()
189    }
190}