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