Skip to main content

aws_sdk_glue/operation/
update_source_control_from_job.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `UpdateSourceControlFromJob`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateSourceControlFromJob;
6impl UpdateSourceControlFromJob {
7    /// Creates a new `UpdateSourceControlFromJob`
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::update_source_control_from_job::UpdateSourceControlFromJobInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::update_source_control_from_job::UpdateSourceControlFromJobOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::update_source_control_from_job::UpdateSourceControlFromJobInput,
20    ) -> ::std::result::Result<
21        crate::operation::update_source_control_from_job::UpdateSourceControlFromJobOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError,
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::update_source_control_from_job::UpdateSourceControlFromJobError>()
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::update_source_control_from_job::UpdateSourceControlFromJobOutput>()
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::update_source_control_from_job::UpdateSourceControlFromJobInput,
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", "UpdateSourceControlFromJob", 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.UpdateSourceControlFromJob",
65                "rpc.service" = "Glue",
66                "rpc.method" = "UpdateSourceControlFromJob",
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::AlreadyExistsException::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::AlreadyExistsException::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::AlreadyExistsException::deserialize(d)?))
120                        },
121                    )
122.insert_error_shape(
123                        crate::types::error::EntityNotFoundException::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::EntityNotFoundException::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::EntityNotFoundException::deserialize(d)?))
129                        },
130                    )
131.insert_error_shape(
132                        crate::types::error::InternalServiceException::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::InternalServiceException::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::InternalServiceException::deserialize(d)?))
138                        },
139                    )
140.insert_error_shape(
141                        crate::types::error::InvalidInputException::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::InvalidInputException::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::InvalidInputException::deserialize(d)?))
147                        },
148                    )
149.insert_error_shape(
150                        crate::types::error::OperationTimeoutException::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::OperationTimeoutException::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::OperationTimeoutException::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 UpdateSourceControlFromJob {
171    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
172        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateSourceControlFromJob");
173
174        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
175            UpdateSourceControlFromJobRequestSerializer,
176        ));
177        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
178            UpdateSourceControlFromJobResponseDeserializer,
179        ));
180
181        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
182            crate::config::auth::Params::builder()
183                .operation_name("UpdateSourceControlFromJob")
184                .build()
185                .expect("required fields set"),
186        ));
187
188        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
189            "UpdateSourceControlFromJob",
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("UpdateSourceControlFromJob")
212            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
213                UpdateSourceControlFromJobTelemetryInputCaptureInterceptor,
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                UpdateSourceControlFromJobEndpointParamsInterceptor,
220            ))
221            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
222                crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError,
223            >::new())
224            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
225                crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError,
226            >::new())
227            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
228                crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError,
229            >::new())
230            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
231                crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError,
232            >::new());
233
234        ::std::borrow::Cow::Owned(rcb)
235    }
236}
237
238#[derive(Debug)]
239struct UpdateSourceControlFromJobTelemetryInputCaptureInterceptor;
240
241#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
242impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateSourceControlFromJobTelemetryInputCaptureInterceptor {
243    fn name(&self) -> &'static str {
244        "UpdateSourceControlFromJobTelemetryInputCaptureInterceptor"
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::<UpdateSourceControlFromJobInput>() 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("RepositoryName") {
277            if let ::std::option::Option::Some(value) = input.repository_name.as_deref() {
278                captured.insert("RepositoryName", value);
279            }
280        }
281        if requested.should_capture("RepositoryOwner") {
282            if let ::std::option::Option::Some(value) = input.repository_owner.as_deref() {
283                captured.insert("RepositoryOwner", value);
284            }
285        }
286        if requested.should_capture("BranchName") {
287            if let ::std::option::Option::Some(value) = input.branch_name.as_deref() {
288                captured.insert("BranchName", value);
289            }
290        }
291        if requested.should_capture("Folder") {
292            if let ::std::option::Option::Some(value) = input.folder.as_deref() {
293                captured.insert("Folder", value);
294            }
295        }
296        if requested.should_capture("CommitId") {
297            if let ::std::option::Option::Some(value) = input.commit_id.as_deref() {
298                captured.insert("CommitId", value);
299            }
300        }
301        if requested.should_capture("AuthToken") {
302            if let ::std::option::Option::Some(value) = input.auth_token.as_deref() {
303                captured.insert("AuthToken", value);
304            }
305        }
306
307        cfg.interceptor_state().store_put(captured);
308        ::std::result::Result::Ok(())
309    }
310}
311#[derive(Debug)]
312struct UpdateSourceControlFromJobResponseDeserializer;
313impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateSourceControlFromJobResponseDeserializer {
314    fn deserialize_nonstreaming_with_config(
315        &self,
316        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
317        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
318    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
319        let (success, status) = (response.status().is_success(), response.status().as_u16());
320        // Load body and headers BEFORE BeforeParseResponse so customizations
321        // (e.g., S3's `body_is_error` check that detects errors returned with
322        // HTTP 200) can inspect them. The legacy non-streaming path also
323        // loads `body` before firing this hook.
324        #[allow(unused_variables)]
325        let body = response.body().bytes().expect("body loaded");
326        let headers = response.headers();
327        #[allow(unused_mut)]
328        let mut force_error = false;
329        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
330        if !success && status != 200 || force_error {
331            let protocol = _cfg
332                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
333                .expect("a SharedClientProtocol is required");
334            #[allow(unused_mut)]
335            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
336                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
337            })?;
338            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
339            let generic = generic_builder.build();
340            let error_code = match generic.code() {
341                ::std::option::Option::Some(code) => code,
342                ::std::option::Option::None => {
343                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
344                        ::aws_smithy_runtime_api::box_error::BoxError::from(
345                            crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::unhandled(generic),
346                        ),
347                    ))
348                }
349            };
350            let _error_message = generic.message().map(|msg| msg.to_owned());
351            let err = match error_code {
352                "AccessDeniedException" => {
353                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::AccessDeniedException({
354                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
355                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
356                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
357                            )
358                        })?;
359                        let mut tmp = <crate::types::error::builders::AccessDeniedExceptionBuilder>::default();
360                        tmp.deserialize_members(&mut *deser).map_err(|e| {
361                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
362                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
363                            )
364                        })?;
365                        if tmp.message.is_none() {
366                            tmp.message = _error_message;
367                        }
368                        let tmp = tmp.meta(generic);
369                        tmp.build()
370                    })
371                }
372                "AlreadyExistsException" => {
373                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::AlreadyExistsException({
374                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
375                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
376                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
377                            )
378                        })?;
379                        let mut tmp = <crate::types::error::builders::AlreadyExistsExceptionBuilder>::default();
380                        tmp.deserialize_members(&mut *deser).map_err(|e| {
381                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
382                                ::aws_smithy_runtime_api::box_error::BoxError::from(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                }
392                "EntityNotFoundException" => {
393                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::EntityNotFoundException({
394                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
395                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
396                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
397                            )
398                        })?;
399                        let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
400                        tmp.deserialize_members(&mut *deser).map_err(|e| {
401                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
402                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
403                            )
404                        })?;
405                        if tmp.message.is_none() {
406                            tmp.message = _error_message;
407                        }
408                        let tmp = tmp.meta(generic);
409                        tmp.build()
410                    })
411                }
412                "InternalServiceException" => {
413                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::InternalServiceException({
414                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
415                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
416                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
417                            )
418                        })?;
419                        let mut tmp = <crate::types::error::builders::InternalServiceExceptionBuilder>::default();
420                        tmp.deserialize_members(&mut *deser).map_err(|e| {
421                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
422                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
423                            )
424                        })?;
425                        if tmp.message.is_none() {
426                            tmp.message = _error_message;
427                        }
428                        let tmp = tmp.meta(generic);
429                        tmp.build()
430                    })
431                }
432                "InvalidInputException" => {
433                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::InvalidInputException({
434                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
435                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
436                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
437                            )
438                        })?;
439                        let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
440                        tmp.deserialize_members(&mut *deser).map_err(|e| {
441                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
442                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
443                            )
444                        })?;
445                        if tmp.message.is_none() {
446                            tmp.message = _error_message;
447                        }
448                        let tmp = tmp.meta(generic);
449                        tmp.build()
450                    })
451                }
452                "OperationTimeoutException" => {
453                    crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::OperationTimeoutException({
454                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
455                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
456                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
457                            )
458                        })?;
459                        let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
460                        tmp.deserialize_members(&mut *deser).map_err(|e| {
461                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
462                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
463                            )
464                        })?;
465                        if tmp.message.is_none() {
466                            tmp.message = _error_message;
467                        }
468                        let tmp = tmp.meta(generic);
469                        tmp.build()
470                    })
471                }
472                "ValidationException" => crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::ValidationException({
473                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
474                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
475                            e,
476                        ))
477                    })?;
478                    let mut tmp = <crate::types::error::builders::ValidationExceptionBuilder>::default();
479                    tmp.deserialize_members(&mut *deser).map_err(|e| {
480                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
481                            e,
482                        ))
483                    })?;
484                    if tmp.message.is_none() {
485                        tmp.message = _error_message;
486                    }
487                    let tmp = tmp.meta(generic);
488                    tmp.build()
489                }),
490                _ => {
491                    // Registry-backed, operation-scoped reification of an error whose
492                    // code this operation does not model directly: the operation's own
493                    // error registry is consulted first, then the lookup widens to the
494                    // service-wide error registry. On a hit, the reified error is attached
495                    // as the source of the returned unhandled error while its metadata
496                    // (code, message, request id) is preserved; on a miss the generic
497                    // error is returned unchanged.
498                    match protocol
499                        .deserialize_error_response(response, _cfg)
500                        .ok()
501                        .and_then(|mut deser| {
502                            ::aws_smithy_schema::registry::reify_error(
503                                crate::operation::update_source_control_from_job::error_registry::REGISTRY
504                                    .or(&crate::error_type_registry::REGISTRY),
505                                error_code,
506                                &mut *deser,
507                            )
508                        }) {
509                        ::std::option::Option::Some(source) => <crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
510                        ::std::option::Option::None => crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError::generic(generic),
511                    }
512                }
513            };
514            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
515                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
516            ))
517        } else {
518            let protocol = _cfg
519                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
520                .expect("a SharedClientProtocol is required");
521            let mut deser = protocol
522                .deserialize_response(response, UpdateSourceControlFromJob::OUTPUT_SCHEMA, _cfg)
523                .map_err(|e| {
524                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
525                })?;
526            // `headers` is already in scope from the top of the function; alias it as
527            // `_response_headers` so MutateOutput customizations have a stable name to
528            // read from.
529            let _response_headers = headers;
530            // `mut` is required because `deserialize_members` and the `MutateOutput`
531            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
532            // empty output has no members and no customizations to run.
533            #[allow(unused_mut)]
534            let mut output = <crate::operation::update_source_control_from_job::builders::UpdateSourceControlFromJobOutputBuilder>::default();
535            output.deserialize_members(&mut *deser).map_err(|e| {
536                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
537            })?;
538            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
539            let output = output.build();
540            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
541        }
542    }
543}
544#[derive(Debug)]
545struct UpdateSourceControlFromJobRequestSerializer;
546impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateSourceControlFromJobRequestSerializer {
547    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
548    fn serialize_input(
549        &self,
550        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
551        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
552    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
553        let input = input
554            .downcast::<crate::operation::update_source_control_from_job::UpdateSourceControlFromJobInput>()
555            .expect("correct type");
556
557        let protocol = _cfg
558            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
559            .expect("a SharedClientProtocol is required");
560        let mut request = protocol
561            .serialize_request(&input, UpdateSourceControlFromJob::INPUT_SCHEMA, "/", _cfg)
562            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
563
564        return ::std::result::Result::Ok(request);
565    }
566}
567#[derive(Debug)]
568struct UpdateSourceControlFromJobEndpointParamsInterceptor;
569
570#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
571impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateSourceControlFromJobEndpointParamsInterceptor {
572    fn name(&self) -> &'static str {
573        "UpdateSourceControlFromJobEndpointParamsInterceptor"
574    }
575
576    fn read_before_execution(
577        &self,
578        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
579            '_,
580            ::aws_smithy_runtime_api::client::interceptors::context::Input,
581            ::aws_smithy_runtime_api::client::interceptors::context::Output,
582            ::aws_smithy_runtime_api::client::interceptors::context::Error,
583        >,
584        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
585    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
586        let _input = context
587            .input()
588            .downcast_ref::<UpdateSourceControlFromJobInput>()
589            .ok_or("failed to downcast to UpdateSourceControlFromJobInput")?;
590
591        let params = crate::config::endpoint::Params::builder()
592            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
593            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
594            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
595            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
596            .build()
597            .map_err(|err| {
598                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
599            })?;
600        cfg.interceptor_state()
601            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
602        ::std::result::Result::Ok(())
603    }
604}
605
606// The get_* functions below are generated from JMESPath expressions in the
607// operationContextParams trait. They target the operation's input shape.
608
609/// Error type for the `UpdateSourceControlFromJobError` operation.
610#[non_exhaustive]
611#[derive(::std::fmt::Debug)]
612pub enum UpdateSourceControlFromJobError {
613    /// <p>Access to a resource was denied.</p>
614    AccessDeniedException(crate::types::error::AccessDeniedException),
615    /// <p>A resource to be created or added already exists.</p>
616    AlreadyExistsException(crate::types::error::AlreadyExistsException),
617    /// <p>A specified entity does not exist</p>
618    EntityNotFoundException(crate::types::error::EntityNotFoundException),
619    /// <p>An internal service error occurred.</p>
620    InternalServiceException(crate::types::error::InternalServiceException),
621    /// <p>The input provided was not valid.</p>
622    InvalidInputException(crate::types::error::InvalidInputException),
623    /// <p>The operation timed out.</p>
624    OperationTimeoutException(crate::types::error::OperationTimeoutException),
625    /// <p>A value could not be validated.</p>
626    ValidationException(crate::types::error::ValidationException),
627    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
628    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
629    variable wildcard pattern and check `.code()`:
630     \
631    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
632     \
633    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateSourceControlFromJobError) for what information is available for the error.")]
634    Unhandled(crate::error::sealed_unhandled::Unhandled),
635}
636impl UpdateSourceControlFromJobError {
637    /// Creates the `UpdateSourceControlFromJobError::Unhandled` variant from any error type.
638    pub fn unhandled(
639        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
640    ) -> Self {
641        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
642            source: err.into(),
643            meta: ::std::default::Default::default(),
644        })
645    }
646
647    /// Creates the `UpdateSourceControlFromJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
648    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
649        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
650            source: err.clone().into(),
651            meta: err,
652        })
653    }
654    ///
655    /// Returns error metadata, which includes the error code, message,
656    /// request ID, and potentially additional information.
657    ///
658    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
659        match self {
660            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
661            Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
662            Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
663            Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
664            Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
665            Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
666            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
667            Self::Unhandled(e) => &e.meta,
668        }
669    }
670    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::AccessDeniedException`.
671    pub fn is_access_denied_exception(&self) -> bool {
672        matches!(self, Self::AccessDeniedException(_))
673    }
674    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::AlreadyExistsException`.
675    pub fn is_already_exists_exception(&self) -> bool {
676        matches!(self, Self::AlreadyExistsException(_))
677    }
678    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::EntityNotFoundException`.
679    pub fn is_entity_not_found_exception(&self) -> bool {
680        matches!(self, Self::EntityNotFoundException(_))
681    }
682    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::InternalServiceException`.
683    pub fn is_internal_service_exception(&self) -> bool {
684        matches!(self, Self::InternalServiceException(_))
685    }
686    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::InvalidInputException`.
687    pub fn is_invalid_input_exception(&self) -> bool {
688        matches!(self, Self::InvalidInputException(_))
689    }
690    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::OperationTimeoutException`.
691    pub fn is_operation_timeout_exception(&self) -> bool {
692        matches!(self, Self::OperationTimeoutException(_))
693    }
694    /// Returns `true` if the error kind is `UpdateSourceControlFromJobError::ValidationException`.
695    pub fn is_validation_exception(&self) -> bool {
696        matches!(self, Self::ValidationException(_))
697    }
698}
699impl ::std::error::Error for UpdateSourceControlFromJobError {
700    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
701        match self {
702            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
703            Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
704            Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
705            Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
706            Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
707            Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
708            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
709            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
710        }
711    }
712}
713impl ::std::fmt::Display for UpdateSourceControlFromJobError {
714    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
715        match self {
716            Self::AccessDeniedException(_inner) => _inner.fmt(f),
717            Self::AlreadyExistsException(_inner) => _inner.fmt(f),
718            Self::EntityNotFoundException(_inner) => _inner.fmt(f),
719            Self::InternalServiceException(_inner) => _inner.fmt(f),
720            Self::InvalidInputException(_inner) => _inner.fmt(f),
721            Self::OperationTimeoutException(_inner) => _inner.fmt(f),
722            Self::ValidationException(_inner) => _inner.fmt(f),
723            Self::Unhandled(_inner) => {
724                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
725                    write!(f, "unhandled error ({code})")
726                } else {
727                    f.write_str("unhandled error")
728                }
729            }
730        }
731    }
732}
733impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateSourceControlFromJobError {
734    fn code(&self) -> ::std::option::Option<&str> {
735        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
736    }
737    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
738        ::std::option::Option::None
739    }
740}
741impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateSourceControlFromJobError {
742    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
743        match self {
744            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
745            Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
746            Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
747            Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
748            Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
749            Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
750            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
751            Self::Unhandled(_inner) => &_inner.meta,
752        }
753    }
754}
755impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateSourceControlFromJobError {
756    fn create_unhandled_error(
757        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
758        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
759    ) -> Self {
760        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
761            source,
762            meta: meta.unwrap_or_default(),
763        })
764    }
765}
766impl ::aws_types::request_id::RequestId for crate::operation::update_source_control_from_job::UpdateSourceControlFromJobError {
767    fn request_id(&self) -> Option<&str> {
768        self.meta().request_id()
769    }
770}
771
772pub use crate::operation::update_source_control_from_job::_update_source_control_from_job_input::UpdateSourceControlFromJobInput;
773
774pub use crate::operation::update_source_control_from_job::_update_source_control_from_job_output::UpdateSourceControlFromJobOutput;
775
776mod _update_source_control_from_job_input;
777
778mod _update_source_control_from_job_output;
779
780/// Builders
781pub mod builders;