Skip to main content

aws_sdk_glue/operation/
update_asset.rs

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