#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UntagResourceError {
pub kind: UntagResourceErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UntagResourceError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UntagResourceErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UntagResourceErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UntagResourceErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UntagResourceError {
fn code(&self) -> Option<&str> {
UntagResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UntagResourceError {
pub fn new(kind: UntagResourceErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UntagResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UntagResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(&self.kind, UntagResourceErrorKind::CloudHsmTagException(_))
}
}
impl std::error::Error for UntagResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UntagResourceErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
UntagResourceErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
UntagResourceErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
UntagResourceErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
UntagResourceErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
UntagResourceErrorKind::CloudHsmTagException(_inner) => Some(_inner),
UntagResourceErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmTagException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmTagException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmTagException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmTagException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmTagException {}
pub mod cloud_hsm_tag_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmTagException {
crate::error::CloudHsmTagException {
message: self.message,
}
}
}
}
impl CloudHsmTagException {
pub fn builder() -> crate::error::cloud_hsm_tag_exception::Builder {
crate::error::cloud_hsm_tag_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmServiceException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmServiceException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmServiceException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmServiceException")?;
if let Some(inner_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmServiceException {}
pub mod cloud_hsm_service_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmServiceException {
crate::error::CloudHsmServiceException {
message: self.message,
}
}
}
}
impl CloudHsmServiceException {
pub fn builder() -> crate::error::cloud_hsm_service_exception::Builder {
crate::error::cloud_hsm_service_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmResourceNotFoundException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmResourceNotFoundException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmResourceNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmResourceNotFoundException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmResourceNotFoundException {}
pub mod cloud_hsm_resource_not_found_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmResourceNotFoundException {
crate::error::CloudHsmResourceNotFoundException {
message: self.message,
}
}
}
}
impl CloudHsmResourceNotFoundException {
pub fn builder() -> crate::error::cloud_hsm_resource_not_found_exception::Builder {
crate::error::cloud_hsm_resource_not_found_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmInvalidRequestException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmInvalidRequestException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmInvalidRequestException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmInvalidRequestException")?;
if let Some(inner_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmInvalidRequestException {}
pub mod cloud_hsm_invalid_request_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmInvalidRequestException {
crate::error::CloudHsmInvalidRequestException {
message: self.message,
}
}
}
}
impl CloudHsmInvalidRequestException {
pub fn builder() -> crate::error::cloud_hsm_invalid_request_exception::Builder {
crate::error::cloud_hsm_invalid_request_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmInternalFailureException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmInternalFailureException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmInternalFailureException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmInternalFailureException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmInternalFailureException {}
pub mod cloud_hsm_internal_failure_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmInternalFailureException {
crate::error::CloudHsmInternalFailureException {
message: self.message,
}
}
}
}
impl CloudHsmInternalFailureException {
pub fn builder() -> crate::error::cloud_hsm_internal_failure_exception::Builder {
crate::error::cloud_hsm_internal_failure_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmAccessDeniedException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl CloudHsmAccessDeniedException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmAccessDeniedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmAccessDeniedException")?;
if let Some(inner_6) = &self.message {
{
write!(f, ": {}", inner_6)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmAccessDeniedException {}
pub mod cloud_hsm_access_denied_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::CloudHsmAccessDeniedException {
crate::error::CloudHsmAccessDeniedException {
message: self.message,
}
}
}
}
impl CloudHsmAccessDeniedException {
pub fn builder() -> crate::error::cloud_hsm_access_denied_exception::Builder {
crate::error::cloud_hsm_access_denied_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct TagResourceError {
pub kind: TagResourceErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for TagResourceError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: TagResourceErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum TagResourceErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for TagResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
TagResourceErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
TagResourceErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
TagResourceErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
TagResourceErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
TagResourceErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
TagResourceErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
TagResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for TagResourceError {
fn code(&self) -> Option<&str> {
TagResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl TagResourceError {
pub fn new(kind: TagResourceErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: TagResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: TagResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(&self.kind, TagResourceErrorKind::CloudHsmTagException(_))
}
}
impl std::error::Error for TagResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
TagResourceErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
TagResourceErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
TagResourceErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
TagResourceErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
TagResourceErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
TagResourceErrorKind::CloudHsmTagException(_inner) => Some(_inner),
TagResourceErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct RestoreBackupError {
pub kind: RestoreBackupErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for RestoreBackupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: RestoreBackupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum RestoreBackupErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for RestoreBackupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
RestoreBackupErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
RestoreBackupErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
RestoreBackupErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
RestoreBackupErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
RestoreBackupErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
RestoreBackupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for RestoreBackupError {
fn code(&self) -> Option<&str> {
RestoreBackupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl RestoreBackupError {
pub fn new(kind: RestoreBackupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: RestoreBackupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: RestoreBackupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
RestoreBackupErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
RestoreBackupErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
RestoreBackupErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
RestoreBackupErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
RestoreBackupErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for RestoreBackupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
RestoreBackupErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
RestoreBackupErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
RestoreBackupErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
RestoreBackupErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
RestoreBackupErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
RestoreBackupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ModifyClusterError {
pub kind: ModifyClusterErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ModifyClusterError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ModifyClusterErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ModifyClusterErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ModifyClusterError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ModifyClusterErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
ModifyClusterErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
ModifyClusterErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
ModifyClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
ModifyClusterErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ModifyClusterErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ModifyClusterError {
fn code(&self) -> Option<&str> {
ModifyClusterError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ModifyClusterError {
pub fn new(kind: ModifyClusterErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ModifyClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ModifyClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ModifyClusterErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
ModifyClusterErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ModifyClusterErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ModifyClusterErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
ModifyClusterErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for ModifyClusterError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ModifyClusterErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
ModifyClusterErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
ModifyClusterErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
ModifyClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
ModifyClusterErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ModifyClusterErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ModifyBackupAttributesError {
pub kind: ModifyBackupAttributesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ModifyBackupAttributesError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ModifyBackupAttributesErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ModifyBackupAttributesErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ModifyBackupAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ModifyBackupAttributesErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
ModifyBackupAttributesErrorKind::CloudHsmInternalFailureException(_inner) => {
_inner.fmt(f)
}
ModifyBackupAttributesErrorKind::CloudHsmInvalidRequestException(_inner) => {
_inner.fmt(f)
}
ModifyBackupAttributesErrorKind::CloudHsmResourceNotFoundException(_inner) => {
_inner.fmt(f)
}
ModifyBackupAttributesErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ModifyBackupAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ModifyBackupAttributesError {
fn code(&self) -> Option<&str> {
ModifyBackupAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ModifyBackupAttributesError {
pub fn new(kind: ModifyBackupAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ModifyBackupAttributesErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ModifyBackupAttributesErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ModifyBackupAttributesErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
ModifyBackupAttributesErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ModifyBackupAttributesErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ModifyBackupAttributesErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
ModifyBackupAttributesErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for ModifyBackupAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ModifyBackupAttributesErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
ModifyBackupAttributesErrorKind::CloudHsmInternalFailureException(_inner) => {
Some(_inner)
}
ModifyBackupAttributesErrorKind::CloudHsmInvalidRequestException(_inner) => {
Some(_inner)
}
ModifyBackupAttributesErrorKind::CloudHsmResourceNotFoundException(_inner) => {
Some(_inner)
}
ModifyBackupAttributesErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ModifyBackupAttributesErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListTagsError {
pub kind: ListTagsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListTagsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListTagsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListTagsErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListTagsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListTagsErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
ListTagsErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
ListTagsErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
ListTagsErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
ListTagsErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListTagsErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
ListTagsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListTagsError {
fn code(&self) -> Option<&str> {
ListTagsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListTagsError {
pub fn new(kind: ListTagsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListTagsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListTagsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, ListTagsErrorKind::CloudHsmServiceException(_))
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(&self.kind, ListTagsErrorKind::CloudHsmTagException(_))
}
}
impl std::error::Error for ListTagsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListTagsErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
ListTagsErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
ListTagsErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
ListTagsErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
ListTagsErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListTagsErrorKind::CloudHsmTagException(_inner) => Some(_inner),
ListTagsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct InitializeClusterError {
pub kind: InitializeClusterErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for InitializeClusterError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: InitializeClusterErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum InitializeClusterErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for InitializeClusterError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
InitializeClusterErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
InitializeClusterErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
InitializeClusterErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
InitializeClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
InitializeClusterErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
InitializeClusterErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for InitializeClusterError {
fn code(&self) -> Option<&str> {
InitializeClusterError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl InitializeClusterError {
pub fn new(kind: InitializeClusterErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: InitializeClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: InitializeClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
InitializeClusterErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
InitializeClusterErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
InitializeClusterErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
InitializeClusterErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
InitializeClusterErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for InitializeClusterError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
InitializeClusterErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
InitializeClusterErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
InitializeClusterErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
InitializeClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
InitializeClusterErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
InitializeClusterErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeClustersError {
pub kind: DescribeClustersErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeClustersError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeClustersErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeClustersErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeClustersError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeClustersErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
DescribeClustersErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
DescribeClustersErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
DescribeClustersErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DescribeClustersErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
DescribeClustersErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeClustersError {
fn code(&self) -> Option<&str> {
DescribeClustersError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeClustersError {
pub fn new(kind: DescribeClustersErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DescribeClustersErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeClustersErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DescribeClustersErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DescribeClustersErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeClustersErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeClustersErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(
&self.kind,
DescribeClustersErrorKind::CloudHsmTagException(_)
)
}
}
impl std::error::Error for DescribeClustersError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeClustersErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
DescribeClustersErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
DescribeClustersErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
DescribeClustersErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DescribeClustersErrorKind::CloudHsmTagException(_inner) => Some(_inner),
DescribeClustersErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeBackupsError {
pub kind: DescribeBackupsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeBackupsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeBackupsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeBackupsErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeBackupsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeBackupsErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
DescribeBackupsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeBackupsError {
fn code(&self) -> Option<&str> {
DescribeBackupsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeBackupsError {
pub fn new(kind: DescribeBackupsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DescribeBackupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeBackupsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(
&self.kind,
DescribeBackupsErrorKind::CloudHsmTagException(_)
)
}
}
impl std::error::Error for DescribeBackupsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeBackupsErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
DescribeBackupsErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
DescribeBackupsErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
DescribeBackupsErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
DescribeBackupsErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DescribeBackupsErrorKind::CloudHsmTagException(_inner) => Some(_inner),
DescribeBackupsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteHsmError {
pub kind: DeleteHsmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteHsmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteHsmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteHsmErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteHsmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteHsmErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteHsmError {
fn code(&self) -> Option<&str> {
DeleteHsmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteHsmError {
pub fn new(kind: DeleteHsmErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteHsmErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DeleteHsmErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DeleteHsmErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteHsmErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, DeleteHsmErrorKind::CloudHsmServiceException(_))
}
}
impl std::error::Error for DeleteHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteHsmErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
DeleteHsmErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
DeleteHsmErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
DeleteHsmErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
DeleteHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteClusterError {
pub kind: DeleteClusterErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteClusterError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteClusterErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteClusterErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteClusterError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteClusterErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
DeleteClusterErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteClusterError {
fn code(&self) -> Option<&str> {
DeleteClusterError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteClusterError {
pub fn new(kind: DeleteClusterErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteClusterErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DeleteClusterErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DeleteClusterErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteClusterErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteClusterErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(&self.kind, DeleteClusterErrorKind::CloudHsmTagException(_))
}
}
impl std::error::Error for DeleteClusterError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteClusterErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
DeleteClusterErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
DeleteClusterErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
DeleteClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
DeleteClusterErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteClusterErrorKind::CloudHsmTagException(_inner) => Some(_inner),
DeleteClusterErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteBackupError {
pub kind: DeleteBackupErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteBackupError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteBackupErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteBackupErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteBackupError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteBackupErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
DeleteBackupErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
DeleteBackupErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
DeleteBackupErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteBackupErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteBackupErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteBackupError {
fn code(&self) -> Option<&str> {
DeleteBackupError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteBackupError {
pub fn new(kind: DeleteBackupErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteBackupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteBackupErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteBackupErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DeleteBackupErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DeleteBackupErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteBackupErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteBackupErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for DeleteBackupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteBackupErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
DeleteBackupErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
DeleteBackupErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
DeleteBackupErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
DeleteBackupErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteBackupErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateHsmError {
pub kind: CreateHsmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateHsmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateHsmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateHsmErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateHsmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateHsmErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateHsmError {
fn code(&self) -> Option<&str> {
CreateHsmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateHsmError {
pub fn new(kind: CreateHsmErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CreateHsmErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
CreateHsmErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
CreateHsmErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateHsmErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, CreateHsmErrorKind::CloudHsmServiceException(_))
}
}
impl std::error::Error for CreateHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateHsmErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
CreateHsmErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
CreateHsmErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
CreateHsmErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
CreateHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CreateHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateClusterError {
pub kind: CreateClusterErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateClusterError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateClusterErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateClusterErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateClusterError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateClusterErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
CreateClusterErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateClusterError {
fn code(&self) -> Option<&str> {
CreateClusterError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateClusterError {
pub fn new(kind: CreateClusterErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateClusterErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CreateClusterErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
CreateClusterErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
CreateClusterErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateClusterErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateClusterErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(&self.kind, CreateClusterErrorKind::CloudHsmTagException(_))
}
}
impl std::error::Error for CreateClusterError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateClusterErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
CreateClusterErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
CreateClusterErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
CreateClusterErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
CreateClusterErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CreateClusterErrorKind::CloudHsmTagException(_inner) => Some(_inner),
CreateClusterErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CopyBackupToRegionError {
pub kind: CopyBackupToRegionErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CopyBackupToRegionError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CopyBackupToRegionErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CopyBackupToRegionErrorKind {
CloudHsmAccessDeniedException(crate::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
CloudHsmTagException(crate::error::CloudHsmTagException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CopyBackupToRegionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CopyBackupToRegionErrorKind::CloudHsmAccessDeniedException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::CloudHsmInternalFailureException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::CloudHsmInvalidRequestException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::CloudHsmResourceNotFoundException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::CloudHsmTagException(_inner) => _inner.fmt(f),
CopyBackupToRegionErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CopyBackupToRegionError {
fn code(&self) -> Option<&str> {
CopyBackupToRegionError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CopyBackupToRegionError {
pub fn new(kind: CopyBackupToRegionErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CopyBackupToRegionErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CopyBackupToRegionErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
pub fn is_cloud_hsm_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmAccessDeniedException(_)
)
}
pub fn is_cloud_hsm_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmInternalFailureException(_)
)
}
pub fn is_cloud_hsm_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmInvalidRequestException(_)
)
}
pub fn is_cloud_hsm_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmResourceNotFoundException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_cloud_hsm_tag_exception(&self) -> bool {
matches!(
&self.kind,
CopyBackupToRegionErrorKind::CloudHsmTagException(_)
)
}
}
impl std::error::Error for CopyBackupToRegionError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CopyBackupToRegionErrorKind::CloudHsmAccessDeniedException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::CloudHsmInternalFailureException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::CloudHsmInvalidRequestException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::CloudHsmResourceNotFoundException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::CloudHsmTagException(_inner) => Some(_inner),
CopyBackupToRegionErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[derive(Debug)]
pub struct Unhandled {
source: Box<dyn std::error::Error + Send + Sync + 'static>,
}
impl Unhandled {
#[allow(unused)]
pub(crate) fn new(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self { source }
}
}
impl std::fmt::Display for Unhandled {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "unhandled error")
}
}
impl std::error::Error for Unhandled {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Some(self.source.as_ref() as _)
}
}