#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateRoutingControlStatesError {
pub kind: UpdateRoutingControlStatesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UpdateRoutingControlStatesError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UpdateRoutingControlStatesErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateRoutingControlStatesErrorKind {
AccessDeniedException(crate::error::AccessDeniedException),
ConflictException(crate::error::ConflictException),
EndpointTemporarilyUnavailableException(crate::error::EndpointTemporarilyUnavailableException),
InternalServerException(crate::error::InternalServerException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ServiceLimitExceededException(crate::error::ServiceLimitExceededException),
ThrottlingException(crate::error::ThrottlingException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UpdateRoutingControlStatesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateRoutingControlStatesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::ConflictException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::EndpointTemporarilyUnavailableException(
_inner,
) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::InternalServerException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::ServiceLimitExceededException(_inner) => {
_inner.fmt(f)
}
UpdateRoutingControlStatesErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateRoutingControlStatesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateRoutingControlStatesError {
fn code(&self) -> Option<&str> {
UpdateRoutingControlStatesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateRoutingControlStatesError {
pub fn new(kind: UpdateRoutingControlStatesErrorKind, 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: UpdateRoutingControlStatesErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateRoutingControlStatesErrorKind::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_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::AccessDeniedException(_)
)
}
pub fn is_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::ConflictException(_)
)
}
pub fn is_endpoint_temporarily_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::EndpointTemporarilyUnavailableException(_)
)
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::InternalServerException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_service_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::ServiceLimitExceededException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::ThrottlingException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStatesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateRoutingControlStatesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateRoutingControlStatesErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::ConflictException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::EndpointTemporarilyUnavailableException(
_inner,
) => Some(_inner),
UpdateRoutingControlStatesErrorKind::InternalServerException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::ServiceLimitExceededException(_inner) => {
Some(_inner)
}
UpdateRoutingControlStatesErrorKind::ThrottlingException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::ValidationException(_inner) => Some(_inner),
UpdateRoutingControlStatesErrorKind::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>,
#[doc(hidden)]
pub reason: std::option::Option<crate::model::ValidationExceptionReason>,
#[doc(hidden)]
pub fields: std::option::Option<std::vec::Vec<crate::model::ValidationExceptionField>>,
}
impl ValidationException {
pub fn reason(&self) -> std::option::Option<&crate::model::ValidationExceptionReason> {
self.reason.as_ref()
}
pub fn fields(&self) -> std::option::Option<&[crate::model::ValidationExceptionField]> {
self.fields.as_deref()
}
}
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>,
pub(crate) reason: std::option::Option<crate::model::ValidationExceptionReason>,
pub(crate) fields:
std::option::Option<std::vec::Vec<crate::model::ValidationExceptionField>>,
}
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 reason(mut self, input: crate::model::ValidationExceptionReason) -> Self {
self.reason = Some(input);
self
}
pub fn set_reason(
mut self,
input: std::option::Option<crate::model::ValidationExceptionReason>,
) -> Self {
self.reason = input;
self
}
pub fn fields(mut self, input: crate::model::ValidationExceptionField) -> Self {
let mut v = self.fields.unwrap_or_default();
v.push(input);
self.fields = Some(v);
self
}
pub fn set_fields(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ValidationExceptionField>>,
) -> Self {
self.fields = input;
self
}
pub fn build(self) -> crate::error::ValidationException {
crate::error::ValidationException {
message: self.message,
reason: self.reason,
fields: self.fields,
}
}
}
}
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 ThrottlingException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub retry_after_seconds: i32,
}
impl ThrottlingException {
pub fn retry_after_seconds(&self) -> i32 {
self.retry_after_seconds
}
}
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_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
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>,
pub(crate) retry_after_seconds: std::option::Option<i32>,
}
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 retry_after_seconds(mut self, input: i32) -> Self {
self.retry_after_seconds = Some(input);
self
}
pub fn set_retry_after_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.retry_after_seconds = input;
self
}
pub fn build(self) -> crate::error::ThrottlingException {
crate::error::ThrottlingException {
message: self.message,
retry_after_seconds: self.retry_after_seconds.unwrap_or_default(),
}
}
}
}
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 ServiceLimitExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub limit_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub service_code: std::option::Option<std::string::String>,
}
impl ServiceLimitExceededException {
pub fn resource_id(&self) -> std::option::Option<&str> {
self.resource_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
pub fn limit_code(&self) -> std::option::Option<&str> {
self.limit_code.as_deref()
}
pub fn service_code(&self) -> std::option::Option<&str> {
self.service_code.as_deref()
}
}
impl ServiceLimitExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ServiceLimitExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ServiceLimitExceededException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for ServiceLimitExceededException {}
pub mod service_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>,
pub(crate) resource_id: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) limit_code: std::option::Option<std::string::String>,
pub(crate) service_code: 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 resource_id(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_id = Some(input.into());
self
}
pub fn set_resource_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
pub fn limit_code(mut self, input: impl Into<std::string::String>) -> Self {
self.limit_code = Some(input.into());
self
}
pub fn set_limit_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.limit_code = input;
self
}
pub fn service_code(mut self, input: impl Into<std::string::String>) -> Self {
self.service_code = Some(input.into());
self
}
pub fn set_service_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.service_code = input;
self
}
pub fn build(self) -> crate::error::ServiceLimitExceededException {
crate::error::ServiceLimitExceededException {
message: self.message,
resource_id: self.resource_id,
resource_type: self.resource_type,
limit_code: self.limit_code,
service_code: self.service_code,
}
}
}
}
impl ServiceLimitExceededException {
pub fn builder() -> crate::error::service_limit_exceeded_exception::Builder {
crate::error::service_limit_exceeded_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResourceNotFoundException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
}
impl ResourceNotFoundException {
pub fn resource_id(&self) -> std::option::Option<&str> {
self.resource_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
}
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_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
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>,
pub(crate) resource_id: std::option::Option<std::string::String>,
pub(crate) resource_type: 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 resource_id(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_id = Some(input.into());
self
}
pub fn set_resource_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
pub fn build(self) -> crate::error::ResourceNotFoundException {
crate::error::ResourceNotFoundException {
message: self.message,
resource_id: self.resource_id,
resource_type: self.resource_type,
}
}
}
}
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 InternalServerException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub retry_after_seconds: i32,
}
impl InternalServerException {
pub fn retry_after_seconds(&self) -> i32 {
self.retry_after_seconds
}
}
impl InternalServerException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalServerException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalServerException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for InternalServerException {}
pub mod internal_server_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) retry_after_seconds: std::option::Option<i32>,
}
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 retry_after_seconds(mut self, input: i32) -> Self {
self.retry_after_seconds = Some(input);
self
}
pub fn set_retry_after_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.retry_after_seconds = input;
self
}
pub fn build(self) -> crate::error::InternalServerException {
crate::error::InternalServerException {
message: self.message,
retry_after_seconds: self.retry_after_seconds.unwrap_or_default(),
}
}
}
}
impl InternalServerException {
pub fn builder() -> crate::error::internal_server_exception::Builder {
crate::error::internal_server_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EndpointTemporarilyUnavailableException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl EndpointTemporarilyUnavailableException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for EndpointTemporarilyUnavailableException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "EndpointTemporarilyUnavailableException")?;
if let Some(inner_6) = &self.message {
{
write!(f, ": {}", inner_6)?;
}
}
Ok(())
}
}
impl std::error::Error for EndpointTemporarilyUnavailableException {}
pub mod endpoint_temporarily_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 {
#[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::EndpointTemporarilyUnavailableException {
crate::error::EndpointTemporarilyUnavailableException {
message: self.message,
}
}
}
}
impl EndpointTemporarilyUnavailableException {
pub fn builder() -> crate::error::endpoint_temporarily_unavailable_exception::Builder {
crate::error::endpoint_temporarily_unavailable_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ConflictException {
#[doc(hidden)]
pub message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
}
impl ConflictException {
pub fn resource_id(&self) -> std::option::Option<&str> {
self.resource_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
}
impl ConflictException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ConflictException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ConflictException")?;
if let Some(inner_7) = &self.message {
{
write!(f, ": {}", inner_7)?;
}
}
Ok(())
}
}
impl std::error::Error for ConflictException {}
pub mod conflict_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) resource_id: std::option::Option<std::string::String>,
pub(crate) resource_type: 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 resource_id(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_id = Some(input.into());
self
}
pub fn set_resource_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
pub fn build(self) -> crate::error::ConflictException {
crate::error::ConflictException {
message: self.message,
resource_id: self.resource_id,
resource_type: self.resource_type,
}
}
}
}
impl ConflictException {
pub fn builder() -> crate::error::conflict_exception::Builder {
crate::error::conflict_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AccessDeniedException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl AccessDeniedException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for AccessDeniedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AccessDeniedException")?;
if let Some(inner_8) = &self.message {
{
write!(f, ": {}", inner_8)?;
}
}
Ok(())
}
}
impl std::error::Error for AccessDeniedException {}
pub mod access_denied_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn build(self) -> crate::error::AccessDeniedException {
crate::error::AccessDeniedException {
message: self.message,
}
}
}
}
impl AccessDeniedException {
pub fn builder() -> crate::error::access_denied_exception::Builder {
crate::error::access_denied_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateRoutingControlStateError {
pub kind: UpdateRoutingControlStateErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for UpdateRoutingControlStateError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: UpdateRoutingControlStateErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateRoutingControlStateErrorKind {
AccessDeniedException(crate::error::AccessDeniedException),
ConflictException(crate::error::ConflictException),
EndpointTemporarilyUnavailableException(crate::error::EndpointTemporarilyUnavailableException),
InternalServerException(crate::error::InternalServerException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ThrottlingException(crate::error::ThrottlingException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for UpdateRoutingControlStateError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateRoutingControlStateErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::ConflictException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
_inner.fmt(f)
}
UpdateRoutingControlStateErrorKind::InternalServerException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateRoutingControlStateErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateRoutingControlStateError {
fn code(&self) -> Option<&str> {
UpdateRoutingControlStateError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateRoutingControlStateError {
pub fn new(kind: UpdateRoutingControlStateErrorKind, 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: UpdateRoutingControlStateErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateRoutingControlStateErrorKind::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_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::AccessDeniedException(_)
)
}
pub fn is_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::ConflictException(_)
)
}
pub fn is_endpoint_temporarily_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_)
)
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::InternalServerException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::ThrottlingException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateRoutingControlStateErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateRoutingControlStateError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateRoutingControlStateErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::ConflictException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
Some(_inner)
}
UpdateRoutingControlStateErrorKind::InternalServerException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::ThrottlingException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::ValidationException(_inner) => Some(_inner),
UpdateRoutingControlStateErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListRoutingControlsError {
pub kind: ListRoutingControlsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListRoutingControlsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListRoutingControlsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListRoutingControlsErrorKind {
AccessDeniedException(crate::error::AccessDeniedException),
EndpointTemporarilyUnavailableException(crate::error::EndpointTemporarilyUnavailableException),
InternalServerException(crate::error::InternalServerException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ThrottlingException(crate::error::ThrottlingException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListRoutingControlsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListRoutingControlsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListRoutingControlsErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
_inner.fmt(f)
}
ListRoutingControlsErrorKind::InternalServerException(_inner) => _inner.fmt(f),
ListRoutingControlsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListRoutingControlsErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
ListRoutingControlsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListRoutingControlsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListRoutingControlsError {
fn code(&self) -> Option<&str> {
ListRoutingControlsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListRoutingControlsError {
pub fn new(kind: ListRoutingControlsErrorKind, 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: ListRoutingControlsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListRoutingControlsErrorKind::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_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::AccessDeniedException(_)
)
}
pub fn is_endpoint_temporarily_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::EndpointTemporarilyUnavailableException(_)
)
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::InternalServerException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::ThrottlingException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListRoutingControlsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListRoutingControlsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListRoutingControlsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListRoutingControlsErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
Some(_inner)
}
ListRoutingControlsErrorKind::InternalServerException(_inner) => Some(_inner),
ListRoutingControlsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListRoutingControlsErrorKind::ThrottlingException(_inner) => Some(_inner),
ListRoutingControlsErrorKind::ValidationException(_inner) => Some(_inner),
ListRoutingControlsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetRoutingControlStateError {
pub kind: GetRoutingControlStateErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetRoutingControlStateError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetRoutingControlStateErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetRoutingControlStateErrorKind {
AccessDeniedException(crate::error::AccessDeniedException),
EndpointTemporarilyUnavailableException(crate::error::EndpointTemporarilyUnavailableException),
InternalServerException(crate::error::InternalServerException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ThrottlingException(crate::error::ThrottlingException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetRoutingControlStateError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetRoutingControlStateErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
_inner.fmt(f)
}
GetRoutingControlStateErrorKind::InternalServerException(_inner) => _inner.fmt(f),
GetRoutingControlStateErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetRoutingControlStateErrorKind::ThrottlingException(_inner) => _inner.fmt(f),
GetRoutingControlStateErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetRoutingControlStateErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetRoutingControlStateError {
fn code(&self) -> Option<&str> {
GetRoutingControlStateError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetRoutingControlStateError {
pub fn new(kind: GetRoutingControlStateErrorKind, 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: GetRoutingControlStateErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetRoutingControlStateErrorKind::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_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::AccessDeniedException(_)
)
}
pub fn is_endpoint_temporarily_unavailable_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_)
)
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::InternalServerException(_)
)
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::ResourceNotFoundException(_)
)
}
pub fn is_throttling_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::ThrottlingException(_)
)
}
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetRoutingControlStateErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetRoutingControlStateError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetRoutingControlStateErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetRoutingControlStateErrorKind::EndpointTemporarilyUnavailableException(_inner) => {
Some(_inner)
}
GetRoutingControlStateErrorKind::InternalServerException(_inner) => Some(_inner),
GetRoutingControlStateErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetRoutingControlStateErrorKind::ThrottlingException(_inner) => Some(_inner),
GetRoutingControlStateErrorKind::ValidationException(_inner) => Some(_inner),
GetRoutingControlStateErrorKind::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 _)
}
}