Struct aws_sdk_iot::error::DisableTopicRuleError
source · #[non_exhaustive]pub struct DisableTopicRuleError {
pub kind: DisableTopicRuleErrorKind,
/* private fields */
}
Expand description
Error type for the DisableTopicRule
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: DisableTopicRuleErrorKind
Kind of error that occurred.
Implementations§
source§impl DisableTopicRuleError
impl DisableTopicRuleError
sourcepub fn new(kind: DisableTopicRuleErrorKind, meta: Error) -> Self
pub fn new(kind: DisableTopicRuleErrorKind, meta: Error) -> Self
Creates a new DisableTopicRuleError
.
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 DisableTopicRuleError::Unhandled
variant from any error type.
Examples found in repository?
14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612
pub fn parse_disable_topic_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DisableTopicRuleOutput, crate::error::DisableTopicRuleError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DisableTopicRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DisableTopicRuleError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::ConflictingResourceUpdateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_resource_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_resource_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalException" => {
crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DisableTopicRuleError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DisableTopicRuleError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612
pub fn parse_disable_topic_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DisableTopicRuleOutput, crate::error::DisableTopicRuleError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DisableTopicRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DisableTopicRuleError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::ConflictingResourceUpdateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_resource_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_resource_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalException" => {
crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DisableTopicRuleError {
meta: generic,
kind: crate::error::DisableTopicRuleErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DisableTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DisableTopicRuleError::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_conflicting_resource_update_exception(&self) -> bool
pub fn is_conflicting_resource_update_exception(&self) -> bool
Returns true
if the error kind is DisableTopicRuleErrorKind::ConflictingResourceUpdateException
.
sourcepub fn is_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is DisableTopicRuleErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is DisableTopicRuleErrorKind::InvalidRequestException
.
Returns true
if the error kind is DisableTopicRuleErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is DisableTopicRuleErrorKind::UnauthorizedException
.