pub fn ser_delete_matchmaking_rule_set_input(
input: &crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::error::SerializationError> {
let mut out = String::new();
let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
crate::protocol_serde::shape_delete_matchmaking_rule_set_input::ser_delete_matchmaking_rule_set_input(&mut object, input)?;
object.finish();
Ok(aws_smithy_http::body::SdkBody::from(out))
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_matchmaking_rule_set_http_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetOutput,
crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError,
> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(response).map_err(
crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::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_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled(
generic,
),
),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServiceException" => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::InternalServiceException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InternalServiceExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_internal_service_exception::de_internal_service_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InvalidRequestException" => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidRequestExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_invalid_request_exception::de_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"NotFoundException" => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::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_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"TaggingFailedException" => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::TaggingFailedException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::TaggingFailedExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_tagging_failed_exception::de_tagging_failed_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"UnsupportedRegionException" => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::UnsupportedRegionException({
#[allow(unused_mut)]
let mut tmp =
{
#[allow(unused_mut)]
let mut output = crate::types::error::builders::UnsupportedRegionExceptionBuilder::default();
let _ = response;
output = crate::protocol_serde::shape_unsupported_region_exception::de_unsupported_region_exception_json_err(response.body().as_ref(), output).map_err(crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::unhandled)?;
let output = output.meta(generic);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError::generic(generic)
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_matchmaking_rule_set_http_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetOutput,
crate::operation::delete_matchmaking_rule_set::DeleteMatchmakingRuleSetError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::delete_matchmaking_rule_set::builders::DeleteMatchmakingRuleSetOutputBuilder::default();
let _ = response;
output._set_request_id(
aws_http::request_id::RequestId::request_id(response).map(str::to_string),
);
output.build()
})
}