1#[non_exhaustive]
4#[derive(std::fmt::Debug)]
5pub struct GetDirectThreadError {
6 pub kind: GetDirectThreadErrorKind,
8 pub(crate) meta: aws_smithy_types::Error,
10}
11#[non_exhaustive]
13#[derive(std::fmt::Debug)]
14pub enum GetDirectThreadErrorKind {
15 InternalError(crate::error::InternalError),
17 RateLimitError(crate::error::RateLimitError),
19 ForbiddenError(crate::error::ForbiddenError),
21 UnauthorizedError(crate::error::UnauthorizedError),
23 NotFoundError(crate::error::NotFoundError),
25 BadRequestError(crate::error::BadRequestError),
27 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
29}
30impl std::fmt::Display for GetDirectThreadError {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 match &self.kind {
33 GetDirectThreadErrorKind::InternalError(_inner) => _inner.fmt(f),
34 GetDirectThreadErrorKind::RateLimitError(_inner) => _inner.fmt(f),
35 GetDirectThreadErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
36 GetDirectThreadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
37 GetDirectThreadErrorKind::NotFoundError(_inner) => _inner.fmt(f),
38 GetDirectThreadErrorKind::BadRequestError(_inner) => _inner.fmt(f),
39 GetDirectThreadErrorKind::Unhandled(_inner) => _inner.fmt(f),
40 }
41 }
42}
43impl aws_smithy_types::retry::ProvideErrorKind for GetDirectThreadError {
44 fn code(&self) -> Option<&str> {
45 GetDirectThreadError::code(self)
46 }
47 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
48 match &self.kind {
49 GetDirectThreadErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
50 GetDirectThreadErrorKind::UnauthorizedError(inner) => {
51 Some(inner.retryable_error_kind())
52 }
53 _ => None,
54 }
55 }
56}
57impl GetDirectThreadError {
58 pub fn new(kind: GetDirectThreadErrorKind, meta: aws_smithy_types::Error) -> Self {
60 Self { kind, meta }
61 }
62
63 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
65 Self {
66 kind: GetDirectThreadErrorKind::Unhandled(err.into()),
67 meta: Default::default(),
68 }
69 }
70
71 pub fn generic(err: aws_smithy_types::Error) -> Self {
73 Self {
74 meta: err.clone(),
75 kind: GetDirectThreadErrorKind::Unhandled(err.into()),
76 }
77 }
78
79 pub fn message(&self) -> Option<&str> {
81 self.meta.message()
82 }
83
84 pub fn meta(&self) -> &aws_smithy_types::Error {
87 &self.meta
88 }
89
90 pub fn request_id(&self) -> Option<&str> {
92 self.meta.request_id()
93 }
94
95 pub fn code(&self) -> Option<&str> {
97 self.meta.code()
98 }
99 pub fn is_internal_error(&self) -> bool {
101 matches!(&self.kind, GetDirectThreadErrorKind::InternalError(_))
102 }
103 pub fn is_rate_limit_error(&self) -> bool {
105 matches!(&self.kind, GetDirectThreadErrorKind::RateLimitError(_))
106 }
107 pub fn is_forbidden_error(&self) -> bool {
109 matches!(&self.kind, GetDirectThreadErrorKind::ForbiddenError(_))
110 }
111 pub fn is_unauthorized_error(&self) -> bool {
113 matches!(&self.kind, GetDirectThreadErrorKind::UnauthorizedError(_))
114 }
115 pub fn is_not_found_error(&self) -> bool {
117 matches!(&self.kind, GetDirectThreadErrorKind::NotFoundError(_))
118 }
119 pub fn is_bad_request_error(&self) -> bool {
121 matches!(&self.kind, GetDirectThreadErrorKind::BadRequestError(_))
122 }
123}
124impl std::error::Error for GetDirectThreadError {
125 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
126 match &self.kind {
127 GetDirectThreadErrorKind::InternalError(_inner) => Some(_inner),
128 GetDirectThreadErrorKind::RateLimitError(_inner) => Some(_inner),
129 GetDirectThreadErrorKind::ForbiddenError(_inner) => Some(_inner),
130 GetDirectThreadErrorKind::UnauthorizedError(_inner) => Some(_inner),
131 GetDirectThreadErrorKind::NotFoundError(_inner) => Some(_inner),
132 GetDirectThreadErrorKind::BadRequestError(_inner) => Some(_inner),
133 GetDirectThreadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
134 }
135 }
136}
137
138#[non_exhaustive]
140#[derive(std::fmt::Debug)]
141pub struct GetThreadHistoryError {
142 pub kind: GetThreadHistoryErrorKind,
144 pub(crate) meta: aws_smithy_types::Error,
146}
147#[non_exhaustive]
149#[derive(std::fmt::Debug)]
150pub enum GetThreadHistoryErrorKind {
151 InternalError(crate::error::InternalError),
153 RateLimitError(crate::error::RateLimitError),
155 ForbiddenError(crate::error::ForbiddenError),
157 UnauthorizedError(crate::error::UnauthorizedError),
159 NotFoundError(crate::error::NotFoundError),
161 BadRequestError(crate::error::BadRequestError),
163 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
165}
166impl std::fmt::Display for GetThreadHistoryError {
167 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
168 match &self.kind {
169 GetThreadHistoryErrorKind::InternalError(_inner) => _inner.fmt(f),
170 GetThreadHistoryErrorKind::RateLimitError(_inner) => _inner.fmt(f),
171 GetThreadHistoryErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
172 GetThreadHistoryErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
173 GetThreadHistoryErrorKind::NotFoundError(_inner) => _inner.fmt(f),
174 GetThreadHistoryErrorKind::BadRequestError(_inner) => _inner.fmt(f),
175 GetThreadHistoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
176 }
177 }
178}
179impl aws_smithy_types::retry::ProvideErrorKind for GetThreadHistoryError {
180 fn code(&self) -> Option<&str> {
181 GetThreadHistoryError::code(self)
182 }
183 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
184 match &self.kind {
185 GetThreadHistoryErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
186 GetThreadHistoryErrorKind::UnauthorizedError(inner) => {
187 Some(inner.retryable_error_kind())
188 }
189 _ => None,
190 }
191 }
192}
193impl GetThreadHistoryError {
194 pub fn new(kind: GetThreadHistoryErrorKind, meta: aws_smithy_types::Error) -> Self {
196 Self { kind, meta }
197 }
198
199 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
201 Self {
202 kind: GetThreadHistoryErrorKind::Unhandled(err.into()),
203 meta: Default::default(),
204 }
205 }
206
207 pub fn generic(err: aws_smithy_types::Error) -> Self {
209 Self {
210 meta: err.clone(),
211 kind: GetThreadHistoryErrorKind::Unhandled(err.into()),
212 }
213 }
214
215 pub fn message(&self) -> Option<&str> {
217 self.meta.message()
218 }
219
220 pub fn meta(&self) -> &aws_smithy_types::Error {
223 &self.meta
224 }
225
226 pub fn request_id(&self) -> Option<&str> {
228 self.meta.request_id()
229 }
230
231 pub fn code(&self) -> Option<&str> {
233 self.meta.code()
234 }
235 pub fn is_internal_error(&self) -> bool {
237 matches!(&self.kind, GetThreadHistoryErrorKind::InternalError(_))
238 }
239 pub fn is_rate_limit_error(&self) -> bool {
241 matches!(&self.kind, GetThreadHistoryErrorKind::RateLimitError(_))
242 }
243 pub fn is_forbidden_error(&self) -> bool {
245 matches!(&self.kind, GetThreadHistoryErrorKind::ForbiddenError(_))
246 }
247 pub fn is_unauthorized_error(&self) -> bool {
249 matches!(&self.kind, GetThreadHistoryErrorKind::UnauthorizedError(_))
250 }
251 pub fn is_not_found_error(&self) -> bool {
253 matches!(&self.kind, GetThreadHistoryErrorKind::NotFoundError(_))
254 }
255 pub fn is_bad_request_error(&self) -> bool {
257 matches!(&self.kind, GetThreadHistoryErrorKind::BadRequestError(_))
258 }
259}
260impl std::error::Error for GetThreadHistoryError {
261 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
262 match &self.kind {
263 GetThreadHistoryErrorKind::InternalError(_inner) => Some(_inner),
264 GetThreadHistoryErrorKind::RateLimitError(_inner) => Some(_inner),
265 GetThreadHistoryErrorKind::ForbiddenError(_inner) => Some(_inner),
266 GetThreadHistoryErrorKind::UnauthorizedError(_inner) => Some(_inner),
267 GetThreadHistoryErrorKind::NotFoundError(_inner) => Some(_inner),
268 GetThreadHistoryErrorKind::BadRequestError(_inner) => Some(_inner),
269 GetThreadHistoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
270 }
271 }
272}
273
274#[non_exhaustive]
276#[derive(std::fmt::Debug)]
277pub struct GetThreadTopicError {
278 pub kind: GetThreadTopicErrorKind,
280 pub(crate) meta: aws_smithy_types::Error,
282}
283#[non_exhaustive]
285#[derive(std::fmt::Debug)]
286pub enum GetThreadTopicErrorKind {
287 InternalError(crate::error::InternalError),
289 RateLimitError(crate::error::RateLimitError),
291 ForbiddenError(crate::error::ForbiddenError),
293 UnauthorizedError(crate::error::UnauthorizedError),
295 NotFoundError(crate::error::NotFoundError),
297 BadRequestError(crate::error::BadRequestError),
299 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
301}
302impl std::fmt::Display for GetThreadTopicError {
303 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
304 match &self.kind {
305 GetThreadTopicErrorKind::InternalError(_inner) => _inner.fmt(f),
306 GetThreadTopicErrorKind::RateLimitError(_inner) => _inner.fmt(f),
307 GetThreadTopicErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
308 GetThreadTopicErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
309 GetThreadTopicErrorKind::NotFoundError(_inner) => _inner.fmt(f),
310 GetThreadTopicErrorKind::BadRequestError(_inner) => _inner.fmt(f),
311 GetThreadTopicErrorKind::Unhandled(_inner) => _inner.fmt(f),
312 }
313 }
314}
315impl aws_smithy_types::retry::ProvideErrorKind for GetThreadTopicError {
316 fn code(&self) -> Option<&str> {
317 GetThreadTopicError::code(self)
318 }
319 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
320 match &self.kind {
321 GetThreadTopicErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
322 GetThreadTopicErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
323 _ => None,
324 }
325 }
326}
327impl GetThreadTopicError {
328 pub fn new(kind: GetThreadTopicErrorKind, meta: aws_smithy_types::Error) -> Self {
330 Self { kind, meta }
331 }
332
333 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
335 Self {
336 kind: GetThreadTopicErrorKind::Unhandled(err.into()),
337 meta: Default::default(),
338 }
339 }
340
341 pub fn generic(err: aws_smithy_types::Error) -> Self {
343 Self {
344 meta: err.clone(),
345 kind: GetThreadTopicErrorKind::Unhandled(err.into()),
346 }
347 }
348
349 pub fn message(&self) -> Option<&str> {
351 self.meta.message()
352 }
353
354 pub fn meta(&self) -> &aws_smithy_types::Error {
357 &self.meta
358 }
359
360 pub fn request_id(&self) -> Option<&str> {
362 self.meta.request_id()
363 }
364
365 pub fn code(&self) -> Option<&str> {
367 self.meta.code()
368 }
369 pub fn is_internal_error(&self) -> bool {
371 matches!(&self.kind, GetThreadTopicErrorKind::InternalError(_))
372 }
373 pub fn is_rate_limit_error(&self) -> bool {
375 matches!(&self.kind, GetThreadTopicErrorKind::RateLimitError(_))
376 }
377 pub fn is_forbidden_error(&self) -> bool {
379 matches!(&self.kind, GetThreadTopicErrorKind::ForbiddenError(_))
380 }
381 pub fn is_unauthorized_error(&self) -> bool {
383 matches!(&self.kind, GetThreadTopicErrorKind::UnauthorizedError(_))
384 }
385 pub fn is_not_found_error(&self) -> bool {
387 matches!(&self.kind, GetThreadTopicErrorKind::NotFoundError(_))
388 }
389 pub fn is_bad_request_error(&self) -> bool {
391 matches!(&self.kind, GetThreadTopicErrorKind::BadRequestError(_))
392 }
393}
394impl std::error::Error for GetThreadTopicError {
395 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
396 match &self.kind {
397 GetThreadTopicErrorKind::InternalError(_inner) => Some(_inner),
398 GetThreadTopicErrorKind::RateLimitError(_inner) => Some(_inner),
399 GetThreadTopicErrorKind::ForbiddenError(_inner) => Some(_inner),
400 GetThreadTopicErrorKind::UnauthorizedError(_inner) => Some(_inner),
401 GetThreadTopicErrorKind::NotFoundError(_inner) => Some(_inner),
402 GetThreadTopicErrorKind::BadRequestError(_inner) => Some(_inner),
403 GetThreadTopicErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
404 }
405 }
406}
407
408#[non_exhaustive]
410#[derive(std::fmt::Debug)]
411pub struct SendChatMessageError {
412 pub kind: SendChatMessageErrorKind,
414 pub(crate) meta: aws_smithy_types::Error,
416}
417#[non_exhaustive]
419#[derive(std::fmt::Debug)]
420pub enum SendChatMessageErrorKind {
421 InternalError(crate::error::InternalError),
423 RateLimitError(crate::error::RateLimitError),
425 ForbiddenError(crate::error::ForbiddenError),
427 UnauthorizedError(crate::error::UnauthorizedError),
429 NotFoundError(crate::error::NotFoundError),
431 BadRequestError(crate::error::BadRequestError),
433 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
435}
436impl std::fmt::Display for SendChatMessageError {
437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
438 match &self.kind {
439 SendChatMessageErrorKind::InternalError(_inner) => _inner.fmt(f),
440 SendChatMessageErrorKind::RateLimitError(_inner) => _inner.fmt(f),
441 SendChatMessageErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
442 SendChatMessageErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
443 SendChatMessageErrorKind::NotFoundError(_inner) => _inner.fmt(f),
444 SendChatMessageErrorKind::BadRequestError(_inner) => _inner.fmt(f),
445 SendChatMessageErrorKind::Unhandled(_inner) => _inner.fmt(f),
446 }
447 }
448}
449impl aws_smithy_types::retry::ProvideErrorKind for SendChatMessageError {
450 fn code(&self) -> Option<&str> {
451 SendChatMessageError::code(self)
452 }
453 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
454 match &self.kind {
455 SendChatMessageErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
456 SendChatMessageErrorKind::UnauthorizedError(inner) => {
457 Some(inner.retryable_error_kind())
458 }
459 _ => None,
460 }
461 }
462}
463impl SendChatMessageError {
464 pub fn new(kind: SendChatMessageErrorKind, meta: aws_smithy_types::Error) -> Self {
466 Self { kind, meta }
467 }
468
469 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
471 Self {
472 kind: SendChatMessageErrorKind::Unhandled(err.into()),
473 meta: Default::default(),
474 }
475 }
476
477 pub fn generic(err: aws_smithy_types::Error) -> Self {
479 Self {
480 meta: err.clone(),
481 kind: SendChatMessageErrorKind::Unhandled(err.into()),
482 }
483 }
484
485 pub fn message(&self) -> Option<&str> {
487 self.meta.message()
488 }
489
490 pub fn meta(&self) -> &aws_smithy_types::Error {
493 &self.meta
494 }
495
496 pub fn request_id(&self) -> Option<&str> {
498 self.meta.request_id()
499 }
500
501 pub fn code(&self) -> Option<&str> {
503 self.meta.code()
504 }
505 pub fn is_internal_error(&self) -> bool {
507 matches!(&self.kind, SendChatMessageErrorKind::InternalError(_))
508 }
509 pub fn is_rate_limit_error(&self) -> bool {
511 matches!(&self.kind, SendChatMessageErrorKind::RateLimitError(_))
512 }
513 pub fn is_forbidden_error(&self) -> bool {
515 matches!(&self.kind, SendChatMessageErrorKind::ForbiddenError(_))
516 }
517 pub fn is_unauthorized_error(&self) -> bool {
519 matches!(&self.kind, SendChatMessageErrorKind::UnauthorizedError(_))
520 }
521 pub fn is_not_found_error(&self) -> bool {
523 matches!(&self.kind, SendChatMessageErrorKind::NotFoundError(_))
524 }
525 pub fn is_bad_request_error(&self) -> bool {
527 matches!(&self.kind, SendChatMessageErrorKind::BadRequestError(_))
528 }
529}
530impl std::error::Error for SendChatMessageError {
531 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
532 match &self.kind {
533 SendChatMessageErrorKind::InternalError(_inner) => Some(_inner),
534 SendChatMessageErrorKind::RateLimitError(_inner) => Some(_inner),
535 SendChatMessageErrorKind::ForbiddenError(_inner) => Some(_inner),
536 SendChatMessageErrorKind::UnauthorizedError(_inner) => Some(_inner),
537 SendChatMessageErrorKind::NotFoundError(_inner) => Some(_inner),
538 SendChatMessageErrorKind::BadRequestError(_inner) => Some(_inner),
539 SendChatMessageErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
540 }
541 }
542}
543
544#[non_exhaustive]
546#[derive(std::fmt::Debug)]
547pub struct SetThreadReadError {
548 pub kind: SetThreadReadErrorKind,
550 pub(crate) meta: aws_smithy_types::Error,
552}
553#[non_exhaustive]
555#[derive(std::fmt::Debug)]
556pub enum SetThreadReadErrorKind {
557 InternalError(crate::error::InternalError),
559 RateLimitError(crate::error::RateLimitError),
561 ForbiddenError(crate::error::ForbiddenError),
563 UnauthorizedError(crate::error::UnauthorizedError),
565 NotFoundError(crate::error::NotFoundError),
567 BadRequestError(crate::error::BadRequestError),
569 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
571}
572impl std::fmt::Display for SetThreadReadError {
573 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
574 match &self.kind {
575 SetThreadReadErrorKind::InternalError(_inner) => _inner.fmt(f),
576 SetThreadReadErrorKind::RateLimitError(_inner) => _inner.fmt(f),
577 SetThreadReadErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
578 SetThreadReadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
579 SetThreadReadErrorKind::NotFoundError(_inner) => _inner.fmt(f),
580 SetThreadReadErrorKind::BadRequestError(_inner) => _inner.fmt(f),
581 SetThreadReadErrorKind::Unhandled(_inner) => _inner.fmt(f),
582 }
583 }
584}
585impl aws_smithy_types::retry::ProvideErrorKind for SetThreadReadError {
586 fn code(&self) -> Option<&str> {
587 SetThreadReadError::code(self)
588 }
589 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
590 match &self.kind {
591 SetThreadReadErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
592 SetThreadReadErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
593 _ => None,
594 }
595 }
596}
597impl SetThreadReadError {
598 pub fn new(kind: SetThreadReadErrorKind, meta: aws_smithy_types::Error) -> Self {
600 Self { kind, meta }
601 }
602
603 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
605 Self {
606 kind: SetThreadReadErrorKind::Unhandled(err.into()),
607 meta: Default::default(),
608 }
609 }
610
611 pub fn generic(err: aws_smithy_types::Error) -> Self {
613 Self {
614 meta: err.clone(),
615 kind: SetThreadReadErrorKind::Unhandled(err.into()),
616 }
617 }
618
619 pub fn message(&self) -> Option<&str> {
621 self.meta.message()
622 }
623
624 pub fn meta(&self) -> &aws_smithy_types::Error {
627 &self.meta
628 }
629
630 pub fn request_id(&self) -> Option<&str> {
632 self.meta.request_id()
633 }
634
635 pub fn code(&self) -> Option<&str> {
637 self.meta.code()
638 }
639 pub fn is_internal_error(&self) -> bool {
641 matches!(&self.kind, SetThreadReadErrorKind::InternalError(_))
642 }
643 pub fn is_rate_limit_error(&self) -> bool {
645 matches!(&self.kind, SetThreadReadErrorKind::RateLimitError(_))
646 }
647 pub fn is_forbidden_error(&self) -> bool {
649 matches!(&self.kind, SetThreadReadErrorKind::ForbiddenError(_))
650 }
651 pub fn is_unauthorized_error(&self) -> bool {
653 matches!(&self.kind, SetThreadReadErrorKind::UnauthorizedError(_))
654 }
655 pub fn is_not_found_error(&self) -> bool {
657 matches!(&self.kind, SetThreadReadErrorKind::NotFoundError(_))
658 }
659 pub fn is_bad_request_error(&self) -> bool {
661 matches!(&self.kind, SetThreadReadErrorKind::BadRequestError(_))
662 }
663}
664impl std::error::Error for SetThreadReadError {
665 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
666 match &self.kind {
667 SetThreadReadErrorKind::InternalError(_inner) => Some(_inner),
668 SetThreadReadErrorKind::RateLimitError(_inner) => Some(_inner),
669 SetThreadReadErrorKind::ForbiddenError(_inner) => Some(_inner),
670 SetThreadReadErrorKind::UnauthorizedError(_inner) => Some(_inner),
671 SetThreadReadErrorKind::NotFoundError(_inner) => Some(_inner),
672 SetThreadReadErrorKind::BadRequestError(_inner) => Some(_inner),
673 SetThreadReadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
674 }
675 }
676}
677
678#[non_exhaustive]
680#[derive(std::fmt::Debug)]
681pub struct SetTypingStatusError {
682 pub kind: SetTypingStatusErrorKind,
684 pub(crate) meta: aws_smithy_types::Error,
686}
687#[non_exhaustive]
689#[derive(std::fmt::Debug)]
690pub enum SetTypingStatusErrorKind {
691 InternalError(crate::error::InternalError),
693 RateLimitError(crate::error::RateLimitError),
695 ForbiddenError(crate::error::ForbiddenError),
697 UnauthorizedError(crate::error::UnauthorizedError),
699 NotFoundError(crate::error::NotFoundError),
701 BadRequestError(crate::error::BadRequestError),
703 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
705}
706impl std::fmt::Display for SetTypingStatusError {
707 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
708 match &self.kind {
709 SetTypingStatusErrorKind::InternalError(_inner) => _inner.fmt(f),
710 SetTypingStatusErrorKind::RateLimitError(_inner) => _inner.fmt(f),
711 SetTypingStatusErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
712 SetTypingStatusErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
713 SetTypingStatusErrorKind::NotFoundError(_inner) => _inner.fmt(f),
714 SetTypingStatusErrorKind::BadRequestError(_inner) => _inner.fmt(f),
715 SetTypingStatusErrorKind::Unhandled(_inner) => _inner.fmt(f),
716 }
717 }
718}
719impl aws_smithy_types::retry::ProvideErrorKind for SetTypingStatusError {
720 fn code(&self) -> Option<&str> {
721 SetTypingStatusError::code(self)
722 }
723 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
724 match &self.kind {
725 SetTypingStatusErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
726 SetTypingStatusErrorKind::UnauthorizedError(inner) => {
727 Some(inner.retryable_error_kind())
728 }
729 _ => None,
730 }
731 }
732}
733impl SetTypingStatusError {
734 pub fn new(kind: SetTypingStatusErrorKind, meta: aws_smithy_types::Error) -> Self {
736 Self { kind, meta }
737 }
738
739 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
741 Self {
742 kind: SetTypingStatusErrorKind::Unhandled(err.into()),
743 meta: Default::default(),
744 }
745 }
746
747 pub fn generic(err: aws_smithy_types::Error) -> Self {
749 Self {
750 meta: err.clone(),
751 kind: SetTypingStatusErrorKind::Unhandled(err.into()),
752 }
753 }
754
755 pub fn message(&self) -> Option<&str> {
757 self.meta.message()
758 }
759
760 pub fn meta(&self) -> &aws_smithy_types::Error {
763 &self.meta
764 }
765
766 pub fn request_id(&self) -> Option<&str> {
768 self.meta.request_id()
769 }
770
771 pub fn code(&self) -> Option<&str> {
773 self.meta.code()
774 }
775 pub fn is_internal_error(&self) -> bool {
777 matches!(&self.kind, SetTypingStatusErrorKind::InternalError(_))
778 }
779 pub fn is_rate_limit_error(&self) -> bool {
781 matches!(&self.kind, SetTypingStatusErrorKind::RateLimitError(_))
782 }
783 pub fn is_forbidden_error(&self) -> bool {
785 matches!(&self.kind, SetTypingStatusErrorKind::ForbiddenError(_))
786 }
787 pub fn is_unauthorized_error(&self) -> bool {
789 matches!(&self.kind, SetTypingStatusErrorKind::UnauthorizedError(_))
790 }
791 pub fn is_not_found_error(&self) -> bool {
793 matches!(&self.kind, SetTypingStatusErrorKind::NotFoundError(_))
794 }
795 pub fn is_bad_request_error(&self) -> bool {
797 matches!(&self.kind, SetTypingStatusErrorKind::BadRequestError(_))
798 }
799}
800impl std::error::Error for SetTypingStatusError {
801 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
802 match &self.kind {
803 SetTypingStatusErrorKind::InternalError(_inner) => Some(_inner),
804 SetTypingStatusErrorKind::RateLimitError(_inner) => Some(_inner),
805 SetTypingStatusErrorKind::ForbiddenError(_inner) => Some(_inner),
806 SetTypingStatusErrorKind::UnauthorizedError(_inner) => Some(_inner),
807 SetTypingStatusErrorKind::NotFoundError(_inner) => Some(_inner),
808 SetTypingStatusErrorKind::BadRequestError(_inner) => Some(_inner),
809 SetTypingStatusErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
810 }
811 }
812}
813
814#[non_exhaustive]
816#[derive(std::fmt::Debug)]
817pub struct WatchThreadError {
818 pub kind: WatchThreadErrorKind,
820 pub(crate) meta: aws_smithy_types::Error,
822}
823#[non_exhaustive]
825#[derive(std::fmt::Debug)]
826pub enum WatchThreadErrorKind {
827 InternalError(crate::error::InternalError),
829 RateLimitError(crate::error::RateLimitError),
831 ForbiddenError(crate::error::ForbiddenError),
833 UnauthorizedError(crate::error::UnauthorizedError),
835 NotFoundError(crate::error::NotFoundError),
837 BadRequestError(crate::error::BadRequestError),
839 Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
841}
842impl std::fmt::Display for WatchThreadError {
843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
844 match &self.kind {
845 WatchThreadErrorKind::InternalError(_inner) => _inner.fmt(f),
846 WatchThreadErrorKind::RateLimitError(_inner) => _inner.fmt(f),
847 WatchThreadErrorKind::ForbiddenError(_inner) => _inner.fmt(f),
848 WatchThreadErrorKind::UnauthorizedError(_inner) => _inner.fmt(f),
849 WatchThreadErrorKind::NotFoundError(_inner) => _inner.fmt(f),
850 WatchThreadErrorKind::BadRequestError(_inner) => _inner.fmt(f),
851 WatchThreadErrorKind::Unhandled(_inner) => _inner.fmt(f),
852 }
853 }
854}
855impl aws_smithy_types::retry::ProvideErrorKind for WatchThreadError {
856 fn code(&self) -> Option<&str> {
857 WatchThreadError::code(self)
858 }
859 fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
860 match &self.kind {
861 WatchThreadErrorKind::InternalError(inner) => Some(inner.retryable_error_kind()),
862 WatchThreadErrorKind::UnauthorizedError(inner) => Some(inner.retryable_error_kind()),
863 _ => None,
864 }
865 }
866}
867impl WatchThreadError {
868 pub fn new(kind: WatchThreadErrorKind, meta: aws_smithy_types::Error) -> Self {
870 Self { kind, meta }
871 }
872
873 pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
875 Self {
876 kind: WatchThreadErrorKind::Unhandled(err.into()),
877 meta: Default::default(),
878 }
879 }
880
881 pub fn generic(err: aws_smithy_types::Error) -> Self {
883 Self {
884 meta: err.clone(),
885 kind: WatchThreadErrorKind::Unhandled(err.into()),
886 }
887 }
888
889 pub fn message(&self) -> Option<&str> {
891 self.meta.message()
892 }
893
894 pub fn meta(&self) -> &aws_smithy_types::Error {
897 &self.meta
898 }
899
900 pub fn request_id(&self) -> Option<&str> {
902 self.meta.request_id()
903 }
904
905 pub fn code(&self) -> Option<&str> {
907 self.meta.code()
908 }
909 pub fn is_internal_error(&self) -> bool {
911 matches!(&self.kind, WatchThreadErrorKind::InternalError(_))
912 }
913 pub fn is_rate_limit_error(&self) -> bool {
915 matches!(&self.kind, WatchThreadErrorKind::RateLimitError(_))
916 }
917 pub fn is_forbidden_error(&self) -> bool {
919 matches!(&self.kind, WatchThreadErrorKind::ForbiddenError(_))
920 }
921 pub fn is_unauthorized_error(&self) -> bool {
923 matches!(&self.kind, WatchThreadErrorKind::UnauthorizedError(_))
924 }
925 pub fn is_not_found_error(&self) -> bool {
927 matches!(&self.kind, WatchThreadErrorKind::NotFoundError(_))
928 }
929 pub fn is_bad_request_error(&self) -> bool {
931 matches!(&self.kind, WatchThreadErrorKind::BadRequestError(_))
932 }
933}
934impl std::error::Error for WatchThreadError {
935 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
936 match &self.kind {
937 WatchThreadErrorKind::InternalError(_inner) => Some(_inner),
938 WatchThreadErrorKind::RateLimitError(_inner) => Some(_inner),
939 WatchThreadErrorKind::ForbiddenError(_inner) => Some(_inner),
940 WatchThreadErrorKind::UnauthorizedError(_inner) => Some(_inner),
941 WatchThreadErrorKind::NotFoundError(_inner) => Some(_inner),
942 WatchThreadErrorKind::BadRequestError(_inner) => Some(_inner),
943 WatchThreadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
944 }
945 }
946}
947
948#[non_exhaustive]
950#[derive(std::clone::Clone, std::cmp::PartialEq)]
951pub struct BadRequestError {
952 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
954 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
956 pub metadata: std::option::Option<aws_smithy_types::Document>,
958}
959impl BadRequestError {
960 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
962 self.code.as_deref()
963 }
964 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
966 self.metadata.as_ref()
967 }
968}
969impl std::fmt::Debug for BadRequestError {
970 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
971 let mut formatter = f.debug_struct("BadRequestError");
972 formatter.field("code", &self.code);
973 formatter.field("message", &self.message);
974 formatter.field("metadata", &self.metadata);
975 formatter.finish()
976 }
977}
978impl BadRequestError {
979 pub fn message(&self) -> Option<&str> {
981 self.message.as_deref()
982 }
983}
984impl std::fmt::Display for BadRequestError {
985 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
986 write!(f, "BadRequestError")?;
987 if let Some(inner_1) = &self.message {
988 write!(f, ": {}", inner_1)?;
989 }
990 Ok(())
991 }
992}
993impl std::error::Error for BadRequestError {}
994pub mod bad_request_error {
996 #[non_exhaustive]
998 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
999 pub struct Builder {
1000 pub(crate) code: std::option::Option<std::string::String>,
1001 pub(crate) message: std::option::Option<std::string::String>,
1002 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1003 }
1004 impl Builder {
1005 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1007 self.code = Some(input.into());
1008 self
1009 }
1010 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1012 self.code = input;
1013 self
1014 }
1015 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1017 self.message = Some(input.into());
1018 self
1019 }
1020 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1022 self.message = input;
1023 self
1024 }
1025 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1027 self.metadata = Some(input);
1028 self
1029 }
1030 pub fn set_metadata(
1032 mut self,
1033 input: std::option::Option<aws_smithy_types::Document>,
1034 ) -> Self {
1035 self.metadata = input;
1036 self
1037 }
1038 pub fn build(self) -> crate::error::BadRequestError {
1040 crate::error::BadRequestError {
1041 code: self.code,
1042 message: self.message,
1043 metadata: self.metadata,
1044 }
1045 }
1046 }
1047}
1048impl BadRequestError {
1049 pub fn builder() -> crate::error::bad_request_error::Builder {
1051 crate::error::bad_request_error::Builder::default()
1052 }
1053}
1054
1055#[non_exhaustive]
1057#[derive(std::clone::Clone, std::cmp::PartialEq)]
1058pub struct NotFoundError {
1059 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
1061 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
1063 pub metadata: std::option::Option<aws_smithy_types::Document>,
1065}
1066impl NotFoundError {
1067 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
1069 self.code.as_deref()
1070 }
1071 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1073 self.metadata.as_ref()
1074 }
1075}
1076impl std::fmt::Debug for NotFoundError {
1077 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1078 let mut formatter = f.debug_struct("NotFoundError");
1079 formatter.field("code", &self.code);
1080 formatter.field("message", &self.message);
1081 formatter.field("metadata", &self.metadata);
1082 formatter.finish()
1083 }
1084}
1085impl NotFoundError {
1086 pub fn message(&self) -> Option<&str> {
1088 self.message.as_deref()
1089 }
1090}
1091impl std::fmt::Display for NotFoundError {
1092 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1093 write!(f, "NotFoundError")?;
1094 if let Some(inner_2) = &self.message {
1095 write!(f, ": {}", inner_2)?;
1096 }
1097 Ok(())
1098 }
1099}
1100impl std::error::Error for NotFoundError {}
1101pub mod not_found_error {
1103 #[non_exhaustive]
1105 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1106 pub struct Builder {
1107 pub(crate) code: std::option::Option<std::string::String>,
1108 pub(crate) message: std::option::Option<std::string::String>,
1109 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1110 }
1111 impl Builder {
1112 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1114 self.code = Some(input.into());
1115 self
1116 }
1117 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1119 self.code = input;
1120 self
1121 }
1122 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1124 self.message = Some(input.into());
1125 self
1126 }
1127 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1129 self.message = input;
1130 self
1131 }
1132 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1134 self.metadata = Some(input);
1135 self
1136 }
1137 pub fn set_metadata(
1139 mut self,
1140 input: std::option::Option<aws_smithy_types::Document>,
1141 ) -> Self {
1142 self.metadata = input;
1143 self
1144 }
1145 pub fn build(self) -> crate::error::NotFoundError {
1147 crate::error::NotFoundError {
1148 code: self.code,
1149 message: self.message,
1150 metadata: self.metadata,
1151 }
1152 }
1153 }
1154}
1155impl NotFoundError {
1156 pub fn builder() -> crate::error::not_found_error::Builder {
1158 crate::error::not_found_error::Builder::default()
1159 }
1160}
1161
1162#[non_exhaustive]
1164#[derive(std::clone::Clone, std::cmp::PartialEq)]
1165pub struct UnauthorizedError {
1166 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
1168 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
1170 pub metadata: std::option::Option<aws_smithy_types::Document>,
1172}
1173impl UnauthorizedError {
1174 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
1176 self.code.as_deref()
1177 }
1178 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1180 self.metadata.as_ref()
1181 }
1182}
1183impl std::fmt::Debug for UnauthorizedError {
1184 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1185 let mut formatter = f.debug_struct("UnauthorizedError");
1186 formatter.field("code", &self.code);
1187 formatter.field("message", &self.message);
1188 formatter.field("metadata", &self.metadata);
1189 formatter.finish()
1190 }
1191}
1192impl UnauthorizedError {
1193 pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
1195 aws_smithy_types::retry::ErrorKind::ClientError
1196 }
1197 pub fn message(&self) -> Option<&str> {
1199 self.message.as_deref()
1200 }
1201}
1202impl std::fmt::Display for UnauthorizedError {
1203 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1204 write!(f, "UnauthorizedError")?;
1205 if let Some(inner_3) = &self.message {
1206 write!(f, ": {}", inner_3)?;
1207 }
1208 Ok(())
1209 }
1210}
1211impl std::error::Error for UnauthorizedError {}
1212pub mod unauthorized_error {
1214 #[non_exhaustive]
1216 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1217 pub struct Builder {
1218 pub(crate) code: std::option::Option<std::string::String>,
1219 pub(crate) message: std::option::Option<std::string::String>,
1220 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1221 }
1222 impl Builder {
1223 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1225 self.code = Some(input.into());
1226 self
1227 }
1228 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1230 self.code = input;
1231 self
1232 }
1233 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1235 self.message = Some(input.into());
1236 self
1237 }
1238 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1240 self.message = input;
1241 self
1242 }
1243 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1245 self.metadata = Some(input);
1246 self
1247 }
1248 pub fn set_metadata(
1250 mut self,
1251 input: std::option::Option<aws_smithy_types::Document>,
1252 ) -> Self {
1253 self.metadata = input;
1254 self
1255 }
1256 pub fn build(self) -> crate::error::UnauthorizedError {
1258 crate::error::UnauthorizedError {
1259 code: self.code,
1260 message: self.message,
1261 metadata: self.metadata,
1262 }
1263 }
1264 }
1265}
1266impl UnauthorizedError {
1267 pub fn builder() -> crate::error::unauthorized_error::Builder {
1269 crate::error::unauthorized_error::Builder::default()
1270 }
1271}
1272
1273#[non_exhaustive]
1275#[derive(std::clone::Clone, std::cmp::PartialEq)]
1276pub struct ForbiddenError {
1277 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
1279 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
1281 pub metadata: std::option::Option<aws_smithy_types::Document>,
1283}
1284impl ForbiddenError {
1285 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
1287 self.code.as_deref()
1288 }
1289 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1291 self.metadata.as_ref()
1292 }
1293}
1294impl std::fmt::Debug for ForbiddenError {
1295 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1296 let mut formatter = f.debug_struct("ForbiddenError");
1297 formatter.field("code", &self.code);
1298 formatter.field("message", &self.message);
1299 formatter.field("metadata", &self.metadata);
1300 formatter.finish()
1301 }
1302}
1303impl ForbiddenError {
1304 pub fn message(&self) -> Option<&str> {
1306 self.message.as_deref()
1307 }
1308}
1309impl std::fmt::Display for ForbiddenError {
1310 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1311 write!(f, "ForbiddenError")?;
1312 if let Some(inner_4) = &self.message {
1313 write!(f, ": {}", inner_4)?;
1314 }
1315 Ok(())
1316 }
1317}
1318impl std::error::Error for ForbiddenError {}
1319pub mod forbidden_error {
1321 #[non_exhaustive]
1323 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1324 pub struct Builder {
1325 pub(crate) code: std::option::Option<std::string::String>,
1326 pub(crate) message: std::option::Option<std::string::String>,
1327 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1328 }
1329 impl Builder {
1330 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1332 self.code = Some(input.into());
1333 self
1334 }
1335 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1337 self.code = input;
1338 self
1339 }
1340 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1342 self.message = Some(input.into());
1343 self
1344 }
1345 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1347 self.message = input;
1348 self
1349 }
1350 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1352 self.metadata = Some(input);
1353 self
1354 }
1355 pub fn set_metadata(
1357 mut self,
1358 input: std::option::Option<aws_smithy_types::Document>,
1359 ) -> Self {
1360 self.metadata = input;
1361 self
1362 }
1363 pub fn build(self) -> crate::error::ForbiddenError {
1365 crate::error::ForbiddenError {
1366 code: self.code,
1367 message: self.message,
1368 metadata: self.metadata,
1369 }
1370 }
1371 }
1372}
1373impl ForbiddenError {
1374 pub fn builder() -> crate::error::forbidden_error::Builder {
1376 crate::error::forbidden_error::Builder::default()
1377 }
1378}
1379
1380#[non_exhaustive]
1382#[derive(std::clone::Clone, std::cmp::PartialEq)]
1383pub struct RateLimitError {
1384 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
1386 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
1388 pub metadata: std::option::Option<aws_smithy_types::Document>,
1390}
1391impl RateLimitError {
1392 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
1394 self.code.as_deref()
1395 }
1396 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1398 self.metadata.as_ref()
1399 }
1400}
1401impl std::fmt::Debug for RateLimitError {
1402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1403 let mut formatter = f.debug_struct("RateLimitError");
1404 formatter.field("code", &self.code);
1405 formatter.field("message", &self.message);
1406 formatter.field("metadata", &self.metadata);
1407 formatter.finish()
1408 }
1409}
1410impl RateLimitError {
1411 pub fn message(&self) -> Option<&str> {
1413 self.message.as_deref()
1414 }
1415}
1416impl std::fmt::Display for RateLimitError {
1417 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1418 write!(f, "RateLimitError")?;
1419 if let Some(inner_5) = &self.message {
1420 write!(f, ": {}", inner_5)?;
1421 }
1422 Ok(())
1423 }
1424}
1425impl std::error::Error for RateLimitError {}
1426pub mod rate_limit_error {
1428 #[non_exhaustive]
1430 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1431 pub struct Builder {
1432 pub(crate) code: std::option::Option<std::string::String>,
1433 pub(crate) message: std::option::Option<std::string::String>,
1434 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1435 }
1436 impl Builder {
1437 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1439 self.code = Some(input.into());
1440 self
1441 }
1442 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1444 self.code = input;
1445 self
1446 }
1447 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1449 self.message = Some(input.into());
1450 self
1451 }
1452 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1454 self.message = input;
1455 self
1456 }
1457 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1459 self.metadata = Some(input);
1460 self
1461 }
1462 pub fn set_metadata(
1464 mut self,
1465 input: std::option::Option<aws_smithy_types::Document>,
1466 ) -> Self {
1467 self.metadata = input;
1468 self
1469 }
1470 pub fn build(self) -> crate::error::RateLimitError {
1472 crate::error::RateLimitError {
1473 code: self.code,
1474 message: self.message,
1475 metadata: self.metadata,
1476 }
1477 }
1478 }
1479}
1480impl RateLimitError {
1481 pub fn builder() -> crate::error::rate_limit_error::Builder {
1483 crate::error::rate_limit_error::Builder::default()
1484 }
1485}
1486
1487#[non_exhaustive]
1489#[derive(std::clone::Clone, std::cmp::PartialEq)]
1490pub struct InternalError {
1491 #[allow(missing_docs)] pub code: std::option::Option<std::string::String>,
1493 #[allow(missing_docs)] pub message: std::option::Option<std::string::String>,
1495 pub metadata: std::option::Option<aws_smithy_types::Document>,
1497}
1498impl InternalError {
1499 #[allow(missing_docs)] pub fn code(&self) -> std::option::Option<&str> {
1501 self.code.as_deref()
1502 }
1503 pub fn metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1505 self.metadata.as_ref()
1506 }
1507}
1508impl std::fmt::Debug for InternalError {
1509 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1510 let mut formatter = f.debug_struct("InternalError");
1511 formatter.field("code", &self.code);
1512 formatter.field("message", &self.message);
1513 formatter.field("metadata", &self.metadata);
1514 formatter.finish()
1515 }
1516}
1517impl InternalError {
1518 pub fn retryable_error_kind(&self) -> aws_smithy_types::retry::ErrorKind {
1520 aws_smithy_types::retry::ErrorKind::ServerError
1521 }
1522 pub fn message(&self) -> Option<&str> {
1524 self.message.as_deref()
1525 }
1526}
1527impl std::fmt::Display for InternalError {
1528 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1529 write!(f, "InternalError")?;
1530 if let Some(inner_6) = &self.message {
1531 write!(f, ": {}", inner_6)?;
1532 }
1533 Ok(())
1534 }
1535}
1536impl std::error::Error for InternalError {}
1537pub mod internal_error {
1539 #[non_exhaustive]
1541 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1542 pub struct Builder {
1543 pub(crate) code: std::option::Option<std::string::String>,
1544 pub(crate) message: std::option::Option<std::string::String>,
1545 pub(crate) metadata: std::option::Option<aws_smithy_types::Document>,
1546 }
1547 impl Builder {
1548 #[allow(missing_docs)] pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
1550 self.code = Some(input.into());
1551 self
1552 }
1553 #[allow(missing_docs)] pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
1555 self.code = input;
1556 self
1557 }
1558 #[allow(missing_docs)] pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1560 self.message = Some(input.into());
1561 self
1562 }
1563 #[allow(missing_docs)] pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1565 self.message = input;
1566 self
1567 }
1568 pub fn metadata(mut self, input: aws_smithy_types::Document) -> Self {
1570 self.metadata = Some(input);
1571 self
1572 }
1573 pub fn set_metadata(
1575 mut self,
1576 input: std::option::Option<aws_smithy_types::Document>,
1577 ) -> Self {
1578 self.metadata = input;
1579 self
1580 }
1581 pub fn build(self) -> crate::error::InternalError {
1583 crate::error::InternalError {
1584 code: self.code,
1585 message: self.message,
1586 metadata: self.metadata,
1587 }
1588 }
1589 }
1590}
1591impl InternalError {
1592 pub fn builder() -> crate::error::internal_error::Builder {
1594 crate::error::internal_error::Builder::default()
1595 }
1596}