Skip to main content

aws_sdk_rdsdata/operation/
execute_statement.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `ExecuteStatement`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ExecuteStatement;
6impl ExecuteStatement {
7    /// Creates a new `ExecuteStatement`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13        input: crate::operation::execute_statement::ExecuteStatementInput,
14    ) -> ::std::result::Result<
15        crate::operation::execute_statement::ExecuteStatementOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::execute_statement::ExecuteStatementError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22            ::aws_smithy_runtime_api::client::interceptors::context::Error,
23            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24        >| {
25            err.map_service_error(|err| {
26                err.downcast::<crate::operation::execute_statement::ExecuteStatementError>()
27                    .expect("correct error type")
28            })
29        };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::execute_statement::ExecuteStatementOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::execute_statement::ExecuteStatementInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("RDS Data", "ExecuteStatement", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "RDS Data.ExecuteStatement",
59                "rpc.service" = "RDS Data",
60                "rpc.method" = "ExecuteStatement",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ExecuteStatement {
88    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ExecuteStatement");
90
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92            ExecuteStatementRequestSerializer,
93        ));
94        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95            ExecuteStatementResponseDeserializer,
96        ));
97
98        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99            crate::config::auth::Params::builder()
100                .operation_name("ExecuteStatement")
101                .build()
102                .expect("required fields set"),
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
106            "ExecuteStatement",
107            "RDS Data",
108        ));
109        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
110        signing_options.double_uri_encode = true;
111        signing_options.content_sha256_header = false;
112        signing_options.normalize_uri_path = true;
113        signing_options.payload_override = None;
114
115        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
116            signing_options,
117            ..::std::default::Default::default()
118        });
119
120        ::std::option::Option::Some(cfg.freeze())
121    }
122
123    fn runtime_components(
124        &self,
125        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
126    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
127        #[allow(unused_mut)]
128        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ExecuteStatement")
129            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130                ExecuteStatementTelemetryInputCaptureInterceptor,
131            ))
132            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
134            ))
135            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
136                ExecuteStatementEndpointParamsInterceptor,
137            ))
138            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
139                crate::operation::execute_statement::ExecuteStatementError,
140            >::new())
141            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
142                crate::operation::execute_statement::ExecuteStatementError,
143            >::new())
144            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
145                crate::operation::execute_statement::ExecuteStatementError,
146            >::new());
147
148        ::std::borrow::Cow::Owned(rcb)
149    }
150}
151
152#[derive(Debug)]
153struct ExecuteStatementTelemetryInputCaptureInterceptor;
154
155#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
156impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ExecuteStatementTelemetryInputCaptureInterceptor {
157    fn name(&self) -> &'static str {
158        "ExecuteStatementTelemetryInputCaptureInterceptor"
159    }
160
161    fn read_before_execution(
162        &self,
163        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
164            '_,
165            ::aws_smithy_runtime_api::client::interceptors::context::Input,
166            ::aws_smithy_runtime_api::client::interceptors::context::Output,
167            ::aws_smithy_runtime_api::client::interceptors::context::Error,
168        >,
169        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
170    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
171        // Nothing to do unless the customer opted in by naming members to record.
172        let ::std::option::Option::Some(requested) = cfg
173            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
174            .filter(|r| !r.is_empty())
175        else {
176            return ::std::result::Result::Ok(());
177        };
178
179        let ::std::option::Option::Some(input) = context.input().downcast_ref::<ExecuteStatementInput>() else {
180            // A mismatched input is not this interceptor's concern; skip quietly.
181            return ::std::result::Result::Ok(());
182        };
183
184        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
185        if requested.should_capture("resourceArn") {
186            if let ::std::option::Option::Some(value) = input.resource_arn.as_deref() {
187                captured.insert("resourceArn", value);
188            }
189        }
190        if requested.should_capture("secretArn") {
191            if let ::std::option::Option::Some(value) = input.secret_arn.as_deref() {
192                captured.insert("secretArn", value);
193            }
194        }
195        if requested.should_capture("sql") {
196            if let ::std::option::Option::Some(value) = input.sql.as_deref() {
197                captured.insert("sql", value);
198            }
199        }
200        if requested.should_capture("database") {
201            if let ::std::option::Option::Some(value) = input.database.as_deref() {
202                captured.insert("database", value);
203            }
204        }
205        if requested.should_capture("schema") {
206            if let ::std::option::Option::Some(value) = input.schema.as_deref() {
207                captured.insert("schema", value);
208            }
209        }
210        if requested.should_capture("transactionId") {
211            if let ::std::option::Option::Some(value) = input.transaction_id.as_deref() {
212                captured.insert("transactionId", value);
213            }
214        }
215
216        cfg.interceptor_state().store_put(captured);
217        ::std::result::Result::Ok(())
218    }
219}
220#[derive(Debug)]
221struct ExecuteStatementResponseDeserializer;
222impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ExecuteStatementResponseDeserializer {
223    fn deserialize_nonstreaming_with_config(
224        &self,
225        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
226        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
227    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
228        let (success, status) = (response.status().is_success(), response.status().as_u16());
229        let headers = response.headers();
230        let body = response.body().bytes().expect("body loaded");
231        #[allow(unused_mut)]
232        let mut force_error = false;
233        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
234        let parse_result = if !success && status != 200 || force_error {
235            crate::protocol_serde::shape_execute_statement::de_execute_statement_http_error(status, headers, body)
236        } else {
237            crate::protocol_serde::shape_execute_statement::de_execute_statement_http_response(status, headers, body)
238        };
239        crate::protocol_serde::type_erase_result(parse_result)
240    }
241}
242#[derive(Debug)]
243struct ExecuteStatementRequestSerializer;
244impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ExecuteStatementRequestSerializer {
245    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
246    fn serialize_input(
247        &self,
248        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
249        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
250    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
251        let input = input
252            .downcast::<crate::operation::execute_statement::ExecuteStatementInput>()
253            .expect("correct type");
254        let _header_serialization_settings = _cfg
255            .load::<crate::serialization_settings::HeaderSerializationSettings>()
256            .cloned()
257            .unwrap_or_default();
258        let mut request_builder = {
259            #[allow(clippy::uninlined_format_args)]
260            fn uri_base(
261                _input: &crate::operation::execute_statement::ExecuteStatementInput,
262                output: &mut ::std::string::String,
263            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
264                use ::std::fmt::Write as _;
265                ::std::write!(output, "/Execute").expect("formatting should succeed");
266                ::std::result::Result::Ok(())
267            }
268            #[allow(clippy::unnecessary_wraps)]
269            fn update_http_builder(
270                input: &crate::operation::execute_statement::ExecuteStatementInput,
271                builder: ::http_1x::request::Builder,
272            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
273                let mut uri = ::std::string::String::new();
274                uri_base(input, &mut uri)?;
275                ::std::result::Result::Ok(builder.method("POST").uri(uri))
276            }
277            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
278            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
279            builder
280        };
281        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_execute_statement::ser_execute_statement_input(&input)?);
282        if let Some(content_length) = body.content_length() {
283            let content_length = content_length.to_string();
284            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
285        }
286        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
287    }
288}
289#[derive(Debug)]
290struct ExecuteStatementEndpointParamsInterceptor;
291
292#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
293impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ExecuteStatementEndpointParamsInterceptor {
294    fn name(&self) -> &'static str {
295        "ExecuteStatementEndpointParamsInterceptor"
296    }
297
298    fn read_before_execution(
299        &self,
300        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
301            '_,
302            ::aws_smithy_runtime_api::client::interceptors::context::Input,
303            ::aws_smithy_runtime_api::client::interceptors::context::Output,
304            ::aws_smithy_runtime_api::client::interceptors::context::Error,
305        >,
306        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
307    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
308        let _input = context
309            .input()
310            .downcast_ref::<ExecuteStatementInput>()
311            .ok_or("failed to downcast to ExecuteStatementInput")?;
312
313        let params = crate::config::endpoint::Params::builder()
314            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
315            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
316            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
317            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
318            .build()
319            .map_err(|err| {
320                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
321            })?;
322        cfg.interceptor_state()
323            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
324        ::std::result::Result::Ok(())
325    }
326}
327
328// The get_* functions below are generated from JMESPath expressions in the
329// operationContextParams trait. They target the operation's input shape.
330
331/// Error type for the `ExecuteStatementError` operation.
332#[non_exhaustive]
333#[derive(::std::fmt::Debug)]
334pub enum ExecuteStatementError {
335    /// <p>You don't have sufficient access to perform this action.</p>
336    AccessDeniedException(crate::types::error::AccessDeniedException),
337    /// <p>There is an error in the call or in a SQL statement. This exception is deprecated.</p>
338    BadRequestException(crate::types::error::BadRequestException),
339    /// <p>There was an error in processing the SQL statement.</p>
340    DatabaseErrorException(crate::types::error::DatabaseErrorException),
341    /// <p>The DB cluster doesn't have a DB instance.</p>
342    DatabaseNotFoundException(crate::types::error::DatabaseNotFoundException),
343    /// <p>A request was cancelled because the Aurora Serverless DB instance was paused. The Data API request automatically resumes the DB instance. Wait a few seconds and try again.</p>
344    DatabaseResumingException(crate::types::error::DatabaseResumingException),
345    /// <p>The writer instance in the DB cluster isn't available.</p>
346    DatabaseUnavailableException(crate::types::error::DatabaseUnavailableException),
347    /// <p>There are insufficient privileges to make the call.</p>
348    ForbiddenException(crate::types::error::ForbiddenException),
349    /// <p>The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster.</p>
350    HttpEndpointNotEnabledException(crate::types::error::HttpEndpointNotEnabledException),
351    /// <p>An internal error occurred.</p>
352    InternalServerErrorException(crate::types::error::InternalServerErrorException),
353    /// <p>The resource is in an invalid state.</p>
354    InvalidResourceStateException(crate::types::error::InvalidResourceStateException),
355    /// <p>The Secrets Manager secret used with the request isn't valid.</p>
356    InvalidSecretException(crate::types::error::InvalidSecretException),
357    /// <p>There was a problem with the Secrets Manager secret used with the request, caused by one of the following conditions:</p>
358    /// <ul>
359    /// <li>
360    /// <p>RDS Data API timed out retrieving the secret.</p></li>
361    /// <li>
362    /// <p>The secret provided wasn't found.</p></li>
363    /// <li>
364    /// <p>The secret couldn't be decrypted.</p></li>
365    /// </ul>
366    SecretsErrorException(crate::types::error::SecretsErrorException),
367    /// <p>The service specified by the <code>resourceArn</code> parameter isn't available.</p>
368    ServiceUnavailableError(crate::types::error::ServiceUnavailableError),
369    /// <p>The execution of the SQL statement timed out.</p>
370    StatementTimeoutException(crate::types::error::StatementTimeoutException),
371    /// <p>The transaction ID wasn't found.</p>
372    TransactionNotFoundException(crate::types::error::TransactionNotFoundException),
373    /// <p>There was a problem with the result because of one of the following conditions:</p>
374    /// <ul>
375    /// <li>
376    /// <p>It contained an unsupported data type.</p></li>
377    /// <li>
378    /// <p>It contained a multidimensional array.</p></li>
379    /// <li>
380    /// <p>The size was too large.</p></li>
381    /// </ul>
382    UnsupportedResultException(crate::types::error::UnsupportedResultException),
383    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
384    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
385    variable wildcard pattern and check `.code()`:
386     \
387    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
388     \
389    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ExecuteStatementError) for what information is available for the error.")]
390    Unhandled(crate::error::sealed_unhandled::Unhandled),
391}
392impl ExecuteStatementError {
393    /// Creates the `ExecuteStatementError::Unhandled` variant from any error type.
394    pub fn unhandled(
395        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
396    ) -> Self {
397        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
398            source: err.into(),
399            meta: ::std::default::Default::default(),
400        })
401    }
402
403    /// Creates the `ExecuteStatementError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
404    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
405        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
406            source: err.clone().into(),
407            meta: err,
408        })
409    }
410    ///
411    /// Returns error metadata, which includes the error code, message,
412    /// request ID, and potentially additional information.
413    ///
414    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
415        match self {
416            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417            Self::BadRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418            Self::DatabaseErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419            Self::DatabaseNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420            Self::DatabaseResumingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421            Self::DatabaseUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422            Self::ForbiddenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423            Self::HttpEndpointNotEnabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424            Self::InternalServerErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425            Self::InvalidResourceStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426            Self::InvalidSecretException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427            Self::SecretsErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428            Self::ServiceUnavailableError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429            Self::StatementTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
430            Self::TransactionNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431            Self::UnsupportedResultException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432            Self::Unhandled(e) => &e.meta,
433        }
434    }
435    /// Returns `true` if the error kind is `ExecuteStatementError::AccessDeniedException`.
436    pub fn is_access_denied_exception(&self) -> bool {
437        matches!(self, Self::AccessDeniedException(_))
438    }
439    /// Returns `true` if the error kind is `ExecuteStatementError::BadRequestException`.
440    pub fn is_bad_request_exception(&self) -> bool {
441        matches!(self, Self::BadRequestException(_))
442    }
443    /// Returns `true` if the error kind is `ExecuteStatementError::DatabaseErrorException`.
444    pub fn is_database_error_exception(&self) -> bool {
445        matches!(self, Self::DatabaseErrorException(_))
446    }
447    /// Returns `true` if the error kind is `ExecuteStatementError::DatabaseNotFoundException`.
448    pub fn is_database_not_found_exception(&self) -> bool {
449        matches!(self, Self::DatabaseNotFoundException(_))
450    }
451    /// Returns `true` if the error kind is `ExecuteStatementError::DatabaseResumingException`.
452    pub fn is_database_resuming_exception(&self) -> bool {
453        matches!(self, Self::DatabaseResumingException(_))
454    }
455    /// Returns `true` if the error kind is `ExecuteStatementError::DatabaseUnavailableException`.
456    pub fn is_database_unavailable_exception(&self) -> bool {
457        matches!(self, Self::DatabaseUnavailableException(_))
458    }
459    /// Returns `true` if the error kind is `ExecuteStatementError::ForbiddenException`.
460    pub fn is_forbidden_exception(&self) -> bool {
461        matches!(self, Self::ForbiddenException(_))
462    }
463    /// Returns `true` if the error kind is `ExecuteStatementError::HttpEndpointNotEnabledException`.
464    pub fn is_http_endpoint_not_enabled_exception(&self) -> bool {
465        matches!(self, Self::HttpEndpointNotEnabledException(_))
466    }
467    /// Returns `true` if the error kind is `ExecuteStatementError::InternalServerErrorException`.
468    pub fn is_internal_server_error_exception(&self) -> bool {
469        matches!(self, Self::InternalServerErrorException(_))
470    }
471    /// Returns `true` if the error kind is `ExecuteStatementError::InvalidResourceStateException`.
472    pub fn is_invalid_resource_state_exception(&self) -> bool {
473        matches!(self, Self::InvalidResourceStateException(_))
474    }
475    /// Returns `true` if the error kind is `ExecuteStatementError::InvalidSecretException`.
476    pub fn is_invalid_secret_exception(&self) -> bool {
477        matches!(self, Self::InvalidSecretException(_))
478    }
479    /// Returns `true` if the error kind is `ExecuteStatementError::SecretsErrorException`.
480    pub fn is_secrets_error_exception(&self) -> bool {
481        matches!(self, Self::SecretsErrorException(_))
482    }
483    /// Returns `true` if the error kind is `ExecuteStatementError::ServiceUnavailableError`.
484    pub fn is_service_unavailable_error(&self) -> bool {
485        matches!(self, Self::ServiceUnavailableError(_))
486    }
487    /// Returns `true` if the error kind is `ExecuteStatementError::StatementTimeoutException`.
488    pub fn is_statement_timeout_exception(&self) -> bool {
489        matches!(self, Self::StatementTimeoutException(_))
490    }
491    /// Returns `true` if the error kind is `ExecuteStatementError::TransactionNotFoundException`.
492    pub fn is_transaction_not_found_exception(&self) -> bool {
493        matches!(self, Self::TransactionNotFoundException(_))
494    }
495    /// Returns `true` if the error kind is `ExecuteStatementError::UnsupportedResultException`.
496    pub fn is_unsupported_result_exception(&self) -> bool {
497        matches!(self, Self::UnsupportedResultException(_))
498    }
499}
500impl ::std::error::Error for ExecuteStatementError {
501    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
502        match self {
503            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
504            Self::BadRequestException(_inner) => ::std::option::Option::Some(_inner),
505            Self::DatabaseErrorException(_inner) => ::std::option::Option::Some(_inner),
506            Self::DatabaseNotFoundException(_inner) => ::std::option::Option::Some(_inner),
507            Self::DatabaseResumingException(_inner) => ::std::option::Option::Some(_inner),
508            Self::DatabaseUnavailableException(_inner) => ::std::option::Option::Some(_inner),
509            Self::ForbiddenException(_inner) => ::std::option::Option::Some(_inner),
510            Self::HttpEndpointNotEnabledException(_inner) => ::std::option::Option::Some(_inner),
511            Self::InternalServerErrorException(_inner) => ::std::option::Option::Some(_inner),
512            Self::InvalidResourceStateException(_inner) => ::std::option::Option::Some(_inner),
513            Self::InvalidSecretException(_inner) => ::std::option::Option::Some(_inner),
514            Self::SecretsErrorException(_inner) => ::std::option::Option::Some(_inner),
515            Self::ServiceUnavailableError(_inner) => ::std::option::Option::Some(_inner),
516            Self::StatementTimeoutException(_inner) => ::std::option::Option::Some(_inner),
517            Self::TransactionNotFoundException(_inner) => ::std::option::Option::Some(_inner),
518            Self::UnsupportedResultException(_inner) => ::std::option::Option::Some(_inner),
519            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
520        }
521    }
522}
523impl ::std::fmt::Display for ExecuteStatementError {
524    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
525        match self {
526            Self::AccessDeniedException(_inner) => _inner.fmt(f),
527            Self::BadRequestException(_inner) => _inner.fmt(f),
528            Self::DatabaseErrorException(_inner) => _inner.fmt(f),
529            Self::DatabaseNotFoundException(_inner) => _inner.fmt(f),
530            Self::DatabaseResumingException(_inner) => _inner.fmt(f),
531            Self::DatabaseUnavailableException(_inner) => _inner.fmt(f),
532            Self::ForbiddenException(_inner) => _inner.fmt(f),
533            Self::HttpEndpointNotEnabledException(_inner) => _inner.fmt(f),
534            Self::InternalServerErrorException(_inner) => _inner.fmt(f),
535            Self::InvalidResourceStateException(_inner) => _inner.fmt(f),
536            Self::InvalidSecretException(_inner) => _inner.fmt(f),
537            Self::SecretsErrorException(_inner) => _inner.fmt(f),
538            Self::ServiceUnavailableError(_inner) => _inner.fmt(f),
539            Self::StatementTimeoutException(_inner) => _inner.fmt(f),
540            Self::TransactionNotFoundException(_inner) => _inner.fmt(f),
541            Self::UnsupportedResultException(_inner) => _inner.fmt(f),
542            Self::Unhandled(_inner) => {
543                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
544                    write!(f, "unhandled error ({code})")
545                } else {
546                    f.write_str("unhandled error")
547                }
548            }
549        }
550    }
551}
552impl ::aws_smithy_types::retry::ProvideErrorKind for ExecuteStatementError {
553    fn code(&self) -> ::std::option::Option<&str> {
554        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
555    }
556    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
557        ::std::option::Option::None
558    }
559}
560impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ExecuteStatementError {
561    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
562        match self {
563            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
564            Self::BadRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
565            Self::DatabaseErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
566            Self::DatabaseNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
567            Self::DatabaseResumingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
568            Self::DatabaseUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
569            Self::ForbiddenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
570            Self::HttpEndpointNotEnabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
571            Self::InternalServerErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
572            Self::InvalidResourceStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
573            Self::InvalidSecretException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
574            Self::SecretsErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
575            Self::ServiceUnavailableError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
576            Self::StatementTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
577            Self::TransactionNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
578            Self::UnsupportedResultException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
579            Self::Unhandled(_inner) => &_inner.meta,
580        }
581    }
582}
583impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ExecuteStatementError {
584    fn create_unhandled_error(
585        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
586        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
587    ) -> Self {
588        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
589            source,
590            meta: meta.unwrap_or_default(),
591        })
592    }
593}
594impl ::aws_types::request_id::RequestId for crate::operation::execute_statement::ExecuteStatementError {
595    fn request_id(&self) -> Option<&str> {
596        self.meta().request_id()
597    }
598}
599
600pub use crate::operation::execute_statement::_execute_statement_input::ExecuteStatementInput;
601
602pub use crate::operation::execute_statement::_execute_statement_output::ExecuteStatementOutput;
603
604mod _execute_statement_input;
605
606mod _execute_statement_output;
607
608/// Builders
609pub mod builders;