Skip to main content

aws_sdk_glue/operation/
create_glossary.rs

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