aws_sdk_connectparticipant/
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>You do not have sufficient access to perform this action.</p>
7    AccessDeniedException(crate::types::error::AccessDeniedException),
8    /// <p>The requested operation conflicts with the current state of a service resource associated with the request.</p>
9    ConflictException(crate::types::error::ConflictException),
10    /// <p>This exception occurs when there is an internal failure in the Amazon Connect service.</p>
11    InternalServerException(crate::types::error::InternalServerException),
12    /// <p>The resource was not found.</p>
13    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
14    /// <p>The number of attachments per contact exceeds the quota.</p>
15    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
16    /// <p>The request was denied due to request throttling.</p>
17    ThrottlingException(crate::types::error::ThrottlingException),
18    /// <p>The input fails to satisfy the constraints specified by Amazon Connect.</p>
19    ValidationException(crate::types::error::ValidationException),
20    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
21    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
22    variable wildcard pattern and check `.code()`:
23     \
24    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
25     \
26    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
27    Unhandled(crate::error::sealed_unhandled::Unhandled),
28}
29impl ::std::fmt::Display for Error {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31        match self {
32            Error::AccessDeniedException(inner) => inner.fmt(f),
33            Error::ConflictException(inner) => inner.fmt(f),
34            Error::InternalServerException(inner) => inner.fmt(f),
35            Error::ResourceNotFoundException(inner) => inner.fmt(f),
36            Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
37            Error::ThrottlingException(inner) => inner.fmt(f),
38            Error::ValidationException(inner) => inner.fmt(f),
39            Error::Unhandled(_) => {
40                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
41                    write!(f, "unhandled error ({code})")
42                } else {
43                    f.write_str("unhandled error")
44                }
45            }
46        }
47    }
48}
49impl From<::aws_smithy_types::error::operation::BuildError> for Error {
50    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
51        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
52            source: value.into(),
53            meta: ::std::default::Default::default(),
54        })
55    }
56}
57impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
58    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
59        match self {
60            Self::AccessDeniedException(inner) => inner.meta(),
61            Self::ConflictException(inner) => inner.meta(),
62            Self::InternalServerException(inner) => inner.meta(),
63            Self::ResourceNotFoundException(inner) => inner.meta(),
64            Self::ServiceQuotaExceededException(inner) => inner.meta(),
65            Self::ThrottlingException(inner) => inner.meta(),
66            Self::ValidationException(inner) => inner.meta(),
67            Self::Unhandled(inner) => &inner.meta,
68        }
69    }
70}
71impl<R>
72    From<
73        ::aws_smithy_runtime_api::client::result::SdkError<
74            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError,
75            R,
76        >,
77    > for Error
78where
79    R: Send + Sync + std::fmt::Debug + 'static,
80{
81    fn from(
82        err: ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError,
84            R,
85        >,
86    ) -> Self {
87        match err {
88            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
89            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
90                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
91                source: err.into(),
92            }),
93        }
94    }
95}
96impl From<crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError> for Error {
97    fn from(err: crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError) -> Self {
98        match err {
99            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError::AccessDeniedException(inner) => {
100                Error::AccessDeniedException(inner)
101            }
102            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError::InternalServerException(inner) => {
103                Error::InternalServerException(inner)
104            }
105            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError::ThrottlingException(inner) => {
106                Error::ThrottlingException(inner)
107            }
108            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError::ValidationException(inner) => {
109                Error::ValidationException(inner)
110            }
111            crate::operation::cancel_participant_authentication::CancelParticipantAuthenticationError::Unhandled(inner) => Error::Unhandled(inner),
112        }
113    }
114}
115impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::complete_attachment_upload::CompleteAttachmentUploadError, R>>
116    for Error
117where
118    R: Send + Sync + std::fmt::Debug + 'static,
119{
120    fn from(
121        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::complete_attachment_upload::CompleteAttachmentUploadError, R>,
122    ) -> Self {
123        match err {
124            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
125            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
126                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
127                source: err.into(),
128            }),
129        }
130    }
131}
132impl From<crate::operation::complete_attachment_upload::CompleteAttachmentUploadError> for Error {
133    fn from(err: crate::operation::complete_attachment_upload::CompleteAttachmentUploadError) -> Self {
134        match err {
135            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::AccessDeniedException(inner) => {
136                Error::AccessDeniedException(inner)
137            }
138            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::ConflictException(inner) => Error::ConflictException(inner),
139            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::InternalServerException(inner) => {
140                Error::InternalServerException(inner)
141            }
142            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::ServiceQuotaExceededException(inner) => {
143                Error::ServiceQuotaExceededException(inner)
144            }
145            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::ThrottlingException(inner) => {
146                Error::ThrottlingException(inner)
147            }
148            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::ValidationException(inner) => {
149                Error::ValidationException(inner)
150            }
151            crate::operation::complete_attachment_upload::CompleteAttachmentUploadError::Unhandled(inner) => Error::Unhandled(inner),
152        }
153    }
154}
155impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_participant_connection::CreateParticipantConnectionError, R>>
156    for Error
157where
158    R: Send + Sync + std::fmt::Debug + 'static,
159{
160    fn from(
161        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_participant_connection::CreateParticipantConnectionError, R>,
162    ) -> Self {
163        match err {
164            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
165            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
166                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
167                source: err.into(),
168            }),
169        }
170    }
171}
172impl From<crate::operation::create_participant_connection::CreateParticipantConnectionError> for Error {
173    fn from(err: crate::operation::create_participant_connection::CreateParticipantConnectionError) -> Self {
174        match err {
175            crate::operation::create_participant_connection::CreateParticipantConnectionError::AccessDeniedException(inner) => {
176                Error::AccessDeniedException(inner)
177            }
178            crate::operation::create_participant_connection::CreateParticipantConnectionError::InternalServerException(inner) => {
179                Error::InternalServerException(inner)
180            }
181            crate::operation::create_participant_connection::CreateParticipantConnectionError::ThrottlingException(inner) => {
182                Error::ThrottlingException(inner)
183            }
184            crate::operation::create_participant_connection::CreateParticipantConnectionError::ValidationException(inner) => {
185                Error::ValidationException(inner)
186            }
187            crate::operation::create_participant_connection::CreateParticipantConnectionError::Unhandled(inner) => Error::Unhandled(inner),
188        }
189    }
190}
191impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_view::DescribeViewError, R>> for Error
192where
193    R: Send + Sync + std::fmt::Debug + 'static,
194{
195    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_view::DescribeViewError, R>) -> Self {
196        match err {
197            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
198            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
199                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
200                source: err.into(),
201            }),
202        }
203    }
204}
205impl From<crate::operation::describe_view::DescribeViewError> for Error {
206    fn from(err: crate::operation::describe_view::DescribeViewError) -> Self {
207        match err {
208            crate::operation::describe_view::DescribeViewError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
209            crate::operation::describe_view::DescribeViewError::InternalServerException(inner) => Error::InternalServerException(inner),
210            crate::operation::describe_view::DescribeViewError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
211            crate::operation::describe_view::DescribeViewError::ThrottlingException(inner) => Error::ThrottlingException(inner),
212            crate::operation::describe_view::DescribeViewError::ValidationException(inner) => Error::ValidationException(inner),
213            crate::operation::describe_view::DescribeViewError::Unhandled(inner) => Error::Unhandled(inner),
214        }
215    }
216}
217impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disconnect_participant::DisconnectParticipantError, R>> for Error
218where
219    R: Send + Sync + std::fmt::Debug + 'static,
220{
221    fn from(
222        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disconnect_participant::DisconnectParticipantError, R>,
223    ) -> Self {
224        match err {
225            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
226            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
227                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
228                source: err.into(),
229            }),
230        }
231    }
232}
233impl From<crate::operation::disconnect_participant::DisconnectParticipantError> for Error {
234    fn from(err: crate::operation::disconnect_participant::DisconnectParticipantError) -> Self {
235        match err {
236            crate::operation::disconnect_participant::DisconnectParticipantError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
237            crate::operation::disconnect_participant::DisconnectParticipantError::InternalServerException(inner) => {
238                Error::InternalServerException(inner)
239            }
240            crate::operation::disconnect_participant::DisconnectParticipantError::ThrottlingException(inner) => Error::ThrottlingException(inner),
241            crate::operation::disconnect_participant::DisconnectParticipantError::ValidationException(inner) => Error::ValidationException(inner),
242            crate::operation::disconnect_participant::DisconnectParticipantError::Unhandled(inner) => Error::Unhandled(inner),
243        }
244    }
245}
246impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_attachment::GetAttachmentError, R>> for Error
247where
248    R: Send + Sync + std::fmt::Debug + 'static,
249{
250    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_attachment::GetAttachmentError, R>) -> Self {
251        match err {
252            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
253            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
254                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
255                source: err.into(),
256            }),
257        }
258    }
259}
260impl From<crate::operation::get_attachment::GetAttachmentError> for Error {
261    fn from(err: crate::operation::get_attachment::GetAttachmentError) -> Self {
262        match err {
263            crate::operation::get_attachment::GetAttachmentError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
264            crate::operation::get_attachment::GetAttachmentError::InternalServerException(inner) => Error::InternalServerException(inner),
265            crate::operation::get_attachment::GetAttachmentError::ThrottlingException(inner) => Error::ThrottlingException(inner),
266            crate::operation::get_attachment::GetAttachmentError::ValidationException(inner) => Error::ValidationException(inner),
267            crate::operation::get_attachment::GetAttachmentError::Unhandled(inner) => Error::Unhandled(inner),
268        }
269    }
270}
271impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_authentication_url::GetAuthenticationUrlError, R>> for Error
272where
273    R: Send + Sync + std::fmt::Debug + 'static,
274{
275    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_authentication_url::GetAuthenticationUrlError, R>) -> Self {
276        match err {
277            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
278            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
279                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
280                source: err.into(),
281            }),
282        }
283    }
284}
285impl From<crate::operation::get_authentication_url::GetAuthenticationUrlError> for Error {
286    fn from(err: crate::operation::get_authentication_url::GetAuthenticationUrlError) -> Self {
287        match err {
288            crate::operation::get_authentication_url::GetAuthenticationUrlError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
289            crate::operation::get_authentication_url::GetAuthenticationUrlError::InternalServerException(inner) => {
290                Error::InternalServerException(inner)
291            }
292            crate::operation::get_authentication_url::GetAuthenticationUrlError::ThrottlingException(inner) => Error::ThrottlingException(inner),
293            crate::operation::get_authentication_url::GetAuthenticationUrlError::ValidationException(inner) => Error::ValidationException(inner),
294            crate::operation::get_authentication_url::GetAuthenticationUrlError::Unhandled(inner) => Error::Unhandled(inner),
295        }
296    }
297}
298impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_transcript::GetTranscriptError, R>> for Error
299where
300    R: Send + Sync + std::fmt::Debug + 'static,
301{
302    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_transcript::GetTranscriptError, R>) -> Self {
303        match err {
304            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
305            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
306                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
307                source: err.into(),
308            }),
309        }
310    }
311}
312impl From<crate::operation::get_transcript::GetTranscriptError> for Error {
313    fn from(err: crate::operation::get_transcript::GetTranscriptError) -> Self {
314        match err {
315            crate::operation::get_transcript::GetTranscriptError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
316            crate::operation::get_transcript::GetTranscriptError::InternalServerException(inner) => Error::InternalServerException(inner),
317            crate::operation::get_transcript::GetTranscriptError::ThrottlingException(inner) => Error::ThrottlingException(inner),
318            crate::operation::get_transcript::GetTranscriptError::ValidationException(inner) => Error::ValidationException(inner),
319            crate::operation::get_transcript::GetTranscriptError::Unhandled(inner) => Error::Unhandled(inner),
320        }
321    }
322}
323impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::send_event::SendEventError, R>> for Error
324where
325    R: Send + Sync + std::fmt::Debug + 'static,
326{
327    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::send_event::SendEventError, R>) -> Self {
328        match err {
329            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
330            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
331                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
332                source: err.into(),
333            }),
334        }
335    }
336}
337impl From<crate::operation::send_event::SendEventError> for Error {
338    fn from(err: crate::operation::send_event::SendEventError) -> Self {
339        match err {
340            crate::operation::send_event::SendEventError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
341            crate::operation::send_event::SendEventError::ConflictException(inner) => Error::ConflictException(inner),
342            crate::operation::send_event::SendEventError::InternalServerException(inner) => Error::InternalServerException(inner),
343            crate::operation::send_event::SendEventError::ThrottlingException(inner) => Error::ThrottlingException(inner),
344            crate::operation::send_event::SendEventError::ValidationException(inner) => Error::ValidationException(inner),
345            crate::operation::send_event::SendEventError::Unhandled(inner) => Error::Unhandled(inner),
346        }
347    }
348}
349impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::send_message::SendMessageError, R>> for Error
350where
351    R: Send + Sync + std::fmt::Debug + 'static,
352{
353    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::send_message::SendMessageError, R>) -> Self {
354        match err {
355            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
356            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
357                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
358                source: err.into(),
359            }),
360        }
361    }
362}
363impl From<crate::operation::send_message::SendMessageError> for Error {
364    fn from(err: crate::operation::send_message::SendMessageError) -> Self {
365        match err {
366            crate::operation::send_message::SendMessageError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
367            crate::operation::send_message::SendMessageError::InternalServerException(inner) => Error::InternalServerException(inner),
368            crate::operation::send_message::SendMessageError::ThrottlingException(inner) => Error::ThrottlingException(inner),
369            crate::operation::send_message::SendMessageError::ValidationException(inner) => Error::ValidationException(inner),
370            crate::operation::send_message::SendMessageError::Unhandled(inner) => Error::Unhandled(inner),
371        }
372    }
373}
374impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_attachment_upload::StartAttachmentUploadError, R>> for Error
375where
376    R: Send + Sync + std::fmt::Debug + 'static,
377{
378    fn from(
379        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_attachment_upload::StartAttachmentUploadError, R>,
380    ) -> Self {
381        match err {
382            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
383            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
384                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
385                source: err.into(),
386            }),
387        }
388    }
389}
390impl From<crate::operation::start_attachment_upload::StartAttachmentUploadError> for Error {
391    fn from(err: crate::operation::start_attachment_upload::StartAttachmentUploadError) -> Self {
392        match err {
393            crate::operation::start_attachment_upload::StartAttachmentUploadError::AccessDeniedException(inner) => {
394                Error::AccessDeniedException(inner)
395            }
396            crate::operation::start_attachment_upload::StartAttachmentUploadError::InternalServerException(inner) => {
397                Error::InternalServerException(inner)
398            }
399            crate::operation::start_attachment_upload::StartAttachmentUploadError::ServiceQuotaExceededException(inner) => {
400                Error::ServiceQuotaExceededException(inner)
401            }
402            crate::operation::start_attachment_upload::StartAttachmentUploadError::ThrottlingException(inner) => Error::ThrottlingException(inner),
403            crate::operation::start_attachment_upload::StartAttachmentUploadError::ValidationException(inner) => Error::ValidationException(inner),
404            crate::operation::start_attachment_upload::StartAttachmentUploadError::Unhandled(inner) => Error::Unhandled(inner),
405        }
406    }
407}
408impl ::std::error::Error for Error {
409    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
410        match self {
411            Error::AccessDeniedException(inner) => inner.source(),
412            Error::ConflictException(inner) => inner.source(),
413            Error::InternalServerException(inner) => inner.source(),
414            Error::ResourceNotFoundException(inner) => inner.source(),
415            Error::ServiceQuotaExceededException(inner) => inner.source(),
416            Error::ThrottlingException(inner) => inner.source(),
417            Error::ValidationException(inner) => inner.source(),
418            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
419        }
420    }
421}
422impl ::aws_types::request_id::RequestId for Error {
423    fn request_id(&self) -> Option<&str> {
424        match self {
425            Self::AccessDeniedException(e) => e.request_id(),
426            Self::ConflictException(e) => e.request_id(),
427            Self::InternalServerException(e) => e.request_id(),
428            Self::ResourceNotFoundException(e) => e.request_id(),
429            Self::ServiceQuotaExceededException(e) => e.request_id(),
430            Self::ThrottlingException(e) => e.request_id(),
431            Self::ValidationException(e) => e.request_id(),
432            Self::Unhandled(e) => e.meta.request_id(),
433        }
434    }
435}