Struct aws_sdk_iot::error::DeleteTopicRuleError
source · #[non_exhaustive]pub struct DeleteTopicRuleError {
pub kind: DeleteTopicRuleErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteTopicRule
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: DeleteTopicRuleErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteTopicRuleError
impl DeleteTopicRuleError
sourcepub fn new(kind: DeleteTopicRuleErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteTopicRuleErrorKind, meta: Error) -> Self
Creates a new DeleteTopicRuleError
.
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 DeleteTopicRuleError::Unhandled
variant from any error type.
Examples found in repository?
9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725
pub fn parse_delete_topic_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteTopicRuleOutput, crate::error::DeleteTopicRuleError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteTopicRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteTopicRuleError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalException" => {
crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteTopicRuleError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteTopicRuleError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725
pub fn parse_delete_topic_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteTopicRuleOutput, crate::error::DeleteTopicRuleError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteTopicRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteTopicRuleError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalException" => {
crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DeleteTopicRuleError {
meta: generic,
kind: crate::error::DeleteTopicRuleErrorKind::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::DeleteTopicRuleError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteTopicRuleError::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 DeleteTopicRuleErrorKind::ConflictingResourceUpdateException
.
sourcepub fn is_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is DeleteTopicRuleErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is DeleteTopicRuleErrorKind::InvalidRequestException
.
Returns true
if the error kind is DeleteTopicRuleErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is DeleteTopicRuleErrorKind::UnauthorizedException
.