138 142 | crate::operation::transact_get_items::TransactGetItemsError,
|
139 143 | >::new());
|
140 144 |
|
141 145 | ::std::borrow::Cow::Owned(rcb)
|
142 146 | }
|
143 147 | }
|
144 148 |
|
145 149 | #[derive(Debug)]
|
146 150 | struct TransactGetItemsResponseDeserializer;
|
147 151 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TransactGetItemsResponseDeserializer {
|
148 - | fn deserialize_nonstreaming(
|
152 + | fn deserialize_nonstreaming_with_config(
|
149 153 | &self,
|
150 154 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
155 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
151 156 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
152 157 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
153 - | let headers = response.headers();
|
154 - | let body = response.body().bytes().expect("body loaded");
|
155 158 | #[allow(unused_mut)]
|
156 159 | let mut force_error = false;
|
157 160 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
158 - | let parse_result = if !success && status != 200 || force_error {
|
159 - | crate::protocol_serde::shape_transact_get_items::de_transact_get_items_http_error(status, headers, body)
|
161 + | if !success && status != 200 || force_error {
|
162 + | let headers = response.headers();
|
163 + | let body = response.body().bytes().expect("body loaded");
|
164 + | #[allow(unused_mut)]
|
165 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
166 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
167 + | })?;
|
168 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
169 + | let generic = generic_builder.build();
|
170 + | let error_code = match generic.code() {
|
171 + | ::std::option::Option::Some(code) => code,
|
172 + | ::std::option::Option::None => {
|
173 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
174 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::transact_get_items::TransactGetItemsError::unhandled(
|
175 + | generic,
|
176 + | )),
|
177 + | ))
|
178 + | }
|
179 + | };
|
180 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
181 + | let protocol = _cfg
|
182 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
183 + | .expect("a SharedClientProtocol is required");
|
184 + | let err = match error_code {
|
185 + | "InternalServerError" => crate::operation::transact_get_items::TransactGetItemsError::InternalServerError({
|
186 + | let mut tmp = match protocol
|
187 + | .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
|
188 + | .and_then(|mut deser| {
|
189 + | crate::types::error::InternalServerError::deserialize_with_response(
|
190 + | &mut *deser,
|
191 + | response.headers(),
|
192 + | response.status().into(),
|
193 + | body,
|
194 + | )
|
195 + | }) {
|
196 + | ::std::result::Result::Ok(val) => val,
|
197 + | ::std::result::Result::Err(e) => {
|
198 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
199 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
200 + | ))
|
201 + | }
|
202 + | };
|
203 + | tmp.meta = generic;
|
204 + | if tmp.message.is_none() {
|
205 + | tmp.message = _error_message;
|
206 + | }
|
207 + | tmp
|
208 + | }),
|
209 + | "InvalidEndpointException" => crate::operation::transact_get_items::TransactGetItemsError::InvalidEndpointException({
|
210 + | let mut tmp = match protocol
|
211 + | .deserialize_response(response, crate::types::error::InvalidEndpointException::SCHEMA, _cfg)
|
212 + | .and_then(|mut deser| {
|
213 + | crate::types::error::InvalidEndpointException::deserialize_with_response(
|
214 + | &mut *deser,
|
215 + | response.headers(),
|
216 + | response.status().into(),
|
217 + | body,
|
218 + | )
|
219 + | }) {
|
220 + | ::std::result::Result::Ok(val) => val,
|
221 + | ::std::result::Result::Err(e) => {
|
222 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
223 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
224 + | ))
|
225 + | }
|
226 + | };
|
227 + | tmp.meta = generic;
|
228 + | if tmp.message.is_none() {
|
229 + | tmp.message = _error_message;
|
230 + | }
|
231 + | tmp
|
232 + | }),
|
233 + | "ProvisionedThroughputExceededException" => {
|
234 + | crate::operation::transact_get_items::TransactGetItemsError::ProvisionedThroughputExceededException({
|
235 + | let mut tmp = match protocol
|
236 + | .deserialize_response(response, crate::types::error::ProvisionedThroughputExceededException::SCHEMA, _cfg)
|
237 + | .and_then(|mut deser| {
|
238 + | crate::types::error::ProvisionedThroughputExceededException::deserialize_with_response(
|
239 + | &mut *deser,
|
240 + | response.headers(),
|
241 + | response.status().into(),
|
242 + | body,
|
243 + | )
|
244 + | }) {
|
245 + | ::std::result::Result::Ok(val) => val,
|
246 + | ::std::result::Result::Err(e) => {
|
247 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
248 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
249 + | ))
|
250 + | }
|
251 + | };
|
252 + | tmp.meta = generic;
|
253 + | if tmp.message.is_none() {
|
254 + | tmp.message = _error_message;
|
255 + | }
|
256 + | tmp
|
257 + | })
|
258 + | }
|
259 + | "RequestLimitExceeded" => crate::operation::transact_get_items::TransactGetItemsError::RequestLimitExceeded({
|
260 + | let mut tmp = match protocol
|
261 + | .deserialize_response(response, crate::types::error::RequestLimitExceeded::SCHEMA, _cfg)
|
262 + | .and_then(|mut deser| {
|
263 + | crate::types::error::RequestLimitExceeded::deserialize_with_response(
|
264 + | &mut *deser,
|
265 + | response.headers(),
|
266 + | response.status().into(),
|
267 + | body,
|
268 + | )
|
269 + | }) {
|
270 + | ::std::result::Result::Ok(val) => val,
|
271 + | ::std::result::Result::Err(e) => {
|
272 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
273 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
274 + | ))
|
275 + | }
|
276 + | };
|
277 + | tmp.meta = generic;
|
278 + | if tmp.message.is_none() {
|
279 + | tmp.message = _error_message;
|
280 + | }
|
281 + | tmp
|
282 + | }),
|
283 + | "ResourceNotFoundException" => crate::operation::transact_get_items::TransactGetItemsError::ResourceNotFoundException({
|
284 + | let mut tmp = match protocol
|
285 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
286 + | .and_then(|mut deser| {
|
287 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
288 + | &mut *deser,
|
289 + | response.headers(),
|
290 + | response.status().into(),
|
291 + | body,
|
292 + | )
|
293 + | }) {
|
294 + | ::std::result::Result::Ok(val) => val,
|
295 + | ::std::result::Result::Err(e) => {
|
296 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
297 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
298 + | ))
|
299 + | }
|
300 + | };
|
301 + | tmp.meta = generic;
|
302 + | if tmp.message.is_none() {
|
303 + | tmp.message = _error_message;
|
304 + | }
|
305 + | tmp
|
306 + | }),
|
307 + | "ThrottlingException" => crate::operation::transact_get_items::TransactGetItemsError::ThrottlingException({
|
308 + | let mut tmp = match protocol
|
309 + | .deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
|
310 + | .and_then(|mut deser| {
|
311 + | crate::types::error::ThrottlingException::deserialize_with_response(
|
312 + | &mut *deser,
|
313 + | response.headers(),
|
314 + | response.status().into(),
|
315 + | body,
|
316 + | )
|
317 + | }) {
|
318 + | ::std::result::Result::Ok(val) => val,
|
319 + | ::std::result::Result::Err(e) => {
|
320 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
321 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
322 + | ))
|
323 + | }
|
324 + | };
|
325 + | tmp.meta = generic;
|
326 + | if tmp.message.is_none() {
|
327 + | tmp.message = _error_message;
|
328 + | }
|
329 + | tmp
|
330 + | }),
|
331 + | "TransactionCanceledException" => crate::operation::transact_get_items::TransactGetItemsError::TransactionCanceledException({
|
332 + | let mut tmp = match protocol
|
333 + | .deserialize_response(response, crate::types::error::TransactionCanceledException::SCHEMA, _cfg)
|
334 + | .and_then(|mut deser| {
|
335 + | crate::types::error::TransactionCanceledException::deserialize_with_response(
|
336 + | &mut *deser,
|
337 + | response.headers(),
|
338 + | response.status().into(),
|
339 + | body,
|
340 + | )
|
341 + | }) {
|
342 + | ::std::result::Result::Ok(val) => val,
|
343 + | ::std::result::Result::Err(e) => {
|
344 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
345 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
346 + | ))
|
347 + | }
|
348 + | };
|
349 + | tmp.meta = generic;
|
350 + | if tmp.message.is_none() {
|
351 + | tmp.message = _error_message;
|
352 + | }
|
353 + | tmp
|
354 + | }),
|
355 + | _ => crate::operation::transact_get_items::TransactGetItemsError::generic(generic),
|
356 + | };
|
357 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
358 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
359 + | ))
|
160 360 | } else {
|
161 - | crate::protocol_serde::shape_transact_get_items::de_transact_get_items_http_response(status, headers, body)
|
162 - | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
361 + | let protocol = _cfg
|
362 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
363 + | .expect("a SharedClientProtocol is required");
|
364 + | let mut deser = protocol
|
365 + | .deserialize_response(response, TransactGetItems::OUTPUT_SCHEMA, _cfg)
|
366 + | .map_err(|e| {
|
367 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
368 + | })?;
|
369 + | let body = response.body().bytes().expect("body loaded");
|
370 + | let output = crate::operation::transact_get_items::TransactGetItemsOutput::deserialize_with_response(
|
371 + | &mut *deser,
|
372 + | response.headers(),
|
373 + | response.status().into(),
|
374 + | body,
|
375 + | )
|
376 + | .map_err(|e| {
|
377 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
378 + | })?;
|
379 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
380 + | }
|
164 381 | }
|
165 382 | }
|
166 383 | #[derive(Debug)]
|
167 384 | struct TransactGetItemsRequestSerializer;
|
168 385 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TransactGetItemsRequestSerializer {
|
169 386 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 387 | fn serialize_input(
|
171 388 | &self,
|
172 389 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 390 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 391 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 392 | let input = input
|
176 393 | .downcast::<crate::operation::transact_get_items::TransactGetItemsInput>()
|
177 394 | .expect("correct type");
|
178 - | let _header_serialization_settings = _cfg
|
179 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
180 - | .cloned()
|
181 - | .unwrap_or_default();
|
182 - | let mut request_builder = {
|
183 - | #[allow(clippy::uninlined_format_args)]
|
184 - | fn uri_base(
|
185 - | _input: &crate::operation::transact_get_items::TransactGetItemsInput,
|
186 - | output: &mut ::std::string::String,
|
187 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
188 - | use ::std::fmt::Write as _;
|
189 - | ::std::write!(output, "/").expect("formatting should succeed");
|
190 - | ::std::result::Result::Ok(())
|
191 - | }
|
192 - | #[allow(clippy::unnecessary_wraps)]
|
193 - | fn update_http_builder(
|
194 - | input: &crate::operation::transact_get_items::TransactGetItemsInput,
|
195 - | builder: ::http_1x::request::Builder,
|
196 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
197 - | let mut uri = ::std::string::String::new();
|
198 - | uri_base(input, &mut uri)?;
|
199 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
200 - | }
|
201 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
202 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
203 - | builder = _header_serialization_settings.set_default_header(
|
204 - | builder,
|
205 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
206 - | "DynamoDB_20120810.TransactGetItems",
|
207 - | );
|
208 - | builder
|
209 - | };
|
210 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_transact_get_items::ser_transact_get_items_input(&input)?);
|
211 - | if let Some(content_length) = body.content_length() {
|
212 - | let content_length = content_length.to_string();
|
213 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
214 - | }
|
215 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
395 + | let protocol = _cfg
|
396 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
397 + | .expect("a SharedClientProtocol is required");
|
398 + | let mut request = protocol
|
399 + | .serialize_request(&input, TransactGetItems::INPUT_SCHEMA, "", _cfg)
|
400 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
401 + |
|
402 + | return ::std::result::Result::Ok(request);
|
216 403 | }
|
217 404 | }
|
218 405 | #[derive(Debug)]
|
219 406 | struct TransactGetItemsEndpointParamsInterceptor;
|
220 407 |
|
221 408 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TransactGetItemsEndpointParamsInterceptor {
|
222 409 | fn name(&self) -> &'static str {
|
223 410 | "TransactGetItemsEndpointParamsInterceptor"
|
224 411 | }
|
225 412 |
|