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(
158 &self,
159 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
160 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
161 let (success, status) = (response.status().is_success(), response.status().as_u16());
162 let headers = response.headers();
163 let body = response.body().bytes().expect("body loaded");
164 #[allow(unused_mut)]
165 let mut force_error = false;
166 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
167 let parse_result = if !success && status != 201 || force_error {
168 crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_error(status, headers, body)
169 } else {
170 crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_response(status, headers, body)
171 };
172 crate::protocol_serde::type_erase_result(parse_result)
173 }
174}
175#[derive(Debug)]
176struct StartSnapshotRequestSerializer;
177impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartSnapshotRequestSerializer {
178 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
179 fn serialize_input(
180 &self,
181 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
182 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
183 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
184 let input = input
185 .downcast::<crate::operation::start_snapshot::StartSnapshotInput>()
186 .expect("correct type");
187 let _header_serialization_settings = _cfg
188 .load::<crate::serialization_settings::HeaderSerializationSettings>()
189 .cloned()
190 .unwrap_or_default();
191 let mut request_builder = {
192 #[allow(clippy::uninlined_format_args)]
193 fn uri_base(
194 _input: &crate::operation::start_snapshot::StartSnapshotInput,
195 output: &mut ::std::string::String,
196 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
197 use ::std::fmt::Write as _;
198 ::std::write!(output, "/snapshots").expect("formatting should succeed");
199 ::std::result::Result::Ok(())
200 }
201 #[allow(clippy::unnecessary_wraps)]
202 fn update_http_builder(
203 input: &crate::operation::start_snapshot::StartSnapshotInput,
204 builder: ::http_1x::request::Builder,
205 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
206 let mut uri = ::std::string::String::new();
207 uri_base(input, &mut uri)?;
208 ::std::result::Result::Ok(builder.method("POST").uri(uri))
209 }
210 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
211 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
212 builder
213 };
214 let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_start_snapshot::ser_start_snapshot_input(&input)?);
215 if let Some(content_length) = body.content_length() {
216 let content_length = content_length.to_string();
217 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
218 }
219 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
220 }
221}
222#[derive(Debug)]
223struct StartSnapshotEndpointParamsInterceptor;
224
225#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
226impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSnapshotEndpointParamsInterceptor {
227 fn name(&self) -> &'static str {
228 "StartSnapshotEndpointParamsInterceptor"
229 }
230
231 fn read_before_execution(
232 &self,
233 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
234 '_,
235 ::aws_smithy_runtime_api::client::interceptors::context::Input,
236 ::aws_smithy_runtime_api::client::interceptors::context::Output,
237 ::aws_smithy_runtime_api::client::interceptors::context::Error,
238 >,
239 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
240 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
241 let _input = context
242 .input()
243 .downcast_ref::<StartSnapshotInput>()
244 .ok_or("failed to downcast to StartSnapshotInput")?;
245
246 let params = crate::config::endpoint::Params::builder()
247 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
248 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
249 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
250 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
251 .build()
252 .map_err(|err| {
253 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
254 })?;
255 cfg.interceptor_state()
256 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
257 ::std::result::Result::Ok(())
258 }
259}
260
261#[allow(unreachable_code, unused_variables)]
265#[cfg(test)]
266mod start_snapshot_test {
267
268 #[::tokio::test]
271 #[::tracing_test::traced_test]
272 async fn lowercase_message_response() {
273 let expected_output = crate::types::error::ValidationException::builder()
274 .set_message(::std::option::Option::Some("1 validation error detected".to_owned()))
275 .build();
276 let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
277 ::http_1x::response::Builder::new()
278 .header("content-length", "77")
279 .header("content-type", "application/json")
280 .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
281 .header(
282 "x-amzn-errortype",
283 "ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/",
284 )
285 .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
286 .status(400)
287 .body(::aws_smithy_types::body::SdkBody::from(
288 "{\n \"message\": \"1 validation error detected\"\n}\n",
289 ))
290 .unwrap(),
291 )
292 .unwrap();
293 use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
294 use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
295
296 let op = crate::operation::start_snapshot::StartSnapshot::new();
297 let config = op.config().expect("the operation has config");
298 let de = config
299 .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
300 .expect("the config must have a deserializer");
301
302 let parsed = de.deserialize_streaming(&mut http_response);
303 let parsed = parsed.unwrap_or_else(|| {
304 let http_response = http_response.map(|body| {
305 ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
306 body.bytes().unwrap(),
307 ::aws_smithy_protocol_test::MediaType::from("application/json"),
308 )))
309 });
310 de.deserialize_nonstreaming(&http_response)
311 });
312 let parsed = parsed.expect_err("should be error response");
313 let parsed: &crate::operation::start_snapshot::StartSnapshotError =
314 parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
315 if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
316 ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
317 ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
318 } else {
319 panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
320 }
321 }
322
323 #[::tokio::test]
326 #[::tracing_test::traced_test]
327 async fn uppercase_message_response() {
328 let expected_output = crate::types::error::ValidationException::builder()
329 .set_message(::std::option::Option::Some("Invalid volume size: 99999999999".to_owned()))
330 .set_reason(::std::option::Option::Some(
331 "INVALID_VOLUME_SIZE"
332 .parse::<crate::types::ValidationExceptionReason>()
333 .expect("static value validated to member"),
334 ))
335 .build();
336 let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
337 ::http_1x::response::Builder::new()
338 .header("content-length", "77")
339 .header("content-type", "application/json")
340 .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
341 .header(
342 "x-amzn-errortype",
343 "ValidationException:http://internal.amazon.com/coral/com.amazon.zeppelindataservice/",
344 )
345 .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
346 .status(400)
347 .body(::aws_smithy_types::body::SdkBody::from(
348 "{\"Message\":\"Invalid volume size: 99999999999\",\"Reason\":\"INVALID_VOLUME_SIZE\"}\n",
349 ))
350 .unwrap(),
351 )
352 .unwrap();
353 use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
354 use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
355
356 let op = crate::operation::start_snapshot::StartSnapshot::new();
357 let config = op.config().expect("the operation has config");
358 let de = config
359 .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
360 .expect("the config must have a deserializer");
361
362 let parsed = de.deserialize_streaming(&mut http_response);
363 let parsed = parsed.unwrap_or_else(|| {
364 let http_response = http_response.map(|body| {
365 ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
366 body.bytes().unwrap(),
367 ::aws_smithy_protocol_test::MediaType::from("application/json"),
368 )))
369 });
370 de.deserialize_nonstreaming(&http_response)
371 });
372 let parsed = parsed.expect_err("should be error response");
373 let parsed: &crate::operation::start_snapshot::StartSnapshotError =
374 parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
375 if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
376 ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
377 ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
378 } else {
379 panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
380 }
381 }
382}
383
384#[non_exhaustive]
386#[derive(::std::fmt::Debug)]
387pub enum StartSnapshotError {
388 AccessDeniedException(crate::types::error::AccessDeniedException),
390 ConcurrentLimitExceededException(crate::types::error::ConcurrentLimitExceededException),
392 ConflictException(crate::types::error::ConflictException),
394 InternalServerException(crate::types::error::InternalServerException),
396 RequestThrottledException(crate::types::error::RequestThrottledException),
398 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
400 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
402 ValidationException(crate::types::error::ValidationException),
404 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
406 variable wildcard pattern and check `.code()`:
407 \
408 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
409 \
410 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartSnapshotError) for what information is available for the error.")]
411 Unhandled(crate::error::sealed_unhandled::Unhandled),
412}
413impl StartSnapshotError {
414 pub fn unhandled(
416 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
417 ) -> Self {
418 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
419 source: err.into(),
420 meta: ::std::default::Default::default(),
421 })
422 }
423
424 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
426 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
427 source: err.clone().into(),
428 meta: err,
429 })
430 }
431 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
436 match self {
437 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::ConcurrentLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::RequestThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445 Self::Unhandled(e) => &e.meta,
446 }
447 }
448 pub fn is_access_denied_exception(&self) -> bool {
450 matches!(self, Self::AccessDeniedException(_))
451 }
452 pub fn is_concurrent_limit_exceeded_exception(&self) -> bool {
454 matches!(self, Self::ConcurrentLimitExceededException(_))
455 }
456 pub fn is_conflict_exception(&self) -> bool {
458 matches!(self, Self::ConflictException(_))
459 }
460 pub fn is_internal_server_exception(&self) -> bool {
462 matches!(self, Self::InternalServerException(_))
463 }
464 pub fn is_request_throttled_exception(&self) -> bool {
466 matches!(self, Self::RequestThrottledException(_))
467 }
468 pub fn is_resource_not_found_exception(&self) -> bool {
470 matches!(self, Self::ResourceNotFoundException(_))
471 }
472 pub fn is_service_quota_exceeded_exception(&self) -> bool {
474 matches!(self, Self::ServiceQuotaExceededException(_))
475 }
476 pub fn is_validation_exception(&self) -> bool {
478 matches!(self, Self::ValidationException(_))
479 }
480}
481impl ::std::error::Error for StartSnapshotError {
482 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
483 match self {
484 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
485 Self::ConcurrentLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
486 Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
487 Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
488 Self::RequestThrottledException(_inner) => ::std::option::Option::Some(_inner),
489 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
490 Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
491 Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
492 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
493 }
494 }
495}
496impl ::std::fmt::Display for StartSnapshotError {
497 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
498 match self {
499 Self::AccessDeniedException(_inner) => _inner.fmt(f),
500 Self::ConcurrentLimitExceededException(_inner) => _inner.fmt(f),
501 Self::ConflictException(_inner) => _inner.fmt(f),
502 Self::InternalServerException(_inner) => _inner.fmt(f),
503 Self::RequestThrottledException(_inner) => _inner.fmt(f),
504 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
505 Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
506 Self::ValidationException(_inner) => _inner.fmt(f),
507 Self::Unhandled(_inner) => {
508 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
509 write!(f, "unhandled error ({code})")
510 } else {
511 f.write_str("unhandled error")
512 }
513 }
514 }
515 }
516}
517impl ::aws_smithy_types::retry::ProvideErrorKind for StartSnapshotError {
518 fn code(&self) -> ::std::option::Option<&str> {
519 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
520 }
521 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
522 ::std::option::Option::None
523 }
524}
525impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartSnapshotError {
526 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
527 match self {
528 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
529 Self::ConcurrentLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
530 Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
531 Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
532 Self::RequestThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
533 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
534 Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
535 Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
536 Self::Unhandled(_inner) => &_inner.meta,
537 }
538 }
539}
540impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartSnapshotError {
541 fn create_unhandled_error(
542 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
543 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
544 ) -> Self {
545 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
546 source,
547 meta: meta.unwrap_or_default(),
548 })
549 }
550}
551impl ::aws_types::request_id::RequestId for crate::operation::start_snapshot::StartSnapshotError {
552 fn request_id(&self) -> Option<&str> {
553 self.meta().request_id()
554 }
555}
556
557pub use crate::operation::start_snapshot::_start_snapshot_input::StartSnapshotInput;
558
559pub use crate::operation::start_snapshot::_start_snapshot_output::StartSnapshotOutput;
560
561mod _start_snapshot_input;
562
563mod _start_snapshot_output;
564
565pub mod builders;