#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_suppressed_destination_http_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationOutput,
crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError,
> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(response).map_err(crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::unhandled)?;
generic_builder = aws_http::request_id::apply_request_id(generic_builder, response.headers());
let generic = generic_builder.build();
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::unhandled(generic))
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"BadRequestException" => crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::BadRequestException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::BadRequestExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_bad_request_exception::de_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"NotFoundException" => crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::NotFoundException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"TooManyRequestsException" => crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError::generic(generic)
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_suppressed_destination_http_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationOutput,
crate::operation::delete_suppressed_destination::DeleteSuppressedDestinationError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::delete_suppressed_destination::builders::DeleteSuppressedDestinationOutputBuilder::default();
let _ = response;
output._set_request_id(
aws_http::request_id::RequestId::request_id(response).map(str::to_string),
);
output.build()
})
}