Skip to main content

aws_sdk_workspaces/operation/
start_workspaces_pool.rs

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