Struct aws_sdk_cloudfront::error::DeletePublicKeyError
source · #[non_exhaustive]pub struct DeletePublicKeyError {
pub kind: DeletePublicKeyErrorKind,
/* private fields */
}
Expand description
Error type for the DeletePublicKey
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: DeletePublicKeyErrorKind
Kind of error that occurred.
Implementations§
source§impl DeletePublicKeyError
impl DeletePublicKeyError
sourcepub fn new(kind: DeletePublicKeyErrorKind, meta: Error) -> Self
pub fn new(kind: DeletePublicKeyErrorKind, meta: Error) -> Self
Creates a new DeletePublicKeyError
.
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 DeletePublicKeyError::Unhandled
variant from any error type.
Examples found in repository?
5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641
pub fn parse_delete_public_key_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeletePublicKeyOutput, crate::error::DeletePublicKeyError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeletePublicKeyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeletePublicKeyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::AccessDenied({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::InvalidIfMatchVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_if_match_version::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchPublicKey" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::NoSuchPublicKey({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_public_key::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_public_key_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"PreconditionFailed" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::PreconditionFailed({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::precondition_failed::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"PublicKeyInUse" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::PublicKeyInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::public_key_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_public_key_in_use_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::DeletePublicKeyError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeletePublicKeyError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641
pub fn parse_delete_public_key_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeletePublicKeyOutput, crate::error::DeletePublicKeyError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeletePublicKeyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeletePublicKeyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::AccessDenied({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::InvalidIfMatchVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_if_match_version::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchPublicKey" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::NoSuchPublicKey({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_public_key::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_public_key_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"PreconditionFailed" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::PreconditionFailed({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::precondition_failed::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"PublicKeyInUse" => {
crate::error::DeletePublicKeyError {
meta: generic,
kind: crate::error::DeletePublicKeyErrorKind::PublicKeyInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::public_key_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_public_key_in_use_xml_err(response.body().as_ref(), output).map_err(crate::error::DeletePublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::DeletePublicKeyError::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_access_denied(&self) -> bool
pub fn is_access_denied(&self) -> bool
Returns true
if the error kind is DeletePublicKeyErrorKind::AccessDenied
.
sourcepub fn is_invalid_if_match_version(&self) -> bool
pub fn is_invalid_if_match_version(&self) -> bool
Returns true
if the error kind is DeletePublicKeyErrorKind::InvalidIfMatchVersion
.
sourcepub fn is_no_such_public_key(&self) -> bool
pub fn is_no_such_public_key(&self) -> bool
Returns true
if the error kind is DeletePublicKeyErrorKind::NoSuchPublicKey
.
sourcepub fn is_precondition_failed(&self) -> bool
pub fn is_precondition_failed(&self) -> bool
Returns true
if the error kind is DeletePublicKeyErrorKind::PreconditionFailed
.
sourcepub fn is_public_key_in_use(&self) -> bool
pub fn is_public_key_in_use(&self) -> bool
Returns true
if the error kind is DeletePublicKeyErrorKind::PublicKeyInUse
.