#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct InvokeEndpointError {
pub kind: InvokeEndpointErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum InvokeEndpointErrorKind {
InternalFailure(crate::error::InternalFailure),
ModelError(crate::error::ModelError),
ServiceUnavailable(crate::error::ServiceUnavailable),
ValidationError(crate::error::ValidationError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for InvokeEndpointError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
InvokeEndpointErrorKind::InternalFailure(_inner) => _inner.fmt(f),
InvokeEndpointErrorKind::ModelError(_inner) => _inner.fmt(f),
InvokeEndpointErrorKind::ServiceUnavailable(_inner) => _inner.fmt(f),
InvokeEndpointErrorKind::ValidationError(_inner) => _inner.fmt(f),
InvokeEndpointErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for InvokeEndpointError {
fn code(&self) -> Option<&str> {
InvokeEndpointError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl InvokeEndpointError {
pub fn new(kind: InvokeEndpointErrorKind, 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: InvokeEndpointErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: InvokeEndpointErrorKind::Unhandled(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(&self) -> bool {
matches!(&self.kind, InvokeEndpointErrorKind::InternalFailure(_))
}
pub fn is_model_error(&self) -> bool {
matches!(&self.kind, InvokeEndpointErrorKind::ModelError(_))
}
pub fn is_service_unavailable(&self) -> bool {
matches!(&self.kind, InvokeEndpointErrorKind::ServiceUnavailable(_))
}
pub fn is_validation_error(&self) -> bool {
matches!(&self.kind, InvokeEndpointErrorKind::ValidationError(_))
}
}
impl std::error::Error for InvokeEndpointError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
InvokeEndpointErrorKind::InternalFailure(_inner) => Some(_inner),
InvokeEndpointErrorKind::ModelError(_inner) => Some(_inner),
InvokeEndpointErrorKind::ServiceUnavailable(_inner) => Some(_inner),
InvokeEndpointErrorKind::ValidationError(_inner) => Some(_inner),
InvokeEndpointErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct InvokeEndpointAsyncError {
pub kind: InvokeEndpointAsyncErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum InvokeEndpointAsyncErrorKind {
InternalFailure(crate::error::InternalFailure),
ServiceUnavailable(crate::error::ServiceUnavailable),
ValidationError(crate::error::ValidationError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for InvokeEndpointAsyncError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
InvokeEndpointAsyncErrorKind::InternalFailure(_inner) => _inner.fmt(f),
InvokeEndpointAsyncErrorKind::ServiceUnavailable(_inner) => _inner.fmt(f),
InvokeEndpointAsyncErrorKind::ValidationError(_inner) => _inner.fmt(f),
InvokeEndpointAsyncErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for InvokeEndpointAsyncError {
fn code(&self) -> Option<&str> {
InvokeEndpointAsyncError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl InvokeEndpointAsyncError {
pub fn new(kind: InvokeEndpointAsyncErrorKind, 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: InvokeEndpointAsyncErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: InvokeEndpointAsyncErrorKind::Unhandled(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(&self) -> bool {
matches!(&self.kind, InvokeEndpointAsyncErrorKind::InternalFailure(_))
}
pub fn is_service_unavailable(&self) -> bool {
matches!(
&self.kind,
InvokeEndpointAsyncErrorKind::ServiceUnavailable(_)
)
}
pub fn is_validation_error(&self) -> bool {
matches!(&self.kind, InvokeEndpointAsyncErrorKind::ValidationError(_))
}
}
impl std::error::Error for InvokeEndpointAsyncError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
InvokeEndpointAsyncErrorKind::InternalFailure(_inner) => Some(_inner),
InvokeEndpointAsyncErrorKind::ServiceUnavailable(_inner) => Some(_inner),
InvokeEndpointAsyncErrorKind::ValidationError(_inner) => Some(_inner),
InvokeEndpointAsyncErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ValidationError {
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ValidationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ValidationError");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ValidationError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ValidationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ValidationError")?;
if let Some(inner_1) = &self.message {
write!(f, ": {}", inner_1)?;
}
Ok(())
}
}
impl std::error::Error for ValidationError {}
pub mod validation_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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::ValidationError {
crate::error::ValidationError {
message: self.message,
}
}
}
}
impl ValidationError {
pub fn builder() -> crate::error::validation_error::Builder {
crate::error::validation_error::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ServiceUnavailable {
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ServiceUnavailable {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ServiceUnavailable");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ServiceUnavailable {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ServiceUnavailable {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ServiceUnavailable")?;
if let Some(inner_2) = &self.message {
write!(f, ": {}", inner_2)?;
}
Ok(())
}
}
impl std::error::Error for ServiceUnavailable {}
pub mod service_unavailable {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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::ServiceUnavailable {
crate::error::ServiceUnavailable {
message: self.message,
}
}
}
}
impl ServiceUnavailable {
pub fn builder() -> crate::error::service_unavailable::Builder {
crate::error::service_unavailable::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InternalFailure {
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InternalFailure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InternalFailure");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InternalFailure {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalFailure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalFailure")?;
if let Some(inner_3) = &self.message {
write!(f, ": {}", inner_3)?;
}
Ok(())
}
}
impl std::error::Error for InternalFailure {}
pub mod internal_failure {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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::InternalFailure {
crate::error::InternalFailure {
message: self.message,
}
}
}
}
impl InternalFailure {
pub fn builder() -> crate::error::internal_failure::Builder {
crate::error::internal_failure::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ModelError {
#[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
pub original_status_code: std::option::Option<i32>,
pub original_message: std::option::Option<std::string::String>,
pub log_stream_arn: std::option::Option<std::string::String>,
}
impl ModelError {
pub fn original_status_code(&self) -> std::option::Option<i32> {
self.original_status_code
}
pub fn original_message(&self) -> std::option::Option<&str> {
self.original_message.as_deref()
}
pub fn log_stream_arn(&self) -> std::option::Option<&str> {
self.log_stream_arn.as_deref()
}
}
impl std::fmt::Debug for ModelError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ModelError");
formatter.field("message", &self.message);
formatter.field("original_status_code", &self.original_status_code);
formatter.field("original_message", &self.original_message);
formatter.field("log_stream_arn", &self.log_stream_arn);
formatter.finish()
}
}
impl ModelError {
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ModelError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ModelError")?;
if let Some(inner_4) = &self.message {
write!(f, ": {}", inner_4)?;
}
Ok(())
}
}
impl std::error::Error for ModelError {}
pub mod model_error {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) original_status_code: std::option::Option<i32>,
pub(crate) original_message: std::option::Option<std::string::String>,
pub(crate) log_stream_arn: 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 original_status_code(mut self, input: i32) -> Self {
self.original_status_code = Some(input);
self
}
pub fn set_original_status_code(mut self, input: std::option::Option<i32>) -> Self {
self.original_status_code = input;
self
}
pub fn original_message(mut self, input: impl Into<std::string::String>) -> Self {
self.original_message = Some(input.into());
self
}
pub fn set_original_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.original_message = input;
self
}
pub fn log_stream_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.log_stream_arn = Some(input.into());
self
}
pub fn set_log_stream_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.log_stream_arn = input;
self
}
pub fn build(self) -> crate::error::ModelError {
crate::error::ModelError {
message: self.message,
original_status_code: self.original_status_code,
original_message: self.original_message,
log_stream_arn: self.log_stream_arn,
}
}
}
}
impl ModelError {
pub fn builder() -> crate::error::model_error::Builder {
crate::error::model_error::Builder::default()
}
}