#[non_exhaustive]pub struct GetResourceConfigHistoryError {
pub kind: GetResourceConfigHistoryErrorKind,
/* private fields */
}Expand description
Error type for the GetResourceConfigHistory operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: GetResourceConfigHistoryErrorKindKind of error that occurred.
Implementations§
source§impl GetResourceConfigHistoryError
impl GetResourceConfigHistoryError
sourcepub fn new(kind: GetResourceConfigHistoryErrorKind, meta: Error) -> Self
pub fn new(kind: GetResourceConfigHistoryErrorKind, meta: Error) -> Self
Creates a new GetResourceConfigHistoryError.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the GetResourceConfigHistoryError::Unhandled variant from any error type.
Examples found in repository?
4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753
pub fn parse_get_resource_config_history_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetResourceConfigHistoryOutput,
crate::error::GetResourceConfigHistoryError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetResourceConfigHistoryError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidLimitException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidNextTokenException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidTimeRangeException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidTimeRangeException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_time_range_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_time_range_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableConfigurationRecorderException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::NoAvailableConfigurationRecorderException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_configuration_recorder_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_configuration_recorder_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotDiscoveredException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::ResourceNotDiscoveredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_discovered_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_discovered_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetResourceConfigHistoryError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetResourceConfigHistoryError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753
pub fn parse_get_resource_config_history_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetResourceConfigHistoryOutput,
crate::error::GetResourceConfigHistoryError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetResourceConfigHistoryError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidLimitException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidNextTokenException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidTimeRangeException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::InvalidTimeRangeException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_time_range_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_time_range_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableConfigurationRecorderException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::NoAvailableConfigurationRecorderException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_configuration_recorder_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_configuration_recorder_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotDiscoveredException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::ResourceNotDiscoveredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_discovered_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_discovered_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::GetResourceConfigHistoryError { meta: generic, kind: crate::error::GetResourceConfigHistoryErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetResourceConfigHistoryError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetResourceConfigHistoryError::generic(generic)
})
}sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_invalid_limit_exception(&self) -> bool
pub fn is_invalid_limit_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::InvalidLimitException.
sourcepub fn is_invalid_next_token_exception(&self) -> bool
pub fn is_invalid_next_token_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::InvalidNextTokenException.
sourcepub fn is_invalid_time_range_exception(&self) -> bool
pub fn is_invalid_time_range_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::InvalidTimeRangeException.
sourcepub fn is_no_available_configuration_recorder_exception(&self) -> bool
pub fn is_no_available_configuration_recorder_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::NoAvailableConfigurationRecorderException.
sourcepub fn is_resource_not_discovered_exception(&self) -> bool
pub fn is_resource_not_discovered_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::ResourceNotDiscoveredException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is GetResourceConfigHistoryErrorKind::ValidationException.