1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartSnapshot;
6impl StartSnapshot {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::start_snapshot::StartSnapshotInput,
14 ) -> ::std::result::Result<
15 crate::operation::start_snapshot::StartSnapshotOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::start_snapshot::StartSnapshotError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22 ::aws_smithy_runtime_api::client::interceptors::context::Error,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >| {
25 err.map_service_error(|err| {
26 err.downcast::<crate::operation::start_snapshot::StartSnapshotError>()
27 .expect("correct error type")
28 })
29 };
30 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31 .await
32 .map_err(map_err)?;
33 let output = context.finalize().map_err(map_err)?;
34 ::std::result::Result::Ok(
35 output
36 .downcast::<crate::operation::start_snapshot::StartSnapshotOutput>()
37 .expect("correct output type"),
38 )
39 }
40
41 pub(crate) async fn orchestrate_with_stop_point(
42 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43 input: crate::operation::start_snapshot::StartSnapshotInput,
44 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45 ) -> ::std::result::Result<
46 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47 ::aws_smithy_runtime_api::client::result::SdkError<
48 ::aws_smithy_runtime_api::client::interceptors::context::Error,
49 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50 >,
51 > {
52 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53 use ::tracing::Instrument;
54 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("EBS", "StartSnapshot", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "EBS.StartSnapshot",
59 "rpc.service" = "EBS",
60 "rpc.method" = "StartSnapshot",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73 runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
74 |token_provider, input| {
75 let input: &mut crate::operation::start_snapshot::StartSnapshotInput = input.downcast_mut().expect("correct type");
76 if input.client_token.is_none() {
77 input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
78 }
79 },
80 ));
81 if let ::std::option::Option::Some(config_override) = config_override {
82 for plugin in config_override.runtime_plugins.iter().cloned() {
83 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
84 }
85 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
86 config_override,
87 client_config.config.clone(),
88 &client_config.runtime_components,
89 ));
90 }
91 runtime_plugins
92 }
93}
94impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartSnapshot {
95 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
96 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartSnapshot");
97
98 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
99 StartSnapshotRequestSerializer,
100 ));
101 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
102 StartSnapshotResponseDeserializer,
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
106 crate::config::auth::Params::builder()
107 .operation_name("StartSnapshot")
108 .build()
109 .expect("required fields set"),
110 ));
111
112 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
113 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("StartSnapshot", "EBS"));
114 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
115 signing_options.double_uri_encode = true;
116 signing_options.content_sha256_header = false;
117 signing_options.normalize_uri_path = true;
118 signing_options.payload_override = None;
119
120 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
121 signing_options,
122 ..::std::default::Default::default()
123 });
124
125 ::std::option::Option::Some(cfg.freeze())
126 }
127
128 fn runtime_components(
129 &self,
130 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
131 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
132 #[allow(unused_mut)]
133 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartSnapshot")
134 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
135 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
136 ))
137 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
138 StartSnapshotEndpointParamsInterceptor,
139 ))
140 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
141 crate::operation::start_snapshot::StartSnapshotError,
142 >::new())
143 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
144 crate::operation::start_snapshot::StartSnapshotError,
145 >::new())
146 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
147 crate::operation::start_snapshot::StartSnapshotError,
148 >::new());
149
150 ::std::borrow::Cow::Owned(rcb)
151 }
152}
153
154#[derive(Debug)]
155struct StartSnapshotResponseDeserializer;
156impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartSnapshotResponseDeserializer {
157 fn deserialize_nonstreaming_with_config(
158 &self,
159 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
160 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
161 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
162 let (success, status) = (response.status().is_success(), response.status().as_u16());
163 let headers = response.headers();
164 let body = response.body().bytes().expect("body loaded");
165 #[allow(unused_mut)]
166 let mut force_error = false;
167 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
168 let parse_result = if !success && status != 201 || force_error {
169 crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_error(status, headers, body)
170 } else {
171 crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_response(status, headers, body)
172 };
173 crate::protocol_serde::type_erase_result(parse_result)
174 }
175}
176#[derive(Debug)]
177struct StartSnapshotRequestSerializer;
178impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartSnapshotRequestSerializer {
179 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
180 fn serialize_input(
181 &self,
182 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
183 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
184 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
185 let input = input
186 .downcast::<crate::operation::start_snapshot::StartSnapshotInput>()
187 .expect("correct type");
188 let _header_serialization_settings = _cfg
189 .load::<crate::serialization_settings::HeaderSerializationSettings>()
190 .cloned()
191 .unwrap_or_default();
192 let mut request_builder = {
193 #[allow(clippy::uninlined_format_args)]
194 fn uri_base(
195 _input: &crate::operation::start_snapshot::StartSnapshotInput,
196 output: &mut ::std::string::String,
197 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
198 use ::std::fmt::Write as _;
199 ::std::write!(output, "/snapshots").expect("formatting should succeed");
200 ::std::result::Result::Ok(())
201 }
202 #[allow(clippy::unnecessary_wraps)]
203 fn update_http_builder(
204 input: &crate::operation::start_snapshot::StartSnapshotInput,
205 builder: ::http_1x::request::Builder,
206 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
207 let mut uri = ::std::string::String::new();
208 uri_base(input, &mut uri)?;
209 ::std::result::Result::Ok(builder.method("POST").uri(uri))
210 }
211 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
212 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
213 builder
214 };
215 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_start_snapshot::ser_start_snapshot_input(&input)?);
216 if let Some(content_length) = body.content_length() {
217 let content_length = content_length.to_string();
218 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
219 }
220 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
221 }
222}
223#[derive(Debug)]
224struct StartSnapshotEndpointParamsInterceptor;
225
226#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
227impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSnapshotEndpointParamsInterceptor {
228 fn name(&self) -> &'static str {
229 "StartSnapshotEndpointParamsInterceptor"
230 }
231
232 fn read_before_execution(
233 &self,
234 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
235 '_,
236 ::aws_smithy_runtime_api::client::interceptors::context::Input,
237 ::aws_smithy_runtime_api::client::interceptors::context::Output,
238 ::aws_smithy_runtime_api::client::interceptors::context::Error,
239 >,
240 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
241 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
242 let _input = context
243 .input()
244 .downcast_ref::<StartSnapshotInput>()
245 .ok_or("failed to downcast to StartSnapshotInput")?;
246
247 let params = crate::config::endpoint::Params::builder()
248 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
249 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
250 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
251 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
252 .build()
253 .map_err(|err| {
254 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
255 })?;
256 cfg.interceptor_state()
257 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
258 ::std::result::Result::Ok(())
259 }
260}
261
262#[allow(unreachable_code, unused_variables)]
266#[cfg(test)]
267mod start_snapshot_test {
268
269 #[::tokio::test]
272 #[::tracing_test::traced_test]
273 async fn lowercase_message_response() {
274 let expected_output = crate::types::error::ValidationException::builder()
275 .set_message(::std::option::Option::Some("1 validation error detected".to_owned()))
276 .build();
277 let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
278 ::http_1x::response::Builder::new()
279 .header("content-length", "77")
280 .header("content-type", "application/json")
281 .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
282 .header(
283 "x-amzn-errortype",
284 "ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/",
285 )
286 .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
287 .status(400)
288 .body(::aws_smithy_types::body::SdkBody::from(
289 "{\n \"message\": \"1 validation error detected\"\n}\n",
290 ))
291 .unwrap(),
292 )
293 .unwrap();
294 use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
295 use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
296
297 let op = crate::operation::start_snapshot::StartSnapshot::new();
298 let config = op.config().expect("the operation has config");
299 let de = config
300 .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
301 .expect("the config must have a deserializer");
302
303 #[allow(unused_mut)]
305 let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
306
307 let parsed = de.deserialize_streaming(&mut http_response);
308 let parsed = parsed.unwrap_or_else(|| {
309 let http_response = http_response.map(|body| {
310 ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
311 body.bytes().unwrap(),
312 ::aws_smithy_protocol_test::MediaType::from("application/json"),
313 )))
314 });
315 de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
316 });
317 let parsed = parsed.expect_err("should be error response");
318 let parsed: &crate::operation::start_snapshot::StartSnapshotError =
319 parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
320 if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
321 ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
322 ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
323 } else {
324 panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
325 }
326 }
327
328 #[::tokio::test]
331 #[::tracing_test::traced_test]
332 async fn uppercase_message_response() {
333 let expected_output = crate::types::error::ValidationException::builder()
334 .set_message(::std::option::Option::Some("Invalid volume size: 99999999999".to_owned()))
335 .set_reason(::std::option::Option::Some(
336 "INVALID_VOLUME_SIZE"
337 .parse::<crate::types::ValidationExceptionReason>()
338 .expect("static value validated to member"),
339 ))
340 .build();
341 let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
342 ::http_1x::response::Builder::new()
343 .header("content-length", "77")
344 .header("content-type", "application/json")
345 .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
346 .header(
347 "x-amzn-errortype",
348 "ValidationException:http://internal.amazon.com/coral/com.amazon.zeppelindataservice/",
349 )
350 .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
351 .status(400)
352 .body(::aws_smithy_types::body::SdkBody::from(
353 "{\"Message\":\"Invalid volume size: 99999999999\",\"Reason\":\"INVALID_VOLUME_SIZE\"}\n",
354 ))
355 .unwrap(),
356 )
357 .unwrap();
358 use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
359 use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
360
361 let op = crate::operation::start_snapshot::StartSnapshot::new();
362 let config = op.config().expect("the operation has config");
363 let de = config
364 .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
365 .expect("the config must have a deserializer");
366
367 #[allow(unused_mut)]
369 let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
370
371 let parsed = de.deserialize_streaming(&mut http_response);
372 let parsed = parsed.unwrap_or_else(|| {
373 let http_response = http_response.map(|body| {
374 ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
375 body.bytes().unwrap(),
376 ::aws_smithy_protocol_test::MediaType::from("application/json"),
377 )))
378 });
379 de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
380 });
381 let parsed = parsed.expect_err("should be error response");
382 let parsed: &crate::operation::start_snapshot::StartSnapshotError =
383 parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
384 if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
385 ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
386 ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
387 } else {
388 panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
389 }
390 }
391}
392
393#[non_exhaustive]
395#[derive(::std::fmt::Debug)]
396pub enum StartSnapshotError {
397 AccessDeniedException(crate::types::error::AccessDeniedException),
399 ConcurrentLimitExceededException(crate::types::error::ConcurrentLimitExceededException),
401 ConflictException(crate::types::error::ConflictException),
403 InternalServerException(crate::types::error::InternalServerException),
405 RequestThrottledException(crate::types::error::RequestThrottledException),
407 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
409 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
411 ValidationException(crate::types::error::ValidationException),
413 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
415 variable wildcard pattern and check `.code()`:
416 \
417 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
418 \
419 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartSnapshotError) for what information is available for the error.")]
420 Unhandled(crate::error::sealed_unhandled::Unhandled),
421}
422impl StartSnapshotError {
423 pub fn unhandled(
425 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
426 ) -> Self {
427 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
428 source: err.into(),
429 meta: ::std::default::Default::default(),
430 })
431 }
432
433 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
435 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
436 source: err.clone().into(),
437 meta: err,
438 })
439 }
440 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
445 match self {
446 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447 Self::ConcurrentLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
448 Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
449 Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
450 Self::RequestThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
451 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
452 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
453 Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
454 Self::Unhandled(e) => &e.meta,
455 }
456 }
457 pub fn is_access_denied_exception(&self) -> bool {
459 matches!(self, Self::AccessDeniedException(_))
460 }
461 pub fn is_concurrent_limit_exceeded_exception(&self) -> bool {
463 matches!(self, Self::ConcurrentLimitExceededException(_))
464 }
465 pub fn is_conflict_exception(&self) -> bool {
467 matches!(self, Self::ConflictException(_))
468 }
469 pub fn is_internal_server_exception(&self) -> bool {
471 matches!(self, Self::InternalServerException(_))
472 }
473 pub fn is_request_throttled_exception(&self) -> bool {
475 matches!(self, Self::RequestThrottledException(_))
476 }
477 pub fn is_resource_not_found_exception(&self) -> bool {
479 matches!(self, Self::ResourceNotFoundException(_))
480 }
481 pub fn is_service_quota_exceeded_exception(&self) -> bool {
483 matches!(self, Self::ServiceQuotaExceededException(_))
484 }
485 pub fn is_validation_exception(&self) -> bool {
487 matches!(self, Self::ValidationException(_))
488 }
489}
490impl ::std::error::Error for StartSnapshotError {
491 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
492 match self {
493 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
494 Self::ConcurrentLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
495 Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
496 Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
497 Self::RequestThrottledException(_inner) => ::std::option::Option::Some(_inner),
498 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
499 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
500 Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
501 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
502 }
503 }
504}
505impl ::std::fmt::Display for StartSnapshotError {
506 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
507 match self {
508 Self::AccessDeniedException(_inner) => _inner.fmt(f),
509 Self::ConcurrentLimitExceededException(_inner) => _inner.fmt(f),
510 Self::ConflictException(_inner) => _inner.fmt(f),
511 Self::InternalServerException(_inner) => _inner.fmt(f),
512 Self::RequestThrottledException(_inner) => _inner.fmt(f),
513 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
514 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
515 Self::ValidationException(_inner) => _inner.fmt(f),
516 Self::Unhandled(_inner) => {
517 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
518 write!(f, "unhandled error ({code})")
519 } else {
520 f.write_str("unhandled error")
521 }
522 }
523 }
524 }
525}
526impl ::aws_smithy_types::retry::ProvideErrorKind for StartSnapshotError {
527 fn code(&self) -> ::std::option::Option<&str> {
528 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
529 }
530 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
531 ::std::option::Option::None
532 }
533}
534impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartSnapshotError {
535 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
536 match self {
537 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
538 Self::ConcurrentLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
539 Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
540 Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
541 Self::RequestThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
542 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
543 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
544 Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
545 Self::Unhandled(_inner) => &_inner.meta,
546 }
547 }
548}
549impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartSnapshotError {
550 fn create_unhandled_error(
551 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
552 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
553 ) -> Self {
554 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
555 source,
556 meta: meta.unwrap_or_default(),
557 })
558 }
559}
560impl ::aws_types::request_id::RequestId for crate::operation::start_snapshot::StartSnapshotError {
561 fn request_id(&self) -> Option<&str> {
562 self.meta().request_id()
563 }
564}
565
566pub use crate::operation::start_snapshot::_start_snapshot_input::StartSnapshotInput;
567
568pub use crate::operation::start_snapshot::_start_snapshot_output::StartSnapshotOutput;
569
570mod _start_snapshot_input;
571
572mod _start_snapshot_output;
573
574pub mod builders;