Skip to main content

aws_sdk_workspaces/operation/
describe_workspaces.rs

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