aws_sdk_datasync/operation/
create_location_fsx_open_zfs.rs1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateLocationFsxOpenZfs;
6impl CreateLocationFsxOpenZfs {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsInput::SCHEMA;
14 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsOutput::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_open_zfs::CreateLocationFsxOpenZfsInput,
20 ) -> ::std::result::Result<
21 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsOutput,
22 ::aws_smithy_runtime_api::client::result::SdkError<
23 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError,
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_open_zfs::CreateLocationFsxOpenZfsError>()
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_open_zfs::CreateLocationFsxOpenZfsOutput>()
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_open_zfs::CreateLocationFsxOpenZfsInput,
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", "CreateLocationFsxOpenZfs", input, runtime_plugins, stop_point)
61 .instrument(::tracing::debug_span!(
64 "DataSync.CreateLocationFsxOpenZfs",
65 "rpc.service" = "DataSync",
66 "rpc.method" = "CreateLocationFsxOpenZfs",
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}
93pub(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 CreateLocationFsxOpenZfs {
126 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
127 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateLocationFsxOpenZfs");
128
129 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
130 CreateLocationFsxOpenZfsRequestSerializer,
131 ));
132 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
133 CreateLocationFsxOpenZfsResponseDeserializer,
134 ));
135
136 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
137 crate::config::auth::Params::builder()
138 .operation_name("CreateLocationFsxOpenZfs")
139 .build()
140 .expect("required fields set"),
141 ));
142
143 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
144 "CreateLocationFsxOpenZfs",
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("CreateLocationFsxOpenZfs")
167 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
168 CreateLocationFsxOpenZfsTelemetryInputCaptureInterceptor,
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 CreateLocationFsxOpenZfsEndpointParamsInterceptor,
175 ))
176 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
177 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError,
178 >::new())
179 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
180 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError,
181 >::new())
182 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
183 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError,
184 >::new())
185 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
186 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError,
187 >::new());
188
189 ::std::borrow::Cow::Owned(rcb)
190 }
191}
192
193#[derive(Debug)]
194struct CreateLocationFsxOpenZfsTelemetryInputCaptureInterceptor;
195
196#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
197impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateLocationFsxOpenZfsTelemetryInputCaptureInterceptor {
198 fn name(&self) -> &'static str {
199 "CreateLocationFsxOpenZfsTelemetryInputCaptureInterceptor"
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 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::<CreateLocationFsxOpenZfsInput>() else {
221 return ::std::result::Result::Ok(());
223 };
224
225 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
226 if requested.should_capture("FsxFilesystemArn") {
227 if let ::std::option::Option::Some(value) = input.fsx_filesystem_arn.as_deref() {
228 captured.insert("FsxFilesystemArn", value);
229 }
230 }
231 if requested.should_capture("Subdirectory") {
232 if let ::std::option::Option::Some(value) = input.subdirectory.as_deref() {
233 captured.insert("Subdirectory", value);
234 }
235 }
236
237 cfg.interceptor_state().store_put(captured);
238 ::std::result::Result::Ok(())
239 }
240}
241#[derive(Debug)]
242struct CreateLocationFsxOpenZfsResponseDeserializer;
243impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateLocationFsxOpenZfsResponseDeserializer {
244 fn deserialize_nonstreaming_with_config(
245 &self,
246 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
247 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
248 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
249 let (success, status) = (response.status().is_success(), response.status().as_u16());
250 #[allow(unused_variables)]
255 let body = response.body().bytes().expect("body loaded");
256 let headers = response.headers();
257 #[allow(unused_mut)]
258 let mut force_error = false;
259 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
260 if !success && status != 200 || force_error {
261 let protocol = _cfg
262 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
263 .expect("a SharedClientProtocol is required");
264 #[allow(unused_mut)]
265 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
266 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
267 })?;
268 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
269 let generic = generic_builder.build();
270 let error_code = match generic.code() {
271 ::std::option::Option::Some(code) => code,
272 ::std::option::Option::None => {
273 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
274 ::aws_smithy_runtime_api::box_error::BoxError::from(
275 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError::unhandled(generic),
276 ),
277 ))
278 }
279 };
280 let _error_message = generic.message().map(|msg| msg.to_owned());
281 let err = match error_code {
282 "InternalException" => crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError::InternalException({
283 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
284 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
285 e,
286 ))
287 })?;
288 let mut tmp = <crate::types::error::builders::InternalExceptionBuilder>::default();
289 tmp.deserialize_members(&mut *deser).map_err(|e| {
290 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
291 e,
292 ))
293 })?;
294 if tmp.message.is_none() {
295 tmp.message = _error_message;
296 }
297 let tmp = tmp.meta(generic);
298 tmp.build()
299 }),
300 "InvalidRequestException" => {
301 crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError::InvalidRequestException({
302 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
303 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
304 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
305 )
306 })?;
307 let mut tmp = <crate::types::error::builders::InvalidRequestExceptionBuilder>::default();
308 tmp.deserialize_members(&mut *deser).map_err(|e| {
309 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
310 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
311 )
312 })?;
313 if tmp.message.is_none() {
314 tmp.message = _error_message;
315 }
316 let tmp = tmp.meta(generic);
317 tmp.build()
318 })
319 }
320 _ => {
321 match protocol
329 .deserialize_error_response(response, _cfg)
330 .ok()
331 .and_then(|mut deser| {
332 ::aws_smithy_schema::registry::reify_error(
333 crate::operation::create_location_fsx_open_zfs::error_registry::REGISTRY
334 .or(&crate::error_type_registry::REGISTRY),
335 error_code,
336 &mut *deser,
337 )
338 }) {
339 ::std::option::Option::Some(source) => <crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
340 ::std::option::Option::None => crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError::generic(generic),
341 }
342 }
343 };
344 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
345 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
346 ))
347 } else {
348 let protocol = _cfg
349 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
350 .expect("a SharedClientProtocol is required");
351 let mut deser = protocol
352 .deserialize_response(response, CreateLocationFsxOpenZfs::OUTPUT_SCHEMA, _cfg)
353 .map_err(|e| {
354 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
355 })?;
356 let _response_headers = headers;
360 #[allow(unused_mut)]
364 let mut output = <crate::operation::create_location_fsx_open_zfs::builders::CreateLocationFsxOpenZfsOutputBuilder>::default();
365 output.deserialize_members(&mut *deser).map_err(|e| {
366 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
367 })?;
368 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
369 let output = output.build();
370 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
371 }
372 }
373}
374#[derive(Debug)]
375struct CreateLocationFsxOpenZfsRequestSerializer;
376impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateLocationFsxOpenZfsRequestSerializer {
377 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
378 fn serialize_input(
379 &self,
380 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
381 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
382 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
383 let input = input
384 .downcast::<crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsInput>()
385 .expect("correct type");
386
387 let protocol = _cfg
388 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
389 .expect("a SharedClientProtocol is required");
390 let mut request = protocol
391 .serialize_request(&input, CreateLocationFsxOpenZfs::INPUT_SCHEMA, "/", _cfg)
392 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
393
394 return ::std::result::Result::Ok(request);
395 }
396}
397#[derive(Debug)]
398struct CreateLocationFsxOpenZfsEndpointParamsInterceptor;
399
400#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
401impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateLocationFsxOpenZfsEndpointParamsInterceptor {
402 fn name(&self) -> &'static str {
403 "CreateLocationFsxOpenZfsEndpointParamsInterceptor"
404 }
405
406 fn read_before_execution(
407 &self,
408 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
409 '_,
410 ::aws_smithy_runtime_api::client::interceptors::context::Input,
411 ::aws_smithy_runtime_api::client::interceptors::context::Output,
412 ::aws_smithy_runtime_api::client::interceptors::context::Error,
413 >,
414 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
415 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
416 let _input = context
417 .input()
418 .downcast_ref::<CreateLocationFsxOpenZfsInput>()
419 .ok_or("failed to downcast to CreateLocationFsxOpenZfsInput")?;
420
421 let params = crate::config::endpoint::Params::builder()
422 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
423 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
424 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
425 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
426 .build()
427 .map_err(|err| {
428 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
429 })?;
430 cfg.interceptor_state()
431 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
432 ::std::result::Result::Ok(())
433 }
434}
435
436#[non_exhaustive]
441#[derive(::std::fmt::Debug)]
442pub enum CreateLocationFsxOpenZfsError {
443 InternalException(crate::types::error::InternalException),
445 InvalidRequestException(crate::types::error::InvalidRequestException),
447 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
449 variable wildcard pattern and check `.code()`:
450 \
451 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
452 \
453 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateLocationFsxOpenZfsError) for what information is available for the error.")]
454 Unhandled(crate::error::sealed_unhandled::Unhandled),
455}
456impl CreateLocationFsxOpenZfsError {
457 pub fn unhandled(
459 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
460 ) -> Self {
461 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
462 source: err.into(),
463 meta: ::std::default::Default::default(),
464 })
465 }
466
467 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
469 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
470 source: err.clone().into(),
471 meta: err,
472 })
473 }
474 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
479 match self {
480 Self::InternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
481 Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
482 Self::Unhandled(e) => &e.meta,
483 }
484 }
485 pub fn is_internal_exception(&self) -> bool {
487 matches!(self, Self::InternalException(_))
488 }
489 pub fn is_invalid_request_exception(&self) -> bool {
491 matches!(self, Self::InvalidRequestException(_))
492 }
493}
494impl ::std::error::Error for CreateLocationFsxOpenZfsError {
495 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
496 match self {
497 Self::InternalException(_inner) => ::std::option::Option::Some(_inner),
498 Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
499 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
500 }
501 }
502}
503impl ::std::fmt::Display for CreateLocationFsxOpenZfsError {
504 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
505 match self {
506 Self::InternalException(_inner) => _inner.fmt(f),
507 Self::InvalidRequestException(_inner) => _inner.fmt(f),
508 Self::Unhandled(_inner) => {
509 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
510 write!(f, "unhandled error ({code})")
511 } else {
512 f.write_str("unhandled error")
513 }
514 }
515 }
516 }
517}
518impl ::aws_smithy_types::retry::ProvideErrorKind for CreateLocationFsxOpenZfsError {
519 fn code(&self) -> ::std::option::Option<&str> {
520 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
521 }
522 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
523 ::std::option::Option::None
524 }
525}
526impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateLocationFsxOpenZfsError {
527 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
528 match self {
529 Self::InternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
530 Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
531 Self::Unhandled(_inner) => &_inner.meta,
532 }
533 }
534}
535impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateLocationFsxOpenZfsError {
536 fn create_unhandled_error(
537 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
538 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
539 ) -> Self {
540 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
541 source,
542 meta: meta.unwrap_or_default(),
543 })
544 }
545}
546impl ::aws_types::request_id::RequestId for crate::operation::create_location_fsx_open_zfs::CreateLocationFsxOpenZfsError {
547 fn request_id(&self) -> Option<&str> {
548 self.meta().request_id()
549 }
550}
551
552pub use crate::operation::create_location_fsx_open_zfs::_create_location_fsx_open_zfs_input::CreateLocationFsxOpenZfsInput;
553
554pub use crate::operation::create_location_fsx_open_zfs::_create_location_fsx_open_zfs_output::CreateLocationFsxOpenZfsOutput;
555
556mod _create_location_fsx_open_zfs_input;
557
558mod _create_location_fsx_open_zfs_output;
559
560pub mod builders;