#[non_exhaustive]pub struct DeleteOrganizationConfigRuleError {
pub kind: DeleteOrganizationConfigRuleErrorKind,
/* private fields */
}Expand description
Error type for the DeleteOrganizationConfigRule 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: DeleteOrganizationConfigRuleErrorKindKind of error that occurred.
Implementations§
source§impl DeleteOrganizationConfigRuleError
impl DeleteOrganizationConfigRuleError
sourcepub fn new(kind: DeleteOrganizationConfigRuleErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteOrganizationConfigRuleErrorKind, meta: Error) -> Self
Creates a new DeleteOrganizationConfigRuleError.
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 DeleteOrganizationConfigRuleError::Unhandled variant from any error type.
Examples found in repository?
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
pub fn parse_delete_organization_config_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteOrganizationConfigRuleOutput,
crate::error::DeleteOrganizationConfigRuleError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteOrganizationConfigRuleError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchOrganizationConfigRuleException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::NoSuchOrganizationConfigRuleException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_organization_config_rule_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_such_organization_config_rule_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteOrganizationConfigRuleError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteOrganizationConfigRuleError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
pub fn parse_delete_organization_config_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteOrganizationConfigRuleOutput,
crate::error::DeleteOrganizationConfigRuleError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteOrganizationConfigRuleError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchOrganizationConfigRuleException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::NoSuchOrganizationConfigRuleException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_organization_config_rule_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_such_organization_config_rule_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::DeleteOrganizationConfigRuleError { meta: generic, kind: crate::error::DeleteOrganizationConfigRuleErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteOrganizationConfigRuleError::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_no_such_organization_config_rule_exception(&self) -> bool
pub fn is_no_such_organization_config_rule_exception(&self) -> bool
Returns true if the error kind is DeleteOrganizationConfigRuleErrorKind::NoSuchOrganizationConfigRuleException.
sourcepub fn is_organization_access_denied_exception(&self) -> bool
pub fn is_organization_access_denied_exception(&self) -> bool
Returns true if the error kind is DeleteOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException.
sourcepub fn is_resource_in_use_exception(&self) -> bool
pub fn is_resource_in_use_exception(&self) -> bool
Returns true if the error kind is DeleteOrganizationConfigRuleErrorKind::ResourceInUseException.