1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateJobFromSourceControl;
6impl UpdateJobFromSourceControl {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlInput::SCHEMA;
14 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlOutput::SCHEMA;
17 pub(crate) async fn orchestrate(
18 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19 input: crate::operation::update_job_from_source_control::UpdateJobFromSourceControlInput,
20 ) -> ::std::result::Result<
21 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlOutput,
22 ::aws_smithy_runtime_api::client::result::SdkError<
23 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlError,
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_job_from_source_control::UpdateJobFromSourceControlError>()
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_job_from_source_control::UpdateJobFromSourceControlOutput>()
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_job_from_source_control::UpdateJobFromSourceControlInput,
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", "UpdateJobFromSourceControl", input, runtime_plugins, stop_point)
61 .instrument(::tracing::debug_span!(
64 "Glue.UpdateJobFromSourceControl",
65 "rpc.service" = "Glue",
66 "rpc.method" = "UpdateJobFromSourceControl",
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}
93pub(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 UpdateJobFromSourceControl {
171 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
172 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateJobFromSourceControl");
173
174 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
175 UpdateJobFromSourceControlRequestSerializer,
176 ));
177 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
178 UpdateJobFromSourceControlResponseDeserializer,
179 ));
180
181 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
182 crate::config::auth::Params::builder()
183 .operation_name("UpdateJobFromSourceControl")
184 .build()
185 .expect("required fields set"),
186 ));
187
188 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
189 "UpdateJobFromSourceControl",
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("UpdateJobFromSourceControl")
212 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
213 UpdateJobFromSourceControlTelemetryInputCaptureInterceptor,
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 UpdateJobFromSourceControlEndpointParamsInterceptor,
220 ))
221 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
222 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlError,
223 >::new())
224 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
225 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlError,
226 >::new())
227 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
228 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlError,
229 >::new())
230 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
231 crate::operation::update_job_from_source_control::UpdateJobFromSourceControlError,
232 >::new());
233
234 ::std::borrow::Cow::Owned(rcb)
235 }
236}
237
238#[derive(Debug)]
239struct UpdateJobFromSourceControlTelemetryInputCaptureInterceptor;
240
241#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
242impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateJobFromSourceControlTelemetryInputCaptureInterceptor {
243 fn name(&self) -> &'static str {
244 "UpdateJobFromSourceControlTelemetryInputCaptureInterceptor"
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 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::<UpdateJobFromSourceControlInput>() else {
266 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 UpdateJobFromSourceControlResponseDeserializer;
313impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateJobFromSourceControlResponseDeserializer {
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 #[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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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_job_from_source_control::UpdateJobFromSourceControlError::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 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_job_from_source_control::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_job_from_source_control::UpdateJobFromSourceControlError 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_job_from_source_control::UpdateJobFromSourceControlError::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, UpdateJobFromSourceControl::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 let _response_headers = headers;
530 #[allow(unused_mut)]
534 let mut output = <crate::operation::update_job_from_source_control::builders::UpdateJobFromSourceControlOutputBuilder>::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 UpdateJobFromSourceControlRequestSerializer;
546impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateJobFromSourceControlRequestSerializer {
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_job_from_source_control::UpdateJobFromSourceControlInput>()
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, UpdateJobFromSourceControl::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 UpdateJobFromSourceControlEndpointParamsInterceptor;
569
570#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
571impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateJobFromSourceControlEndpointParamsInterceptor {
572 fn name(&self) -> &'static str {
573 "UpdateJobFromSourceControlEndpointParamsInterceptor"
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::<UpdateJobFromSourceControlInput>()
589 .ok_or("failed to downcast to UpdateJobFromSourceControlInput")?;
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#[non_exhaustive]
611#[derive(::std::fmt::Debug)]
612pub enum UpdateJobFromSourceControlError {
613 AccessDeniedException(crate::types::error::AccessDeniedException),
615 AlreadyExistsException(crate::types::error::AlreadyExistsException),
617 EntityNotFoundException(crate::types::error::EntityNotFoundException),
619 InternalServiceException(crate::types::error::InternalServiceException),
621 InvalidInputException(crate::types::error::InvalidInputException),
623 OperationTimeoutException(crate::types::error::OperationTimeoutException),
625 ValidationException(crate::types::error::ValidationException),
627 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
629 variable wildcard pattern and check `.code()`:
630 \
631 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
632 \
633 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateJobFromSourceControlError) for what information is available for the error.")]
634 Unhandled(crate::error::sealed_unhandled::Unhandled),
635}
636impl UpdateJobFromSourceControlError {
637 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 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 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 pub fn is_access_denied_exception(&self) -> bool {
672 matches!(self, Self::AccessDeniedException(_))
673 }
674 pub fn is_already_exists_exception(&self) -> bool {
676 matches!(self, Self::AlreadyExistsException(_))
677 }
678 pub fn is_entity_not_found_exception(&self) -> bool {
680 matches!(self, Self::EntityNotFoundException(_))
681 }
682 pub fn is_internal_service_exception(&self) -> bool {
684 matches!(self, Self::InternalServiceException(_))
685 }
686 pub fn is_invalid_input_exception(&self) -> bool {
688 matches!(self, Self::InvalidInputException(_))
689 }
690 pub fn is_operation_timeout_exception(&self) -> bool {
692 matches!(self, Self::OperationTimeoutException(_))
693 }
694 pub fn is_validation_exception(&self) -> bool {
696 matches!(self, Self::ValidationException(_))
697 }
698}
699impl ::std::error::Error for UpdateJobFromSourceControlError {
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 UpdateJobFromSourceControlError {
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 UpdateJobFromSourceControlError {
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 UpdateJobFromSourceControlError {
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 UpdateJobFromSourceControlError {
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_job_from_source_control::UpdateJobFromSourceControlError {
767 fn request_id(&self) -> Option<&str> {
768 self.meta().request_id()
769 }
770}
771
772pub use crate::operation::update_job_from_source_control::_update_job_from_source_control_input::UpdateJobFromSourceControlInput;
773
774pub use crate::operation::update_job_from_source_control::_update_job_from_source_control_output::UpdateJobFromSourceControlOutput;
775
776mod _update_job_from_source_control_input;
777
778mod _update_job_from_source_control_output;
779
780pub mod builders;