Skip to main content

aws_sdk_glue/operation/
disassociate_glossary_terms.rs

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