#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct RemoveTagsFromResourceError {
pub kind: RemoveTagsFromResourceErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for RemoveTagsFromResourceError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: RemoveTagsFromResourceErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum RemoveTagsFromResourceErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for RemoveTagsFromResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
RemoveTagsFromResourceErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
RemoveTagsFromResourceErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
RemoveTagsFromResourceErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
RemoveTagsFromResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for RemoveTagsFromResourceError {
fn code(&self) -> Option<&str> {
RemoveTagsFromResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl RemoveTagsFromResourceError {
pub fn new(kind: RemoveTagsFromResourceErrorKind, 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: RemoveTagsFromResourceErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: RemoveTagsFromResourceErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
RemoveTagsFromResourceErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
RemoveTagsFromResourceErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
RemoveTagsFromResourceErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for RemoveTagsFromResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
RemoveTagsFromResourceErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
RemoveTagsFromResourceErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
RemoveTagsFromResourceErrorKind::InvalidRequestException(_inner) => Some(_inner),
RemoveTagsFromResourceErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidRequestException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub retryable: bool,
}
impl InvalidRequestException {
pub fn retryable(&self) -> bool {
self.retryable
}
}
impl InvalidRequestException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidRequestException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidRequestException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidRequestException {}
pub mod 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>,
pub(crate) retryable: std::option::Option<bool>,
}
impl Builder {
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn retryable(mut self, input: bool) -> Self {
self.retryable = Some(input);
self
}
pub fn set_retryable(mut self, input: std::option::Option<bool>) -> Self {
self.retryable = input;
self
}
pub fn build(self) -> crate::error::InvalidRequestException {
crate::error::InvalidRequestException {
message: self.message,
retryable: self.retryable.unwrap_or_default(),
}
}
}
}
impl InvalidRequestException {
pub fn builder() -> crate::error::invalid_request_exception::Builder {
crate::error::invalid_request_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloudHsmServiceException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub retryable: bool,
}
impl CloudHsmServiceException {
pub fn retryable(&self) -> bool {
self.retryable
}
}
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>,
pub(crate) retryable: std::option::Option<bool>,
}
impl Builder {
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn retryable(mut self, input: bool) -> Self {
self.retryable = Some(input);
self
}
pub fn set_retryable(mut self, input: std::option::Option<bool>) -> Self {
self.retryable = input;
self
}
pub fn build(self) -> crate::error::CloudHsmServiceException {
crate::error::CloudHsmServiceException {
message: self.message,
retryable: self.retryable.unwrap_or_default(),
}
}
}
}
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 CloudHsmInternalException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub retryable: bool,
}
impl CloudHsmInternalException {
pub fn retryable(&self) -> bool {
self.retryable
}
}
impl CloudHsmInternalException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CloudHsmInternalException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CloudHsmInternalException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for CloudHsmInternalException {}
pub mod cloud_hsm_internal_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>,
pub(crate) retryable: std::option::Option<bool>,
}
impl Builder {
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn retryable(mut self, input: bool) -> Self {
self.retryable = Some(input);
self
}
pub fn set_retryable(mut self, input: std::option::Option<bool>) -> Self {
self.retryable = input;
self
}
pub fn build(self) -> crate::error::CloudHsmInternalException {
crate::error::CloudHsmInternalException {
message: self.message,
retryable: self.retryable.unwrap_or_default(),
}
}
}
}
impl CloudHsmInternalException {
pub fn builder() -> crate::error::cloud_hsm_internal_exception::Builder {
crate::error::cloud_hsm_internal_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ModifyLunaClientError {
pub kind: ModifyLunaClientErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ModifyLunaClientError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ModifyLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ModifyLunaClientErrorKind {
CloudHsmServiceException(crate::error::CloudHsmServiceException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ModifyLunaClientError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ModifyLunaClientErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ModifyLunaClientErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ModifyLunaClientError {
fn code(&self) -> Option<&str> {
ModifyLunaClientError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ModifyLunaClientError {
pub fn new(kind: ModifyLunaClientErrorKind, 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: ModifyLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ModifyLunaClientErrorKind::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_service_exception(&self) -> bool {
matches!(
&self.kind,
ModifyLunaClientErrorKind::CloudHsmServiceException(_)
)
}
}
impl std::error::Error for ModifyLunaClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ModifyLunaClientErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ModifyLunaClientErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ModifyHsmError {
pub kind: ModifyHsmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ModifyHsmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ModifyHsmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ModifyHsmErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ModifyHsmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ModifyHsmErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ModifyHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ModifyHsmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ModifyHsmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ModifyHsmError {
fn code(&self) -> Option<&str> {
ModifyHsmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ModifyHsmError {
pub fn new(kind: ModifyHsmErrorKind, 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: ModifyHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ModifyHsmErrorKind::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_internal_exception(&self) -> bool {
matches!(&self.kind, ModifyHsmErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, ModifyHsmErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, ModifyHsmErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for ModifyHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ModifyHsmErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ModifyHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ModifyHsmErrorKind::InvalidRequestException(_inner) => Some(_inner),
ModifyHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ModifyHapgError {
pub kind: ModifyHapgErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ModifyHapgError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ModifyHapgErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ModifyHapgErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ModifyHapgError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ModifyHapgErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ModifyHapgErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ModifyHapgErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ModifyHapgErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ModifyHapgError {
fn code(&self) -> Option<&str> {
ModifyHapgError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ModifyHapgError {
pub fn new(kind: ModifyHapgErrorKind, 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: ModifyHapgErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ModifyHapgErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
ModifyHapgErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, ModifyHapgErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, ModifyHapgErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for ModifyHapgError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ModifyHapgErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ModifyHapgErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ModifyHapgErrorKind::InvalidRequestException(_inner) => Some(_inner),
ModifyHapgErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListTagsForResourceError {
pub kind: ListTagsForResourceErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListTagsForResourceError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListTagsForResourceErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListTagsForResourceErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListTagsForResourceErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListTagsForResourceError {
fn code(&self) -> Option<&str> {
ListTagsForResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListTagsForResourceError {
pub fn new(kind: ListTagsForResourceErrorKind, 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: ListTagsForResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListTagsForResourceErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for ListTagsForResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListTagsForResourceErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListLunaClientsError {
pub kind: ListLunaClientsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListLunaClientsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListLunaClientsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListLunaClientsErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListLunaClientsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListLunaClientsErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ListLunaClientsErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListLunaClientsErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListLunaClientsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListLunaClientsError {
fn code(&self) -> Option<&str> {
ListLunaClientsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListLunaClientsError {
pub fn new(kind: ListLunaClientsErrorKind, 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: ListLunaClientsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListLunaClientsErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
ListLunaClientsErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
ListLunaClientsErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ListLunaClientsErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for ListLunaClientsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListLunaClientsErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ListLunaClientsErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListLunaClientsErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListLunaClientsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListHsmsError {
pub kind: ListHsmsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListHsmsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListHsmsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListHsmsErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListHsmsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListHsmsErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ListHsmsErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListHsmsErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListHsmsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListHsmsError {
fn code(&self) -> Option<&str> {
ListHsmsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListHsmsError {
pub fn new(kind: ListHsmsErrorKind, 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: ListHsmsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListHsmsErrorKind::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_internal_exception(&self) -> bool {
matches!(&self.kind, ListHsmsErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, ListHsmsErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, ListHsmsErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for ListHsmsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListHsmsErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ListHsmsErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListHsmsErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListHsmsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListHapgsError {
pub kind: ListHapgsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListHapgsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListHapgsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListHapgsErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListHapgsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListHapgsErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ListHapgsErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListHapgsErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListHapgsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListHapgsError {
fn code(&self) -> Option<&str> {
ListHapgsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListHapgsError {
pub fn new(kind: ListHapgsErrorKind, 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: ListHapgsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListHapgsErrorKind::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_internal_exception(&self) -> bool {
matches!(&self.kind, ListHapgsErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, ListHapgsErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, ListHapgsErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for ListHapgsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListHapgsErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ListHapgsErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListHapgsErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListHapgsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListAvailableZonesError {
pub kind: ListAvailableZonesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListAvailableZonesError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListAvailableZonesErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListAvailableZonesErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListAvailableZonesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListAvailableZonesErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
ListAvailableZonesErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
ListAvailableZonesErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListAvailableZonesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListAvailableZonesError {
fn code(&self) -> Option<&str> {
ListAvailableZonesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListAvailableZonesError {
pub fn new(kind: ListAvailableZonesErrorKind, 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: ListAvailableZonesErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListAvailableZonesErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
ListAvailableZonesErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
ListAvailableZonesErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ListAvailableZonesErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for ListAvailableZonesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListAvailableZonesErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
ListAvailableZonesErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
ListAvailableZonesErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListAvailableZonesErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetConfigError {
pub kind: GetConfigErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetConfigError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetConfigErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetConfigErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetConfigError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetConfigErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
GetConfigErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
GetConfigErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
GetConfigErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetConfigError {
fn code(&self) -> Option<&str> {
GetConfigError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetConfigError {
pub fn new(kind: GetConfigErrorKind, 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: GetConfigErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetConfigErrorKind::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_internal_exception(&self) -> bool {
matches!(&self.kind, GetConfigErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, GetConfigErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, GetConfigErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for GetConfigError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetConfigErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
GetConfigErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
GetConfigErrorKind::InvalidRequestException(_inner) => Some(_inner),
GetConfigErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeLunaClientError {
pub kind: DescribeLunaClientErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeLunaClientError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeLunaClientErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeLunaClientError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeLunaClientErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
DescribeLunaClientErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DescribeLunaClientErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DescribeLunaClientErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeLunaClientError {
fn code(&self) -> Option<&str> {
DescribeLunaClientError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeLunaClientError {
pub fn new(kind: DescribeLunaClientErrorKind, 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: DescribeLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeLunaClientErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
DescribeLunaClientErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeLunaClientErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeLunaClientErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for DescribeLunaClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeLunaClientErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DescribeLunaClientErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DescribeLunaClientErrorKind::InvalidRequestException(_inner) => Some(_inner),
DescribeLunaClientErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeHsmError {
pub kind: DescribeHsmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeHsmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeHsmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeHsmErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeHsmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeHsmErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
DescribeHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DescribeHsmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DescribeHsmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeHsmError {
fn code(&self) -> Option<&str> {
DescribeHsmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeHsmError {
pub fn new(kind: DescribeHsmErrorKind, 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: DescribeHsmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeHsmErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
DescribeHsmErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeHsmErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, DescribeHsmErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for DescribeHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeHsmErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DescribeHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DescribeHsmErrorKind::InvalidRequestException(_inner) => Some(_inner),
DescribeHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeHapgError {
pub kind: DescribeHapgErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeHapgError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeHapgErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeHapgErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeHapgError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeHapgErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
DescribeHapgErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DescribeHapgErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DescribeHapgErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeHapgError {
fn code(&self) -> Option<&str> {
DescribeHapgError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeHapgError {
pub fn new(kind: DescribeHapgErrorKind, 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: DescribeHapgErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeHapgErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
DescribeHapgErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeHapgErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeHapgErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for DescribeHapgError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeHapgErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DescribeHapgErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DescribeHapgErrorKind::InvalidRequestException(_inner) => Some(_inner),
DescribeHapgErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteLunaClientError {
pub kind: DeleteLunaClientErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteLunaClientError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteLunaClientErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteLunaClientError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteLunaClientErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
DeleteLunaClientErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteLunaClientErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DeleteLunaClientErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteLunaClientError {
fn code(&self) -> Option<&str> {
DeleteLunaClientError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteLunaClientError {
pub fn new(kind: DeleteLunaClientErrorKind, 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: DeleteLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteLunaClientErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
DeleteLunaClientErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteLunaClientErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DeleteLunaClientErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for DeleteLunaClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteLunaClientErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DeleteLunaClientErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteLunaClientErrorKind::InvalidRequestException(_inner) => Some(_inner),
DeleteLunaClientErrorKind::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 {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
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::CloudHsmInternalException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteHsmErrorKind::InvalidRequestException(_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_internal_exception(&self) -> bool {
matches!(&self.kind, DeleteHsmErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, DeleteHsmErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, DeleteHsmErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for DeleteHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteHsmErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DeleteHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteHsmErrorKind::InvalidRequestException(_inner) => Some(_inner),
DeleteHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteHapgError {
pub kind: DeleteHapgErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteHapgError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteHapgErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteHapgErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteHapgError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteHapgErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
DeleteHapgErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
DeleteHapgErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DeleteHapgErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteHapgError {
fn code(&self) -> Option<&str> {
DeleteHapgError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteHapgError {
pub fn new(kind: DeleteHapgErrorKind, 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: DeleteHapgErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteHapgErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
DeleteHapgErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, DeleteHapgErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, DeleteHapgErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for DeleteHapgError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteHapgErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
DeleteHapgErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
DeleteHapgErrorKind::InvalidRequestException(_inner) => Some(_inner),
DeleteHapgErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateLunaClientError {
pub kind: CreateLunaClientErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateLunaClientError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateLunaClientErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateLunaClientError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateLunaClientErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
CreateLunaClientErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CreateLunaClientErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
CreateLunaClientErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateLunaClientError {
fn code(&self) -> Option<&str> {
CreateLunaClientError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateLunaClientError {
pub fn new(kind: CreateLunaClientErrorKind, 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: CreateLunaClientErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateLunaClientErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
CreateLunaClientErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateLunaClientErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
CreateLunaClientErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for CreateLunaClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateLunaClientErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
CreateLunaClientErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CreateLunaClientErrorKind::InvalidRequestException(_inner) => Some(_inner),
CreateLunaClientErrorKind::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 {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
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::CloudHsmInternalException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CreateHsmErrorKind::InvalidRequestException(_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_internal_exception(&self) -> bool {
matches!(&self.kind, CreateHsmErrorKind::CloudHsmInternalException(_))
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, CreateHsmErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, CreateHsmErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for CreateHsmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateHsmErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
CreateHsmErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CreateHsmErrorKind::InvalidRequestException(_inner) => Some(_inner),
CreateHsmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateHapgError {
pub kind: CreateHapgErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateHapgError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateHapgErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateHapgErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateHapgError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateHapgErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
CreateHapgErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
CreateHapgErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
CreateHapgErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateHapgError {
fn code(&self) -> Option<&str> {
CreateHapgError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateHapgError {
pub fn new(kind: CreateHapgErrorKind, 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: CreateHapgErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateHapgErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
CreateHapgErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(&self.kind, CreateHapgErrorKind::CloudHsmServiceException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, CreateHapgErrorKind::InvalidRequestException(_))
}
}
impl std::error::Error for CreateHapgError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateHapgErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
CreateHapgErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
CreateHapgErrorKind::InvalidRequestException(_inner) => Some(_inner),
CreateHapgErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AddTagsToResourceError {
pub kind: AddTagsToResourceErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for AddTagsToResourceError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: AddTagsToResourceErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AddTagsToResourceErrorKind {
CloudHsmInternalException(crate::error::CloudHsmInternalException),
CloudHsmServiceException(crate::error::CloudHsmServiceException),
InvalidRequestException(crate::error::InvalidRequestException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for AddTagsToResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AddTagsToResourceErrorKind::CloudHsmInternalException(_inner) => _inner.fmt(f),
AddTagsToResourceErrorKind::CloudHsmServiceException(_inner) => _inner.fmt(f),
AddTagsToResourceErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
AddTagsToResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AddTagsToResourceError {
fn code(&self) -> Option<&str> {
AddTagsToResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AddTagsToResourceError {
pub fn new(kind: AddTagsToResourceErrorKind, 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: AddTagsToResourceErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AddTagsToResourceErrorKind::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_internal_exception(&self) -> bool {
matches!(
&self.kind,
AddTagsToResourceErrorKind::CloudHsmInternalException(_)
)
}
pub fn is_cloud_hsm_service_exception(&self) -> bool {
matches!(
&self.kind,
AddTagsToResourceErrorKind::CloudHsmServiceException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
AddTagsToResourceErrorKind::InvalidRequestException(_)
)
}
}
impl std::error::Error for AddTagsToResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AddTagsToResourceErrorKind::CloudHsmInternalException(_inner) => Some(_inner),
AddTagsToResourceErrorKind::CloudHsmServiceException(_inner) => Some(_inner),
AddTagsToResourceErrorKind::InvalidRequestException(_inner) => Some(_inner),
AddTagsToResourceErrorKind::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 _)
}
}