pub use crate::types::error::_access_denied_exception::AccessDeniedException;
pub use crate::types::error::_internal_server_exception::InternalServerException;
pub use crate::types::error::_throttling_exception::ThrottlingException;
pub use crate::types::error::_validation_exception::ValidationException;
pub use crate::types::error::_conflict_exception::ConflictException;
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException;
pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededException;
pub use crate::types::error::_service_unavailable_exception::ServiceUnavailableException;
pub use crate::types::error::_model_error_exception::ModelErrorException;
pub use crate::types::error::_model_not_ready_exception::ModelNotReadyException;
pub use crate::types::error::_model_timeout_exception::ModelTimeoutException;
pub use crate::types::error::_model_stream_error_exception::ModelStreamErrorException;
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum ConverseStreamOutputError {
InternalServerException(crate::types::error::InternalServerException),
ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
ValidationException(crate::types::error::ValidationException),
ThrottlingException(crate::types::error::ThrottlingException),
ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseStreamOutputError) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ConverseStreamOutputError {
pub fn unhandled(
err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.into(),
meta: ::std::default::Default::default(),
})
}
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
meta: err,
})
}
pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::Unhandled(e) => &e.meta,
}
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(self, Self::InternalServerException(_))
}
pub fn is_model_stream_error_exception(&self) -> bool {
matches!(self, Self::ModelStreamErrorException(_))
}
pub fn is_validation_exception(&self) -> bool {
matches!(self, Self::ValidationException(_))
}
pub fn is_throttling_exception(&self) -> bool {
matches!(self, Self::ThrottlingException(_))
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(self, Self::ServiceUnavailableException(_))
}
}
impl ::std::error::Error for ConverseStreamOutputError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for ConverseStreamOutputError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::InternalServerException(_inner) => _inner.fmt(f),
Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
Self::ValidationException(_inner) => _inner.fmt(f),
Self::ThrottlingException(_inner) => _inner.fmt(f),
Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
Self::Unhandled(_inner) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseStreamOutputError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseStreamOutputError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseStreamOutputError {
fn create_unhandled_error(
source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source,
meta: meta.unwrap_or_default(),
})
}
}
impl ::aws_types::request_id::RequestId for crate::types::error::ConverseStreamOutputError {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum InvokeModelWithBidirectionalStreamInputError {
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamInputError) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl InvokeModelWithBidirectionalStreamInputError {
pub fn unhandled(
err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.into(),
meta: ::std::default::Default::default(),
})
}
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
meta: err,
})
}
pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::Unhandled(e) => &e.meta,
}
}
}
impl ::std::error::Error for InvokeModelWithBidirectionalStreamInputError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamInputError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::Unhandled(_inner) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamInputError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamInputError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamInputError {
fn create_unhandled_error(
source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source,
meta: meta.unwrap_or_default(),
})
}
}
impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamInputError {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum InvokeModelWithBidirectionalStreamOutputError {
InternalServerException(crate::types::error::InternalServerException),
ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
ValidationException(crate::types::error::ValidationException),
ThrottlingException(crate::types::error::ThrottlingException),
ModelTimeoutException(crate::types::error::ModelTimeoutException),
ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamOutputError) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl InvokeModelWithBidirectionalStreamOutputError {
pub fn unhandled(
err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.into(),
meta: ::std::default::Default::default(),
})
}
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
meta: err,
})
}
pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::Unhandled(e) => &e.meta,
}
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(self, Self::InternalServerException(_))
}
pub fn is_model_stream_error_exception(&self) -> bool {
matches!(self, Self::ModelStreamErrorException(_))
}
pub fn is_validation_exception(&self) -> bool {
matches!(self, Self::ValidationException(_))
}
pub fn is_throttling_exception(&self) -> bool {
matches!(self, Self::ThrottlingException(_))
}
pub fn is_model_timeout_exception(&self) -> bool {
matches!(self, Self::ModelTimeoutException(_))
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(self, Self::ServiceUnavailableException(_))
}
}
impl ::std::error::Error for InvokeModelWithBidirectionalStreamOutputError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamOutputError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::InternalServerException(_inner) => _inner.fmt(f),
Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
Self::ValidationException(_inner) => _inner.fmt(f),
Self::ThrottlingException(_inner) => _inner.fmt(f),
Self::ModelTimeoutException(_inner) => _inner.fmt(f),
Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
Self::Unhandled(_inner) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamOutputError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamOutputError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamOutputError {
fn create_unhandled_error(
source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source,
meta: meta.unwrap_or_default(),
})
}
}
impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamOutputError {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum ResponseStreamError {
InternalServerException(crate::types::error::InternalServerException),
ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
ValidationException(crate::types::error::ValidationException),
ThrottlingException(crate::types::error::ThrottlingException),
ModelTimeoutException(crate::types::error::ModelTimeoutException),
ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseStreamError) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ResponseStreamError {
pub fn unhandled(
err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.into(),
meta: ::std::default::Default::default(),
})
}
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
meta: err,
})
}
pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::Unhandled(e) => &e.meta,
}
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(self, Self::InternalServerException(_))
}
pub fn is_model_stream_error_exception(&self) -> bool {
matches!(self, Self::ModelStreamErrorException(_))
}
pub fn is_validation_exception(&self) -> bool {
matches!(self, Self::ValidationException(_))
}
pub fn is_throttling_exception(&self) -> bool {
matches!(self, Self::ThrottlingException(_))
}
pub fn is_model_timeout_exception(&self) -> bool {
matches!(self, Self::ModelTimeoutException(_))
}
pub fn is_service_unavailable_exception(&self) -> bool {
matches!(self, Self::ServiceUnavailableException(_))
}
}
impl ::std::error::Error for ResponseStreamError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for ResponseStreamError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::InternalServerException(_inner) => _inner.fmt(f),
Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
Self::ValidationException(_inner) => _inner.fmt(f),
Self::ThrottlingException(_inner) => _inner.fmt(f),
Self::ModelTimeoutException(_inner) => _inner.fmt(f),
Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
Self::Unhandled(_inner) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseStreamError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseStreamError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseStreamError {
fn create_unhandled_error(
source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source,
meta: meta.unwrap_or_default(),
})
}
}
impl ::aws_types::request_id::RequestId for crate::types::error::ResponseStreamError {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}
mod _access_denied_exception;
mod _conflict_exception;
mod _internal_server_exception;
mod _model_error_exception;
mod _model_not_ready_exception;
mod _model_stream_error_exception;
mod _model_timeout_exception;
mod _resource_not_found_exception;
mod _service_quota_exceeded_exception;
mod _service_unavailable_exception;
mod _throttling_exception;
mod _validation_exception;
pub mod builders;