244 244 |
|
245 245 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartStreamTranscriptionEndpointParamsInterceptor {
|
246 246 | fn name(&self) -> &'static str {
|
247 247 | "StartStreamTranscriptionEndpointParamsInterceptor"
|
248 248 | }
|
249 249 |
|
250 250 | fn read_before_execution(
|
251 251 | &self,
|
252 252 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
253 253 | '_,
|
254 254 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
255 255 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
256 256 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
257 257 | >,
|
258 258 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
259 259 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
260 260 | let _input = context
|
261 261 | .input()
|
262 262 | .downcast_ref::<StartStreamTranscriptionInput>()
|
263 263 | .ok_or("failed to downcast to StartStreamTranscriptionInput")?;
|
264 264 |
|
265 265 | let params = crate::config::endpoint::Params::builder()
|
266 266 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
267 267 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
268 268 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
269 269 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
270 270 | .build()
|
271 271 | .map_err(|err| {
|
272 272 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
273 273 | })?;
|
274 + |
|
274 275 | cfg.interceptor_state()
|
275 276 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
277 + |
|
276 278 | ::std::result::Result::Ok(())
|
277 279 | }
|
278 280 | }
|
279 281 |
|
280 282 | // The get_* functions below are generated from JMESPath expressions in the
|
281 283 | // operationContextParams trait. They target the operation's input shape.
|
282 284 |
|
283 285 | /// Error type for the `StartStreamTranscriptionError` operation.
|
284 286 | #[non_exhaustive]
|
285 287 | #[derive(::std::fmt::Debug)]
|
286 288 | pub enum StartStreamTranscriptionError {
|
287 289 | /// <p>The service is currently unavailable. Try your request later.</p>
|
288 290 | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
289 291 | /// <p>One or more arguments to the <code>StartStreamTranscription</code>, <code>StartMedicalStreamTranscription</code>, or <code>StartCallAnalyticsStreamTranscription</code> operation was not valid. For example, <code>MediaEncoding</code> or <code>LanguageCode</code> used not valid values. Check the specified parameters and try your request again.</p>
|
290 292 | BadRequestException(crate::types::error::BadRequestException),
|
291 293 | /// <p>A problem occurred while processing the audio. Amazon Transcribe terminated processing.</p>
|
292 294 | InternalFailureException(crate::types::error::InternalFailureException),
|
293 295 | /// <p>A new stream started with the same session ID. The current stream has been terminated.</p>
|
294 296 | ConflictException(crate::types::error::ConflictException),
|
295 297 | /// <p>Your client has exceeded one of the Amazon Transcribe limits. This is typically the audio length limit. Break your audio stream into smaller chunks and try your request again.</p>
|
296 298 | LimitExceededException(crate::types::error::LimitExceededException),
|
297 299 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
298 300 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
299 301 | variable wildcard pattern and check `.code()`:
|
300 302 | \
|
301 303 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
302 304 | \
|
303 305 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartStreamTranscriptionError) for what information is available for the error.")]
|
304 306 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
305 307 | }
|