#[allow(clippy::unnecessary_wraps)]
pub fn de_stop_stack_set_operation_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::stop_stack_set_operation::StopStackSetOperationOutput,
crate::operation::stop_stack_set_operation::StopStackSetOperationError,
> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
.map_err(crate::operation::stop_stack_set_operation::StopStackSetOperationError::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::stop_stack_set_operation::StopStackSetOperationError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidOperationException" => crate::operation::stop_stack_set_operation::StopStackSetOperationError::InvalidOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidOperationExceptionBuilder::default();
output = crate::protocol_serde::shape_invalid_operation_exception::de_invalid_operation_exception_xml_err(_response_body, output)
.map_err(crate::operation::stop_stack_set_operation::StopStackSetOperationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"OperationNotFoundException" => crate::operation::stop_stack_set_operation::StopStackSetOperationError::OperationNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::OperationNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_operation_not_found_exception::de_operation_not_found_exception_xml_err(_response_body, output)
.map_err(crate::operation::stop_stack_set_operation::StopStackSetOperationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"StackSetNotFoundException" => crate::operation::stop_stack_set_operation::StopStackSetOperationError::StackSetNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::StackSetNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_stack_set_not_found_exception::de_stack_set_not_found_exception_xml_err(_response_body, output)
.map_err(crate::operation::stop_stack_set_operation::StopStackSetOperationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::stop_stack_set_operation::StopStackSetOperationError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_stop_stack_set_operation_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::stop_stack_set_operation::StopStackSetOperationOutput,
crate::operation::stop_stack_set_operation::StopStackSetOperationError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::stop_stack_set_operation::builders::StopStackSetOperationOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}