#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_organization_conformance_pack_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackOutput,
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError,
> {
#[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_organization_conformance_pack::DeleteOrganizationConformancePackError::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_organization_conformance_pack::DeleteOrganizationConformancePackError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchOrganizationConformancePackException" => {
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::NoSuchOrganizationConformancePackException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::NoSuchOrganizationConformancePackExceptionBuilder::default();
output = crate::protocol_serde::shape_no_such_organization_conformance_pack_exception::de_no_such_organization_conformance_pack_exception_json_err(_response_body, output).map_err(crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
)
}
"OrganizationAccessDeniedException" => {
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::OrganizationAccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::OrganizationAccessDeniedExceptionBuilder::default();
output = crate::protocol_serde::shape_organization_access_denied_exception::de_organization_access_denied_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"ResourceInUseException" => {
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::ResourceInUseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::ResourceInUseExceptionBuilder::default();
output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
_ => crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_organization_conformance_pack_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackOutput,
crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::delete_organization_conformance_pack::builders::DeleteOrganizationConformancePackOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}
pub fn ser_delete_organization_conformance_pack_input(
input: &crate::operation::delete_organization_conformance_pack::DeleteOrganizationConformancePackInput,
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
let mut out = String::new();
let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
crate::protocol_serde::shape_delete_organization_conformance_pack_input::ser_delete_organization_conformance_pack_input_input(
&mut object,
input,
)?;
object.finish();
Ok(::aws_smithy_types::body::SdkBody::from(out))
}