1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct TransactWriteItems;
6impl TransactWriteItems {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::transact_write_items::TransactWriteItemsInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::transact_write_items::TransactWriteItemsOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::transact_write_items::TransactWriteItemsInput,
18 ) -> ::std::result::Result<crate::operation::transact_write_items::TransactWriteItemsOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::transact_write_items::TransactWriteItemsError, ::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_write_items::TransactWriteItemsError>().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_write_items::TransactWriteItemsOutput>().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_write_items::TransactWriteItemsInput,
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 "TransactWriteItems",
41 input,
42 runtime_plugins,
43 stop_point
44 )
45 .instrument(::tracing::debug_span!(
48 "DynamoDB.TransactWriteItems",
49 "rpc.service" = "DynamoDB",
50 "rpc.method" = "TransactWriteItems",
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 runtime_plugins = runtime_plugins
64 .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(|token_provider, input| {
65 let input: &mut crate::operation::transact_write_items::TransactWriteItemsInput = input.downcast_mut().expect("correct type");
66 if input.client_request_token.is_none() {
67 input.client_request_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
68 }
69 }));
70 if let ::std::option::Option::Some(config_override) = config_override {
71 for plugin in config_override.runtime_plugins.iter().cloned() {
72 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
73 }
74 runtime_plugins = runtime_plugins.with_operation_plugin(
75 crate::config::ConfigOverrideRuntimePlugin::new(config_override, client_config.config.clone(), &client_config.runtime_components)
76 );
77 }
78 runtime_plugins
79 }
80}
81impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for TransactWriteItems {
82 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
83 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("TransactWriteItems");
84
85 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(TransactWriteItemsRequestSerializer));
86 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(TransactWriteItemsResponseDeserializer));
87
88 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
89 crate::config::auth::Params::builder()
90 .operation_name("TransactWriteItems")
91 .build()
92 .expect("required fields set")
93 ));
94
95 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
96 "TransactWriteItems",
97 "DynamoDB",
98 ));
99let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
100 signing_options.double_uri_encode = true;
101 signing_options.content_sha256_header = false;
102 signing_options.normalize_uri_path = true;
103 signing_options.payload_override = None;
104
105 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
106 signing_options,
107 ..::std::default::Default::default()
108 });
109
110 ::std::option::Option::Some(cfg.freeze())
111 }
112
113 fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
114 #[allow(unused_mut)]
115 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("TransactWriteItems")
116 .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
117.with_interceptor(TransactWriteItemsEndpointParamsInterceptor)
118 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::transact_write_items::TransactWriteItemsError>::new())
119.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::transact_write_items::TransactWriteItemsError>::new())
120.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::transact_write_items::TransactWriteItemsError>::new());
121
122 ::std::borrow::Cow::Owned(rcb)
123 }
124 }
125
126
127#[derive(Debug)]
128 struct TransactWriteItemsResponseDeserializer;
129 impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TransactWriteItemsResponseDeserializer {
130
131
132 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 {
133 let (success, status) = (response.status().is_success(), response.status().as_u16());
134 #[allow(unused_mut)]
135 let mut force_error = false;
136 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
137 if !success && status != 200 || force_error {
138 let headers = response.headers();
139 let body = response.body().bytes().expect("body loaded");
140#[allow(unused_mut)]
141 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body)
142 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
143 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
144 let generic = generic_builder.build();
145let error_code = match generic.code() {
146 ::std::option::Option::Some(code) => code,
147 ::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_write_items::TransactWriteItemsError::unhandled(generic)))),
148 };
149 let _error_message = generic.message().map(|msg| msg.to_owned());
150 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
151 .expect("a SharedClientProtocol is required");
152let err = match error_code {
153"IdempotentParameterMismatchException" => crate::operation::transact_write_items::TransactWriteItemsError::IdempotentParameterMismatchException({
154let mut tmp = match protocol.deserialize_response(response, crate::types::error::IdempotentParameterMismatchException::SCHEMA, _cfg)
155 .and_then(|mut deser| crate::types::error::IdempotentParameterMismatchException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
156 {
157 ::std::result::Result::Ok(val) => val,
158 ::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))),
159 };
160 tmp.meta = generic;
161if tmp.message.is_none() {
162 tmp.message = _error_message;
163 }
164tmp
165}),
166"InternalServerError" => crate::operation::transact_write_items::TransactWriteItemsError::InternalServerError({
167let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
168 .and_then(|mut deser| crate::types::error::InternalServerError::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
169 {
170 ::std::result::Result::Ok(val) => val,
171 ::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))),
172 };
173 tmp.meta = generic;
174if tmp.message.is_none() {
175 tmp.message = _error_message;
176 }
177tmp
178}),
179"InvalidEndpointException" => crate::operation::transact_write_items::TransactWriteItemsError::InvalidEndpointException({
180let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidEndpointException::SCHEMA, _cfg)
181 .and_then(|mut deser| crate::types::error::InvalidEndpointException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
182 {
183 ::std::result::Result::Ok(val) => val,
184 ::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))),
185 };
186 tmp.meta = generic;
187if tmp.message.is_none() {
188 tmp.message = _error_message;
189 }
190tmp
191}),
192"ProvisionedThroughputExceededException" => crate::operation::transact_write_items::TransactWriteItemsError::ProvisionedThroughputExceededException({
193let mut tmp = match protocol.deserialize_response(response, crate::types::error::ProvisionedThroughputExceededException::SCHEMA, _cfg)
194 .and_then(|mut deser| crate::types::error::ProvisionedThroughputExceededException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
195 {
196 ::std::result::Result::Ok(val) => val,
197 ::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))),
198 };
199 tmp.meta = generic;
200if tmp.message.is_none() {
201 tmp.message = _error_message;
202 }
203tmp
204}),
205"RequestLimitExceeded" => crate::operation::transact_write_items::TransactWriteItemsError::RequestLimitExceeded({
206let mut tmp = match protocol.deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
207 .and_then(|mut deser| crate::types::error::RequestLimitExceeded::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
208 {
209 ::std::result::Result::Ok(val) => val,
210 ::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))),
211 };
212 tmp.meta = generic;
213if tmp.message.is_none() {
214 tmp.message = _error_message;
215 }
216tmp
217}),
218"ResourceNotFoundException" => crate::operation::transact_write_items::TransactWriteItemsError::ResourceNotFoundException({
219let mut tmp = match protocol.deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
220 .and_then(|mut deser| crate::types::error::ResourceNotFoundException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
221 {
222 ::std::result::Result::Ok(val) => val,
223 ::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))),
224 };
225 tmp.meta = generic;
226if tmp.message.is_none() {
227 tmp.message = _error_message;
228 }
229tmp
230}),
231"ThrottlingException" => crate::operation::transact_write_items::TransactWriteItemsError::ThrottlingException({
232let mut tmp = match protocol.deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
233 .and_then(|mut deser| crate::types::error::ThrottlingException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
234 {
235 ::std::result::Result::Ok(val) => val,
236 ::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))),
237 };
238 tmp.meta = generic;
239if tmp.message.is_none() {
240 tmp.message = _error_message;
241 }
242tmp
243}),
244"TransactionCanceledException" => crate::operation::transact_write_items::TransactWriteItemsError::TransactionCanceledException({
245let mut tmp = match protocol.deserialize_response(response, crate::types::error::TransactionCanceledException::SCHEMA, _cfg)
246 .and_then(|mut deser| crate::types::error::TransactionCanceledException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
247 {
248 ::std::result::Result::Ok(val) => val,
249 ::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))),
250 };
251 tmp.meta = generic;
252if tmp.message.is_none() {
253 tmp.message = _error_message;
254 }
255tmp
256}),
257"TransactionInProgressException" => crate::operation::transact_write_items::TransactWriteItemsError::TransactionInProgressException({
258let mut tmp = match protocol.deserialize_response(response, crate::types::error::TransactionInProgressException::SCHEMA, _cfg)
259 .and_then(|mut deser| crate::types::error::TransactionInProgressException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
260 {
261 ::std::result::Result::Ok(val) => val,
262 ::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))),
263 };
264 tmp.meta = generic;
265if tmp.message.is_none() {
266 tmp.message = _error_message;
267 }
268tmp
269}),
270_ => crate::operation::transact_write_items::TransactWriteItemsError::generic(generic)
271};
272 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
273} else {
274 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
275 .expect("a SharedClientProtocol is required");
276 let mut deser = protocol.deserialize_response(response, TransactWriteItems::OUTPUT_SCHEMA, _cfg)
277 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
278 let body = response.body().bytes().expect("body loaded");
279 let output = crate::operation::transact_write_items::TransactWriteItemsOutput::deserialize_with_response(
280 &mut *deser,
281 response.headers(),
282 response.status().into(),
283 body,
284 ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
285 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
286 }
287 }
288 }
289#[derive(Debug)]
290 struct TransactWriteItemsRequestSerializer;
291 impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TransactWriteItemsRequestSerializer {
292 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
293 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> {
294 let input = input.downcast::<crate::operation::transact_write_items::TransactWriteItemsInput>().expect("correct type");
295 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
296 .expect("a SharedClientProtocol is required");
297 let mut request = protocol.serialize_request(
298 &input, TransactWriteItems::INPUT_SCHEMA, "", _cfg,
299 ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
300
301 return ::std::result::Result::Ok(request);
302 }
303 }
304#[derive(Debug)]
305 struct TransactWriteItemsEndpointParamsInterceptor;
306
307 impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TransactWriteItemsEndpointParamsInterceptor {
308 fn name(&self) -> &'static str {
309 "TransactWriteItemsEndpointParamsInterceptor"
310 }
311
312 fn read_before_execution(
313 &self,
314 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>,
315 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
316 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
317 let _input = context.input()
318 .downcast_ref::<TransactWriteItemsInput>()
319 .ok_or("failed to downcast to TransactWriteItemsInput")?;
320
321
322
323 let params = crate::config::endpoint::Params::builder()
324 .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
325.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
326.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
327.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
328.set_account_id_endpoint_mode(::std::option::Option::Some(cfg.load::<::aws_types::endpoint_config::AccountIdEndpointMode>().cloned().unwrap_or_default().to_string()))
329.set_resource_arn_list(get_resource_arn_list(_input).map(|v| v.into_iter().cloned().collect::<Vec<_>>()))
330 .build()
331 .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
332 cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
333 ::std::result::Result::Ok(())
334 }
335 }
336
337 fn get_resource_arn_list(input: &crate::operation::transact_write_items::TransactWriteItemsInput) -> Option<::std::vec::Vec::<&::std::string::String>> {
342 let _fld_1 = input.transact_items.as_ref()?;
343 let _prj_11 = _fld_1.iter()
344 .flat_map(|v| {
345 #[allow(clippy::let_and_return)]
346 fn map(_v: &crate::types::TransactWriteItem) -> ::std::option::Option<::std::vec::Vec::<::std::option::Option<&::std::string::String>>> {
347 let _fld_2 = _v.condition_check.as_ref();
348 let _fld_3 = _fld_2.map(|v| &v.table_name);
349 let _fld_4 = _v.put.as_ref();
350 let _fld_5 = _fld_4.map(|v| &v.table_name);
351 let _fld_6 = _v.delete.as_ref();
352 let _fld_7 = _fld_6.map(|v| &v.table_name);
353 let _fld_8 = _v.update.as_ref();
354 let _fld_9 = _fld_8.map(|v| &v.table_name);
355 let _msl_10 = vec![_fld_3, _fld_5, _fld_7, _fld_9];
356 ::std::option::Option::Some(_msl_10)
357 }
358 map(v)
359 })
360 .flatten()
361 .flatten()
362 .collect::<::std::vec::Vec<_>>();
363 Some(_prj_11)
364}
365
366#[non_exhaustive]
368#[derive(::std::fmt::Debug)]
369pub enum TransactWriteItemsError {
370 IdempotentParameterMismatchException(crate::types::error::IdempotentParameterMismatchException),
372 InternalServerError(crate::types::error::InternalServerError),
374 #[allow(missing_docs)] InvalidEndpointException(crate::types::error::InvalidEndpointException),
376 ProvisionedThroughputExceededException(crate::types::error::ProvisionedThroughputExceededException),
378 RequestLimitExceeded(crate::types::error::RequestLimitExceeded),
380 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
382 ThrottlingException(crate::types::error::ThrottlingException),
384 TransactionCanceledException(crate::types::error::TransactionCanceledException),
517 TransactionInProgressException(crate::types::error::TransactionInProgressException),
550 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
552 variable wildcard pattern and check `.code()`:
553 \
554 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
555 \
556 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-TransactWriteItemsError) for what information is available for the error.")]
557 Unhandled(crate::error::sealed_unhandled::Unhandled),
558}
559impl TransactWriteItemsError {
560 pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
562 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
563 }
564
565 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
567 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
568 }
569 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
574 match self {
575 Self::IdempotentParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
576 Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
577 Self::InvalidEndpointException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
578 Self::ProvisionedThroughputExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
579 Self::RequestLimitExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
580 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
581 Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
582 Self::TransactionCanceledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
583 Self::TransactionInProgressException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
584 Self::Unhandled(e) => &e.meta,
585 }
586 }
587 pub fn is_idempotent_parameter_mismatch_exception(&self) -> bool {
589 matches!(self, Self::IdempotentParameterMismatchException(_))
590 }
591 pub fn is_internal_server_error(&self) -> bool {
593 matches!(self, Self::InternalServerError(_))
594 }
595 pub fn is_invalid_endpoint_exception(&self) -> bool {
597 matches!(self, Self::InvalidEndpointException(_))
598 }
599 pub fn is_provisioned_throughput_exceeded_exception(&self) -> bool {
601 matches!(self, Self::ProvisionedThroughputExceededException(_))
602 }
603 pub fn is_request_limit_exceeded(&self) -> bool {
605 matches!(self, Self::RequestLimitExceeded(_))
606 }
607 pub fn is_resource_not_found_exception(&self) -> bool {
609 matches!(self, Self::ResourceNotFoundException(_))
610 }
611 pub fn is_throttling_exception(&self) -> bool {
613 matches!(self, Self::ThrottlingException(_))
614 }
615 pub fn is_transaction_canceled_exception(&self) -> bool {
617 matches!(self, Self::TransactionCanceledException(_))
618 }
619 pub fn is_transaction_in_progress_exception(&self) -> bool {
621 matches!(self, Self::TransactionInProgressException(_))
622 }
623}
624impl ::std::error::Error for TransactWriteItemsError {
625 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
626 match self {
627 Self::IdempotentParameterMismatchException(_inner) =>
628 ::std::option::Option::Some(_inner)
629 ,
630 Self::InternalServerError(_inner) =>
631 ::std::option::Option::Some(_inner)
632 ,
633 Self::InvalidEndpointException(_inner) =>
634 ::std::option::Option::Some(_inner)
635 ,
636 Self::ProvisionedThroughputExceededException(_inner) =>
637 ::std::option::Option::Some(_inner)
638 ,
639 Self::RequestLimitExceeded(_inner) =>
640 ::std::option::Option::Some(_inner)
641 ,
642 Self::ResourceNotFoundException(_inner) =>
643 ::std::option::Option::Some(_inner)
644 ,
645 Self::ThrottlingException(_inner) =>
646 ::std::option::Option::Some(_inner)
647 ,
648 Self::TransactionCanceledException(_inner) =>
649 ::std::option::Option::Some(_inner)
650 ,
651 Self::TransactionInProgressException(_inner) =>
652 ::std::option::Option::Some(_inner)
653 ,
654 Self::Unhandled(_inner) => {
655 ::std::option::Option::Some(&*_inner.source)
656 }
657 }
658 }
659}
660impl ::std::fmt::Display for TransactWriteItemsError {
661 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
662 match self {
663 Self::IdempotentParameterMismatchException(_inner) =>
664 _inner.fmt(f)
665 ,
666 Self::InternalServerError(_inner) =>
667 _inner.fmt(f)
668 ,
669 Self::InvalidEndpointException(_inner) =>
670 _inner.fmt(f)
671 ,
672 Self::ProvisionedThroughputExceededException(_inner) =>
673 _inner.fmt(f)
674 ,
675 Self::RequestLimitExceeded(_inner) =>
676 _inner.fmt(f)
677 ,
678 Self::ResourceNotFoundException(_inner) =>
679 _inner.fmt(f)
680 ,
681 Self::ThrottlingException(_inner) =>
682 _inner.fmt(f)
683 ,
684 Self::TransactionCanceledException(_inner) =>
685 _inner.fmt(f)
686 ,
687 Self::TransactionInProgressException(_inner) =>
688 _inner.fmt(f)
689 ,
690 Self::Unhandled(_inner) => {
691 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
692 write!(f, "unhandled error ({code})")
693 } else {
694 f.write_str("unhandled error")
695 }
696 }
697 }
698 }
699}
700impl ::aws_smithy_types::retry::ProvideErrorKind for TransactWriteItemsError {
701 fn code(&self) -> ::std::option::Option<&str> {
702 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
703 }
704 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
705 ::std::option::Option::None
706 }
707}
708impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TransactWriteItemsError {
709 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
710 match self {
711 Self::IdempotentParameterMismatchException(_inner) =>
712 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
713 ,
714 Self::InternalServerError(_inner) =>
715 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
716 ,
717 Self::InvalidEndpointException(_inner) =>
718 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
719 ,
720 Self::ProvisionedThroughputExceededException(_inner) =>
721 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
722 ,
723 Self::RequestLimitExceeded(_inner) =>
724 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
725 ,
726 Self::ResourceNotFoundException(_inner) =>
727 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
728 ,
729 Self::ThrottlingException(_inner) =>
730 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
731 ,
732 Self::TransactionCanceledException(_inner) =>
733 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
734 ,
735 Self::TransactionInProgressException(_inner) =>
736 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
737 ,
738 Self::Unhandled(_inner) => {
739 &_inner.meta
740 }
741 }
742 }
743}
744impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for TransactWriteItemsError {
745 fn create_unhandled_error(
746 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
747 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
748 ) -> Self {
749 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
750 }
751}
752impl ::aws_types::request_id::RequestId for crate::operation::transact_write_items::TransactWriteItemsError {
753 fn request_id(&self) -> Option<&str> {
754 self.meta().request_id()
755 }
756 }
757
758pub use crate::operation::transact_write_items::_transact_write_items_input::TransactWriteItemsInput;
759
760pub use crate::operation::transact_write_items::_transact_write_items_output::TransactWriteItemsOutput;
761
762mod _transact_write_items_input;
763
764mod _transact_write_items_output;
765
766pub mod builders;
768