#[non_exhaustive]pub struct AssociateResourceSharePermissionError {
pub kind: AssociateResourceSharePermissionErrorKind,
/* private fields */
}Expand description
Error type for the AssociateResourceSharePermission 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: AssociateResourceSharePermissionErrorKindKind of error that occurred.
Implementations§
sourcepub fn new(kind: AssociateResourceSharePermissionErrorKind, meta: Error) -> Self
pub fn new(kind: AssociateResourceSharePermissionErrorKind, meta: Error) -> Self
Creates a new AssociateResourceSharePermissionError.
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 AssociateResourceSharePermissionError::Unhandled variant from any error type.
Examples found in repository?
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
pub fn parse_associate_resource_share_permission_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssociateResourceSharePermissionOutput,
crate::error::AssociateResourceSharePermissionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::AssociateResourceSharePermissionError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidClientTokenException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::InvalidClientTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_client_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_client_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::InvalidParameterException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MalformedArnException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::MalformedArnException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::malformed_arn_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_malformed_arn_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OperationNotPermittedException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_operation_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServerInternalException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::ServerInternalException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::server_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::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::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnknownResourceException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::UnknownResourceException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unknown_resource_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unknown_resource_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::AssociateResourceSharePermissionError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the AssociateResourceSharePermissionError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
pub fn parse_associate_resource_share_permission_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssociateResourceSharePermissionOutput,
crate::error::AssociateResourceSharePermissionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::AssociateResourceSharePermissionError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidClientTokenException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::InvalidClientTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_client_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_client_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::InvalidParameterException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MalformedArnException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::MalformedArnException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::malformed_arn_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_malformed_arn_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OperationNotPermittedException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_operation_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServerInternalException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::ServerInternalException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::server_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::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::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnknownResourceException" => crate::error::AssociateResourceSharePermissionError { meta: generic, kind: crate::error::AssociateResourceSharePermissionErrorKind::UnknownResourceException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unknown_resource_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unknown_resource_exception_json_err(response.body().as_ref(), output).map_err(crate::error::AssociateResourceSharePermissionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::AssociateResourceSharePermissionError::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_invalid_client_token_exception(&self) -> bool
pub fn is_invalid_client_token_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::InvalidClientTokenException.
sourcepub fn is_invalid_parameter_exception(&self) -> bool
pub fn is_invalid_parameter_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::InvalidParameterException.
sourcepub fn is_malformed_arn_exception(&self) -> bool
pub fn is_malformed_arn_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::MalformedArnException.
sourcepub fn is_operation_not_permitted_exception(&self) -> bool
pub fn is_operation_not_permitted_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::OperationNotPermittedException.
sourcepub fn is_server_internal_exception(&self) -> bool
pub fn is_server_internal_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::ServerInternalException.
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::ServiceUnavailableException.
sourcepub fn is_unknown_resource_exception(&self) -> bool
pub fn is_unknown_resource_exception(&self) -> bool
Returns true if the error kind is AssociateResourceSharePermissionErrorKind::UnknownResourceException.