Skip to main content

aws_sdk_glue/operation/
start_job_upgrade_analysis.rs

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