#[allow(clippy::unnecessary_wraps)]
pub fn de_update_configuration_set_event_destination_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationOutput,
crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError,
> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
.map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::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::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConfigurationSetDoesNotExist" => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::ConfigurationSetDoesNotExistException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::ConfigurationSetDoesNotExistExceptionBuilder::default();
output = crate::protocol_serde::shape_configuration_set_does_not_exist_exception::de_configuration_set_does_not_exist_exception_xml_err(_response_body, output).map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"EventDestinationDoesNotExist" => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::EventDestinationDoesNotExistException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::EventDestinationDoesNotExistExceptionBuilder::default();
output = crate::protocol_serde::shape_event_destination_does_not_exist_exception::de_event_destination_does_not_exist_exception_xml_err(_response_body, output).map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InvalidCloudWatchDestination" => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::InvalidCloudWatchDestinationException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidCloudWatchDestinationExceptionBuilder::default();
output = crate::protocol_serde::shape_invalid_cloud_watch_destination_exception::de_invalid_cloud_watch_destination_exception_xml_err(_response_body, output).map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InvalidFirehoseDestination" => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::InvalidFirehoseDestinationException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidFirehoseDestinationExceptionBuilder::default();
output = crate::protocol_serde::shape_invalid_firehose_destination_exception::de_invalid_firehose_destination_exception_xml_err(_response_body, output).map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InvalidSNSDestination" => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::InvalidSnsDestinationException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidSnsDestinationExceptionBuilder::default();
output = crate::protocol_serde::shape_invalid_sns_destination_exception::de_invalid_sns_destination_exception_xml_err(_response_body, output).map_err(crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError::generic(generic)
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_update_configuration_set_event_destination_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationOutput,
crate::operation::update_configuration_set_event_destination::UpdateConfigurationSetEventDestinationError,
> {
Ok({
#[allow(unused_mut)]
let mut output =
crate::operation::update_configuration_set_event_destination::builders::UpdateConfigurationSetEventDestinationOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}