#[non_exhaustive]pub struct DeleteCloudFrontOriginAccessIdentityError {
pub kind: DeleteCloudFrontOriginAccessIdentityErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteCloudFrontOriginAccessIdentity
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: DeleteCloudFrontOriginAccessIdentityErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteCloudFrontOriginAccessIdentityError
impl DeleteCloudFrontOriginAccessIdentityError
sourcepub fn new(
kind: DeleteCloudFrontOriginAccessIdentityErrorKind,
meta: Error
) -> Self
pub fn new(
kind: DeleteCloudFrontOriginAccessIdentityErrorKind,
meta: Error
) -> Self
Creates a new DeleteCloudFrontOriginAccessIdentityError
.
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 DeleteCloudFrontOriginAccessIdentityError::Unhandled
variant from any error type.
Examples found in repository?
4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542
pub fn parse_delete_cloud_front_origin_access_identity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteCloudFrontOriginAccessIdentityOutput,
crate::error::DeleteCloudFrontOriginAccessIdentityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CloudFrontOriginAccessIdentityInUse" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityInUse({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_front_origin_access_identity_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cloud_front_origin_access_identity_in_use_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidIfMatchVersion" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchCloudFrontOriginAccessIdentity" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_cloud_front_origin_access_identity::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_cloud_front_origin_access_identity_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"PreconditionFailed" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteCloudFrontOriginAccessIdentityError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteCloudFrontOriginAccessIdentityError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542
pub fn parse_delete_cloud_front_origin_access_identity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteCloudFrontOriginAccessIdentityOutput,
crate::error::DeleteCloudFrontOriginAccessIdentityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CloudFrontOriginAccessIdentityInUse" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityInUse({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_front_origin_access_identity_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cloud_front_origin_access_identity_in_use_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidIfMatchVersion" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchCloudFrontOriginAccessIdentity" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_cloud_front_origin_access_identity::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_cloud_front_origin_access_identity_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"PreconditionFailed" => crate::error::DeleteCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::DeleteCloudFrontOriginAccessIdentityErrorKind::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::DeleteCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteCloudFrontOriginAccessIdentityError::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 DeleteCloudFrontOriginAccessIdentityErrorKind::AccessDenied
.
sourcepub fn is_cloud_front_origin_access_identity_in_use(&self) -> bool
pub fn is_cloud_front_origin_access_identity_in_use(&self) -> bool
Returns true
if the error kind is DeleteCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityInUse
.
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 DeleteCloudFrontOriginAccessIdentityErrorKind::InvalidIfMatchVersion
.
sourcepub fn is_no_such_cloud_front_origin_access_identity(&self) -> bool
pub fn is_no_such_cloud_front_origin_access_identity(&self) -> bool
Returns true
if the error kind is DeleteCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity
.
sourcepub fn is_precondition_failed(&self) -> bool
pub fn is_precondition_failed(&self) -> bool
Returns true
if the error kind is DeleteCloudFrontOriginAccessIdentityErrorKind::PreconditionFailed
.