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