Skip to main content

aws_sdk_glue/operation/
get_plan.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `GetPlan`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetPlan;
6impl GetPlan {
7    /// Creates a new `GetPlan`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_plan::GetPlanInput::SCHEMA;
13    /// The schema for this operation's output shape.
14    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_plan::GetPlanOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17        input: crate::operation::get_plan::GetPlanInput,
18    ) -> ::std::result::Result<
19        crate::operation::get_plan::GetPlanOutput,
20        ::aws_smithy_runtime_api::client::result::SdkError<
21            crate::operation::get_plan::GetPlanError,
22            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
23        >,
24    > {
25        let map_err =
26            |err: ::aws_smithy_runtime_api::client::result::SdkError<
27                ::aws_smithy_runtime_api::client::interceptors::context::Error,
28                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
29            >| { err.map_service_error(|err| err.downcast::<crate::operation::get_plan::GetPlanError>().expect("correct error type")) };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::get_plan::GetPlanOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::get_plan::GetPlanInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Glue", "GetPlan", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "Glue.GetPlan",
59                "rpc.service" = "Glue",
60                "rpc.method" = "GetPlan",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87/// Per-operation error registry. Contains an entry for every modeled
88/// error this operation can throw.
89///
90/// Used by the schema-serde error path as the operation-scoped lookup
91/// for registry-backed error reification: an error code that does not
92/// match one of the operation's modeled errors directly is resolved
93/// against this registry first, then widened to the service-wide error
94/// registry.
95pub(crate) mod error_registry {
96    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
97        ::aws_smithy_schema::registry::TypeRegistry::builder()
98                            .insert_error_shape(
99                        crate::types::error::InternalServiceException::SCHEMA,
100                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
101                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServiceException::deserialize(d)?))
102                        },
103                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
104                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServiceException::deserialize(d)?))
105                        },
106                    )
107.insert_error_shape(
108                        crate::types::error::InvalidInputException::SCHEMA,
109                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
110                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidInputException::deserialize(d)?))
111                        },
112                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
113                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidInputException::deserialize(d)?))
114                        },
115                    )
116.insert_error_shape(
117                        crate::types::error::OperationTimeoutException::SCHEMA,
118                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
119                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
120                        },
121                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
122                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
123                        },
124                    )
125                            .build()
126    });
127}
128impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetPlan {
129    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
130        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetPlan");
131
132        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
133            GetPlanRequestSerializer,
134        ));
135        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
136            GetPlanResponseDeserializer,
137        ));
138
139        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
140            crate::config::auth::Params::builder()
141                .operation_name("GetPlan")
142                .build()
143                .expect("required fields set"),
144        ));
145
146        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetPlan", "Glue"));
147        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
148        signing_options.double_uri_encode = true;
149        signing_options.content_sha256_header = false;
150        signing_options.normalize_uri_path = true;
151        signing_options.payload_override = None;
152
153        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
154            signing_options,
155            ..::std::default::Default::default()
156        });
157
158        ::std::option::Option::Some(cfg.freeze())
159    }
160
161    fn runtime_components(
162        &self,
163        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
164    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
165        #[allow(unused_mut)]
166        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetPlan")
167            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
168                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
169            ))
170            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
171                GetPlanEndpointParamsInterceptor,
172            ))
173            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
174                crate::operation::get_plan::GetPlanError,
175            >::new())
176            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
177                crate::operation::get_plan::GetPlanError,
178            >::new())
179            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
180                crate::operation::get_plan::GetPlanError,
181            >::new())
182            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
183                crate::operation::get_plan::GetPlanError,
184            >::new());
185
186        ::std::borrow::Cow::Owned(rcb)
187    }
188}
189
190#[derive(Debug)]
191struct GetPlanResponseDeserializer;
192impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetPlanResponseDeserializer {
193    fn deserialize_nonstreaming_with_config(
194        &self,
195        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
196        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
197    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
198        let (success, status) = (response.status().is_success(), response.status().as_u16());
199        // Load body and headers BEFORE BeforeParseResponse so customizations
200        // (e.g., S3's `body_is_error` check that detects errors returned with
201        // HTTP 200) can inspect them. The legacy non-streaming path also
202        // loads `body` before firing this hook.
203        #[allow(unused_variables)]
204        let body = response.body().bytes().expect("body loaded");
205        let headers = response.headers();
206        #[allow(unused_mut)]
207        let mut force_error = false;
208        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
209        if !success && status != 200 || force_error {
210            let protocol = _cfg
211                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
212                .expect("a SharedClientProtocol is required");
213            #[allow(unused_mut)]
214            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
215                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
216            })?;
217            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
218            let generic = generic_builder.build();
219            let error_code = match generic.code() {
220                ::std::option::Option::Some(code) => code,
221                ::std::option::Option::None => {
222                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
223                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::get_plan::GetPlanError::unhandled(generic)),
224                    ))
225                }
226            };
227            let _error_message = generic.message().map(|msg| msg.to_owned());
228            let err = match error_code {
229                "InternalServiceException" => crate::operation::get_plan::GetPlanError::InternalServiceException({
230                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
231                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
232                            e,
233                        ))
234                    })?;
235                    let mut tmp = <crate::types::error::builders::InternalServiceExceptionBuilder>::default();
236                    tmp.deserialize_members(&mut *deser).map_err(|e| {
237                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
238                            e,
239                        ))
240                    })?;
241                    if tmp.message.is_none() {
242                        tmp.message = _error_message;
243                    }
244                    let tmp = tmp.meta(generic);
245                    tmp.build()
246                }),
247                "InvalidInputException" => crate::operation::get_plan::GetPlanError::InvalidInputException({
248                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
249                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
250                            e,
251                        ))
252                    })?;
253                    let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
254                    tmp.deserialize_members(&mut *deser).map_err(|e| {
255                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
256                            e,
257                        ))
258                    })?;
259                    if tmp.message.is_none() {
260                        tmp.message = _error_message;
261                    }
262                    let tmp = tmp.meta(generic);
263                    tmp.build()
264                }),
265                "OperationTimeoutException" => crate::operation::get_plan::GetPlanError::OperationTimeoutException({
266                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
267                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
268                            e,
269                        ))
270                    })?;
271                    let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
272                    tmp.deserialize_members(&mut *deser).map_err(|e| {
273                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
274                            e,
275                        ))
276                    })?;
277                    if tmp.message.is_none() {
278                        tmp.message = _error_message;
279                    }
280                    let tmp = tmp.meta(generic);
281                    tmp.build()
282                }),
283                _ => {
284                    // Registry-backed, operation-scoped reification of an error whose
285                    // code this operation does not model directly: the operation's own
286                    // error registry is consulted first, then the lookup widens to the
287                    // service-wide error registry. On a hit, the reified error is attached
288                    // as the source of the returned unhandled error while its metadata
289                    // (code, message, request id) is preserved; on a miss the generic
290                    // error is returned unchanged.
291                    match protocol
292                        .deserialize_error_response(response, _cfg)
293                        .ok()
294                        .and_then(|mut deser| {
295                            ::aws_smithy_schema::registry::reify_error(
296                                crate::operation::get_plan::error_registry::REGISTRY
297                                    .or(&crate::error_type_registry::REGISTRY),
298                                error_code,
299                                &mut *deser,
300                            )
301                        }) {
302                        ::std::option::Option::Some(source) => <crate::operation::get_plan::GetPlanError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
303                        ::std::option::Option::None => crate::operation::get_plan::GetPlanError::generic(generic),
304                    }
305                }
306            };
307            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
308                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
309            ))
310        } else {
311            let protocol = _cfg
312                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
313                .expect("a SharedClientProtocol is required");
314            let mut deser = protocol.deserialize_response(response, GetPlan::OUTPUT_SCHEMA, _cfg).map_err(|e| {
315                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
316            })?;
317            // `headers` is already in scope from the top of the function; alias it as
318            // `_response_headers` so MutateOutput customizations have a stable name to
319            // read from.
320            let _response_headers = headers;
321            // `mut` is required because `deserialize_members` and the `MutateOutput`
322            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
323            // empty output has no members and no customizations to run.
324            #[allow(unused_mut)]
325            let mut output = <crate::operation::get_plan::builders::GetPlanOutputBuilder>::default();
326            output.deserialize_members(&mut *deser).map_err(|e| {
327                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
328            })?;
329            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
330            let output = output.build();
331            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
332        }
333    }
334}
335#[derive(Debug)]
336struct GetPlanRequestSerializer;
337impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetPlanRequestSerializer {
338    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
339    fn serialize_input(
340        &self,
341        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
342        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
343    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
344        let input = input.downcast::<crate::operation::get_plan::GetPlanInput>().expect("correct type");
345
346        let protocol = _cfg
347            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
348            .expect("a SharedClientProtocol is required");
349        let mut request = protocol
350            .serialize_request(&input, GetPlan::INPUT_SCHEMA, "/", _cfg)
351            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
352
353        return ::std::result::Result::Ok(request);
354    }
355}
356#[derive(Debug)]
357struct GetPlanEndpointParamsInterceptor;
358
359#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
360impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetPlanEndpointParamsInterceptor {
361    fn name(&self) -> &'static str {
362        "GetPlanEndpointParamsInterceptor"
363    }
364
365    fn read_before_execution(
366        &self,
367        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
368            '_,
369            ::aws_smithy_runtime_api::client::interceptors::context::Input,
370            ::aws_smithy_runtime_api::client::interceptors::context::Output,
371            ::aws_smithy_runtime_api::client::interceptors::context::Error,
372        >,
373        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
374    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
375        let _input = context
376            .input()
377            .downcast_ref::<GetPlanInput>()
378            .ok_or("failed to downcast to GetPlanInput")?;
379
380        let params = crate::config::endpoint::Params::builder()
381            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
382            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
383            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
384            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
385            .build()
386            .map_err(|err| {
387                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
388            })?;
389        cfg.interceptor_state()
390            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
391        ::std::result::Result::Ok(())
392    }
393}
394
395// The get_* functions below are generated from JMESPath expressions in the
396// operationContextParams trait. They target the operation's input shape.
397
398/// Error type for the `GetPlanError` operation.
399#[non_exhaustive]
400#[derive(::std::fmt::Debug)]
401pub enum GetPlanError {
402    /// <p>An internal service error occurred.</p>
403    InternalServiceException(crate::types::error::InternalServiceException),
404    /// <p>The input provided was not valid.</p>
405    InvalidInputException(crate::types::error::InvalidInputException),
406    /// <p>The operation timed out.</p>
407    OperationTimeoutException(crate::types::error::OperationTimeoutException),
408    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
409    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
410    variable wildcard pattern and check `.code()`:
411     \
412    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
413     \
414    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetPlanError) for what information is available for the error.")]
415    Unhandled(crate::error::sealed_unhandled::Unhandled),
416}
417impl GetPlanError {
418    /// Creates the `GetPlanError::Unhandled` variant from any error type.
419    pub fn unhandled(
420        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
421    ) -> Self {
422        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
423            source: err.into(),
424            meta: ::std::default::Default::default(),
425        })
426    }
427
428    /// Creates the `GetPlanError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
429    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
430        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
431            source: err.clone().into(),
432            meta: err,
433        })
434    }
435    ///
436    /// Returns error metadata, which includes the error code, message,
437    /// request ID, and potentially additional information.
438    ///
439    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
440        match self {
441            Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442            Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443            Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444            Self::Unhandled(e) => &e.meta,
445        }
446    }
447    /// Returns `true` if the error kind is `GetPlanError::InternalServiceException`.
448    pub fn is_internal_service_exception(&self) -> bool {
449        matches!(self, Self::InternalServiceException(_))
450    }
451    /// Returns `true` if the error kind is `GetPlanError::InvalidInputException`.
452    pub fn is_invalid_input_exception(&self) -> bool {
453        matches!(self, Self::InvalidInputException(_))
454    }
455    /// Returns `true` if the error kind is `GetPlanError::OperationTimeoutException`.
456    pub fn is_operation_timeout_exception(&self) -> bool {
457        matches!(self, Self::OperationTimeoutException(_))
458    }
459}
460impl ::std::error::Error for GetPlanError {
461    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
462        match self {
463            Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
464            Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
465            Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
466            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
467        }
468    }
469}
470impl ::std::fmt::Display for GetPlanError {
471    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
472        match self {
473            Self::InternalServiceException(_inner) => _inner.fmt(f),
474            Self::InvalidInputException(_inner) => _inner.fmt(f),
475            Self::OperationTimeoutException(_inner) => _inner.fmt(f),
476            Self::Unhandled(_inner) => {
477                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
478                    write!(f, "unhandled error ({code})")
479                } else {
480                    f.write_str("unhandled error")
481                }
482            }
483        }
484    }
485}
486impl ::aws_smithy_types::retry::ProvideErrorKind for GetPlanError {
487    fn code(&self) -> ::std::option::Option<&str> {
488        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
489    }
490    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
491        ::std::option::Option::None
492    }
493}
494impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetPlanError {
495    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
496        match self {
497            Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
498            Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
499            Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
500            Self::Unhandled(_inner) => &_inner.meta,
501        }
502    }
503}
504impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetPlanError {
505    fn create_unhandled_error(
506        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
507        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
508    ) -> Self {
509        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
510            source,
511            meta: meta.unwrap_or_default(),
512        })
513    }
514}
515impl ::aws_types::request_id::RequestId for crate::operation::get_plan::GetPlanError {
516    fn request_id(&self) -> Option<&str> {
517        self.meta().request_id()
518    }
519}
520
521pub use crate::operation::get_plan::_get_plan_input::GetPlanInput;
522
523pub use crate::operation::get_plan::_get_plan_output::GetPlanOutput;
524
525mod _get_plan_input;
526
527mod _get_plan_output;
528
529/// Builders
530pub mod builders;