Skip to main content

aws_sdk_fsx/operation/
create_volume.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateVolume`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateVolume;
6impl CreateVolume {
7    /// Creates a new `CreateVolume`
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::create_volume::CreateVolumeInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_volume::CreateVolumeOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_volume::CreateVolumeError,
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::create_volume::CreateVolumeError>()
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::create_volume::CreateVolumeOutput>()
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::create_volume::CreateVolumeInput,
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("FSx", "CreateVolume", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "FSx.CreateVolume",
59                "rpc.service" = "FSx",
60                "rpc.method" = "CreateVolume",
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::create_volume::CreateVolumeInput = input.downcast_mut().expect("correct type");
76                if input.client_request_token.is_none() {
77                    input.client_request_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 CreateVolume {
95    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
96        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateVolume");
97
98        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
99            CreateVolumeRequestSerializer,
100        ));
101        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
102            CreateVolumeResponseDeserializer,
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
106            crate::config::auth::Params::builder()
107                .operation_name("CreateVolume")
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("CreateVolume", "FSx"));
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("CreateVolume")
134            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
135                CreateVolumeTelemetryInputCaptureInterceptor,
136            ))
137            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
138                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
139            ))
140            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
141                CreateVolumeEndpointParamsInterceptor,
142            ))
143            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
144                crate::operation::create_volume::CreateVolumeError,
145            >::new())
146            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
147                crate::operation::create_volume::CreateVolumeError,
148            >::new())
149            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
150                crate::operation::create_volume::CreateVolumeError,
151            >::new());
152
153        ::std::borrow::Cow::Owned(rcb)
154    }
155}
156
157#[derive(Debug)]
158struct CreateVolumeTelemetryInputCaptureInterceptor;
159
160#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
161impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateVolumeTelemetryInputCaptureInterceptor {
162    fn name(&self) -> &'static str {
163        "CreateVolumeTelemetryInputCaptureInterceptor"
164    }
165
166    fn read_before_execution(
167        &self,
168        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
169            '_,
170            ::aws_smithy_runtime_api::client::interceptors::context::Input,
171            ::aws_smithy_runtime_api::client::interceptors::context::Output,
172            ::aws_smithy_runtime_api::client::interceptors::context::Error,
173        >,
174        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
175    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
176        // Nothing to do unless the customer opted in by naming members to record.
177        let ::std::option::Option::Some(requested) = cfg
178            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
179            .filter(|r| !r.is_empty())
180        else {
181            return ::std::result::Result::Ok(());
182        };
183
184        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateVolumeInput>() else {
185            // A mismatched input is not this interceptor's concern; skip quietly.
186            return ::std::result::Result::Ok(());
187        };
188
189        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
190        if requested.should_capture("ClientRequestToken") {
191            if let ::std::option::Option::Some(value) = input.client_request_token.as_deref() {
192                captured.insert("ClientRequestToken", value);
193            }
194        }
195        if requested.should_capture("Name") {
196            if let ::std::option::Option::Some(value) = input.name.as_deref() {
197                captured.insert("Name", value);
198            }
199        }
200
201        cfg.interceptor_state().store_put(captured);
202        ::std::result::Result::Ok(())
203    }
204}
205#[derive(Debug)]
206struct CreateVolumeResponseDeserializer;
207impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateVolumeResponseDeserializer {
208    fn deserialize_nonstreaming_with_config(
209        &self,
210        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
211        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
212    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
213        let (success, status) = (response.status().is_success(), response.status().as_u16());
214        let headers = response.headers();
215        let body = response.body().bytes().expect("body loaded");
216        #[allow(unused_mut)]
217        let mut force_error = false;
218        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
219        let parse_result = if !success && status != 200 || force_error {
220            crate::protocol_serde::shape_create_volume::de_create_volume_http_error(status, headers, body)
221        } else {
222            crate::protocol_serde::shape_create_volume::de_create_volume_http_response(status, headers, body)
223        };
224        crate::protocol_serde::type_erase_result(parse_result)
225    }
226}
227#[derive(Debug)]
228struct CreateVolumeRequestSerializer;
229impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateVolumeRequestSerializer {
230    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
231    fn serialize_input(
232        &self,
233        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
234        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
235    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
236        let input = input
237            .downcast::<crate::operation::create_volume::CreateVolumeInput>()
238            .expect("correct type");
239        let _header_serialization_settings = _cfg
240            .load::<crate::serialization_settings::HeaderSerializationSettings>()
241            .cloned()
242            .unwrap_or_default();
243        let mut request_builder = {
244            #[allow(clippy::uninlined_format_args)]
245            fn uri_base(
246                _input: &crate::operation::create_volume::CreateVolumeInput,
247                output: &mut ::std::string::String,
248            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
249                use ::std::fmt::Write as _;
250                ::std::write!(output, "/").expect("formatting should succeed");
251                ::std::result::Result::Ok(())
252            }
253            #[allow(clippy::unnecessary_wraps)]
254            fn update_http_builder(
255                input: &crate::operation::create_volume::CreateVolumeInput,
256                builder: ::http_1x::request::Builder,
257            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
258                let mut uri = ::std::string::String::new();
259                uri_base(input, &mut uri)?;
260                ::std::result::Result::Ok(builder.method("POST").uri(uri))
261            }
262            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
263            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
264            builder = _header_serialization_settings.set_default_header(
265                builder,
266                ::http_1x::header::HeaderName::from_static("x-amz-target"),
267                "AWSSimbaAPIService_v20180301.CreateVolume",
268            );
269            builder
270        };
271        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_volume::ser_create_volume_input(&input)?);
272        if let Some(content_length) = body.content_length() {
273            let content_length = content_length.to_string();
274            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
275        }
276        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
277    }
278}
279#[derive(Debug)]
280struct CreateVolumeEndpointParamsInterceptor;
281
282#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
283impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateVolumeEndpointParamsInterceptor {
284    fn name(&self) -> &'static str {
285        "CreateVolumeEndpointParamsInterceptor"
286    }
287
288    fn read_before_execution(
289        &self,
290        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
291            '_,
292            ::aws_smithy_runtime_api::client::interceptors::context::Input,
293            ::aws_smithy_runtime_api::client::interceptors::context::Output,
294            ::aws_smithy_runtime_api::client::interceptors::context::Error,
295        >,
296        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
297    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
298        let _input = context
299            .input()
300            .downcast_ref::<CreateVolumeInput>()
301            .ok_or("failed to downcast to CreateVolumeInput")?;
302
303        let params = crate::config::endpoint::Params::builder()
304            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
305            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
306            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
307            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
308            .build()
309            .map_err(|err| {
310                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
311            })?;
312        cfg.interceptor_state()
313            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
314        ::std::result::Result::Ok(())
315    }
316}
317
318// The get_* functions below are generated from JMESPath expressions in the
319// operationContextParams trait. They target the operation's input shape.
320
321/// Error type for the `CreateVolumeError` operation.
322#[non_exhaustive]
323#[derive(::std::fmt::Debug)]
324pub enum CreateVolumeError {
325    /// <p>A generic error indicating a failure with a client request.</p>
326    BadRequest(crate::types::error::BadRequest),
327    /// <p>No Amazon FSx file systems were found based upon supplied parameters.</p>
328    FileSystemNotFound(crate::types::error::FileSystemNotFound),
329    /// <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
330    IncompatibleParameterError(crate::types::error::IncompatibleParameterError),
331    /// <p>A generic error indicating a server-side failure.</p>
332    InternalServerError(crate::types::error::InternalServerError),
333    /// <p>A volume configuration is required for this operation.</p>
334    MissingVolumeConfiguration(crate::types::error::MissingVolumeConfiguration),
335    /// <p>An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.</p>
336    ServiceLimitExceeded(crate::types::error::ServiceLimitExceeded),
337    /// <p>No FSx for ONTAP SVMs were found based upon the supplied parameters.</p>
338    StorageVirtualMachineNotFound(crate::types::error::StorageVirtualMachineNotFound),
339    /// <p>The requested operation is not supported for this resource or API.</p>
340    UnsupportedOperation(crate::types::error::UnsupportedOperation),
341    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
342    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
343    variable wildcard pattern and check `.code()`:
344     \
345    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
346     \
347    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateVolumeError) for what information is available for the error.")]
348    Unhandled(crate::error::sealed_unhandled::Unhandled),
349}
350impl CreateVolumeError {
351    /// Creates the `CreateVolumeError::Unhandled` variant from any error type.
352    pub fn unhandled(
353        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
354    ) -> Self {
355        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
356            source: err.into(),
357            meta: ::std::default::Default::default(),
358        })
359    }
360
361    /// Creates the `CreateVolumeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
362    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
363        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
364            source: err.clone().into(),
365            meta: err,
366        })
367    }
368    ///
369    /// Returns error metadata, which includes the error code, message,
370    /// request ID, and potentially additional information.
371    ///
372    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
373        match self {
374            Self::BadRequest(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
375            Self::FileSystemNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
376            Self::IncompatibleParameterError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
377            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
378            Self::MissingVolumeConfiguration(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
379            Self::ServiceLimitExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
380            Self::StorageVirtualMachineNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
381            Self::UnsupportedOperation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
382            Self::Unhandled(e) => &e.meta,
383        }
384    }
385    /// Returns `true` if the error kind is `CreateVolumeError::BadRequest`.
386    pub fn is_bad_request(&self) -> bool {
387        matches!(self, Self::BadRequest(_))
388    }
389    /// Returns `true` if the error kind is `CreateVolumeError::FileSystemNotFound`.
390    pub fn is_file_system_not_found(&self) -> bool {
391        matches!(self, Self::FileSystemNotFound(_))
392    }
393    /// Returns `true` if the error kind is `CreateVolumeError::IncompatibleParameterError`.
394    pub fn is_incompatible_parameter_error(&self) -> bool {
395        matches!(self, Self::IncompatibleParameterError(_))
396    }
397    /// Returns `true` if the error kind is `CreateVolumeError::InternalServerError`.
398    pub fn is_internal_server_error(&self) -> bool {
399        matches!(self, Self::InternalServerError(_))
400    }
401    /// Returns `true` if the error kind is `CreateVolumeError::MissingVolumeConfiguration`.
402    pub fn is_missing_volume_configuration(&self) -> bool {
403        matches!(self, Self::MissingVolumeConfiguration(_))
404    }
405    /// Returns `true` if the error kind is `CreateVolumeError::ServiceLimitExceeded`.
406    pub fn is_service_limit_exceeded(&self) -> bool {
407        matches!(self, Self::ServiceLimitExceeded(_))
408    }
409    /// Returns `true` if the error kind is `CreateVolumeError::StorageVirtualMachineNotFound`.
410    pub fn is_storage_virtual_machine_not_found(&self) -> bool {
411        matches!(self, Self::StorageVirtualMachineNotFound(_))
412    }
413    /// Returns `true` if the error kind is `CreateVolumeError::UnsupportedOperation`.
414    pub fn is_unsupported_operation(&self) -> bool {
415        matches!(self, Self::UnsupportedOperation(_))
416    }
417}
418impl ::std::error::Error for CreateVolumeError {
419    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
420        match self {
421            Self::BadRequest(_inner) => ::std::option::Option::Some(_inner),
422            Self::FileSystemNotFound(_inner) => ::std::option::Option::Some(_inner),
423            Self::IncompatibleParameterError(_inner) => ::std::option::Option::Some(_inner),
424            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
425            Self::MissingVolumeConfiguration(_inner) => ::std::option::Option::Some(_inner),
426            Self::ServiceLimitExceeded(_inner) => ::std::option::Option::Some(_inner),
427            Self::StorageVirtualMachineNotFound(_inner) => ::std::option::Option::Some(_inner),
428            Self::UnsupportedOperation(_inner) => ::std::option::Option::Some(_inner),
429            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
430        }
431    }
432}
433impl ::std::fmt::Display for CreateVolumeError {
434    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
435        match self {
436            Self::BadRequest(_inner) => _inner.fmt(f),
437            Self::FileSystemNotFound(_inner) => _inner.fmt(f),
438            Self::IncompatibleParameterError(_inner) => _inner.fmt(f),
439            Self::InternalServerError(_inner) => _inner.fmt(f),
440            Self::MissingVolumeConfiguration(_inner) => _inner.fmt(f),
441            Self::ServiceLimitExceeded(_inner) => _inner.fmt(f),
442            Self::StorageVirtualMachineNotFound(_inner) => _inner.fmt(f),
443            Self::UnsupportedOperation(_inner) => _inner.fmt(f),
444            Self::Unhandled(_inner) => {
445                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
446                    write!(f, "unhandled error ({code})")
447                } else {
448                    f.write_str("unhandled error")
449                }
450            }
451        }
452    }
453}
454impl ::aws_smithy_types::retry::ProvideErrorKind for CreateVolumeError {
455    fn code(&self) -> ::std::option::Option<&str> {
456        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
457    }
458    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
459        ::std::option::Option::None
460    }
461}
462impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateVolumeError {
463    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
464        match self {
465            Self::BadRequest(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
466            Self::FileSystemNotFound(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
467            Self::IncompatibleParameterError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
468            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
469            Self::MissingVolumeConfiguration(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
470            Self::ServiceLimitExceeded(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
471            Self::StorageVirtualMachineNotFound(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
472            Self::UnsupportedOperation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
473            Self::Unhandled(_inner) => &_inner.meta,
474        }
475    }
476}
477impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateVolumeError {
478    fn create_unhandled_error(
479        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
480        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
481    ) -> Self {
482        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
483            source,
484            meta: meta.unwrap_or_default(),
485        })
486    }
487}
488impl ::aws_types::request_id::RequestId for crate::operation::create_volume::CreateVolumeError {
489    fn request_id(&self) -> Option<&str> {
490        self.meta().request_id()
491    }
492}
493
494pub use crate::operation::create_volume::_create_volume_input::CreateVolumeInput;
495
496pub use crate::operation::create_volume::_create_volume_output::CreateVolumeOutput;
497
498mod _create_volume_input;
499
500mod _create_volume_output;
501
502/// Builders
503pub mod builders;