#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListDetectorsError {
pub kind: ListDetectorsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListDetectorsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListDetectorsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListDetectorsErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListDetectorsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListDetectorsErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
ListDetectorsErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListDetectorsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListDetectorsErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
ListDetectorsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListDetectorsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListDetectorsError {
fn code(&self) -> Option<&str> {
ListDetectorsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListDetectorsError {
pub fn new(kind: ListDetectorsErrorKind, 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: ListDetectorsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListDetectorsErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
ListDetectorsErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
ListDetectorsErrorKind::InvalidRequestException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListDetectorsErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
ListDetectorsErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, ListDetectorsErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for ListDetectorsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListDetectorsErrorKind::InternalFailureException(_inner) => Some(_inner),
ListDetectorsErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListDetectorsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListDetectorsErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
ListDetectorsErrorKind::ThrottlingException(_inner) => Some(_inner),
ListDetectorsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ThrottlingException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ThrottlingException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ThrottlingException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ThrottlingException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for ThrottlingException {}
pub mod throttling_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 {
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 build(self) -> crate::error::ThrottlingException {
crate::error::ThrottlingException {
message: self.message,
}
}
}
}
impl ThrottlingException {
pub fn builder() -> crate::error::throttling_exception::Builder {
crate::error::throttling_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ServiceUnavailableException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ServiceUnavailableException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ServiceUnavailableException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ServiceUnavailableException")?;
if let Some(inner_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
Ok(())
}
}
impl std::error::Error for ServiceUnavailableException {}
pub mod service_unavailable_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 {
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 build(self) -> crate::error::ServiceUnavailableException {
crate::error::ServiceUnavailableException {
message: self.message,
}
}
}
}
impl ServiceUnavailableException {
pub fn builder() -> crate::error::service_unavailable_exception::Builder {
crate::error::service_unavailable_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResourceNotFoundException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ResourceNotFoundException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ResourceNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ResourceNotFoundException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for ResourceNotFoundException {}
pub mod 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 {
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 build(self) -> crate::error::ResourceNotFoundException {
crate::error::ResourceNotFoundException {
message: self.message,
}
}
}
}
impl ResourceNotFoundException {
pub fn builder() -> crate::error::resource_not_found_exception::Builder {
crate::error::resource_not_found_exception::Builder::default()
}
}
#[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>,
}
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_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
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>,
}
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 build(self) -> crate::error::InvalidRequestException {
crate::error::InvalidRequestException {
message: self.message,
}
}
}
}
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 InternalFailureException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InternalFailureException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalFailureException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalFailureException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for InternalFailureException {}
pub mod 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 {
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 build(self) -> crate::error::InternalFailureException {
crate::error::InternalFailureException {
message: self.message,
}
}
}
}
impl InternalFailureException {
pub fn builder() -> crate::error::internal_failure_exception::Builder {
crate::error::internal_failure_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListAlarmsError {
pub kind: ListAlarmsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListAlarmsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListAlarmsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListAlarmsErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListAlarmsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListAlarmsErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
ListAlarmsErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
ListAlarmsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListAlarmsErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
ListAlarmsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListAlarmsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListAlarmsError {
fn code(&self) -> Option<&str> {
ListAlarmsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListAlarmsError {
pub fn new(kind: ListAlarmsErrorKind, 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: ListAlarmsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListAlarmsErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(&self.kind, ListAlarmsErrorKind::InternalFailureException(_))
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(&self.kind, ListAlarmsErrorKind::InvalidRequestException(_))
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListAlarmsErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
ListAlarmsErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, ListAlarmsErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for ListAlarmsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListAlarmsErrorKind::InternalFailureException(_inner) => Some(_inner),
ListAlarmsErrorKind::InvalidRequestException(_inner) => Some(_inner),
ListAlarmsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListAlarmsErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
ListAlarmsErrorKind::ThrottlingException(_inner) => Some(_inner),
ListAlarmsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeDetectorError {
pub kind: DescribeDetectorErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeDetectorError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeDetectorErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeDetectorErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeDetectorError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeDetectorErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
DescribeDetectorErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DescribeDetectorErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeDetectorErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
DescribeDetectorErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DescribeDetectorErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeDetectorError {
fn code(&self) -> Option<&str> {
DescribeDetectorError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeDetectorError {
pub fn new(kind: DescribeDetectorErrorKind, 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: DescribeDetectorErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeDetectorErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DescribeDetectorErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeDetectorErrorKind::InvalidRequestException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeDetectorErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
DescribeDetectorErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
DescribeDetectorErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for DescribeDetectorError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeDetectorErrorKind::InternalFailureException(_inner) => Some(_inner),
DescribeDetectorErrorKind::InvalidRequestException(_inner) => Some(_inner),
DescribeDetectorErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DescribeDetectorErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
DescribeDetectorErrorKind::ThrottlingException(_inner) => Some(_inner),
DescribeDetectorErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeAlarmError {
pub kind: DescribeAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
DescribeAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
DescribeAlarmErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DescribeAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
DescribeAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
DescribeAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeAlarmError {
fn code(&self) -> Option<&str> {
DescribeAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeAlarmError {
pub fn new(kind: DescribeAlarmErrorKind, 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: DescribeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
DescribeAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
DescribeAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DescribeAlarmErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
DescribeAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, DescribeAlarmErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for DescribeAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
DescribeAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
DescribeAlarmErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DescribeAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
DescribeAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
DescribeAlarmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchUpdateDetectorError {
pub kind: BatchUpdateDetectorErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchUpdateDetectorError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchUpdateDetectorErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchUpdateDetectorErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchUpdateDetectorError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchUpdateDetectorErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchUpdateDetectorErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchUpdateDetectorErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchUpdateDetectorErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchUpdateDetectorErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchUpdateDetectorError {
fn code(&self) -> Option<&str> {
BatchUpdateDetectorError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchUpdateDetectorError {
pub fn new(kind: BatchUpdateDetectorErrorKind, 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: BatchUpdateDetectorErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchUpdateDetectorErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchUpdateDetectorErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchUpdateDetectorErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchUpdateDetectorErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchUpdateDetectorErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchUpdateDetectorError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchUpdateDetectorErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchUpdateDetectorErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchUpdateDetectorErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchUpdateDetectorErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchUpdateDetectorErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchSnoozeAlarmError {
pub kind: BatchSnoozeAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchSnoozeAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchSnoozeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchSnoozeAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchSnoozeAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchSnoozeAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchSnoozeAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchSnoozeAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchSnoozeAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchSnoozeAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchSnoozeAlarmError {
fn code(&self) -> Option<&str> {
BatchSnoozeAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchSnoozeAlarmError {
pub fn new(kind: BatchSnoozeAlarmErrorKind, 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: BatchSnoozeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchSnoozeAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchSnoozeAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchSnoozeAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchSnoozeAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchSnoozeAlarmErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchSnoozeAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchSnoozeAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchSnoozeAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchSnoozeAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchSnoozeAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchSnoozeAlarmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchResetAlarmError {
pub kind: BatchResetAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchResetAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchResetAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchResetAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchResetAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchResetAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchResetAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchResetAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchResetAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchResetAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchResetAlarmError {
fn code(&self) -> Option<&str> {
BatchResetAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchResetAlarmError {
pub fn new(kind: BatchResetAlarmErrorKind, 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: BatchResetAlarmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchResetAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchResetAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchResetAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchResetAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, BatchResetAlarmErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for BatchResetAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchResetAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchResetAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchResetAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchResetAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchResetAlarmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchPutMessageError {
pub kind: BatchPutMessageErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchPutMessageError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchPutMessageErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchPutMessageErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchPutMessageError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchPutMessageErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchPutMessageErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchPutMessageErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchPutMessageErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchPutMessageErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchPutMessageError {
fn code(&self) -> Option<&str> {
BatchPutMessageError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchPutMessageError {
pub fn new(kind: BatchPutMessageErrorKind, 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: BatchPutMessageErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchPutMessageErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchPutMessageErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchPutMessageErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchPutMessageErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(&self.kind, BatchPutMessageErrorKind::ThrottlingException(_))
}
}
impl std::error::Error for BatchPutMessageError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchPutMessageErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchPutMessageErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchPutMessageErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchPutMessageErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchPutMessageErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchEnableAlarmError {
pub kind: BatchEnableAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchEnableAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchEnableAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchEnableAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchEnableAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchEnableAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchEnableAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchEnableAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchEnableAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchEnableAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchEnableAlarmError {
fn code(&self) -> Option<&str> {
BatchEnableAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchEnableAlarmError {
pub fn new(kind: BatchEnableAlarmErrorKind, 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: BatchEnableAlarmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchEnableAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchEnableAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchEnableAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchEnableAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchEnableAlarmErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchEnableAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchEnableAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchEnableAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchEnableAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchEnableAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchEnableAlarmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchDisableAlarmError {
pub kind: BatchDisableAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchDisableAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchDisableAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchDisableAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchDisableAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchDisableAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchDisableAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchDisableAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchDisableAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchDisableAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchDisableAlarmError {
fn code(&self) -> Option<&str> {
BatchDisableAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchDisableAlarmError {
pub fn new(kind: BatchDisableAlarmErrorKind, 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: BatchDisableAlarmErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchDisableAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchDisableAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchDisableAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchDisableAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchDisableAlarmErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchDisableAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchDisableAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchDisableAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchDisableAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchDisableAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchDisableAlarmErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchDeleteDetectorError {
pub kind: BatchDeleteDetectorErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchDeleteDetectorError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchDeleteDetectorErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchDeleteDetectorErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchDeleteDetectorError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchDeleteDetectorErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchDeleteDetectorErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchDeleteDetectorErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchDeleteDetectorErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchDeleteDetectorErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchDeleteDetectorError {
fn code(&self) -> Option<&str> {
BatchDeleteDetectorError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchDeleteDetectorError {
pub fn new(kind: BatchDeleteDetectorErrorKind, 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: BatchDeleteDetectorErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchDeleteDetectorErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchDeleteDetectorErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchDeleteDetectorErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchDeleteDetectorErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchDeleteDetectorErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchDeleteDetectorError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchDeleteDetectorErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchDeleteDetectorErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchDeleteDetectorErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchDeleteDetectorErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchDeleteDetectorErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchAcknowledgeAlarmError {
pub kind: BatchAcknowledgeAlarmErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for BatchAcknowledgeAlarmError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: BatchAcknowledgeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchAcknowledgeAlarmErrorKind {
InternalFailureException(crate::error::InternalFailureException),
InvalidRequestException(crate::error::InvalidRequestException),
ServiceUnavailableException(crate::error::ServiceUnavailableException),
ThrottlingException(crate::error::ThrottlingException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for BatchAcknowledgeAlarmError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchAcknowledgeAlarmErrorKind::InternalFailureException(_inner) => _inner.fmt(f),
BatchAcknowledgeAlarmErrorKind::InvalidRequestException(_inner) => _inner.fmt(f),
BatchAcknowledgeAlarmErrorKind::ServiceUnavailableException(_inner) => _inner.fmt(f),
BatchAcknowledgeAlarmErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
BatchAcknowledgeAlarmErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchAcknowledgeAlarmError {
fn code(&self) -> Option<&str> {
BatchAcknowledgeAlarmError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchAcknowledgeAlarmError {
pub fn new(kind: BatchAcknowledgeAlarmErrorKind, 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: BatchAcknowledgeAlarmErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchAcknowledgeAlarmErrorKind::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_internal_failure_exception(&self) -> bool {
matches!(
&self.kind,
BatchAcknowledgeAlarmErrorKind::InternalFailureException(_)
)
}
pub fn is_invalid_request_exception(&self) -> bool {
matches!(
&self.kind,
BatchAcknowledgeAlarmErrorKind::InvalidRequestException(_)
)
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
BatchAcknowledgeAlarmErrorKind::ServiceUnavailableException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
BatchAcknowledgeAlarmErrorKind::ThrottlingException(_)
)
}
}
impl std::error::Error for BatchAcknowledgeAlarmError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchAcknowledgeAlarmErrorKind::InternalFailureException(_inner) => Some(_inner),
BatchAcknowledgeAlarmErrorKind::InvalidRequestException(_inner) => Some(_inner),
BatchAcknowledgeAlarmErrorKind::ServiceUnavailableException(_inner) => Some(_inner),
BatchAcknowledgeAlarmErrorKind::ThrottlingException(_inner) => Some(_inner),
BatchAcknowledgeAlarmErrorKind::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 _)
}
}