#[allow(clippy::unnecessary_wraps)]
pub fn de_update_custom_key_store_http_error(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::update_custom_key_store::UpdateCustomKeyStoreOutput,
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
> {
#[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_custom_key_store::UpdateCustomKeyStoreError::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_custom_key_store::UpdateCustomKeyStoreError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CloudHsmClusterInvalidConfigurationException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CloudHsmClusterInvalidConfigurationExceptionBuilder::default();
output = crate::protocol_serde::shape_cloud_hsm_cluster_invalid_configuration_exception::de_cloud_hsm_cluster_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CloudHsmClusterNotActiveException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotActiveException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CloudHsmClusterNotActiveExceptionBuilder::default();
output = crate::protocol_serde::shape_cloud_hsm_cluster_not_active_exception::de_cloud_hsm_cluster_not_active_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CloudHsmClusterNotFoundException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CloudHsmClusterNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_cloud_hsm_cluster_not_found_exception::de_cloud_hsm_cluster_not_found_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CloudHsmClusterNotRelatedException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotRelatedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CloudHsmClusterNotRelatedExceptionBuilder::default();
output =
crate::protocol_serde::shape_cloud_hsm_cluster_not_related_exception::de_cloud_hsm_cluster_not_related_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CustomKeyStoreInvalidStateException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreInvalidStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CustomKeyStoreInvalidStateExceptionBuilder::default();
output =
crate::protocol_serde::shape_custom_key_store_invalid_state_exception::de_custom_key_store_invalid_state_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CustomKeyStoreNameInUseException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNameInUseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CustomKeyStoreNameInUseExceptionBuilder::default();
output = crate::protocol_serde::shape_custom_key_store_name_in_use_exception::de_custom_key_store_name_in_use_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"CustomKeyStoreNotFoundException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::CustomKeyStoreNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_custom_key_store_not_found_exception::de_custom_key_store_not_found_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"KMSInternalException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"XksProxyIncorrectAuthenticationCredentialException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyIncorrectAuthenticationCredentialExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_incorrect_authentication_credential_exception::de_xks_proxy_incorrect_authentication_credential_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyInvalidConfigurationException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidConfigurationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyInvalidConfigurationExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_invalid_configuration_exception::de_xks_proxy_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyInvalidResponseException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidResponseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyInvalidResponseExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_invalid_response_exception::de_xks_proxy_invalid_response_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyUriEndpointInUseException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriEndpointInUseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyUriEndpointInUseExceptionBuilder::default();
output =
crate::protocol_serde::shape_xks_proxy_uri_endpoint_in_use_exception::de_xks_proxy_uri_endpoint_in_use_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyUriInUseException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriInUseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyUriInUseExceptionBuilder::default();
output =
crate::protocol_serde::shape_xks_proxy_uri_in_use_exception::de_xks_proxy_uri_in_use_exception_json_err(_response_body, output)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"XksProxyUriUnreachableException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriUnreachableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyUriUnreachableExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_uri_unreachable_exception::de_xks_proxy_uri_unreachable_exception_json_err(
_response_body,
output,
)
.map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
"XksProxyVpcEndpointServiceInUseException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInUseExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_in_use_exception::de_xks_proxy_vpc_endpoint_service_in_use_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyVpcEndpointServiceInvalidConfigurationException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInvalidConfigurationExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_invalid_configuration_exception::de_xks_proxy_vpc_endpoint_service_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
"XksProxyVpcEndpointServiceNotFoundException" => {
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceNotFoundExceptionBuilder::default();
output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_not_found_exception::de_xks_proxy_vpc_endpoint_service_not_found_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
let output = output.meta(generic);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})
}
_ => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn de_update_custom_key_store_http_response(
_response_status: u16,
_response_headers: &::aws_smithy_runtime_api::http::Headers,
_response_body: &[u8],
) -> std::result::Result<
crate::operation::update_custom_key_store::UpdateCustomKeyStoreOutput,
crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::operation::update_custom_key_store::builders::UpdateCustomKeyStoreOutputBuilder::default();
output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
output.build()
})
}
pub fn ser_update_custom_key_store_input(
input: &crate::operation::update_custom_key_store::UpdateCustomKeyStoreInput,
) -> ::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_update_custom_key_store_input::ser_update_custom_key_store_input_input(&mut object, input)?;
object.finish();
Ok(::aws_smithy_types::body::SdkBody::from(out))
}