Skip to main content

aws_sdk_glue/operation/
update_glossary.rs

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