#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_s3_table_integration_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationOutput,
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError,
> {
#[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_s3_table_integration::DeleteS3TableIntegrationError::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_s3_table_integration::DeleteS3TableIntegrationError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::AccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
output = output.set_amzn_error_type(
crate::protocol_serde::shape_access_denied_exception::de_amzn_error_type_header(_response_headers).map_err(|_| {
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled(
"Failed to parse amznErrorType from header `x-amzn-ErrorType",
)
})?,
);
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InternalServerException" => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
output = output.set_amzn_error_type(
crate::protocol_serde::shape_internal_server_exception::de_amzn_error_type_header(_response_headers).map_err(|_| {
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled(
"Failed to parse amznErrorType from header `x-amzn-ErrorType",
)
})?,
);
output = output.set_retry_after_seconds(
crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| {
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled(
"Failed to parse retryAfterSeconds from header `Retry-After",
)
})?,
);
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"InvalidStateException" => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::InvalidStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::InvalidStateExceptionBuilder::default();
output = crate::protocol_serde::shape_invalid_state_exception::de_invalid_state_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"ServiceQuotaExceededException" => {
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::ServiceQuotaExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
output = output.set_amzn_error_type(
crate::protocol_serde::shape_service_quota_exceeded_exception::de_amzn_error_type_header(_response_headers).map_err(
|_| {
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled(
"Failed to parse amznErrorType from header `x-amzn-ErrorType",
)
},
)?,
);
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"TooManyRequestsException" => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"ValidationException" => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::ValidationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
.map_err(crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
_ => crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_delete_s3_table_integration_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationOutput,
crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::delete_s3_table_integration::builders::DeleteS3TableIntegrationOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}
pub fn ser_delete_s3_table_integration_input(
input: &crate::operation::delete_s3_table_integration::DeleteS3TableIntegrationInput,
) -> ::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_s3_table_integration_input::ser_delete_s3_table_integration_input_input(&mut object, input)?;
object.finish();
Ok(::aws_smithy_types::body::SdkBody::from(out))
}