#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateScalingPlanError {
pub kind: UpdateScalingPlanErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UpdateScalingPlanError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UpdateScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateScalingPlanErrorKind {
ConcurrentUpdateException(crate::error::ConcurrentUpdateException),
InternalServiceException(crate::error::InternalServiceException),
ObjectNotFoundException(crate::error::ObjectNotFoundException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UpdateScalingPlanError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateScalingPlanErrorKind::ConcurrentUpdateException(_inner) => _inner.fmt(f),
UpdateScalingPlanErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateScalingPlanErrorKind::ObjectNotFoundException(_inner) => _inner.fmt(f),
UpdateScalingPlanErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateScalingPlanErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateScalingPlanError {
fn code(&self) -> Option<&str> {
UpdateScalingPlanError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateScalingPlanError {
pub fn new(kind: UpdateScalingPlanErrorKind, 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: UpdateScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateScalingPlanErrorKind::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_concurrent_update_exception(&self) -> bool {
matches!(
&self.kind,
UpdateScalingPlanErrorKind::ConcurrentUpdateException(_)
)
}
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateScalingPlanErrorKind::InternalServiceException(_)
)
}
pub fn is_object_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateScalingPlanErrorKind::ObjectNotFoundException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateScalingPlanErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateScalingPlanError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateScalingPlanErrorKind::ConcurrentUpdateException(_inner) => Some(_inner),
UpdateScalingPlanErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateScalingPlanErrorKind::ObjectNotFoundException(_inner) => Some(_inner),
UpdateScalingPlanErrorKind::ValidationException(_inner) => Some(_inner),
UpdateScalingPlanErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ValidationException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ValidationException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ValidationException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for ValidationException {}
pub mod validation_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::ValidationException {
crate::error::ValidationException {
message: self.message,
}
}
}
}
impl ValidationException {
pub fn builder() -> crate::error::validation_exception::Builder {
crate::error::validation_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ObjectNotFoundException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ObjectNotFoundException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ObjectNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ObjectNotFoundException")?;
if let Some(inner_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
Ok(())
}
}
impl std::error::Error for ObjectNotFoundException {}
pub mod object_not_found_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::ObjectNotFoundException {
crate::error::ObjectNotFoundException {
message: self.message,
}
}
}
}
impl ObjectNotFoundException {
pub fn builder() -> crate::error::object_not_found_exception::Builder {
crate::error::object_not_found_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InternalServiceException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InternalServiceException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalServiceException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalServiceException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for InternalServiceException {}
pub mod internal_service_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::InternalServiceException {
crate::error::InternalServiceException {
message: self.message,
}
}
}
}
impl InternalServiceException {
pub fn builder() -> crate::error::internal_service_exception::Builder {
crate::error::internal_service_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ConcurrentUpdateException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ConcurrentUpdateException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ConcurrentUpdateException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ConcurrentUpdateException")?;
if let Some(inner_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
Ok(())
}
}
impl std::error::Error for ConcurrentUpdateException {}
pub mod concurrent_update_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::ConcurrentUpdateException {
crate::error::ConcurrentUpdateException {
message: self.message,
}
}
}
}
impl ConcurrentUpdateException {
pub fn builder() -> crate::error::concurrent_update_exception::Builder {
crate::error::concurrent_update_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetScalingPlanResourceForecastDataError {
pub kind: GetScalingPlanResourceForecastDataErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetScalingPlanResourceForecastDataError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetScalingPlanResourceForecastDataErrorKind::Unhandled(
crate::error::Unhandled::new(source),
),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetScalingPlanResourceForecastDataErrorKind {
InternalServiceException(crate::error::InternalServiceException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetScalingPlanResourceForecastDataError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetScalingPlanResourceForecastDataErrorKind::InternalServiceException(_inner) => {
_inner.fmt(f)
}
GetScalingPlanResourceForecastDataErrorKind::ValidationException(_inner) => {
_inner.fmt(f)
}
GetScalingPlanResourceForecastDataErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetScalingPlanResourceForecastDataError {
fn code(&self) -> Option<&str> {
GetScalingPlanResourceForecastDataError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetScalingPlanResourceForecastDataError {
pub fn new(
kind: GetScalingPlanResourceForecastDataErrorKind,
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: GetScalingPlanResourceForecastDataErrorKind::Unhandled(
crate::error::Unhandled::new(err.into()),
),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetScalingPlanResourceForecastDataErrorKind::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_service_exception(&self) -> bool {
matches!(
&self.kind,
GetScalingPlanResourceForecastDataErrorKind::InternalServiceException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetScalingPlanResourceForecastDataErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetScalingPlanResourceForecastDataError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetScalingPlanResourceForecastDataErrorKind::InternalServiceException(_inner) => {
Some(_inner)
}
GetScalingPlanResourceForecastDataErrorKind::ValidationException(_inner) => {
Some(_inner)
}
GetScalingPlanResourceForecastDataErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeScalingPlansError {
pub kind: DescribeScalingPlansErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeScalingPlansError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeScalingPlansErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeScalingPlansErrorKind {
ConcurrentUpdateException(crate::error::ConcurrentUpdateException),
InternalServiceException(crate::error::InternalServiceException),
InvalidNextTokenException(crate::error::InvalidNextTokenException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeScalingPlansError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeScalingPlansErrorKind::ConcurrentUpdateException(_inner) => _inner.fmt(f),
DescribeScalingPlansErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DescribeScalingPlansErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
DescribeScalingPlansErrorKind::ValidationException(_inner) => _inner.fmt(f),
DescribeScalingPlansErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeScalingPlansError {
fn code(&self) -> Option<&str> {
DescribeScalingPlansError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeScalingPlansError {
pub fn new(kind: DescribeScalingPlansErrorKind, 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: DescribeScalingPlansErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeScalingPlansErrorKind::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_concurrent_update_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlansErrorKind::ConcurrentUpdateException(_)
)
}
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlansErrorKind::InternalServiceException(_)
)
}
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlansErrorKind::InvalidNextTokenException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlansErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for DescribeScalingPlansError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeScalingPlansErrorKind::ConcurrentUpdateException(_inner) => Some(_inner),
DescribeScalingPlansErrorKind::InternalServiceException(_inner) => Some(_inner),
DescribeScalingPlansErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
DescribeScalingPlansErrorKind::ValidationException(_inner) => Some(_inner),
DescribeScalingPlansErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidNextTokenException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidNextTokenException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidNextTokenException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidNextTokenException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidNextTokenException {}
pub mod invalid_next_token_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::InvalidNextTokenException {
crate::error::InvalidNextTokenException {
message: self.message,
}
}
}
}
impl InvalidNextTokenException {
pub fn builder() -> crate::error::invalid_next_token_exception::Builder {
crate::error::invalid_next_token_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeScalingPlanResourcesError {
pub kind: DescribeScalingPlanResourcesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeScalingPlanResourcesError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeScalingPlanResourcesErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeScalingPlanResourcesErrorKind {
ConcurrentUpdateException(crate::error::ConcurrentUpdateException),
InternalServiceException(crate::error::InternalServiceException),
InvalidNextTokenException(crate::error::InvalidNextTokenException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeScalingPlanResourcesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeScalingPlanResourcesErrorKind::ConcurrentUpdateException(_inner) => {
_inner.fmt(f)
}
DescribeScalingPlanResourcesErrorKind::InternalServiceException(_inner) => {
_inner.fmt(f)
}
DescribeScalingPlanResourcesErrorKind::InvalidNextTokenException(_inner) => {
_inner.fmt(f)
}
DescribeScalingPlanResourcesErrorKind::ValidationException(_inner) => _inner.fmt(f),
DescribeScalingPlanResourcesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeScalingPlanResourcesError {
fn code(&self) -> Option<&str> {
DescribeScalingPlanResourcesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeScalingPlanResourcesError {
pub fn new(kind: DescribeScalingPlanResourcesErrorKind, 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: DescribeScalingPlanResourcesErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeScalingPlanResourcesErrorKind::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_concurrent_update_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlanResourcesErrorKind::ConcurrentUpdateException(_)
)
}
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlanResourcesErrorKind::InternalServiceException(_)
)
}
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlanResourcesErrorKind::InvalidNextTokenException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DescribeScalingPlanResourcesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for DescribeScalingPlanResourcesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeScalingPlanResourcesErrorKind::ConcurrentUpdateException(_inner) => {
Some(_inner)
}
DescribeScalingPlanResourcesErrorKind::InternalServiceException(_inner) => Some(_inner),
DescribeScalingPlanResourcesErrorKind::InvalidNextTokenException(_inner) => {
Some(_inner)
}
DescribeScalingPlanResourcesErrorKind::ValidationException(_inner) => Some(_inner),
DescribeScalingPlanResourcesErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteScalingPlanError {
pub kind: DeleteScalingPlanErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteScalingPlanError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteScalingPlanErrorKind {
ConcurrentUpdateException(crate::error::ConcurrentUpdateException),
InternalServiceException(crate::error::InternalServiceException),
ObjectNotFoundException(crate::error::ObjectNotFoundException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteScalingPlanError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteScalingPlanErrorKind::ConcurrentUpdateException(_inner) => _inner.fmt(f),
DeleteScalingPlanErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteScalingPlanErrorKind::ObjectNotFoundException(_inner) => _inner.fmt(f),
DeleteScalingPlanErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteScalingPlanErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteScalingPlanError {
fn code(&self) -> Option<&str> {
DeleteScalingPlanError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteScalingPlanError {
pub fn new(kind: DeleteScalingPlanErrorKind, 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: DeleteScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteScalingPlanErrorKind::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_concurrent_update_exception(&self) -> bool {
matches!(
&self.kind,
DeleteScalingPlanErrorKind::ConcurrentUpdateException(_)
)
}
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteScalingPlanErrorKind::InternalServiceException(_)
)
}
pub fn is_object_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteScalingPlanErrorKind::ObjectNotFoundException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DeleteScalingPlanErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for DeleteScalingPlanError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteScalingPlanErrorKind::ConcurrentUpdateException(_inner) => Some(_inner),
DeleteScalingPlanErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteScalingPlanErrorKind::ObjectNotFoundException(_inner) => Some(_inner),
DeleteScalingPlanErrorKind::ValidationException(_inner) => Some(_inner),
DeleteScalingPlanErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateScalingPlanError {
pub kind: CreateScalingPlanErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for CreateScalingPlanError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: CreateScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateScalingPlanErrorKind {
ConcurrentUpdateException(crate::error::ConcurrentUpdateException),
InternalServiceException(crate::error::InternalServiceException),
LimitExceededException(crate::error::LimitExceededException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for CreateScalingPlanError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateScalingPlanErrorKind::ConcurrentUpdateException(_inner) => _inner.fmt(f),
CreateScalingPlanErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateScalingPlanErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateScalingPlanErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateScalingPlanErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateScalingPlanError {
fn code(&self) -> Option<&str> {
CreateScalingPlanError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateScalingPlanError {
pub fn new(kind: CreateScalingPlanErrorKind, 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: CreateScalingPlanErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateScalingPlanErrorKind::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_concurrent_update_exception(&self) -> bool {
matches!(
&self.kind,
CreateScalingPlanErrorKind::ConcurrentUpdateException(_)
)
}
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateScalingPlanErrorKind::InternalServiceException(_)
)
}
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateScalingPlanErrorKind::LimitExceededException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateScalingPlanErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for CreateScalingPlanError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateScalingPlanErrorKind::ConcurrentUpdateException(_inner) => Some(_inner),
CreateScalingPlanErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateScalingPlanErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateScalingPlanErrorKind::ValidationException(_inner) => Some(_inner),
CreateScalingPlanErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LimitExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl LimitExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LimitExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LimitExceededException")?;
if let Some(inner_6) = &self.message {
{
write!(f, ": {}", inner_6)?;
}
}
Ok(())
}
}
impl std::error::Error for LimitExceededException {}
pub mod limit_exceeded_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::LimitExceededException {
crate::error::LimitExceededException {
message: self.message,
}
}
}
}
impl LimitExceededException {
pub fn builder() -> crate::error::limit_exceeded_exception::Builder {
crate::error::limit_exceeded_exception::Builder::default()
}
}
#[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 _)
}
}