1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | /// Error type for the `StartSnapshot` operation.
|
3 - | /// Each variant represents an error that can occur for the `StartSnapshot` operation.
|
2 + | /// Error type for the `CompleteSnapshot` operation.
|
3 + | /// Each variant represents an error that can occur for the `CompleteSnapshot` operation.
|
4 4 | #[derive(::std::fmt::Debug)]
|
5 - | pub enum StartSnapshotError {
|
5 + | pub enum CompleteSnapshotError {
|
6 6 | /// <p>An internal error has occurred.</p>
|
7 7 | InternalServerException(crate::error::InternalServerException),
|
8 8 | /// <p>The specified resource does not exist.</p>
|
9 9 | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
10 10 | /// <p>You do not have sufficient access to perform this action.</p>
|
11 11 | AccessDeniedException(crate::error::AccessDeniedException),
|
12 - | /// <p>The request uses the same client token as a previous, but non-identical request.</p>
|
13 - | ConflictException(crate::error::ConflictException),
|
14 12 | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
15 13 | RequestThrottledException(crate::error::RequestThrottledException),
|
16 14 | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
17 15 | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
18 - | /// <p>You have reached the limit for concurrent API requests. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance">Optimizing performance of the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
19 - | ConcurrentLimitExceededException(crate::error::ConcurrentLimitExceededException),
|
20 16 | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
21 17 | ValidationException(crate::error::ValidationException),
|
22 18 | #[allow(missing_docs)] // documentation missing in model
|
23 19 | InternalServerError(crate::error::InternalServerError),
|
24 20 | }
|
25 - | impl ::std::fmt::Display for StartSnapshotError {
|
21 + | impl ::std::fmt::Display for CompleteSnapshotError {
|
26 22 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
27 23 | match &self {
|
28 - | StartSnapshotError::InternalServerException(_inner) => _inner.fmt(f),
|
29 - | StartSnapshotError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
30 - | StartSnapshotError::AccessDeniedException(_inner) => _inner.fmt(f),
|
31 - | StartSnapshotError::ConflictException(_inner) => _inner.fmt(f),
|
32 - | StartSnapshotError::RequestThrottledException(_inner) => _inner.fmt(f),
|
33 - | StartSnapshotError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
34 - | StartSnapshotError::ConcurrentLimitExceededException(_inner) => _inner.fmt(f),
|
35 - | StartSnapshotError::ValidationException(_inner) => _inner.fmt(f),
|
36 - | StartSnapshotError::InternalServerError(_inner) => _inner.fmt(f),
|
24 + | CompleteSnapshotError::InternalServerException(_inner) => _inner.fmt(f),
|
25 + | CompleteSnapshotError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
26 + | CompleteSnapshotError::AccessDeniedException(_inner) => _inner.fmt(f),
|
27 + | CompleteSnapshotError::RequestThrottledException(_inner) => _inner.fmt(f),
|
28 + | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
29 + | CompleteSnapshotError::ValidationException(_inner) => _inner.fmt(f),
|
30 + | CompleteSnapshotError::InternalServerError(_inner) => _inner.fmt(f),
|
37 31 | }
|
38 32 | }
|
39 33 | }
|
40 - | impl StartSnapshotError {
|
41 - | /// Returns `true` if the error kind is `StartSnapshotError::InternalServerException`.
|
34 + | impl CompleteSnapshotError {
|
35 + | /// Returns `true` if the error kind is `CompleteSnapshotError::InternalServerException`.
|
42 36 | pub fn is_internal_server_exception(&self) -> bool {
|
43 - | matches!(&self, StartSnapshotError::InternalServerException(_))
|
37 + | matches!(&self, CompleteSnapshotError::InternalServerException(_))
|
44 38 | }
|
45 - | /// Returns `true` if the error kind is `StartSnapshotError::ResourceNotFoundException`.
|
39 + | /// Returns `true` if the error kind is `CompleteSnapshotError::ResourceNotFoundException`.
|
46 40 | pub fn is_resource_not_found_exception(&self) -> bool {
|
47 - | matches!(&self, StartSnapshotError::ResourceNotFoundException(_))
|
41 + | matches!(&self, CompleteSnapshotError::ResourceNotFoundException(_))
|
48 42 | }
|
49 - | /// Returns `true` if the error kind is `StartSnapshotError::AccessDeniedException`.
|
43 + | /// Returns `true` if the error kind is `CompleteSnapshotError::AccessDeniedException`.
|
50 44 | pub fn is_access_denied_exception(&self) -> bool {
|
51 - | matches!(&self, StartSnapshotError::AccessDeniedException(_))
|
52 - | }
|
53 - | /// Returns `true` if the error kind is `StartSnapshotError::ConflictException`.
|
54 - | pub fn is_conflict_exception(&self) -> bool {
|
55 - | matches!(&self, StartSnapshotError::ConflictException(_))
|
45 + | matches!(&self, CompleteSnapshotError::AccessDeniedException(_))
|
56 46 | }
|
57 - | /// Returns `true` if the error kind is `StartSnapshotError::RequestThrottledException`.
|
47 + | /// Returns `true` if the error kind is `CompleteSnapshotError::RequestThrottledException`.
|
58 48 | pub fn is_request_throttled_exception(&self) -> bool {
|
59 - | matches!(&self, StartSnapshotError::RequestThrottledException(_))
|
49 + | matches!(&self, CompleteSnapshotError::RequestThrottledException(_))
|
60 50 | }
|
61 - | /// Returns `true` if the error kind is `StartSnapshotError::ServiceQuotaExceededException`.
|
51 + | /// Returns `true` if the error kind is `CompleteSnapshotError::ServiceQuotaExceededException`.
|
62 52 | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
63 - | matches!(&self, StartSnapshotError::ServiceQuotaExceededException(_))
|
64 - | }
|
65 - | /// Returns `true` if the error kind is `StartSnapshotError::ConcurrentLimitExceededException`.
|
66 - | pub fn is_concurrent_limit_exceeded_exception(&self) -> bool {
|
67 53 | matches!(
|
68 54 | &self,
|
69 - | StartSnapshotError::ConcurrentLimitExceededException(_)
|
55 + | CompleteSnapshotError::ServiceQuotaExceededException(_)
|
70 56 | )
|
71 57 | }
|
72 - | /// Returns `true` if the error kind is `StartSnapshotError::ValidationException`.
|
58 + | /// Returns `true` if the error kind is `CompleteSnapshotError::ValidationException`.
|
73 59 | pub fn is_validation_exception(&self) -> bool {
|
74 - | matches!(&self, StartSnapshotError::ValidationException(_))
|
60 + | matches!(&self, CompleteSnapshotError::ValidationException(_))
|
75 61 | }
|
76 - | /// Returns `true` if the error kind is `StartSnapshotError::InternalServerError`.
|
62 + | /// Returns `true` if the error kind is `CompleteSnapshotError::InternalServerError`.
|
77 63 | pub fn is_internal_server_error(&self) -> bool {
|
78 - | matches!(&self, StartSnapshotError::InternalServerError(_))
|
64 + | matches!(&self, CompleteSnapshotError::InternalServerError(_))
|
79 65 | }
|
80 66 | /// Returns the error name string by matching the correct variant.
|
81 67 | pub fn name(&self) -> &'static str {
|
82 68 | match &self {
|
83 - | StartSnapshotError::InternalServerException(_inner) => _inner.name(),
|
84 - | StartSnapshotError::ResourceNotFoundException(_inner) => _inner.name(),
|
85 - | StartSnapshotError::AccessDeniedException(_inner) => _inner.name(),
|
86 - | StartSnapshotError::ConflictException(_inner) => _inner.name(),
|
87 - | StartSnapshotError::RequestThrottledException(_inner) => _inner.name(),
|
88 - | StartSnapshotError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
89 - | StartSnapshotError::ConcurrentLimitExceededException(_inner) => _inner.name(),
|
90 - | StartSnapshotError::ValidationException(_inner) => _inner.name(),
|
91 - | StartSnapshotError::InternalServerError(_inner) => _inner.name(),
|
69 + | CompleteSnapshotError::InternalServerException(_inner) => _inner.name(),
|
70 + | CompleteSnapshotError::ResourceNotFoundException(_inner) => _inner.name(),
|
71 + | CompleteSnapshotError::AccessDeniedException(_inner) => _inner.name(),
|
72 + | CompleteSnapshotError::RequestThrottledException(_inner) => _inner.name(),
|
73 + | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
74 + | CompleteSnapshotError::ValidationException(_inner) => _inner.name(),
|
75 + | CompleteSnapshotError::InternalServerError(_inner) => _inner.name(),
|
92 76 | }
|
93 77 | }
|
94 78 | }
|
95 - | impl ::std::error::Error for StartSnapshotError {
|
79 + | impl ::std::error::Error for CompleteSnapshotError {
|
96 80 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
97 81 | match &self {
|
98 - | StartSnapshotError::InternalServerException(_inner) => Some(_inner),
|
99 - | StartSnapshotError::ResourceNotFoundException(_inner) => Some(_inner),
|
100 - | StartSnapshotError::AccessDeniedException(_inner) => Some(_inner),
|
101 - | StartSnapshotError::ConflictException(_inner) => Some(_inner),
|
102 - | StartSnapshotError::RequestThrottledException(_inner) => Some(_inner),
|
103 - | StartSnapshotError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
104 - | StartSnapshotError::ConcurrentLimitExceededException(_inner) => Some(_inner),
|
105 - | StartSnapshotError::ValidationException(_inner) => Some(_inner),
|
106 - | StartSnapshotError::InternalServerError(_inner) => Some(_inner),
|
82 + | CompleteSnapshotError::InternalServerException(_inner) => Some(_inner),
|
83 + | CompleteSnapshotError::ResourceNotFoundException(_inner) => Some(_inner),
|
84 + | CompleteSnapshotError::AccessDeniedException(_inner) => Some(_inner),
|
85 + | CompleteSnapshotError::RequestThrottledException(_inner) => Some(_inner),
|
86 + | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
87 + | CompleteSnapshotError::ValidationException(_inner) => Some(_inner),
|
88 + | CompleteSnapshotError::InternalServerError(_inner) => Some(_inner),
|
107 89 | }
|
108 90 | }
|
109 91 | }
|
110 92 | impl ::std::convert::From<crate::error::InternalServerException>
|
111 - | for crate::error::StartSnapshotError
|
93 + | for crate::error::CompleteSnapshotError
|
112 94 | {
|
113 - | fn from(variant: crate::error::InternalServerException) -> crate::error::StartSnapshotError {
|
95 + | fn from(variant: crate::error::InternalServerException) -> crate::error::CompleteSnapshotError {
|
114 96 | Self::InternalServerException(variant)
|
115 97 | }
|
116 98 | }
|
117 99 | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
118 - | for crate::error::StartSnapshotError
|
100 + | for crate::error::CompleteSnapshotError
|
119 101 | {
|
120 - | fn from(variant: crate::error::ResourceNotFoundException) -> crate::error::StartSnapshotError {
|
102 + | fn from(
|
103 + | variant: crate::error::ResourceNotFoundException,
|
104 + | ) -> crate::error::CompleteSnapshotError {
|
121 105 | Self::ResourceNotFoundException(variant)
|
122 106 | }
|
123 107 | }
|
124 108 | impl ::std::convert::From<crate::error::AccessDeniedException>
|
125 - | for crate::error::StartSnapshotError
|
109 + | for crate::error::CompleteSnapshotError
|
126 110 | {
|
127 - | fn from(variant: crate::error::AccessDeniedException) -> crate::error::StartSnapshotError {
|
111 + | fn from(variant: crate::error::AccessDeniedException) -> crate::error::CompleteSnapshotError {
|
128 112 | Self::AccessDeniedException(variant)
|
129 113 | }
|
130 114 | }
|
131 - | impl ::std::convert::From<crate::error::ConflictException> for crate::error::StartSnapshotError {
|
132 - | fn from(variant: crate::error::ConflictException) -> crate::error::StartSnapshotError {
|
133 - | Self::ConflictException(variant)
|
134 - | }
|
135 - | }
|
136 115 | impl ::std::convert::From<crate::error::RequestThrottledException>
|
137 - | for crate::error::StartSnapshotError
|
116 + | for crate::error::CompleteSnapshotError
|
138 117 | {
|
139 - | fn from(variant: crate::error::RequestThrottledException) -> crate::error::StartSnapshotError {
|
118 + | fn from(
|
119 + | variant: crate::error::RequestThrottledException,
|
120 + | ) -> crate::error::CompleteSnapshotError {
|
140 121 | Self::RequestThrottledException(variant)
|
141 122 | }
|
142 123 | }
|
143 124 | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
144 - | for crate::error::StartSnapshotError
|
125 + | for crate::error::CompleteSnapshotError
|
145 126 | {
|
146 127 | fn from(
|
147 128 | variant: crate::error::ServiceQuotaExceededException,
|
148 - | ) -> crate::error::StartSnapshotError {
|
129 + | ) -> crate::error::CompleteSnapshotError {
|
149 130 | Self::ServiceQuotaExceededException(variant)
|
150 131 | }
|
151 132 | }
|
152 - | impl ::std::convert::From<crate::error::ConcurrentLimitExceededException>
|
153 - | for crate::error::StartSnapshotError
|
133 + | impl ::std::convert::From<crate::error::ValidationException>
|
134 + | for crate::error::CompleteSnapshotError
|
154 135 | {
|
155 - | fn from(
|
156 - | variant: crate::error::ConcurrentLimitExceededException,
|
157 - | ) -> crate::error::StartSnapshotError {
|
158 - | Self::ConcurrentLimitExceededException(variant)
|
159 - | }
|
160 - | }
|
161 - | impl ::std::convert::From<crate::error::ValidationException> for crate::error::StartSnapshotError {
|
162 - | fn from(variant: crate::error::ValidationException) -> crate::error::StartSnapshotError {
|
136 + | fn from(variant: crate::error::ValidationException) -> crate::error::CompleteSnapshotError {
|
163 137 | Self::ValidationException(variant)
|
164 138 | }
|
165 139 | }
|
166 - | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::StartSnapshotError {
|
167 - | fn from(variant: crate::error::InternalServerError) -> crate::error::StartSnapshotError {
|
140 + | impl ::std::convert::From<crate::error::InternalServerError>
|
141 + | for crate::error::CompleteSnapshotError
|
142 + | {
|
143 + | fn from(variant: crate::error::InternalServerError) -> crate::error::CompleteSnapshotError {
|
168 144 | Self::InternalServerError(variant)
|
169 145 | }
|
170 146 | }
|
171 147 |
|
172 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::StartSnapshotError {
|
173 - | fn from(variant: ::pyo3::PyErr) -> crate::error::StartSnapshotError {
|
148 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::CompleteSnapshotError {
|
149 + | fn from(variant: ::pyo3::PyErr) -> crate::error::CompleteSnapshotError {
|
174 150 | ::pyo3::Python::with_gil(|py| {
|
175 151 | let error = variant.value(py);
|
176 152 | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
177 153 | return error.into();
|
178 154 | }
|
179 155 | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
180 156 | return error.into();
|
181 157 | }
|
182 158 | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
183 159 | return error.into();
|
184 160 | }
|
185 - | if let Ok(error) = error.extract::<crate::error::ConflictException>() {
|
186 - | return error.into();
|
187 - | }
|
188 161 | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
189 162 | return error.into();
|
190 163 | }
|
191 164 | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
192 165 | return error.into();
|
193 166 | }
|
194 - | if let Ok(error) = error.extract::<crate::error::ConcurrentLimitExceededException>() {
|
195 - | return error.into();
|
196 - | }
|
197 167 | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
198 168 | return error.into();
|
199 169 | }
|
200 170 | crate::error::InternalServerError {
|
201 171 | message: error.to_string(),
|
202 172 | }
|
203 173 | .into()
|
204 174 | })
|
205 175 | }
|
206 176 | }
|
207 177 |
|
208 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
209 - | /// :param message str:
|
210 - | /// :rtype None:
|
211 - | #[allow(missing_docs)] // documentation missing in model
|
212 - | #[derive(
|
213 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
214 - | )]
|
215 - | pub struct InternalServerError {
|
216 - | #[pyo3(get, set)]
|
217 - | /// :type str:
|
178 + | /// Error type for the `GetSnapshotBlock` operation.
|
179 + | /// Each variant represents an error that can occur for the `GetSnapshotBlock` operation.
|
180 + | #[derive(::std::fmt::Debug)]
|
181 + | pub enum GetSnapshotBlockError {
|
182 + | /// <p>An internal error has occurred.</p>
|
183 + | InternalServerException(crate::error::InternalServerException),
|
184 + | /// <p>The specified resource does not exist.</p>
|
185 + | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
186 + | /// <p>You do not have sufficient access to perform this action.</p>
|
187 + | AccessDeniedException(crate::error::AccessDeniedException),
|
188 + | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
189 + | RequestThrottledException(crate::error::RequestThrottledException),
|
190 + | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
191 + | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
192 + | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
193 + | ValidationException(crate::error::ValidationException),
|
218 194 | #[allow(missing_docs)] // documentation missing in model
|
219 - | pub message: ::std::string::String,
|
195 + | InternalServerError(crate::error::InternalServerError),
|
220 196 | }
|
221 - | #[allow(clippy::new_without_default)]
|
222 - | #[allow(clippy::too_many_arguments)]
|
223 - | #[::pyo3::pymethods]
|
224 - | impl InternalServerError {
|
225 - | #[new]
|
226 - | pub fn new(message: ::std::string::String) -> Self {
|
227 - | Self { message }
|
228 - | }
|
229 - | fn __repr__(&self) -> String {
|
230 - | format!("{self:?}")
|
197 + | impl ::std::fmt::Display for GetSnapshotBlockError {
|
198 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
199 + | match &self {
|
200 + | GetSnapshotBlockError::InternalServerException(_inner) => _inner.fmt(f),
|
201 + | GetSnapshotBlockError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
202 + | GetSnapshotBlockError::AccessDeniedException(_inner) => _inner.fmt(f),
|
203 + | GetSnapshotBlockError::RequestThrottledException(_inner) => _inner.fmt(f),
|
204 + | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
205 + | GetSnapshotBlockError::ValidationException(_inner) => _inner.fmt(f),
|
206 + | GetSnapshotBlockError::InternalServerError(_inner) => _inner.fmt(f),
|
231 207 | }
|
232 - | fn __str__(&self) -> String {
|
233 - | format!("{self:?}")
|
234 208 | }
|
235 209 | }
|
236 - | impl InternalServerError {
|
237 - | /// Returns the error message.
|
238 - | pub fn message(&self) -> &str {
|
239 - | &self.message
|
210 + | impl GetSnapshotBlockError {
|
211 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::InternalServerException`.
|
212 + | pub fn is_internal_server_exception(&self) -> bool {
|
213 + | matches!(&self, GetSnapshotBlockError::InternalServerException(_))
|
240 214 | }
|
241 - | #[doc(hidden)]
|
242 - | /// Returns the error name.
|
243 - | pub fn name(&self) -> &'static str {
|
244 - | "InternalServerError"
|
215 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::ResourceNotFoundException`.
|
216 + | pub fn is_resource_not_found_exception(&self) -> bool {
|
217 + | matches!(&self, GetSnapshotBlockError::ResourceNotFoundException(_))
|
245 218 | }
|
246 - | }
|
247 - | impl ::std::fmt::Display for InternalServerError {
|
248 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
249 - | ::std::write!(f, "InternalServerError")?;
|
250 - | {
|
251 - | ::std::write!(f, ": {}", &self.message)?;
|
219 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::AccessDeniedException`.
|
220 + | pub fn is_access_denied_exception(&self) -> bool {
|
221 + | matches!(&self, GetSnapshotBlockError::AccessDeniedException(_))
|
252 222 | }
|
253 - | Ok(())
|
223 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::RequestThrottledException`.
|
224 + | pub fn is_request_throttled_exception(&self) -> bool {
|
225 + | matches!(&self, GetSnapshotBlockError::RequestThrottledException(_))
|
254 226 | }
|
255 - | }
|
256 - | impl ::std::error::Error for InternalServerError {}
|
257 - | impl InternalServerError {
|
258 - | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
259 - | pub fn builder() -> crate::error::internal_server_error::Builder {
|
260 - | crate::error::internal_server_error::Builder::default()
|
227 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::ServiceQuotaExceededException`.
|
228 + | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
229 + | matches!(
|
230 + | &self,
|
231 + | GetSnapshotBlockError::ServiceQuotaExceededException(_)
|
232 + | )
|
261 233 | }
|
262 - | }
|
263 - |
|
264 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
265 - | /// :param message str:
|
266 - | /// :param field_list typing.Optional\[typing.List\[ebs.model.ValidationExceptionField\]\]:
|
267 - | /// :rtype None:
|
268 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
269 - | #[derive(
|
270 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
271 - | )]
|
272 - | pub struct ValidationException {
|
273 - | #[pyo3(get, set)]
|
274 - | /// :type str:
|
275 - | /// A summary of the validation failure.
|
276 - | pub message: ::std::string::String,
|
277 - | #[pyo3(get, set)]
|
278 - | /// :type typing.Optional\[typing.List\[ebs.model.ValidationExceptionField\]\]:
|
279 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
280 - | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
281 - | }
|
282 - | impl ValidationException {
|
283 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
284 - | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
285 - | self.field_list.as_deref()
|
286 - | }
|
287 - | }
|
288 - | #[allow(clippy::new_without_default)]
|
289 - | #[allow(clippy::too_many_arguments)]
|
290 - | #[::pyo3::pymethods]
|
291 - | impl ValidationException {
|
292 - | #[new]
|
293 - | pub fn new(
|
294 - | message: ::std::string::String,
|
295 - | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
296 - | ) -> Self {
|
297 - | Self {
|
298 - | message,
|
299 - | field_list,
|
234 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::ValidationException`.
|
235 + | pub fn is_validation_exception(&self) -> bool {
|
236 + | matches!(&self, GetSnapshotBlockError::ValidationException(_))
|
300 237 | }
|
238 + | /// Returns `true` if the error kind is `GetSnapshotBlockError::InternalServerError`.
|
239 + | pub fn is_internal_server_error(&self) -> bool {
|
240 + | matches!(&self, GetSnapshotBlockError::InternalServerError(_))
|
301 241 | }
|
302 - | fn __repr__(&self) -> String {
|
303 - | format!("{self:?}")
|
242 + | /// Returns the error name string by matching the correct variant.
|
243 + | pub fn name(&self) -> &'static str {
|
244 + | match &self {
|
245 + | GetSnapshotBlockError::InternalServerException(_inner) => _inner.name(),
|
246 + | GetSnapshotBlockError::ResourceNotFoundException(_inner) => _inner.name(),
|
247 + | GetSnapshotBlockError::AccessDeniedException(_inner) => _inner.name(),
|
248 + | GetSnapshotBlockError::RequestThrottledException(_inner) => _inner.name(),
|
249 + | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
250 + | GetSnapshotBlockError::ValidationException(_inner) => _inner.name(),
|
251 + | GetSnapshotBlockError::InternalServerError(_inner) => _inner.name(),
|
304 252 | }
|
305 - | fn __str__(&self) -> String {
|
306 - | format!("{self:?}")
|
307 253 | }
|
308 254 | }
|
309 - | impl ValidationException {
|
310 - | /// Returns the error message.
|
311 - | pub fn message(&self) -> &str {
|
312 - | &self.message
|
255 + | impl ::std::error::Error for GetSnapshotBlockError {
|
256 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
257 + | match &self {
|
258 + | GetSnapshotBlockError::InternalServerException(_inner) => Some(_inner),
|
259 + | GetSnapshotBlockError::ResourceNotFoundException(_inner) => Some(_inner),
|
260 + | GetSnapshotBlockError::AccessDeniedException(_inner) => Some(_inner),
|
261 + | GetSnapshotBlockError::RequestThrottledException(_inner) => Some(_inner),
|
262 + | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
263 + | GetSnapshotBlockError::ValidationException(_inner) => Some(_inner),
|
264 + | GetSnapshotBlockError::InternalServerError(_inner) => Some(_inner),
|
313 265 | }
|
314 - | #[doc(hidden)]
|
315 - | /// Returns the error name.
|
316 - | pub fn name(&self) -> &'static str {
|
317 - | "ValidationException"
|
318 266 | }
|
319 267 | }
|
320 - | impl ::std::fmt::Display for ValidationException {
|
321 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
322 - | ::std::write!(f, "ValidationException")?;
|
323 - | {
|
324 - | ::std::write!(f, ": {}", &self.message)?;
|
325 - | }
|
326 - | Ok(())
|
268 + | impl ::std::convert::From<crate::error::InternalServerException>
|
269 + | for crate::error::GetSnapshotBlockError
|
270 + | {
|
271 + | fn from(variant: crate::error::InternalServerException) -> crate::error::GetSnapshotBlockError {
|
272 + | Self::InternalServerException(variant)
|
327 273 | }
|
328 274 | }
|
329 - | impl ::std::error::Error for ValidationException {}
|
330 - | impl ValidationException {
|
331 - | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
332 - | pub fn builder() -> crate::error::validation_exception::Builder {
|
333 - | crate::error::validation_exception::Builder::default()
|
275 + | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
276 + | for crate::error::GetSnapshotBlockError
|
277 + | {
|
278 + | fn from(
|
279 + | variant: crate::error::ResourceNotFoundException,
|
280 + | ) -> crate::error::GetSnapshotBlockError {
|
281 + | Self::ResourceNotFoundException(variant)
|
334 282 | }
|
335 283 | }
|
336 - |
|
337 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
338 - | /// :param message typing.Optional\[str\]:
|
339 - | /// :rtype None:
|
340 - | /// <p>You have reached the limit for concurrent API requests. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance">Optimizing performance of the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
341 - | #[derive(
|
342 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
343 - | )]
|
344 - | pub struct ConcurrentLimitExceededException {
|
345 - | #[pyo3(get, set)]
|
346 - | /// :type typing.Optional\[str\]:
|
347 - | #[allow(missing_docs)] // documentation missing in model
|
348 - | pub message: ::std::option::Option<::std::string::String>,
|
349 - | }
|
350 - | #[allow(clippy::new_without_default)]
|
351 - | #[allow(clippy::too_many_arguments)]
|
352 - | #[::pyo3::pymethods]
|
353 - | impl ConcurrentLimitExceededException {
|
354 - | #[new]
|
355 - | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
356 - | Self { message }
|
357 - | }
|
358 - | fn __repr__(&self) -> String {
|
359 - | format!("{self:?}")
|
360 - | }
|
361 - | fn __str__(&self) -> String {
|
362 - | format!("{self:?}")
|
284 + | impl ::std::convert::From<crate::error::AccessDeniedException>
|
285 + | for crate::error::GetSnapshotBlockError
|
286 + | {
|
287 + | fn from(variant: crate::error::AccessDeniedException) -> crate::error::GetSnapshotBlockError {
|
288 + | Self::AccessDeniedException(variant)
|
363 289 | }
|
364 290 | }
|
365 - | impl ConcurrentLimitExceededException {
|
366 - | /// Returns the error message.
|
367 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
368 - | self.message.as_deref()
|
369 - | }
|
370 - | #[doc(hidden)]
|
371 - | /// Returns the error name.
|
372 - | pub fn name(&self) -> &'static str {
|
373 - | "ConcurrentLimitExceededException"
|
291 + | impl ::std::convert::From<crate::error::RequestThrottledException>
|
292 + | for crate::error::GetSnapshotBlockError
|
293 + | {
|
294 + | fn from(
|
295 + | variant: crate::error::RequestThrottledException,
|
296 + | ) -> crate::error::GetSnapshotBlockError {
|
297 + | Self::RequestThrottledException(variant)
|
374 298 | }
|
375 299 | }
|
376 - | impl ::std::fmt::Display for ConcurrentLimitExceededException {
|
377 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
378 - | ::std::write!(f, "ConcurrentLimitExceededException")?;
|
379 - | if let ::std::option::Option::Some(inner_1) = &self.message {
|
380 - | {
|
381 - | ::std::write!(f, ": {inner_1}")?;
|
382 - | }
|
383 - | }
|
384 - | Ok(())
|
300 + | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
301 + | for crate::error::GetSnapshotBlockError
|
302 + | {
|
303 + | fn from(
|
304 + | variant: crate::error::ServiceQuotaExceededException,
|
305 + | ) -> crate::error::GetSnapshotBlockError {
|
306 + | Self::ServiceQuotaExceededException(variant)
|
385 307 | }
|
386 308 | }
|
387 - | impl ::std::error::Error for ConcurrentLimitExceededException {}
|
388 - | impl ConcurrentLimitExceededException {
|
389 - | /// Creates a new builder-style object to manufacture [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
390 - | pub fn builder() -> crate::error::concurrent_limit_exceeded_exception::Builder {
|
391 - | crate::error::concurrent_limit_exceeded_exception::Builder::default()
|
309 + | impl ::std::convert::From<crate::error::ValidationException>
|
310 + | for crate::error::GetSnapshotBlockError
|
311 + | {
|
312 + | fn from(variant: crate::error::ValidationException) -> crate::error::GetSnapshotBlockError {
|
313 + | Self::ValidationException(variant)
|
392 314 | }
|
393 315 | }
|
394 - |
|
395 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
396 - | /// :param reason typing.Optional\[ebs.model.ServiceQuotaExceededExceptionReason\]:
|
397 - | /// :param message typing.Optional\[str\]:
|
398 - | /// :rtype None:
|
399 - | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
400 - | #[derive(
|
401 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
402 - | )]
|
403 - | pub struct ServiceQuotaExceededException {
|
404 - | #[pyo3(get, set)]
|
405 - | /// :type typing.Optional\[ebs.model.ServiceQuotaExceededExceptionReason\]:
|
406 - | /// <p>The reason for the exception.</p>
|
407 - | pub reason: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
408 - | #[pyo3(get, set)]
|
409 - | /// :type typing.Optional\[str\]:
|
410 - | #[allow(missing_docs)] // documentation missing in model
|
411 - | pub message: ::std::option::Option<::std::string::String>,
|
412 - | }
|
413 - | impl ServiceQuotaExceededException {
|
414 - | /// <p>The reason for the exception.</p>
|
415 - | pub fn reason(
|
416 - | &self,
|
417 - | ) -> ::std::option::Option<&crate::model::ServiceQuotaExceededExceptionReason> {
|
418 - | self.reason.as_ref()
|
316 + | impl ::std::convert::From<crate::error::InternalServerError>
|
317 + | for crate::error::GetSnapshotBlockError
|
318 + | {
|
319 + | fn from(variant: crate::error::InternalServerError) -> crate::error::GetSnapshotBlockError {
|
320 + | Self::InternalServerError(variant)
|
419 321 | }
|
420 322 | }
|
421 - | #[allow(clippy::new_without_default)]
|
422 - | #[allow(clippy::too_many_arguments)]
|
423 - | #[::pyo3::pymethods]
|
424 - | impl ServiceQuotaExceededException {
|
425 - | #[new]
|
426 - | pub fn new(
|
427 - | reason: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
428 - | message: ::std::option::Option<::std::string::String>,
|
429 - | ) -> Self {
|
430 - | Self { reason, message }
|
431 - | }
|
432 - | fn __repr__(&self) -> String {
|
433 - | format!("{self:?}")
|
323 + |
|
324 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::GetSnapshotBlockError {
|
325 + | fn from(variant: ::pyo3::PyErr) -> crate::error::GetSnapshotBlockError {
|
326 + | ::pyo3::Python::with_gil(|py| {
|
327 + | let error = variant.value(py);
|
328 + | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
329 + | return error.into();
|
434 330 | }
|
435 - | fn __str__(&self) -> String {
|
436 - | format!("{self:?}")
|
331 + | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
332 + | return error.into();
|
437 333 | }
|
438 - | }
|
439 - | impl ServiceQuotaExceededException {
|
440 - | /// Returns the error message.
|
441 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
442 - | self.message.as_deref()
|
334 + | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
335 + | return error.into();
|
443 336 | }
|
444 - | #[doc(hidden)]
|
445 - | /// Returns the error name.
|
446 - | pub fn name(&self) -> &'static str {
|
447 - | "ServiceQuotaExceededException"
|
337 + | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
338 + | return error.into();
|
448 339 | }
|
449 - | }
|
450 - | impl ::std::fmt::Display for ServiceQuotaExceededException {
|
451 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
452 - | ::std::write!(f, "ServiceQuotaExceededException")?;
|
453 - | if let ::std::option::Option::Some(inner_2) = &self.message {
|
454 - | {
|
455 - | ::std::write!(f, ": {inner_2}")?;
|
340 + | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
341 + | return error.into();
|
456 342 | }
|
343 + | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
344 + | return error.into();
|
457 345 | }
|
458 - | Ok(())
|
346 + | crate::error::InternalServerError {
|
347 + | message: error.to_string(),
|
459 348 | }
|
460 - | }
|
461 - | impl ::std::error::Error for ServiceQuotaExceededException {}
|
462 - | impl ServiceQuotaExceededException {
|
463 - | /// Creates a new builder-style object to manufacture [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
|
464 - | pub fn builder() -> crate::error::service_quota_exceeded_exception::Builder {
|
465 - | crate::error::service_quota_exceeded_exception::Builder::default()
|
349 + | .into()
|
350 + | })
|
466 351 | }
|
467 352 | }
|
468 353 |
|
469 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
470 - | /// :param message typing.Optional\[str\]:
|
471 - | /// :param reason typing.Optional\[ebs.model.RequestThrottledExceptionReason\]:
|
472 - | /// :rtype None:
|
473 - | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
474 - | #[derive(
|
475 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
476 - | )]
|
477 - | pub struct RequestThrottledException {
|
478 - | #[pyo3(get, set)]
|
479 - | /// :type typing.Optional\[str\]:
|
354 + | /// Error type for the `ListChangedBlocks` operation.
|
355 + | /// Each variant represents an error that can occur for the `ListChangedBlocks` operation.
|
356 + | #[derive(::std::fmt::Debug)]
|
357 + | pub enum ListChangedBlocksError {
|
358 + | /// <p>An internal error has occurred.</p>
|
359 + | InternalServerException(crate::error::InternalServerException),
|
360 + | /// <p>The specified resource does not exist.</p>
|
361 + | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
362 + | /// <p>You do not have sufficient access to perform this action.</p>
|
363 + | AccessDeniedException(crate::error::AccessDeniedException),
|
364 + | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
365 + | RequestThrottledException(crate::error::RequestThrottledException),
|
366 + | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
367 + | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
368 + | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
369 + | ValidationException(crate::error::ValidationException),
|
480 370 | #[allow(missing_docs)] // documentation missing in model
|
481 - | pub message: ::std::option::Option<::std::string::String>,
|
482 - | #[pyo3(get, set)]
|
483 - | /// :type typing.Optional\[ebs.model.RequestThrottledExceptionReason\]:
|
484 - | /// <p>The reason for the exception.</p>
|
485 - | pub reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
371 + | InternalServerError(crate::error::InternalServerError),
|
486 372 | }
|
487 - | impl RequestThrottledException {
|
488 - | /// <p>The reason for the exception.</p>
|
489 - | pub fn reason(&self) -> ::std::option::Option<&crate::model::RequestThrottledExceptionReason> {
|
490 - | self.reason.as_ref()
|
373 + | impl ::std::fmt::Display for ListChangedBlocksError {
|
374 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
375 + | match &self {
|
376 + | ListChangedBlocksError::InternalServerException(_inner) => _inner.fmt(f),
|
377 + | ListChangedBlocksError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
378 + | ListChangedBlocksError::AccessDeniedException(_inner) => _inner.fmt(f),
|
379 + | ListChangedBlocksError::RequestThrottledException(_inner) => _inner.fmt(f),
|
380 + | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
381 + | ListChangedBlocksError::ValidationException(_inner) => _inner.fmt(f),
|
382 + | ListChangedBlocksError::InternalServerError(_inner) => _inner.fmt(f),
|
383 + | }
|
491 384 | }
|
492 385 | }
|
493 - | #[allow(clippy::new_without_default)]
|
494 - | #[allow(clippy::too_many_arguments)]
|
495 - | #[::pyo3::pymethods]
|
496 - | impl RequestThrottledException {
|
497 - | #[new]
|
498 - | pub fn new(
|
499 - | message: ::std::option::Option<::std::string::String>,
|
500 - | reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
501 - | ) -> Self {
|
502 - | Self { message, reason }
|
386 + | impl ListChangedBlocksError {
|
387 + | /// Returns `true` if the error kind is `ListChangedBlocksError::InternalServerException`.
|
388 + | pub fn is_internal_server_exception(&self) -> bool {
|
389 + | matches!(&self, ListChangedBlocksError::InternalServerException(_))
|
503 390 | }
|
504 - | fn __repr__(&self) -> String {
|
505 - | format!("{self:?}")
|
391 + | /// Returns `true` if the error kind is `ListChangedBlocksError::ResourceNotFoundException`.
|
392 + | pub fn is_resource_not_found_exception(&self) -> bool {
|
393 + | matches!(&self, ListChangedBlocksError::ResourceNotFoundException(_))
|
506 394 | }
|
507 - | fn __str__(&self) -> String {
|
508 - | format!("{self:?}")
|
395 + | /// Returns `true` if the error kind is `ListChangedBlocksError::AccessDeniedException`.
|
396 + | pub fn is_access_denied_exception(&self) -> bool {
|
397 + | matches!(&self, ListChangedBlocksError::AccessDeniedException(_))
|
509 398 | }
|
510 - | }
|
511 - | impl RequestThrottledException {
|
512 - | /// Returns the error message.
|
513 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
514 - | self.message.as_deref()
|
399 + | /// Returns `true` if the error kind is `ListChangedBlocksError::RequestThrottledException`.
|
400 + | pub fn is_request_throttled_exception(&self) -> bool {
|
401 + | matches!(&self, ListChangedBlocksError::RequestThrottledException(_))
|
515 402 | }
|
516 - | #[doc(hidden)]
|
517 - | /// Returns the error name.
|
403 + | /// Returns `true` if the error kind is `ListChangedBlocksError::ServiceQuotaExceededException`.
|
404 + | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
405 + | matches!(
|
406 + | &self,
|
407 + | ListChangedBlocksError::ServiceQuotaExceededException(_)
|
408 + | )
|
409 + | }
|
410 + | /// Returns `true` if the error kind is `ListChangedBlocksError::ValidationException`.
|
411 + | pub fn is_validation_exception(&self) -> bool {
|
412 + | matches!(&self, ListChangedBlocksError::ValidationException(_))
|
413 + | }
|
414 + | /// Returns `true` if the error kind is `ListChangedBlocksError::InternalServerError`.
|
415 + | pub fn is_internal_server_error(&self) -> bool {
|
416 + | matches!(&self, ListChangedBlocksError::InternalServerError(_))
|
417 + | }
|
418 + | /// Returns the error name string by matching the correct variant.
|
518 419 | pub fn name(&self) -> &'static str {
|
519 - | "RequestThrottledException"
|
420 + | match &self {
|
421 + | ListChangedBlocksError::InternalServerException(_inner) => _inner.name(),
|
422 + | ListChangedBlocksError::ResourceNotFoundException(_inner) => _inner.name(),
|
423 + | ListChangedBlocksError::AccessDeniedException(_inner) => _inner.name(),
|
424 + | ListChangedBlocksError::RequestThrottledException(_inner) => _inner.name(),
|
425 + | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
426 + | ListChangedBlocksError::ValidationException(_inner) => _inner.name(),
|
427 + | ListChangedBlocksError::InternalServerError(_inner) => _inner.name(),
|
520 428 | }
|
521 - | }
|
522 - | impl ::std::fmt::Display for RequestThrottledException {
|
523 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
524 - | ::std::write!(f, "RequestThrottledException")?;
|
525 - | if let ::std::option::Option::Some(inner_3) = &self.message {
|
526 - | {
|
527 - | ::std::write!(f, ": {inner_3}")?;
|
528 429 | }
|
430 + | }
|
431 + | impl ::std::error::Error for ListChangedBlocksError {
|
432 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
433 + | match &self {
|
434 + | ListChangedBlocksError::InternalServerException(_inner) => Some(_inner),
|
435 + | ListChangedBlocksError::ResourceNotFoundException(_inner) => Some(_inner),
|
436 + | ListChangedBlocksError::AccessDeniedException(_inner) => Some(_inner),
|
437 + | ListChangedBlocksError::RequestThrottledException(_inner) => Some(_inner),
|
438 + | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
439 + | ListChangedBlocksError::ValidationException(_inner) => Some(_inner),
|
440 + | ListChangedBlocksError::InternalServerError(_inner) => Some(_inner),
|
529 441 | }
|
530 - | Ok(())
|
531 442 | }
|
532 443 | }
|
533 - | impl ::std::error::Error for RequestThrottledException {}
|
534 - | impl RequestThrottledException {
|
535 - | /// Creates a new builder-style object to manufacture [`RequestThrottledException`](crate::error::RequestThrottledException).
|
536 - | pub fn builder() -> crate::error::request_throttled_exception::Builder {
|
537 - | crate::error::request_throttled_exception::Builder::default()
|
444 + | impl ::std::convert::From<crate::error::InternalServerException>
|
445 + | for crate::error::ListChangedBlocksError
|
446 + | {
|
447 + | fn from(
|
448 + | variant: crate::error::InternalServerException,
|
449 + | ) -> crate::error::ListChangedBlocksError {
|
450 + | Self::InternalServerException(variant)
|
538 451 | }
|
539 452 | }
|
540 - |
|
541 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
542 - | /// :param message typing.Optional\[str\]:
|
543 - | /// :rtype None:
|
544 - | /// <p>The request uses the same client token as a previous, but non-identical request.</p>
|
545 - | #[derive(
|
546 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
547 - | )]
|
548 - | pub struct ConflictException {
|
549 - | #[pyo3(get, set)]
|
550 - | /// :type typing.Optional\[str\]:
|
551 - | #[allow(missing_docs)] // documentation missing in model
|
552 - | pub message: ::std::option::Option<::std::string::String>,
|
453 + | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
454 + | for crate::error::ListChangedBlocksError
|
455 + | {
|
456 + | fn from(
|
457 + | variant: crate::error::ResourceNotFoundException,
|
458 + | ) -> crate::error::ListChangedBlocksError {
|
459 + | Self::ResourceNotFoundException(variant)
|
460 + | }
|
553 461 | }
|
554 - | #[allow(clippy::new_without_default)]
|
555 - | #[allow(clippy::too_many_arguments)]
|
556 - | #[::pyo3::pymethods]
|
557 - | impl ConflictException {
|
558 - | #[new]
|
559 - | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
560 - | Self { message }
|
462 + | impl ::std::convert::From<crate::error::AccessDeniedException>
|
463 + | for crate::error::ListChangedBlocksError
|
464 + | {
|
465 + | fn from(variant: crate::error::AccessDeniedException) -> crate::error::ListChangedBlocksError {
|
466 + | Self::AccessDeniedException(variant)
|
561 467 | }
|
562 - | fn __repr__(&self) -> String {
|
563 - | format!("{self:?}")
|
468 + | }
|
469 + | impl ::std::convert::From<crate::error::RequestThrottledException>
|
470 + | for crate::error::ListChangedBlocksError
|
471 + | {
|
472 + | fn from(
|
473 + | variant: crate::error::RequestThrottledException,
|
474 + | ) -> crate::error::ListChangedBlocksError {
|
475 + | Self::RequestThrottledException(variant)
|
564 476 | }
|
565 - | fn __str__(&self) -> String {
|
566 - | format!("{self:?}")
|
477 + | }
|
478 + | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
479 + | for crate::error::ListChangedBlocksError
|
480 + | {
|
481 + | fn from(
|
482 + | variant: crate::error::ServiceQuotaExceededException,
|
483 + | ) -> crate::error::ListChangedBlocksError {
|
484 + | Self::ServiceQuotaExceededException(variant)
|
567 485 | }
|
568 486 | }
|
569 - | impl ConflictException {
|
570 - | /// Returns the error message.
|
571 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
572 - | self.message.as_deref()
|
487 + | impl ::std::convert::From<crate::error::ValidationException>
|
488 + | for crate::error::ListChangedBlocksError
|
489 + | {
|
490 + | fn from(variant: crate::error::ValidationException) -> crate::error::ListChangedBlocksError {
|
491 + | Self::ValidationException(variant)
|
573 492 | }
|
574 - | #[doc(hidden)]
|
575 - | /// Returns the error name.
|
576 - | pub fn name(&self) -> &'static str {
|
577 - | "ConflictException"
|
493 + | }
|
494 + | impl ::std::convert::From<crate::error::InternalServerError>
|
495 + | for crate::error::ListChangedBlocksError
|
496 + | {
|
497 + | fn from(variant: crate::error::InternalServerError) -> crate::error::ListChangedBlocksError {
|
498 + | Self::InternalServerError(variant)
|
578 499 | }
|
579 500 | }
|
580 - | impl ::std::fmt::Display for ConflictException {
|
581 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
582 - | ::std::write!(f, "ConflictException")?;
|
583 - | if let ::std::option::Option::Some(inner_4) = &self.message {
|
584 - | {
|
585 - | ::std::write!(f, ": {inner_4}")?;
|
501 + |
|
502 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ListChangedBlocksError {
|
503 + | fn from(variant: ::pyo3::PyErr) -> crate::error::ListChangedBlocksError {
|
504 + | ::pyo3::Python::with_gil(|py| {
|
505 + | let error = variant.value(py);
|
506 + | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
507 + | return error.into();
|
586 508 | }
|
509 + | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
510 + | return error.into();
|
587 511 | }
|
588 - | Ok(())
|
512 + | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
513 + | return error.into();
|
589 514 | }
|
590 - | }
|
591 - | impl ::std::error::Error for ConflictException {}
|
592 - | impl ConflictException {
|
593 - | /// Creates a new builder-style object to manufacture [`ConflictException`](crate::error::ConflictException).
|
594 - | pub fn builder() -> crate::error::conflict_exception::Builder {
|
595 - | crate::error::conflict_exception::Builder::default()
|
515 + | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
516 + | return error.into();
|
517 + | }
|
518 + | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
519 + | return error.into();
|
520 + | }
|
521 + | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
522 + | return error.into();
|
523 + | }
|
524 + | crate::error::InternalServerError {
|
525 + | message: error.to_string(),
|
526 + | }
|
527 + | .into()
|
528 + | })
|
596 529 | }
|
597 530 | }
|
598 531 |
|
599 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
600 - | /// :param reason ebs.model.AccessDeniedExceptionReason:
|
601 - | /// :param message typing.Optional\[str\]:
|
602 - | /// :rtype None:
|
603 - | /// <p>You do not have sufficient access to perform this action.</p>
|
604 - | #[derive(
|
605 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
606 - | )]
|
607 - | pub struct AccessDeniedException {
|
608 - | #[pyo3(get, set)]
|
609 - | /// :type typing.Optional\[str\]:
|
532 + | /// Error type for the `ListSnapshotBlocks` operation.
|
533 + | /// Each variant represents an error that can occur for the `ListSnapshotBlocks` operation.
|
534 + | #[derive(::std::fmt::Debug)]
|
535 + | pub enum ListSnapshotBlocksError {
|
536 + | /// <p>An internal error has occurred.</p>
|
537 + | InternalServerException(crate::error::InternalServerException),
|
538 + | /// <p>The specified resource does not exist.</p>
|
539 + | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
540 + | /// <p>You do not have sufficient access to perform this action.</p>
|
541 + | AccessDeniedException(crate::error::AccessDeniedException),
|
542 + | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
543 + | RequestThrottledException(crate::error::RequestThrottledException),
|
544 + | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
545 + | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
546 + | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
547 + | ValidationException(crate::error::ValidationException),
|
610 548 | #[allow(missing_docs)] // documentation missing in model
|
611 - | pub message: ::std::option::Option<::std::string::String>,
|
612 - | #[pyo3(get, set)]
|
613 - | /// :type ebs.model.AccessDeniedExceptionReason:
|
614 - | /// <p>The reason for the exception.</p>
|
615 - | pub reason: crate::model::AccessDeniedExceptionReason,
|
549 + | InternalServerError(crate::error::InternalServerError),
|
616 550 | }
|
617 - | impl AccessDeniedException {
|
618 - | /// <p>The reason for the exception.</p>
|
619 - | pub fn reason(&self) -> &crate::model::AccessDeniedExceptionReason {
|
620 - | &self.reason
|
551 + | impl ::std::fmt::Display for ListSnapshotBlocksError {
|
552 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
553 + | match &self {
|
554 + | ListSnapshotBlocksError::InternalServerException(_inner) => _inner.fmt(f),
|
555 + | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
556 + | ListSnapshotBlocksError::AccessDeniedException(_inner) => _inner.fmt(f),
|
557 + | ListSnapshotBlocksError::RequestThrottledException(_inner) => _inner.fmt(f),
|
558 + | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
559 + | ListSnapshotBlocksError::ValidationException(_inner) => _inner.fmt(f),
|
560 + | ListSnapshotBlocksError::InternalServerError(_inner) => _inner.fmt(f),
|
621 561 | }
|
622 - | }
|
623 - | #[allow(clippy::new_without_default)]
|
624 - | #[allow(clippy::too_many_arguments)]
|
625 - | #[::pyo3::pymethods]
|
626 - | impl AccessDeniedException {
|
627 - | #[new]
|
628 - | pub fn new(
|
629 - | reason: crate::model::AccessDeniedExceptionReason,
|
630 - | message: ::std::option::Option<::std::string::String>,
|
631 - | ) -> Self {
|
632 - | Self { reason, message }
|
633 562 | }
|
634 - | fn __repr__(&self) -> String {
|
635 - | format!("{self:?}")
|
563 + | }
|
564 + | impl ListSnapshotBlocksError {
|
565 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::InternalServerException`.
|
566 + | pub fn is_internal_server_exception(&self) -> bool {
|
567 + | matches!(&self, ListSnapshotBlocksError::InternalServerException(_))
|
636 568 | }
|
637 - | fn __str__(&self) -> String {
|
638 - | format!("{self:?}")
|
569 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ResourceNotFoundException`.
|
570 + | pub fn is_resource_not_found_exception(&self) -> bool {
|
571 + | matches!(&self, ListSnapshotBlocksError::ResourceNotFoundException(_))
|
639 572 | }
|
640 - | }
|
641 - | impl AccessDeniedException {
|
642 - | /// Returns the error message.
|
643 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
644 - | self.message.as_deref()
|
573 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::AccessDeniedException`.
|
574 + | pub fn is_access_denied_exception(&self) -> bool {
|
575 + | matches!(&self, ListSnapshotBlocksError::AccessDeniedException(_))
|
645 576 | }
|
646 - | #[doc(hidden)]
|
647 - | /// Returns the error name.
|
648 - | pub fn name(&self) -> &'static str {
|
649 - | "AccessDeniedException"
|
577 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::RequestThrottledException`.
|
578 + | pub fn is_request_throttled_exception(&self) -> bool {
|
579 + | matches!(&self, ListSnapshotBlocksError::RequestThrottledException(_))
|
650 580 | }
|
651 - | }
|
652 - | impl ::std::fmt::Display for AccessDeniedException {
|
653 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
654 - | ::std::write!(f, "AccessDeniedException")?;
|
655 - | if let ::std::option::Option::Some(inner_5) = &self.message {
|
656 - | {
|
657 - | ::std::write!(f, ": {inner_5}")?;
|
581 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ServiceQuotaExceededException`.
|
582 + | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
583 + | matches!(
|
584 + | &self,
|
585 + | ListSnapshotBlocksError::ServiceQuotaExceededException(_)
|
586 + | )
|
658 587 | }
|
588 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ValidationException`.
|
589 + | pub fn is_validation_exception(&self) -> bool {
|
590 + | matches!(&self, ListSnapshotBlocksError::ValidationException(_))
|
659 591 | }
|
660 - | Ok(())
|
592 + | /// Returns `true` if the error kind is `ListSnapshotBlocksError::InternalServerError`.
|
593 + | pub fn is_internal_server_error(&self) -> bool {
|
594 + | matches!(&self, ListSnapshotBlocksError::InternalServerError(_))
|
661 595 | }
|
662 - | }
|
663 - | impl ::std::error::Error for AccessDeniedException {}
|
664 - | impl AccessDeniedException {
|
665 - | /// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::error::AccessDeniedException).
|
666 - | pub fn builder() -> crate::error::access_denied_exception::Builder {
|
667 - | crate::error::access_denied_exception::Builder::default()
|
596 + | /// Returns the error name string by matching the correct variant.
|
597 + | pub fn name(&self) -> &'static str {
|
598 + | match &self {
|
599 + | ListSnapshotBlocksError::InternalServerException(_inner) => _inner.name(),
|
600 + | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => _inner.name(),
|
601 + | ListSnapshotBlocksError::AccessDeniedException(_inner) => _inner.name(),
|
602 + | ListSnapshotBlocksError::RequestThrottledException(_inner) => _inner.name(),
|
603 + | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
604 + | ListSnapshotBlocksError::ValidationException(_inner) => _inner.name(),
|
605 + | ListSnapshotBlocksError::InternalServerError(_inner) => _inner.name(),
|
668 606 | }
|
669 - | }
|
670 - |
|
671 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
672 - | /// :param message typing.Optional\[str\]:
|
673 - | /// :param reason typing.Optional\[ebs.model.ResourceNotFoundExceptionReason\]:
|
674 - | /// :rtype None:
|
675 - | /// <p>The specified resource does not exist.</p>
|
676 - | #[derive(
|
677 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
678 - | )]
|
679 - | pub struct ResourceNotFoundException {
|
680 - | #[pyo3(get, set)]
|
681 - | /// :type typing.Optional\[str\]:
|
682 - | #[allow(missing_docs)] // documentation missing in model
|
683 - | pub message: ::std::option::Option<::std::string::String>,
|
684 - | #[pyo3(get, set)]
|
685 - | /// :type typing.Optional\[ebs.model.ResourceNotFoundExceptionReason\]:
|
686 - | /// <p>The reason for the exception.</p>
|
687 - | pub reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
688 - | }
|
689 - | impl ResourceNotFoundException {
|
690 - | /// <p>The reason for the exception.</p>
|
691 - | pub fn reason(&self) -> ::std::option::Option<&crate::model::ResourceNotFoundExceptionReason> {
|
692 - | self.reason.as_ref()
|
693 607 | }
|
694 608 | }
|
695 - | #[allow(clippy::new_without_default)]
|
696 - | #[allow(clippy::too_many_arguments)]
|
697 - | #[::pyo3::pymethods]
|
698 - | impl ResourceNotFoundException {
|
699 - | #[new]
|
700 - | pub fn new(
|
701 - | message: ::std::option::Option<::std::string::String>,
|
702 - | reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
703 - | ) -> Self {
|
704 - | Self { message, reason }
|
609 + | impl ::std::error::Error for ListSnapshotBlocksError {
|
610 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
611 + | match &self {
|
612 + | ListSnapshotBlocksError::InternalServerException(_inner) => Some(_inner),
|
613 + | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => Some(_inner),
|
614 + | ListSnapshotBlocksError::AccessDeniedException(_inner) => Some(_inner),
|
615 + | ListSnapshotBlocksError::RequestThrottledException(_inner) => Some(_inner),
|
616 + | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
617 + | ListSnapshotBlocksError::ValidationException(_inner) => Some(_inner),
|
618 + | ListSnapshotBlocksError::InternalServerError(_inner) => Some(_inner),
|
705 619 | }
|
706 - | fn __repr__(&self) -> String {
|
707 - | format!("{self:?}")
|
708 620 | }
|
709 - | fn __str__(&self) -> String {
|
710 - | format!("{self:?}")
|
621 + | }
|
622 + | impl ::std::convert::From<crate::error::InternalServerException>
|
623 + | for crate::error::ListSnapshotBlocksError
|
624 + | {
|
625 + | fn from(
|
626 + | variant: crate::error::InternalServerException,
|
627 + | ) -> crate::error::ListSnapshotBlocksError {
|
628 + | Self::InternalServerException(variant)
|
711 629 | }
|
712 630 | }
|
713 - | impl ResourceNotFoundException {
|
714 - | /// Returns the error message.
|
715 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
716 - | self.message.as_deref()
|
631 + | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
632 + | for crate::error::ListSnapshotBlocksError
|
633 + | {
|
634 + | fn from(
|
635 + | variant: crate::error::ResourceNotFoundException,
|
636 + | ) -> crate::error::ListSnapshotBlocksError {
|
637 + | Self::ResourceNotFoundException(variant)
|
717 638 | }
|
718 - | #[doc(hidden)]
|
719 - | /// Returns the error name.
|
720 - | pub fn name(&self) -> &'static str {
|
721 - | "ResourceNotFoundException"
|
639 + | }
|
640 + | impl ::std::convert::From<crate::error::AccessDeniedException>
|
641 + | for crate::error::ListSnapshotBlocksError
|
642 + | {
|
643 + | fn from(variant: crate::error::AccessDeniedException) -> crate::error::ListSnapshotBlocksError {
|
644 + | Self::AccessDeniedException(variant)
|
722 645 | }
|
723 646 | }
|
724 - | impl ::std::fmt::Display for ResourceNotFoundException {
|
725 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
726 - | ::std::write!(f, "ResourceNotFoundException")?;
|
727 - | if let ::std::option::Option::Some(inner_6) = &self.message {
|
728 - | {
|
729 - | ::std::write!(f, ": {inner_6}")?;
|
647 + | impl ::std::convert::From<crate::error::RequestThrottledException>
|
648 + | for crate::error::ListSnapshotBlocksError
|
649 + | {
|
650 + | fn from(
|
651 + | variant: crate::error::RequestThrottledException,
|
652 + | ) -> crate::error::ListSnapshotBlocksError {
|
653 + | Self::RequestThrottledException(variant)
|
730 654 | }
|
655 + | }
|
656 + | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
657 + | for crate::error::ListSnapshotBlocksError
|
658 + | {
|
659 + | fn from(
|
660 + | variant: crate::error::ServiceQuotaExceededException,
|
661 + | ) -> crate::error::ListSnapshotBlocksError {
|
662 + | Self::ServiceQuotaExceededException(variant)
|
731 663 | }
|
732 - | Ok(())
|
664 + | }
|
665 + | impl ::std::convert::From<crate::error::ValidationException>
|
666 + | for crate::error::ListSnapshotBlocksError
|
667 + | {
|
668 + | fn from(variant: crate::error::ValidationException) -> crate::error::ListSnapshotBlocksError {
|
669 + | Self::ValidationException(variant)
|
733 670 | }
|
734 671 | }
|
735 - | impl ::std::error::Error for ResourceNotFoundException {}
|
736 - | impl ResourceNotFoundException {
|
737 - | /// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
738 - | pub fn builder() -> crate::error::resource_not_found_exception::Builder {
|
739 - | crate::error::resource_not_found_exception::Builder::default()
|
672 + | impl ::std::convert::From<crate::error::InternalServerError>
|
673 + | for crate::error::ListSnapshotBlocksError
|
674 + | {
|
675 + | fn from(variant: crate::error::InternalServerError) -> crate::error::ListSnapshotBlocksError {
|
676 + | Self::InternalServerError(variant)
|
740 677 | }
|
741 678 | }
|
742 679 |
|
743 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
744 - | /// :param message typing.Optional\[str\]:
|
745 - | /// :rtype None:
|
746 - | /// <p>An internal error has occurred.</p>
|
747 - | #[derive(
|
748 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
749 - | )]
|
750 - | pub struct InternalServerException {
|
751 - | #[pyo3(get, set)]
|
752 - | /// :type typing.Optional\[str\]:
|
753 - | #[allow(missing_docs)] // documentation missing in model
|
754 - | pub message: ::std::option::Option<::std::string::String>,
|
755 - | }
|
756 - | #[allow(clippy::new_without_default)]
|
757 - | #[allow(clippy::too_many_arguments)]
|
758 - | #[::pyo3::pymethods]
|
759 - | impl InternalServerException {
|
760 - | #[new]
|
761 - | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
762 - | Self { message }
|
763 - | }
|
764 - | fn __repr__(&self) -> String {
|
765 - | format!("{self:?}")
|
680 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ListSnapshotBlocksError {
|
681 + | fn from(variant: ::pyo3::PyErr) -> crate::error::ListSnapshotBlocksError {
|
682 + | ::pyo3::Python::with_gil(|py| {
|
683 + | let error = variant.value(py);
|
684 + | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
685 + | return error.into();
|
766 686 | }
|
767 - | fn __str__(&self) -> String {
|
768 - | format!("{self:?}")
|
687 + | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
688 + | return error.into();
|
769 689 | }
|
770 - | }
|
771 - | impl InternalServerException {
|
772 - | /// Returns the error message.
|
773 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
774 - | self.message.as_deref()
|
690 + | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
691 + | return error.into();
|
775 692 | }
|
776 - | #[doc(hidden)]
|
777 - | /// Returns the error name.
|
778 - | pub fn name(&self) -> &'static str {
|
779 - | "InternalServerException"
|
693 + | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
694 + | return error.into();
|
780 695 | }
|
781 - | }
|
782 - | impl ::std::fmt::Display for InternalServerException {
|
783 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
784 - | ::std::write!(f, "InternalServerException")?;
|
785 - | if let ::std::option::Option::Some(inner_7) = &self.message {
|
786 - | {
|
787 - | ::std::write!(f, ": {inner_7}")?;
|
696 + | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
697 + | return error.into();
|
788 698 | }
|
699 + | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
700 + | return error.into();
|
789 701 | }
|
790 - | Ok(())
|
702 + | crate::error::InternalServerError {
|
703 + | message: error.to_string(),
|
791 704 | }
|
792 - | }
|
793 - | impl ::std::error::Error for InternalServerException {}
|
794 - | impl InternalServerException {
|
795 - | /// Creates a new builder-style object to manufacture [`InternalServerException`](crate::error::InternalServerException).
|
796 - | pub fn builder() -> crate::error::internal_server_exception::Builder {
|
797 - | crate::error::internal_server_exception::Builder::default()
|
705 + | .into()
|
706 + | })
|
798 707 | }
|
799 708 | }
|
800 709 |
|
801 710 | /// Error type for the `PutSnapshotBlock` operation.
|
802 711 | /// Each variant represents an error that can occur for the `PutSnapshotBlock` operation.
|
803 712 | #[derive(::std::fmt::Debug)]
|
804 713 | pub enum PutSnapshotBlockError {
|
805 714 | /// <p>An internal error has occurred.</p>
|
806 715 | InternalServerException(crate::error::InternalServerException),
|
807 716 | /// <p>The specified resource does not exist.</p>
|
967 876 | return error.into();
|
968 877 | }
|
969 878 | crate::error::InternalServerError {
|
970 879 | message: error.to_string(),
|
971 880 | }
|
972 881 | .into()
|
973 882 | })
|
974 883 | }
|
975 884 | }
|
976 885 |
|
977 - | /// Error type for the `ListSnapshotBlocks` operation.
|
978 - | /// Each variant represents an error that can occur for the `ListSnapshotBlocks` operation.
|
886 + | /// Error type for the `StartSnapshot` operation.
|
887 + | /// Each variant represents an error that can occur for the `StartSnapshot` operation.
|
979 888 | #[derive(::std::fmt::Debug)]
|
980 - | pub enum ListSnapshotBlocksError {
|
889 + | pub enum StartSnapshotError {
|
981 890 | /// <p>An internal error has occurred.</p>
|
982 891 | InternalServerException(crate::error::InternalServerException),
|
983 892 | /// <p>The specified resource does not exist.</p>
|
984 893 | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
985 894 | /// <p>You do not have sufficient access to perform this action.</p>
|
986 895 | AccessDeniedException(crate::error::AccessDeniedException),
|
896 + | /// <p>The request uses the same client token as a previous, but non-identical request.</p>
|
897 + | ConflictException(crate::error::ConflictException),
|
987 898 | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
988 899 | RequestThrottledException(crate::error::RequestThrottledException),
|
989 900 | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
990 901 | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
902 + | /// <p>You have reached the limit for concurrent API requests. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance">Optimizing performance of the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
903 + | ConcurrentLimitExceededException(crate::error::ConcurrentLimitExceededException),
|
991 904 | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
992 905 | ValidationException(crate::error::ValidationException),
|
993 906 | #[allow(missing_docs)] // documentation missing in model
|
994 907 | InternalServerError(crate::error::InternalServerError),
|
995 908 | }
|
996 - | impl ::std::fmt::Display for ListSnapshotBlocksError {
|
909 + | impl ::std::fmt::Display for StartSnapshotError {
|
997 910 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
998 911 | match &self {
|
999 - | ListSnapshotBlocksError::InternalServerException(_inner) => _inner.fmt(f),
|
1000 - | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
1001 - | ListSnapshotBlocksError::AccessDeniedException(_inner) => _inner.fmt(f),
|
1002 - | ListSnapshotBlocksError::RequestThrottledException(_inner) => _inner.fmt(f),
|
1003 - | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
1004 - | ListSnapshotBlocksError::ValidationException(_inner) => _inner.fmt(f),
|
1005 - | ListSnapshotBlocksError::InternalServerError(_inner) => _inner.fmt(f),
|
912 + | StartSnapshotError::InternalServerException(_inner) => _inner.fmt(f),
|
913 + | StartSnapshotError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
914 + | StartSnapshotError::AccessDeniedException(_inner) => _inner.fmt(f),
|
915 + | StartSnapshotError::ConflictException(_inner) => _inner.fmt(f),
|
916 + | StartSnapshotError::RequestThrottledException(_inner) => _inner.fmt(f),
|
917 + | StartSnapshotError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
918 + | StartSnapshotError::ConcurrentLimitExceededException(_inner) => _inner.fmt(f),
|
919 + | StartSnapshotError::ValidationException(_inner) => _inner.fmt(f),
|
920 + | StartSnapshotError::InternalServerError(_inner) => _inner.fmt(f),
|
1006 921 | }
|
1007 922 | }
|
1008 923 | }
|
1009 - | impl ListSnapshotBlocksError {
|
1010 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::InternalServerException`.
|
924 + | impl StartSnapshotError {
|
925 + | /// Returns `true` if the error kind is `StartSnapshotError::InternalServerException`.
|
1011 926 | pub fn is_internal_server_exception(&self) -> bool {
|
1012 - | matches!(&self, ListSnapshotBlocksError::InternalServerException(_))
|
927 + | matches!(&self, StartSnapshotError::InternalServerException(_))
|
1013 928 | }
|
1014 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ResourceNotFoundException`.
|
929 + | /// Returns `true` if the error kind is `StartSnapshotError::ResourceNotFoundException`.
|
1015 930 | pub fn is_resource_not_found_exception(&self) -> bool {
|
1016 - | matches!(&self, ListSnapshotBlocksError::ResourceNotFoundException(_))
|
931 + | matches!(&self, StartSnapshotError::ResourceNotFoundException(_))
|
1017 932 | }
|
1018 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::AccessDeniedException`.
|
933 + | /// Returns `true` if the error kind is `StartSnapshotError::AccessDeniedException`.
|
1019 934 | pub fn is_access_denied_exception(&self) -> bool {
|
1020 - | matches!(&self, ListSnapshotBlocksError::AccessDeniedException(_))
|
935 + | matches!(&self, StartSnapshotError::AccessDeniedException(_))
|
1021 936 | }
|
1022 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::RequestThrottledException`.
|
937 + | /// Returns `true` if the error kind is `StartSnapshotError::ConflictException`.
|
938 + | pub fn is_conflict_exception(&self) -> bool {
|
939 + | matches!(&self, StartSnapshotError::ConflictException(_))
|
940 + | }
|
941 + | /// Returns `true` if the error kind is `StartSnapshotError::RequestThrottledException`.
|
1023 942 | pub fn is_request_throttled_exception(&self) -> bool {
|
1024 - | matches!(&self, ListSnapshotBlocksError::RequestThrottledException(_))
|
943 + | matches!(&self, StartSnapshotError::RequestThrottledException(_))
|
1025 944 | }
|
1026 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ServiceQuotaExceededException`.
|
945 + | /// Returns `true` if the error kind is `StartSnapshotError::ServiceQuotaExceededException`.
|
1027 946 | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
947 + | matches!(&self, StartSnapshotError::ServiceQuotaExceededException(_))
|
948 + | }
|
949 + | /// Returns `true` if the error kind is `StartSnapshotError::ConcurrentLimitExceededException`.
|
950 + | pub fn is_concurrent_limit_exceeded_exception(&self) -> bool {
|
1028 951 | matches!(
|
1029 952 | &self,
|
1030 - | ListSnapshotBlocksError::ServiceQuotaExceededException(_)
|
953 + | StartSnapshotError::ConcurrentLimitExceededException(_)
|
1031 954 | )
|
1032 955 | }
|
1033 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::ValidationException`.
|
956 + | /// Returns `true` if the error kind is `StartSnapshotError::ValidationException`.
|
1034 957 | pub fn is_validation_exception(&self) -> bool {
|
1035 - | matches!(&self, ListSnapshotBlocksError::ValidationException(_))
|
958 + | matches!(&self, StartSnapshotError::ValidationException(_))
|
1036 959 | }
|
1037 - | /// Returns `true` if the error kind is `ListSnapshotBlocksError::InternalServerError`.
|
960 + | /// Returns `true` if the error kind is `StartSnapshotError::InternalServerError`.
|
1038 961 | pub fn is_internal_server_error(&self) -> bool {
|
1039 - | matches!(&self, ListSnapshotBlocksError::InternalServerError(_))
|
962 + | matches!(&self, StartSnapshotError::InternalServerError(_))
|
1040 963 | }
|
1041 964 | /// Returns the error name string by matching the correct variant.
|
1042 965 | pub fn name(&self) -> &'static str {
|
1043 966 | match &self {
|
1044 - | ListSnapshotBlocksError::InternalServerException(_inner) => _inner.name(),
|
1045 - | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => _inner.name(),
|
1046 - | ListSnapshotBlocksError::AccessDeniedException(_inner) => _inner.name(),
|
1047 - | ListSnapshotBlocksError::RequestThrottledException(_inner) => _inner.name(),
|
1048 - | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
1049 - | ListSnapshotBlocksError::ValidationException(_inner) => _inner.name(),
|
1050 - | ListSnapshotBlocksError::InternalServerError(_inner) => _inner.name(),
|
967 + | StartSnapshotError::InternalServerException(_inner) => _inner.name(),
|
968 + | StartSnapshotError::ResourceNotFoundException(_inner) => _inner.name(),
|
969 + | StartSnapshotError::AccessDeniedException(_inner) => _inner.name(),
|
970 + | StartSnapshotError::ConflictException(_inner) => _inner.name(),
|
971 + | StartSnapshotError::RequestThrottledException(_inner) => _inner.name(),
|
972 + | StartSnapshotError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
973 + | StartSnapshotError::ConcurrentLimitExceededException(_inner) => _inner.name(),
|
974 + | StartSnapshotError::ValidationException(_inner) => _inner.name(),
|
975 + | StartSnapshotError::InternalServerError(_inner) => _inner.name(),
|
1051 976 | }
|
1052 977 | }
|
1053 978 | }
|
1054 - | impl ::std::error::Error for ListSnapshotBlocksError {
|
979 + | impl ::std::error::Error for StartSnapshotError {
|
1055 980 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
1056 981 | match &self {
|
1057 - | ListSnapshotBlocksError::InternalServerException(_inner) => Some(_inner),
|
1058 - | ListSnapshotBlocksError::ResourceNotFoundException(_inner) => Some(_inner),
|
1059 - | ListSnapshotBlocksError::AccessDeniedException(_inner) => Some(_inner),
|
1060 - | ListSnapshotBlocksError::RequestThrottledException(_inner) => Some(_inner),
|
1061 - | ListSnapshotBlocksError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
1062 - | ListSnapshotBlocksError::ValidationException(_inner) => Some(_inner),
|
1063 - | ListSnapshotBlocksError::InternalServerError(_inner) => Some(_inner),
|
982 + | StartSnapshotError::InternalServerException(_inner) => Some(_inner),
|
983 + | StartSnapshotError::ResourceNotFoundException(_inner) => Some(_inner),
|
984 + | StartSnapshotError::AccessDeniedException(_inner) => Some(_inner),
|
985 + | StartSnapshotError::ConflictException(_inner) => Some(_inner),
|
986 + | StartSnapshotError::RequestThrottledException(_inner) => Some(_inner),
|
987 + | StartSnapshotError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
988 + | StartSnapshotError::ConcurrentLimitExceededException(_inner) => Some(_inner),
|
989 + | StartSnapshotError::ValidationException(_inner) => Some(_inner),
|
990 + | StartSnapshotError::InternalServerError(_inner) => Some(_inner),
|
1064 991 | }
|
1065 992 | }
|
1066 993 | }
|
1067 994 | impl ::std::convert::From<crate::error::InternalServerException>
|
1068 - | for crate::error::ListSnapshotBlocksError
|
995 + | for crate::error::StartSnapshotError
|
1069 996 | {
|
1070 - | fn from(
|
1071 - | variant: crate::error::InternalServerException,
|
1072 - | ) -> crate::error::ListSnapshotBlocksError {
|
997 + | fn from(variant: crate::error::InternalServerException) -> crate::error::StartSnapshotError {
|
1073 998 | Self::InternalServerException(variant)
|
1074 999 | }
|
1075 1000 | }
|
1076 1001 | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
1077 - | for crate::error::ListSnapshotBlocksError
|
1002 + | for crate::error::StartSnapshotError
|
1078 1003 | {
|
1079 - | fn from(
|
1080 - | variant: crate::error::ResourceNotFoundException,
|
1081 - | ) -> crate::error::ListSnapshotBlocksError {
|
1004 + | fn from(variant: crate::error::ResourceNotFoundException) -> crate::error::StartSnapshotError {
|
1082 1005 | Self::ResourceNotFoundException(variant)
|
1083 1006 | }
|
1084 1007 | }
|
1085 1008 | impl ::std::convert::From<crate::error::AccessDeniedException>
|
1086 - | for crate::error::ListSnapshotBlocksError
|
1009 + | for crate::error::StartSnapshotError
|
1087 1010 | {
|
1088 - | fn from(variant: crate::error::AccessDeniedException) -> crate::error::ListSnapshotBlocksError {
|
1011 + | fn from(variant: crate::error::AccessDeniedException) -> crate::error::StartSnapshotError {
|
1089 1012 | Self::AccessDeniedException(variant)
|
1090 1013 | }
|
1091 1014 | }
|
1015 + | impl ::std::convert::From<crate::error::ConflictException> for crate::error::StartSnapshotError {
|
1016 + | fn from(variant: crate::error::ConflictException) -> crate::error::StartSnapshotError {
|
1017 + | Self::ConflictException(variant)
|
1018 + | }
|
1019 + | }
|
1092 1020 | impl ::std::convert::From<crate::error::RequestThrottledException>
|
1093 - | for crate::error::ListSnapshotBlocksError
|
1021 + | for crate::error::StartSnapshotError
|
1094 1022 | {
|
1095 - | fn from(
|
1096 - | variant: crate::error::RequestThrottledException,
|
1097 - | ) -> crate::error::ListSnapshotBlocksError {
|
1023 + | fn from(variant: crate::error::RequestThrottledException) -> crate::error::StartSnapshotError {
|
1098 1024 | Self::RequestThrottledException(variant)
|
1099 1025 | }
|
1100 1026 | }
|
1101 1027 | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
1102 - | for crate::error::ListSnapshotBlocksError
|
1028 + | for crate::error::StartSnapshotError
|
1103 1029 | {
|
1104 1030 | fn from(
|
1105 1031 | variant: crate::error::ServiceQuotaExceededException,
|
1106 - | ) -> crate::error::ListSnapshotBlocksError {
|
1032 + | ) -> crate::error::StartSnapshotError {
|
1107 1033 | Self::ServiceQuotaExceededException(variant)
|
1108 1034 | }
|
1109 1035 | }
|
1110 - | impl ::std::convert::From<crate::error::ValidationException>
|
1111 - | for crate::error::ListSnapshotBlocksError
|
1036 + | impl ::std::convert::From<crate::error::ConcurrentLimitExceededException>
|
1037 + | for crate::error::StartSnapshotError
|
1112 1038 | {
|
1113 - | fn from(variant: crate::error::ValidationException) -> crate::error::ListSnapshotBlocksError {
|
1039 + | fn from(
|
1040 + | variant: crate::error::ConcurrentLimitExceededException,
|
1041 + | ) -> crate::error::StartSnapshotError {
|
1042 + | Self::ConcurrentLimitExceededException(variant)
|
1043 + | }
|
1044 + | }
|
1045 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::StartSnapshotError {
|
1046 + | fn from(variant: crate::error::ValidationException) -> crate::error::StartSnapshotError {
|
1114 1047 | Self::ValidationException(variant)
|
1115 1048 | }
|
1116 1049 | }
|
1117 - | impl ::std::convert::From<crate::error::InternalServerError>
|
1118 - | for crate::error::ListSnapshotBlocksError
|
1119 - | {
|
1120 - | fn from(variant: crate::error::InternalServerError) -> crate::error::ListSnapshotBlocksError {
|
1050 + | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::StartSnapshotError {
|
1051 + | fn from(variant: crate::error::InternalServerError) -> crate::error::StartSnapshotError {
|
1121 1052 | Self::InternalServerError(variant)
|
1122 1053 | }
|
1123 1054 | }
|
1124 1055 |
|
1125 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ListSnapshotBlocksError {
|
1126 - | fn from(variant: ::pyo3::PyErr) -> crate::error::ListSnapshotBlocksError {
|
1056 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::StartSnapshotError {
|
1057 + | fn from(variant: ::pyo3::PyErr) -> crate::error::StartSnapshotError {
|
1127 1058 | ::pyo3::Python::with_gil(|py| {
|
1128 1059 | let error = variant.value(py);
|
1129 1060 | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
1130 1061 | return error.into();
|
1131 1062 | }
|
1132 1063 | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
1133 1064 | return error.into();
|
1134 1065 | }
|
1135 1066 | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
1136 1067 | return error.into();
|
1137 1068 | }
|
1069 + | if let Ok(error) = error.extract::<crate::error::ConflictException>() {
|
1070 + | return error.into();
|
1071 + | }
|
1138 1072 | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
1139 1073 | return error.into();
|
1140 1074 | }
|
1141 1075 | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
1142 1076 | return error.into();
|
1143 1077 | }
|
1078 + | if let Ok(error) = error.extract::<crate::error::ConcurrentLimitExceededException>() {
|
1079 + | return error.into();
|
1080 + | }
|
1144 1081 | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
1145 1082 | return error.into();
|
1146 1083 | }
|
1147 1084 | crate::error::InternalServerError {
|
1148 1085 | message: error.to_string(),
|
1149 1086 | }
|
1150 1087 | .into()
|
1151 1088 | })
|
1152 1089 | }
|
1153 1090 | }
|
1154 1091 |
|
1155 - | /// Error type for the `ListChangedBlocks` operation.
|
1156 - | /// Each variant represents an error that can occur for the `ListChangedBlocks` operation.
|
1157 - | #[derive(::std::fmt::Debug)]
|
1158 - | pub enum ListChangedBlocksError {
|
1159 - | /// <p>An internal error has occurred.</p>
|
1160 - | InternalServerException(crate::error::InternalServerException),
|
1161 - | /// <p>The specified resource does not exist.</p>
|
1162 - | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
1163 - | /// <p>You do not have sufficient access to perform this action.</p>
|
1164 - | AccessDeniedException(crate::error::AccessDeniedException),
|
1165 - | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
1166 - | RequestThrottledException(crate::error::RequestThrottledException),
|
1167 - | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
1168 - | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
1169 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
1170 - | ValidationException(crate::error::ValidationException),
|
1092 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1093 + | /// :param message typing.Optional\[str\]:
|
1094 + | /// :rtype None:
|
1095 + | /// <p>An internal error has occurred.</p>
|
1096 + | #[derive(
|
1097 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1098 + | )]
|
1099 + | pub struct InternalServerException {
|
1100 + | #[pyo3(get, set)]
|
1101 + | /// :type typing.Optional\[str\]:
|
1171 1102 | #[allow(missing_docs)] // documentation missing in model
|
1172 - | InternalServerError(crate::error::InternalServerError),
|
1103 + | pub message: ::std::option::Option<::std::string::String>,
|
1173 1104 | }
|
1174 - | impl ::std::fmt::Display for ListChangedBlocksError {
|
1175 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1176 - | match &self {
|
1177 - | ListChangedBlocksError::InternalServerException(_inner) => _inner.fmt(f),
|
1178 - | ListChangedBlocksError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
1179 - | ListChangedBlocksError::AccessDeniedException(_inner) => _inner.fmt(f),
|
1180 - | ListChangedBlocksError::RequestThrottledException(_inner) => _inner.fmt(f),
|
1181 - | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
1182 - | ListChangedBlocksError::ValidationException(_inner) => _inner.fmt(f),
|
1183 - | ListChangedBlocksError::InternalServerError(_inner) => _inner.fmt(f),
|
1105 + | #[allow(clippy::new_without_default)]
|
1106 + | #[allow(clippy::too_many_arguments)]
|
1107 + | #[::pyo3::pymethods]
|
1108 + | impl InternalServerException {
|
1109 + | #[new]
|
1110 + | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
1111 + | Self { message }
|
1184 1112 | }
|
1113 + | fn __repr__(&self) -> String {
|
1114 + | format!("{self:?}")
|
1115 + | }
|
1116 + | fn __str__(&self) -> String {
|
1117 + | format!("{self:?}")
|
1185 1118 | }
|
1186 1119 | }
|
1187 - | impl ListChangedBlocksError {
|
1188 - | /// Returns `true` if the error kind is `ListChangedBlocksError::InternalServerException`.
|
1189 - | pub fn is_internal_server_exception(&self) -> bool {
|
1190 - | matches!(&self, ListChangedBlocksError::InternalServerException(_))
|
1120 + | impl InternalServerException {
|
1121 + | /// Returns the error message.
|
1122 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1123 + | self.message.as_deref()
|
1191 1124 | }
|
1192 - | /// Returns `true` if the error kind is `ListChangedBlocksError::ResourceNotFoundException`.
|
1193 - | pub fn is_resource_not_found_exception(&self) -> bool {
|
1194 - | matches!(&self, ListChangedBlocksError::ResourceNotFoundException(_))
|
1125 + | #[doc(hidden)]
|
1126 + | /// Returns the error name.
|
1127 + | pub fn name(&self) -> &'static str {
|
1128 + | "InternalServerException"
|
1195 1129 | }
|
1196 - | /// Returns `true` if the error kind is `ListChangedBlocksError::AccessDeniedException`.
|
1197 - | pub fn is_access_denied_exception(&self) -> bool {
|
1198 - | matches!(&self, ListChangedBlocksError::AccessDeniedException(_))
|
1130 + | }
|
1131 + | impl ::std::fmt::Display for InternalServerException {
|
1132 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1133 + | ::std::write!(f, "InternalServerException")?;
|
1134 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
1135 + | {
|
1136 + | ::std::write!(f, ": {inner_1}")?;
|
1199 1137 | }
|
1200 - | /// Returns `true` if the error kind is `ListChangedBlocksError::RequestThrottledException`.
|
1201 - | pub fn is_request_throttled_exception(&self) -> bool {
|
1202 - | matches!(&self, ListChangedBlocksError::RequestThrottledException(_))
|
1203 1138 | }
|
1204 - | /// Returns `true` if the error kind is `ListChangedBlocksError::ServiceQuotaExceededException`.
|
1205 - | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
1206 - | matches!(
|
1207 - | &self,
|
1208 - | ListChangedBlocksError::ServiceQuotaExceededException(_)
|
1209 - | )
|
1139 + | Ok(())
|
1210 1140 | }
|
1211 - | /// Returns `true` if the error kind is `ListChangedBlocksError::ValidationException`.
|
1212 - | pub fn is_validation_exception(&self) -> bool {
|
1213 - | matches!(&self, ListChangedBlocksError::ValidationException(_))
|
1141 + | }
|
1142 + | impl ::std::error::Error for InternalServerException {}
|
1143 + | impl InternalServerException {
|
1144 + | /// Creates a new builder-style object to manufacture [`InternalServerException`](crate::error::InternalServerException).
|
1145 + | pub fn builder() -> crate::error::internal_server_exception::Builder {
|
1146 + | crate::error::internal_server_exception::Builder::default()
|
1214 1147 | }
|
1215 - | /// Returns `true` if the error kind is `ListChangedBlocksError::InternalServerError`.
|
1216 - | pub fn is_internal_server_error(&self) -> bool {
|
1217 - | matches!(&self, ListChangedBlocksError::InternalServerError(_))
|
1148 + | }
|
1149 + |
|
1150 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1151 + | /// :param message typing.Optional\[str\]:
|
1152 + | /// :param reason typing.Optional\[ebs.model.ResourceNotFoundExceptionReason\]:
|
1153 + | /// :rtype None:
|
1154 + | /// <p>The specified resource does not exist.</p>
|
1155 + | #[derive(
|
1156 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1157 + | )]
|
1158 + | pub struct ResourceNotFoundException {
|
1159 + | #[pyo3(get, set)]
|
1160 + | /// :type typing.Optional\[str\]:
|
1161 + | #[allow(missing_docs)] // documentation missing in model
|
1162 + | pub message: ::std::option::Option<::std::string::String>,
|
1163 + | #[pyo3(get, set)]
|
1164 + | /// :type typing.Optional\[ebs.model.ResourceNotFoundExceptionReason\]:
|
1165 + | /// <p>The reason for the exception.</p>
|
1166 + | pub reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
1167 + | }
|
1168 + | impl ResourceNotFoundException {
|
1169 + | /// <p>The reason for the exception.</p>
|
1170 + | pub fn reason(&self) -> ::std::option::Option<&crate::model::ResourceNotFoundExceptionReason> {
|
1171 + | self.reason.as_ref()
|
1218 1172 | }
|
1219 - | /// Returns the error name string by matching the correct variant.
|
1173 + | }
|
1174 + | #[allow(clippy::new_without_default)]
|
1175 + | #[allow(clippy::too_many_arguments)]
|
1176 + | #[::pyo3::pymethods]
|
1177 + | impl ResourceNotFoundException {
|
1178 + | #[new]
|
1179 + | pub fn new(
|
1180 + | message: ::std::option::Option<::std::string::String>,
|
1181 + | reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
1182 + | ) -> Self {
|
1183 + | Self { message, reason }
|
1184 + | }
|
1185 + | fn __repr__(&self) -> String {
|
1186 + | format!("{self:?}")
|
1187 + | }
|
1188 + | fn __str__(&self) -> String {
|
1189 + | format!("{self:?}")
|
1190 + | }
|
1191 + | }
|
1192 + | impl ResourceNotFoundException {
|
1193 + | /// Returns the error message.
|
1194 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1195 + | self.message.as_deref()
|
1196 + | }
|
1197 + | #[doc(hidden)]
|
1198 + | /// Returns the error name.
|
1220 1199 | pub fn name(&self) -> &'static str {
|
1221 - | match &self {
|
1222 - | ListChangedBlocksError::InternalServerException(_inner) => _inner.name(),
|
1223 - | ListChangedBlocksError::ResourceNotFoundException(_inner) => _inner.name(),
|
1224 - | ListChangedBlocksError::AccessDeniedException(_inner) => _inner.name(),
|
1225 - | ListChangedBlocksError::RequestThrottledException(_inner) => _inner.name(),
|
1226 - | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
1227 - | ListChangedBlocksError::ValidationException(_inner) => _inner.name(),
|
1228 - | ListChangedBlocksError::InternalServerError(_inner) => _inner.name(),
|
1200 + | "ResourceNotFoundException"
|
1201 + | }
|
1202 + | }
|
1203 + | impl ::std::fmt::Display for ResourceNotFoundException {
|
1204 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1205 + | ::std::write!(f, "ResourceNotFoundException")?;
|
1206 + | if let ::std::option::Option::Some(inner_2) = &self.message {
|
1207 + | {
|
1208 + | ::std::write!(f, ": {inner_2}")?;
|
1209 + | }
|
1210 + | }
|
1211 + | Ok(())
|
1212 + | }
|
1213 + | }
|
1214 + | impl ::std::error::Error for ResourceNotFoundException {}
|
1215 + | impl ResourceNotFoundException {
|
1216 + | /// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
1217 + | pub fn builder() -> crate::error::resource_not_found_exception::Builder {
|
1218 + | crate::error::resource_not_found_exception::Builder::default()
|
1219 + | }
|
1220 + | }
|
1221 + |
|
1222 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1223 + | /// :param reason ebs.model.AccessDeniedExceptionReason:
|
1224 + | /// :param message typing.Optional\[str\]:
|
1225 + | /// :rtype None:
|
1226 + | /// <p>You do not have sufficient access to perform this action.</p>
|
1227 + | #[derive(
|
1228 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1229 + | )]
|
1230 + | pub struct AccessDeniedException {
|
1231 + | #[pyo3(get, set)]
|
1232 + | /// :type typing.Optional\[str\]:
|
1233 + | #[allow(missing_docs)] // documentation missing in model
|
1234 + | pub message: ::std::option::Option<::std::string::String>,
|
1235 + | #[pyo3(get, set)]
|
1236 + | /// :type ebs.model.AccessDeniedExceptionReason:
|
1237 + | /// <p>The reason for the exception.</p>
|
1238 + | pub reason: crate::model::AccessDeniedExceptionReason,
|
1239 + | }
|
1240 + | impl AccessDeniedException {
|
1241 + | /// <p>The reason for the exception.</p>
|
1242 + | pub fn reason(&self) -> &crate::model::AccessDeniedExceptionReason {
|
1243 + | &self.reason
|
1244 + | }
|
1245 + | }
|
1246 + | #[allow(clippy::new_without_default)]
|
1247 + | #[allow(clippy::too_many_arguments)]
|
1248 + | #[::pyo3::pymethods]
|
1249 + | impl AccessDeniedException {
|
1250 + | #[new]
|
1251 + | pub fn new(
|
1252 + | reason: crate::model::AccessDeniedExceptionReason,
|
1253 + | message: ::std::option::Option<::std::string::String>,
|
1254 + | ) -> Self {
|
1255 + | Self { reason, message }
|
1256 + | }
|
1257 + | fn __repr__(&self) -> String {
|
1258 + | format!("{self:?}")
|
1229 1259 | }
|
1260 + | fn __str__(&self) -> String {
|
1261 + | format!("{self:?}")
|
1230 1262 | }
|
1231 1263 | }
|
1232 - | impl ::std::error::Error for ListChangedBlocksError {
|
1233 - | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
1234 - | match &self {
|
1235 - | ListChangedBlocksError::InternalServerException(_inner) => Some(_inner),
|
1236 - | ListChangedBlocksError::ResourceNotFoundException(_inner) => Some(_inner),
|
1237 - | ListChangedBlocksError::AccessDeniedException(_inner) => Some(_inner),
|
1238 - | ListChangedBlocksError::RequestThrottledException(_inner) => Some(_inner),
|
1239 - | ListChangedBlocksError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
1240 - | ListChangedBlocksError::ValidationException(_inner) => Some(_inner),
|
1241 - | ListChangedBlocksError::InternalServerError(_inner) => Some(_inner),
|
1264 + | impl AccessDeniedException {
|
1265 + | /// Returns the error message.
|
1266 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1267 + | self.message.as_deref()
|
1242 1268 | }
|
1269 + | #[doc(hidden)]
|
1270 + | /// Returns the error name.
|
1271 + | pub fn name(&self) -> &'static str {
|
1272 + | "AccessDeniedException"
|
1243 1273 | }
|
1244 1274 | }
|
1245 - | impl ::std::convert::From<crate::error::InternalServerException>
|
1246 - | for crate::error::ListChangedBlocksError
|
1247 - | {
|
1248 - | fn from(
|
1249 - | variant: crate::error::InternalServerException,
|
1250 - | ) -> crate::error::ListChangedBlocksError {
|
1251 - | Self::InternalServerException(variant)
|
1275 + | impl ::std::fmt::Display for AccessDeniedException {
|
1276 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1277 + | ::std::write!(f, "AccessDeniedException")?;
|
1278 + | if let ::std::option::Option::Some(inner_3) = &self.message {
|
1279 + | {
|
1280 + | ::std::write!(f, ": {inner_3}")?;
|
1252 1281 | }
|
1253 - | }
|
1254 - | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
1255 - | for crate::error::ListChangedBlocksError
|
1256 - | {
|
1257 - | fn from(
|
1258 - | variant: crate::error::ResourceNotFoundException,
|
1259 - | ) -> crate::error::ListChangedBlocksError {
|
1260 - | Self::ResourceNotFoundException(variant)
|
1261 1282 | }
|
1262 - | }
|
1263 - | impl ::std::convert::From<crate::error::AccessDeniedException>
|
1264 - | for crate::error::ListChangedBlocksError
|
1265 - | {
|
1266 - | fn from(variant: crate::error::AccessDeniedException) -> crate::error::ListChangedBlocksError {
|
1267 - | Self::AccessDeniedException(variant)
|
1283 + | Ok(())
|
1268 1284 | }
|
1269 1285 | }
|
1270 - | impl ::std::convert::From<crate::error::RequestThrottledException>
|
1271 - | for crate::error::ListChangedBlocksError
|
1272 - | {
|
1273 - | fn from(
|
1274 - | variant: crate::error::RequestThrottledException,
|
1275 - | ) -> crate::error::ListChangedBlocksError {
|
1276 - | Self::RequestThrottledException(variant)
|
1286 + | impl ::std::error::Error for AccessDeniedException {}
|
1287 + | impl AccessDeniedException {
|
1288 + | /// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1289 + | pub fn builder() -> crate::error::access_denied_exception::Builder {
|
1290 + | crate::error::access_denied_exception::Builder::default()
|
1277 1291 | }
|
1278 1292 | }
|
1279 - | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
1280 - | for crate::error::ListChangedBlocksError
|
1281 - | {
|
1282 - | fn from(
|
1283 - | variant: crate::error::ServiceQuotaExceededException,
|
1284 - | ) -> crate::error::ListChangedBlocksError {
|
1285 - | Self::ServiceQuotaExceededException(variant)
|
1286 - | }
|
1293 + |
|
1294 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1295 + | /// :param message typing.Optional\[str\]:
|
1296 + | /// :param reason typing.Optional\[ebs.model.RequestThrottledExceptionReason\]:
|
1297 + | /// :rtype None:
|
1298 + | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
1299 + | #[derive(
|
1300 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1301 + | )]
|
1302 + | pub struct RequestThrottledException {
|
1303 + | #[pyo3(get, set)]
|
1304 + | /// :type typing.Optional\[str\]:
|
1305 + | #[allow(missing_docs)] // documentation missing in model
|
1306 + | pub message: ::std::option::Option<::std::string::String>,
|
1307 + | #[pyo3(get, set)]
|
1308 + | /// :type typing.Optional\[ebs.model.RequestThrottledExceptionReason\]:
|
1309 + | /// <p>The reason for the exception.</p>
|
1310 + | pub reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1287 1311 | }
|
1288 - | impl ::std::convert::From<crate::error::ValidationException>
|
1289 - | for crate::error::ListChangedBlocksError
|
1290 - | {
|
1291 - | fn from(variant: crate::error::ValidationException) -> crate::error::ListChangedBlocksError {
|
1292 - | Self::ValidationException(variant)
|
1312 + | impl RequestThrottledException {
|
1313 + | /// <p>The reason for the exception.</p>
|
1314 + | pub fn reason(&self) -> ::std::option::Option<&crate::model::RequestThrottledExceptionReason> {
|
1315 + | self.reason.as_ref()
|
1293 1316 | }
|
1294 1317 | }
|
1295 - | impl ::std::convert::From<crate::error::InternalServerError>
|
1296 - | for crate::error::ListChangedBlocksError
|
1297 - | {
|
1298 - | fn from(variant: crate::error::InternalServerError) -> crate::error::ListChangedBlocksError {
|
1299 - | Self::InternalServerError(variant)
|
1318 + | #[allow(clippy::new_without_default)]
|
1319 + | #[allow(clippy::too_many_arguments)]
|
1320 + | #[::pyo3::pymethods]
|
1321 + | impl RequestThrottledException {
|
1322 + | #[new]
|
1323 + | pub fn new(
|
1324 + | message: ::std::option::Option<::std::string::String>,
|
1325 + | reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1326 + | ) -> Self {
|
1327 + | Self { message, reason }
|
1300 1328 | }
|
1301 - | }
|
1302 - |
|
1303 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ListChangedBlocksError {
|
1304 - | fn from(variant: ::pyo3::PyErr) -> crate::error::ListChangedBlocksError {
|
1305 - | ::pyo3::Python::with_gil(|py| {
|
1306 - | let error = variant.value(py);
|
1307 - | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
1308 - | return error.into();
|
1329 + | fn __repr__(&self) -> String {
|
1330 + | format!("{self:?}")
|
1309 1331 | }
|
1310 - | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
1311 - | return error.into();
|
1332 + | fn __str__(&self) -> String {
|
1333 + | format!("{self:?}")
|
1312 1334 | }
|
1313 - | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
1314 - | return error.into();
|
1335 + | }
|
1336 + | impl RequestThrottledException {
|
1337 + | /// Returns the error message.
|
1338 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1339 + | self.message.as_deref()
|
1315 1340 | }
|
1316 - | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
1317 - | return error.into();
|
1341 + | #[doc(hidden)]
|
1342 + | /// Returns the error name.
|
1343 + | pub fn name(&self) -> &'static str {
|
1344 + | "RequestThrottledException"
|
1318 1345 | }
|
1319 - | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
1320 - | return error.into();
|
1346 + | }
|
1347 + | impl ::std::fmt::Display for RequestThrottledException {
|
1348 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1349 + | ::std::write!(f, "RequestThrottledException")?;
|
1350 + | if let ::std::option::Option::Some(inner_4) = &self.message {
|
1351 + | {
|
1352 + | ::std::write!(f, ": {inner_4}")?;
|
1321 1353 | }
|
1322 - | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
1323 - | return error.into();
|
1324 1354 | }
|
1325 - | crate::error::InternalServerError {
|
1326 - | message: error.to_string(),
|
1355 + | Ok(())
|
1327 1356 | }
|
1328 - | .into()
|
1329 - | })
|
1357 + | }
|
1358 + | impl ::std::error::Error for RequestThrottledException {}
|
1359 + | impl RequestThrottledException {
|
1360 + | /// Creates a new builder-style object to manufacture [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1361 + | pub fn builder() -> crate::error::request_throttled_exception::Builder {
|
1362 + | crate::error::request_throttled_exception::Builder::default()
|
1330 1363 | }
|
1331 1364 | }
|
1332 1365 |
|
1333 - | /// Error type for the `GetSnapshotBlock` operation.
|
1334 - | /// Each variant represents an error that can occur for the `GetSnapshotBlock` operation.
|
1335 - | #[derive(::std::fmt::Debug)]
|
1336 - | pub enum GetSnapshotBlockError {
|
1337 - | /// <p>An internal error has occurred.</p>
|
1338 - | InternalServerException(crate::error::InternalServerException),
|
1339 - | /// <p>The specified resource does not exist.</p>
|
1340 - | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
1341 - | /// <p>You do not have sufficient access to perform this action.</p>
|
1342 - | AccessDeniedException(crate::error::AccessDeniedException),
|
1343 - | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
1344 - | RequestThrottledException(crate::error::RequestThrottledException),
|
1345 - | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
1346 - | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
1347 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
1348 - | ValidationException(crate::error::ValidationException),
|
1366 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1367 + | /// :param reason typing.Optional\[ebs.model.ServiceQuotaExceededExceptionReason\]:
|
1368 + | /// :param message typing.Optional\[str\]:
|
1369 + | /// :rtype None:
|
1370 + | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
1371 + | #[derive(
|
1372 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1373 + | )]
|
1374 + | pub struct ServiceQuotaExceededException {
|
1375 + | #[pyo3(get, set)]
|
1376 + | /// :type typing.Optional\[ebs.model.ServiceQuotaExceededExceptionReason\]:
|
1377 + | /// <p>The reason for the exception.</p>
|
1378 + | pub reason: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
1379 + | #[pyo3(get, set)]
|
1380 + | /// :type typing.Optional\[str\]:
|
1349 1381 | #[allow(missing_docs)] // documentation missing in model
|
1350 - | InternalServerError(crate::error::InternalServerError),
|
1351 - | }
|
1352 - | impl ::std::fmt::Display for GetSnapshotBlockError {
|
1353 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1354 - | match &self {
|
1355 - | GetSnapshotBlockError::InternalServerException(_inner) => _inner.fmt(f),
|
1356 - | GetSnapshotBlockError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
1357 - | GetSnapshotBlockError::AccessDeniedException(_inner) => _inner.fmt(f),
|
1358 - | GetSnapshotBlockError::RequestThrottledException(_inner) => _inner.fmt(f),
|
1359 - | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
1360 - | GetSnapshotBlockError::ValidationException(_inner) => _inner.fmt(f),
|
1361 - | GetSnapshotBlockError::InternalServerError(_inner) => _inner.fmt(f),
|
1362 - | }
|
1363 - | }
|
1382 + | pub message: ::std::option::Option<::std::string::String>,
|
1364 1383 | }
|
1365 - | impl GetSnapshotBlockError {
|
1366 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::InternalServerException`.
|
1367 - | pub fn is_internal_server_exception(&self) -> bool {
|
1368 - | matches!(&self, GetSnapshotBlockError::InternalServerException(_))
|
1369 - | }
|
1370 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::ResourceNotFoundException`.
|
1371 - | pub fn is_resource_not_found_exception(&self) -> bool {
|
1372 - | matches!(&self, GetSnapshotBlockError::ResourceNotFoundException(_))
|
1373 - | }
|
1374 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::AccessDeniedException`.
|
1375 - | pub fn is_access_denied_exception(&self) -> bool {
|
1376 - | matches!(&self, GetSnapshotBlockError::AccessDeniedException(_))
|
1377 - | }
|
1378 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::RequestThrottledException`.
|
1379 - | pub fn is_request_throttled_exception(&self) -> bool {
|
1380 - | matches!(&self, GetSnapshotBlockError::RequestThrottledException(_))
|
1381 - | }
|
1382 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::ServiceQuotaExceededException`.
|
1383 - | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
1384 - | matches!(
|
1384 + | impl ServiceQuotaExceededException {
|
1385 + | /// <p>The reason for the exception.</p>
|
1386 + | pub fn reason(
|
1385 1387 | &self,
|
1386 - | GetSnapshotBlockError::ServiceQuotaExceededException(_)
|
1387 - | )
|
1388 - | }
|
1389 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::ValidationException`.
|
1390 - | pub fn is_validation_exception(&self) -> bool {
|
1391 - | matches!(&self, GetSnapshotBlockError::ValidationException(_))
|
1388 + | ) -> ::std::option::Option<&crate::model::ServiceQuotaExceededExceptionReason> {
|
1389 + | self.reason.as_ref()
|
1392 1390 | }
|
1393 - | /// Returns `true` if the error kind is `GetSnapshotBlockError::InternalServerError`.
|
1394 - | pub fn is_internal_server_error(&self) -> bool {
|
1395 - | matches!(&self, GetSnapshotBlockError::InternalServerError(_))
|
1391 + | }
|
1392 + | #[allow(clippy::new_without_default)]
|
1393 + | #[allow(clippy::too_many_arguments)]
|
1394 + | #[::pyo3::pymethods]
|
1395 + | impl ServiceQuotaExceededException {
|
1396 + | #[new]
|
1397 + | pub fn new(
|
1398 + | reason: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
1399 + | message: ::std::option::Option<::std::string::String>,
|
1400 + | ) -> Self {
|
1401 + | Self { reason, message }
|
1396 1402 | }
|
1397 - | /// Returns the error name string by matching the correct variant.
|
1398 - | pub fn name(&self) -> &'static str {
|
1399 - | match &self {
|
1400 - | GetSnapshotBlockError::InternalServerException(_inner) => _inner.name(),
|
1401 - | GetSnapshotBlockError::ResourceNotFoundException(_inner) => _inner.name(),
|
1402 - | GetSnapshotBlockError::AccessDeniedException(_inner) => _inner.name(),
|
1403 - | GetSnapshotBlockError::RequestThrottledException(_inner) => _inner.name(),
|
1404 - | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
1405 - | GetSnapshotBlockError::ValidationException(_inner) => _inner.name(),
|
1406 - | GetSnapshotBlockError::InternalServerError(_inner) => _inner.name(),
|
1403 + | fn __repr__(&self) -> String {
|
1404 + | format!("{self:?}")
|
1407 1405 | }
|
1406 + | fn __str__(&self) -> String {
|
1407 + | format!("{self:?}")
|
1408 1408 | }
|
1409 1409 | }
|
1410 - | impl ::std::error::Error for GetSnapshotBlockError {
|
1411 - | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
1412 - | match &self {
|
1413 - | GetSnapshotBlockError::InternalServerException(_inner) => Some(_inner),
|
1414 - | GetSnapshotBlockError::ResourceNotFoundException(_inner) => Some(_inner),
|
1415 - | GetSnapshotBlockError::AccessDeniedException(_inner) => Some(_inner),
|
1416 - | GetSnapshotBlockError::RequestThrottledException(_inner) => Some(_inner),
|
1417 - | GetSnapshotBlockError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
1418 - | GetSnapshotBlockError::ValidationException(_inner) => Some(_inner),
|
1419 - | GetSnapshotBlockError::InternalServerError(_inner) => Some(_inner),
|
1410 + | impl ServiceQuotaExceededException {
|
1411 + | /// Returns the error message.
|
1412 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1413 + | self.message.as_deref()
|
1420 1414 | }
|
1415 + | #[doc(hidden)]
|
1416 + | /// Returns the error name.
|
1417 + | pub fn name(&self) -> &'static str {
|
1418 + | "ServiceQuotaExceededException"
|
1421 1419 | }
|
1422 1420 | }
|
1423 - | impl ::std::convert::From<crate::error::InternalServerException>
|
1424 - | for crate::error::GetSnapshotBlockError
|
1425 - | {
|
1426 - | fn from(variant: crate::error::InternalServerException) -> crate::error::GetSnapshotBlockError {
|
1427 - | Self::InternalServerException(variant)
|
1421 + | impl ::std::fmt::Display for ServiceQuotaExceededException {
|
1422 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1423 + | ::std::write!(f, "ServiceQuotaExceededException")?;
|
1424 + | if let ::std::option::Option::Some(inner_5) = &self.message {
|
1425 + | {
|
1426 + | ::std::write!(f, ": {inner_5}")?;
|
1427 + | }
|
1428 + | }
|
1429 + | Ok(())
|
1428 1430 | }
|
1429 1431 | }
|
1430 - | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
1431 - | for crate::error::GetSnapshotBlockError
|
1432 - | {
|
1433 - | fn from(
|
1434 - | variant: crate::error::ResourceNotFoundException,
|
1435 - | ) -> crate::error::GetSnapshotBlockError {
|
1436 - | Self::ResourceNotFoundException(variant)
|
1432 + | impl ::std::error::Error for ServiceQuotaExceededException {}
|
1433 + | impl ServiceQuotaExceededException {
|
1434 + | /// Creates a new builder-style object to manufacture [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
|
1435 + | pub fn builder() -> crate::error::service_quota_exceeded_exception::Builder {
|
1436 + | crate::error::service_quota_exceeded_exception::Builder::default()
|
1437 1437 | }
|
1438 1438 | }
|
1439 - | impl ::std::convert::From<crate::error::AccessDeniedException>
|
1440 - | for crate::error::GetSnapshotBlockError
|
1441 - | {
|
1442 - | fn from(variant: crate::error::AccessDeniedException) -> crate::error::GetSnapshotBlockError {
|
1443 - | Self::AccessDeniedException(variant)
|
1439 + |
|
1440 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1441 + | /// :param message str:
|
1442 + | /// :param field_list typing.Optional\[typing.List\[ebs.model.ValidationExceptionField\]\]:
|
1443 + | /// :rtype None:
|
1444 + | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
1445 + | #[derive(
|
1446 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1447 + | )]
|
1448 + | pub struct ValidationException {
|
1449 + | #[pyo3(get, set)]
|
1450 + | /// :type str:
|
1451 + | /// A summary of the validation failure.
|
1452 + | pub message: ::std::string::String,
|
1453 + | #[pyo3(get, set)]
|
1454 + | /// :type typing.Optional\[typing.List\[ebs.model.ValidationExceptionField\]\]:
|
1455 + | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
1456 + | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1457 + | }
|
1458 + | impl ValidationException {
|
1459 + | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
1460 + | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
1461 + | self.field_list.as_deref()
|
1444 1462 | }
|
1445 1463 | }
|
1446 - | impl ::std::convert::From<crate::error::RequestThrottledException>
|
1447 - | for crate::error::GetSnapshotBlockError
|
1448 - | {
|
1449 - | fn from(
|
1450 - | variant: crate::error::RequestThrottledException,
|
1451 - | ) -> crate::error::GetSnapshotBlockError {
|
1452 - | Self::RequestThrottledException(variant)
|
1464 + | #[allow(clippy::new_without_default)]
|
1465 + | #[allow(clippy::too_many_arguments)]
|
1466 + | #[::pyo3::pymethods]
|
1467 + | impl ValidationException {
|
1468 + | #[new]
|
1469 + | pub fn new(
|
1470 + | message: ::std::string::String,
|
1471 + | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1472 + | ) -> Self {
|
1473 + | Self {
|
1474 + | message,
|
1475 + | field_list,
|
1476 + | }
|
1477 + | }
|
1478 + | fn __repr__(&self) -> String {
|
1479 + | format!("{self:?}")
|
1480 + | }
|
1481 + | fn __str__(&self) -> String {
|
1482 + | format!("{self:?}")
|
1453 1483 | }
|
1454 1484 | }
|
1455 - | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
1456 - | for crate::error::GetSnapshotBlockError
|
1457 - | {
|
1458 - | fn from(
|
1459 - | variant: crate::error::ServiceQuotaExceededException,
|
1460 - | ) -> crate::error::GetSnapshotBlockError {
|
1461 - | Self::ServiceQuotaExceededException(variant)
|
1485 + | impl ValidationException {
|
1486 + | /// Returns the error message.
|
1487 + | pub fn message(&self) -> &str {
|
1488 + | &self.message
|
1489 + | }
|
1490 + | #[doc(hidden)]
|
1491 + | /// Returns the error name.
|
1492 + | pub fn name(&self) -> &'static str {
|
1493 + | "ValidationException"
|
1462 1494 | }
|
1463 1495 | }
|
1464 - | impl ::std::convert::From<crate::error::ValidationException>
|
1465 - | for crate::error::GetSnapshotBlockError
|
1466 - | {
|
1467 - | fn from(variant: crate::error::ValidationException) -> crate::error::GetSnapshotBlockError {
|
1468 - | Self::ValidationException(variant)
|
1496 + | impl ::std::fmt::Display for ValidationException {
|
1497 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1498 + | ::std::write!(f, "ValidationException")?;
|
1499 + | {
|
1500 + | ::std::write!(f, ": {}", &self.message)?;
|
1501 + | }
|
1502 + | Ok(())
|
1469 1503 | }
|
1470 1504 | }
|
1471 - | impl ::std::convert::From<crate::error::InternalServerError>
|
1472 - | for crate::error::GetSnapshotBlockError
|
1473 - | {
|
1474 - | fn from(variant: crate::error::InternalServerError) -> crate::error::GetSnapshotBlockError {
|
1475 - | Self::InternalServerError(variant)
|
1505 + | impl ::std::error::Error for ValidationException {}
|
1506 + | impl ValidationException {
|
1507 + | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
1508 + | pub fn builder() -> crate::error::validation_exception::Builder {
|
1509 + | crate::error::validation_exception::Builder::default()
|
1476 1510 | }
|
1477 1511 | }
|
1478 1512 |
|
1479 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::GetSnapshotBlockError {
|
1480 - | fn from(variant: ::pyo3::PyErr) -> crate::error::GetSnapshotBlockError {
|
1481 - | ::pyo3::Python::with_gil(|py| {
|
1482 - | let error = variant.value(py);
|
1483 - | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
1484 - | return error.into();
|
1513 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1514 + | /// :param message str:
|
1515 + | /// :rtype None:
|
1516 + | #[allow(missing_docs)] // documentation missing in model
|
1517 + | #[derive(
|
1518 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1519 + | )]
|
1520 + | pub struct InternalServerError {
|
1521 + | #[pyo3(get, set)]
|
1522 + | /// :type str:
|
1523 + | #[allow(missing_docs)] // documentation missing in model
|
1524 + | pub message: ::std::string::String,
|
1525 + | }
|
1526 + | #[allow(clippy::new_without_default)]
|
1527 + | #[allow(clippy::too_many_arguments)]
|
1528 + | #[::pyo3::pymethods]
|
1529 + | impl InternalServerError {
|
1530 + | #[new]
|
1531 + | pub fn new(message: ::std::string::String) -> Self {
|
1532 + | Self { message }
|
1485 1533 | }
|
1486 - | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
1487 - | return error.into();
|
1534 + | fn __repr__(&self) -> String {
|
1535 + | format!("{self:?}")
|
1488 1536 | }
|
1489 - | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
1490 - | return error.into();
|
1537 + | fn __str__(&self) -> String {
|
1538 + | format!("{self:?}")
|
1491 1539 | }
|
1492 - | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
1493 - | return error.into();
|
1540 + | }
|
1541 + | impl InternalServerError {
|
1542 + | /// Returns the error message.
|
1543 + | pub fn message(&self) -> &str {
|
1544 + | &self.message
|
1494 1545 | }
|
1495 - | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
1496 - | return error.into();
|
1546 + | #[doc(hidden)]
|
1547 + | /// Returns the error name.
|
1548 + | pub fn name(&self) -> &'static str {
|
1549 + | "InternalServerError"
|
1497 1550 | }
|
1498 - | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
1499 - | return error.into();
|
1551 + | }
|
1552 + | impl ::std::fmt::Display for InternalServerError {
|
1553 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1554 + | ::std::write!(f, "InternalServerError")?;
|
1555 + | {
|
1556 + | ::std::write!(f, ": {}", &self.message)?;
|
1500 1557 | }
|
1501 - | crate::error::InternalServerError {
|
1502 - | message: error.to_string(),
|
1558 + | Ok(())
|
1503 1559 | }
|
1504 - | .into()
|
1505 - | })
|
1560 + | }
|
1561 + | impl ::std::error::Error for InternalServerError {}
|
1562 + | impl InternalServerError {
|
1563 + | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
1564 + | pub fn builder() -> crate::error::internal_server_error::Builder {
|
1565 + | crate::error::internal_server_error::Builder::default()
|
1506 1566 | }
|
1507 1567 | }
|
1508 1568 |
|
1509 - | /// Error type for the `CompleteSnapshot` operation.
|
1510 - | /// Each variant represents an error that can occur for the `CompleteSnapshot` operation.
|
1511 - | #[derive(::std::fmt::Debug)]
|
1512 - | pub enum CompleteSnapshotError {
|
1513 - | /// <p>An internal error has occurred.</p>
|
1514 - | InternalServerException(crate::error::InternalServerException),
|
1515 - | /// <p>The specified resource does not exist.</p>
|
1516 - | ResourceNotFoundException(crate::error::ResourceNotFoundException),
|
1517 - | /// <p>You do not have sufficient access to perform this action.</p>
|
1518 - | AccessDeniedException(crate::error::AccessDeniedException),
|
1519 - | /// <p>The number of API requests has exceed the maximum allowed API request throttling limit.</p>
|
1520 - | RequestThrottledException(crate::error::RequestThrottledException),
|
1521 - | /// <p>Your current service quotas do not allow you to perform this action.</p>
|
1522 - | ServiceQuotaExceededException(crate::error::ServiceQuotaExceededException),
|
1523 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
1524 - | ValidationException(crate::error::ValidationException),
|
1569 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1570 + | /// :param message typing.Optional\[str\]:
|
1571 + | /// :rtype None:
|
1572 + | /// <p>The request uses the same client token as a previous, but non-identical request.</p>
|
1573 + | #[derive(
|
1574 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1575 + | )]
|
1576 + | pub struct ConflictException {
|
1577 + | #[pyo3(get, set)]
|
1578 + | /// :type typing.Optional\[str\]:
|
1525 1579 | #[allow(missing_docs)] // documentation missing in model
|
1526 - | InternalServerError(crate::error::InternalServerError),
|
1527 - | }
|
1528 - | impl ::std::fmt::Display for CompleteSnapshotError {
|
1529 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1530 - | match &self {
|
1531 - | CompleteSnapshotError::InternalServerException(_inner) => _inner.fmt(f),
|
1532 - | CompleteSnapshotError::ResourceNotFoundException(_inner) => _inner.fmt(f),
|
1533 - | CompleteSnapshotError::AccessDeniedException(_inner) => _inner.fmt(f),
|
1534 - | CompleteSnapshotError::RequestThrottledException(_inner) => _inner.fmt(f),
|
1535 - | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
|
1536 - | CompleteSnapshotError::ValidationException(_inner) => _inner.fmt(f),
|
1537 - | CompleteSnapshotError::InternalServerError(_inner) => _inner.fmt(f),
|
1538 - | }
|
1539 - | }
|
1580 + | pub message: ::std::option::Option<::std::string::String>,
|
1540 1581 | }
|
1541 - | impl CompleteSnapshotError {
|
1542 - | /// Returns `true` if the error kind is `CompleteSnapshotError::InternalServerException`.
|
1543 - | pub fn is_internal_server_exception(&self) -> bool {
|
1544 - | matches!(&self, CompleteSnapshotError::InternalServerException(_))
|
1582 + | #[allow(clippy::new_without_default)]
|
1583 + | #[allow(clippy::too_many_arguments)]
|
1584 + | #[::pyo3::pymethods]
|
1585 + | impl ConflictException {
|
1586 + | #[new]
|
1587 + | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
1588 + | Self { message }
|
1545 1589 | }
|
1546 - | /// Returns `true` if the error kind is `CompleteSnapshotError::ResourceNotFoundException`.
|
1547 - | pub fn is_resource_not_found_exception(&self) -> bool {
|
1548 - | matches!(&self, CompleteSnapshotError::ResourceNotFoundException(_))
|
1590 + | fn __repr__(&self) -> String {
|
1591 + | format!("{self:?}")
|
1549 1592 | }
|
1550 - | /// Returns `true` if the error kind is `CompleteSnapshotError::AccessDeniedException`.
|
1551 - | pub fn is_access_denied_exception(&self) -> bool {
|
1552 - | matches!(&self, CompleteSnapshotError::AccessDeniedException(_))
|
1593 + | fn __str__(&self) -> String {
|
1594 + | format!("{self:?}")
|
1553 1595 | }
|
1554 - | /// Returns `true` if the error kind is `CompleteSnapshotError::RequestThrottledException`.
|
1555 - | pub fn is_request_throttled_exception(&self) -> bool {
|
1556 - | matches!(&self, CompleteSnapshotError::RequestThrottledException(_))
|
1596 + | }
|
1597 + | impl ConflictException {
|
1598 + | /// Returns the error message.
|
1599 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1600 + | self.message.as_deref()
|
1557 1601 | }
|
1558 - | /// Returns `true` if the error kind is `CompleteSnapshotError::ServiceQuotaExceededException`.
|
1559 - | pub fn is_service_quota_exceeded_exception(&self) -> bool {
|
1560 - | matches!(
|
1561 - | &self,
|
1562 - | CompleteSnapshotError::ServiceQuotaExceededException(_)
|
1563 - | )
|
1602 + | #[doc(hidden)]
|
1603 + | /// Returns the error name.
|
1604 + | pub fn name(&self) -> &'static str {
|
1605 + | "ConflictException"
|
1564 1606 | }
|
1565 - | /// Returns `true` if the error kind is `CompleteSnapshotError::ValidationException`.
|
1566 - | pub fn is_validation_exception(&self) -> bool {
|
1567 - | matches!(&self, CompleteSnapshotError::ValidationException(_))
|
1607 + | }
|
1608 + | impl ::std::fmt::Display for ConflictException {
|
1609 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1610 + | ::std::write!(f, "ConflictException")?;
|
1611 + | if let ::std::option::Option::Some(inner_6) = &self.message {
|
1612 + | {
|
1613 + | ::std::write!(f, ": {inner_6}")?;
|
1568 1614 | }
|
1569 - | /// Returns `true` if the error kind is `CompleteSnapshotError::InternalServerError`.
|
1570 - | pub fn is_internal_server_error(&self) -> bool {
|
1571 - | matches!(&self, CompleteSnapshotError::InternalServerError(_))
|
1572 1615 | }
|
1573 - | /// Returns the error name string by matching the correct variant.
|
1574 - | pub fn name(&self) -> &'static str {
|
1575 - | match &self {
|
1576 - | CompleteSnapshotError::InternalServerException(_inner) => _inner.name(),
|
1577 - | CompleteSnapshotError::ResourceNotFoundException(_inner) => _inner.name(),
|
1578 - | CompleteSnapshotError::AccessDeniedException(_inner) => _inner.name(),
|
1579 - | CompleteSnapshotError::RequestThrottledException(_inner) => _inner.name(),
|
1580 - | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => _inner.name(),
|
1581 - | CompleteSnapshotError::ValidationException(_inner) => _inner.name(),
|
1582 - | CompleteSnapshotError::InternalServerError(_inner) => _inner.name(),
|
1616 + | Ok(())
|
1583 1617 | }
|
1618 + | }
|
1619 + | impl ::std::error::Error for ConflictException {}
|
1620 + | impl ConflictException {
|
1621 + | /// Creates a new builder-style object to manufacture [`ConflictException`](crate::error::ConflictException).
|
1622 + | pub fn builder() -> crate::error::conflict_exception::Builder {
|
1623 + | crate::error::conflict_exception::Builder::default()
|
1584 1624 | }
|
1585 1625 | }
|
1586 - | impl ::std::error::Error for CompleteSnapshotError {
|
1587 - | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
1588 - | match &self {
|
1589 - | CompleteSnapshotError::InternalServerException(_inner) => Some(_inner),
|
1590 - | CompleteSnapshotError::ResourceNotFoundException(_inner) => Some(_inner),
|
1591 - | CompleteSnapshotError::AccessDeniedException(_inner) => Some(_inner),
|
1592 - | CompleteSnapshotError::RequestThrottledException(_inner) => Some(_inner),
|
1593 - | CompleteSnapshotError::ServiceQuotaExceededException(_inner) => Some(_inner),
|
1594 - | CompleteSnapshotError::ValidationException(_inner) => Some(_inner),
|
1595 - | CompleteSnapshotError::InternalServerError(_inner) => Some(_inner),
|
1626 + |
|
1627 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
1628 + | /// :param message typing.Optional\[str\]:
|
1629 + | /// :rtype None:
|
1630 + | /// <p>You have reached the limit for concurrent API requests. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance">Optimizing performance of the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1631 + | #[derive(
|
1632 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1633 + | )]
|
1634 + | pub struct ConcurrentLimitExceededException {
|
1635 + | #[pyo3(get, set)]
|
1636 + | /// :type typing.Optional\[str\]:
|
1637 + | #[allow(missing_docs)] // documentation missing in model
|
1638 + | pub message: ::std::option::Option<::std::string::String>,
|
1639 + | }
|
1640 + | #[allow(clippy::new_without_default)]
|
1641 + | #[allow(clippy::too_many_arguments)]
|
1642 + | #[::pyo3::pymethods]
|
1643 + | impl ConcurrentLimitExceededException {
|
1644 + | #[new]
|
1645 + | pub fn new(message: ::std::option::Option<::std::string::String>) -> Self {
|
1646 + | Self { message }
|
1596 1647 | }
|
1648 + | fn __repr__(&self) -> String {
|
1649 + | format!("{self:?}")
|
1597 1650 | }
|
1598 - | }
|
1599 - | impl ::std::convert::From<crate::error::InternalServerException>
|
1600 - | for crate::error::CompleteSnapshotError
|
1601 - | {
|
1602 - | fn from(variant: crate::error::InternalServerException) -> crate::error::CompleteSnapshotError {
|
1603 - | Self::InternalServerException(variant)
|
1651 + | fn __str__(&self) -> String {
|
1652 + | format!("{self:?}")
|
1604 1653 | }
|
1605 1654 | }
|
1606 - | impl ::std::convert::From<crate::error::ResourceNotFoundException>
|
1607 - | for crate::error::CompleteSnapshotError
|
1608 - | {
|
1609 - | fn from(
|
1610 - | variant: crate::error::ResourceNotFoundException,
|
1611 - | ) -> crate::error::CompleteSnapshotError {
|
1612 - | Self::ResourceNotFoundException(variant)
|
1655 + | impl ConcurrentLimitExceededException {
|
1656 + | /// Returns the error message.
|
1657 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
1658 + | self.message.as_deref()
|
1613 1659 | }
|
1614 - | }
|
1615 - | impl ::std::convert::From<crate::error::AccessDeniedException>
|
1616 - | for crate::error::CompleteSnapshotError
|
1617 - | {
|
1618 - | fn from(variant: crate::error::AccessDeniedException) -> crate::error::CompleteSnapshotError {
|
1619 - | Self::AccessDeniedException(variant)
|
1660 + | #[doc(hidden)]
|
1661 + | /// Returns the error name.
|
1662 + | pub fn name(&self) -> &'static str {
|
1663 + | "ConcurrentLimitExceededException"
|
1620 1664 | }
|
1621 1665 | }
|
1622 - | impl ::std::convert::From<crate::error::RequestThrottledException>
|
1623 - | for crate::error::CompleteSnapshotError
|
1624 - | {
|
1625 - | fn from(
|
1626 - | variant: crate::error::RequestThrottledException,
|
1627 - | ) -> crate::error::CompleteSnapshotError {
|
1628 - | Self::RequestThrottledException(variant)
|
1666 + | impl ::std::fmt::Display for ConcurrentLimitExceededException {
|
1667 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1668 + | ::std::write!(f, "ConcurrentLimitExceededException")?;
|
1669 + | if let ::std::option::Option::Some(inner_7) = &self.message {
|
1670 + | {
|
1671 + | ::std::write!(f, ": {inner_7}")?;
|
1629 1672 | }
|
1630 - | }
|
1631 - | impl ::std::convert::From<crate::error::ServiceQuotaExceededException>
|
1632 - | for crate::error::CompleteSnapshotError
|
1633 - | {
|
1634 - | fn from(
|
1635 - | variant: crate::error::ServiceQuotaExceededException,
|
1636 - | ) -> crate::error::CompleteSnapshotError {
|
1637 - | Self::ServiceQuotaExceededException(variant)
|
1638 1673 | }
|
1639 - | }
|
1640 - | impl ::std::convert::From<crate::error::ValidationException>
|
1641 - | for crate::error::CompleteSnapshotError
|
1642 - | {
|
1643 - | fn from(variant: crate::error::ValidationException) -> crate::error::CompleteSnapshotError {
|
1644 - | Self::ValidationException(variant)
|
1674 + | Ok(())
|
1645 1675 | }
|
1646 1676 | }
|
1647 - | impl ::std::convert::From<crate::error::InternalServerError>
|
1648 - | for crate::error::CompleteSnapshotError
|
1649 - | {
|
1650 - | fn from(variant: crate::error::InternalServerError) -> crate::error::CompleteSnapshotError {
|
1651 - | Self::InternalServerError(variant)
|
1677 + | impl ::std::error::Error for ConcurrentLimitExceededException {}
|
1678 + | impl ConcurrentLimitExceededException {
|
1679 + | /// Creates a new builder-style object to manufacture [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
1680 + | pub fn builder() -> crate::error::concurrent_limit_exceeded_exception::Builder {
|
1681 + | crate::error::concurrent_limit_exceeded_exception::Builder::default()
|
1652 1682 | }
|
1653 1683 | }
|
1684 + | /// See [`InternalServerException`](crate::error::InternalServerException).
|
1685 + | pub mod internal_server_exception {
|
1654 1686 |
|
1655 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::CompleteSnapshotError {
|
1656 - | fn from(variant: ::pyo3::PyErr) -> crate::error::CompleteSnapshotError {
|
1657 - | ::pyo3::Python::with_gil(|py| {
|
1658 - | let error = variant.value(py);
|
1659 - | if let Ok(error) = error.extract::<crate::error::InternalServerException>() {
|
1660 - | return error.into();
|
1687 + | impl ::std::convert::From<Builder> for crate::error::InternalServerException {
|
1688 + | fn from(builder: Builder) -> Self {
|
1689 + | builder.build()
|
1661 1690 | }
|
1662 - | if let Ok(error) = error.extract::<crate::error::ResourceNotFoundException>() {
|
1663 - | return error.into();
|
1664 1691 | }
|
1665 - | if let Ok(error) = error.extract::<crate::error::AccessDeniedException>() {
|
1666 - | return error.into();
|
1692 + | /// A builder for [`InternalServerException`](crate::error::InternalServerException).
|
1693 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1694 + | pub struct Builder {
|
1695 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1667 1696 | }
|
1668 - | if let Ok(error) = error.extract::<crate::error::RequestThrottledException>() {
|
1669 - | return error.into();
|
1697 + | impl Builder {
|
1698 + | #[allow(missing_docs)] // documentation missing in model
|
1699 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1700 + | self.message = input;
|
1701 + | self
|
1670 1702 | }
|
1671 - | if let Ok(error) = error.extract::<crate::error::ServiceQuotaExceededException>() {
|
1672 - | return error.into();
|
1703 + | /// Consumes the builder and constructs a [`InternalServerException`](crate::error::InternalServerException).
|
1704 + | pub fn build(self) -> crate::error::InternalServerException {
|
1705 + | self.build_enforcing_required_and_enum_traits()
|
1673 1706 | }
|
1674 - | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
1675 - | return error.into();
|
1707 + | fn build_enforcing_required_and_enum_traits(self) -> crate::error::InternalServerException {
|
1708 + | crate::error::InternalServerException {
|
1709 + | message: self.message,
|
1676 1710 | }
|
1677 - | crate::error::InternalServerError {
|
1678 - | message: error.to_string(),
|
1679 1711 | }
|
1680 - | .into()
|
1681 - | })
|
1682 1712 | }
|
1683 1713 | }
|
1684 - | /// See [`InternalServerError`](crate::error::InternalServerError).
|
1685 - | pub mod internal_server_error {
|
1686 - |
|
1687 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1688 - | /// Holds one variant for each of the ways the builder can fail.
|
1689 - | #[allow(clippy::enum_variant_names)]
|
1690 - | pub enum ConstraintViolation {
|
1691 - | /// `message` was not provided but it is required when building `InternalServerError`.
|
1692 - | MissingMessage,
|
1693 - | }
|
1694 - | impl ::std::fmt::Display for ConstraintViolation {
|
1695 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1696 - | match self {
|
1697 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
1698 - | }
|
1699 - | }
|
1700 - | }
|
1701 - | impl ::std::error::Error for ConstraintViolation {}
|
1702 - | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
1703 - | type Error = ConstraintViolation;
|
1714 + | /// See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
1715 + | pub mod resource_not_found_exception {
|
1704 1716 |
|
1705 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1717 + | impl ::std::convert::From<Builder> for crate::error::ResourceNotFoundException {
|
1718 + | fn from(builder: Builder) -> Self {
|
1706 1719 | builder.build()
|
1707 1720 | }
|
1708 1721 | }
|
1709 - | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
1722 + | /// A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
1710 1723 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1711 1724 | pub struct Builder {
|
1712 1725 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1726 + | pub(crate) reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
1713 1727 | }
|
1714 1728 | impl Builder {
|
1715 1729 | #[allow(missing_docs)] // documentation missing in model
|
1716 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1717 - | self.message = Some(input);
|
1730 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1731 + | self.message = input;
|
1718 1732 | self
|
1719 1733 | }
|
1720 - | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
1721 - | ///
|
1722 - | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
1723 - | ///
|
1724 - | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
1734 + | /// <p>The reason for the exception.</p>
|
1735 + | pub fn reason(
|
1736 + | mut self,
|
1737 + | input: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
1738 + | ) -> Self {
|
1739 + | self.reason = input;
|
1740 + | self
|
1741 + | }
|
1742 + | /// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
1743 + | pub fn build(self) -> crate::error::ResourceNotFoundException {
|
1725 1744 | self.build_enforcing_required_and_enum_traits()
|
1726 1745 | }
|
1727 1746 | fn build_enforcing_required_and_enum_traits(
|
1728 1747 | self,
|
1729 - | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
1730 - | Ok(crate::error::InternalServerError {
|
1731 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
1732 - | })
|
1748 + | ) -> crate::error::ResourceNotFoundException {
|
1749 + | crate::error::ResourceNotFoundException {
|
1750 + | message: self.message,
|
1751 + | reason: self.reason,
|
1752 + | }
|
1733 1753 | }
|
1734 1754 | }
|
1735 1755 | }
|
1736 - | /// See [`ValidationException`](crate::error::ValidationException).
|
1737 - | pub mod validation_exception {
|
1756 + | /// See [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1757 + | pub mod access_denied_exception {
|
1738 1758 |
|
1739 1759 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1740 1760 | /// Holds one variant for each of the ways the builder can fail.
|
1741 1761 | #[allow(clippy::enum_variant_names)]
|
1742 1762 | pub enum ConstraintViolation {
|
1743 - | /// `message` was not provided but it is required when building `ValidationException`.
|
1744 - | MissingMessage,
|
1763 + | /// `reason` was not provided but it is required when building `AccessDeniedException`.
|
1764 + | MissingReason,
|
1745 1765 | }
|
1746 1766 | impl ::std::fmt::Display for ConstraintViolation {
|
1747 1767 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1748 1768 | match self {
|
1749 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
1769 + | ConstraintViolation::MissingReason => write!(f, "`reason` was not provided but it is required when building `AccessDeniedException`"),
|
1750 1770 | }
|
1751 1771 | }
|
1752 1772 | }
|
1753 1773 | impl ::std::error::Error for ConstraintViolation {}
|
1754 - | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
1774 + | impl ::std::convert::TryFrom<Builder> for crate::error::AccessDeniedException {
|
1755 1775 | type Error = ConstraintViolation;
|
1756 1776 |
|
1757 1777 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1758 1778 | builder.build()
|
1759 1779 | }
|
1760 1780 | }
|
1761 - | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
1781 + | /// A builder for [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1762 1782 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1763 1783 | pub struct Builder {
|
1764 1784 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1765 - | pub(crate) field_list:
|
1766 - | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1785 + | pub(crate) reason: ::std::option::Option<crate::model::AccessDeniedExceptionReason>,
|
1767 1786 | }
|
1768 1787 | impl Builder {
|
1769 - | /// A summary of the validation failure.
|
1770 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1771 - | self.message = Some(input);
|
1788 + | #[allow(missing_docs)] // documentation missing in model
|
1789 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1790 + | self.message = input;
|
1772 1791 | self
|
1773 1792 | }
|
1774 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
1775 - | pub fn field_list(
|
1776 - | mut self,
|
1777 - | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1778 - | ) -> Self {
|
1779 - | self.field_list = input;
|
1793 + | /// <p>The reason for the exception.</p>
|
1794 + | pub fn reason(mut self, input: crate::model::AccessDeniedExceptionReason) -> Self {
|
1795 + | self.reason = Some(input);
|
1780 1796 | self
|
1781 1797 | }
|
1782 - | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
1798 + | /// Consumes the builder and constructs a [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1783 1799 | ///
|
1784 - | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
1800 + | /// The builder fails to construct a [`AccessDeniedException`](crate::error::AccessDeniedException) if you do not provide a value for all non-`Option`al members.
|
1785 1801 | ///
|
1786 - | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
1802 + | pub fn build(self) -> Result<crate::error::AccessDeniedException, ConstraintViolation> {
|
1787 1803 | self.build_enforcing_required_and_enum_traits()
|
1788 1804 | }
|
1789 1805 | fn build_enforcing_required_and_enum_traits(
|
1790 1806 | self,
|
1791 - | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
1792 - | Ok(crate::error::ValidationException {
|
1793 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
1794 - | field_list: self.field_list,
|
1807 + | ) -> Result<crate::error::AccessDeniedException, ConstraintViolation> {
|
1808 + | Ok(crate::error::AccessDeniedException {
|
1809 + | message: self.message,
|
1810 + | reason: self.reason.ok_or(ConstraintViolation::MissingReason)?,
|
1795 1811 | })
|
1796 1812 | }
|
1797 1813 | }
|
1798 1814 | }
|
1799 - | /// See [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
1800 - | pub mod concurrent_limit_exceeded_exception {
|
1815 + | /// See [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1816 + | pub mod request_throttled_exception {
|
1801 1817 |
|
1802 - | impl ::std::convert::From<Builder> for crate::error::ConcurrentLimitExceededException {
|
1818 + | impl ::std::convert::From<Builder> for crate::error::RequestThrottledException {
|
1803 1819 | fn from(builder: Builder) -> Self {
|
1804 1820 | builder.build()
|
1805 1821 | }
|
1806 1822 | }
|
1807 - | /// A builder for [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
1823 + | /// A builder for [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1808 1824 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1809 1825 | pub struct Builder {
|
1810 1826 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1827 + | pub(crate) reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1811 1828 | }
|
1812 1829 | impl Builder {
|
1813 1830 | #[allow(missing_docs)] // documentation missing in model
|
1814 1831 | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1815 1832 | self.message = input;
|
1816 1833 | self
|
1817 1834 | }
|
1818 - | /// Consumes the builder and constructs a [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
1819 - | pub fn build(self) -> crate::error::ConcurrentLimitExceededException {
|
1835 + | /// <p>The reason for the exception.</p>
|
1836 + | pub fn reason(
|
1837 + | mut self,
|
1838 + | input: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1839 + | ) -> Self {
|
1840 + | self.reason = input;
|
1841 + | self
|
1842 + | }
|
1843 + | /// Consumes the builder and constructs a [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1844 + | pub fn build(self) -> crate::error::RequestThrottledException {
|
1820 1845 | self.build_enforcing_required_and_enum_traits()
|
1821 1846 | }
|
1822 1847 | fn build_enforcing_required_and_enum_traits(
|
1823 1848 | self,
|
1824 - | ) -> crate::error::ConcurrentLimitExceededException {
|
1825 - | crate::error::ConcurrentLimitExceededException {
|
1849 + | ) -> crate::error::RequestThrottledException {
|
1850 + | crate::error::RequestThrottledException {
|
1826 1851 | message: self.message,
|
1852 + | reason: self.reason,
|
1827 1853 | }
|
1828 1854 | }
|
1829 1855 | }
|
1830 1856 | }
|
1831 1857 | /// See [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
|
1832 1858 | pub mod service_quota_exceeded_exception {
|
1833 1859 |
|
1834 1860 | impl ::std::convert::From<Builder> for crate::error::ServiceQuotaExceededException {
|
1835 1861 | fn from(builder: Builder) -> Self {
|
1836 1862 | builder.build()
|
1837 1863 | }
|
1838 1864 | }
|
1839 1865 | /// A builder for [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
|
1840 1866 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1841 1867 | pub struct Builder {
|
1842 1868 | pub(crate) reason: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
1843 1869 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1844 1870 | }
|
1845 1871 | impl Builder {
|
1846 1872 | /// <p>The reason for the exception.</p>
|
1847 1873 | pub fn reason(
|
1848 1874 | mut self,
|
1849 1875 | input: ::std::option::Option<crate::model::ServiceQuotaExceededExceptionReason>,
|
1850 1876 | ) -> Self {
|
1851 1877 | self.reason = input;
|
1852 1878 | self
|
1853 1879 | }
|
1854 1880 | #[allow(missing_docs)] // documentation missing in model
|
1855 1881 | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1856 1882 | self.message = input;
|
1857 1883 | self
|
1858 1884 | }
|
1859 1885 | /// Consumes the builder and constructs a [`ServiceQuotaExceededException`](crate::error::ServiceQuotaExceededException).
|
1860 1886 | pub fn build(self) -> crate::error::ServiceQuotaExceededException {
|
1861 1887 | self.build_enforcing_required_and_enum_traits()
|
1862 1888 | }
|
1863 1889 | fn build_enforcing_required_and_enum_traits(
|
1864 1890 | self,
|
1865 1891 | ) -> crate::error::ServiceQuotaExceededException {
|
1866 1892 | crate::error::ServiceQuotaExceededException {
|
1867 1893 | reason: self.reason,
|
1868 1894 | message: self.message,
|
1869 1895 | }
|
1870 1896 | }
|
1871 1897 | }
|
1872 1898 | }
|
1873 - | /// See [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1874 - | pub mod request_throttled_exception {
|
1899 + | /// See [`ValidationException`](crate::error::ValidationException).
|
1900 + | pub mod validation_exception {
|
1875 1901 |
|
1876 - | impl ::std::convert::From<Builder> for crate::error::RequestThrottledException {
|
1877 - | fn from(builder: Builder) -> Self {
|
1902 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1903 + | /// Holds one variant for each of the ways the builder can fail.
|
1904 + | #[allow(clippy::enum_variant_names)]
|
1905 + | pub enum ConstraintViolation {
|
1906 + | /// `message` was not provided but it is required when building `ValidationException`.
|
1907 + | MissingMessage,
|
1908 + | }
|
1909 + | impl ::std::fmt::Display for ConstraintViolation {
|
1910 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1911 + | match self {
|
1912 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
1913 + | }
|
1914 + | }
|
1915 + | }
|
1916 + | impl ::std::error::Error for ConstraintViolation {}
|
1917 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
1918 + | type Error = ConstraintViolation;
|
1919 + |
|
1920 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1878 1921 | builder.build()
|
1879 1922 | }
|
1880 1923 | }
|
1881 - | /// A builder for [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1924 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
1882 1925 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1883 1926 | pub struct Builder {
|
1884 1927 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1885 - | pub(crate) reason: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1928 + | pub(crate) field_list:
|
1929 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1886 1930 | }
|
1887 1931 | impl Builder {
|
1888 - | #[allow(missing_docs)] // documentation missing in model
|
1889 - | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1890 - | self.message = input;
|
1932 + | /// A summary of the validation failure.
|
1933 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1934 + | self.message = Some(input);
|
1891 1935 | self
|
1892 1936 | }
|
1893 - | /// <p>The reason for the exception.</p>
|
1894 - | pub fn reason(
|
1937 + | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
1938 + | pub fn field_list(
|
1895 1939 | mut self,
|
1896 - | input: ::std::option::Option<crate::model::RequestThrottledExceptionReason>,
|
1940 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
1897 1941 | ) -> Self {
|
1898 - | self.reason = input;
|
1942 + | self.field_list = input;
|
1899 1943 | self
|
1900 1944 | }
|
1901 - | /// Consumes the builder and constructs a [`RequestThrottledException`](crate::error::RequestThrottledException).
|
1902 - | pub fn build(self) -> crate::error::RequestThrottledException {
|
1945 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
1946 + | ///
|
1947 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
1948 + | ///
|
1949 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
1903 1950 | self.build_enforcing_required_and_enum_traits()
|
1904 1951 | }
|
1905 1952 | fn build_enforcing_required_and_enum_traits(
|
1906 1953 | self,
|
1907 - | ) -> crate::error::RequestThrottledException {
|
1908 - | crate::error::RequestThrottledException {
|
1909 - | message: self.message,
|
1910 - | reason: self.reason,
|
1911 - | }
|
1912 - | }
|
1913 - | }
|
1914 - | }
|
1915 - | /// See [`ConflictException`](crate::error::ConflictException).
|
1916 - | pub mod conflict_exception {
|
1917 - |
|
1918 - | impl ::std::convert::From<Builder> for crate::error::ConflictException {
|
1919 - | fn from(builder: Builder) -> Self {
|
1920 - | builder.build()
|
1921 - | }
|
1922 - | }
|
1923 - | /// A builder for [`ConflictException`](crate::error::ConflictException).
|
1924 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1925 - | pub struct Builder {
|
1926 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1927 - | }
|
1928 - | impl Builder {
|
1929 - | #[allow(missing_docs)] // documentation missing in model
|
1930 - | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1931 - | self.message = input;
|
1932 - | self
|
1933 - | }
|
1934 - | /// Consumes the builder and constructs a [`ConflictException`](crate::error::ConflictException).
|
1935 - | pub fn build(self) -> crate::error::ConflictException {
|
1936 - | self.build_enforcing_required_and_enum_traits()
|
1937 - | }
|
1938 - | fn build_enforcing_required_and_enum_traits(self) -> crate::error::ConflictException {
|
1939 - | crate::error::ConflictException {
|
1940 - | message: self.message,
|
1941 - | }
|
1954 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
1955 + | Ok(crate::error::ValidationException {
|
1956 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
1957 + | field_list: self.field_list,
|
1958 + | })
|
1942 1959 | }
|
1943 1960 | }
|
1944 1961 | }
|
1945 - | /// See [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1946 - | pub mod access_denied_exception {
|
1962 + | /// See [`InternalServerError`](crate::error::InternalServerError).
|
1963 + | pub mod internal_server_error {
|
1947 1964 |
|
1948 1965 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1949 1966 | /// Holds one variant for each of the ways the builder can fail.
|
1950 1967 | #[allow(clippy::enum_variant_names)]
|
1951 1968 | pub enum ConstraintViolation {
|
1952 - | /// `reason` was not provided but it is required when building `AccessDeniedException`.
|
1953 - | MissingReason,
|
1969 + | /// `message` was not provided but it is required when building `InternalServerError`.
|
1970 + | MissingMessage,
|
1954 1971 | }
|
1955 1972 | impl ::std::fmt::Display for ConstraintViolation {
|
1956 1973 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1957 1974 | match self {
|
1958 - | ConstraintViolation::MissingReason => write!(f, "`reason` was not provided but it is required when building `AccessDeniedException`"),
|
1975 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
1959 1976 | }
|
1960 1977 | }
|
1961 1978 | }
|
1962 1979 | impl ::std::error::Error for ConstraintViolation {}
|
1963 - | impl ::std::convert::TryFrom<Builder> for crate::error::AccessDeniedException {
|
1980 + | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
1964 1981 | type Error = ConstraintViolation;
|
1965 1982 |
|
1966 1983 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1967 1984 | builder.build()
|
1968 1985 | }
|
1969 1986 | }
|
1970 - | /// A builder for [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1987 + | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
1971 1988 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1972 1989 | pub struct Builder {
|
1973 1990 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1974 - | pub(crate) reason: ::std::option::Option<crate::model::AccessDeniedExceptionReason>,
|
1975 1991 | }
|
1976 1992 | impl Builder {
|
1977 1993 | #[allow(missing_docs)] // documentation missing in model
|
1978 - | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1979 - | self.message = input;
|
1980 - | self
|
1981 - | }
|
1982 - | /// <p>The reason for the exception.</p>
|
1983 - | pub fn reason(mut self, input: crate::model::AccessDeniedExceptionReason) -> Self {
|
1984 - | self.reason = Some(input);
|
1994 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1995 + | self.message = Some(input);
|
1985 1996 | self
|
1986 1997 | }
|
1987 - | /// Consumes the builder and constructs a [`AccessDeniedException`](crate::error::AccessDeniedException).
|
1998 + | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
1988 1999 | ///
|
1989 - | /// The builder fails to construct a [`AccessDeniedException`](crate::error::AccessDeniedException) if you do not provide a value for all non-`Option`al members.
|
2000 + | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
1990 2001 | ///
|
1991 - | pub fn build(self) -> Result<crate::error::AccessDeniedException, ConstraintViolation> {
|
2002 + | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
1992 2003 | self.build_enforcing_required_and_enum_traits()
|
1993 2004 | }
|
1994 2005 | fn build_enforcing_required_and_enum_traits(
|
1995 2006 | self,
|
1996 - | ) -> Result<crate::error::AccessDeniedException, ConstraintViolation> {
|
1997 - | Ok(crate::error::AccessDeniedException {
|
1998 - | message: self.message,
|
1999 - | reason: self.reason.ok_or(ConstraintViolation::MissingReason)?,
|
2007 + | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
2008 + | Ok(crate::error::InternalServerError {
|
2009 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
2000 2010 | })
|
2001 2011 | }
|
2002 2012 | }
|
2003 2013 | }
|
2004 - | /// See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
2005 - | pub mod resource_not_found_exception {
|
2014 + | /// See [`ConflictException`](crate::error::ConflictException).
|
2015 + | pub mod conflict_exception {
|
2006 2016 |
|
2007 - | impl ::std::convert::From<Builder> for crate::error::ResourceNotFoundException {
|
2017 + | impl ::std::convert::From<Builder> for crate::error::ConflictException {
|
2008 2018 | fn from(builder: Builder) -> Self {
|
2009 2019 | builder.build()
|
2010 2020 | }
|
2011 2021 | }
|
2012 - | /// A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
2022 + | /// A builder for [`ConflictException`](crate::error::ConflictException).
|
2013 2023 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2014 2024 | pub struct Builder {
|
2015 2025 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
2016 - | pub(crate) reason: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
2017 2026 | }
|
2018 2027 | impl Builder {
|
2019 2028 | #[allow(missing_docs)] // documentation missing in model
|
2020 2029 | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2021 2030 | self.message = input;
|
2022 2031 | self
|
2023 2032 | }
|
2024 - | /// <p>The reason for the exception.</p>
|
2025 - | pub fn reason(
|
2026 - | mut self,
|
2027 - | input: ::std::option::Option<crate::model::ResourceNotFoundExceptionReason>,
|
2028 - | ) -> Self {
|
2029 - | self.reason = input;
|
2030 - | self
|
2031 - | }
|
2032 - | /// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
2033 - | pub fn build(self) -> crate::error::ResourceNotFoundException {
|
2033 + | /// Consumes the builder and constructs a [`ConflictException`](crate::error::ConflictException).
|
2034 + | pub fn build(self) -> crate::error::ConflictException {
|
2034 2035 | self.build_enforcing_required_and_enum_traits()
|
2035 2036 | }
|
2036 - | fn build_enforcing_required_and_enum_traits(
|
2037 - | self,
|
2038 - | ) -> crate::error::ResourceNotFoundException {
|
2039 - | crate::error::ResourceNotFoundException {
|
2037 + | fn build_enforcing_required_and_enum_traits(self) -> crate::error::ConflictException {
|
2038 + | crate::error::ConflictException {
|
2040 2039 | message: self.message,
|
2041 - | reason: self.reason,
|
2042 2040 | }
|
2043 2041 | }
|
2044 2042 | }
|
2045 2043 | }
|
2046 - | /// See [`InternalServerException`](crate::error::InternalServerException).
|
2047 - | pub mod internal_server_exception {
|
2044 + | /// See [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
2045 + | pub mod concurrent_limit_exceeded_exception {
|
2048 2046 |
|
2049 - | impl ::std::convert::From<Builder> for crate::error::InternalServerException {
|
2047 + | impl ::std::convert::From<Builder> for crate::error::ConcurrentLimitExceededException {
|
2050 2048 | fn from(builder: Builder) -> Self {
|
2051 2049 | builder.build()
|
2052 2050 | }
|
2053 2051 | }
|
2054 - | /// A builder for [`InternalServerException`](crate::error::InternalServerException).
|
2052 + | /// A builder for [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
2055 2053 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2056 2054 | pub struct Builder {
|
2057 2055 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
2058 2056 | }
|
2059 2057 | impl Builder {
|
2060 2058 | #[allow(missing_docs)] // documentation missing in model
|
2061 2059 | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2062 2060 | self.message = input;
|
2063 2061 | self
|
2064 2062 | }
|
2065 - | /// Consumes the builder and constructs a [`InternalServerException`](crate::error::InternalServerException).
|
2066 - | pub fn build(self) -> crate::error::InternalServerException {
|
2063 + | /// Consumes the builder and constructs a [`ConcurrentLimitExceededException`](crate::error::ConcurrentLimitExceededException).
|
2064 + | pub fn build(self) -> crate::error::ConcurrentLimitExceededException {
|
2067 2065 | self.build_enforcing_required_and_enum_traits()
|
2068 2066 | }
|
2069 - | fn build_enforcing_required_and_enum_traits(self) -> crate::error::InternalServerException {
|
2070 - | crate::error::InternalServerException {
|
2067 + | fn build_enforcing_required_and_enum_traits(
|
2068 + | self,
|
2069 + | ) -> crate::error::ConcurrentLimitExceededException {
|
2070 + | crate::error::ConcurrentLimitExceededException {
|
2071 2071 | message: self.message,
|
2072 2072 | }
|
2073 2073 | }
|
2074 2074 | }
|
2075 2075 | }
|