#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_rule_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<crate::operation::delete_rule::DeleteRuleOutput, crate::operation::delete_rule::DeleteRuleError> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
.map_err(crate::operation::delete_rule::DeleteRuleError::unhandled)?;
generic_builder = ::aws_types::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_rule::DeleteRuleError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"OperationNotPermitted" => crate::operation::delete_rule::DeleteRuleError::OperationNotPermittedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::OperationNotPermittedExceptionBuilder::default();
output = crate::protocol_serde::shape_operation_not_permitted_exception::de_operation_not_permitted_exception_xml_err(
_response_body,
output,
)
.map_err(crate::operation::delete_rule::DeleteRuleError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"RuleNotFound" => crate::operation::delete_rule::DeleteRuleError::RuleNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::RuleNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_rule_not_found_exception::de_rule_not_found_exception_xml_err(_response_body, output)
.map_err(crate::operation::delete_rule::DeleteRuleError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::delete_rule::DeleteRuleError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_rule_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<crate::operation::delete_rule::DeleteRuleOutput, crate::operation::delete_rule::DeleteRuleError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::delete_rule::builders::DeleteRuleOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}