Skip to main content

aws_sdk_glue/operation/
update_ml_transform.rs

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