aws_sdk_ebs/operation/
start_snapshot.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `StartSnapshot`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartSnapshot;
6impl StartSnapshot {
7    /// Creates a new `StartSnapshot`
8    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        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("ebs", "StartSnapshot", 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
63            .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
64                |token_provider, input| {
65                    let input: &mut crate::operation::start_snapshot::StartSnapshotInput = input.downcast_mut().expect("correct type");
66                    if input.client_token.is_none() {
67                        input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
68                    }
69                },
70            ))
71            .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
72                ::aws_runtime::auth::sigv4::SCHEME_ID,
73            ]));
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartSnapshot {
88    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartSnapshot");
90
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92            StartSnapshotRequestSerializer,
93        ));
94        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95            StartSnapshotResponseDeserializer,
96        ));
97
98        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
100        ));
101
102        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
103        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("StartSnapshot", "ebs"));
104        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
105        signing_options.double_uri_encode = true;
106        signing_options.content_sha256_header = false;
107        signing_options.normalize_uri_path = true;
108        signing_options.payload_override = None;
109
110        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
111            signing_options,
112            ..::std::default::Default::default()
113        });
114
115        ::std::option::Option::Some(cfg.freeze())
116    }
117
118    fn runtime_components(
119        &self,
120        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
121    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
122        #[allow(unused_mut)]
123        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartSnapshot")
124            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
125            .with_interceptor(StartSnapshotEndpointParamsInterceptor)
126            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
127                crate::operation::start_snapshot::StartSnapshotError,
128            >::new())
129            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
130                crate::operation::start_snapshot::StartSnapshotError,
131            >::new())
132            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
133                crate::operation::start_snapshot::StartSnapshotError,
134            >::new());
135
136        ::std::borrow::Cow::Owned(rcb)
137    }
138}
139
140#[derive(Debug)]
141struct StartSnapshotResponseDeserializer;
142impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartSnapshotResponseDeserializer {
143    fn deserialize_nonstreaming(
144        &self,
145        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
146    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
147        let (success, status) = (response.status().is_success(), response.status().as_u16());
148        let headers = response.headers();
149        let body = response.body().bytes().expect("body loaded");
150        #[allow(unused_mut)]
151        let mut force_error = false;
152        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
153        let parse_result = if !success && status != 201 || force_error {
154            crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_error(status, headers, body)
155        } else {
156            crate::protocol_serde::shape_start_snapshot::de_start_snapshot_http_response(status, headers, body)
157        };
158        crate::protocol_serde::type_erase_result(parse_result)
159    }
160}
161#[derive(Debug)]
162struct StartSnapshotRequestSerializer;
163impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartSnapshotRequestSerializer {
164    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
165    fn serialize_input(
166        &self,
167        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
168        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
169    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
170        let input = input
171            .downcast::<crate::operation::start_snapshot::StartSnapshotInput>()
172            .expect("correct type");
173        let _header_serialization_settings = _cfg
174            .load::<crate::serialization_settings::HeaderSerializationSettings>()
175            .cloned()
176            .unwrap_or_default();
177        let mut request_builder = {
178            fn uri_base(
179                _input: &crate::operation::start_snapshot::StartSnapshotInput,
180                output: &mut ::std::string::String,
181            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
182                use ::std::fmt::Write as _;
183                ::std::write!(output, "/snapshots").expect("formatting should succeed");
184                ::std::result::Result::Ok(())
185            }
186            #[allow(clippy::unnecessary_wraps)]
187            fn update_http_builder(
188                input: &crate::operation::start_snapshot::StartSnapshotInput,
189                builder: ::http::request::Builder,
190            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
191                let mut uri = ::std::string::String::new();
192                uri_base(input, &mut uri)?;
193                ::std::result::Result::Ok(builder.method("POST").uri(uri))
194            }
195            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
196            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
197            builder
198        };
199        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_start_snapshot::ser_start_snapshot_input(&input)?);
200        if let Some(content_length) = body.content_length() {
201            let content_length = content_length.to_string();
202            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
203        }
204        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
205    }
206}
207#[derive(Debug)]
208struct StartSnapshotEndpointParamsInterceptor;
209
210impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSnapshotEndpointParamsInterceptor {
211    fn name(&self) -> &'static str {
212        "StartSnapshotEndpointParamsInterceptor"
213    }
214
215    fn read_before_execution(
216        &self,
217        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
218            '_,
219            ::aws_smithy_runtime_api::client::interceptors::context::Input,
220            ::aws_smithy_runtime_api::client::interceptors::context::Output,
221            ::aws_smithy_runtime_api::client::interceptors::context::Error,
222        >,
223        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
224    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
225        let _input = context
226            .input()
227            .downcast_ref::<StartSnapshotInput>()
228            .ok_or("failed to downcast to StartSnapshotInput")?;
229
230        let params = crate::config::endpoint::Params::builder()
231            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
232            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
233            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
234            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
235            .build()
236            .map_err(|err| {
237                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
238            })?;
239        cfg.interceptor_state()
240            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
241        ::std::result::Result::Ok(())
242    }
243}
244
245// The get_* functions below are generated from JMESPath expressions in the
246// operationContextParams trait. They target the operation's input shape.
247
248#[allow(unreachable_code, unused_variables)]
249#[cfg(test)]
250mod start_snapshot_test {
251
252    /// This test case validates case insensitive parsing of `message`
253    /// Test ID: LowercaseMessage
254    #[::tokio::test]
255    #[::tracing_test::traced_test]
256    async fn lowercase_message_response() {
257        let expected_output = crate::types::error::ValidationException::builder()
258            .set_message(::std::option::Option::Some("1 validation error detected".to_owned()))
259            .build();
260        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
261            ::http::response::Builder::new()
262                .header("content-length", "77")
263                .header("content-type", "application/json")
264                .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
265                .header(
266                    "x-amzn-errortype",
267                    "ValidationException:http://internal.amazon.com/coral/com.amazon.coral.validate/",
268                )
269                .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
270                .status(400)
271                .body(::aws_smithy_types::body::SdkBody::from(
272                    "{\n  \"message\": \"1 validation error detected\"\n}\n",
273                ))
274                .unwrap(),
275        )
276        .unwrap();
277        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
278        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
279
280        let op = crate::operation::start_snapshot::StartSnapshot::new();
281        let config = op.config().expect("the operation has config");
282        let de = config
283            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
284            .expect("the config must have a deserializer");
285
286        let parsed = de.deserialize_streaming(&mut http_response);
287        let parsed = parsed.unwrap_or_else(|| {
288            let http_response = http_response.map(|body| {
289                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
290                    body.bytes().unwrap(),
291                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
292                )))
293            });
294            de.deserialize_nonstreaming(&http_response)
295        });
296        let parsed = parsed.expect_err("should be error response");
297        let parsed: &crate::operation::start_snapshot::StartSnapshotError =
298            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
299        if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
300            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
301            ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
302        } else {
303            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
304        }
305    }
306
307    /// This test case validates case insensitive parsing of `message`
308    /// Test ID: UppercaseMessage
309    #[::tokio::test]
310    #[::tracing_test::traced_test]
311    async fn uppercase_message_response() {
312        let expected_output = crate::types::error::ValidationException::builder()
313            .set_message(::std::option::Option::Some("Invalid volume size: 99999999999".to_owned()))
314            .set_reason(::std::option::Option::Some(
315                "INVALID_VOLUME_SIZE"
316                    .parse::<crate::types::ValidationExceptionReason>()
317                    .expect("static value validated to member"),
318            ))
319            .build();
320        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
321            ::http::response::Builder::new()
322                .header("content-length", "77")
323                .header("content-type", "application/json")
324                .header("date", "Wed, 30 Jun 2021 23:42:27 GMT")
325                .header(
326                    "x-amzn-errortype",
327                    "ValidationException:http://internal.amazon.com/coral/com.amazon.zeppelindataservice/",
328                )
329                .header("x-amzn-requestid", "2af8f013-250a-4f6e-88ae-6dd7f6e12807")
330                .status(400)
331                .body(::aws_smithy_types::body::SdkBody::from(
332                    "{\"Message\":\"Invalid volume size: 99999999999\",\"Reason\":\"INVALID_VOLUME_SIZE\"}\n",
333                ))
334                .unwrap(),
335        )
336        .unwrap();
337        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
338        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
339
340        let op = crate::operation::start_snapshot::StartSnapshot::new();
341        let config = op.config().expect("the operation has config");
342        let de = config
343            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
344            .expect("the config must have a deserializer");
345
346        let parsed = de.deserialize_streaming(&mut http_response);
347        let parsed = parsed.unwrap_or_else(|| {
348            let http_response = http_response.map(|body| {
349                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
350                    body.bytes().unwrap(),
351                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
352                )))
353            });
354            de.deserialize_nonstreaming(&http_response)
355        });
356        let parsed = parsed.expect_err("should be error response");
357        let parsed: &crate::operation::start_snapshot::StartSnapshotError =
358            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
359        if let crate::operation::start_snapshot::StartSnapshotError::ValidationException(parsed) = parsed {
360            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
361            ::pretty_assertions::assert_eq!(parsed.reason, expected_output.reason, "Unexpected value for `reason`");
362        } else {
363            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
364        }
365    }
366}
367
368/// Error type for the `StartSnapshotError` operation.
369#[non_exhaustive]
370#[derive(::std::fmt::Debug)]
371pub enum StartSnapshotError {
372    /// <p>You do not have sufficient access to perform this action.</p>
373    AccessDeniedException(crate::types::error::AccessDeniedException),
374    /// <p>You have reached the limit for concurrent API requests. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance">Optimizing performance of the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
375    ConcurrentLimitExceededException(crate::types::error::ConcurrentLimitExceededException),
376    /// <p>The request uses the same client token as a previous, but non-identical request.</p>
377    ConflictException(crate::types::error::ConflictException),
378    /// <p>An internal error has occurred. For more information see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html">Error retries</a>.</p>
379    InternalServerException(crate::types::error::InternalServerException),
380    /// <p>The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/error-retries.html">Error retries</a>.</p>
381    RequestThrottledException(crate::types::error::RequestThrottledException),
382    /// <p>The specified resource does not exist.</p>
383    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
384    /// <p>Your current service quotas do not allow you to perform this action.</p>
385    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
386    /// <p>The input fails to satisfy the constraints of the EBS direct APIs.</p>
387    ValidationException(crate::types::error::ValidationException),
388    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
389    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
390    variable wildcard pattern and check `.code()`:
391     \
392    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
393     \
394    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartSnapshotError) for what information is available for the error.")]
395    Unhandled(crate::error::sealed_unhandled::Unhandled),
396}
397impl StartSnapshotError {
398    /// Creates the `StartSnapshotError::Unhandled` variant from any error type.
399    pub fn unhandled(
400        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
401    ) -> Self {
402        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
403            source: err.into(),
404            meta: ::std::default::Default::default(),
405        })
406    }
407
408    /// Creates the `StartSnapshotError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
409    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
410        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
411            source: err.clone().into(),
412            meta: err,
413        })
414    }
415    ///
416    /// Returns error metadata, which includes the error code, message,
417    /// request ID, and potentially additional information.
418    ///
419    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
420        match self {
421            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422            Self::ConcurrentLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423            Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425            Self::RequestThrottledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
427            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
428            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
429            Self::Unhandled(e) => &e.meta,
430        }
431    }
432    /// Returns `true` if the error kind is `StartSnapshotError::AccessDeniedException`.
433    pub fn is_access_denied_exception(&self) -> bool {
434        matches!(self, Self::AccessDeniedException(_))
435    }
436    /// Returns `true` if the error kind is `StartSnapshotError::ConcurrentLimitExceededException`.
437    pub fn is_concurrent_limit_exceeded_exception(&self) -> bool {
438        matches!(self, Self::ConcurrentLimitExceededException(_))
439    }
440    /// Returns `true` if the error kind is `StartSnapshotError::ConflictException`.
441    pub fn is_conflict_exception(&self) -> bool {
442        matches!(self, Self::ConflictException(_))
443    }
444    /// Returns `true` if the error kind is `StartSnapshotError::InternalServerException`.
445    pub fn is_internal_server_exception(&self) -> bool {
446        matches!(self, Self::InternalServerException(_))
447    }
448    /// Returns `true` if the error kind is `StartSnapshotError::RequestThrottledException`.
449    pub fn is_request_throttled_exception(&self) -> bool {
450        matches!(self, Self::RequestThrottledException(_))
451    }
452    /// Returns `true` if the error kind is `StartSnapshotError::ResourceNotFoundException`.
453    pub fn is_resource_not_found_exception(&self) -> bool {
454        matches!(self, Self::ResourceNotFoundException(_))
455    }
456    /// Returns `true` if the error kind is `StartSnapshotError::ServiceQuotaExceededException`.
457    pub fn is_service_quota_exceeded_exception(&self) -> bool {
458        matches!(self, Self::ServiceQuotaExceededException(_))
459    }
460    /// Returns `true` if the error kind is `StartSnapshotError::ValidationException`.
461    pub fn is_validation_exception(&self) -> bool {
462        matches!(self, Self::ValidationException(_))
463    }
464}
465impl ::std::error::Error for StartSnapshotError {
466    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
467        match self {
468            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
469            Self::ConcurrentLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
470            Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
471            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
472            Self::RequestThrottledException(_inner) => ::std::option::Option::Some(_inner),
473            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
474            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
475            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
476            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
477        }
478    }
479}
480impl ::std::fmt::Display for StartSnapshotError {
481    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
482        match self {
483            Self::AccessDeniedException(_inner) => _inner.fmt(f),
484            Self::ConcurrentLimitExceededException(_inner) => _inner.fmt(f),
485            Self::ConflictException(_inner) => _inner.fmt(f),
486            Self::InternalServerException(_inner) => _inner.fmt(f),
487            Self::RequestThrottledException(_inner) => _inner.fmt(f),
488            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
489            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
490            Self::ValidationException(_inner) => _inner.fmt(f),
491            Self::Unhandled(_inner) => {
492                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
493                    write!(f, "unhandled error ({code})")
494                } else {
495                    f.write_str("unhandled error")
496                }
497            }
498        }
499    }
500}
501impl ::aws_smithy_types::retry::ProvideErrorKind for StartSnapshotError {
502    fn code(&self) -> ::std::option::Option<&str> {
503        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
504    }
505    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
506        ::std::option::Option::None
507    }
508}
509impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartSnapshotError {
510    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
511        match self {
512            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
513            Self::ConcurrentLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
514            Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
515            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
516            Self::RequestThrottledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
517            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
518            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
519            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
520            Self::Unhandled(_inner) => &_inner.meta,
521        }
522    }
523}
524impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartSnapshotError {
525    fn create_unhandled_error(
526        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
527        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
528    ) -> Self {
529        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
530            source,
531            meta: meta.unwrap_or_default(),
532        })
533    }
534}
535impl ::aws_types::request_id::RequestId for crate::operation::start_snapshot::StartSnapshotError {
536    fn request_id(&self) -> Option<&str> {
537        self.meta().request_id()
538    }
539}
540
541pub use crate::operation::start_snapshot::_start_snapshot_output::StartSnapshotOutput;
542
543pub use crate::operation::start_snapshot::_start_snapshot_input::StartSnapshotInput;
544
545mod _start_snapshot_input;
546
547mod _start_snapshot_output;
548
549/// Builders
550pub mod builders;