Skip to main content

aws_sdk_datasync/operation/
create_location_fsx_windows.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateLocationFsxWindows`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateLocationFsxWindows;
6impl CreateLocationFsxWindows {
7    /// Creates a new `CreateLocationFsxWindows`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13        crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsInput,
20    ) -> ::std::result::Result<
21        crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError,
24            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25        >,
26    > {
27        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
28            ::aws_smithy_runtime_api::client::interceptors::context::Error,
29            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
30        >| {
31            err.map_service_error(|err| {
32                err.downcast::<crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError>()
33                    .expect("correct error type")
34            })
35        };
36        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
37            .await
38            .map_err(map_err)?;
39        let output = context.finalize().map_err(map_err)?;
40        ::std::result::Result::Ok(
41            output
42                .downcast::<crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsOutput>()
43                .expect("correct output type"),
44        )
45    }
46
47    pub(crate) async fn orchestrate_with_stop_point(
48        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
49        input: crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsInput,
50        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
51    ) -> ::std::result::Result<
52        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
53        ::aws_smithy_runtime_api::client::result::SdkError<
54            ::aws_smithy_runtime_api::client::interceptors::context::Error,
55            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
56        >,
57    > {
58        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
59        use ::tracing::Instrument;
60        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("DataSync", "CreateLocationFsxWindows", input, runtime_plugins, stop_point)
61            // Create a parent span for the entire operation. Includes a random, internal-only,
62            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63            .instrument(::tracing::debug_span!(
64                "DataSync.CreateLocationFsxWindows",
65                "rpc.service" = "DataSync",
66                "rpc.method" = "CreateLocationFsxWindows",
67                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68                "rpc.system" = "aws-api",
69            ))
70            .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93/// Per-operation error registry. Contains an entry for every modeled
94/// error this operation can throw.
95///
96/// Used by the schema-serde error path as the operation-scoped lookup
97/// for registry-backed error reification: an error code that does not
98/// match one of the operation's modeled errors directly is resolved
99/// against this registry first, then widened to the service-wide error
100/// registry.
101pub(crate) mod error_registry {
102    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
103        ::aws_smithy_schema::registry::TypeRegistry::builder()
104                            .insert_error_shape(
105                        crate::types::error::InternalException::SCHEMA,
106                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
107                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalException::deserialize(d)?))
108                        },
109                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
110                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalException::deserialize(d)?))
111                        },
112                    )
113.insert_error_shape(
114                        crate::types::error::InvalidRequestException::SCHEMA,
115                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
116                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidRequestException::deserialize(d)?))
117                        },
118                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
119                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidRequestException::deserialize(d)?))
120                        },
121                    )
122                            .build()
123    });
124}
125impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateLocationFsxWindows {
126    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
127        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateLocationFsxWindows");
128
129        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
130            CreateLocationFsxWindowsRequestSerializer,
131        ));
132        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
133            CreateLocationFsxWindowsResponseDeserializer,
134        ));
135
136        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
137            crate::config::auth::Params::builder()
138                .operation_name("CreateLocationFsxWindows")
139                .build()
140                .expect("required fields set"),
141        ));
142
143        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
144            "CreateLocationFsxWindows",
145            "DataSync",
146        ));
147        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
148        signing_options.double_uri_encode = true;
149        signing_options.content_sha256_header = false;
150        signing_options.normalize_uri_path = true;
151        signing_options.payload_override = None;
152
153        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
154            signing_options,
155            ..::std::default::Default::default()
156        });
157
158        ::std::option::Option::Some(cfg.freeze())
159    }
160
161    fn runtime_components(
162        &self,
163        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
164    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
165        #[allow(unused_mut)]
166        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateLocationFsxWindows")
167            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
168                CreateLocationFsxWindowsTelemetryInputCaptureInterceptor,
169            ))
170            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
171                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
172            ))
173            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
174                CreateLocationFsxWindowsEndpointParamsInterceptor,
175            ))
176            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
177                crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError,
178            >::new())
179            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
180                crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError,
181            >::new())
182            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
183                crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError,
184            >::new())
185            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
186                crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError,
187            >::new());
188
189        ::std::borrow::Cow::Owned(rcb)
190    }
191}
192
193#[derive(Debug)]
194struct CreateLocationFsxWindowsTelemetryInputCaptureInterceptor;
195
196#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
197impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateLocationFsxWindowsTelemetryInputCaptureInterceptor {
198    fn name(&self) -> &'static str {
199        "CreateLocationFsxWindowsTelemetryInputCaptureInterceptor"
200    }
201
202    fn read_before_execution(
203        &self,
204        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
205            '_,
206            ::aws_smithy_runtime_api::client::interceptors::context::Input,
207            ::aws_smithy_runtime_api::client::interceptors::context::Output,
208            ::aws_smithy_runtime_api::client::interceptors::context::Error,
209        >,
210        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
211    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
212        // Nothing to do unless the customer opted in by naming members to record.
213        let ::std::option::Option::Some(requested) = cfg
214            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
215            .filter(|r| !r.is_empty())
216        else {
217            return ::std::result::Result::Ok(());
218        };
219
220        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateLocationFsxWindowsInput>() else {
221            // A mismatched input is not this interceptor's concern; skip quietly.
222            return ::std::result::Result::Ok(());
223        };
224
225        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
226        if requested.should_capture("Subdirectory") {
227            if let ::std::option::Option::Some(value) = input.subdirectory.as_deref() {
228                captured.insert("Subdirectory", value);
229            }
230        }
231        if requested.should_capture("FsxFilesystemArn") {
232            if let ::std::option::Option::Some(value) = input.fsx_filesystem_arn.as_deref() {
233                captured.insert("FsxFilesystemArn", value);
234            }
235        }
236        if requested.should_capture("User") {
237            if let ::std::option::Option::Some(value) = input.user.as_deref() {
238                captured.insert("User", value);
239            }
240        }
241        if requested.should_capture("Domain") {
242            if let ::std::option::Option::Some(value) = input.domain.as_deref() {
243                captured.insert("Domain", value);
244            }
245        }
246
247        cfg.interceptor_state().store_put(captured);
248        ::std::result::Result::Ok(())
249    }
250}
251#[derive(Debug)]
252struct CreateLocationFsxWindowsResponseDeserializer;
253impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateLocationFsxWindowsResponseDeserializer {
254    fn deserialize_nonstreaming_with_config(
255        &self,
256        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
257        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
258    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
259        let (success, status) = (response.status().is_success(), response.status().as_u16());
260        // Load body and headers BEFORE BeforeParseResponse so customizations
261        // (e.g., S3's `body_is_error` check that detects errors returned with
262        // HTTP 200) can inspect them. The legacy non-streaming path also
263        // loads `body` before firing this hook.
264        #[allow(unused_variables)]
265        let body = response.body().bytes().expect("body loaded");
266        let headers = response.headers();
267        #[allow(unused_mut)]
268        let mut force_error = false;
269        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
270        if !success && status != 200 || force_error {
271            let protocol = _cfg
272                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
273                .expect("a SharedClientProtocol is required");
274            #[allow(unused_mut)]
275            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
276                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
277            })?;
278            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
279            let generic = generic_builder.build();
280            let error_code = match generic.code() {
281                ::std::option::Option::Some(code) => code,
282                ::std::option::Option::None => {
283                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
284                        ::aws_smithy_runtime_api::box_error::BoxError::from(
285                            crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError::unhandled(generic),
286                        ),
287                    ))
288                }
289            };
290            let _error_message = generic.message().map(|msg| msg.to_owned());
291            let err = match error_code {
292                "InternalException" => crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError::InternalException({
293                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
294                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
295                            e,
296                        ))
297                    })?;
298                    let mut tmp = <crate::types::error::builders::InternalExceptionBuilder>::default();
299                    tmp.deserialize_members(&mut *deser).map_err(|e| {
300                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
301                            e,
302                        ))
303                    })?;
304                    if tmp.message.is_none() {
305                        tmp.message = _error_message;
306                    }
307                    let tmp = tmp.meta(generic);
308                    tmp.build()
309                }),
310                "InvalidRequestException" => crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError::InvalidRequestException({
311                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
312                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
313                            e,
314                        ))
315                    })?;
316                    let mut tmp = <crate::types::error::builders::InvalidRequestExceptionBuilder>::default();
317                    tmp.deserialize_members(&mut *deser).map_err(|e| {
318                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
319                            e,
320                        ))
321                    })?;
322                    if tmp.message.is_none() {
323                        tmp.message = _error_message;
324                    }
325                    let tmp = tmp.meta(generic);
326                    tmp.build()
327                }),
328                _ => {
329                    // Registry-backed, operation-scoped reification of an error whose
330                    // code this operation does not model directly: the operation's own
331                    // error registry is consulted first, then the lookup widens to the
332                    // service-wide error registry. On a hit, the reified error is attached
333                    // as the source of the returned unhandled error while its metadata
334                    // (code, message, request id) is preserved; on a miss the generic
335                    // error is returned unchanged.
336                    match protocol
337                        .deserialize_error_response(response, _cfg)
338                        .ok()
339                        .and_then(|mut deser| {
340                            ::aws_smithy_schema::registry::reify_error(
341                                crate::operation::create_location_fsx_windows::error_registry::REGISTRY
342                                    .or(&crate::error_type_registry::REGISTRY),
343                                error_code,
344                                &mut *deser,
345                            )
346                        }) {
347                        ::std::option::Option::Some(source) => <crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
348                        ::std::option::Option::None => crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError::generic(generic),
349                    }
350                }
351            };
352            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
353                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
354            ))
355        } else {
356            let protocol = _cfg
357                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
358                .expect("a SharedClientProtocol is required");
359            let mut deser = protocol
360                .deserialize_response(response, CreateLocationFsxWindows::OUTPUT_SCHEMA, _cfg)
361                .map_err(|e| {
362                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
363                })?;
364            // `headers` is already in scope from the top of the function; alias it as
365            // `_response_headers` so MutateOutput customizations have a stable name to
366            // read from.
367            let _response_headers = headers;
368            // `mut` is required because `deserialize_members` and the `MutateOutput`
369            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
370            // empty output has no members and no customizations to run.
371            #[allow(unused_mut)]
372            let mut output = <crate::operation::create_location_fsx_windows::builders::CreateLocationFsxWindowsOutputBuilder>::default();
373            output.deserialize_members(&mut *deser).map_err(|e| {
374                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
375            })?;
376            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
377            let output = output.build();
378            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
379        }
380    }
381}
382#[derive(Debug)]
383struct CreateLocationFsxWindowsRequestSerializer;
384impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateLocationFsxWindowsRequestSerializer {
385    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
386    fn serialize_input(
387        &self,
388        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
389        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
390    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
391        let input = input
392            .downcast::<crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsInput>()
393            .expect("correct type");
394
395        let protocol = _cfg
396            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
397            .expect("a SharedClientProtocol is required");
398        let mut request = protocol
399            .serialize_request(&input, CreateLocationFsxWindows::INPUT_SCHEMA, "/", _cfg)
400            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
401
402        return ::std::result::Result::Ok(request);
403    }
404}
405#[derive(Debug)]
406struct CreateLocationFsxWindowsEndpointParamsInterceptor;
407
408#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
409impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateLocationFsxWindowsEndpointParamsInterceptor {
410    fn name(&self) -> &'static str {
411        "CreateLocationFsxWindowsEndpointParamsInterceptor"
412    }
413
414    fn read_before_execution(
415        &self,
416        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
417            '_,
418            ::aws_smithy_runtime_api::client::interceptors::context::Input,
419            ::aws_smithy_runtime_api::client::interceptors::context::Output,
420            ::aws_smithy_runtime_api::client::interceptors::context::Error,
421        >,
422        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
423    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
424        let _input = context
425            .input()
426            .downcast_ref::<CreateLocationFsxWindowsInput>()
427            .ok_or("failed to downcast to CreateLocationFsxWindowsInput")?;
428
429        let params = crate::config::endpoint::Params::builder()
430            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
431            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
432            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
433            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
434            .build()
435            .map_err(|err| {
436                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
437            })?;
438        cfg.interceptor_state()
439            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
440        ::std::result::Result::Ok(())
441    }
442}
443
444// The get_* functions below are generated from JMESPath expressions in the
445// operationContextParams trait. They target the operation's input shape.
446
447/// Error type for the `CreateLocationFsxWindowsError` operation.
448#[non_exhaustive]
449#[derive(::std::fmt::Debug)]
450pub enum CreateLocationFsxWindowsError {
451    /// <p>This exception is thrown when an error occurs in the DataSync service.</p>
452    InternalException(crate::types::error::InternalException),
453    /// <p>This exception is thrown when the client submits a malformed request.</p>
454    InvalidRequestException(crate::types::error::InvalidRequestException),
455    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
456    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
457    variable wildcard pattern and check `.code()`:
458     \
459    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
460     \
461    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateLocationFsxWindowsError) for what information is available for the error.")]
462    Unhandled(crate::error::sealed_unhandled::Unhandled),
463}
464impl CreateLocationFsxWindowsError {
465    /// Creates the `CreateLocationFsxWindowsError::Unhandled` variant from any error type.
466    pub fn unhandled(
467        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
468    ) -> Self {
469        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
470            source: err.into(),
471            meta: ::std::default::Default::default(),
472        })
473    }
474
475    /// Creates the `CreateLocationFsxWindowsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
476    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
477        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
478            source: err.clone().into(),
479            meta: err,
480        })
481    }
482    ///
483    /// Returns error metadata, which includes the error code, message,
484    /// request ID, and potentially additional information.
485    ///
486    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
487        match self {
488            Self::InternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
489            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
490            Self::Unhandled(e) => &e.meta,
491        }
492    }
493    /// Returns `true` if the error kind is `CreateLocationFsxWindowsError::InternalException`.
494    pub fn is_internal_exception(&self) -> bool {
495        matches!(self, Self::InternalException(_))
496    }
497    /// Returns `true` if the error kind is `CreateLocationFsxWindowsError::InvalidRequestException`.
498    pub fn is_invalid_request_exception(&self) -> bool {
499        matches!(self, Self::InvalidRequestException(_))
500    }
501}
502impl ::std::error::Error for CreateLocationFsxWindowsError {
503    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
504        match self {
505            Self::InternalException(_inner) => ::std::option::Option::Some(_inner),
506            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
507            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
508        }
509    }
510}
511impl ::std::fmt::Display for CreateLocationFsxWindowsError {
512    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
513        match self {
514            Self::InternalException(_inner) => _inner.fmt(f),
515            Self::InvalidRequestException(_inner) => _inner.fmt(f),
516            Self::Unhandled(_inner) => {
517                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
518                    write!(f, "unhandled error ({code})")
519                } else {
520                    f.write_str("unhandled error")
521                }
522            }
523        }
524    }
525}
526impl ::aws_smithy_types::retry::ProvideErrorKind for CreateLocationFsxWindowsError {
527    fn code(&self) -> ::std::option::Option<&str> {
528        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
529    }
530    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
531        ::std::option::Option::None
532    }
533}
534impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateLocationFsxWindowsError {
535    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
536        match self {
537            Self::InternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
538            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
539            Self::Unhandled(_inner) => &_inner.meta,
540        }
541    }
542}
543impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateLocationFsxWindowsError {
544    fn create_unhandled_error(
545        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
546        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
547    ) -> Self {
548        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
549            source,
550            meta: meta.unwrap_or_default(),
551        })
552    }
553}
554impl ::aws_types::request_id::RequestId for crate::operation::create_location_fsx_windows::CreateLocationFsxWindowsError {
555    fn request_id(&self) -> Option<&str> {
556        self.meta().request_id()
557    }
558}
559
560pub use crate::operation::create_location_fsx_windows::_create_location_fsx_windows_input::CreateLocationFsxWindowsInput;
561
562pub use crate::operation::create_location_fsx_windows::_create_location_fsx_windows_output::CreateLocationFsxWindowsOutput;
563
564mod _create_location_fsx_windows_input;
565
566mod _create_location_fsx_windows_output;
567
568/// Builders
569pub mod builders;