aws_sdk_apigatewayv2/protocol_serde/
shape_delete_integration.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_delete_integration_http_error(
4 _response_status: u16,
5 _response_headers: &::aws_smithy_runtime_api::http::Headers,
6 _response_body: &[u8],
7) -> std::result::Result<crate::operation::delete_integration::DeleteIntegrationOutput, crate::operation::delete_integration::DeleteIntegrationError>
8{
9 #[allow(unused_mut)]
10 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
11 .map_err(crate::operation::delete_integration::DeleteIntegrationError::unhandled)?;
12 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
13 let generic = generic_builder.build();
14 let error_code = match generic.code() {
15 Some(code) => code,
16 None => return Err(crate::operation::delete_integration::DeleteIntegrationError::unhandled(generic)),
17 };
18
19 let _error_message = generic.message().map(|msg| msg.to_owned());
20 Err(match error_code {
21 "NotFoundException" => crate::operation::delete_integration::DeleteIntegrationError::NotFoundException({
22 #[allow(unused_mut)]
23 let mut tmp = {
24 #[allow(unused_mut)]
25 let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
26 output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
27 .map_err(crate::operation::delete_integration::DeleteIntegrationError::unhandled)?;
28 let output = output.meta(generic);
29 output.build()
30 };
31 if tmp.message.is_none() {
32 tmp.message = _error_message;
33 }
34 tmp
35 }),
36 "TooManyRequestsException" => crate::operation::delete_integration::DeleteIntegrationError::TooManyRequestsException({
37 #[allow(unused_mut)]
38 let mut tmp = {
39 #[allow(unused_mut)]
40 let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
41 output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(_response_body, output)
42 .map_err(crate::operation::delete_integration::DeleteIntegrationError::unhandled)?;
43 let output = output.meta(generic);
44 output.build()
45 };
46 if tmp.message.is_none() {
47 tmp.message = _error_message;
48 }
49 tmp
50 }),
51 _ => crate::operation::delete_integration::DeleteIntegrationError::generic(generic),
52 })
53}
54
55#[allow(clippy::unnecessary_wraps)]
56pub fn de_delete_integration_http_response(
57 _response_status: u16,
58 _response_headers: &::aws_smithy_runtime_api::http::Headers,
59 _response_body: &[u8],
60) -> std::result::Result<crate::operation::delete_integration::DeleteIntegrationOutput, crate::operation::delete_integration::DeleteIntegrationError>
61{
62 Ok({
63 #[allow(unused_mut)]
64 let mut output = crate::operation::delete_integration::builders::DeleteIntegrationOutputBuilder::default();
65 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
66 output.build()
67 })
68}