Skip to main content

aws_sdk_lexruntime/operation/
post_text.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `PostText`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct PostText;
6impl PostText {
7    /// Creates a new `PostText`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13        input: crate::operation::post_text::PostTextInput,
14    ) -> ::std::result::Result<
15        crate::operation::post_text::PostTextOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::post_text::PostTextError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err =
22            |err: ::aws_smithy_runtime_api::client::result::SdkError<
23                ::aws_smithy_runtime_api::client::interceptors::context::Error,
24                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25            >| { err.map_service_error(|err| err.downcast::<crate::operation::post_text::PostTextError>().expect("correct error type")) };
26        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
27            .await
28            .map_err(map_err)?;
29        let output = context.finalize().map_err(map_err)?;
30        ::std::result::Result::Ok(
31            output
32                .downcast::<crate::operation::post_text::PostTextOutput>()
33                .expect("correct output type"),
34        )
35    }
36
37    pub(crate) async fn orchestrate_with_stop_point(
38        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
39        input: crate::operation::post_text::PostTextInput,
40        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
41    ) -> ::std::result::Result<
42        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
43        ::aws_smithy_runtime_api::client::result::SdkError<
44            ::aws_smithy_runtime_api::client::interceptors::context::Error,
45            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
46        >,
47    > {
48        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
49        use ::tracing::Instrument;
50        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Lex Runtime Service", "PostText", input, runtime_plugins, stop_point)
51            // Create a parent span for the entire operation. Includes a random, internal-only,
52            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
53            .instrument(::tracing::debug_span!(
54                "Lex Runtime Service.PostText",
55                "rpc.service" = "Lex Runtime Service",
56                "rpc.method" = "PostText",
57                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
58                "rpc.system" = "aws-api",
59            ))
60            .await
61    }
62
63    pub(crate) fn operation_runtime_plugins(
64        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
65        client_config: &crate::config::Config,
66        config_override: ::std::option::Option<crate::config::Builder>,
67    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
68        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
69
70        if let ::std::option::Option::Some(config_override) = config_override {
71            for plugin in config_override.runtime_plugins.iter().cloned() {
72                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
73            }
74            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
75                config_override,
76                client_config.config.clone(),
77                &client_config.runtime_components,
78            ));
79        }
80        runtime_plugins
81    }
82}
83impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PostText {
84    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
85        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("PostText");
86
87        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
88            PostTextRequestSerializer,
89        ));
90        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
91            PostTextResponseDeserializer,
92        ));
93
94        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
95            crate::config::auth::Params::builder()
96                .operation_name("PostText")
97                .build()
98                .expect("required fields set"),
99        ));
100
101        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
102        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
103            "PostText",
104            "Lex Runtime Service",
105        ));
106        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
107        signing_options.double_uri_encode = true;
108        signing_options.content_sha256_header = false;
109        signing_options.normalize_uri_path = true;
110        signing_options.payload_override = None;
111
112        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
113            signing_options,
114            ..::std::default::Default::default()
115        });
116
117        ::std::option::Option::Some(cfg.freeze())
118    }
119
120    fn runtime_components(
121        &self,
122        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
123    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
124        #[allow(unused_mut)]
125        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("PostText")
126            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
127                PostTextTelemetryInputCaptureInterceptor,
128            ))
129            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
131            ))
132            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133                PostTextEndpointParamsInterceptor,
134            ))
135            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
136                crate::operation::post_text::PostTextError,
137            >::new())
138            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
139                crate::operation::post_text::PostTextError,
140            >::new())
141            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
142                crate::operation::post_text::PostTextError,
143            >::new());
144
145        ::std::borrow::Cow::Owned(rcb)
146    }
147}
148
149#[derive(Debug)]
150struct PostTextTelemetryInputCaptureInterceptor;
151
152#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
153impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostTextTelemetryInputCaptureInterceptor {
154    fn name(&self) -> &'static str {
155        "PostTextTelemetryInputCaptureInterceptor"
156    }
157
158    fn read_before_execution(
159        &self,
160        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
161            '_,
162            ::aws_smithy_runtime_api::client::interceptors::context::Input,
163            ::aws_smithy_runtime_api::client::interceptors::context::Output,
164            ::aws_smithy_runtime_api::client::interceptors::context::Error,
165        >,
166        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
167    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
168        // Nothing to do unless the customer opted in by naming members to record.
169        let ::std::option::Option::Some(requested) = cfg
170            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
171            .filter(|r| !r.is_empty())
172        else {
173            return ::std::result::Result::Ok(());
174        };
175
176        let ::std::option::Option::Some(input) = context.input().downcast_ref::<PostTextInput>() else {
177            // A mismatched input is not this interceptor's concern; skip quietly.
178            return ::std::result::Result::Ok(());
179        };
180
181        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
182        if requested.should_capture("botName") {
183            if let ::std::option::Option::Some(value) = input.bot_name.as_deref() {
184                captured.insert("botName", value);
185            }
186        }
187        if requested.should_capture("botAlias") {
188            if let ::std::option::Option::Some(value) = input.bot_alias.as_deref() {
189                captured.insert("botAlias", value);
190            }
191        }
192        if requested.should_capture("userId") {
193            if let ::std::option::Option::Some(value) = input.user_id.as_deref() {
194                captured.insert("userId", value);
195            }
196        }
197
198        cfg.interceptor_state().store_put(captured);
199        ::std::result::Result::Ok(())
200    }
201}
202#[derive(Debug)]
203struct PostTextResponseDeserializer;
204impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PostTextResponseDeserializer {
205    fn deserialize_nonstreaming_with_config(
206        &self,
207        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
208        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
209    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
210        let (success, status) = (response.status().is_success(), response.status().as_u16());
211        let headers = response.headers();
212        let body = response.body().bytes().expect("body loaded");
213        #[allow(unused_mut)]
214        let mut force_error = false;
215        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
216        let parse_result = if !success && status != 200 || force_error {
217            crate::protocol_serde::shape_post_text::de_post_text_http_error(status, headers, body)
218        } else {
219            crate::protocol_serde::shape_post_text::de_post_text_http_response(status, headers, body)
220        };
221        crate::protocol_serde::type_erase_result(parse_result)
222    }
223}
224#[derive(Debug)]
225struct PostTextRequestSerializer;
226impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PostTextRequestSerializer {
227    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
228    fn serialize_input(
229        &self,
230        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
231        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
232    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
233        let input = input.downcast::<crate::operation::post_text::PostTextInput>().expect("correct type");
234        let _header_serialization_settings = _cfg
235            .load::<crate::serialization_settings::HeaderSerializationSettings>()
236            .cloned()
237            .unwrap_or_default();
238        let mut request_builder = {
239            #[allow(clippy::uninlined_format_args)]
240            fn uri_base(
241                _input: &crate::operation::post_text::PostTextInput,
242                output: &mut ::std::string::String,
243            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
244                use ::std::fmt::Write as _;
245                let input_1 = &_input.bot_name;
246                let input_1 = input_1
247                    .as_ref()
248                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bot_name", "cannot be empty or unset"))?;
249                let bot_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
250                if bot_name.is_empty() {
251                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
252                        "bot_name",
253                        "cannot be empty or unset",
254                    ));
255                }
256                let input_2 = &_input.bot_alias;
257                let input_2 = input_2
258                    .as_ref()
259                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bot_alias", "cannot be empty or unset"))?;
260                let bot_alias = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default);
261                if bot_alias.is_empty() {
262                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
263                        "bot_alias",
264                        "cannot be empty or unset",
265                    ));
266                }
267                let input_3 = &_input.user_id;
268                let input_3 = input_3
269                    .as_ref()
270                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("user_id", "cannot be empty or unset"))?;
271                let user_id = ::aws_smithy_http::label::fmt_string(input_3, ::aws_smithy_http::label::EncodingStrategy::Default);
272                if user_id.is_empty() {
273                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
274                        "user_id",
275                        "cannot be empty or unset",
276                    ));
277                }
278                ::std::write!(
279                    output,
280                    "/bot/{botName}/alias/{botAlias}/user/{userId}/text",
281                    botName = bot_name,
282                    botAlias = bot_alias,
283                    userId = user_id
284                )
285                .expect("formatting should succeed");
286                ::std::result::Result::Ok(())
287            }
288            #[allow(clippy::unnecessary_wraps)]
289            fn update_http_builder(
290                input: &crate::operation::post_text::PostTextInput,
291                builder: ::http_1x::request::Builder,
292            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
293                let mut uri = ::std::string::String::new();
294                uri_base(input, &mut uri)?;
295                ::std::result::Result::Ok(builder.method("POST").uri(uri))
296            }
297            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
298            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
299            builder
300        };
301        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_post_text::ser_post_text_input(&input)?);
302        if let Some(content_length) = body.content_length() {
303            let content_length = content_length.to_string();
304            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
305        }
306        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
307    }
308}
309#[derive(Debug)]
310struct PostTextEndpointParamsInterceptor;
311
312#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
313impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostTextEndpointParamsInterceptor {
314    fn name(&self) -> &'static str {
315        "PostTextEndpointParamsInterceptor"
316    }
317
318    fn read_before_execution(
319        &self,
320        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
321            '_,
322            ::aws_smithy_runtime_api::client::interceptors::context::Input,
323            ::aws_smithy_runtime_api::client::interceptors::context::Output,
324            ::aws_smithy_runtime_api::client::interceptors::context::Error,
325        >,
326        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
327    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
328        let _input = context
329            .input()
330            .downcast_ref::<PostTextInput>()
331            .ok_or("failed to downcast to PostTextInput")?;
332
333        let params = crate::config::endpoint::Params::builder()
334            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
335            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
336            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
337            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
338            .build()
339            .map_err(|err| {
340                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
341            })?;
342        cfg.interceptor_state()
343            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
344        ::std::result::Result::Ok(())
345    }
346}
347
348// The get_* functions below are generated from JMESPath expressions in the
349// operationContextParams trait. They target the operation's input shape.
350
351/// Error type for the `PostTextError` operation.
352#[non_exhaustive]
353#[derive(::std::fmt::Debug)]
354pub enum PostTextError {
355    /// <p>Either the Amazon Lex bot is still building, or one of the dependent services (Amazon Polly, AWS Lambda) failed with an internal service error.</p>
356    BadGatewayException(crate::types::error::BadGatewayException),
357    /// <p>Request validation failed, there is no usable message in the context, or the bot build failed, is still in progress, or contains unbuilt changes.</p>
358    BadRequestException(crate::types::error::BadRequestException),
359    /// <p>Two clients are using the same AWS account, Amazon Lex bot, and user ID.</p>
360    ConflictException(crate::types::error::ConflictException),
361    /// <p>One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. For example,</p>
362    /// <ul>
363    /// <li>
364    /// <p>If Amazon Lex does not have sufficient permissions to call a Lambda function.</p></li>
365    /// <li>
366    /// <p>If a Lambda function takes longer than 30 seconds to execute.</p></li>
367    /// <li>
368    /// <p>If a fulfillment Lambda function returns a <code>Delegate</code> dialog action without removing any slot values.</p></li>
369    /// </ul>
370    DependencyFailedException(crate::types::error::DependencyFailedException),
371    /// <p>Internal service error. Retry the call.</p>
372    InternalFailureException(crate::types::error::InternalFailureException),
373    /// <p>Exceeded a limit.</p>
374    LimitExceededException(crate::types::error::LimitExceededException),
375    /// <p>This exception is not used.</p>
376    LoopDetectedException(crate::types::error::LoopDetectedException),
377    /// <p>The resource (such as the Amazon Lex bot or an alias) that is referred to is not found.</p>
378    NotFoundException(crate::types::error::NotFoundException),
379    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
380    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
381    variable wildcard pattern and check `.code()`:
382     \
383    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
384     \
385    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PostTextError) for what information is available for the error.")]
386    Unhandled(crate::error::sealed_unhandled::Unhandled),
387}
388impl PostTextError {
389    /// Creates the `PostTextError::Unhandled` variant from any error type.
390    pub fn unhandled(
391        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
392    ) -> Self {
393        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
394            source: err.into(),
395            meta: ::std::default::Default::default(),
396        })
397    }
398
399    /// Creates the `PostTextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
400    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
401        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
402            source: err.clone().into(),
403            meta: err,
404        })
405    }
406    ///
407    /// Returns error metadata, which includes the error code, message,
408    /// request ID, and potentially additional information.
409    ///
410    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
411        match self {
412            Self::BadGatewayException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413            Self::BadRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414            Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415            Self::DependencyFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416            Self::InternalFailureException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418            Self::LoopDetectedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419            Self::NotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420            Self::Unhandled(e) => &e.meta,
421        }
422    }
423    /// Returns `true` if the error kind is `PostTextError::BadGatewayException`.
424    pub fn is_bad_gateway_exception(&self) -> bool {
425        matches!(self, Self::BadGatewayException(_))
426    }
427    /// Returns `true` if the error kind is `PostTextError::BadRequestException`.
428    pub fn is_bad_request_exception(&self) -> bool {
429        matches!(self, Self::BadRequestException(_))
430    }
431    /// Returns `true` if the error kind is `PostTextError::ConflictException`.
432    pub fn is_conflict_exception(&self) -> bool {
433        matches!(self, Self::ConflictException(_))
434    }
435    /// Returns `true` if the error kind is `PostTextError::DependencyFailedException`.
436    pub fn is_dependency_failed_exception(&self) -> bool {
437        matches!(self, Self::DependencyFailedException(_))
438    }
439    /// Returns `true` if the error kind is `PostTextError::InternalFailureException`.
440    pub fn is_internal_failure_exception(&self) -> bool {
441        matches!(self, Self::InternalFailureException(_))
442    }
443    /// Returns `true` if the error kind is `PostTextError::LimitExceededException`.
444    pub fn is_limit_exceeded_exception(&self) -> bool {
445        matches!(self, Self::LimitExceededException(_))
446    }
447    /// Returns `true` if the error kind is `PostTextError::LoopDetectedException`.
448    pub fn is_loop_detected_exception(&self) -> bool {
449        matches!(self, Self::LoopDetectedException(_))
450    }
451    /// Returns `true` if the error kind is `PostTextError::NotFoundException`.
452    pub fn is_not_found_exception(&self) -> bool {
453        matches!(self, Self::NotFoundException(_))
454    }
455}
456impl ::std::error::Error for PostTextError {
457    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
458        match self {
459            Self::BadGatewayException(_inner) => ::std::option::Option::Some(_inner),
460            Self::BadRequestException(_inner) => ::std::option::Option::Some(_inner),
461            Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
462            Self::DependencyFailedException(_inner) => ::std::option::Option::Some(_inner),
463            Self::InternalFailureException(_inner) => ::std::option::Option::Some(_inner),
464            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
465            Self::LoopDetectedException(_inner) => ::std::option::Option::Some(_inner),
466            Self::NotFoundException(_inner) => ::std::option::Option::Some(_inner),
467            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
468        }
469    }
470}
471impl ::std::fmt::Display for PostTextError {
472    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
473        match self {
474            Self::BadGatewayException(_inner) => _inner.fmt(f),
475            Self::BadRequestException(_inner) => _inner.fmt(f),
476            Self::ConflictException(_inner) => _inner.fmt(f),
477            Self::DependencyFailedException(_inner) => _inner.fmt(f),
478            Self::InternalFailureException(_inner) => _inner.fmt(f),
479            Self::LimitExceededException(_inner) => _inner.fmt(f),
480            Self::LoopDetectedException(_inner) => _inner.fmt(f),
481            Self::NotFoundException(_inner) => _inner.fmt(f),
482            Self::Unhandled(_inner) => {
483                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
484                    write!(f, "unhandled error ({code})")
485                } else {
486                    f.write_str("unhandled error")
487                }
488            }
489        }
490    }
491}
492impl ::aws_smithy_types::retry::ProvideErrorKind for PostTextError {
493    fn code(&self) -> ::std::option::Option<&str> {
494        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
495    }
496    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
497        ::std::option::Option::None
498    }
499}
500impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PostTextError {
501    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
502        match self {
503            Self::BadGatewayException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
504            Self::BadRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
505            Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
506            Self::DependencyFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
507            Self::InternalFailureException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
508            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
509            Self::LoopDetectedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
510            Self::NotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
511            Self::Unhandled(_inner) => &_inner.meta,
512        }
513    }
514}
515impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PostTextError {
516    fn create_unhandled_error(
517        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
518        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
519    ) -> Self {
520        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
521            source,
522            meta: meta.unwrap_or_default(),
523        })
524    }
525}
526impl ::aws_types::request_id::RequestId for crate::operation::post_text::PostTextError {
527    fn request_id(&self) -> Option<&str> {
528        self.meta().request_id()
529    }
530}
531
532pub use crate::operation::post_text::_post_text_input::PostTextInput;
533
534pub use crate::operation::post_text::_post_text_output::PostTextOutput;
535
536mod _post_text_input;
537
538mod _post_text_output;
539
540/// Builders
541pub mod builders;