1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateGlossaryTerm;
6impl UpdateGlossaryTerm {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::update_glossary_term::UpdateGlossaryTermInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::update_glossary_term::UpdateGlossaryTermOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::update_glossary_term::UpdateGlossaryTermInput,
18 ) -> ::std::result::Result<
19 crate::operation::update_glossary_term::UpdateGlossaryTermOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::update_glossary_term::UpdateGlossaryTermError,
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_term::UpdateGlossaryTermError>()
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_term::UpdateGlossaryTermOutput>()
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_term::UpdateGlossaryTermInput,
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", "UpdateGlossaryTerm", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Glue.UpdateGlossaryTerm",
63 "rpc.service" = "Glue",
64 "rpc.method" = "UpdateGlossaryTerm",
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_term::UpdateGlossaryTermInput = 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}
98pub(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 UpdateGlossaryTerm {
176 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
177 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateGlossaryTerm");
178
179 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
180 UpdateGlossaryTermRequestSerializer,
181 ));
182 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
183 UpdateGlossaryTermResponseDeserializer,
184 ));
185
186 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
187 crate::config::auth::Params::builder()
188 .operation_name("UpdateGlossaryTerm")
189 .build()
190 .expect("required fields set"),
191 ));
192
193 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
194 "UpdateGlossaryTerm",
195 "Glue",
196 ));
197 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
198 signing_options.double_uri_encode = true;
199 signing_options.content_sha256_header = false;
200 signing_options.normalize_uri_path = true;
201 signing_options.payload_override = None;
202
203 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
204 signing_options,
205 ..::std::default::Default::default()
206 });
207
208 ::std::option::Option::Some(cfg.freeze())
209 }
210
211 fn runtime_components(
212 &self,
213 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
214 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
215 #[allow(unused_mut)]
216 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateGlossaryTerm")
217 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
218 UpdateGlossaryTermTelemetryInputCaptureInterceptor,
219 ))
220 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
221 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
222 ))
223 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
224 UpdateGlossaryTermEndpointParamsInterceptor,
225 ))
226 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
227 crate::operation::update_glossary_term::UpdateGlossaryTermError,
228 >::new())
229 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
230 crate::operation::update_glossary_term::UpdateGlossaryTermError,
231 >::new())
232 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
233 crate::operation::update_glossary_term::UpdateGlossaryTermError,
234 >::new())
235 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
236 crate::operation::update_glossary_term::UpdateGlossaryTermError,
237 >::new());
238
239 ::std::borrow::Cow::Owned(rcb)
240 }
241}
242
243#[derive(Debug)]
244struct UpdateGlossaryTermTelemetryInputCaptureInterceptor;
245
246#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
247impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateGlossaryTermTelemetryInputCaptureInterceptor {
248 fn name(&self) -> &'static str {
249 "UpdateGlossaryTermTelemetryInputCaptureInterceptor"
250 }
251
252 fn read_before_execution(
253 &self,
254 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
255 '_,
256 ::aws_smithy_runtime_api::client::interceptors::context::Input,
257 ::aws_smithy_runtime_api::client::interceptors::context::Output,
258 ::aws_smithy_runtime_api::client::interceptors::context::Error,
259 >,
260 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
261 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
262 let ::std::option::Option::Some(requested) = cfg
264 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
265 .filter(|r| !r.is_empty())
266 else {
267 return ::std::result::Result::Ok(());
268 };
269
270 let ::std::option::Option::Some(input) = context.input().downcast_ref::<UpdateGlossaryTermInput>() else {
271 return ::std::result::Result::Ok(());
273 };
274
275 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
276 if requested.should_capture("Identifier") {
277 if let ::std::option::Option::Some(value) = input.identifier.as_deref() {
278 captured.insert("Identifier", value);
279 }
280 }
281 if requested.should_capture("Name") {
282 if let ::std::option::Option::Some(value) = input.name.as_deref() {
283 captured.insert("Name", value);
284 }
285 }
286 if requested.should_capture("ShortDescription") {
287 if let ::std::option::Option::Some(value) = input.short_description.as_deref() {
288 captured.insert("ShortDescription", value);
289 }
290 }
291 if requested.should_capture("LongDescription") {
292 if let ::std::option::Option::Some(value) = input.long_description.as_deref() {
293 captured.insert("LongDescription", value);
294 }
295 }
296 if requested.should_capture("ClientToken") {
297 if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
298 captured.insert("ClientToken", value);
299 }
300 }
301
302 cfg.interceptor_state().store_put(captured);
303 ::std::result::Result::Ok(())
304 }
305}
306#[derive(Debug)]
307struct UpdateGlossaryTermResponseDeserializer;
308impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateGlossaryTermResponseDeserializer {
309 fn deserialize_nonstreaming_with_config(
310 &self,
311 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
312 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
313 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
314 let (success, status) = (response.status().is_success(), response.status().as_u16());
315 #[allow(unused_variables)]
320 let body = response.body().bytes().expect("body loaded");
321 let headers = response.headers();
322 #[allow(unused_mut)]
323 let mut force_error = false;
324 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
325 if !success && status != 200 || force_error {
326 let protocol = _cfg
327 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
328 .expect("a SharedClientProtocol is required");
329 #[allow(unused_mut)]
330 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
331 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
332 })?;
333 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
334 let generic = generic_builder.build();
335 let error_code = match generic.code() {
336 ::std::option::Option::Some(code) => code,
337 ::std::option::Option::None => {
338 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
339 ::aws_smithy_runtime_api::box_error::BoxError::from(
340 crate::operation::update_glossary_term::UpdateGlossaryTermError::unhandled(generic),
341 ),
342 ))
343 }
344 };
345 let _error_message = generic.message().map(|msg| msg.to_owned());
346 let err = match error_code {
347 "AccessDeniedException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::AccessDeniedException({
348 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
349 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
350 e,
351 ))
352 })?;
353 let mut tmp = <crate::types::error::builders::AccessDeniedExceptionBuilder>::default();
354 tmp.deserialize_members(&mut *deser).map_err(|e| {
355 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
356 e,
357 ))
358 })?;
359 if tmp.message.is_none() {
360 tmp.message = _error_message;
361 }
362 let tmp = tmp.meta(generic);
363 tmp.build()
364 }),
365 "AlreadyExistsException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::AlreadyExistsException({
366 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
367 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
368 e,
369 ))
370 })?;
371 let mut tmp = <crate::types::error::builders::AlreadyExistsExceptionBuilder>::default();
372 tmp.deserialize_members(&mut *deser).map_err(|e| {
373 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
374 e,
375 ))
376 })?;
377 if tmp.message.is_none() {
378 tmp.message = _error_message;
379 }
380 let tmp = tmp.meta(generic);
381 tmp.build()
382 }),
383 "ConcurrentModificationException" => {
384 crate::operation::update_glossary_term::UpdateGlossaryTermError::ConcurrentModificationException({
385 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
386 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
387 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
388 )
389 })?;
390 let mut tmp = <crate::types::error::builders::ConcurrentModificationExceptionBuilder>::default();
391 tmp.deserialize_members(&mut *deser).map_err(|e| {
392 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
393 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
394 )
395 })?;
396 if tmp.message.is_none() {
397 tmp.message = _error_message;
398 }
399 let tmp = tmp.meta(generic);
400 tmp.build()
401 })
402 }
403 "EntityNotFoundException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::EntityNotFoundException({
404 let mut deser = protocol.deserialize_error_response(response, _cfg).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 let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
410 tmp.deserialize_members(&mut *deser).map_err(|e| {
411 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
412 e,
413 ))
414 })?;
415 if tmp.message.is_none() {
416 tmp.message = _error_message;
417 }
418 let tmp = tmp.meta(generic);
419 tmp.build()
420 }),
421 "InternalServiceException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::InternalServiceException({
422 let mut deser = protocol.deserialize_error_response(response, _cfg).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 let mut tmp = <crate::types::error::builders::InternalServiceExceptionBuilder>::default();
428 tmp.deserialize_members(&mut *deser).map_err(|e| {
429 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
430 e,
431 ))
432 })?;
433 if tmp.message.is_none() {
434 tmp.message = _error_message;
435 }
436 let tmp = tmp.meta(generic);
437 tmp.build()
438 }),
439 "InvalidInputException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::InvalidInputException({
440 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
441 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
442 e,
443 ))
444 })?;
445 let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
446 tmp.deserialize_members(&mut *deser).map_err(|e| {
447 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
448 e,
449 ))
450 })?;
451 if tmp.message.is_none() {
452 tmp.message = _error_message;
453 }
454 let tmp = tmp.meta(generic);
455 tmp.build()
456 }),
457 "ThrottlingException" => crate::operation::update_glossary_term::UpdateGlossaryTermError::ThrottlingException({
458 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
459 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
460 e,
461 ))
462 })?;
463 let mut tmp = <crate::types::error::builders::ThrottlingExceptionBuilder>::default();
464 tmp.deserialize_members(&mut *deser).map_err(|e| {
465 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
466 e,
467 ))
468 })?;
469 if tmp.message.is_none() {
470 tmp.message = _error_message;
471 }
472 let tmp = tmp.meta(generic);
473 tmp.build()
474 }),
475 _ => {
476 match protocol
484 .deserialize_error_response(response, _cfg)
485 .ok()
486 .and_then(|mut deser| {
487 ::aws_smithy_schema::registry::reify_error(
488 crate::operation::update_glossary_term::error_registry::REGISTRY
489 .or(&crate::error_type_registry::REGISTRY),
490 error_code,
491 &mut *deser,
492 )
493 }) {
494 ::std::option::Option::Some(source) => <crate::operation::update_glossary_term::UpdateGlossaryTermError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
495 ::std::option::Option::None => crate::operation::update_glossary_term::UpdateGlossaryTermError::generic(generic),
496 }
497 }
498 };
499 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
500 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
501 ))
502 } else {
503 let protocol = _cfg
504 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
505 .expect("a SharedClientProtocol is required");
506 let mut deser = protocol
507 .deserialize_response(response, UpdateGlossaryTerm::OUTPUT_SCHEMA, _cfg)
508 .map_err(|e| {
509 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
510 })?;
511 let _response_headers = headers;
515 #[allow(unused_mut)]
519 let mut output = <crate::operation::update_glossary_term::builders::UpdateGlossaryTermOutputBuilder>::default();
520 output.deserialize_members(&mut *deser).map_err(|e| {
521 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
522 })?;
523 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
524 let output = output.build();
525 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
526 }
527 }
528}
529#[derive(Debug)]
530struct UpdateGlossaryTermRequestSerializer;
531impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateGlossaryTermRequestSerializer {
532 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
533 fn serialize_input(
534 &self,
535 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
536 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
537 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
538 let input = input
539 .downcast::<crate::operation::update_glossary_term::UpdateGlossaryTermInput>()
540 .expect("correct type");
541 let _required_check = input
542 .identifier
543 .as_ref()
544 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("identifier", "cannot be empty or unset"))?;
545 if _required_check.is_empty() {
546 return ::std::result::Result::Err(
547 ::aws_smithy_types::error::operation::BuildError::missing_field("identifier", "cannot be empty or unset").into(),
548 );
549 }
550 let protocol = _cfg
551 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
552 .expect("a SharedClientProtocol is required");
553 let mut request = protocol
554 .serialize_request(&input, UpdateGlossaryTerm::INPUT_SCHEMA, "/", _cfg)
555 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
556
557 return ::std::result::Result::Ok(request);
558 }
559}
560#[derive(Debug)]
561struct UpdateGlossaryTermEndpointParamsInterceptor;
562
563#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
564impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateGlossaryTermEndpointParamsInterceptor {
565 fn name(&self) -> &'static str {
566 "UpdateGlossaryTermEndpointParamsInterceptor"
567 }
568
569 fn read_before_execution(
570 &self,
571 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
572 '_,
573 ::aws_smithy_runtime_api::client::interceptors::context::Input,
574 ::aws_smithy_runtime_api::client::interceptors::context::Output,
575 ::aws_smithy_runtime_api::client::interceptors::context::Error,
576 >,
577 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
578 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
579 let _input = context
580 .input()
581 .downcast_ref::<UpdateGlossaryTermInput>()
582 .ok_or("failed to downcast to UpdateGlossaryTermInput")?;
583
584 let params = crate::config::endpoint::Params::builder()
585 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
586 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
587 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
588 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
589 .build()
590 .map_err(|err| {
591 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
592 })?;
593 cfg.interceptor_state()
594 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
595 ::std::result::Result::Ok(())
596 }
597}
598
599#[non_exhaustive]
604#[derive(::std::fmt::Debug)]
605pub enum UpdateGlossaryTermError {
606 AccessDeniedException(crate::types::error::AccessDeniedException),
608 AlreadyExistsException(crate::types::error::AlreadyExistsException),
610 ConcurrentModificationException(crate::types::error::ConcurrentModificationException),
612 EntityNotFoundException(crate::types::error::EntityNotFoundException),
614 InternalServiceException(crate::types::error::InternalServiceException),
616 InvalidInputException(crate::types::error::InvalidInputException),
618 ThrottlingException(crate::types::error::ThrottlingException),
620 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
622 variable wildcard pattern and check `.code()`:
623 \
624 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
625 \
626 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateGlossaryTermError) for what information is available for the error.")]
627 Unhandled(crate::error::sealed_unhandled::Unhandled),
628}
629impl UpdateGlossaryTermError {
630 pub fn unhandled(
632 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
633 ) -> Self {
634 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
635 source: err.into(),
636 meta: ::std::default::Default::default(),
637 })
638 }
639
640 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
642 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
643 source: err.clone().into(),
644 meta: err,
645 })
646 }
647 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
652 match self {
653 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
654 Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
655 Self::ConcurrentModificationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
656 Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
657 Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
658 Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
659 Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
660 Self::Unhandled(e) => &e.meta,
661 }
662 }
663 pub fn is_access_denied_exception(&self) -> bool {
665 matches!(self, Self::AccessDeniedException(_))
666 }
667 pub fn is_already_exists_exception(&self) -> bool {
669 matches!(self, Self::AlreadyExistsException(_))
670 }
671 pub fn is_concurrent_modification_exception(&self) -> bool {
673 matches!(self, Self::ConcurrentModificationException(_))
674 }
675 pub fn is_entity_not_found_exception(&self) -> bool {
677 matches!(self, Self::EntityNotFoundException(_))
678 }
679 pub fn is_internal_service_exception(&self) -> bool {
681 matches!(self, Self::InternalServiceException(_))
682 }
683 pub fn is_invalid_input_exception(&self) -> bool {
685 matches!(self, Self::InvalidInputException(_))
686 }
687 pub fn is_throttling_exception(&self) -> bool {
689 matches!(self, Self::ThrottlingException(_))
690 }
691}
692impl ::std::error::Error for UpdateGlossaryTermError {
693 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
694 match self {
695 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
696 Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
697 Self::ConcurrentModificationException(_inner) => ::std::option::Option::Some(_inner),
698 Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
699 Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
700 Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
701 Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
702 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
703 }
704 }
705}
706impl ::std::fmt::Display for UpdateGlossaryTermError {
707 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
708 match self {
709 Self::AccessDeniedException(_inner) => _inner.fmt(f),
710 Self::AlreadyExistsException(_inner) => _inner.fmt(f),
711 Self::ConcurrentModificationException(_inner) => _inner.fmt(f),
712 Self::EntityNotFoundException(_inner) => _inner.fmt(f),
713 Self::InternalServiceException(_inner) => _inner.fmt(f),
714 Self::InvalidInputException(_inner) => _inner.fmt(f),
715 Self::ThrottlingException(_inner) => _inner.fmt(f),
716 Self::Unhandled(_inner) => {
717 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
718 write!(f, "unhandled error ({code})")
719 } else {
720 f.write_str("unhandled error")
721 }
722 }
723 }
724 }
725}
726impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateGlossaryTermError {
727 fn code(&self) -> ::std::option::Option<&str> {
728 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
729 }
730 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
731 ::std::option::Option::None
732 }
733}
734impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateGlossaryTermError {
735 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
736 match self {
737 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
738 Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
739 Self::ConcurrentModificationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
740 Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
741 Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
742 Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
743 Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
744 Self::Unhandled(_inner) => &_inner.meta,
745 }
746 }
747}
748impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateGlossaryTermError {
749 fn create_unhandled_error(
750 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
751 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
752 ) -> Self {
753 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
754 source,
755 meta: meta.unwrap_or_default(),
756 })
757 }
758}
759impl ::aws_types::request_id::RequestId for crate::operation::update_glossary_term::UpdateGlossaryTermError {
760 fn request_id(&self) -> Option<&str> {
761 self.meta().request_id()
762 }
763}
764
765pub use crate::operation::update_glossary_term::_update_glossary_term_input::UpdateGlossaryTermInput;
766
767pub use crate::operation::update_glossary_term::_update_glossary_term_output::UpdateGlossaryTermOutput;
768
769mod _update_glossary_term_input;
770
771mod _update_glossary_term_output;
772
773pub mod builders;