aws_sdk_fis/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>The request could not be processed because of a conflict.</p>
7    ConflictException(crate::types::error::ConflictException),
8    /// <p>The specified resource cannot be found.</p>
9    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
10    /// <p>You have exceeded your service quota.</p>
11    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
12    /// <p>The specified input is not valid, or fails to satisfy the constraints for the request.</p>
13    ValidationException(crate::types::error::ValidationException),
14    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
15    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
16    variable wildcard pattern and check `.code()`:
17     \
18    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
19     \
20    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
21    Unhandled(crate::error::sealed_unhandled::Unhandled),
22}
23impl ::std::fmt::Display for Error {
24    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25        match self {
26            Error::ConflictException(inner) => inner.fmt(f),
27            Error::ResourceNotFoundException(inner) => inner.fmt(f),
28            Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
29            Error::ValidationException(inner) => inner.fmt(f),
30            Error::Unhandled(_) => {
31                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
32                    write!(f, "unhandled error ({code})")
33                } else {
34                    f.write_str("unhandled error")
35                }
36            }
37        }
38    }
39}
40impl From<::aws_smithy_types::error::operation::BuildError> for Error {
41    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
42        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
43            source: value.into(),
44            meta: ::std::default::Default::default(),
45        })
46    }
47}
48impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
49    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
50        match self {
51            Self::ConflictException(inner) => inner.meta(),
52            Self::ResourceNotFoundException(inner) => inner.meta(),
53            Self::ServiceQuotaExceededException(inner) => inner.meta(),
54            Self::ValidationException(inner) => inner.meta(),
55            Self::Unhandled(inner) => &inner.meta,
56        }
57    }
58}
59impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_experiment_template::CreateExperimentTemplateError, R>>
60    for Error
61where
62    R: Send + Sync + std::fmt::Debug + 'static,
63{
64    fn from(
65        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_experiment_template::CreateExperimentTemplateError, R>,
66    ) -> Self {
67        match err {
68            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
69            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
70                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
71                source: err.into(),
72            }),
73        }
74    }
75}
76impl From<crate::operation::create_experiment_template::CreateExperimentTemplateError> for Error {
77    fn from(err: crate::operation::create_experiment_template::CreateExperimentTemplateError) -> Self {
78        match err {
79            crate::operation::create_experiment_template::CreateExperimentTemplateError::ConflictException(inner) => Error::ConflictException(inner),
80            crate::operation::create_experiment_template::CreateExperimentTemplateError::ResourceNotFoundException(inner) => {
81                Error::ResourceNotFoundException(inner)
82            }
83            crate::operation::create_experiment_template::CreateExperimentTemplateError::ServiceQuotaExceededException(inner) => {
84                Error::ServiceQuotaExceededException(inner)
85            }
86            crate::operation::create_experiment_template::CreateExperimentTemplateError::ValidationException(inner) => {
87                Error::ValidationException(inner)
88            }
89            crate::operation::create_experiment_template::CreateExperimentTemplateError::Unhandled(inner) => Error::Unhandled(inner),
90        }
91    }
92}
93impl<R>
94    From<
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError,
97            R,
98        >,
99    > for Error
100where
101    R: Send + Sync + std::fmt::Debug + 'static,
102{
103    fn from(
104        err: ::aws_smithy_runtime_api::client::result::SdkError<
105            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError,
106            R,
107        >,
108    ) -> Self {
109        match err {
110            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
111            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
112                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
113                source: err.into(),
114            }),
115        }
116    }
117}
118impl From<crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError> for Error {
119    fn from(err: crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError) -> Self {
120        match err {
121            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError::ConflictException(inner) => {
122                Error::ConflictException(inner)
123            }
124            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError::ResourceNotFoundException(inner) => {
125                Error::ResourceNotFoundException(inner)
126            }
127            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError::ServiceQuotaExceededException(inner) => {
128                Error::ServiceQuotaExceededException(inner)
129            }
130            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError::ValidationException(inner) => {
131                Error::ValidationException(inner)
132            }
133            crate::operation::create_target_account_configuration::CreateTargetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
134        }
135    }
136}
137impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_experiment_template::DeleteExperimentTemplateError, R>>
138    for Error
139where
140    R: Send + Sync + std::fmt::Debug + 'static,
141{
142    fn from(
143        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_experiment_template::DeleteExperimentTemplateError, R>,
144    ) -> Self {
145        match err {
146            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
147            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
148                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
149                source: err.into(),
150            }),
151        }
152    }
153}
154impl From<crate::operation::delete_experiment_template::DeleteExperimentTemplateError> for Error {
155    fn from(err: crate::operation::delete_experiment_template::DeleteExperimentTemplateError) -> Self {
156        match err {
157            crate::operation::delete_experiment_template::DeleteExperimentTemplateError::ResourceNotFoundException(inner) => {
158                Error::ResourceNotFoundException(inner)
159            }
160            crate::operation::delete_experiment_template::DeleteExperimentTemplateError::ValidationException(inner) => {
161                Error::ValidationException(inner)
162            }
163            crate::operation::delete_experiment_template::DeleteExperimentTemplateError::Unhandled(inner) => Error::Unhandled(inner),
164        }
165    }
166}
167impl<R>
168    From<
169        ::aws_smithy_runtime_api::client::result::SdkError<
170            crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError,
171            R,
172        >,
173    > for Error
174where
175    R: Send + Sync + std::fmt::Debug + 'static,
176{
177    fn from(
178        err: ::aws_smithy_runtime_api::client::result::SdkError<
179            crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError,
180            R,
181        >,
182    ) -> Self {
183        match err {
184            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
185            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
186                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
187                source: err.into(),
188            }),
189        }
190    }
191}
192impl From<crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError> for Error {
193    fn from(err: crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError) -> Self {
194        match err {
195            crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError::ResourceNotFoundException(inner) => {
196                Error::ResourceNotFoundException(inner)
197            }
198            crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError::ValidationException(inner) => {
199                Error::ValidationException(inner)
200            }
201            crate::operation::delete_target_account_configuration::DeleteTargetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
202        }
203    }
204}
205impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_action::GetActionError, R>> for Error
206where
207    R: Send + Sync + std::fmt::Debug + 'static,
208{
209    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_action::GetActionError, R>) -> Self {
210        match err {
211            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
212            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
213                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
214                source: err.into(),
215            }),
216        }
217    }
218}
219impl From<crate::operation::get_action::GetActionError> for Error {
220    fn from(err: crate::operation::get_action::GetActionError) -> Self {
221        match err {
222            crate::operation::get_action::GetActionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
223            crate::operation::get_action::GetActionError::ValidationException(inner) => Error::ValidationException(inner),
224            crate::operation::get_action::GetActionError::Unhandled(inner) => Error::Unhandled(inner),
225        }
226    }
227}
228impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_experiment::GetExperimentError, R>> for Error
229where
230    R: Send + Sync + std::fmt::Debug + 'static,
231{
232    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_experiment::GetExperimentError, R>) -> Self {
233        match err {
234            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
235            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
236                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
237                source: err.into(),
238            }),
239        }
240    }
241}
242impl From<crate::operation::get_experiment::GetExperimentError> for Error {
243    fn from(err: crate::operation::get_experiment::GetExperimentError) -> Self {
244        match err {
245            crate::operation::get_experiment::GetExperimentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
246            crate::operation::get_experiment::GetExperimentError::ValidationException(inner) => Error::ValidationException(inner),
247            crate::operation::get_experiment::GetExperimentError::Unhandled(inner) => Error::Unhandled(inner),
248        }
249    }
250}
251impl<R>
252    From<
253        ::aws_smithy_runtime_api::client::result::SdkError<
254            crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError,
255            R,
256        >,
257    > for Error
258where
259    R: Send + Sync + std::fmt::Debug + 'static,
260{
261    fn from(
262        err: ::aws_smithy_runtime_api::client::result::SdkError<
263            crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError,
264            R,
265        >,
266    ) -> Self {
267        match err {
268            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
269            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
270                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
271                source: err.into(),
272            }),
273        }
274    }
275}
276impl From<crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError> for Error {
277    fn from(err: crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError) -> Self {
278        match err {
279            crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
280            crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError::ValidationException(inner) => Error::ValidationException(inner),
281            crate::operation::get_experiment_target_account_configuration::GetExperimentTargetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
282        }
283    }
284}
285impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_experiment_template::GetExperimentTemplateError, R>> for Error
286where
287    R: Send + Sync + std::fmt::Debug + 'static,
288{
289    fn from(
290        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_experiment_template::GetExperimentTemplateError, R>,
291    ) -> Self {
292        match err {
293            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
294            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
295                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
296                source: err.into(),
297            }),
298        }
299    }
300}
301impl From<crate::operation::get_experiment_template::GetExperimentTemplateError> for Error {
302    fn from(err: crate::operation::get_experiment_template::GetExperimentTemplateError) -> Self {
303        match err {
304            crate::operation::get_experiment_template::GetExperimentTemplateError::ResourceNotFoundException(inner) => {
305                Error::ResourceNotFoundException(inner)
306            }
307            crate::operation::get_experiment_template::GetExperimentTemplateError::ValidationException(inner) => Error::ValidationException(inner),
308            crate::operation::get_experiment_template::GetExperimentTemplateError::Unhandled(inner) => Error::Unhandled(inner),
309        }
310    }
311}
312impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_safety_lever::GetSafetyLeverError, R>> for Error
313where
314    R: Send + Sync + std::fmt::Debug + 'static,
315{
316    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_safety_lever::GetSafetyLeverError, R>) -> Self {
317        match err {
318            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
319            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
320                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
321                source: err.into(),
322            }),
323        }
324    }
325}
326impl From<crate::operation::get_safety_lever::GetSafetyLeverError> for Error {
327    fn from(err: crate::operation::get_safety_lever::GetSafetyLeverError) -> Self {
328        match err {
329            crate::operation::get_safety_lever::GetSafetyLeverError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
330            crate::operation::get_safety_lever::GetSafetyLeverError::Unhandled(inner) => Error::Unhandled(inner),
331        }
332    }
333}
334impl<R>
335    From<
336        ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError, R>,
337    > for Error
338where
339    R: Send + Sync + std::fmt::Debug + 'static,
340{
341    fn from(
342        err: ::aws_smithy_runtime_api::client::result::SdkError<
343            crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError,
344            R,
345        >,
346    ) -> Self {
347        match err {
348            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
349            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
350                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
351                source: err.into(),
352            }),
353        }
354    }
355}
356impl From<crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError> for Error {
357    fn from(err: crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError) -> Self {
358        match err {
359            crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError::ResourceNotFoundException(inner) => {
360                Error::ResourceNotFoundException(inner)
361            }
362            crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError::ValidationException(inner) => {
363                Error::ValidationException(inner)
364            }
365            crate::operation::get_target_account_configuration::GetTargetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
366        }
367    }
368}
369impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_target_resource_type::GetTargetResourceTypeError, R>> for Error
370where
371    R: Send + Sync + std::fmt::Debug + 'static,
372{
373    fn from(
374        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_target_resource_type::GetTargetResourceTypeError, R>,
375    ) -> Self {
376        match err {
377            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
378            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
379                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
380                source: err.into(),
381            }),
382        }
383    }
384}
385impl From<crate::operation::get_target_resource_type::GetTargetResourceTypeError> for Error {
386    fn from(err: crate::operation::get_target_resource_type::GetTargetResourceTypeError) -> Self {
387        match err {
388            crate::operation::get_target_resource_type::GetTargetResourceTypeError::ResourceNotFoundException(inner) => {
389                Error::ResourceNotFoundException(inner)
390            }
391            crate::operation::get_target_resource_type::GetTargetResourceTypeError::ValidationException(inner) => Error::ValidationException(inner),
392            crate::operation::get_target_resource_type::GetTargetResourceTypeError::Unhandled(inner) => Error::Unhandled(inner),
393        }
394    }
395}
396impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_actions::ListActionsError, R>> for Error
397where
398    R: Send + Sync + std::fmt::Debug + 'static,
399{
400    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_actions::ListActionsError, R>) -> Self {
401        match err {
402            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
403            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
404                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
405                source: err.into(),
406            }),
407        }
408    }
409}
410impl From<crate::operation::list_actions::ListActionsError> for Error {
411    fn from(err: crate::operation::list_actions::ListActionsError) -> Self {
412        match err {
413            crate::operation::list_actions::ListActionsError::ValidationException(inner) => Error::ValidationException(inner),
414            crate::operation::list_actions::ListActionsError::Unhandled(inner) => Error::Unhandled(inner),
415        }
416    }
417}
418impl<R>
419    From<
420        ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError, R>,
421    > for Error
422where
423    R: Send + Sync + std::fmt::Debug + 'static,
424{
425    fn from(
426        err: ::aws_smithy_runtime_api::client::result::SdkError<
427            crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError,
428            R,
429        >,
430    ) -> Self {
431        match err {
432            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
433            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
434                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
435                source: err.into(),
436            }),
437        }
438    }
439}
440impl From<crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError> for Error {
441    fn from(err: crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError) -> Self {
442        match err {
443            crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError::ResourceNotFoundException(inner) => {
444                Error::ResourceNotFoundException(inner)
445            }
446            crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError::ValidationException(inner) => {
447                Error::ValidationException(inner)
448            }
449            crate::operation::list_experiment_resolved_targets::ListExperimentResolvedTargetsError::Unhandled(inner) => Error::Unhandled(inner),
450        }
451    }
452}
453impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_experiments::ListExperimentsError, R>> for Error
454where
455    R: Send + Sync + std::fmt::Debug + 'static,
456{
457    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_experiments::ListExperimentsError, R>) -> Self {
458        match err {
459            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
460            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
461                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
462                source: err.into(),
463            }),
464        }
465    }
466}
467impl From<crate::operation::list_experiments::ListExperimentsError> for Error {
468    fn from(err: crate::operation::list_experiments::ListExperimentsError) -> Self {
469        match err {
470            crate::operation::list_experiments::ListExperimentsError::ValidationException(inner) => Error::ValidationException(inner),
471            crate::operation::list_experiments::ListExperimentsError::Unhandled(inner) => Error::Unhandled(inner),
472        }
473    }
474}
475impl<R>
476    From<
477        ::aws_smithy_runtime_api::client::result::SdkError<
478            crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError,
479            R,
480        >,
481    > for Error
482where
483    R: Send + Sync + std::fmt::Debug + 'static,
484{
485    fn from(
486        err: ::aws_smithy_runtime_api::client::result::SdkError<
487            crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError,
488            R,
489        >,
490    ) -> Self {
491        match err {
492            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
493            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
494                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
495                source: err.into(),
496            }),
497        }
498    }
499}
500impl From<crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError> for Error {
501    fn from(err: crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError) -> Self {
502        match err {
503            crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
504            crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError::ValidationException(inner) => Error::ValidationException(inner),
505            crate::operation::list_experiment_target_account_configurations::ListExperimentTargetAccountConfigurationsError::Unhandled(inner) => Error::Unhandled(inner),
506        }
507    }
508}
509impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_experiment_templates::ListExperimentTemplatesError, R>>
510    for Error
511where
512    R: Send + Sync + std::fmt::Debug + 'static,
513{
514    fn from(
515        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_experiment_templates::ListExperimentTemplatesError, R>,
516    ) -> Self {
517        match err {
518            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
519            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
520                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
521                source: err.into(),
522            }),
523        }
524    }
525}
526impl From<crate::operation::list_experiment_templates::ListExperimentTemplatesError> for Error {
527    fn from(err: crate::operation::list_experiment_templates::ListExperimentTemplatesError) -> Self {
528        match err {
529            crate::operation::list_experiment_templates::ListExperimentTemplatesError::ValidationException(inner) => {
530                Error::ValidationException(inner)
531            }
532            crate::operation::list_experiment_templates::ListExperimentTemplatesError::Unhandled(inner) => Error::Unhandled(inner),
533        }
534    }
535}
536impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
537where
538    R: Send + Sync + std::fmt::Debug + 'static,
539{
540    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
541        match err {
542            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
543            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
544                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
545                source: err.into(),
546            }),
547        }
548    }
549}
550impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
551    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
552        match err {
553            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
554        }
555    }
556}
557impl<R>
558    From<
559        ::aws_smithy_runtime_api::client::result::SdkError<
560            crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError,
561            R,
562        >,
563    > for Error
564where
565    R: Send + Sync + std::fmt::Debug + 'static,
566{
567    fn from(
568        err: ::aws_smithy_runtime_api::client::result::SdkError<
569            crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError,
570            R,
571        >,
572    ) -> Self {
573        match err {
574            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
575            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
576                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
577                source: err.into(),
578            }),
579        }
580    }
581}
582impl From<crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError> for Error {
583    fn from(err: crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError) -> Self {
584        match err {
585            crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError::ResourceNotFoundException(inner) => {
586                Error::ResourceNotFoundException(inner)
587            }
588            crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError::ValidationException(inner) => {
589                Error::ValidationException(inner)
590            }
591            crate::operation::list_target_account_configurations::ListTargetAccountConfigurationsError::Unhandled(inner) => Error::Unhandled(inner),
592        }
593    }
594}
595impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_target_resource_types::ListTargetResourceTypesError, R>>
596    for Error
597where
598    R: Send + Sync + std::fmt::Debug + 'static,
599{
600    fn from(
601        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_target_resource_types::ListTargetResourceTypesError, R>,
602    ) -> Self {
603        match err {
604            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
605            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
606                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
607                source: err.into(),
608            }),
609        }
610    }
611}
612impl From<crate::operation::list_target_resource_types::ListTargetResourceTypesError> for Error {
613    fn from(err: crate::operation::list_target_resource_types::ListTargetResourceTypesError) -> Self {
614        match err {
615            crate::operation::list_target_resource_types::ListTargetResourceTypesError::ValidationException(inner) => {
616                Error::ValidationException(inner)
617            }
618            crate::operation::list_target_resource_types::ListTargetResourceTypesError::Unhandled(inner) => Error::Unhandled(inner),
619        }
620    }
621}
622impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_experiment::StartExperimentError, R>> for Error
623where
624    R: Send + Sync + std::fmt::Debug + 'static,
625{
626    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_experiment::StartExperimentError, R>) -> Self {
627        match err {
628            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
629            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
630                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
631                source: err.into(),
632            }),
633        }
634    }
635}
636impl From<crate::operation::start_experiment::StartExperimentError> for Error {
637    fn from(err: crate::operation::start_experiment::StartExperimentError) -> Self {
638        match err {
639            crate::operation::start_experiment::StartExperimentError::ConflictException(inner) => Error::ConflictException(inner),
640            crate::operation::start_experiment::StartExperimentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
641            crate::operation::start_experiment::StartExperimentError::ServiceQuotaExceededException(inner) => {
642                Error::ServiceQuotaExceededException(inner)
643            }
644            crate::operation::start_experiment::StartExperimentError::ValidationException(inner) => Error::ValidationException(inner),
645            crate::operation::start_experiment::StartExperimentError::Unhandled(inner) => Error::Unhandled(inner),
646        }
647    }
648}
649impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_experiment::StopExperimentError, R>> for Error
650where
651    R: Send + Sync + std::fmt::Debug + 'static,
652{
653    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_experiment::StopExperimentError, R>) -> Self {
654        match err {
655            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
656            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
657                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
658                source: err.into(),
659            }),
660        }
661    }
662}
663impl From<crate::operation::stop_experiment::StopExperimentError> for Error {
664    fn from(err: crate::operation::stop_experiment::StopExperimentError) -> Self {
665        match err {
666            crate::operation::stop_experiment::StopExperimentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
667            crate::operation::stop_experiment::StopExperimentError::ValidationException(inner) => Error::ValidationException(inner),
668            crate::operation::stop_experiment::StopExperimentError::Unhandled(inner) => Error::Unhandled(inner),
669        }
670    }
671}
672impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
673where
674    R: Send + Sync + std::fmt::Debug + 'static,
675{
676    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
677        match err {
678            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
679            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
680                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
681                source: err.into(),
682            }),
683        }
684    }
685}
686impl From<crate::operation::tag_resource::TagResourceError> for Error {
687    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
688        match err {
689            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
690        }
691    }
692}
693impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
694where
695    R: Send + Sync + std::fmt::Debug + 'static,
696{
697    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
698        match err {
699            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
700            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
701                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
702                source: err.into(),
703            }),
704        }
705    }
706}
707impl From<crate::operation::untag_resource::UntagResourceError> for Error {
708    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
709        match err {
710            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
711        }
712    }
713}
714impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_experiment_template::UpdateExperimentTemplateError, R>>
715    for Error
716where
717    R: Send + Sync + std::fmt::Debug + 'static,
718{
719    fn from(
720        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_experiment_template::UpdateExperimentTemplateError, R>,
721    ) -> Self {
722        match err {
723            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
724            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
725                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
726                source: err.into(),
727            }),
728        }
729    }
730}
731impl From<crate::operation::update_experiment_template::UpdateExperimentTemplateError> for Error {
732    fn from(err: crate::operation::update_experiment_template::UpdateExperimentTemplateError) -> Self {
733        match err {
734            crate::operation::update_experiment_template::UpdateExperimentTemplateError::ResourceNotFoundException(inner) => {
735                Error::ResourceNotFoundException(inner)
736            }
737            crate::operation::update_experiment_template::UpdateExperimentTemplateError::ServiceQuotaExceededException(inner) => {
738                Error::ServiceQuotaExceededException(inner)
739            }
740            crate::operation::update_experiment_template::UpdateExperimentTemplateError::ValidationException(inner) => {
741                Error::ValidationException(inner)
742            }
743            crate::operation::update_experiment_template::UpdateExperimentTemplateError::Unhandled(inner) => Error::Unhandled(inner),
744        }
745    }
746}
747impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError, R>>
748    for Error
749where
750    R: Send + Sync + std::fmt::Debug + 'static,
751{
752    fn from(
753        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError, R>,
754    ) -> Self {
755        match err {
756            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
757            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
758                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
759                source: err.into(),
760            }),
761        }
762    }
763}
764impl From<crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError> for Error {
765    fn from(err: crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError) -> Self {
766        match err {
767            crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError::ConflictException(inner) => Error::ConflictException(inner),
768            crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError::ResourceNotFoundException(inner) => {
769                Error::ResourceNotFoundException(inner)
770            }
771            crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError::ValidationException(inner) => Error::ValidationException(inner),
772            crate::operation::update_safety_lever_state::UpdateSafetyLeverStateError::Unhandled(inner) => Error::Unhandled(inner),
773        }
774    }
775}
776impl<R>
777    From<
778        ::aws_smithy_runtime_api::client::result::SdkError<
779            crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError,
780            R,
781        >,
782    > for Error
783where
784    R: Send + Sync + std::fmt::Debug + 'static,
785{
786    fn from(
787        err: ::aws_smithy_runtime_api::client::result::SdkError<
788            crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError,
789            R,
790        >,
791    ) -> Self {
792        match err {
793            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
794            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
795                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
796                source: err.into(),
797            }),
798        }
799    }
800}
801impl From<crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError> for Error {
802    fn from(err: crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError) -> Self {
803        match err {
804            crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError::ResourceNotFoundException(inner) => {
805                Error::ResourceNotFoundException(inner)
806            }
807            crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError::ValidationException(inner) => {
808                Error::ValidationException(inner)
809            }
810            crate::operation::update_target_account_configuration::UpdateTargetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
811        }
812    }
813}
814impl ::std::error::Error for Error {
815    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
816        match self {
817            Error::ConflictException(inner) => inner.source(),
818            Error::ResourceNotFoundException(inner) => inner.source(),
819            Error::ServiceQuotaExceededException(inner) => inner.source(),
820            Error::ValidationException(inner) => inner.source(),
821            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
822        }
823    }
824}
825impl ::aws_types::request_id::RequestId for Error {
826    fn request_id(&self) -> Option<&str> {
827        match self {
828            Self::ConflictException(e) => e.request_id(),
829            Self::ResourceNotFoundException(e) => e.request_id(),
830            Self::ServiceQuotaExceededException(e) => e.request_id(),
831            Self::ValidationException(e) => e.request_id(),
832            Self::Unhandled(e) => e.meta.request_id(),
833        }
834    }
835}