Skip to main content

aws_sdk_glue/operation/
delete_classifier.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `DeleteClassifier`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct DeleteClassifier;
6impl DeleteClassifier {
7    /// Creates a new `DeleteClassifier`
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::delete_classifier::DeleteClassifierInput::SCHEMA;
13    /// The schema for this operation's output shape.
14    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::delete_classifier::DeleteClassifierOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17        input: crate::operation::delete_classifier::DeleteClassifierInput,
18    ) -> ::std::result::Result<
19        crate::operation::delete_classifier::DeleteClassifierOutput,
20        ::aws_smithy_runtime_api::client::result::SdkError<
21            crate::operation::delete_classifier::DeleteClassifierError,
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::delete_classifier::DeleteClassifierError>()
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::delete_classifier::DeleteClassifierOutput>()
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::delete_classifier::DeleteClassifierInput,
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", "DeleteClassifier", 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.DeleteClassifier",
63                "rpc.service" = "Glue",
64                "rpc.method" = "DeleteClassifier",
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
78        if let ::std::option::Option::Some(config_override) = config_override {
79            for plugin in config_override.runtime_plugins.iter().cloned() {
80                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
81            }
82            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
83                config_override,
84                client_config.config.clone(),
85                &client_config.runtime_components,
86            ));
87        }
88        runtime_plugins
89    }
90}
91/// Per-operation error registry. Contains an entry for every modeled
92/// error this operation can throw.
93///
94/// Used by the schema-serde error path as the operation-scoped lookup
95/// for registry-backed error reification: an error code that does not
96/// match one of the operation's modeled errors directly is resolved
97/// against this registry first, then widened to the service-wide error
98/// registry.
99pub(crate) mod error_registry {
100    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
101        ::aws_smithy_schema::registry::TypeRegistry::builder()
102                            .insert_error_shape(
103                        crate::types::error::EntityNotFoundException::SCHEMA,
104                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
105                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
106                        },
107                        |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> {
108                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
109                        },
110                    )
111.insert_error_shape(
112                        crate::types::error::OperationTimeoutException::SCHEMA,
113                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
114                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
115                        },
116                        |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> {
117                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
118                        },
119                    )
120                            .build()
121    });
122}
123impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteClassifier {
124    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
125        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeleteClassifier");
126
127        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
128            DeleteClassifierRequestSerializer,
129        ));
130        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
131            DeleteClassifierResponseDeserializer,
132        ));
133
134        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
135            crate::config::auth::Params::builder()
136                .operation_name("DeleteClassifier")
137                .build()
138                .expect("required fields set"),
139        ));
140
141        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("DeleteClassifier", "Glue"));
142        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
143        signing_options.double_uri_encode = true;
144        signing_options.content_sha256_header = false;
145        signing_options.normalize_uri_path = true;
146        signing_options.payload_override = None;
147
148        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
149            signing_options,
150            ..::std::default::Default::default()
151        });
152
153        ::std::option::Option::Some(cfg.freeze())
154    }
155
156    fn runtime_components(
157        &self,
158        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
159    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
160        #[allow(unused_mut)]
161        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteClassifier")
162            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
163                DeleteClassifierTelemetryInputCaptureInterceptor,
164            ))
165            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
166                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
167            ))
168            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
169                DeleteClassifierEndpointParamsInterceptor,
170            ))
171            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
172                crate::operation::delete_classifier::DeleteClassifierError,
173            >::new())
174            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
175                crate::operation::delete_classifier::DeleteClassifierError,
176            >::new())
177            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
178                crate::operation::delete_classifier::DeleteClassifierError,
179            >::new())
180            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
181                crate::operation::delete_classifier::DeleteClassifierError,
182            >::new());
183
184        ::std::borrow::Cow::Owned(rcb)
185    }
186}
187
188#[derive(Debug)]
189struct DeleteClassifierTelemetryInputCaptureInterceptor;
190
191#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
192impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteClassifierTelemetryInputCaptureInterceptor {
193    fn name(&self) -> &'static str {
194        "DeleteClassifierTelemetryInputCaptureInterceptor"
195    }
196
197    fn read_before_execution(
198        &self,
199        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
200            '_,
201            ::aws_smithy_runtime_api::client::interceptors::context::Input,
202            ::aws_smithy_runtime_api::client::interceptors::context::Output,
203            ::aws_smithy_runtime_api::client::interceptors::context::Error,
204        >,
205        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
206    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
207        // Nothing to do unless the customer opted in by naming members to record.
208        let ::std::option::Option::Some(requested) = cfg
209            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
210            .filter(|r| !r.is_empty())
211        else {
212            return ::std::result::Result::Ok(());
213        };
214
215        let ::std::option::Option::Some(input) = context.input().downcast_ref::<DeleteClassifierInput>() else {
216            // A mismatched input is not this interceptor's concern; skip quietly.
217            return ::std::result::Result::Ok(());
218        };
219
220        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
221        if requested.should_capture("Name") {
222            if let ::std::option::Option::Some(value) = input.name.as_deref() {
223                captured.insert("Name", value);
224            }
225        }
226
227        cfg.interceptor_state().store_put(captured);
228        ::std::result::Result::Ok(())
229    }
230}
231#[derive(Debug)]
232struct DeleteClassifierResponseDeserializer;
233impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteClassifierResponseDeserializer {
234    fn deserialize_nonstreaming_with_config(
235        &self,
236        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
237        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
238    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
239        let (success, status) = (response.status().is_success(), response.status().as_u16());
240        // Load body and headers BEFORE BeforeParseResponse so customizations
241        // (e.g., S3's `body_is_error` check that detects errors returned with
242        // HTTP 200) can inspect them. The legacy non-streaming path also
243        // loads `body` before firing this hook.
244        #[allow(unused_variables)]
245        let body = response.body().bytes().expect("body loaded");
246        let headers = response.headers();
247        #[allow(unused_mut)]
248        let mut force_error = false;
249        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
250        if !success && status != 200 || force_error {
251            let protocol = _cfg
252                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
253                .expect("a SharedClientProtocol is required");
254            #[allow(unused_mut)]
255            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
256                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
257            })?;
258            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
259            let generic = generic_builder.build();
260            let error_code = match generic.code() {
261                ::std::option::Option::Some(code) => code,
262                ::std::option::Option::None => {
263                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
264                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::delete_classifier::DeleteClassifierError::unhandled(
265                            generic,
266                        )),
267                    ))
268                }
269            };
270            let _error_message = generic.message().map(|msg| msg.to_owned());
271            let err = match error_code {
272                "EntityNotFoundException" => crate::operation::delete_classifier::DeleteClassifierError::EntityNotFoundException({
273                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
274                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
275                            e,
276                        ))
277                    })?;
278                    let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
279                    tmp.deserialize_members(&mut *deser).map_err(|e| {
280                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
281                            e,
282                        ))
283                    })?;
284                    if tmp.message.is_none() {
285                        tmp.message = _error_message;
286                    }
287                    let tmp = tmp.meta(generic);
288                    tmp.build()
289                }),
290                "OperationTimeoutException" => crate::operation::delete_classifier::DeleteClassifierError::OperationTimeoutException({
291                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
292                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
293                            e,
294                        ))
295                    })?;
296                    let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
297                    tmp.deserialize_members(&mut *deser).map_err(|e| {
298                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
299                            e,
300                        ))
301                    })?;
302                    if tmp.message.is_none() {
303                        tmp.message = _error_message;
304                    }
305                    let tmp = tmp.meta(generic);
306                    tmp.build()
307                }),
308                _ => {
309                    // Registry-backed, operation-scoped reification of an error whose
310                    // code this operation does not model directly: the operation's own
311                    // error registry is consulted first, then the lookup widens to the
312                    // service-wide error registry. On a hit, the reified error is attached
313                    // as the source of the returned unhandled error while its metadata
314                    // (code, message, request id) is preserved; on a miss the generic
315                    // error is returned unchanged.
316                    match protocol
317                        .deserialize_error_response(response, _cfg)
318                        .ok()
319                        .and_then(|mut deser| {
320                            ::aws_smithy_schema::registry::reify_error(
321                                crate::operation::delete_classifier::error_registry::REGISTRY
322                                    .or(&crate::error_type_registry::REGISTRY),
323                                error_code,
324                                &mut *deser,
325                            )
326                        }) {
327                        ::std::option::Option::Some(source) => <crate::operation::delete_classifier::DeleteClassifierError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
328                        ::std::option::Option::None => crate::operation::delete_classifier::DeleteClassifierError::generic(generic),
329                    }
330                }
331            };
332            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
333                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
334            ))
335        } else {
336            let protocol = _cfg
337                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
338                .expect("a SharedClientProtocol is required");
339            let mut deser = protocol
340                .deserialize_response(response, DeleteClassifier::OUTPUT_SCHEMA, _cfg)
341                .map_err(|e| {
342                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
343                })?;
344            // `headers` is already in scope from the top of the function; alias it as
345            // `_response_headers` so MutateOutput customizations have a stable name to
346            // read from.
347            let _response_headers = headers;
348            // `mut` is required because `deserialize_members` and the `MutateOutput`
349            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
350            // empty output has no members and no customizations to run.
351            #[allow(unused_mut)]
352            let mut output = <crate::operation::delete_classifier::builders::DeleteClassifierOutputBuilder>::default();
353            output.deserialize_members(&mut *deser).map_err(|e| {
354                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
355            })?;
356            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
357            let output = output.build();
358            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
359        }
360    }
361}
362#[derive(Debug)]
363struct DeleteClassifierRequestSerializer;
364impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteClassifierRequestSerializer {
365    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
366    fn serialize_input(
367        &self,
368        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
369        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
370    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
371        let input = input
372            .downcast::<crate::operation::delete_classifier::DeleteClassifierInput>()
373            .expect("correct type");
374
375        let protocol = _cfg
376            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
377            .expect("a SharedClientProtocol is required");
378        let mut request = protocol
379            .serialize_request(&input, DeleteClassifier::INPUT_SCHEMA, "/", _cfg)
380            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
381
382        return ::std::result::Result::Ok(request);
383    }
384}
385#[derive(Debug)]
386struct DeleteClassifierEndpointParamsInterceptor;
387
388#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
389impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteClassifierEndpointParamsInterceptor {
390    fn name(&self) -> &'static str {
391        "DeleteClassifierEndpointParamsInterceptor"
392    }
393
394    fn read_before_execution(
395        &self,
396        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
397            '_,
398            ::aws_smithy_runtime_api::client::interceptors::context::Input,
399            ::aws_smithy_runtime_api::client::interceptors::context::Output,
400            ::aws_smithy_runtime_api::client::interceptors::context::Error,
401        >,
402        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
403    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
404        let _input = context
405            .input()
406            .downcast_ref::<DeleteClassifierInput>()
407            .ok_or("failed to downcast to DeleteClassifierInput")?;
408
409        let params = crate::config::endpoint::Params::builder()
410            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
411            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
412            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
413            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
414            .build()
415            .map_err(|err| {
416                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
417            })?;
418        cfg.interceptor_state()
419            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
420        ::std::result::Result::Ok(())
421    }
422}
423
424// The get_* functions below are generated from JMESPath expressions in the
425// operationContextParams trait. They target the operation's input shape.
426
427/// Error type for the `DeleteClassifierError` operation.
428#[non_exhaustive]
429#[derive(::std::fmt::Debug)]
430pub enum DeleteClassifierError {
431    /// <p>A specified entity does not exist</p>
432    EntityNotFoundException(crate::types::error::EntityNotFoundException),
433    /// <p>The operation timed out.</p>
434    OperationTimeoutException(crate::types::error::OperationTimeoutException),
435    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
436    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
437    variable wildcard pattern and check `.code()`:
438     \
439    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
440     \
441    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeleteClassifierError) for what information is available for the error.")]
442    Unhandled(crate::error::sealed_unhandled::Unhandled),
443}
444impl DeleteClassifierError {
445    /// Creates the `DeleteClassifierError::Unhandled` variant from any error type.
446    pub fn unhandled(
447        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
448    ) -> Self {
449        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
450            source: err.into(),
451            meta: ::std::default::Default::default(),
452        })
453    }
454
455    /// Creates the `DeleteClassifierError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
456    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
457        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
458            source: err.clone().into(),
459            meta: err,
460        })
461    }
462    ///
463    /// Returns error metadata, which includes the error code, message,
464    /// request ID, and potentially additional information.
465    ///
466    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
467        match self {
468            Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
469            Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
470            Self::Unhandled(e) => &e.meta,
471        }
472    }
473    /// Returns `true` if the error kind is `DeleteClassifierError::EntityNotFoundException`.
474    pub fn is_entity_not_found_exception(&self) -> bool {
475        matches!(self, Self::EntityNotFoundException(_))
476    }
477    /// Returns `true` if the error kind is `DeleteClassifierError::OperationTimeoutException`.
478    pub fn is_operation_timeout_exception(&self) -> bool {
479        matches!(self, Self::OperationTimeoutException(_))
480    }
481}
482impl ::std::error::Error for DeleteClassifierError {
483    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
484        match self {
485            Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
486            Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
487            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
488        }
489    }
490}
491impl ::std::fmt::Display for DeleteClassifierError {
492    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
493        match self {
494            Self::EntityNotFoundException(_inner) => _inner.fmt(f),
495            Self::OperationTimeoutException(_inner) => _inner.fmt(f),
496            Self::Unhandled(_inner) => {
497                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
498                    write!(f, "unhandled error ({code})")
499                } else {
500                    f.write_str("unhandled error")
501                }
502            }
503        }
504    }
505}
506impl ::aws_smithy_types::retry::ProvideErrorKind for DeleteClassifierError {
507    fn code(&self) -> ::std::option::Option<&str> {
508        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
509    }
510    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
511        ::std::option::Option::None
512    }
513}
514impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeleteClassifierError {
515    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
516        match self {
517            Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
518            Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
519            Self::Unhandled(_inner) => &_inner.meta,
520        }
521    }
522}
523impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteClassifierError {
524    fn create_unhandled_error(
525        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
526        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
527    ) -> Self {
528        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
529            source,
530            meta: meta.unwrap_or_default(),
531        })
532    }
533}
534impl ::aws_types::request_id::RequestId for crate::operation::delete_classifier::DeleteClassifierError {
535    fn request_id(&self) -> Option<&str> {
536        self.meta().request_id()
537    }
538}
539
540pub use crate::operation::delete_classifier::_delete_classifier_input::DeleteClassifierInput;
541
542pub use crate::operation::delete_classifier::_delete_classifier_output::DeleteClassifierOutput;
543
544mod _delete_classifier_input;
545
546mod _delete_classifier_output;
547
548/// Builders
549pub mod builders;