1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub use crate::types::error::_validation_exception::ValidationError;
|
3 - |
|
4 - | pub use crate::types::error::_storage_access_not_authorized::StorageAccessNotAuthorized;
|
2 + | pub use crate::types::error::_unsupported_region_error::UnsupportedRegionError;
|
5 3 |
|
6 - | pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundError;
|
4 + | pub use crate::types::error::_throttling_error::ThrottlingError;
|
7 5 |
|
8 - | pub use crate::types::error::_invalid_pokeball_error::InvalidPokeballError;
|
6 + | pub use crate::types::error::_validation_exception::ValidationError;
|
9 7 |
|
10 8 | pub use crate::types::error::_master_ball_unsuccessful::MasterBallUnsuccessful;
|
11 9 |
|
12 - | pub use crate::types::error::_throttling_error::ThrottlingError;
|
10 + | pub use crate::types::error::_invalid_pokeball_error::InvalidPokeballError;
|
13 11 |
|
14 - | pub use crate::types::error::_unsupported_region_error::UnsupportedRegionError;
|
12 + | pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundError;
|
15 13 |
|
16 - | /// Error type for the `CapturePokemonEventsError` operation.
|
14 + | pub use crate::types::error::_storage_access_not_authorized::StorageAccessNotAuthorized;
|
15 + |
|
16 + | /// Error type for the `AttemptCapturingPokemonEventError` operation.
|
17 17 | #[non_exhaustive]
|
18 18 | #[derive(::std::fmt::Debug)]
|
19 - | pub enum CapturePokemonEventsError {
|
20 - | #[allow(missing_docs)] // documentation missing in model
|
21 - | InvalidPokeballError(crate::types::error::InvalidPokeballError),
|
19 + | pub enum AttemptCapturingPokemonEventError {
|
22 20 | #[allow(missing_docs)] // documentation missing in model
|
23 - | ThrottlingError(crate::types::error::ThrottlingError),
|
21 + | MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
|
24 22 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
25 23 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
26 24 | variable wildcard pattern and check `.code()`:
|
27 25 | \
|
28 26 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
29 27 | \
|
30 - | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CapturePokemonEventsError) for what information is available for the error.")]
|
28 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AttemptCapturingPokemonEventError) for what information is available for the error.")]
|
31 29 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
32 30 | }
|
33 - | impl CapturePokemonEventsError {
|
34 - | /// Creates the `CapturePokemonEventsError::Unhandled` variant from any error type.
|
31 + | impl AttemptCapturingPokemonEventError {
|
32 + | /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from any error type.
|
35 33 | pub fn unhandled(
|
36 34 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
37 35 | ) -> Self {
|
38 36 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
39 37 | source: err.into(),
|
40 38 | meta: ::std::default::Default::default(),
|
41 39 | })
|
42 40 | }
|
43 41 |
|
44 - | /// Creates the `CapturePokemonEventsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
42 + | /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
45 43 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
46 44 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
47 45 | source: err.clone().into(),
|
48 46 | meta: err,
|
49 47 | })
|
50 48 | }
|
51 49 | ///
|
52 50 | /// Returns error metadata, which includes the error code, message,
|
53 51 | /// request ID, and potentially additional information.
|
54 52 | ///
|
55 53 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
56 54 | match self {
|
57 - | Self::InvalidPokeballError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
58 - | Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
55 + | Self::MasterBallUnsuccessful(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
59 56 | Self::Unhandled(e) => &e.meta,
|
60 57 | }
|
61 58 | }
|
62 - | /// Returns `true` if the error kind is `CapturePokemonEventsError::InvalidPokeballError`.
|
63 - | pub fn is_invalid_pokeball_error(&self) -> bool {
|
64 - | matches!(self, Self::InvalidPokeballError(_))
|
65 - | }
|
66 - | /// Returns `true` if the error kind is `CapturePokemonEventsError::ThrottlingError`.
|
67 - | pub fn is_throttling_error(&self) -> bool {
|
68 - | matches!(self, Self::ThrottlingError(_))
|
59 + | /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
|
60 + | pub fn is_master_ball_unsuccessful(&self) -> bool {
|
61 + | matches!(self, Self::MasterBallUnsuccessful(_))
|
69 62 | }
|
70 63 | }
|
71 - | impl ::std::error::Error for CapturePokemonEventsError {
|
64 + | impl ::std::error::Error for AttemptCapturingPokemonEventError {
|
72 65 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
73 66 | match self {
|
74 - | Self::InvalidPokeballError(_inner) => ::std::option::Option::Some(_inner),
|
75 - | Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner),
|
67 + | Self::MasterBallUnsuccessful(_inner) => ::std::option::Option::Some(_inner),
|
76 68 | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
77 69 | }
|
78 70 | }
|
79 71 | }
|
80 - | impl ::std::fmt::Display for CapturePokemonEventsError {
|
72 + | impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
|
81 73 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
82 74 | match self {
|
83 - | Self::InvalidPokeballError(_inner) => _inner.fmt(f),
|
84 - | Self::ThrottlingError(_inner) => _inner.fmt(f),
|
75 + | Self::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
|
85 76 | Self::Unhandled(_inner) => {
|
86 77 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
87 78 | write!(f, "unhandled error ({code})")
|
88 79 | } else {
|
89 80 | f.write_str("unhandled error")
|
90 81 | }
|
91 82 | }
|
92 83 | }
|
93 84 | }
|
94 85 | }
|
95 - | impl ::aws_smithy_types::retry::ProvideErrorKind for CapturePokemonEventsError {
|
86 + | impl ::aws_smithy_types::retry::ProvideErrorKind for AttemptCapturingPokemonEventError {
|
96 87 | fn code(&self) -> ::std::option::Option<&str> {
|
97 88 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
98 89 | }
|
99 90 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
100 91 | ::std::option::Option::None
|
101 92 | }
|
102 93 | }
|
103 - | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CapturePokemonEventsError {
|
94 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AttemptCapturingPokemonEventError {
|
104 95 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
105 96 | match self {
|
106 - | Self::InvalidPokeballError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
107 - | Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
97 + | Self::MasterBallUnsuccessful(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
108 98 | Self::Unhandled(_inner) => &_inner.meta,
|
109 99 | }
|
110 100 | }
|
111 101 | }
|
112 - | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CapturePokemonEventsError {
|
102 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AttemptCapturingPokemonEventError {
|
113 103 | fn create_unhandled_error(
|
114 104 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
115 105 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
116 106 | ) -> Self {
|
117 107 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
118 108 | source,
|
119 109 | meta: meta.unwrap_or_default(),
|
120 110 | })
|
121 111 | }
|
122 112 | }
|
123 113 |
|
124 - | /// Error type for the `AttemptCapturingPokemonEventError` operation.
|
114 + | /// Error type for the `CapturePokemonEventsError` operation.
|
125 115 | #[non_exhaustive]
|
126 116 | #[derive(::std::fmt::Debug)]
|
127 - | pub enum AttemptCapturingPokemonEventError {
|
117 + | pub enum CapturePokemonEventsError {
|
128 118 | #[allow(missing_docs)] // documentation missing in model
|
129 - | MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
|
119 + | InvalidPokeballError(crate::types::error::InvalidPokeballError),
|
120 + | #[allow(missing_docs)] // documentation missing in model
|
121 + | ThrottlingError(crate::types::error::ThrottlingError),
|
130 122 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
131 123 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
132 124 | variable wildcard pattern and check `.code()`:
|
133 125 | \
|
134 126 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
135 127 | \
|
136 - | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AttemptCapturingPokemonEventError) for what information is available for the error.")]
|
128 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CapturePokemonEventsError) for what information is available for the error.")]
|
137 129 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
138 130 | }
|
139 - | impl AttemptCapturingPokemonEventError {
|
140 - | /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from any error type.
|
131 + | impl CapturePokemonEventsError {
|
132 + | /// Creates the `CapturePokemonEventsError::Unhandled` variant from any error type.
|
141 133 | pub fn unhandled(
|
142 134 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
143 135 | ) -> Self {
|
144 136 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
145 137 | source: err.into(),
|
146 138 | meta: ::std::default::Default::default(),
|
147 139 | })
|
148 140 | }
|
149 141 |
|
150 - | /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
142 + | /// Creates the `CapturePokemonEventsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
151 143 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
152 144 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
153 145 | source: err.clone().into(),
|
154 146 | meta: err,
|
155 147 | })
|
156 148 | }
|
157 149 | ///
|
158 150 | /// Returns error metadata, which includes the error code, message,
|
159 151 | /// request ID, and potentially additional information.
|
160 152 | ///
|
161 153 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
162 154 | match self {
|
163 - | Self::MasterBallUnsuccessful(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
155 + | Self::InvalidPokeballError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
156 + | Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
164 157 | Self::Unhandled(e) => &e.meta,
|
165 158 | }
|
166 159 | }
|
167 - | /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
|
168 - | pub fn is_master_ball_unsuccessful(&self) -> bool {
|
169 - | matches!(self, Self::MasterBallUnsuccessful(_))
|
160 + | /// Returns `true` if the error kind is `CapturePokemonEventsError::InvalidPokeballError`.
|
161 + | pub fn is_invalid_pokeball_error(&self) -> bool {
|
162 + | matches!(self, Self::InvalidPokeballError(_))
|
163 + | }
|
164 + | /// Returns `true` if the error kind is `CapturePokemonEventsError::ThrottlingError`.
|
165 + | pub fn is_throttling_error(&self) -> bool {
|
166 + | matches!(self, Self::ThrottlingError(_))
|
170 167 | }
|
171 168 | }
|
172 - | impl ::std::error::Error for AttemptCapturingPokemonEventError {
|
169 + | impl ::std::error::Error for CapturePokemonEventsError {
|
173 170 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
174 171 | match self {
|
175 - | Self::MasterBallUnsuccessful(_inner) => ::std::option::Option::Some(_inner),
|
172 + | Self::InvalidPokeballError(_inner) => ::std::option::Option::Some(_inner),
|
173 + | Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner),
|
176 174 | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
177 175 | }
|
178 176 | }
|
179 177 | }
|
180 - | impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
|
178 + | impl ::std::fmt::Display for CapturePokemonEventsError {
|
181 179 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
182 180 | match self {
|
183 - | Self::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
|
181 + | Self::InvalidPokeballError(_inner) => _inner.fmt(f),
|
182 + | Self::ThrottlingError(_inner) => _inner.fmt(f),
|
184 183 | Self::Unhandled(_inner) => {
|
185 184 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
186 185 | write!(f, "unhandled error ({code})")
|
187 186 | } else {
|
188 187 | f.write_str("unhandled error")
|
189 188 | }
|
190 189 | }
|
191 190 | }
|
192 191 | }
|
193 192 | }
|
194 - | impl ::aws_smithy_types::retry::ProvideErrorKind for AttemptCapturingPokemonEventError {
|
193 + | impl ::aws_smithy_types::retry::ProvideErrorKind for CapturePokemonEventsError {
|
195 194 | fn code(&self) -> ::std::option::Option<&str> {
|
196 195 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
197 196 | }
|
198 197 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
199 198 | ::std::option::Option::None
|
200 199 | }
|
201 200 | }
|
202 - | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AttemptCapturingPokemonEventError {
|
201 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CapturePokemonEventsError {
|
203 202 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
204 203 | match self {
|
205 - | Self::MasterBallUnsuccessful(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
204 + | Self::InvalidPokeballError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
205 + | Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
206 206 | Self::Unhandled(_inner) => &_inner.meta,
|
207 207 | }
|
208 208 | }
|
209 209 | }
|
210 - | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AttemptCapturingPokemonEventError {
|
210 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CapturePokemonEventsError {
|
211 211 | fn create_unhandled_error(
|
212 212 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
213 213 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
214 214 | ) -> Self {
|
215 215 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
216 216 | source,
|
217 217 | meta: meta.unwrap_or_default(),
|
218 218 | })
|
219 219 | }
|
220 220 | }
|