Skip to main content

aws_sdk_glue/operation/
publish_data_quality_result_v2.rs

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