Skip to main content

aws_sdk_glue/operation/
get_job.rs

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