1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct RegisterWorkspaceDirectory;
6impl RegisterWorkspaceDirectory {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13 crate::operation::register_workspace_directory::RegisterWorkspaceDirectoryInput::SCHEMA;
14 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 .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}
99pub(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 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 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 #[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 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 let _response_headers = headers;
579 #[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(&input, RegisterWorkspaceDirectory::INPUT_SCHEMA, "/", _cfg)
611 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
612
613 return ::std::result::Result::Ok(request);
614 }
615}
616#[derive(Debug)]
617struct RegisterWorkspaceDirectoryEndpointParamsInterceptor;
618
619#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
620impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RegisterWorkspaceDirectoryEndpointParamsInterceptor {
621 fn name(&self) -> &'static str {
622 "RegisterWorkspaceDirectoryEndpointParamsInterceptor"
623 }
624
625 fn read_before_execution(
626 &self,
627 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
628 '_,
629 ::aws_smithy_runtime_api::client::interceptors::context::Input,
630 ::aws_smithy_runtime_api::client::interceptors::context::Output,
631 ::aws_smithy_runtime_api::client::interceptors::context::Error,
632 >,
633 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
634 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
635 let _input = context
636 .input()
637 .downcast_ref::<RegisterWorkspaceDirectoryInput>()
638 .ok_or("failed to downcast to RegisterWorkspaceDirectoryInput")?;
639
640 let params = crate::config::endpoint::Params::builder()
641 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
642 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
643 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
644 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
645 .build()
646 .map_err(|err| {
647 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
648 })?;
649 cfg.interceptor_state()
650 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
651 ::std::result::Result::Ok(())
652 }
653}
654
655#[non_exhaustive]
660#[derive(::std::fmt::Debug)]
661pub enum RegisterWorkspaceDirectoryError {
662 AccessDeniedException(crate::types::error::AccessDeniedException),
664 InvalidParameterValuesException(crate::types::error::InvalidParameterValuesException),
666 InvalidResourceStateException(crate::types::error::InvalidResourceStateException),
668 OperationNotSupportedException(crate::types::error::OperationNotSupportedException),
670 ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
672 ResourceLimitExceededException(crate::types::error::ResourceLimitExceededException),
674 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
676 UnsupportedNetworkConfigurationException(crate::types::error::UnsupportedNetworkConfigurationException),
678 WorkspacesDefaultRoleNotFoundException(crate::types::error::WorkspacesDefaultRoleNotFoundException),
680 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
682 variable wildcard pattern and check `.code()`:
683 \
684 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
685 \
686 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RegisterWorkspaceDirectoryError) for what information is available for the error.")]
687 Unhandled(crate::error::sealed_unhandled::Unhandled),
688}
689impl RegisterWorkspaceDirectoryError {
690 pub fn unhandled(
692 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
693 ) -> Self {
694 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
695 source: err.into(),
696 meta: ::std::default::Default::default(),
697 })
698 }
699
700 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
702 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
703 source: err.clone().into(),
704 meta: err,
705 })
706 }
707 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
712 match self {
713 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
714 Self::InvalidParameterValuesException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
715 Self::InvalidResourceStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
716 Self::OperationNotSupportedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
717 Self::ResourceAlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
718 Self::ResourceLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
719 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
720 Self::UnsupportedNetworkConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
721 Self::WorkspacesDefaultRoleNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
722 Self::Unhandled(e) => &e.meta,
723 }
724 }
725 pub fn is_access_denied_exception(&self) -> bool {
727 matches!(self, Self::AccessDeniedException(_))
728 }
729 pub fn is_invalid_parameter_values_exception(&self) -> bool {
731 matches!(self, Self::InvalidParameterValuesException(_))
732 }
733 pub fn is_invalid_resource_state_exception(&self) -> bool {
735 matches!(self, Self::InvalidResourceStateException(_))
736 }
737 pub fn is_operation_not_supported_exception(&self) -> bool {
739 matches!(self, Self::OperationNotSupportedException(_))
740 }
741 pub fn is_resource_already_exists_exception(&self) -> bool {
743 matches!(self, Self::ResourceAlreadyExistsException(_))
744 }
745 pub fn is_resource_limit_exceeded_exception(&self) -> bool {
747 matches!(self, Self::ResourceLimitExceededException(_))
748 }
749 pub fn is_resource_not_found_exception(&self) -> bool {
751 matches!(self, Self::ResourceNotFoundException(_))
752 }
753 pub fn is_unsupported_network_configuration_exception(&self) -> bool {
755 matches!(self, Self::UnsupportedNetworkConfigurationException(_))
756 }
757 pub fn is_workspaces_default_role_not_found_exception(&self) -> bool {
759 matches!(self, Self::WorkspacesDefaultRoleNotFoundException(_))
760 }
761}
762impl ::std::error::Error for RegisterWorkspaceDirectoryError {
763 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
764 match self {
765 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
766 Self::InvalidParameterValuesException(_inner) => ::std::option::Option::Some(_inner),
767 Self::InvalidResourceStateException(_inner) => ::std::option::Option::Some(_inner),
768 Self::OperationNotSupportedException(_inner) => ::std::option::Option::Some(_inner),
769 Self::ResourceAlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
770 Self::ResourceLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
771 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
772 Self::UnsupportedNetworkConfigurationException(_inner) => ::std::option::Option::Some(_inner),
773 Self::WorkspacesDefaultRoleNotFoundException(_inner) => ::std::option::Option::Some(_inner),
774 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
775 }
776 }
777}
778impl ::std::fmt::Display for RegisterWorkspaceDirectoryError {
779 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
780 match self {
781 Self::AccessDeniedException(_inner) => _inner.fmt(f),
782 Self::InvalidParameterValuesException(_inner) => _inner.fmt(f),
783 Self::InvalidResourceStateException(_inner) => _inner.fmt(f),
784 Self::OperationNotSupportedException(_inner) => _inner.fmt(f),
785 Self::ResourceAlreadyExistsException(_inner) => _inner.fmt(f),
786 Self::ResourceLimitExceededException(_inner) => _inner.fmt(f),
787 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
788 Self::UnsupportedNetworkConfigurationException(_inner) => _inner.fmt(f),
789 Self::WorkspacesDefaultRoleNotFoundException(_inner) => _inner.fmt(f),
790 Self::Unhandled(_inner) => {
791 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
792 write!(f, "unhandled error ({code})")
793 } else {
794 f.write_str("unhandled error")
795 }
796 }
797 }
798 }
799}
800impl ::aws_smithy_types::retry::ProvideErrorKind for RegisterWorkspaceDirectoryError {
801 fn code(&self) -> ::std::option::Option<&str> {
802 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
803 }
804 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
805 ::std::option::Option::None
806 }
807}
808impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RegisterWorkspaceDirectoryError {
809 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
810 match self {
811 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
812 Self::InvalidParameterValuesException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
813 Self::InvalidResourceStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
814 Self::OperationNotSupportedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
815 Self::ResourceAlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
816 Self::ResourceLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
817 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
818 Self::UnsupportedNetworkConfigurationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
819 Self::WorkspacesDefaultRoleNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
820 Self::Unhandled(_inner) => &_inner.meta,
821 }
822 }
823}
824impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RegisterWorkspaceDirectoryError {
825 fn create_unhandled_error(
826 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
827 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
828 ) -> Self {
829 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
830 source,
831 meta: meta.unwrap_or_default(),
832 })
833 }
834}
835impl ::aws_types::request_id::RequestId for crate::operation::register_workspace_directory::RegisterWorkspaceDirectoryError {
836 fn request_id(&self) -> Option<&str> {
837 self.meta().request_id()
838 }
839}
840
841pub use crate::operation::register_workspace_directory::_register_workspace_directory_input::RegisterWorkspaceDirectoryInput;
842
843pub use crate::operation::register_workspace_directory::_register_workspace_directory_output::RegisterWorkspaceDirectoryOutput;
844
845mod _register_workspace_directory_input;
846
847mod _register_workspace_directory_output;
848
849pub mod builders;