aws_sdk_dynamodb/operation/
transact_get_items.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `TransactGetItems`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct TransactGetItems;
6impl TransactGetItems {
7    /// Creates a new `TransactGetItems`
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::transact_get_items::TransactGetItemsInput::SCHEMA;
13                    /// The schema for this operation's output shape.
14                    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::transact_get_items::TransactGetItemsOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17                        input: crate::operation::transact_get_items::TransactGetItemsInput,
18                    ) -> ::std::result::Result<crate::operation::transact_get_items::TransactGetItemsOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::transact_get_items::TransactGetItemsError, ::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::transact_get_items::TransactGetItemsError>().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::transact_get_items::TransactGetItemsOutput>().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::transact_get_items::TransactGetItemsInput,
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                            "TransactGetItems",
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.TransactGetItems",
49                                "rpc.service" = "DynamoDB",
50                                "rpc.method" = "TransactGetItems",
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 TransactGetItems {
76                fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77                    let mut cfg = ::aws_smithy_types::config_bag::Layer::new("TransactGetItems");
78
79                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(TransactGetItemsRequestSerializer));
80                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(TransactGetItemsResponseDeserializer));
81
82                    cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83                        crate::config::auth::Params::builder()
84                            .operation_name("TransactGetItems")
85                            .build()
86                            .expect("required fields set")
87                    ));
88
89                    cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
90                            "TransactGetItems",
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("TransactGetItems")
110                            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
111.with_interceptor(TransactGetItemsEndpointParamsInterceptor)
112                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::transact_get_items::TransactGetItemsError>::new())
113.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::transact_get_items::TransactGetItemsError>::new())
114.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::transact_get_items::TransactGetItemsError>::new());
115
116                    ::std::borrow::Cow::Owned(rcb)
117                }
118            }
119
120            
121#[derive(Debug)]
122            struct TransactGetItemsResponseDeserializer;
123            impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TransactGetItemsResponseDeserializer {
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::transact_get_items::TransactGetItemsError::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"InternalServerError" => crate::operation::transact_get_items::TransactGetItemsError::InternalServerError({
148let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
149                        .and_then(|mut deser| crate::types::error::InternalServerError::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"InvalidEndpointException" => crate::operation::transact_get_items::TransactGetItemsError::InvalidEndpointException({
161let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidEndpointException::SCHEMA, _cfg)
162                        .and_then(|mut deser| crate::types::error::InvalidEndpointException::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"ProvisionedThroughputExceededException" => crate::operation::transact_get_items::TransactGetItemsError::ProvisionedThroughputExceededException({
174let mut tmp = match protocol.deserialize_response(response, crate::types::error::ProvisionedThroughputExceededException::SCHEMA, _cfg)
175                        .and_then(|mut deser| crate::types::error::ProvisionedThroughputExceededException::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"RequestLimitExceeded" => crate::operation::transact_get_items::TransactGetItemsError::RequestLimitExceeded({
187let mut tmp = match protocol.deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
188                        .and_then(|mut deser| crate::types::error::RequestLimitExceeded::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"ResourceNotFoundException" => crate::operation::transact_get_items::TransactGetItemsError::ResourceNotFoundException({
200let mut tmp = match protocol.deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
201                        .and_then(|mut deser| crate::types::error::ResourceNotFoundException::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"ThrottlingException" => crate::operation::transact_get_items::TransactGetItemsError::ThrottlingException({
213let mut tmp = match protocol.deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
214                        .and_then(|mut deser| crate::types::error::ThrottlingException::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"TransactionCanceledException" => crate::operation::transact_get_items::TransactGetItemsError::TransactionCanceledException({
226let mut tmp = match protocol.deserialize_response(response, crate::types::error::TransactionCanceledException::SCHEMA, _cfg)
227                        .and_then(|mut deser| crate::types::error::TransactionCanceledException::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_ => crate::operation::transact_get_items::TransactGetItemsError::generic(generic)
239};
240                ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
241} else {
242                let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
243                    .expect("a SharedClientProtocol is required");
244                let mut deser = protocol.deserialize_response(response, TransactGetItems::OUTPUT_SCHEMA, _cfg)
245                    .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
246                let body = response.body().bytes().expect("body loaded");
247                let output = crate::operation::transact_get_items::TransactGetItemsOutput::deserialize_with_response(
248                    &mut *deser,
249                    response.headers(),
250                    response.status().into(),
251                    body,
252                ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
253                ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
254            }
255                }
256            }
257#[derive(Debug)]
258            struct TransactGetItemsRequestSerializer;
259            impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TransactGetItemsRequestSerializer {
260                #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
261                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> {
262                    let input = input.downcast::<crate::operation::transact_get_items::TransactGetItemsInput>().expect("correct type");
263                    let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
264                        .expect("a SharedClientProtocol is required");
265                    let mut request = protocol.serialize_request(
266                            &input, TransactGetItems::INPUT_SCHEMA, "", _cfg,
267                        ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
268                        
269                        return ::std::result::Result::Ok(request);
270                }
271            }
272#[derive(Debug)]
273            struct TransactGetItemsEndpointParamsInterceptor;
274
275            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TransactGetItemsEndpointParamsInterceptor {
276                fn name(&self) -> &'static str {
277                    "TransactGetItemsEndpointParamsInterceptor"
278                }
279
280                fn read_before_execution(
281                    &self,
282                    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>,
283                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
284                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
285                    let _input = context.input()
286                        .downcast_ref::<TransactGetItemsInput>()
287                        .ok_or("failed to downcast to TransactGetItemsInput")?;
288
289                    
290
291                    let params = crate::config::endpoint::Params::builder()
292                        .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
293.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
294.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
295.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
296.set_account_id_endpoint_mode(::std::option::Option::Some(cfg.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned().unwrap_or_default().to_string()))
297.set_resource_arn_list(get_resource_arn_list(_input).map(|v| v.into_iter().cloned().collect::<Vec<_>>()))
298                        .build()
299                        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
300                    cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
301                    ::std::result::Result::Ok(())
302                }
303            }
304
305            // The get_* functions below are generated from JMESPath expressions in the
306            // operationContextParams trait. They target the operation's input shape.
307
308            // Generated from JMESPath Expression: TransactItems[*].Get.TableName
309fn get_resource_arn_list(input: &crate::operation::transact_get_items::TransactGetItemsInput) -> Option<::std::vec::Vec::<&::std::string::String>> {
310    let _fld_1 = input.transact_items.as_ref()?;
311    let _prj_4 = _fld_1.iter()
312    .flat_map(|v| {
313        #[allow(clippy::let_and_return)]
314        fn map(_v: &crate::types::TransactGetItem) -> ::std::option::Option<&::std::string::String> {
315            let _fld_2 = _v.get.as_ref();
316            let _fld_3 = _fld_2.map(|v| &v.table_name);
317            _fld_3
318        }
319        map(v)
320    })
321    .collect::<::std::vec::Vec<_>>();
322    Some(_prj_4)
323}
324
325/// Error type for the `TransactGetItemsError` operation.
326#[non_exhaustive]
327#[derive(::std::fmt::Debug)]
328pub enum TransactGetItemsError {
329    /// <p>An error occurred on the server side.</p>
330    InternalServerError(crate::types::error::InternalServerError),
331    #[allow(missing_docs)] // documentation missing in model
332    InvalidEndpointException(crate::types::error::InvalidEndpointException),
333    /// <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>
334    ProvisionedThroughputExceededException(crate::types::error::ProvisionedThroughputExceededException),
335    /// <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>
336    RequestLimitExceeded(crate::types::error::RequestLimitExceeded),
337    /// <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>
338    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
339    /// <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>
340    ThrottlingException(crate::types::error::ThrottlingException),
341    /// <p>The entire transaction request was canceled.</p>
342    /// <p>DynamoDB cancels a <code>TransactWriteItems</code> request under the following circumstances:</p>
343    /// <ul>
344    /// <li>
345    /// <p>A condition in one of the condition expressions is not met.</p></li>
346    /// <li>
347    /// <p>A table in the <code>TransactWriteItems</code> request is in a different account or region.</p></li>
348    /// <li>
349    /// <p>More than one action in the <code>TransactWriteItems</code> operation targets the same item.</p></li>
350    /// <li>
351    /// <p>There is insufficient provisioned capacity for the transaction to be completed.</p></li>
352    /// <li>
353    /// <p>An item size becomes too large (larger than 400 KB), or a local secondary index (LSI) becomes too large, or a similar validation error occurs because of changes made by the transaction.</p></li>
354    /// <li>
355    /// <p>There is a user error, such as an invalid data format.</p></li>
356    /// <li>
357    /// <p>There is an ongoing <code>TransactWriteItems</code> operation that conflicts with a concurrent <code>TransactWriteItems</code> request. In this case the <code>TransactWriteItems</code> operation fails with a <code>TransactionCanceledException</code>.</p></li>
358    /// </ul>
359    /// <p>DynamoDB cancels a <code>TransactGetItems</code> request under the following circumstances:</p>
360    /// <ul>
361    /// <li>
362    /// <p>There is an ongoing <code>TransactGetItems</code> operation that conflicts with a concurrent <code>PutItem</code>, <code>UpdateItem</code>, <code>DeleteItem</code> or <code>TransactWriteItems</code> request. In this case the <code>TransactGetItems</code> operation fails with a <code>TransactionCanceledException</code>.</p></li>
363    /// <li>
364    /// <p>A table in the <code>TransactGetItems</code> request is in a different account or region.</p></li>
365    /// <li>
366    /// <p>There is insufficient provisioned capacity for the transaction to be completed.</p></li>
367    /// <li>
368    /// <p>There is a user error, such as an invalid data format.</p></li>
369    /// </ul><note>
370    /// <p>If using Java, DynamoDB lists the cancellation reasons on the <code>CancellationReasons</code> property. This property is not set for other languages. Transaction cancellation reasons are ordered in the order of requested items, if an item has no error it will have <code>None</code> code and <code>Null</code> message.</p>
371    /// </note>
372    /// <p>Cancellation reason codes and possible error messages:</p>
373    /// <ul>
374    /// <li>
375    /// <p>No Errors:</p>
376    /// <ul>
377    /// <li>
378    /// <p>Code: <code>None</code></p></li>
379    /// <li>
380    /// <p>Message: <code>null</code></p></li>
381    /// </ul></li>
382    /// <li>
383    /// <p>Conditional Check Failed:</p>
384    /// <ul>
385    /// <li>
386    /// <p>Code: <code>ConditionalCheckFailed</code></p></li>
387    /// <li>
388    /// <p>Message: The conditional request failed.</p></li>
389    /// </ul></li>
390    /// <li>
391    /// <p>Item Collection Size Limit Exceeded:</p>
392    /// <ul>
393    /// <li>
394    /// <p>Code: <code>ItemCollectionSizeLimitExceeded</code></p></li>
395    /// <li>
396    /// <p>Message: Collection size exceeded.</p></li>
397    /// </ul></li>
398    /// <li>
399    /// <p>Transaction Conflict:</p>
400    /// <ul>
401    /// <li>
402    /// <p>Code: <code>TransactionConflict</code></p></li>
403    /// <li>
404    /// <p>Message: Transaction is ongoing for the item.</p></li>
405    /// </ul></li>
406    /// <li>
407    /// <p>Provisioned Throughput Exceeded:</p>
408    /// <ul>
409    /// <li>
410    /// <p>Code: <code>ProvisionedThroughputExceeded</code></p></li>
411    /// <li>
412    /// <p>Messages:</p>
413    /// <ul>
414    /// <li>
415    /// <p>The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API.</p><note>
416    /// <p>This Message is received when provisioned throughput is exceeded is on a provisioned DynamoDB table.</p>
417    /// </note></li>
418    /// <li>
419    /// <p>The level of configured provisioned throughput for one or more global secondary indexes of the table was exceeded. Consider increasing your provisioning level for the under-provisioned global secondary indexes with the UpdateTable API.</p><note>
420    /// <p>This message is returned when provisioned throughput is exceeded is on a provisioned GSI.</p>
421    /// </note></li>
422    /// </ul></li>
423    /// </ul></li>
424    /// <li>
425    /// <p>Throttling Error:</p>
426    /// <ul>
427    /// <li>
428    /// <p>Code: <code>ThrottlingError</code></p></li>
429    /// <li>
430    /// <p>Messages:</p>
431    /// <ul>
432    /// <li>
433    /// <p>Throughput exceeds the current capacity of your table or index. DynamoDB is automatically scaling your table or index so please try again shortly. If exceptions persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.</p><note>
434    /// <p>This message is returned when writes get throttled on an On-Demand table as DynamoDB is automatically scaling the table.</p>
435    /// </note></li>
436    /// <li>
437    /// <p>Throughput exceeds the current capacity for one or more global secondary indexes. DynamoDB is automatically scaling your index so please try again shortly.</p><note>
438    /// <p>This message is returned when writes get throttled on an On-Demand GSI as DynamoDB is automatically scaling the GSI.</p>
439    /// </note></li>
440    /// </ul></li>
441    /// </ul></li>
442    /// <li>
443    /// <p>Validation Error:</p>
444    /// <ul>
445    /// <li>
446    /// <p>Code: <code>ValidationError</code></p></li>
447    /// <li>
448    /// <p>Messages:</p>
449    /// <ul>
450    /// <li>
451    /// <p>One or more parameter values were invalid.</p></li>
452    /// <li>
453    /// <p>The update expression attempted to update the secondary index key beyond allowed size limits.</p></li>
454    /// <li>
455    /// <p>The update expression attempted to update the secondary index key to unsupported type.</p></li>
456    /// <li>
457    /// <p>An operand in the update expression has an incorrect data type.</p></li>
458    /// <li>
459    /// <p>Item size to update has exceeded the maximum allowed size.</p></li>
460    /// <li>
461    /// <p>Number overflow. Attempting to store a number with magnitude larger than supported range.</p></li>
462    /// <li>
463    /// <p>Type mismatch for attribute to update.</p></li>
464    /// <li>
465    /// <p>Nesting Levels have exceeded supported limits.</p></li>
466    /// <li>
467    /// <p>The document path provided in the update expression is invalid for update.</p></li>
468    /// <li>
469    /// <p>The provided expression refers to an attribute that does not exist in the item.</p></li>
470    /// </ul></li>
471    /// </ul></li>
472    /// </ul>
473    TransactionCanceledException(crate::types::error::TransactionCanceledException),
474    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
475                    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
476    variable wildcard pattern and check `.code()`:
477     \
478    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
479     \
480    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-TransactGetItemsError) for what information is available for the error.")]
481                    Unhandled(crate::error::sealed_unhandled::Unhandled),
482}
483impl TransactGetItemsError {
484    /// Creates the `TransactGetItemsError::Unhandled` variant from any error type.
485                    pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
486                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
487                    }
488    
489                    /// Creates the `TransactGetItemsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
490                    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
491                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
492                    }
493    /// 
494    /// Returns error metadata, which includes the error code, message,
495    /// request ID, and potentially additional information.
496    /// 
497    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
498        match self {
499            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
500            Self::InvalidEndpointException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
501            Self::ProvisionedThroughputExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
502            Self::RequestLimitExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
503            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
504            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
505            Self::TransactionCanceledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
506            Self::Unhandled(e) => &e.meta,
507        }
508    }
509    /// Returns `true` if the error kind is `TransactGetItemsError::InternalServerError`.
510    pub fn is_internal_server_error(&self) -> bool {
511        matches!(self, Self::InternalServerError(_))
512    }
513    /// Returns `true` if the error kind is `TransactGetItemsError::InvalidEndpointException`.
514    pub fn is_invalid_endpoint_exception(&self) -> bool {
515        matches!(self, Self::InvalidEndpointException(_))
516    }
517    /// Returns `true` if the error kind is `TransactGetItemsError::ProvisionedThroughputExceededException`.
518    pub fn is_provisioned_throughput_exceeded_exception(&self) -> bool {
519        matches!(self, Self::ProvisionedThroughputExceededException(_))
520    }
521    /// Returns `true` if the error kind is `TransactGetItemsError::RequestLimitExceeded`.
522    pub fn is_request_limit_exceeded(&self) -> bool {
523        matches!(self, Self::RequestLimitExceeded(_))
524    }
525    /// Returns `true` if the error kind is `TransactGetItemsError::ResourceNotFoundException`.
526    pub fn is_resource_not_found_exception(&self) -> bool {
527        matches!(self, Self::ResourceNotFoundException(_))
528    }
529    /// Returns `true` if the error kind is `TransactGetItemsError::ThrottlingException`.
530    pub fn is_throttling_exception(&self) -> bool {
531        matches!(self, Self::ThrottlingException(_))
532    }
533    /// Returns `true` if the error kind is `TransactGetItemsError::TransactionCanceledException`.
534    pub fn is_transaction_canceled_exception(&self) -> bool {
535        matches!(self, Self::TransactionCanceledException(_))
536    }
537}
538impl ::std::error::Error for TransactGetItemsError {
539    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
540        match self {
541            Self::InternalServerError(_inner) =>
542            ::std::option::Option::Some(_inner)
543            ,
544            Self::InvalidEndpointException(_inner) =>
545            ::std::option::Option::Some(_inner)
546            ,
547            Self::ProvisionedThroughputExceededException(_inner) =>
548            ::std::option::Option::Some(_inner)
549            ,
550            Self::RequestLimitExceeded(_inner) =>
551            ::std::option::Option::Some(_inner)
552            ,
553            Self::ResourceNotFoundException(_inner) =>
554            ::std::option::Option::Some(_inner)
555            ,
556            Self::ThrottlingException(_inner) =>
557            ::std::option::Option::Some(_inner)
558            ,
559            Self::TransactionCanceledException(_inner) =>
560            ::std::option::Option::Some(_inner)
561            ,
562            Self::Unhandled(_inner) => {
563                ::std::option::Option::Some(&*_inner.source)
564            }
565        }
566    }
567}
568impl ::std::fmt::Display for TransactGetItemsError {
569    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
570        match self {
571            Self::InternalServerError(_inner) =>
572            _inner.fmt(f)
573            ,
574            Self::InvalidEndpointException(_inner) =>
575            _inner.fmt(f)
576            ,
577            Self::ProvisionedThroughputExceededException(_inner) =>
578            _inner.fmt(f)
579            ,
580            Self::RequestLimitExceeded(_inner) =>
581            _inner.fmt(f)
582            ,
583            Self::ResourceNotFoundException(_inner) =>
584            _inner.fmt(f)
585            ,
586            Self::ThrottlingException(_inner) =>
587            _inner.fmt(f)
588            ,
589            Self::TransactionCanceledException(_inner) =>
590            _inner.fmt(f)
591            ,
592            Self::Unhandled(_inner) => {
593                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
594                                                        write!(f, "unhandled error ({code})")
595                                                    } else {
596                                                        f.write_str("unhandled error")
597                                                    }
598            }
599        }
600    }
601}
602impl ::aws_smithy_types::retry::ProvideErrorKind for TransactGetItemsError {
603    fn code(&self) -> ::std::option::Option<&str> {
604        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
605    }
606    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
607        ::std::option::Option::None
608    }
609}
610impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TransactGetItemsError {
611    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
612        match self {
613            Self::InternalServerError(_inner) =>
614            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
615            ,
616            Self::InvalidEndpointException(_inner) =>
617            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
618            ,
619            Self::ProvisionedThroughputExceededException(_inner) =>
620            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
621            ,
622            Self::RequestLimitExceeded(_inner) =>
623            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
624            ,
625            Self::ResourceNotFoundException(_inner) =>
626            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
627            ,
628            Self::ThrottlingException(_inner) =>
629            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
630            ,
631            Self::TransactionCanceledException(_inner) =>
632            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
633            ,
634            Self::Unhandled(_inner) => {
635                &_inner.meta
636            }
637        }
638    }
639}
640impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for TransactGetItemsError {
641    fn create_unhandled_error(
642                        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
643                        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
644                    ) -> Self {
645        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
646    }
647}
648impl ::aws_types::request_id::RequestId for crate::operation::transact_get_items::TransactGetItemsError {
649                                fn request_id(&self) -> Option<&str> {
650                                    self.meta().request_id()
651                                }
652                            }
653
654pub use crate::operation::transact_get_items::_transact_get_items_input::TransactGetItemsInput;
655
656pub use crate::operation::transact_get_items::_transact_get_items_output::TransactGetItemsOutput;
657
658mod _transact_get_items_input;
659
660mod _transact_get_items_output;
661
662/// Builders
663pub mod builders;
664