Skip to main content

aws_sdk_glue/operation/
update_data_quality_ruleset.rs

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