223 223 |
|
224 224 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SynthesizeSpeechEndpointParamsInterceptor {
|
225 225 | fn name(&self) -> &'static str {
|
226 226 | "SynthesizeSpeechEndpointParamsInterceptor"
|
227 227 | }
|
228 228 |
|
229 229 | fn read_before_execution(
|
230 230 | &self,
|
231 231 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
232 232 | '_,
|
233 233 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
234 234 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
235 235 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
236 236 | >,
|
237 237 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
238 238 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
239 239 | let _input = context
|
240 240 | .input()
|
241 241 | .downcast_ref::<SynthesizeSpeechInput>()
|
242 242 | .ok_or("failed to downcast to SynthesizeSpeechInput")?;
|
243 243 |
|
244 244 | let params = crate::config::endpoint::Params::builder()
|
245 245 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
246 246 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
247 247 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
248 248 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
249 249 | .build()
|
250 250 | .map_err(|err| {
|
251 251 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
252 252 | })?;
|
253 + |
|
253 254 | cfg.interceptor_state()
|
254 255 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
256 + |
|
255 257 | ::std::result::Result::Ok(())
|
256 258 | }
|
257 259 | }
|
258 260 |
|
259 261 | // The get_* functions below are generated from JMESPath expressions in the
|
260 262 | // operationContextParams trait. They target the operation's input shape.
|
261 263 |
|
262 264 | /// Error type for the `SynthesizeSpeechError` operation.
|
263 265 | #[non_exhaustive]
|
264 266 | #[derive(::std::fmt::Debug)]
|
265 267 | pub enum SynthesizeSpeechError {
|
266 268 | /// <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>
|
267 269 | EngineNotSupportedException(crate::types::error::EngineNotSupportedException),
|
268 270 | /// <p>The specified sample rate is not valid.</p>
|
269 271 | InvalidSampleRateException(crate::types::error::InvalidSampleRateException),
|
270 272 | /// <p>The SSML you provided is invalid. Verify the SSML syntax, spelling of tags and values, and then try again.</p>
|
271 273 | InvalidSsmlException(crate::types::error::InvalidSsmlException),
|
272 274 | /// <p>The language specified is not currently supported by Amazon Polly in this capacity.</p>
|
273 275 | LanguageNotSupportedException(crate::types::error::LanguageNotSupportedException),
|
274 276 | /// <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>
|
275 277 | /// <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>
|
276 278 | LexiconNotFoundException(crate::types::error::LexiconNotFoundException),
|
277 279 | /// <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>
|
278 280 | MarksNotSupportedForFormatException(crate::types::error::MarksNotSupportedForFormatException),
|
279 281 | /// <p>An unknown condition has caused a service failure.</p>
|
280 282 | ServiceFailureException(crate::types::error::ServiceFailureException),
|
281 283 | /// <p>SSML speech marks are not supported for plain text-type input.</p>
|
282 284 | SsmlMarksNotSupportedForTextTypeException(crate::types::error::SsmlMarksNotSupportedForTextTypeException),
|
283 285 | /// <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>
|
284 286 | TextLengthExceededException(crate::types::error::TextLengthExceededException),
|