Skip to main content

aws_sdk_glue/operation/
get_asset.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `GetAsset`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetAsset;
6impl GetAsset {
7    /// Creates a new `GetAsset`
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_asset::GetAssetInput::SCHEMA;
13    /// The schema for this operation's output shape.
14    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_asset::GetAssetOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17        input: crate::operation::get_asset::GetAssetInput,
18    ) -> ::std::result::Result<
19        crate::operation::get_asset::GetAssetOutput,
20        ::aws_smithy_runtime_api::client::result::SdkError<
21            crate::operation::get_asset::GetAssetError,
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_asset::GetAssetError>().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_asset::GetAssetOutput>()
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_asset::GetAssetInput,
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", "GetAsset", 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.GetAsset",
59                "rpc.service" = "Glue",
60                "rpc.method" = "GetAsset",
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::AccessDeniedException::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::AccessDeniedException::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::AccessDeniedException::deserialize(d)?))
105                        },
106                    )
107.insert_error_shape(
108                        crate::types::error::EntityNotFoundException::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::EntityNotFoundException::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::EntityNotFoundException::deserialize(d)?))
114                        },
115                    )
116.insert_error_shape(
117                        crate::types::error::InternalServiceException::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::InternalServiceException::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::InternalServiceException::deserialize(d)?))
123                        },
124                    )
125.insert_error_shape(
126                        crate::types::error::InvalidInputException::SCHEMA,
127                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
128                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidInputException::deserialize(d)?))
129                        },
130                        |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> {
131                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidInputException::deserialize(d)?))
132                        },
133                    )
134.insert_error_shape(
135                        crate::types::error::ThrottlingException::SCHEMA,
136                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
137                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ThrottlingException::deserialize(d)?))
138                        },
139                        |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> {
140                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ThrottlingException::deserialize(d)?))
141                        },
142                    )
143                            .build()
144    });
145}
146impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetAsset {
147    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
148        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetAsset");
149
150        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
151            GetAssetRequestSerializer,
152        ));
153        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
154            GetAssetResponseDeserializer,
155        ));
156
157        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
158            crate::config::auth::Params::builder()
159                .operation_name("GetAsset")
160                .build()
161                .expect("required fields set"),
162        ));
163
164        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetAsset", "Glue"));
165        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
166        signing_options.double_uri_encode = true;
167        signing_options.content_sha256_header = false;
168        signing_options.normalize_uri_path = true;
169        signing_options.payload_override = None;
170
171        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
172            signing_options,
173            ..::std::default::Default::default()
174        });
175
176        ::std::option::Option::Some(cfg.freeze())
177    }
178
179    fn runtime_components(
180        &self,
181        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
182    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
183        #[allow(unused_mut)]
184        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetAsset")
185            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
186                GetAssetTelemetryInputCaptureInterceptor,
187            ))
188            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
189                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
190            ))
191            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
192                GetAssetEndpointParamsInterceptor,
193            ))
194            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
195                crate::operation::get_asset::GetAssetError,
196            >::new())
197            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
198                crate::operation::get_asset::GetAssetError,
199            >::new())
200            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
201                crate::operation::get_asset::GetAssetError,
202            >::new())
203            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
204                crate::operation::get_asset::GetAssetError,
205            >::new());
206
207        ::std::borrow::Cow::Owned(rcb)
208    }
209}
210
211#[derive(Debug)]
212struct GetAssetTelemetryInputCaptureInterceptor;
213
214#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
215impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAssetTelemetryInputCaptureInterceptor {
216    fn name(&self) -> &'static str {
217        "GetAssetTelemetryInputCaptureInterceptor"
218    }
219
220    fn read_before_execution(
221        &self,
222        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
223            '_,
224            ::aws_smithy_runtime_api::client::interceptors::context::Input,
225            ::aws_smithy_runtime_api::client::interceptors::context::Output,
226            ::aws_smithy_runtime_api::client::interceptors::context::Error,
227        >,
228        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
229    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
230        // Nothing to do unless the customer opted in by naming members to record.
231        let ::std::option::Option::Some(requested) = cfg
232            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
233            .filter(|r| !r.is_empty())
234        else {
235            return ::std::result::Result::Ok(());
236        };
237
238        let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetAssetInput>() else {
239            // A mismatched input is not this interceptor's concern; skip quietly.
240            return ::std::result::Result::Ok(());
241        };
242
243        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
244        if requested.should_capture("Identifier") {
245            if let ::std::option::Option::Some(value) = input.identifier.as_deref() {
246                captured.insert("Identifier", value);
247            }
248        }
249
250        cfg.interceptor_state().store_put(captured);
251        ::std::result::Result::Ok(())
252    }
253}
254#[derive(Debug)]
255struct GetAssetResponseDeserializer;
256impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetAssetResponseDeserializer {
257    fn deserialize_nonstreaming_with_config(
258        &self,
259        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
260        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
261    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
262        let (success, status) = (response.status().is_success(), response.status().as_u16());
263        // Load body and headers BEFORE BeforeParseResponse so customizations
264        // (e.g., S3's `body_is_error` check that detects errors returned with
265        // HTTP 200) can inspect them. The legacy non-streaming path also
266        // loads `body` before firing this hook.
267        #[allow(unused_variables)]
268        let body = response.body().bytes().expect("body loaded");
269        let headers = response.headers();
270        #[allow(unused_mut)]
271        let mut force_error = false;
272        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
273        if !success && status != 200 || force_error {
274            let protocol = _cfg
275                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
276                .expect("a SharedClientProtocol is required");
277            #[allow(unused_mut)]
278            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
279                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
280            })?;
281            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
282            let generic = generic_builder.build();
283            let error_code = match generic.code() {
284                ::std::option::Option::Some(code) => code,
285                ::std::option::Option::None => {
286                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
287                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::get_asset::GetAssetError::unhandled(generic)),
288                    ))
289                }
290            };
291            let _error_message = generic.message().map(|msg| msg.to_owned());
292            let err = match error_code {
293                "AccessDeniedException" => crate::operation::get_asset::GetAssetError::AccessDeniedException({
294                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
295                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
296                            e,
297                        ))
298                    })?;
299                    let mut tmp = <crate::types::error::builders::AccessDeniedExceptionBuilder>::default();
300                    tmp.deserialize_members(&mut *deser).map_err(|e| {
301                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
302                            e,
303                        ))
304                    })?;
305                    if tmp.message.is_none() {
306                        tmp.message = _error_message;
307                    }
308                    let tmp = tmp.meta(generic);
309                    tmp.build()
310                }),
311                "EntityNotFoundException" => crate::operation::get_asset::GetAssetError::EntityNotFoundException({
312                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
313                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
314                            e,
315                        ))
316                    })?;
317                    let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
318                    tmp.deserialize_members(&mut *deser).map_err(|e| {
319                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
320                            e,
321                        ))
322                    })?;
323                    if tmp.message.is_none() {
324                        tmp.message = _error_message;
325                    }
326                    let tmp = tmp.meta(generic);
327                    tmp.build()
328                }),
329                "InternalServiceException" => crate::operation::get_asset::GetAssetError::InternalServiceException({
330                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
331                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
332                            e,
333                        ))
334                    })?;
335                    let mut tmp = <crate::types::error::builders::InternalServiceExceptionBuilder>::default();
336                    tmp.deserialize_members(&mut *deser).map_err(|e| {
337                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
338                            e,
339                        ))
340                    })?;
341                    if tmp.message.is_none() {
342                        tmp.message = _error_message;
343                    }
344                    let tmp = tmp.meta(generic);
345                    tmp.build()
346                }),
347                "InvalidInputException" => crate::operation::get_asset::GetAssetError::InvalidInputException({
348                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
349                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
350                            e,
351                        ))
352                    })?;
353                    let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
354                    tmp.deserialize_members(&mut *deser).map_err(|e| {
355                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
356                            e,
357                        ))
358                    })?;
359                    if tmp.message.is_none() {
360                        tmp.message = _error_message;
361                    }
362                    let tmp = tmp.meta(generic);
363                    tmp.build()
364                }),
365                "ThrottlingException" => crate::operation::get_asset::GetAssetError::ThrottlingException({
366                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
367                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
368                            e,
369                        ))
370                    })?;
371                    let mut tmp = <crate::types::error::builders::ThrottlingExceptionBuilder>::default();
372                    tmp.deserialize_members(&mut *deser).map_err(|e| {
373                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
374                            e,
375                        ))
376                    })?;
377                    if tmp.message.is_none() {
378                        tmp.message = _error_message;
379                    }
380                    let tmp = tmp.meta(generic);
381                    tmp.build()
382                }),
383                _ => {
384                    // Registry-backed, operation-scoped reification of an error whose
385                    // code this operation does not model directly: the operation's own
386                    // error registry is consulted first, then the lookup widens to the
387                    // service-wide error registry. On a hit, the reified error is attached
388                    // as the source of the returned unhandled error while its metadata
389                    // (code, message, request id) is preserved; on a miss the generic
390                    // error is returned unchanged.
391                    match protocol
392                        .deserialize_error_response(response, _cfg)
393                        .ok()
394                        .and_then(|mut deser| {
395                            ::aws_smithy_schema::registry::reify_error(
396                                crate::operation::get_asset::error_registry::REGISTRY
397                                    .or(&crate::error_type_registry::REGISTRY),
398                                error_code,
399                                &mut *deser,
400                            )
401                        }) {
402                        ::std::option::Option::Some(source) => <crate::operation::get_asset::GetAssetError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
403                        ::std::option::Option::None => crate::operation::get_asset::GetAssetError::generic(generic),
404                    }
405                }
406            };
407            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
408                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
409            ))
410        } else {
411            let protocol = _cfg
412                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
413                .expect("a SharedClientProtocol is required");
414            let mut deser = protocol.deserialize_response(response, GetAsset::OUTPUT_SCHEMA, _cfg).map_err(|e| {
415                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
416            })?;
417            // `headers` is already in scope from the top of the function; alias it as
418            // `_response_headers` so MutateOutput customizations have a stable name to
419            // read from.
420            let _response_headers = headers;
421            // `mut` is required because `deserialize_members` and the `MutateOutput`
422            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
423            // empty output has no members and no customizations to run.
424            #[allow(unused_mut)]
425            let mut output = <crate::operation::get_asset::builders::GetAssetOutputBuilder>::default();
426            output.deserialize_members(&mut *deser).map_err(|e| {
427                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
428            })?;
429            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
430            let output = crate::serde_util::get_asset_output_output_correct_errors(output).build().map_err(|e| {
431                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
432            })?;
433            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
434        }
435    }
436}
437#[derive(Debug)]
438struct GetAssetRequestSerializer;
439impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetAssetRequestSerializer {
440    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
441    fn serialize_input(
442        &self,
443        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
444        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
445    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
446        let input = input.downcast::<crate::operation::get_asset::GetAssetInput>().expect("correct type");
447        let _required_check = input
448            .identifier
449            .as_ref()
450            .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("identifier", "cannot be empty or unset"))?;
451        if _required_check.is_empty() {
452            return ::std::result::Result::Err(
453                ::aws_smithy_types::error::operation::BuildError::missing_field("identifier", "cannot be empty or unset").into(),
454            );
455        }
456        let protocol = _cfg
457            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
458            .expect("a SharedClientProtocol is required");
459        let mut request = protocol
460            .serialize_request(&input, GetAsset::INPUT_SCHEMA, "/", _cfg)
461            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
462
463        return ::std::result::Result::Ok(request);
464    }
465}
466#[derive(Debug)]
467struct GetAssetEndpointParamsInterceptor;
468
469#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
470impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAssetEndpointParamsInterceptor {
471    fn name(&self) -> &'static str {
472        "GetAssetEndpointParamsInterceptor"
473    }
474
475    fn read_before_execution(
476        &self,
477        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
478            '_,
479            ::aws_smithy_runtime_api::client::interceptors::context::Input,
480            ::aws_smithy_runtime_api::client::interceptors::context::Output,
481            ::aws_smithy_runtime_api::client::interceptors::context::Error,
482        >,
483        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
484    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
485        let _input = context
486            .input()
487            .downcast_ref::<GetAssetInput>()
488            .ok_or("failed to downcast to GetAssetInput")?;
489
490        let params = crate::config::endpoint::Params::builder()
491            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
492            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
493            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
494            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
495            .build()
496            .map_err(|err| {
497                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
498            })?;
499        cfg.interceptor_state()
500            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
501        ::std::result::Result::Ok(())
502    }
503}
504
505// The get_* functions below are generated from JMESPath expressions in the
506// operationContextParams trait. They target the operation's input shape.
507
508/// Error type for the `GetAssetError` operation.
509#[non_exhaustive]
510#[derive(::std::fmt::Debug)]
511pub enum GetAssetError {
512    /// <p>Access to a resource was denied.</p>
513    AccessDeniedException(crate::types::error::AccessDeniedException),
514    /// <p>A specified entity does not exist</p>
515    EntityNotFoundException(crate::types::error::EntityNotFoundException),
516    /// <p>An internal service error occurred.</p>
517    InternalServiceException(crate::types::error::InternalServiceException),
518    /// <p>The input provided was not valid.</p>
519    InvalidInputException(crate::types::error::InvalidInputException),
520    /// <p>The throttling threshhold was exceeded.</p>
521    ThrottlingException(crate::types::error::ThrottlingException),
522    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
523    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
524    variable wildcard pattern and check `.code()`:
525     \
526    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
527     \
528    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetAssetError) for what information is available for the error.")]
529    Unhandled(crate::error::sealed_unhandled::Unhandled),
530}
531impl GetAssetError {
532    /// Creates the `GetAssetError::Unhandled` variant from any error type.
533    pub fn unhandled(
534        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
535    ) -> Self {
536        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
537            source: err.into(),
538            meta: ::std::default::Default::default(),
539        })
540    }
541
542    /// Creates the `GetAssetError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
543    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
544        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
545            source: err.clone().into(),
546            meta: err,
547        })
548    }
549    ///
550    /// Returns error metadata, which includes the error code, message,
551    /// request ID, and potentially additional information.
552    ///
553    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
554        match self {
555            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
556            Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
557            Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
558            Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
559            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
560            Self::Unhandled(e) => &e.meta,
561        }
562    }
563    /// Returns `true` if the error kind is `GetAssetError::AccessDeniedException`.
564    pub fn is_access_denied_exception(&self) -> bool {
565        matches!(self, Self::AccessDeniedException(_))
566    }
567    /// Returns `true` if the error kind is `GetAssetError::EntityNotFoundException`.
568    pub fn is_entity_not_found_exception(&self) -> bool {
569        matches!(self, Self::EntityNotFoundException(_))
570    }
571    /// Returns `true` if the error kind is `GetAssetError::InternalServiceException`.
572    pub fn is_internal_service_exception(&self) -> bool {
573        matches!(self, Self::InternalServiceException(_))
574    }
575    /// Returns `true` if the error kind is `GetAssetError::InvalidInputException`.
576    pub fn is_invalid_input_exception(&self) -> bool {
577        matches!(self, Self::InvalidInputException(_))
578    }
579    /// Returns `true` if the error kind is `GetAssetError::ThrottlingException`.
580    pub fn is_throttling_exception(&self) -> bool {
581        matches!(self, Self::ThrottlingException(_))
582    }
583}
584impl ::std::error::Error for GetAssetError {
585    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
586        match self {
587            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
588            Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
589            Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
590            Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
591            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
592            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
593        }
594    }
595}
596impl ::std::fmt::Display for GetAssetError {
597    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
598        match self {
599            Self::AccessDeniedException(_inner) => _inner.fmt(f),
600            Self::EntityNotFoundException(_inner) => _inner.fmt(f),
601            Self::InternalServiceException(_inner) => _inner.fmt(f),
602            Self::InvalidInputException(_inner) => _inner.fmt(f),
603            Self::ThrottlingException(_inner) => _inner.fmt(f),
604            Self::Unhandled(_inner) => {
605                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
606                    write!(f, "unhandled error ({code})")
607                } else {
608                    f.write_str("unhandled error")
609                }
610            }
611        }
612    }
613}
614impl ::aws_smithy_types::retry::ProvideErrorKind for GetAssetError {
615    fn code(&self) -> ::std::option::Option<&str> {
616        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
617    }
618    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
619        ::std::option::Option::None
620    }
621}
622impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetAssetError {
623    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
624        match self {
625            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
626            Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
627            Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
628            Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
629            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
630            Self::Unhandled(_inner) => &_inner.meta,
631        }
632    }
633}
634impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetAssetError {
635    fn create_unhandled_error(
636        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
637        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
638    ) -> Self {
639        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
640            source,
641            meta: meta.unwrap_or_default(),
642        })
643    }
644}
645impl ::aws_types::request_id::RequestId for crate::operation::get_asset::GetAssetError {
646    fn request_id(&self) -> Option<&str> {
647        self.meta().request_id()
648    }
649}
650
651pub use crate::operation::get_asset::_get_asset_input::GetAssetInput;
652
653pub use crate::operation::get_asset::_get_asset_output::GetAssetOutput;
654
655mod _get_asset_input;
656
657mod _get_asset_output;
658
659/// Builders
660pub mod builders;