1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartWorkspacesPool;
6impl StartWorkspacesPool {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::start_workspaces_pool::StartWorkspacesPoolInput::SCHEMA;
13 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 .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}
92pub(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 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 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 #[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 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 let _response_headers = headers;
495 #[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(
527 &input,
528 StartWorkspacesPool::INPUT_SCHEMA,
529 "/service/WorkspacesService/operation/StartWorkspacesPool",
530 _cfg,
531 )
532 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
533
534 return ::std::result::Result::Ok(request);
535 }
536}
537#[derive(Debug)]
538struct StartWorkspacesPoolEndpointParamsInterceptor;
539
540#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
541impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartWorkspacesPoolEndpointParamsInterceptor {
542 fn name(&self) -> &'static str {
543 "StartWorkspacesPoolEndpointParamsInterceptor"
544 }
545
546 fn read_before_execution(
547 &self,
548 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
549 '_,
550 ::aws_smithy_runtime_api::client::interceptors::context::Input,
551 ::aws_smithy_runtime_api::client::interceptors::context::Output,
552 ::aws_smithy_runtime_api::client::interceptors::context::Error,
553 >,
554 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
555 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
556 let _input = context
557 .input()
558 .downcast_ref::<StartWorkspacesPoolInput>()
559 .ok_or("failed to downcast to StartWorkspacesPoolInput")?;
560
561 let params = crate::config::endpoint::Params::builder()
562 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
563 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
564 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
565 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
566 .build()
567 .map_err(|err| {
568 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
569 })?;
570 cfg.interceptor_state()
571 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
572 ::std::result::Result::Ok(())
573 }
574}
575
576#[non_exhaustive]
581#[derive(::std::fmt::Debug)]
582pub enum StartWorkspacesPoolError {
583 AccessDeniedException(crate::types::error::AccessDeniedException),
585 InvalidParameterValuesException(crate::types::error::InvalidParameterValuesException),
587 InvalidResourceStateException(crate::types::error::InvalidResourceStateException),
589 OperationInProgressException(crate::types::error::OperationInProgressException),
591 OperationNotSupportedException(crate::types::error::OperationNotSupportedException),
593 ResourceLimitExceededException(crate::types::error::ResourceLimitExceededException),
595 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
597 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
599 variable wildcard pattern and check `.code()`:
600 \
601 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
602 \
603 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartWorkspacesPoolError) for what information is available for the error.")]
604 Unhandled(crate::error::sealed_unhandled::Unhandled),
605}
606impl StartWorkspacesPoolError {
607 pub fn unhandled(
609 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
610 ) -> Self {
611 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
612 source: err.into(),
613 meta: ::std::default::Default::default(),
614 })
615 }
616
617 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
619 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
620 source: err.clone().into(),
621 meta: err,
622 })
623 }
624 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
629 match self {
630 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
631 Self::InvalidParameterValuesException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
632 Self::InvalidResourceStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
633 Self::OperationInProgressException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
634 Self::OperationNotSupportedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
635 Self::ResourceLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
636 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
637 Self::Unhandled(e) => &e.meta,
638 }
639 }
640 pub fn is_access_denied_exception(&self) -> bool {
642 matches!(self, Self::AccessDeniedException(_))
643 }
644 pub fn is_invalid_parameter_values_exception(&self) -> bool {
646 matches!(self, Self::InvalidParameterValuesException(_))
647 }
648 pub fn is_invalid_resource_state_exception(&self) -> bool {
650 matches!(self, Self::InvalidResourceStateException(_))
651 }
652 pub fn is_operation_in_progress_exception(&self) -> bool {
654 matches!(self, Self::OperationInProgressException(_))
655 }
656 pub fn is_operation_not_supported_exception(&self) -> bool {
658 matches!(self, Self::OperationNotSupportedException(_))
659 }
660 pub fn is_resource_limit_exceeded_exception(&self) -> bool {
662 matches!(self, Self::ResourceLimitExceededException(_))
663 }
664 pub fn is_resource_not_found_exception(&self) -> bool {
666 matches!(self, Self::ResourceNotFoundException(_))
667 }
668}
669impl ::std::error::Error for StartWorkspacesPoolError {
670 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
671 match self {
672 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
673 Self::InvalidParameterValuesException(_inner) => ::std::option::Option::Some(_inner),
674 Self::InvalidResourceStateException(_inner) => ::std::option::Option::Some(_inner),
675 Self::OperationInProgressException(_inner) => ::std::option::Option::Some(_inner),
676 Self::OperationNotSupportedException(_inner) => ::std::option::Option::Some(_inner),
677 Self::ResourceLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
678 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
679 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
680 }
681 }
682}
683impl ::std::fmt::Display for StartWorkspacesPoolError {
684 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
685 match self {
686 Self::AccessDeniedException(_inner) => _inner.fmt(f),
687 Self::InvalidParameterValuesException(_inner) => _inner.fmt(f),
688 Self::InvalidResourceStateException(_inner) => _inner.fmt(f),
689 Self::OperationInProgressException(_inner) => _inner.fmt(f),
690 Self::OperationNotSupportedException(_inner) => _inner.fmt(f),
691 Self::ResourceLimitExceededException(_inner) => _inner.fmt(f),
692 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
693 Self::Unhandled(_inner) => {
694 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
695 write!(f, "unhandled error ({code})")
696 } else {
697 f.write_str("unhandled error")
698 }
699 }
700 }
701 }
702}
703impl ::aws_smithy_types::retry::ProvideErrorKind for StartWorkspacesPoolError {
704 fn code(&self) -> ::std::option::Option<&str> {
705 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
706 }
707 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
708 ::std::option::Option::None
709 }
710}
711impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartWorkspacesPoolError {
712 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
713 match self {
714 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
715 Self::InvalidParameterValuesException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
716 Self::InvalidResourceStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
717 Self::OperationInProgressException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
718 Self::OperationNotSupportedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
719 Self::ResourceLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
720 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
721 Self::Unhandled(_inner) => &_inner.meta,
722 }
723 }
724}
725impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartWorkspacesPoolError {
726 fn create_unhandled_error(
727 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
728 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
729 ) -> Self {
730 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
731 source,
732 meta: meta.unwrap_or_default(),
733 })
734 }
735}
736impl ::aws_types::request_id::RequestId for crate::operation::start_workspaces_pool::StartWorkspacesPoolError {
737 fn request_id(&self) -> Option<&str> {
738 self.meta().request_id()
739 }
740}
741
742pub use crate::operation::start_workspaces_pool::_start_workspaces_pool_input::StartWorkspacesPoolInput;
743
744pub use crate::operation::start_workspaces_pool::_start_workspaces_pool_output::StartWorkspacesPoolOutput;
745
746mod _start_workspaces_pool_input;
747
748mod _start_workspaces_pool_output;
749
750pub mod builders;