aws_sdk_dynamodb/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    /// The schema for this operation's input shape.
12                    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::execute_statement::ExecuteStatementInput::SCHEMA;
13                    /// The schema for this operation's output shape.
14                    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::execute_statement::ExecuteStatementOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17                        input: crate::operation::execute_statement::ExecuteStatementInput,
18                    ) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::execute_statement::ExecuteStatementError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
19                        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>| {
20                            err.map_service_error(|err| {
21                                err.downcast::<crate::operation::execute_statement::ExecuteStatementError>().expect("correct error type")
22                            })
23                        };
24                        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
25                            .await
26                            .map_err(map_err)?;
27                        let output = context.finalize().map_err(map_err)?;
28                        ::std::result::Result::Ok(output.downcast::<crate::operation::execute_statement::ExecuteStatementOutput>().expect("correct output type"))
29                    }
30    
31                    pub(crate) async fn orchestrate_with_stop_point(
32                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
33                        input: crate::operation::execute_statement::ExecuteStatementInput,
34                        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
35                    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
36                        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
37                        use ::tracing::Instrument;
38                        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
39                            "DynamoDB",
40                            "ExecuteStatement",
41                            input,
42                            runtime_plugins,
43                            stop_point
44                        )
45                        // Create a parent span for the entire operation. Includes a random, internal-only,
46                        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
47                        .instrument(::tracing::debug_span!(
48                                "DynamoDB.ExecuteStatement",
49                                "rpc.service" = "DynamoDB",
50                                "rpc.method" = "ExecuteStatement",
51                                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
52                                "rpc.system" = "aws-api",
53                            ))
54                        .await
55                    }
56    
57                    pub(crate) fn operation_runtime_plugins(
58                        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
59                        client_config: &crate::config::Config,
60                        config_override: ::std::option::Option<crate::config::Builder>,
61                    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
62                        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
63                        
64                        if let ::std::option::Option::Some(config_override) = config_override {
65                            for plugin in config_override.runtime_plugins.iter().cloned() {
66                                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
67                            }
68                            runtime_plugins = runtime_plugins.with_operation_plugin(
69                                crate::config::ConfigOverrideRuntimePlugin::new(config_override, client_config.config.clone(), &client_config.runtime_components)
70                            );
71                        }
72                        runtime_plugins
73                    }
74}
75impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ExecuteStatement {
76                fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77                    let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ExecuteStatement");
78
79                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ExecuteStatementRequestSerializer));
80                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ExecuteStatementResponseDeserializer));
81
82                    cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83                        crate::config::auth::Params::builder()
84                            .operation_name("ExecuteStatement")
85                            .build()
86                            .expect("required fields set")
87                    ));
88
89                    cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
90                            "ExecuteStatement",
91                            "DynamoDB",
92                        ));
93let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
94                            signing_options.double_uri_encode = true;
95                            signing_options.content_sha256_header = false;
96                            signing_options.normalize_uri_path = true;
97                            signing_options.payload_override = None;
98
99                            cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
100                                signing_options,
101                                ..::std::default::Default::default()
102                            });
103
104                    ::std::option::Option::Some(cfg.freeze())
105                }
106
107                fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
108                    #[allow(unused_mut)]
109                    let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ExecuteStatement")
110                            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
111.with_interceptor(ExecuteStatementEndpointParamsInterceptor)
112                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::execute_statement::ExecuteStatementError>::new())
113.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::execute_statement::ExecuteStatementError>::new())
114.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::execute_statement::ExecuteStatementError>::new());
115
116                    ::std::borrow::Cow::Owned(rcb)
117                }
118            }
119
120            
121#[derive(Debug)]
122            struct ExecuteStatementResponseDeserializer;
123            impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ExecuteStatementResponseDeserializer {
124                
125
126                fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
127                    let (success, status) = (response.status().is_success(), response.status().as_u16());
128            #[allow(unused_mut)]
129            let mut force_error = false;
130            ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
131            if !success && status != 200 || force_error {
132                let headers = response.headers();
133                let body = response.body().bytes().expect("body loaded");
134#[allow(unused_mut)]
135            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body)
136                .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
137            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
138            let generic = generic_builder.build();
139let error_code = match generic.code() {
140                    ::std::option::Option::Some(code) => code,
141                    ::std::option::Option::None => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::execute_statement::ExecuteStatementError::unhandled(generic)))),
142                };
143                let _error_message = generic.message().map(|msg| msg.to_owned());
144                let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
145                    .expect("a SharedClientProtocol is required");
146let err = match error_code {
147"ConditionalCheckFailedException" => crate::operation::execute_statement::ExecuteStatementError::ConditionalCheckFailedException({
148let mut tmp = match protocol.deserialize_response(response, crate::types::error::ConditionalCheckFailedException::SCHEMA, _cfg)
149                        .and_then(|mut deser| crate::types::error::ConditionalCheckFailedException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
150                    {
151                        ::std::result::Result::Ok(val) => val,
152                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
153                    };
154                    tmp.meta = generic;
155if tmp.message.is_none() {
156                                tmp.message = _error_message;
157                            }
158tmp
159}),
160"DuplicateItemException" => crate::operation::execute_statement::ExecuteStatementError::DuplicateItemException({
161let mut tmp = match protocol.deserialize_response(response, crate::types::error::DuplicateItemException::SCHEMA, _cfg)
162                        .and_then(|mut deser| crate::types::error::DuplicateItemException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
163                    {
164                        ::std::result::Result::Ok(val) => val,
165                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
166                    };
167                    tmp.meta = generic;
168if tmp.message.is_none() {
169                                tmp.message = _error_message;
170                            }
171tmp
172}),
173"InternalServerError" => crate::operation::execute_statement::ExecuteStatementError::InternalServerError({
174let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
175                        .and_then(|mut deser| crate::types::error::InternalServerError::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
176                    {
177                        ::std::result::Result::Ok(val) => val,
178                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
179                    };
180                    tmp.meta = generic;
181if tmp.message.is_none() {
182                                tmp.message = _error_message;
183                            }
184tmp
185}),
186"ItemCollectionSizeLimitExceededException" => crate::operation::execute_statement::ExecuteStatementError::ItemCollectionSizeLimitExceededException({
187let mut tmp = match protocol.deserialize_response(response, crate::types::error::ItemCollectionSizeLimitExceededException::SCHEMA, _cfg)
188                        .and_then(|mut deser| crate::types::error::ItemCollectionSizeLimitExceededException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
189                    {
190                        ::std::result::Result::Ok(val) => val,
191                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
192                    };
193                    tmp.meta = generic;
194if tmp.message.is_none() {
195                                tmp.message = _error_message;
196                            }
197tmp
198}),
199"ProvisionedThroughputExceededException" => crate::operation::execute_statement::ExecuteStatementError::ProvisionedThroughputExceededException({
200let mut tmp = match protocol.deserialize_response(response, crate::types::error::ProvisionedThroughputExceededException::SCHEMA, _cfg)
201                        .and_then(|mut deser| crate::types::error::ProvisionedThroughputExceededException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
202                    {
203                        ::std::result::Result::Ok(val) => val,
204                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
205                    };
206                    tmp.meta = generic;
207if tmp.message.is_none() {
208                                tmp.message = _error_message;
209                            }
210tmp
211}),
212"RequestLimitExceeded" => crate::operation::execute_statement::ExecuteStatementError::RequestLimitExceeded({
213let mut tmp = match protocol.deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
214                        .and_then(|mut deser| crate::types::error::RequestLimitExceeded::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
215                    {
216                        ::std::result::Result::Ok(val) => val,
217                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
218                    };
219                    tmp.meta = generic;
220if tmp.message.is_none() {
221                                tmp.message = _error_message;
222                            }
223tmp
224}),
225"ResourceNotFoundException" => crate::operation::execute_statement::ExecuteStatementError::ResourceNotFoundException({
226let mut tmp = match protocol.deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
227                        .and_then(|mut deser| crate::types::error::ResourceNotFoundException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
228                    {
229                        ::std::result::Result::Ok(val) => val,
230                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
231                    };
232                    tmp.meta = generic;
233if tmp.message.is_none() {
234                                tmp.message = _error_message;
235                            }
236tmp
237}),
238"ThrottlingException" => crate::operation::execute_statement::ExecuteStatementError::ThrottlingException({
239let mut tmp = match protocol.deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
240                        .and_then(|mut deser| crate::types::error::ThrottlingException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
241                    {
242                        ::std::result::Result::Ok(val) => val,
243                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
244                    };
245                    tmp.meta = generic;
246if tmp.message.is_none() {
247                                tmp.message = _error_message;
248                            }
249tmp
250}),
251"TransactionConflictException" => crate::operation::execute_statement::ExecuteStatementError::TransactionConflictException({
252let mut tmp = match protocol.deserialize_response(response, crate::types::error::TransactionConflictException::SCHEMA, _cfg)
253                        .and_then(|mut deser| crate::types::error::TransactionConflictException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
254                    {
255                        ::std::result::Result::Ok(val) => val,
256                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
257                    };
258                    tmp.meta = generic;
259if tmp.message.is_none() {
260                                tmp.message = _error_message;
261                            }
262tmp
263}),
264_ => crate::operation::execute_statement::ExecuteStatementError::generic(generic)
265};
266                ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
267} else {
268                let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
269                    .expect("a SharedClientProtocol is required");
270                let mut deser = protocol.deserialize_response(response, ExecuteStatement::OUTPUT_SCHEMA, _cfg)
271                    .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
272                let body = response.body().bytes().expect("body loaded");
273                let output = crate::operation::execute_statement::ExecuteStatementOutput::deserialize_with_response(
274                    &mut *deser,
275                    response.headers(),
276                    response.status().into(),
277                    body,
278                ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
279                ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
280            }
281                }
282            }
283#[derive(Debug)]
284            struct ExecuteStatementRequestSerializer;
285            impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ExecuteStatementRequestSerializer {
286                #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
287                fn serialize_input(&self, input: ::aws_smithy_runtime_api::client::interceptors::context::Input, _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
288                    let input = input.downcast::<crate::operation::execute_statement::ExecuteStatementInput>().expect("correct type");
289                    let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
290                        .expect("a SharedClientProtocol is required");
291                    let mut request = protocol.serialize_request(
292                            &input, ExecuteStatement::INPUT_SCHEMA, "", _cfg,
293                        ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
294                        
295                        return ::std::result::Result::Ok(request);
296                }
297            }
298#[derive(Debug)]
299            struct ExecuteStatementEndpointParamsInterceptor;
300
301            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ExecuteStatementEndpointParamsInterceptor {
302                fn name(&self) -> &'static str {
303                    "ExecuteStatementEndpointParamsInterceptor"
304                }
305
306                fn read_before_execution(
307                    &self,
308                    context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<'_, ::aws_smithy_runtime_api::client::interceptors::context::Input, ::aws_smithy_runtime_api::client::interceptors::context::Output, ::aws_smithy_runtime_api::client::interceptors::context::Error>,
309                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
310                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
311                    let _input = context.input()
312                        .downcast_ref::<ExecuteStatementInput>()
313                        .ok_or("failed to downcast to ExecuteStatementInput")?;
314
315                    
316
317                    let params = crate::config::endpoint::Params::builder()
318                        .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
319.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
320.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
321.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
322.set_account_id_endpoint_mode(::std::option::Option::Some(cfg.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned().unwrap_or_default().to_string()))
323                        .build()
324                        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
325                    cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
326                    ::std::result::Result::Ok(())
327                }
328            }
329
330            // The get_* functions below are generated from JMESPath expressions in the
331            // operationContextParams trait. They target the operation's input shape.
332
333            
334
335/// Error type for the `ExecuteStatementError` operation.
336#[non_exhaustive]
337#[derive(::std::fmt::Debug)]
338pub enum ExecuteStatementError {
339    /// <p>A condition specified in the operation failed to be evaluated.</p>
340    ConditionalCheckFailedException(crate::types::error::ConditionalCheckFailedException),
341    /// <p>There was an attempt to insert an item with the same primary key as an item that already exists in the DynamoDB table.</p>
342    DuplicateItemException(crate::types::error::DuplicateItemException),
343    /// <p>An error occurred on the server side.</p>
344    InternalServerError(crate::types::error::InternalServerError),
345    /// <p>An item collection is too large. This exception is only returned for tables that have one or more local secondary indexes.</p>
346    ItemCollectionSizeLimitExceededException(crate::types::error::ItemCollectionSizeLimitExceededException),
347    /// <p>The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html">ThrottlingReason</a> field in the returned exception. The Amazon Web Services SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests and use exponential backoff. For more information, go to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff">Error Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
348    ProvisionedThroughputExceededException(crate::types::error::ProvisionedThroughputExceededException),
349    /// <p>Throughput exceeds the current throughput quota for your account. For detailed information about why the request was throttled and the ARN of the impacted resource, find the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html">ThrottlingReason</a> field in the returned exception. Contact <a href="https://aws.amazon.com/support">Amazon Web Services Support</a> to request a quota increase.</p>
350    RequestLimitExceeded(crate::types::error::RequestLimitExceeded),
351    /// <p>The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
352    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
353    /// <p>The request was denied due to request throttling. For detailed information about why the request was throttled and the ARN of the impacted resource, find the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html">ThrottlingReason</a> field in the returned exception.</p>
354    ThrottlingException(crate::types::error::ThrottlingException),
355    /// <p>Operation was rejected because there is an ongoing transaction for the item.</p>
356    TransactionConflictException(crate::types::error::TransactionConflictException),
357    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
358                    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
359    variable wildcard pattern and check `.code()`:
360     \
361    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
362     \
363    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ExecuteStatementError) for what information is available for the error.")]
364                    Unhandled(crate::error::sealed_unhandled::Unhandled),
365}
366impl ExecuteStatementError {
367    /// Creates the `ExecuteStatementError::Unhandled` variant from any error type.
368                    pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
369                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
370                    }
371    
372                    /// Creates the `ExecuteStatementError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
373                    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
374                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
375                    }
376    /// 
377    /// Returns error metadata, which includes the error code, message,
378    /// request ID, and potentially additional information.
379    /// 
380    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
381        match self {
382            Self::ConditionalCheckFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
383            Self::DuplicateItemException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
384            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
385            Self::ItemCollectionSizeLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
386            Self::ProvisionedThroughputExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
387            Self::RequestLimitExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
388            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
389            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
390            Self::TransactionConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
391            Self::Unhandled(e) => &e.meta,
392        }
393    }
394    /// Returns `true` if the error kind is `ExecuteStatementError::ConditionalCheckFailedException`.
395    pub fn is_conditional_check_failed_exception(&self) -> bool {
396        matches!(self, Self::ConditionalCheckFailedException(_))
397    }
398    /// Returns `true` if the error kind is `ExecuteStatementError::DuplicateItemException`.
399    pub fn is_duplicate_item_exception(&self) -> bool {
400        matches!(self, Self::DuplicateItemException(_))
401    }
402    /// Returns `true` if the error kind is `ExecuteStatementError::InternalServerError`.
403    pub fn is_internal_server_error(&self) -> bool {
404        matches!(self, Self::InternalServerError(_))
405    }
406    /// Returns `true` if the error kind is `ExecuteStatementError::ItemCollectionSizeLimitExceededException`.
407    pub fn is_item_collection_size_limit_exceeded_exception(&self) -> bool {
408        matches!(self, Self::ItemCollectionSizeLimitExceededException(_))
409    }
410    /// Returns `true` if the error kind is `ExecuteStatementError::ProvisionedThroughputExceededException`.
411    pub fn is_provisioned_throughput_exceeded_exception(&self) -> bool {
412        matches!(self, Self::ProvisionedThroughputExceededException(_))
413    }
414    /// Returns `true` if the error kind is `ExecuteStatementError::RequestLimitExceeded`.
415    pub fn is_request_limit_exceeded(&self) -> bool {
416        matches!(self, Self::RequestLimitExceeded(_))
417    }
418    /// Returns `true` if the error kind is `ExecuteStatementError::ResourceNotFoundException`.
419    pub fn is_resource_not_found_exception(&self) -> bool {
420        matches!(self, Self::ResourceNotFoundException(_))
421    }
422    /// Returns `true` if the error kind is `ExecuteStatementError::ThrottlingException`.
423    pub fn is_throttling_exception(&self) -> bool {
424        matches!(self, Self::ThrottlingException(_))
425    }
426    /// Returns `true` if the error kind is `ExecuteStatementError::TransactionConflictException`.
427    pub fn is_transaction_conflict_exception(&self) -> bool {
428        matches!(self, Self::TransactionConflictException(_))
429    }
430}
431impl ::std::error::Error for ExecuteStatementError {
432    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
433        match self {
434            Self::ConditionalCheckFailedException(_inner) =>
435            ::std::option::Option::Some(_inner)
436            ,
437            Self::DuplicateItemException(_inner) =>
438            ::std::option::Option::Some(_inner)
439            ,
440            Self::InternalServerError(_inner) =>
441            ::std::option::Option::Some(_inner)
442            ,
443            Self::ItemCollectionSizeLimitExceededException(_inner) =>
444            ::std::option::Option::Some(_inner)
445            ,
446            Self::ProvisionedThroughputExceededException(_inner) =>
447            ::std::option::Option::Some(_inner)
448            ,
449            Self::RequestLimitExceeded(_inner) =>
450            ::std::option::Option::Some(_inner)
451            ,
452            Self::ResourceNotFoundException(_inner) =>
453            ::std::option::Option::Some(_inner)
454            ,
455            Self::ThrottlingException(_inner) =>
456            ::std::option::Option::Some(_inner)
457            ,
458            Self::TransactionConflictException(_inner) =>
459            ::std::option::Option::Some(_inner)
460            ,
461            Self::Unhandled(_inner) => {
462                ::std::option::Option::Some(&*_inner.source)
463            }
464        }
465    }
466}
467impl ::std::fmt::Display for ExecuteStatementError {
468    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
469        match self {
470            Self::ConditionalCheckFailedException(_inner) =>
471            _inner.fmt(f)
472            ,
473            Self::DuplicateItemException(_inner) =>
474            _inner.fmt(f)
475            ,
476            Self::InternalServerError(_inner) =>
477            _inner.fmt(f)
478            ,
479            Self::ItemCollectionSizeLimitExceededException(_inner) =>
480            _inner.fmt(f)
481            ,
482            Self::ProvisionedThroughputExceededException(_inner) =>
483            _inner.fmt(f)
484            ,
485            Self::RequestLimitExceeded(_inner) =>
486            _inner.fmt(f)
487            ,
488            Self::ResourceNotFoundException(_inner) =>
489            _inner.fmt(f)
490            ,
491            Self::ThrottlingException(_inner) =>
492            _inner.fmt(f)
493            ,
494            Self::TransactionConflictException(_inner) =>
495            _inner.fmt(f)
496            ,
497            Self::Unhandled(_inner) => {
498                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
499                                                        write!(f, "unhandled error ({code})")
500                                                    } else {
501                                                        f.write_str("unhandled error")
502                                                    }
503            }
504        }
505    }
506}
507impl ::aws_smithy_types::retry::ProvideErrorKind for ExecuteStatementError {
508    fn code(&self) -> ::std::option::Option<&str> {
509        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
510    }
511    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
512        ::std::option::Option::None
513    }
514}
515impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ExecuteStatementError {
516    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
517        match self {
518            Self::ConditionalCheckFailedException(_inner) =>
519            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
520            ,
521            Self::DuplicateItemException(_inner) =>
522            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
523            ,
524            Self::InternalServerError(_inner) =>
525            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
526            ,
527            Self::ItemCollectionSizeLimitExceededException(_inner) =>
528            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
529            ,
530            Self::ProvisionedThroughputExceededException(_inner) =>
531            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
532            ,
533            Self::RequestLimitExceeded(_inner) =>
534            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
535            ,
536            Self::ResourceNotFoundException(_inner) =>
537            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
538            ,
539            Self::ThrottlingException(_inner) =>
540            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
541            ,
542            Self::TransactionConflictException(_inner) =>
543            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
544            ,
545            Self::Unhandled(_inner) => {
546                &_inner.meta
547            }
548        }
549    }
550}
551impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ExecuteStatementError {
552    fn create_unhandled_error(
553                        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
554                        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
555                    ) -> Self {
556        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
557    }
558}
559impl ::aws_types::request_id::RequestId for crate::operation::execute_statement::ExecuteStatementError {
560                                fn request_id(&self) -> Option<&str> {
561                                    self.meta().request_id()
562                                }
563                            }
564
565pub use crate::operation::execute_statement::_execute_statement_input::ExecuteStatementInput;
566
567pub use crate::operation::execute_statement::_execute_statement_output::ExecuteStatementOutput;
568
569mod _execute_statement_input;
570
571mod _execute_statement_output;
572
573/// Builders
574pub mod builders;
575