#[non_exhaustive]pub struct CreateCloudFrontOriginAccessIdentityError {
pub kind: CreateCloudFrontOriginAccessIdentityErrorKind,
/* private fields */
}
Expand description
Error type for the CreateCloudFrontOriginAccessIdentity
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: CreateCloudFrontOriginAccessIdentityErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateCloudFrontOriginAccessIdentityError
impl CreateCloudFrontOriginAccessIdentityError
sourcepub fn new(
kind: CreateCloudFrontOriginAccessIdentityErrorKind,
meta: Error
) -> Self
pub fn new(
kind: CreateCloudFrontOriginAccessIdentityErrorKind,
meta: Error
) -> Self
Creates a new CreateCloudFrontOriginAccessIdentityError
.
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 CreateCloudFrontOriginAccessIdentityError::Unhandled
variant from any error type.
Examples found in repository?
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
pub fn parse_create_cloud_front_origin_access_identity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateCloudFrontOriginAccessIdentityOutput,
crate::error::CreateCloudFrontOriginAccessIdentityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CloudFrontOriginAccessIdentityAlreadyExists" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityAlreadyExists({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_front_origin_access_identity_already_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cloud_front_origin_access_identity_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InconsistentQuantities" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::inconsistent_quantities::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_inconsistent_quantities_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidArgument" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MissingBody" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::MissingBody({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::missing_body::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_missing_body_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyCloudFrontOriginAccessIdentities" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::TooManyCloudFrontOriginAccessIdentities({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_cloud_front_origin_access_identities::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_cloud_front_origin_access_identities_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateCloudFrontOriginAccessIdentityError::generic(generic)
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_create_cloud_front_origin_access_identity_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateCloudFrontOriginAccessIdentityOutput,
crate::error::CreateCloudFrontOriginAccessIdentityError,
> {
Ok({
#[allow(unused_mut)]
let mut output =
crate::output::create_cloud_front_origin_access_identity_output::Builder::default();
let _ = response;
output = output.set_cloud_front_origin_access_identity(
crate::http_serde::deser_payload_create_cloud_front_origin_access_identity_create_cloud_front_origin_access_identity_output_cloud_front_origin_access_identity(response.body().as_ref())?
);
output = output.set_e_tag(
crate::http_serde::deser_header_create_cloud_front_origin_access_identity_create_cloud_front_origin_access_identity_output_e_tag(response.headers())
.map_err(|_|crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled("Failed to parse ETag from header `ETag"))?
);
output = output.set_location(
crate::http_serde::deser_header_create_cloud_front_origin_access_identity_create_cloud_front_origin_access_identity_output_location(response.headers())
.map_err(|_|crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled("Failed to parse Location from header `Location"))?
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateCloudFrontOriginAccessIdentityError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
pub fn parse_create_cloud_front_origin_access_identity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateCloudFrontOriginAccessIdentityOutput,
crate::error::CreateCloudFrontOriginAccessIdentityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CloudFrontOriginAccessIdentityAlreadyExists" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityAlreadyExists({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_front_origin_access_identity_already_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cloud_front_origin_access_identity_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InconsistentQuantities" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::inconsistent_quantities::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_inconsistent_quantities_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidArgument" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MissingBody" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::MissingBody({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::missing_body::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_missing_body_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyCloudFrontOriginAccessIdentities" => crate::error::CreateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::CreateCloudFrontOriginAccessIdentityErrorKind::TooManyCloudFrontOriginAccessIdentities({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_cloud_front_origin_access_identities::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_cloud_front_origin_access_identities_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCloudFrontOriginAccessIdentityError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateCloudFrontOriginAccessIdentityError::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_cloud_front_origin_access_identity_already_exists(&self) -> bool
pub fn is_cloud_front_origin_access_identity_already_exists(&self) -> bool
Returns true
if the error kind is CreateCloudFrontOriginAccessIdentityErrorKind::CloudFrontOriginAccessIdentityAlreadyExists
.
sourcepub fn is_inconsistent_quantities(&self) -> bool
pub fn is_inconsistent_quantities(&self) -> bool
Returns true
if the error kind is CreateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities
.
sourcepub fn is_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true
if the error kind is CreateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument
.
sourcepub fn is_missing_body(&self) -> bool
pub fn is_missing_body(&self) -> bool
Returns true
if the error kind is CreateCloudFrontOriginAccessIdentityErrorKind::MissingBody
.
sourcepub fn is_too_many_cloud_front_origin_access_identities(&self) -> bool
pub fn is_too_many_cloud_front_origin_access_identities(&self) -> bool
Returns true
if the error kind is CreateCloudFrontOriginAccessIdentityErrorKind::TooManyCloudFrontOriginAccessIdentities
.