1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AccessDeniedException(crate::types::error::AccessDeniedException),
8 ConflictException(crate::types::error::ConflictException),
10 InternalServiceErrorException(crate::types::error::InternalServiceErrorException),
12 InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
14 InvalidParameterException(crate::types::error::InvalidParameterException),
16 LimitExceededException(crate::types::error::LimitExceededException),
18 ResourceExistsException(crate::types::error::ResourceExistsException),
20 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
22 ThrottlingException(crate::types::error::ThrottlingException),
24 ValidationException(crate::types::error::ValidationException),
26 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
28 variable wildcard pattern and check `.code()`:
29 \
30 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
31 \
32 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
33 Unhandled(crate::error::sealed_unhandled::Unhandled),
34}
35impl ::std::fmt::Display for Error {
36 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37 match self {
38 Error::AccessDeniedException(inner) => inner.fmt(f),
39 Error::ConflictException(inner) => inner.fmt(f),
40 Error::InternalServiceErrorException(inner) => inner.fmt(f),
41 Error::InvalidNextTokenException(inner) => inner.fmt(f),
42 Error::InvalidParameterException(inner) => inner.fmt(f),
43 Error::LimitExceededException(inner) => inner.fmt(f),
44 Error::ResourceExistsException(inner) => inner.fmt(f),
45 Error::ResourceNotFoundException(inner) => inner.fmt(f),
46 Error::ThrottlingException(inner) => inner.fmt(f),
47 Error::ValidationException(inner) => inner.fmt(f),
48 Error::Unhandled(_) => {
49 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
50 write!(f, "unhandled error ({code})")
51 } else {
52 f.write_str("unhandled error")
53 }
54 }
55 }
56 }
57}
58impl From<::aws_smithy_types::error::operation::BuildError> for Error {
59 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
60 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
61 source: value.into(),
62 meta: ::std::default::Default::default(),
63 })
64 }
65}
66impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
67 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
68 match self {
69 Self::AccessDeniedException(inner) => inner.meta(),
70 Self::ConflictException(inner) => inner.meta(),
71 Self::InternalServiceErrorException(inner) => inner.meta(),
72 Self::InvalidNextTokenException(inner) => inner.meta(),
73 Self::InvalidParameterException(inner) => inner.meta(),
74 Self::LimitExceededException(inner) => inner.meta(),
75 Self::ResourceExistsException(inner) => inner.meta(),
76 Self::ResourceNotFoundException(inner) => inner.meta(),
77 Self::ThrottlingException(inner) => inner.meta(),
78 Self::ValidationException(inner) => inner.meta(),
79 Self::Unhandled(inner) => &inner.meta,
80 }
81 }
82}
83impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_profile::AssociateProfileError, R>> for Error
84where
85 R: Send + Sync + std::fmt::Debug + 'static,
86{
87 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_profile::AssociateProfileError, R>) -> Self {
88 match err {
89 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
90 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
91 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
92 source: err.into(),
93 }),
94 }
95 }
96}
97impl From<crate::operation::associate_profile::AssociateProfileError> for Error {
98 fn from(err: crate::operation::associate_profile::AssociateProfileError) -> Self {
99 match err {
100 crate::operation::associate_profile::AssociateProfileError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
101 crate::operation::associate_profile::AssociateProfileError::ConflictException(inner) => Error::ConflictException(inner),
102 crate::operation::associate_profile::AssociateProfileError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
103 crate::operation::associate_profile::AssociateProfileError::LimitExceededException(inner) => Error::LimitExceededException(inner),
104 crate::operation::associate_profile::AssociateProfileError::ResourceExistsException(inner) => Error::ResourceExistsException(inner),
105 crate::operation::associate_profile::AssociateProfileError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
106 crate::operation::associate_profile::AssociateProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
107 crate::operation::associate_profile::AssociateProfileError::ValidationException(inner) => Error::ValidationException(inner),
108 crate::operation::associate_profile::AssociateProfileError::Unhandled(inner) => Error::Unhandled(inner),
109 }
110 }
111}
112impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_resource_to_profile::AssociateResourceToProfileError, R>>
113 for Error
114where
115 R: Send + Sync + std::fmt::Debug + 'static,
116{
117 fn from(
118 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_resource_to_profile::AssociateResourceToProfileError, R>,
119 ) -> Self {
120 match err {
121 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
122 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
123 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
124 source: err.into(),
125 }),
126 }
127 }
128}
129impl From<crate::operation::associate_resource_to_profile::AssociateResourceToProfileError> for Error {
130 fn from(err: crate::operation::associate_resource_to_profile::AssociateResourceToProfileError) -> Self {
131 match err {
132 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::AccessDeniedException(inner) => {
133 Error::AccessDeniedException(inner)
134 }
135 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::ConflictException(inner) => {
136 Error::ConflictException(inner)
137 }
138 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::InternalServiceErrorException(inner) => {
139 Error::InternalServiceErrorException(inner)
140 }
141 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::InvalidParameterException(inner) => {
142 Error::InvalidParameterException(inner)
143 }
144 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::LimitExceededException(inner) => {
145 Error::LimitExceededException(inner)
146 }
147 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::ResourceNotFoundException(inner) => {
148 Error::ResourceNotFoundException(inner)
149 }
150 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::ThrottlingException(inner) => {
151 Error::ThrottlingException(inner)
152 }
153 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::ValidationException(inner) => {
154 Error::ValidationException(inner)
155 }
156 crate::operation::associate_resource_to_profile::AssociateResourceToProfileError::Unhandled(inner) => Error::Unhandled(inner),
157 }
158 }
159}
160impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_profile::CreateProfileError, R>> for Error
161where
162 R: Send + Sync + std::fmt::Debug + 'static,
163{
164 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_profile::CreateProfileError, R>) -> Self {
165 match err {
166 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
167 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
168 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
169 source: err.into(),
170 }),
171 }
172 }
173}
174impl From<crate::operation::create_profile::CreateProfileError> for Error {
175 fn from(err: crate::operation::create_profile::CreateProfileError) -> Self {
176 match err {
177 crate::operation::create_profile::CreateProfileError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
178 crate::operation::create_profile::CreateProfileError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
179 crate::operation::create_profile::CreateProfileError::LimitExceededException(inner) => Error::LimitExceededException(inner),
180 crate::operation::create_profile::CreateProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
181 crate::operation::create_profile::CreateProfileError::ValidationException(inner) => Error::ValidationException(inner),
182 crate::operation::create_profile::CreateProfileError::Unhandled(inner) => Error::Unhandled(inner),
183 }
184 }
185}
186impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_profile::DeleteProfileError, R>> for Error
187where
188 R: Send + Sync + std::fmt::Debug + 'static,
189{
190 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_profile::DeleteProfileError, R>) -> Self {
191 match err {
192 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
193 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
194 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
195 source: err.into(),
196 }),
197 }
198 }
199}
200impl From<crate::operation::delete_profile::DeleteProfileError> for Error {
201 fn from(err: crate::operation::delete_profile::DeleteProfileError) -> Self {
202 match err {
203 crate::operation::delete_profile::DeleteProfileError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
204 crate::operation::delete_profile::DeleteProfileError::ConflictException(inner) => Error::ConflictException(inner),
205 crate::operation::delete_profile::DeleteProfileError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
206 crate::operation::delete_profile::DeleteProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
207 crate::operation::delete_profile::DeleteProfileError::ValidationException(inner) => Error::ValidationException(inner),
208 crate::operation::delete_profile::DeleteProfileError::Unhandled(inner) => Error::Unhandled(inner),
209 }
210 }
211}
212impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_profile::DisassociateProfileError, R>> for Error
213where
214 R: Send + Sync + std::fmt::Debug + 'static,
215{
216 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_profile::DisassociateProfileError, R>) -> Self {
217 match err {
218 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
219 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
220 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
221 source: err.into(),
222 }),
223 }
224 }
225}
226impl From<crate::operation::disassociate_profile::DisassociateProfileError> for Error {
227 fn from(err: crate::operation::disassociate_profile::DisassociateProfileError) -> Self {
228 match err {
229 crate::operation::disassociate_profile::DisassociateProfileError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
230 crate::operation::disassociate_profile::DisassociateProfileError::InvalidParameterException(inner) => {
231 Error::InvalidParameterException(inner)
232 }
233 crate::operation::disassociate_profile::DisassociateProfileError::LimitExceededException(inner) => Error::LimitExceededException(inner),
234 crate::operation::disassociate_profile::DisassociateProfileError::ResourceNotFoundException(inner) => {
235 Error::ResourceNotFoundException(inner)
236 }
237 crate::operation::disassociate_profile::DisassociateProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
238 crate::operation::disassociate_profile::DisassociateProfileError::ValidationException(inner) => Error::ValidationException(inner),
239 crate::operation::disassociate_profile::DisassociateProfileError::Unhandled(inner) => Error::Unhandled(inner),
240 }
241 }
242}
243impl<R>
244 From<
245 ::aws_smithy_runtime_api::client::result::SdkError<
246 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError,
247 R,
248 >,
249 > for Error
250where
251 R: Send + Sync + std::fmt::Debug + 'static,
252{
253 fn from(
254 err: ::aws_smithy_runtime_api::client::result::SdkError<
255 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError,
256 R,
257 >,
258 ) -> Self {
259 match err {
260 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
261 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
262 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
263 source: err.into(),
264 }),
265 }
266 }
267}
268impl From<crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError> for Error {
269 fn from(err: crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError) -> Self {
270 match err {
271 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::AccessDeniedException(inner) => {
272 Error::AccessDeniedException(inner)
273 }
274 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::ConflictException(inner) => {
275 Error::ConflictException(inner)
276 }
277 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::InternalServiceErrorException(inner) => {
278 Error::InternalServiceErrorException(inner)
279 }
280 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::InvalidParameterException(inner) => {
281 Error::InvalidParameterException(inner)
282 }
283 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::LimitExceededException(inner) => {
284 Error::LimitExceededException(inner)
285 }
286 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::ResourceNotFoundException(inner) => {
287 Error::ResourceNotFoundException(inner)
288 }
289 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::ThrottlingException(inner) => {
290 Error::ThrottlingException(inner)
291 }
292 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::ValidationException(inner) => {
293 Error::ValidationException(inner)
294 }
295 crate::operation::disassociate_resource_from_profile::DisassociateResourceFromProfileError::Unhandled(inner) => Error::Unhandled(inner),
296 }
297 }
298}
299impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile::GetProfileError, R>> for Error
300where
301 R: Send + Sync + std::fmt::Debug + 'static,
302{
303 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile::GetProfileError, R>) -> Self {
304 match err {
305 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
306 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
307 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
308 source: err.into(),
309 }),
310 }
311 }
312}
313impl From<crate::operation::get_profile::GetProfileError> for Error {
314 fn from(err: crate::operation::get_profile::GetProfileError) -> Self {
315 match err {
316 crate::operation::get_profile::GetProfileError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
317 crate::operation::get_profile::GetProfileError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
318 crate::operation::get_profile::GetProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
319 crate::operation::get_profile::GetProfileError::ValidationException(inner) => Error::ValidationException(inner),
320 crate::operation::get_profile::GetProfileError::Unhandled(inner) => Error::Unhandled(inner),
321 }
322 }
323}
324impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile_association::GetProfileAssociationError, R>> for Error
325where
326 R: Send + Sync + std::fmt::Debug + 'static,
327{
328 fn from(
329 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile_association::GetProfileAssociationError, R>,
330 ) -> Self {
331 match err {
332 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
333 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
334 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
335 source: err.into(),
336 }),
337 }
338 }
339}
340impl From<crate::operation::get_profile_association::GetProfileAssociationError> for Error {
341 fn from(err: crate::operation::get_profile_association::GetProfileAssociationError) -> Self {
342 match err {
343 crate::operation::get_profile_association::GetProfileAssociationError::AccessDeniedException(inner) => {
344 Error::AccessDeniedException(inner)
345 }
346 crate::operation::get_profile_association::GetProfileAssociationError::ResourceNotFoundException(inner) => {
347 Error::ResourceNotFoundException(inner)
348 }
349 crate::operation::get_profile_association::GetProfileAssociationError::ThrottlingException(inner) => Error::ThrottlingException(inner),
350 crate::operation::get_profile_association::GetProfileAssociationError::ValidationException(inner) => Error::ValidationException(inner),
351 crate::operation::get_profile_association::GetProfileAssociationError::Unhandled(inner) => Error::Unhandled(inner),
352 }
353 }
354}
355impl<R>
356 From<
357 ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile_resource_association::GetProfileResourceAssociationError, R>,
358 > for Error
359where
360 R: Send + Sync + std::fmt::Debug + 'static,
361{
362 fn from(
363 err: ::aws_smithy_runtime_api::client::result::SdkError<
364 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError,
365 R,
366 >,
367 ) -> Self {
368 match err {
369 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
370 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
371 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
372 source: err.into(),
373 }),
374 }
375 }
376}
377impl From<crate::operation::get_profile_resource_association::GetProfileResourceAssociationError> for Error {
378 fn from(err: crate::operation::get_profile_resource_association::GetProfileResourceAssociationError) -> Self {
379 match err {
380 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::AccessDeniedException(inner) => {
381 Error::AccessDeniedException(inner)
382 }
383 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::InvalidParameterException(inner) => {
384 Error::InvalidParameterException(inner)
385 }
386 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::ResourceNotFoundException(inner) => {
387 Error::ResourceNotFoundException(inner)
388 }
389 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::ThrottlingException(inner) => {
390 Error::ThrottlingException(inner)
391 }
392 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::ValidationException(inner) => {
393 Error::ValidationException(inner)
394 }
395 crate::operation::get_profile_resource_association::GetProfileResourceAssociationError::Unhandled(inner) => Error::Unhandled(inner),
396 }
397 }
398}
399impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profile_associations::ListProfileAssociationsError, R>>
400 for Error
401where
402 R: Send + Sync + std::fmt::Debug + 'static,
403{
404 fn from(
405 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profile_associations::ListProfileAssociationsError, R>,
406 ) -> Self {
407 match err {
408 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
409 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
410 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
411 source: err.into(),
412 }),
413 }
414 }
415}
416impl From<crate::operation::list_profile_associations::ListProfileAssociationsError> for Error {
417 fn from(err: crate::operation::list_profile_associations::ListProfileAssociationsError) -> Self {
418 match err {
419 crate::operation::list_profile_associations::ListProfileAssociationsError::AccessDeniedException(inner) => {
420 Error::AccessDeniedException(inner)
421 }
422 crate::operation::list_profile_associations::ListProfileAssociationsError::InvalidNextTokenException(inner) => {
423 Error::InvalidNextTokenException(inner)
424 }
425 crate::operation::list_profile_associations::ListProfileAssociationsError::InvalidParameterException(inner) => {
426 Error::InvalidParameterException(inner)
427 }
428 crate::operation::list_profile_associations::ListProfileAssociationsError::ThrottlingException(inner) => {
429 Error::ThrottlingException(inner)
430 }
431 crate::operation::list_profile_associations::ListProfileAssociationsError::ValidationException(inner) => {
432 Error::ValidationException(inner)
433 }
434 crate::operation::list_profile_associations::ListProfileAssociationsError::Unhandled(inner) => Error::Unhandled(inner),
435 }
436 }
437}
438impl<R>
439 From<
440 ::aws_smithy_runtime_api::client::result::SdkError<
441 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError,
442 R,
443 >,
444 > for Error
445where
446 R: Send + Sync + std::fmt::Debug + 'static,
447{
448 fn from(
449 err: ::aws_smithy_runtime_api::client::result::SdkError<
450 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError,
451 R,
452 >,
453 ) -> Self {
454 match err {
455 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
456 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
457 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
458 source: err.into(),
459 }),
460 }
461 }
462}
463impl From<crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError> for Error {
464 fn from(err: crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError) -> Self {
465 match err {
466 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::AccessDeniedException(inner) => {
467 Error::AccessDeniedException(inner)
468 }
469 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::InternalServiceErrorException(inner) => {
470 Error::InternalServiceErrorException(inner)
471 }
472 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::InvalidNextTokenException(inner) => {
473 Error::InvalidNextTokenException(inner)
474 }
475 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::InvalidParameterException(inner) => {
476 Error::InvalidParameterException(inner)
477 }
478 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::ResourceNotFoundException(inner) => {
479 Error::ResourceNotFoundException(inner)
480 }
481 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::ThrottlingException(inner) => {
482 Error::ThrottlingException(inner)
483 }
484 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::ValidationException(inner) => {
485 Error::ValidationException(inner)
486 }
487 crate::operation::list_profile_resource_associations::ListProfileResourceAssociationsError::Unhandled(inner) => Error::Unhandled(inner),
488 }
489 }
490}
491impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profiles::ListProfilesError, R>> for Error
492where
493 R: Send + Sync + std::fmt::Debug + 'static,
494{
495 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profiles::ListProfilesError, R>) -> Self {
496 match err {
497 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
498 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
499 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
500 source: err.into(),
501 }),
502 }
503 }
504}
505impl From<crate::operation::list_profiles::ListProfilesError> for Error {
506 fn from(err: crate::operation::list_profiles::ListProfilesError) -> Self {
507 match err {
508 crate::operation::list_profiles::ListProfilesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
509 crate::operation::list_profiles::ListProfilesError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
510 crate::operation::list_profiles::ListProfilesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
511 crate::operation::list_profiles::ListProfilesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
512 crate::operation::list_profiles::ListProfilesError::ValidationException(inner) => Error::ValidationException(inner),
513 crate::operation::list_profiles::ListProfilesError::Unhandled(inner) => Error::Unhandled(inner),
514 }
515 }
516}
517impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
518where
519 R: Send + Sync + std::fmt::Debug + 'static,
520{
521 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
522 match err {
523 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
524 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
525 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
526 source: err.into(),
527 }),
528 }
529 }
530}
531impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
532 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
533 match err {
534 crate::operation::list_tags_for_resource::ListTagsForResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
535 crate::operation::list_tags_for_resource::ListTagsForResourceError::ConflictException(inner) => Error::ConflictException(inner),
536 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
537 Error::ResourceNotFoundException(inner)
538 }
539 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
540 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
541 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
542 }
543 }
544}
545impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
546where
547 R: Send + Sync + std::fmt::Debug + 'static,
548{
549 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
550 match err {
551 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
552 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
553 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
554 source: err.into(),
555 }),
556 }
557 }
558}
559impl From<crate::operation::tag_resource::TagResourceError> for Error {
560 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
561 match err {
562 crate::operation::tag_resource::TagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
563 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
564 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
565 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
566 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
567 }
568 }
569}
570impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
571where
572 R: Send + Sync + std::fmt::Debug + 'static,
573{
574 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
575 match err {
576 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
577 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
578 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
579 source: err.into(),
580 }),
581 }
582 }
583}
584impl From<crate::operation::untag_resource::UntagResourceError> for Error {
585 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
586 match err {
587 crate::operation::untag_resource::UntagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
588 crate::operation::untag_resource::UntagResourceError::ConflictException(inner) => Error::ConflictException(inner),
589 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
590 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
591 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
592 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
593 }
594 }
595}
596impl<R>
597 From<
598 ::aws_smithy_runtime_api::client::result::SdkError<
599 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError,
600 R,
601 >,
602 > for Error
603where
604 R: Send + Sync + std::fmt::Debug + 'static,
605{
606 fn from(
607 err: ::aws_smithy_runtime_api::client::result::SdkError<
608 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError,
609 R,
610 >,
611 ) -> Self {
612 match err {
613 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
614 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
615 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
616 source: err.into(),
617 }),
618 }
619 }
620}
621impl From<crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError> for Error {
622 fn from(err: crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError) -> Self {
623 match err {
624 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::AccessDeniedException(inner) => {
625 Error::AccessDeniedException(inner)
626 }
627 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::ConflictException(inner) => {
628 Error::ConflictException(inner)
629 }
630 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::InternalServiceErrorException(inner) => {
631 Error::InternalServiceErrorException(inner)
632 }
633 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::InvalidParameterException(inner) => {
634 Error::InvalidParameterException(inner)
635 }
636 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::LimitExceededException(inner) => {
637 Error::LimitExceededException(inner)
638 }
639 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::ResourceNotFoundException(inner) => {
640 Error::ResourceNotFoundException(inner)
641 }
642 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::ThrottlingException(inner) => {
643 Error::ThrottlingException(inner)
644 }
645 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::ValidationException(inner) => {
646 Error::ValidationException(inner)
647 }
648 crate::operation::update_profile_resource_association::UpdateProfileResourceAssociationError::Unhandled(inner) => Error::Unhandled(inner),
649 }
650 }
651}
652impl ::std::error::Error for Error {
653 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
654 match self {
655 Error::AccessDeniedException(inner) => inner.source(),
656 Error::ConflictException(inner) => inner.source(),
657 Error::InternalServiceErrorException(inner) => inner.source(),
658 Error::InvalidNextTokenException(inner) => inner.source(),
659 Error::InvalidParameterException(inner) => inner.source(),
660 Error::LimitExceededException(inner) => inner.source(),
661 Error::ResourceExistsException(inner) => inner.source(),
662 Error::ResourceNotFoundException(inner) => inner.source(),
663 Error::ThrottlingException(inner) => inner.source(),
664 Error::ValidationException(inner) => inner.source(),
665 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
666 }
667 }
668}
669impl ::aws_types::request_id::RequestId for Error {
670 fn request_id(&self) -> Option<&str> {
671 match self {
672 Self::AccessDeniedException(e) => e.request_id(),
673 Self::ConflictException(e) => e.request_id(),
674 Self::InternalServiceErrorException(e) => e.request_id(),
675 Self::InvalidNextTokenException(e) => e.request_id(),
676 Self::InvalidParameterException(e) => e.request_id(),
677 Self::LimitExceededException(e) => e.request_id(),
678 Self::ResourceExistsException(e) => e.request_id(),
679 Self::ResourceNotFoundException(e) => e.request_id(),
680 Self::ThrottlingException(e) => e.request_id(),
681 Self::ValidationException(e) => e.request_id(),
682 Self::Unhandled(e) => e.meta.request_id(),
683 }
684 }
685}