#[allow(clippy::unnecessary_wraps)]
pub fn de_get_introspection_schema_http_error(
_response_status: u16,
_response_headers: &::http::header::HeaderMap,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::get_introspection_schema::GetIntrospectionSchemaOutput,
crate::operation::get_introspection_schema::GetIntrospectionSchemaError,
> {
#[allow(unused_mut)]
let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
.map_err(crate::operation::get_introspection_schema::GetIntrospectionSchemaError::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::get_introspection_schema::GetIntrospectionSchemaError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"GraphQLSchemaException" => crate::operation::get_introspection_schema::GetIntrospectionSchemaError::GraphQlSchemaException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::GraphQlSchemaExceptionBuilder::default();
output = crate::protocol_serde::shape_graph_ql_schema_exception::de_graph_ql_schema_exception_json_err(_response_body, output)
.map_err(crate::operation::get_introspection_schema::GetIntrospectionSchemaError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InternalFailureException" => crate::operation::get_introspection_schema::GetIntrospectionSchemaError::InternalFailureException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InternalFailureExceptionBuilder::default();
output = crate::protocol_serde::shape_internal_failure_exception::de_internal_failure_exception_json_err(_response_body, output)
.map_err(crate::operation::get_introspection_schema::GetIntrospectionSchemaError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"NotFoundException" => crate::operation::get_introspection_schema::GetIntrospectionSchemaError::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
.map_err(crate::operation::get_introspection_schema::GetIntrospectionSchemaError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"UnauthorizedException" => crate::operation::get_introspection_schema::GetIntrospectionSchemaError::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::UnauthorizedExceptionBuilder::default();
output = crate::protocol_serde::shape_unauthorized_exception::de_unauthorized_exception_json_err(_response_body, output)
.map_err(crate::operation::get_introspection_schema::GetIntrospectionSchemaError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::get_introspection_schema::GetIntrospectionSchemaError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_get_introspection_schema_http_response(
_response_status: u16,
_response_headers: &::http::header::HeaderMap,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::get_introspection_schema::GetIntrospectionSchemaOutput,
crate::operation::get_introspection_schema::GetIntrospectionSchemaError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::get_introspection_schema::builders::GetIntrospectionSchemaOutputBuilder::default();
output = output.set_schema(crate::protocol_serde::shape_get_introspection_schema_output::de_schema_payload(
_response_body,
)?);
output._set_request_id(::aws_http::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}