#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct SynthesizeSpeechError {
pub kind: SynthesizeSpeechErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for SynthesizeSpeechError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: SynthesizeSpeechErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum SynthesizeSpeechErrorKind {
EngineNotSupportedException(crate::error::EngineNotSupportedException),
InvalidSampleRateException(crate::error::InvalidSampleRateException),
InvalidSsmlException(crate::error::InvalidSsmlException),
LanguageNotSupportedException(crate::error::LanguageNotSupportedException),
LexiconNotFoundException(crate::error::LexiconNotFoundException),
MarksNotSupportedForFormatException(crate::error::MarksNotSupportedForFormatException),
ServiceFailureException(crate::error::ServiceFailureException),
SsmlMarksNotSupportedForTextTypeException(
crate::error::SsmlMarksNotSupportedForTextTypeException,
),
TextLengthExceededException(crate::error::TextLengthExceededException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for SynthesizeSpeechError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
SynthesizeSpeechErrorKind::EngineNotSupportedException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::InvalidSampleRateException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::InvalidSsmlException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::LanguageNotSupportedException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::LexiconNotFoundException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::MarksNotSupportedForFormatException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::SsmlMarksNotSupportedForTextTypeException(_inner) => {
_inner.fmt(f)
}
SynthesizeSpeechErrorKind::TextLengthExceededException(_inner) => _inner.fmt(f),
SynthesizeSpeechErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for SynthesizeSpeechError {
fn code(&self) -> Option<&str> {
SynthesizeSpeechError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl SynthesizeSpeechError {
pub fn new(kind: SynthesizeSpeechErrorKind, 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: SynthesizeSpeechErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: SynthesizeSpeechErrorKind::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_engine_not_supported_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::EngineNotSupportedException(_)
)
}
pub fn is_invalid_sample_rate_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::InvalidSampleRateException(_)
)
}
pub fn is_invalid_ssml_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::InvalidSsmlException(_)
)
}
pub fn is_language_not_supported_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::LanguageNotSupportedException(_)
)
}
pub fn is_lexicon_not_found_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::LexiconNotFoundException(_)
)
}
pub fn is_marks_not_supported_for_format_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::MarksNotSupportedForFormatException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::ServiceFailureException(_)
)
}
pub fn is_ssml_marks_not_supported_for_text_type_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::SsmlMarksNotSupportedForTextTypeException(_)
)
}
pub fn is_text_length_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
SynthesizeSpeechErrorKind::TextLengthExceededException(_)
)
}
}
impl std::error::Error for SynthesizeSpeechError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
SynthesizeSpeechErrorKind::EngineNotSupportedException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::InvalidSampleRateException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::InvalidSsmlException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::LanguageNotSupportedException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::LexiconNotFoundException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::MarksNotSupportedForFormatException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::ServiceFailureException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::SsmlMarksNotSupportedForTextTypeException(_inner) => {
Some(_inner)
}
SynthesizeSpeechErrorKind::TextLengthExceededException(_inner) => Some(_inner),
SynthesizeSpeechErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TextLengthExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl TextLengthExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for TextLengthExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "TextLengthExceededException")?;
if let Some(inner_1) = &self.message {
{
write!(f, ": {}", inner_1)?;
}
}
Ok(())
}
}
impl std::error::Error for TextLengthExceededException {}
pub mod text_length_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::TextLengthExceededException {
crate::error::TextLengthExceededException {
message: self.message,
}
}
}
}
impl TextLengthExceededException {
pub fn builder() -> crate::error::text_length_exceeded_exception::Builder {
crate::error::text_length_exceeded_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SsmlMarksNotSupportedForTextTypeException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl SsmlMarksNotSupportedForTextTypeException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for SsmlMarksNotSupportedForTextTypeException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "SsmlMarksNotSupportedForTextTypeException")?;
if let Some(inner_2) = &self.message {
{
write!(f, ": {}", inner_2)?;
}
}
Ok(())
}
}
impl std::error::Error for SsmlMarksNotSupportedForTextTypeException {}
pub mod ssml_marks_not_supported_for_text_type_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::SsmlMarksNotSupportedForTextTypeException {
crate::error::SsmlMarksNotSupportedForTextTypeException {
message: self.message,
}
}
}
}
impl SsmlMarksNotSupportedForTextTypeException {
pub fn builder() -> crate::error::ssml_marks_not_supported_for_text_type_exception::Builder {
crate::error::ssml_marks_not_supported_for_text_type_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ServiceFailureException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl ServiceFailureException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ServiceFailureException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ServiceFailureException")?;
if let Some(inner_3) = &self.message {
{
write!(f, ": {}", inner_3)?;
}
}
Ok(())
}
}
impl std::error::Error for ServiceFailureException {}
pub mod service_failure_exception {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[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::ServiceFailureException {
crate::error::ServiceFailureException {
message: self.message,
}
}
}
}
impl ServiceFailureException {
pub fn builder() -> crate::error::service_failure_exception::Builder {
crate::error::service_failure_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MarksNotSupportedForFormatException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl MarksNotSupportedForFormatException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for MarksNotSupportedForFormatException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MarksNotSupportedForFormatException")?;
if let Some(inner_4) = &self.message {
{
write!(f, ": {}", inner_4)?;
}
}
Ok(())
}
}
impl std::error::Error for MarksNotSupportedForFormatException {}
pub mod marks_not_supported_for_format_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::MarksNotSupportedForFormatException {
crate::error::MarksNotSupportedForFormatException {
message: self.message,
}
}
}
}
impl MarksNotSupportedForFormatException {
pub fn builder() -> crate::error::marks_not_supported_for_format_exception::Builder {
crate::error::marks_not_supported_for_format_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LexiconNotFoundException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl LexiconNotFoundException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LexiconNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LexiconNotFoundException")?;
if let Some(inner_5) = &self.message {
{
write!(f, ": {}", inner_5)?;
}
}
Ok(())
}
}
impl std::error::Error for LexiconNotFoundException {}
pub mod lexicon_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::LexiconNotFoundException {
crate::error::LexiconNotFoundException {
message: self.message,
}
}
}
}
impl LexiconNotFoundException {
pub fn builder() -> crate::error::lexicon_not_found_exception::Builder {
crate::error::lexicon_not_found_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LanguageNotSupportedException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl LanguageNotSupportedException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LanguageNotSupportedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LanguageNotSupportedException")?;
if let Some(inner_6) = &self.message {
{
write!(f, ": {}", inner_6)?;
}
}
Ok(())
}
}
impl std::error::Error for LanguageNotSupportedException {}
pub mod language_not_supported_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::LanguageNotSupportedException {
crate::error::LanguageNotSupportedException {
message: self.message,
}
}
}
}
impl LanguageNotSupportedException {
pub fn builder() -> crate::error::language_not_supported_exception::Builder {
crate::error::language_not_supported_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidSsmlException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidSsmlException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidSsmlException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidSsmlException")?;
if let Some(inner_7) = &self.message {
{
write!(f, ": {}", inner_7)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidSsmlException {}
pub mod invalid_ssml_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::InvalidSsmlException {
crate::error::InvalidSsmlException {
message: self.message,
}
}
}
}
impl InvalidSsmlException {
pub fn builder() -> crate::error::invalid_ssml_exception::Builder {
crate::error::invalid_ssml_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidSampleRateException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidSampleRateException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidSampleRateException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidSampleRateException")?;
if let Some(inner_8) = &self.message {
{
write!(f, ": {}", inner_8)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidSampleRateException {}
pub mod invalid_sample_rate_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::InvalidSampleRateException {
crate::error::InvalidSampleRateException {
message: self.message,
}
}
}
}
impl InvalidSampleRateException {
pub fn builder() -> crate::error::invalid_sample_rate_exception::Builder {
crate::error::invalid_sample_rate_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EngineNotSupportedException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl EngineNotSupportedException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for EngineNotSupportedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "EngineNotSupportedException")?;
if let Some(inner_9) = &self.message {
{
write!(f, ": {}", inner_9)?;
}
}
Ok(())
}
}
impl std::error::Error for EngineNotSupportedException {}
pub mod engine_not_supported_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::EngineNotSupportedException {
crate::error::EngineNotSupportedException {
message: self.message,
}
}
}
}
impl EngineNotSupportedException {
pub fn builder() -> crate::error::engine_not_supported_exception::Builder {
crate::error::engine_not_supported_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct StartSpeechSynthesisTaskError {
pub kind: StartSpeechSynthesisTaskErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for StartSpeechSynthesisTaskError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: StartSpeechSynthesisTaskErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum StartSpeechSynthesisTaskErrorKind {
EngineNotSupportedException(crate::error::EngineNotSupportedException),
InvalidS3BucketException(crate::error::InvalidS3BucketException),
InvalidS3KeyException(crate::error::InvalidS3KeyException),
InvalidSampleRateException(crate::error::InvalidSampleRateException),
InvalidSnsTopicArnException(crate::error::InvalidSnsTopicArnException),
InvalidSsmlException(crate::error::InvalidSsmlException),
LanguageNotSupportedException(crate::error::LanguageNotSupportedException),
LexiconNotFoundException(crate::error::LexiconNotFoundException),
MarksNotSupportedForFormatException(crate::error::MarksNotSupportedForFormatException),
ServiceFailureException(crate::error::ServiceFailureException),
SsmlMarksNotSupportedForTextTypeException(
crate::error::SsmlMarksNotSupportedForTextTypeException,
),
TextLengthExceededException(crate::error::TextLengthExceededException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for StartSpeechSynthesisTaskError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
StartSpeechSynthesisTaskErrorKind::EngineNotSupportedException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::InvalidS3BucketException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::InvalidS3KeyException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::InvalidSampleRateException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::InvalidSnsTopicArnException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::InvalidSsmlException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::LanguageNotSupportedException(_inner) => {
_inner.fmt(f)
}
StartSpeechSynthesisTaskErrorKind::LexiconNotFoundException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::MarksNotSupportedForFormatException(_inner) => {
_inner.fmt(f)
}
StartSpeechSynthesisTaskErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::SsmlMarksNotSupportedForTextTypeException(
_inner,
) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::TextLengthExceededException(_inner) => _inner.fmt(f),
StartSpeechSynthesisTaskErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for StartSpeechSynthesisTaskError {
fn code(&self) -> Option<&str> {
StartSpeechSynthesisTaskError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl StartSpeechSynthesisTaskError {
pub fn new(kind: StartSpeechSynthesisTaskErrorKind, 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: StartSpeechSynthesisTaskErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: StartSpeechSynthesisTaskErrorKind::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_engine_not_supported_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::EngineNotSupportedException(_)
)
}
pub fn is_invalid_s3_bucket_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::InvalidS3BucketException(_)
)
}
pub fn is_invalid_s3_key_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::InvalidS3KeyException(_)
)
}
pub fn is_invalid_sample_rate_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::InvalidSampleRateException(_)
)
}
pub fn is_invalid_sns_topic_arn_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::InvalidSnsTopicArnException(_)
)
}
pub fn is_invalid_ssml_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::InvalidSsmlException(_)
)
}
pub fn is_language_not_supported_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::LanguageNotSupportedException(_)
)
}
pub fn is_lexicon_not_found_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::LexiconNotFoundException(_)
)
}
pub fn is_marks_not_supported_for_format_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::MarksNotSupportedForFormatException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::ServiceFailureException(_)
)
}
pub fn is_ssml_marks_not_supported_for_text_type_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::SsmlMarksNotSupportedForTextTypeException(_)
)
}
pub fn is_text_length_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
StartSpeechSynthesisTaskErrorKind::TextLengthExceededException(_)
)
}
}
impl std::error::Error for StartSpeechSynthesisTaskError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
StartSpeechSynthesisTaskErrorKind::EngineNotSupportedException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::InvalidS3BucketException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::InvalidS3KeyException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::InvalidSampleRateException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::InvalidSnsTopicArnException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::InvalidSsmlException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::LanguageNotSupportedException(_inner) => {
Some(_inner)
}
StartSpeechSynthesisTaskErrorKind::LexiconNotFoundException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::MarksNotSupportedForFormatException(_inner) => {
Some(_inner)
}
StartSpeechSynthesisTaskErrorKind::ServiceFailureException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::SsmlMarksNotSupportedForTextTypeException(
_inner,
) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::TextLengthExceededException(_inner) => Some(_inner),
StartSpeechSynthesisTaskErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidSnsTopicArnException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidSnsTopicArnException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidSnsTopicArnException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidSnsTopicArnException")?;
if let Some(inner_10) = &self.message {
{
write!(f, ": {}", inner_10)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidSnsTopicArnException {}
pub mod invalid_sns_topic_arn_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::InvalidSnsTopicArnException {
crate::error::InvalidSnsTopicArnException {
message: self.message,
}
}
}
}
impl InvalidSnsTopicArnException {
pub fn builder() -> crate::error::invalid_sns_topic_arn_exception::Builder {
crate::error::invalid_sns_topic_arn_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidS3KeyException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidS3KeyException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidS3KeyException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidS3KeyException")?;
if let Some(inner_11) = &self.message {
{
write!(f, ": {}", inner_11)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidS3KeyException {}
pub mod invalid_s3_key_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::InvalidS3KeyException {
crate::error::InvalidS3KeyException {
message: self.message,
}
}
}
}
impl InvalidS3KeyException {
pub fn builder() -> crate::error::invalid_s3_key_exception::Builder {
crate::error::invalid_s3_key_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidS3BucketException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidS3BucketException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidS3BucketException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidS3BucketException")?;
if let Some(inner_12) = &self.message {
{
write!(f, ": {}", inner_12)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidS3BucketException {}
pub mod invalid_s3_bucket_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::InvalidS3BucketException {
crate::error::InvalidS3BucketException {
message: self.message,
}
}
}
}
impl InvalidS3BucketException {
pub fn builder() -> crate::error::invalid_s3_bucket_exception::Builder {
crate::error::invalid_s3_bucket_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PutLexiconError {
pub kind: PutLexiconErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for PutLexiconError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: PutLexiconErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum PutLexiconErrorKind {
InvalidLexiconException(crate::error::InvalidLexiconException),
LexiconSizeExceededException(crate::error::LexiconSizeExceededException),
MaxLexemeLengthExceededException(crate::error::MaxLexemeLengthExceededException),
MaxLexiconsNumberExceededException(crate::error::MaxLexiconsNumberExceededException),
ServiceFailureException(crate::error::ServiceFailureException),
UnsupportedPlsAlphabetException(crate::error::UnsupportedPlsAlphabetException),
UnsupportedPlsLanguageException(crate::error::UnsupportedPlsLanguageException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for PutLexiconError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
PutLexiconErrorKind::InvalidLexiconException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::LexiconSizeExceededException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::MaxLexemeLengthExceededException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::MaxLexiconsNumberExceededException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::UnsupportedPlsAlphabetException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::UnsupportedPlsLanguageException(_inner) => _inner.fmt(f),
PutLexiconErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for PutLexiconError {
fn code(&self) -> Option<&str> {
PutLexiconError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl PutLexiconError {
pub fn new(kind: PutLexiconErrorKind, 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: PutLexiconErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: PutLexiconErrorKind::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_invalid_lexicon_exception(&self) -> bool {
matches!(&self.kind, PutLexiconErrorKind::InvalidLexiconException(_))
}
pub fn is_lexicon_size_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
PutLexiconErrorKind::LexiconSizeExceededException(_)
)
}
pub fn is_max_lexeme_length_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
PutLexiconErrorKind::MaxLexemeLengthExceededException(_)
)
}
pub fn is_max_lexicons_number_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
PutLexiconErrorKind::MaxLexiconsNumberExceededException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(&self.kind, PutLexiconErrorKind::ServiceFailureException(_))
}
pub fn is_unsupported_pls_alphabet_exception(&self) -> bool {
matches!(
&self.kind,
PutLexiconErrorKind::UnsupportedPlsAlphabetException(_)
)
}
pub fn is_unsupported_pls_language_exception(&self) -> bool {
matches!(
&self.kind,
PutLexiconErrorKind::UnsupportedPlsLanguageException(_)
)
}
}
impl std::error::Error for PutLexiconError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
PutLexiconErrorKind::InvalidLexiconException(_inner) => Some(_inner),
PutLexiconErrorKind::LexiconSizeExceededException(_inner) => Some(_inner),
PutLexiconErrorKind::MaxLexemeLengthExceededException(_inner) => Some(_inner),
PutLexiconErrorKind::MaxLexiconsNumberExceededException(_inner) => Some(_inner),
PutLexiconErrorKind::ServiceFailureException(_inner) => Some(_inner),
PutLexiconErrorKind::UnsupportedPlsAlphabetException(_inner) => Some(_inner),
PutLexiconErrorKind::UnsupportedPlsLanguageException(_inner) => Some(_inner),
PutLexiconErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UnsupportedPlsLanguageException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl UnsupportedPlsLanguageException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for UnsupportedPlsLanguageException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "UnsupportedPlsLanguageException")?;
if let Some(inner_13) = &self.message {
{
write!(f, ": {}", inner_13)?;
}
}
Ok(())
}
}
impl std::error::Error for UnsupportedPlsLanguageException {}
pub mod unsupported_pls_language_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::UnsupportedPlsLanguageException {
crate::error::UnsupportedPlsLanguageException {
message: self.message,
}
}
}
}
impl UnsupportedPlsLanguageException {
pub fn builder() -> crate::error::unsupported_pls_language_exception::Builder {
crate::error::unsupported_pls_language_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UnsupportedPlsAlphabetException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl UnsupportedPlsAlphabetException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for UnsupportedPlsAlphabetException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "UnsupportedPlsAlphabetException")?;
if let Some(inner_14) = &self.message {
{
write!(f, ": {}", inner_14)?;
}
}
Ok(())
}
}
impl std::error::Error for UnsupportedPlsAlphabetException {}
pub mod unsupported_pls_alphabet_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::UnsupportedPlsAlphabetException {
crate::error::UnsupportedPlsAlphabetException {
message: self.message,
}
}
}
}
impl UnsupportedPlsAlphabetException {
pub fn builder() -> crate::error::unsupported_pls_alphabet_exception::Builder {
crate::error::unsupported_pls_alphabet_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MaxLexiconsNumberExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl MaxLexiconsNumberExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for MaxLexiconsNumberExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MaxLexiconsNumberExceededException")?;
if let Some(inner_15) = &self.message {
{
write!(f, ": {}", inner_15)?;
}
}
Ok(())
}
}
impl std::error::Error for MaxLexiconsNumberExceededException {}
pub mod max_lexicons_number_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::MaxLexiconsNumberExceededException {
crate::error::MaxLexiconsNumberExceededException {
message: self.message,
}
}
}
}
impl MaxLexiconsNumberExceededException {
pub fn builder() -> crate::error::max_lexicons_number_exceeded_exception::Builder {
crate::error::max_lexicons_number_exceeded_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MaxLexemeLengthExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl MaxLexemeLengthExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for MaxLexemeLengthExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MaxLexemeLengthExceededException")?;
if let Some(inner_16) = &self.message {
{
write!(f, ": {}", inner_16)?;
}
}
Ok(())
}
}
impl std::error::Error for MaxLexemeLengthExceededException {}
pub mod max_lexeme_length_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::MaxLexemeLengthExceededException {
crate::error::MaxLexemeLengthExceededException {
message: self.message,
}
}
}
}
impl MaxLexemeLengthExceededException {
pub fn builder() -> crate::error::max_lexeme_length_exceeded_exception::Builder {
crate::error::max_lexeme_length_exceeded_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LexiconSizeExceededException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl LexiconSizeExceededException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LexiconSizeExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LexiconSizeExceededException")?;
if let Some(inner_17) = &self.message {
{
write!(f, ": {}", inner_17)?;
}
}
Ok(())
}
}
impl std::error::Error for LexiconSizeExceededException {}
pub mod lexicon_size_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::LexiconSizeExceededException {
crate::error::LexiconSizeExceededException {
message: self.message,
}
}
}
}
impl LexiconSizeExceededException {
pub fn builder() -> crate::error::lexicon_size_exceeded_exception::Builder {
crate::error::lexicon_size_exceeded_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidLexiconException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidLexiconException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidLexiconException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidLexiconException")?;
if let Some(inner_18) = &self.message {
{
write!(f, ": {}", inner_18)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidLexiconException {}
pub mod invalid_lexicon_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::InvalidLexiconException {
crate::error::InvalidLexiconException {
message: self.message,
}
}
}
}
impl InvalidLexiconException {
pub fn builder() -> crate::error::invalid_lexicon_exception::Builder {
crate::error::invalid_lexicon_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListSpeechSynthesisTasksError {
pub kind: ListSpeechSynthesisTasksErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListSpeechSynthesisTasksError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListSpeechSynthesisTasksErrorKind::Unhandled(crate::error::Unhandled::new(
source,
)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListSpeechSynthesisTasksErrorKind {
InvalidNextTokenException(crate::error::InvalidNextTokenException),
ServiceFailureException(crate::error::ServiceFailureException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListSpeechSynthesisTasksError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListSpeechSynthesisTasksErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListSpeechSynthesisTasksErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
ListSpeechSynthesisTasksErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListSpeechSynthesisTasksError {
fn code(&self) -> Option<&str> {
ListSpeechSynthesisTasksError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListSpeechSynthesisTasksError {
pub fn new(kind: ListSpeechSynthesisTasksErrorKind, 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: ListSpeechSynthesisTasksErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListSpeechSynthesisTasksErrorKind::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_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListSpeechSynthesisTasksErrorKind::InvalidNextTokenException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
ListSpeechSynthesisTasksErrorKind::ServiceFailureException(_)
)
}
}
impl std::error::Error for ListSpeechSynthesisTasksError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListSpeechSynthesisTasksErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListSpeechSynthesisTasksErrorKind::ServiceFailureException(_inner) => Some(_inner),
ListSpeechSynthesisTasksErrorKind::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_19) = &self.message {
{
write!(f, ": {}", inner_19)?;
}
}
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 ListLexiconsError {
pub kind: ListLexiconsErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for ListLexiconsError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: ListLexiconsErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListLexiconsErrorKind {
InvalidNextTokenException(crate::error::InvalidNextTokenException),
ServiceFailureException(crate::error::ServiceFailureException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for ListLexiconsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListLexiconsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListLexiconsErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
ListLexiconsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListLexiconsError {
fn code(&self) -> Option<&str> {
ListLexiconsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListLexiconsError {
pub fn new(kind: ListLexiconsErrorKind, 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: ListLexiconsErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListLexiconsErrorKind::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_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListLexiconsErrorKind::InvalidNextTokenException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
ListLexiconsErrorKind::ServiceFailureException(_)
)
}
}
impl std::error::Error for ListLexiconsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListLexiconsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListLexiconsErrorKind::ServiceFailureException(_inner) => Some(_inner),
ListLexiconsErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetSpeechSynthesisTaskError {
pub kind: GetSpeechSynthesisTaskErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetSpeechSynthesisTaskError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetSpeechSynthesisTaskErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetSpeechSynthesisTaskErrorKind {
InvalidTaskIdException(crate::error::InvalidTaskIdException),
ServiceFailureException(crate::error::ServiceFailureException),
SynthesisTaskNotFoundException(crate::error::SynthesisTaskNotFoundException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetSpeechSynthesisTaskError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetSpeechSynthesisTaskErrorKind::InvalidTaskIdException(_inner) => _inner.fmt(f),
GetSpeechSynthesisTaskErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
GetSpeechSynthesisTaskErrorKind::SynthesisTaskNotFoundException(_inner) => {
_inner.fmt(f)
}
GetSpeechSynthesisTaskErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetSpeechSynthesisTaskError {
fn code(&self) -> Option<&str> {
GetSpeechSynthesisTaskError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetSpeechSynthesisTaskError {
pub fn new(kind: GetSpeechSynthesisTaskErrorKind, 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: GetSpeechSynthesisTaskErrorKind::Unhandled(crate::error::Unhandled::new(
err.into(),
)),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetSpeechSynthesisTaskErrorKind::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_invalid_task_id_exception(&self) -> bool {
matches!(
&self.kind,
GetSpeechSynthesisTaskErrorKind::InvalidTaskIdException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
GetSpeechSynthesisTaskErrorKind::ServiceFailureException(_)
)
}
pub fn is_synthesis_task_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetSpeechSynthesisTaskErrorKind::SynthesisTaskNotFoundException(_)
)
}
}
impl std::error::Error for GetSpeechSynthesisTaskError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetSpeechSynthesisTaskErrorKind::InvalidTaskIdException(_inner) => Some(_inner),
GetSpeechSynthesisTaskErrorKind::ServiceFailureException(_inner) => Some(_inner),
GetSpeechSynthesisTaskErrorKind::SynthesisTaskNotFoundException(_inner) => Some(_inner),
GetSpeechSynthesisTaskErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SynthesisTaskNotFoundException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl SynthesisTaskNotFoundException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for SynthesisTaskNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "SynthesisTaskNotFoundException")?;
if let Some(inner_20) = &self.message {
{
write!(f, ": {}", inner_20)?;
}
}
Ok(())
}
}
impl std::error::Error for SynthesisTaskNotFoundException {}
pub mod synthesis_task_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::SynthesisTaskNotFoundException {
crate::error::SynthesisTaskNotFoundException {
message: self.message,
}
}
}
}
impl SynthesisTaskNotFoundException {
pub fn builder() -> crate::error::synthesis_task_not_found_exception::Builder {
crate::error::synthesis_task_not_found_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidTaskIdException {
#[allow(missing_docs)] #[doc(hidden)]
pub message: std::option::Option<std::string::String>,
}
impl InvalidTaskIdException {
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidTaskIdException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidTaskIdException")?;
if let Some(inner_21) = &self.message {
{
write!(f, ": {}", inner_21)?;
}
}
Ok(())
}
}
impl std::error::Error for InvalidTaskIdException {}
pub mod invalid_task_id_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::InvalidTaskIdException {
crate::error::InvalidTaskIdException {
message: self.message,
}
}
}
}
impl InvalidTaskIdException {
pub fn builder() -> crate::error::invalid_task_id_exception::Builder {
crate::error::invalid_task_id_exception::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetLexiconError {
pub kind: GetLexiconErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for GetLexiconError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: GetLexiconErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetLexiconErrorKind {
LexiconNotFoundException(crate::error::LexiconNotFoundException),
ServiceFailureException(crate::error::ServiceFailureException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for GetLexiconError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetLexiconErrorKind::LexiconNotFoundException(_inner) => _inner.fmt(f),
GetLexiconErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
GetLexiconErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetLexiconError {
fn code(&self) -> Option<&str> {
GetLexiconError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetLexiconError {
pub fn new(kind: GetLexiconErrorKind, 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: GetLexiconErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetLexiconErrorKind::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_lexicon_not_found_exception(&self) -> bool {
matches!(&self.kind, GetLexiconErrorKind::LexiconNotFoundException(_))
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(&self.kind, GetLexiconErrorKind::ServiceFailureException(_))
}
}
impl std::error::Error for GetLexiconError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetLexiconErrorKind::LexiconNotFoundException(_inner) => Some(_inner),
GetLexiconErrorKind::ServiceFailureException(_inner) => Some(_inner),
GetLexiconErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DescribeVoicesError {
pub kind: DescribeVoicesErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DescribeVoicesError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DescribeVoicesErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DescribeVoicesErrorKind {
InvalidNextTokenException(crate::error::InvalidNextTokenException),
ServiceFailureException(crate::error::ServiceFailureException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DescribeVoicesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DescribeVoicesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
DescribeVoicesErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
DescribeVoicesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DescribeVoicesError {
fn code(&self) -> Option<&str> {
DescribeVoicesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DescribeVoicesError {
pub fn new(kind: DescribeVoicesErrorKind, 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: DescribeVoicesErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DescribeVoicesErrorKind::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_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
DescribeVoicesErrorKind::InvalidNextTokenException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
DescribeVoicesErrorKind::ServiceFailureException(_)
)
}
}
impl std::error::Error for DescribeVoicesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DescribeVoicesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
DescribeVoicesErrorKind::ServiceFailureException(_inner) => Some(_inner),
DescribeVoicesErrorKind::Unhandled(_inner) => Some(_inner),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteLexiconError {
pub kind: DeleteLexiconErrorKind,
pub(crate) meta: aws_smithy_types::Error,
}
impl aws_smithy_http::result::CreateUnhandledError for DeleteLexiconError {
fn create_unhandled_error(source: Box<dyn std::error::Error + Send + Sync + 'static>) -> Self {
Self {
kind: DeleteLexiconErrorKind::Unhandled(crate::error::Unhandled::new(source)),
meta: Default::default(),
}
}
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteLexiconErrorKind {
LexiconNotFoundException(crate::error::LexiconNotFoundException),
ServiceFailureException(crate::error::ServiceFailureException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for DeleteLexiconError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteLexiconErrorKind::LexiconNotFoundException(_inner) => _inner.fmt(f),
DeleteLexiconErrorKind::ServiceFailureException(_inner) => _inner.fmt(f),
DeleteLexiconErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteLexiconError {
fn code(&self) -> Option<&str> {
DeleteLexiconError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteLexiconError {
pub fn new(kind: DeleteLexiconErrorKind, 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: DeleteLexiconErrorKind::Unhandled(crate::error::Unhandled::new(err.into())),
meta: Default::default(),
}
}
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteLexiconErrorKind::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_lexicon_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteLexiconErrorKind::LexiconNotFoundException(_)
)
}
pub fn is_service_failure_exception(&self) -> bool {
matches!(
&self.kind,
DeleteLexiconErrorKind::ServiceFailureException(_)
)
}
}
impl std::error::Error for DeleteLexiconError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteLexiconErrorKind::LexiconNotFoundException(_inner) => Some(_inner),
DeleteLexiconErrorKind::ServiceFailureException(_inner) => Some(_inner),
DeleteLexiconErrorKind::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 _)
}
}