Skip to main content

aws_sdk_workspaces/operation/
register_workspace_directory.rs

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