aws_sdk_polly/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>This engine is not compatible with the voice that you have designated. Choose a new voice that is compatible with the engine or change the engine and restart the operation.</p>
7    EngineNotSupportedException(crate::types::error::EngineNotSupportedException),
8    /// <p>Amazon Polly can't find the specified lexicon. Verify that the lexicon's name is spelled correctly, and then try again.</p>
9    InvalidLexiconException(crate::types::error::InvalidLexiconException),
10    /// <p>The NextToken is invalid. Verify that it's spelled correctly, and then try again.</p>
11    InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
12    /// <p>The provided Amazon S3 bucket name is invalid. Please check your input with S3 bucket naming requirements and try again.</p>
13    InvalidS3BucketException(crate::types::error::InvalidS3BucketException),
14    /// <p>The provided Amazon S3 key prefix is invalid. Please provide a valid S3 object key name.</p>
15    InvalidS3KeyException(crate::types::error::InvalidS3KeyException),
16    /// <p>The specified sample rate is not valid.</p>
17    InvalidSampleRateException(crate::types::error::InvalidSampleRateException),
18    /// <p>The provided SNS topic ARN is invalid. Please provide a valid SNS topic ARN and try again.</p>
19    InvalidSnsTopicArnException(crate::types::error::InvalidSnsTopicArnException),
20    /// <p>The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try again.</p>
21    InvalidSsmlException(crate::types::error::InvalidSsmlException),
22    /// <p>The provided Task ID is not valid. Please provide a valid Task ID and try again.</p>
23    InvalidTaskIdException(crate::types::error::InvalidTaskIdException),
24    /// <p>The language specified is not currently supported by Amazon Polly in this capacity.</p>
25    LanguageNotSupportedException(crate::types::error::LanguageNotSupportedException),
26    /// <p>Amazon Polly can't find the specified lexicon. This could be caused by a lexicon that is missing, its name is misspelled or specifying a lexicon that is in a different region.</p>
27    /// <p>Verify that the lexicon exists, is in the region (see <code>ListLexicons</code>) and that you spelled its name is spelled correctly. Then try again.</p>
28    LexiconNotFoundException(crate::types::error::LexiconNotFoundException),
29    /// <p>The maximum size of the specified lexicon would be exceeded by this operation.</p>
30    LexiconSizeExceededException(crate::types::error::LexiconSizeExceededException),
31    /// <p>Speech marks are not supported for the <code>OutputFormat</code> selected. Speech marks are only available for content in <code>json</code> format.</p>
32    MarksNotSupportedForFormatException(crate::types::error::MarksNotSupportedForFormatException),
33    /// <p>The maximum size of the lexeme would be exceeded by this operation.</p>
34    MaxLexemeLengthExceededException(crate::types::error::MaxLexemeLengthExceededException),
35    /// <p>The maximum number of lexicons would be exceeded by this operation.</p>
36    MaxLexiconsNumberExceededException(crate::types::error::MaxLexiconsNumberExceededException),
37    /// <p>An unknown condition has caused a service failure.</p>
38    ServiceFailureException(crate::types::error::ServiceFailureException),
39    /// <p>SSML speech marks are not supported for plain text-type input.</p>
40    SsmlMarksNotSupportedForTextTypeException(crate::types::error::SsmlMarksNotSupportedForTextTypeException),
41    /// <p>The Speech Synthesis task with requested Task ID cannot be found.</p>
42    SynthesisTaskNotFoundException(crate::types::error::SynthesisTaskNotFoundException),
43    /// <p>The value of the "Text" parameter is longer than the accepted limits. For the <code>SynthesizeSpeech</code> API, the limit for input text is a maximum of 6000 characters total, of which no more than 3000 can be billed characters. For the <code>StartSpeechSynthesisTask</code> API, the maximum is 200,000 characters, of which no more than 100,000 can be billed characters. SSML tags are not counted as billed characters.</p>
44    TextLengthExceededException(crate::types::error::TextLengthExceededException),
45    /// <p>The alphabet specified by the lexicon is not a supported alphabet. Valid values are <code>x-sampa</code> and <code>ipa</code>.</p>
46    UnsupportedPlsAlphabetException(crate::types::error::UnsupportedPlsAlphabetException),
47    /// <p>The language specified in the lexicon is unsupported. For a list of supported languages, see <a href="https://docs.aws.amazon.com/polly/latest/dg/API_LexiconAttributes.html">Lexicon Attributes</a>.</p>
48    UnsupportedPlsLanguageException(crate::types::error::UnsupportedPlsLanguageException),
49    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
50    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
51    variable wildcard pattern and check `.code()`:
52     \
53    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
54     \
55    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
56    Unhandled(crate::error::sealed_unhandled::Unhandled),
57}
58impl ::std::fmt::Display for Error {
59    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
60        match self {
61            Error::EngineNotSupportedException(inner) => inner.fmt(f),
62            Error::InvalidLexiconException(inner) => inner.fmt(f),
63            Error::InvalidNextTokenException(inner) => inner.fmt(f),
64            Error::InvalidS3BucketException(inner) => inner.fmt(f),
65            Error::InvalidS3KeyException(inner) => inner.fmt(f),
66            Error::InvalidSampleRateException(inner) => inner.fmt(f),
67            Error::InvalidSnsTopicArnException(inner) => inner.fmt(f),
68            Error::InvalidSsmlException(inner) => inner.fmt(f),
69            Error::InvalidTaskIdException(inner) => inner.fmt(f),
70            Error::LanguageNotSupportedException(inner) => inner.fmt(f),
71            Error::LexiconNotFoundException(inner) => inner.fmt(f),
72            Error::LexiconSizeExceededException(inner) => inner.fmt(f),
73            Error::MarksNotSupportedForFormatException(inner) => inner.fmt(f),
74            Error::MaxLexemeLengthExceededException(inner) => inner.fmt(f),
75            Error::MaxLexiconsNumberExceededException(inner) => inner.fmt(f),
76            Error::ServiceFailureException(inner) => inner.fmt(f),
77            Error::SsmlMarksNotSupportedForTextTypeException(inner) => inner.fmt(f),
78            Error::SynthesisTaskNotFoundException(inner) => inner.fmt(f),
79            Error::TextLengthExceededException(inner) => inner.fmt(f),
80            Error::UnsupportedPlsAlphabetException(inner) => inner.fmt(f),
81            Error::UnsupportedPlsLanguageException(inner) => inner.fmt(f),
82            Error::Unhandled(_) => {
83                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
84                    write!(f, "unhandled error ({code})")
85                } else {
86                    f.write_str("unhandled error")
87                }
88            }
89        }
90    }
91}
92impl From<::aws_smithy_types::error::operation::BuildError> for Error {
93    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
94        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
95            source: value.into(),
96            meta: ::std::default::Default::default(),
97        })
98    }
99}
100impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
101    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
102        match self {
103            Self::EngineNotSupportedException(inner) => inner.meta(),
104            Self::InvalidLexiconException(inner) => inner.meta(),
105            Self::InvalidNextTokenException(inner) => inner.meta(),
106            Self::InvalidS3BucketException(inner) => inner.meta(),
107            Self::InvalidS3KeyException(inner) => inner.meta(),
108            Self::InvalidSampleRateException(inner) => inner.meta(),
109            Self::InvalidSnsTopicArnException(inner) => inner.meta(),
110            Self::InvalidSsmlException(inner) => inner.meta(),
111            Self::InvalidTaskIdException(inner) => inner.meta(),
112            Self::LanguageNotSupportedException(inner) => inner.meta(),
113            Self::LexiconNotFoundException(inner) => inner.meta(),
114            Self::LexiconSizeExceededException(inner) => inner.meta(),
115            Self::MarksNotSupportedForFormatException(inner) => inner.meta(),
116            Self::MaxLexemeLengthExceededException(inner) => inner.meta(),
117            Self::MaxLexiconsNumberExceededException(inner) => inner.meta(),
118            Self::ServiceFailureException(inner) => inner.meta(),
119            Self::SsmlMarksNotSupportedForTextTypeException(inner) => inner.meta(),
120            Self::SynthesisTaskNotFoundException(inner) => inner.meta(),
121            Self::TextLengthExceededException(inner) => inner.meta(),
122            Self::UnsupportedPlsAlphabetException(inner) => inner.meta(),
123            Self::UnsupportedPlsLanguageException(inner) => inner.meta(),
124            Self::Unhandled(inner) => &inner.meta,
125        }
126    }
127}
128impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_lexicon::DeleteLexiconError, R>> for Error
129where
130    R: Send + Sync + std::fmt::Debug + 'static,
131{
132    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_lexicon::DeleteLexiconError, R>) -> Self {
133        match err {
134            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
135            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
136                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
137                source: err.into(),
138            }),
139        }
140    }
141}
142impl From<crate::operation::delete_lexicon::DeleteLexiconError> for Error {
143    fn from(err: crate::operation::delete_lexicon::DeleteLexiconError) -> Self {
144        match err {
145            crate::operation::delete_lexicon::DeleteLexiconError::LexiconNotFoundException(inner) => Error::LexiconNotFoundException(inner),
146            crate::operation::delete_lexicon::DeleteLexiconError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
147            crate::operation::delete_lexicon::DeleteLexiconError::Unhandled(inner) => Error::Unhandled(inner),
148        }
149    }
150}
151impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_voices::DescribeVoicesError, R>> for Error
152where
153    R: Send + Sync + std::fmt::Debug + 'static,
154{
155    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_voices::DescribeVoicesError, R>) -> Self {
156        match err {
157            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
158            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
159                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
160                source: err.into(),
161            }),
162        }
163    }
164}
165impl From<crate::operation::describe_voices::DescribeVoicesError> for Error {
166    fn from(err: crate::operation::describe_voices::DescribeVoicesError) -> Self {
167        match err {
168            crate::operation::describe_voices::DescribeVoicesError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
169            crate::operation::describe_voices::DescribeVoicesError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
170            crate::operation::describe_voices::DescribeVoicesError::Unhandled(inner) => Error::Unhandled(inner),
171        }
172    }
173}
174impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_lexicon::GetLexiconError, R>> for Error
175where
176    R: Send + Sync + std::fmt::Debug + 'static,
177{
178    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_lexicon::GetLexiconError, R>) -> Self {
179        match err {
180            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
181            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
182                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
183                source: err.into(),
184            }),
185        }
186    }
187}
188impl From<crate::operation::get_lexicon::GetLexiconError> for Error {
189    fn from(err: crate::operation::get_lexicon::GetLexiconError) -> Self {
190        match err {
191            crate::operation::get_lexicon::GetLexiconError::LexiconNotFoundException(inner) => Error::LexiconNotFoundException(inner),
192            crate::operation::get_lexicon::GetLexiconError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
193            crate::operation::get_lexicon::GetLexiconError::Unhandled(inner) => Error::Unhandled(inner),
194        }
195    }
196}
197impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError, R>>
198    for Error
199where
200    R: Send + Sync + std::fmt::Debug + 'static,
201{
202    fn from(
203        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError, R>,
204    ) -> Self {
205        match err {
206            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
207            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
208                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
209                source: err.into(),
210            }),
211        }
212    }
213}
214impl From<crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError> for Error {
215    fn from(err: crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError) -> Self {
216        match err {
217            crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::InvalidTaskIdException(inner) => {
218                Error::InvalidTaskIdException(inner)
219            }
220            crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::ServiceFailureException(inner) => {
221                Error::ServiceFailureException(inner)
222            }
223            crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::SynthesisTaskNotFoundException(inner) => {
224                Error::SynthesisTaskNotFoundException(inner)
225            }
226            crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::Unhandled(inner) => Error::Unhandled(inner),
227        }
228    }
229}
230impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_lexicons::ListLexiconsError, R>> for Error
231where
232    R: Send + Sync + std::fmt::Debug + 'static,
233{
234    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_lexicons::ListLexiconsError, R>) -> Self {
235        match err {
236            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
237            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
238                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
239                source: err.into(),
240            }),
241        }
242    }
243}
244impl From<crate::operation::list_lexicons::ListLexiconsError> for Error {
245    fn from(err: crate::operation::list_lexicons::ListLexiconsError) -> Self {
246        match err {
247            crate::operation::list_lexicons::ListLexiconsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
248            crate::operation::list_lexicons::ListLexiconsError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
249            crate::operation::list_lexicons::ListLexiconsError::Unhandled(inner) => Error::Unhandled(inner),
250        }
251    }
252}
253impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError, R>>
254    for Error
255where
256    R: Send + Sync + std::fmt::Debug + 'static,
257{
258    fn from(
259        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError, R>,
260    ) -> Self {
261        match err {
262            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
263            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
264                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
265                source: err.into(),
266            }),
267        }
268    }
269}
270impl From<crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError> for Error {
271    fn from(err: crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError) -> Self {
272        match err {
273            crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError::InvalidNextTokenException(inner) => {
274                Error::InvalidNextTokenException(inner)
275            }
276            crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError::ServiceFailureException(inner) => {
277                Error::ServiceFailureException(inner)
278            }
279            crate::operation::list_speech_synthesis_tasks::ListSpeechSynthesisTasksError::Unhandled(inner) => Error::Unhandled(inner),
280        }
281    }
282}
283impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_lexicon::PutLexiconError, R>> for Error
284where
285    R: Send + Sync + std::fmt::Debug + 'static,
286{
287    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_lexicon::PutLexiconError, R>) -> Self {
288        match err {
289            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
290            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
291                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
292                source: err.into(),
293            }),
294        }
295    }
296}
297impl From<crate::operation::put_lexicon::PutLexiconError> for Error {
298    fn from(err: crate::operation::put_lexicon::PutLexiconError) -> Self {
299        match err {
300            crate::operation::put_lexicon::PutLexiconError::InvalidLexiconException(inner) => Error::InvalidLexiconException(inner),
301            crate::operation::put_lexicon::PutLexiconError::LexiconSizeExceededException(inner) => Error::LexiconSizeExceededException(inner),
302            crate::operation::put_lexicon::PutLexiconError::MaxLexemeLengthExceededException(inner) => Error::MaxLexemeLengthExceededException(inner),
303            crate::operation::put_lexicon::PutLexiconError::MaxLexiconsNumberExceededException(inner) => {
304                Error::MaxLexiconsNumberExceededException(inner)
305            }
306            crate::operation::put_lexicon::PutLexiconError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
307            crate::operation::put_lexicon::PutLexiconError::UnsupportedPlsAlphabetException(inner) => Error::UnsupportedPlsAlphabetException(inner),
308            crate::operation::put_lexicon::PutLexiconError::UnsupportedPlsLanguageException(inner) => Error::UnsupportedPlsLanguageException(inner),
309            crate::operation::put_lexicon::PutLexiconError::Unhandled(inner) => Error::Unhandled(inner),
310        }
311    }
312}
313impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError, R>>
314    for Error
315where
316    R: Send + Sync + std::fmt::Debug + 'static,
317{
318    fn from(
319        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError, R>,
320    ) -> Self {
321        match err {
322            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
323            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
324                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
325                source: err.into(),
326            }),
327        }
328    }
329}
330impl From<crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError> for Error {
331    fn from(err: crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError) -> Self {
332        match err {
333            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::EngineNotSupportedException(inner) => {
334                Error::EngineNotSupportedException(inner)
335            }
336            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::InvalidS3BucketException(inner) => {
337                Error::InvalidS3BucketException(inner)
338            }
339            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::InvalidS3KeyException(inner) => {
340                Error::InvalidS3KeyException(inner)
341            }
342            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::InvalidSampleRateException(inner) => {
343                Error::InvalidSampleRateException(inner)
344            }
345            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::InvalidSnsTopicArnException(inner) => {
346                Error::InvalidSnsTopicArnException(inner)
347            }
348            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::InvalidSsmlException(inner) => {
349                Error::InvalidSsmlException(inner)
350            }
351            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::LanguageNotSupportedException(inner) => {
352                Error::LanguageNotSupportedException(inner)
353            }
354            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::LexiconNotFoundException(inner) => {
355                Error::LexiconNotFoundException(inner)
356            }
357            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::MarksNotSupportedForFormatException(inner) => {
358                Error::MarksNotSupportedForFormatException(inner)
359            }
360            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::ServiceFailureException(inner) => {
361                Error::ServiceFailureException(inner)
362            }
363            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::SsmlMarksNotSupportedForTextTypeException(inner) => {
364                Error::SsmlMarksNotSupportedForTextTypeException(inner)
365            }
366            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::TextLengthExceededException(inner) => {
367                Error::TextLengthExceededException(inner)
368            }
369            crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskError::Unhandled(inner) => Error::Unhandled(inner),
370        }
371    }
372}
373impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::synthesize_speech::SynthesizeSpeechError, R>> for Error
374where
375    R: Send + Sync + std::fmt::Debug + 'static,
376{
377    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::synthesize_speech::SynthesizeSpeechError, R>) -> Self {
378        match err {
379            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
380            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
381                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
382                source: err.into(),
383            }),
384        }
385    }
386}
387impl From<crate::operation::synthesize_speech::SynthesizeSpeechError> for Error {
388    fn from(err: crate::operation::synthesize_speech::SynthesizeSpeechError) -> Self {
389        match err {
390            crate::operation::synthesize_speech::SynthesizeSpeechError::EngineNotSupportedException(inner) => {
391                Error::EngineNotSupportedException(inner)
392            }
393            crate::operation::synthesize_speech::SynthesizeSpeechError::InvalidSampleRateException(inner) => Error::InvalidSampleRateException(inner),
394            crate::operation::synthesize_speech::SynthesizeSpeechError::InvalidSsmlException(inner) => Error::InvalidSsmlException(inner),
395            crate::operation::synthesize_speech::SynthesizeSpeechError::LanguageNotSupportedException(inner) => {
396                Error::LanguageNotSupportedException(inner)
397            }
398            crate::operation::synthesize_speech::SynthesizeSpeechError::LexiconNotFoundException(inner) => Error::LexiconNotFoundException(inner),
399            crate::operation::synthesize_speech::SynthesizeSpeechError::MarksNotSupportedForFormatException(inner) => {
400                Error::MarksNotSupportedForFormatException(inner)
401            }
402            crate::operation::synthesize_speech::SynthesizeSpeechError::ServiceFailureException(inner) => Error::ServiceFailureException(inner),
403            crate::operation::synthesize_speech::SynthesizeSpeechError::SsmlMarksNotSupportedForTextTypeException(inner) => {
404                Error::SsmlMarksNotSupportedForTextTypeException(inner)
405            }
406            crate::operation::synthesize_speech::SynthesizeSpeechError::TextLengthExceededException(inner) => {
407                Error::TextLengthExceededException(inner)
408            }
409            crate::operation::synthesize_speech::SynthesizeSpeechError::Unhandled(inner) => Error::Unhandled(inner),
410        }
411    }
412}
413impl ::std::error::Error for Error {
414    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
415        match self {
416            Error::EngineNotSupportedException(inner) => inner.source(),
417            Error::InvalidLexiconException(inner) => inner.source(),
418            Error::InvalidNextTokenException(inner) => inner.source(),
419            Error::InvalidS3BucketException(inner) => inner.source(),
420            Error::InvalidS3KeyException(inner) => inner.source(),
421            Error::InvalidSampleRateException(inner) => inner.source(),
422            Error::InvalidSnsTopicArnException(inner) => inner.source(),
423            Error::InvalidSsmlException(inner) => inner.source(),
424            Error::InvalidTaskIdException(inner) => inner.source(),
425            Error::LanguageNotSupportedException(inner) => inner.source(),
426            Error::LexiconNotFoundException(inner) => inner.source(),
427            Error::LexiconSizeExceededException(inner) => inner.source(),
428            Error::MarksNotSupportedForFormatException(inner) => inner.source(),
429            Error::MaxLexemeLengthExceededException(inner) => inner.source(),
430            Error::MaxLexiconsNumberExceededException(inner) => inner.source(),
431            Error::ServiceFailureException(inner) => inner.source(),
432            Error::SsmlMarksNotSupportedForTextTypeException(inner) => inner.source(),
433            Error::SynthesisTaskNotFoundException(inner) => inner.source(),
434            Error::TextLengthExceededException(inner) => inner.source(),
435            Error::UnsupportedPlsAlphabetException(inner) => inner.source(),
436            Error::UnsupportedPlsLanguageException(inner) => inner.source(),
437            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
438        }
439    }
440}
441impl ::aws_types::request_id::RequestId for Error {
442    fn request_id(&self) -> Option<&str> {
443        match self {
444            Self::EngineNotSupportedException(e) => e.request_id(),
445            Self::InvalidLexiconException(e) => e.request_id(),
446            Self::InvalidNextTokenException(e) => e.request_id(),
447            Self::InvalidS3BucketException(e) => e.request_id(),
448            Self::InvalidS3KeyException(e) => e.request_id(),
449            Self::InvalidSampleRateException(e) => e.request_id(),
450            Self::InvalidSnsTopicArnException(e) => e.request_id(),
451            Self::InvalidSsmlException(e) => e.request_id(),
452            Self::InvalidTaskIdException(e) => e.request_id(),
453            Self::LanguageNotSupportedException(e) => e.request_id(),
454            Self::LexiconNotFoundException(e) => e.request_id(),
455            Self::LexiconSizeExceededException(e) => e.request_id(),
456            Self::MarksNotSupportedForFormatException(e) => e.request_id(),
457            Self::MaxLexemeLengthExceededException(e) => e.request_id(),
458            Self::MaxLexiconsNumberExceededException(e) => e.request_id(),
459            Self::ServiceFailureException(e) => e.request_id(),
460            Self::SsmlMarksNotSupportedForTextTypeException(e) => e.request_id(),
461            Self::SynthesisTaskNotFoundException(e) => e.request_id(),
462            Self::TextLengthExceededException(e) => e.request_id(),
463            Self::UnsupportedPlsAlphabetException(e) => e.request_id(),
464            Self::UnsupportedPlsLanguageException(e) => e.request_id(),
465            Self::Unhandled(e) => e.meta.request_id(),
466        }
467    }
468}