1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /// Error type for the `SensitiveValidation` operation.
|
3 + | /// Each variant represents an error that can occur for the `SensitiveValidation` operation.
|
4 + | #[derive(::std::fmt::Debug)]
|
5 + | pub enum SensitiveValidationError {
|
6 + | /// 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.
|
7 + | ValidationException(crate::error::ValidationException),
|
8 + | }
|
9 + | impl ::std::fmt::Display for SensitiveValidationError {
|
10 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11 + | match &self {
|
12 + | SensitiveValidationError::ValidationException(_inner) => _inner.fmt(f),
|
13 + | }
|
14 + | }
|
15 + | }
|
16 + | impl SensitiveValidationError {
|
17 + | /// Returns `true` if the error kind is `SensitiveValidationError::ValidationException`.
|
18 + | pub fn is_validation_exception(&self) -> bool {
|
19 + | matches!(&self, SensitiveValidationError::ValidationException(_))
|
20 + | }
|
21 + | /// Returns the error name string by matching the correct variant.
|
22 + | pub fn name(&self) -> &'static str {
|
23 + | match &self {
|
24 + | SensitiveValidationError::ValidationException(_inner) => _inner.name(),
|
25 + | }
|
26 + | }
|
27 + | }
|
28 + | impl ::std::error::Error for SensitiveValidationError {
|
29 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
30 + | match &self {
|
31 + | SensitiveValidationError::ValidationException(_inner) => Some(_inner),
|
32 + | }
|
33 + | }
|
34 + | }
|
35 + | impl ::std::convert::From<crate::error::ValidationException>
|
36 + | for crate::error::SensitiveValidationError
|
37 + | {
|
38 + | fn from(variant: crate::error::ValidationException) -> crate::error::SensitiveValidationError {
|
39 + | Self::ValidationException(variant)
|
40 + | }
|
41 + | }
|
42 + |
|
43 + | /// 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.
|
44 + | #[derive(
|
45 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
46 + | )]
|
47 + | pub struct ValidationException {
|
48 + | /// A summary of the validation failure.
|
49 + | pub message: ::std::string::String,
|
50 + | /// 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.
|
51 + | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
52 + | }
|
53 + | impl ValidationException {
|
54 + | /// 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.
|
55 + | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
56 + | self.field_list.as_deref()
|
57 + | }
|
58 + | }
|
59 + | impl ValidationException {
|
60 + | /// Returns the error message.
|
61 + | pub fn message(&self) -> &str {
|
62 + | &self.message
|
63 + | }
|
64 + | #[doc(hidden)]
|
65 + | /// Returns the error name.
|
66 + | pub fn name(&self) -> &'static str {
|
67 + | "ValidationException"
|
68 + | }
|
69 + | }
|
70 + | impl ::std::fmt::Display for ValidationException {
|
71 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
72 + | ::std::write!(f, "ValidationException")?;
|
73 + | {
|
74 + | ::std::write!(f, ": {}", &self.message)?;
|
75 + | }
|
76 + | Ok(())
|
77 + | }
|
78 + | }
|
79 + | impl ::std::error::Error for ValidationException {}
|
80 + | impl ValidationException {
|
81 + | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
82 + | pub fn builder() -> crate::error::validation_exception::Builder {
|
83 + | crate::error::validation_exception::Builder::default()
|
84 + | }
|
85 + | }
|
86 + |
|
87 + | /// Error type for the `RecursiveStructures` operation.
|
88 + | /// Each variant represents an error that can occur for the `RecursiveStructures` operation.
|
89 + | #[derive(::std::fmt::Debug)]
|
90 + | pub enum RecursiveStructuresError {
|
91 + | /// 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.
|
92 + | ValidationException(crate::error::ValidationException),
|
93 + | }
|
94 + | impl ::std::fmt::Display for RecursiveStructuresError {
|
95 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
96 + | match &self {
|
97 + | RecursiveStructuresError::ValidationException(_inner) => _inner.fmt(f),
|
98 + | }
|
99 + | }
|
100 + | }
|
101 + | impl RecursiveStructuresError {
|
102 + | /// Returns `true` if the error kind is `RecursiveStructuresError::ValidationException`.
|
103 + | pub fn is_validation_exception(&self) -> bool {
|
104 + | matches!(&self, RecursiveStructuresError::ValidationException(_))
|
105 + | }
|
106 + | /// Returns the error name string by matching the correct variant.
|
107 + | pub fn name(&self) -> &'static str {
|
108 + | match &self {
|
109 + | RecursiveStructuresError::ValidationException(_inner) => _inner.name(),
|
110 + | }
|
111 + | }
|
112 + | }
|
113 + | impl ::std::error::Error for RecursiveStructuresError {
|
114 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
115 + | match &self {
|
116 + | RecursiveStructuresError::ValidationException(_inner) => Some(_inner),
|
117 + | }
|
118 + | }
|
119 + | }
|
120 + | impl ::std::convert::From<crate::error::ValidationException>
|
121 + | for crate::error::RecursiveStructuresError
|
122 + | {
|
123 + | fn from(variant: crate::error::ValidationException) -> crate::error::RecursiveStructuresError {
|
124 + | Self::ValidationException(variant)
|
125 + | }
|
126 + | }
|
127 + |
|
128 + | /// Error type for the `MalformedUniqueItems` operation.
|
129 + | /// Each variant represents an error that can occur for the `MalformedUniqueItems` operation.
|
130 + | #[derive(::std::fmt::Debug)]
|
131 + | pub enum MalformedUniqueItemsError {
|
132 + | /// 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.
|
133 + | ValidationException(crate::error::ValidationException),
|
134 + | }
|
135 + | impl ::std::fmt::Display for MalformedUniqueItemsError {
|
136 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
137 + | match &self {
|
138 + | MalformedUniqueItemsError::ValidationException(_inner) => _inner.fmt(f),
|
139 + | }
|
140 + | }
|
141 + | }
|
142 + | impl MalformedUniqueItemsError {
|
143 + | /// Returns `true` if the error kind is `MalformedUniqueItemsError::ValidationException`.
|
144 + | pub fn is_validation_exception(&self) -> bool {
|
145 + | matches!(&self, MalformedUniqueItemsError::ValidationException(_))
|
146 + | }
|
147 + | /// Returns the error name string by matching the correct variant.
|
148 + | pub fn name(&self) -> &'static str {
|
149 + | match &self {
|
150 + | MalformedUniqueItemsError::ValidationException(_inner) => _inner.name(),
|
151 + | }
|
152 + | }
|
153 + | }
|
154 + | impl ::std::error::Error for MalformedUniqueItemsError {
|
155 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
156 + | match &self {
|
157 + | MalformedUniqueItemsError::ValidationException(_inner) => Some(_inner),
|
158 + | }
|
159 + | }
|
160 + | }
|
161 + | impl ::std::convert::From<crate::error::ValidationException>
|
162 + | for crate::error::MalformedUniqueItemsError
|
163 + | {
|
164 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedUniqueItemsError {
|
165 + | Self::ValidationException(variant)
|
166 + | }
|
167 + | }
|
168 + |
|
169 + | /// Error type for the `MalformedRequired` operation.
|
170 + | /// Each variant represents an error that can occur for the `MalformedRequired` operation.
|
171 + | #[derive(::std::fmt::Debug)]
|
172 + | pub enum MalformedRequiredError {
|
173 + | /// 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.
|
174 + | ValidationException(crate::error::ValidationException),
|
175 + | }
|
176 + | impl ::std::fmt::Display for MalformedRequiredError {
|
177 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
178 + | match &self {
|
179 + | MalformedRequiredError::ValidationException(_inner) => _inner.fmt(f),
|
180 + | }
|
181 + | }
|
182 + | }
|
183 + | impl MalformedRequiredError {
|
184 + | /// Returns `true` if the error kind is `MalformedRequiredError::ValidationException`.
|
185 + | pub fn is_validation_exception(&self) -> bool {
|
186 + | matches!(&self, MalformedRequiredError::ValidationException(_))
|
187 + | }
|
188 + | /// Returns the error name string by matching the correct variant.
|
189 + | pub fn name(&self) -> &'static str {
|
190 + | match &self {
|
191 + | MalformedRequiredError::ValidationException(_inner) => _inner.name(),
|
192 + | }
|
193 + | }
|
194 + | }
|
195 + | impl ::std::error::Error for MalformedRequiredError {
|
196 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
197 + | match &self {
|
198 + | MalformedRequiredError::ValidationException(_inner) => Some(_inner),
|
199 + | }
|
200 + | }
|
201 + | }
|
202 + | impl ::std::convert::From<crate::error::ValidationException>
|
203 + | for crate::error::MalformedRequiredError
|
204 + | {
|
205 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedRequiredError {
|
206 + | Self::ValidationException(variant)
|
207 + | }
|
208 + | }
|
209 + |
|
210 + | /// Error type for the `MalformedRangeOverride` operation.
|
211 + | /// Each variant represents an error that can occur for the `MalformedRangeOverride` operation.
|
212 + | #[derive(::std::fmt::Debug)]
|
213 + | pub enum MalformedRangeOverrideError {
|
214 + | /// 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.
|
215 + | ValidationException(crate::error::ValidationException),
|
216 + | }
|
217 + | impl ::std::fmt::Display for MalformedRangeOverrideError {
|
218 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
219 + | match &self {
|
220 + | MalformedRangeOverrideError::ValidationException(_inner) => _inner.fmt(f),
|
221 + | }
|
222 + | }
|
223 + | }
|
224 + | impl MalformedRangeOverrideError {
|
225 + | /// Returns `true` if the error kind is `MalformedRangeOverrideError::ValidationException`.
|
226 + | pub fn is_validation_exception(&self) -> bool {
|
227 + | matches!(&self, MalformedRangeOverrideError::ValidationException(_))
|
228 + | }
|
229 + | /// Returns the error name string by matching the correct variant.
|
230 + | pub fn name(&self) -> &'static str {
|
231 + | match &self {
|
232 + | MalformedRangeOverrideError::ValidationException(_inner) => _inner.name(),
|
233 + | }
|
234 + | }
|
235 + | }
|
236 + | impl ::std::error::Error for MalformedRangeOverrideError {
|
237 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
238 + | match &self {
|
239 + | MalformedRangeOverrideError::ValidationException(_inner) => Some(_inner),
|
240 + | }
|
241 + | }
|
242 + | }
|
243 + | impl ::std::convert::From<crate::error::ValidationException>
|
244 + | for crate::error::MalformedRangeOverrideError
|
245 + | {
|
246 + | fn from(
|
247 + | variant: crate::error::ValidationException,
|
248 + | ) -> crate::error::MalformedRangeOverrideError {
|
249 + | Self::ValidationException(variant)
|
250 + | }
|
251 + | }
|
252 + |
|
253 + | /// Error type for the `MalformedRange` operation.
|
254 + | /// Each variant represents an error that can occur for the `MalformedRange` operation.
|
255 + | #[derive(::std::fmt::Debug)]
|
256 + | pub enum MalformedRangeError {
|
257 + | /// 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.
|
258 + | ValidationException(crate::error::ValidationException),
|
259 + | }
|
260 + | impl ::std::fmt::Display for MalformedRangeError {
|
261 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
262 + | match &self {
|
263 + | MalformedRangeError::ValidationException(_inner) => _inner.fmt(f),
|
264 + | }
|
265 + | }
|
266 + | }
|
267 + | impl MalformedRangeError {
|
268 + | /// Returns `true` if the error kind is `MalformedRangeError::ValidationException`.
|
269 + | pub fn is_validation_exception(&self) -> bool {
|
270 + | matches!(&self, MalformedRangeError::ValidationException(_))
|
271 + | }
|
272 + | /// Returns the error name string by matching the correct variant.
|
273 + | pub fn name(&self) -> &'static str {
|
274 + | match &self {
|
275 + | MalformedRangeError::ValidationException(_inner) => _inner.name(),
|
276 + | }
|
277 + | }
|
278 + | }
|
279 + | impl ::std::error::Error for MalformedRangeError {
|
280 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
281 + | match &self {
|
282 + | MalformedRangeError::ValidationException(_inner) => Some(_inner),
|
283 + | }
|
284 + | }
|
285 + | }
|
286 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::MalformedRangeError {
|
287 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedRangeError {
|
288 + | Self::ValidationException(variant)
|
289 + | }
|
290 + | }
|
291 + |
|
292 + | /// Error type for the `MalformedPatternOverride` operation.
|
293 + | /// Each variant represents an error that can occur for the `MalformedPatternOverride` operation.
|
294 + | #[derive(::std::fmt::Debug)]
|
295 + | pub enum MalformedPatternOverrideError {
|
296 + | /// 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.
|
297 + | ValidationException(crate::error::ValidationException),
|
298 + | }
|
299 + | impl ::std::fmt::Display for MalformedPatternOverrideError {
|
300 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
301 + | match &self {
|
302 + | MalformedPatternOverrideError::ValidationException(_inner) => _inner.fmt(f),
|
303 + | }
|
304 + | }
|
305 + | }
|
306 + | impl MalformedPatternOverrideError {
|
307 + | /// Returns `true` if the error kind is `MalformedPatternOverrideError::ValidationException`.
|
308 + | pub fn is_validation_exception(&self) -> bool {
|
309 + | matches!(&self, MalformedPatternOverrideError::ValidationException(_))
|
310 + | }
|
311 + | /// Returns the error name string by matching the correct variant.
|
312 + | pub fn name(&self) -> &'static str {
|
313 + | match &self {
|
314 + | MalformedPatternOverrideError::ValidationException(_inner) => _inner.name(),
|
315 + | }
|
316 + | }
|
317 + | }
|
318 + | impl ::std::error::Error for MalformedPatternOverrideError {
|
319 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
320 + | match &self {
|
321 + | MalformedPatternOverrideError::ValidationException(_inner) => Some(_inner),
|
322 + | }
|
323 + | }
|
324 + | }
|
325 + | impl ::std::convert::From<crate::error::ValidationException>
|
326 + | for crate::error::MalformedPatternOverrideError
|
327 + | {
|
328 + | fn from(
|
329 + | variant: crate::error::ValidationException,
|
330 + | ) -> crate::error::MalformedPatternOverrideError {
|
331 + | Self::ValidationException(variant)
|
332 + | }
|
333 + | }
|
334 + |
|
335 + | /// Error type for the `MalformedPattern` operation.
|
336 + | /// Each variant represents an error that can occur for the `MalformedPattern` operation.
|
337 + | #[derive(::std::fmt::Debug)]
|
338 + | pub enum MalformedPatternError {
|
339 + | /// 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.
|
340 + | ValidationException(crate::error::ValidationException),
|
341 + | }
|
342 + | impl ::std::fmt::Display for MalformedPatternError {
|
343 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
344 + | match &self {
|
345 + | MalformedPatternError::ValidationException(_inner) => _inner.fmt(f),
|
346 + | }
|
347 + | }
|
348 + | }
|
349 + | impl MalformedPatternError {
|
350 + | /// Returns `true` if the error kind is `MalformedPatternError::ValidationException`.
|
351 + | pub fn is_validation_exception(&self) -> bool {
|
352 + | matches!(&self, MalformedPatternError::ValidationException(_))
|
353 + | }
|
354 + | /// Returns the error name string by matching the correct variant.
|
355 + | pub fn name(&self) -> &'static str {
|
356 + | match &self {
|
357 + | MalformedPatternError::ValidationException(_inner) => _inner.name(),
|
358 + | }
|
359 + | }
|
360 + | }
|
361 + | impl ::std::error::Error for MalformedPatternError {
|
362 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
363 + | match &self {
|
364 + | MalformedPatternError::ValidationException(_inner) => Some(_inner),
|
365 + | }
|
366 + | }
|
367 + | }
|
368 + | impl ::std::convert::From<crate::error::ValidationException>
|
369 + | for crate::error::MalformedPatternError
|
370 + | {
|
371 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedPatternError {
|
372 + | Self::ValidationException(variant)
|
373 + | }
|
374 + | }
|
375 + |
|
376 + | /// Error type for the `MalformedLengthQueryString` operation.
|
377 + | /// Each variant represents an error that can occur for the `MalformedLengthQueryString` operation.
|
378 + | #[derive(::std::fmt::Debug)]
|
379 + | pub enum MalformedLengthQueryStringError {
|
380 + | /// 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.
|
381 + | ValidationException(crate::error::ValidationException),
|
382 + | }
|
383 + | impl ::std::fmt::Display for MalformedLengthQueryStringError {
|
384 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
385 + | match &self {
|
386 + | MalformedLengthQueryStringError::ValidationException(_inner) => _inner.fmt(f),
|
387 + | }
|
388 + | }
|
389 + | }
|
390 + | impl MalformedLengthQueryStringError {
|
391 + | /// Returns `true` if the error kind is `MalformedLengthQueryStringError::ValidationException`.
|
392 + | pub fn is_validation_exception(&self) -> bool {
|
393 + | matches!(
|
394 + | &self,
|
395 + | MalformedLengthQueryStringError::ValidationException(_)
|
396 + | )
|
397 + | }
|
398 + | /// Returns the error name string by matching the correct variant.
|
399 + | pub fn name(&self) -> &'static str {
|
400 + | match &self {
|
401 + | MalformedLengthQueryStringError::ValidationException(_inner) => _inner.name(),
|
402 + | }
|
403 + | }
|
404 + | }
|
405 + | impl ::std::error::Error for MalformedLengthQueryStringError {
|
406 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
407 + | match &self {
|
408 + | MalformedLengthQueryStringError::ValidationException(_inner) => Some(_inner),
|
409 + | }
|
410 + | }
|
411 + | }
|
412 + | impl ::std::convert::From<crate::error::ValidationException>
|
413 + | for crate::error::MalformedLengthQueryStringError
|
414 + | {
|
415 + | fn from(
|
416 + | variant: crate::error::ValidationException,
|
417 + | ) -> crate::error::MalformedLengthQueryStringError {
|
418 + | Self::ValidationException(variant)
|
419 + | }
|
420 + | }
|
421 + |
|
422 + | /// Error type for the `MalformedLengthOverride` operation.
|
423 + | /// Each variant represents an error that can occur for the `MalformedLengthOverride` operation.
|
424 + | #[derive(::std::fmt::Debug)]
|
425 + | pub enum MalformedLengthOverrideError {
|
426 + | /// 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.
|
427 + | ValidationException(crate::error::ValidationException),
|
428 + | }
|
429 + | impl ::std::fmt::Display for MalformedLengthOverrideError {
|
430 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
431 + | match &self {
|
432 + | MalformedLengthOverrideError::ValidationException(_inner) => _inner.fmt(f),
|
433 + | }
|
434 + | }
|
435 + | }
|
436 + | impl MalformedLengthOverrideError {
|
437 + | /// Returns `true` if the error kind is `MalformedLengthOverrideError::ValidationException`.
|
438 + | pub fn is_validation_exception(&self) -> bool {
|
439 + | matches!(&self, MalformedLengthOverrideError::ValidationException(_))
|
440 + | }
|
441 + | /// Returns the error name string by matching the correct variant.
|
442 + | pub fn name(&self) -> &'static str {
|
443 + | match &self {
|
444 + | MalformedLengthOverrideError::ValidationException(_inner) => _inner.name(),
|
445 + | }
|
446 + | }
|
447 + | }
|
448 + | impl ::std::error::Error for MalformedLengthOverrideError {
|
449 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
450 + | match &self {
|
451 + | MalformedLengthOverrideError::ValidationException(_inner) => Some(_inner),
|
452 + | }
|
453 + | }
|
454 + | }
|
455 + | impl ::std::convert::From<crate::error::ValidationException>
|
456 + | for crate::error::MalformedLengthOverrideError
|
457 + | {
|
458 + | fn from(
|
459 + | variant: crate::error::ValidationException,
|
460 + | ) -> crate::error::MalformedLengthOverrideError {
|
461 + | Self::ValidationException(variant)
|
462 + | }
|
463 + | }
|
464 + |
|
465 + | /// Error type for the `MalformedLength` operation.
|
466 + | /// Each variant represents an error that can occur for the `MalformedLength` operation.
|
467 + | #[derive(::std::fmt::Debug)]
|
468 + | pub enum MalformedLengthError {
|
469 + | /// 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.
|
470 + | ValidationException(crate::error::ValidationException),
|
471 + | }
|
472 + | impl ::std::fmt::Display for MalformedLengthError {
|
473 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
474 + | match &self {
|
475 + | MalformedLengthError::ValidationException(_inner) => _inner.fmt(f),
|
476 + | }
|
477 + | }
|
478 + | }
|
479 + | impl MalformedLengthError {
|
480 + | /// Returns `true` if the error kind is `MalformedLengthError::ValidationException`.
|
481 + | pub fn is_validation_exception(&self) -> bool {
|
482 + | matches!(&self, MalformedLengthError::ValidationException(_))
|
483 + | }
|
484 + | /// Returns the error name string by matching the correct variant.
|
485 + | pub fn name(&self) -> &'static str {
|
486 + | match &self {
|
487 + | MalformedLengthError::ValidationException(_inner) => _inner.name(),
|
488 + | }
|
489 + | }
|
490 + | }
|
491 + | impl ::std::error::Error for MalformedLengthError {
|
492 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
493 + | match &self {
|
494 + | MalformedLengthError::ValidationException(_inner) => Some(_inner),
|
495 + | }
|
496 + | }
|
497 + | }
|
498 + | impl ::std::convert::From<crate::error::ValidationException>
|
499 + | for crate::error::MalformedLengthError
|
500 + | {
|
501 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedLengthError {
|
502 + | Self::ValidationException(variant)
|
503 + | }
|
504 + | }
|
505 + |
|
506 + | /// Error type for the `MalformedEnum` operation.
|
507 + | /// Each variant represents an error that can occur for the `MalformedEnum` operation.
|
508 + | #[derive(::std::fmt::Debug)]
|
509 + | pub enum MalformedEnumError {
|
510 + | /// 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.
|
511 + | ValidationException(crate::error::ValidationException),
|
512 + | }
|
513 + | impl ::std::fmt::Display for MalformedEnumError {
|
514 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
515 + | match &self {
|
516 + | MalformedEnumError::ValidationException(_inner) => _inner.fmt(f),
|
517 + | }
|
518 + | }
|
519 + | }
|
520 + | impl MalformedEnumError {
|
521 + | /// Returns `true` if the error kind is `MalformedEnumError::ValidationException`.
|
522 + | pub fn is_validation_exception(&self) -> bool {
|
523 + | matches!(&self, MalformedEnumError::ValidationException(_))
|
524 + | }
|
525 + | /// Returns the error name string by matching the correct variant.
|
526 + | pub fn name(&self) -> &'static str {
|
527 + | match &self {
|
528 + | MalformedEnumError::ValidationException(_inner) => _inner.name(),
|
529 + | }
|
530 + | }
|
531 + | }
|
532 + | impl ::std::error::Error for MalformedEnumError {
|
533 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
534 + | match &self {
|
535 + | MalformedEnumError::ValidationException(_inner) => Some(_inner),
|
536 + | }
|
537 + | }
|
538 + | }
|
539 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::MalformedEnumError {
|
540 + | fn from(variant: crate::error::ValidationException) -> crate::error::MalformedEnumError {
|
541 + | Self::ValidationException(variant)
|
542 + | }
|
543 + | }
|
544 + | /// See [`ValidationException`](crate::error::ValidationException).
|
545 + | pub mod validation_exception {
|
546 + |
|
547 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
548 + | /// Holds one variant for each of the ways the builder can fail.
|
549 + | #[non_exhaustive]
|
550 + | #[allow(clippy::enum_variant_names)]
|
551 + | pub enum ConstraintViolation {
|
552 + | /// `message` was not provided but it is required when building `ValidationException`.
|
553 + | MissingMessage,
|
554 + | }
|
555 + | impl ::std::fmt::Display for ConstraintViolation {
|
556 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
557 + | match self {
|
558 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
559 + | }
|
560 + | }
|
561 + | }
|
562 + | impl ::std::error::Error for ConstraintViolation {}
|
563 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
564 + | type Error = ConstraintViolation;
|
565 + |
|
566 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
567 + | builder.build()
|
568 + | }
|
569 + | }
|
570 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
571 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
572 + | pub struct Builder {
|
573 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
574 + | pub(crate) field_list:
|
575 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
576 + | }
|
577 + | impl Builder {
|
578 + | /// A summary of the validation failure.
|
579 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
580 + | self.message = Some(input);
|
581 + | self
|
582 + | }
|
583 + | /// 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.
|
584 + | pub fn field_list(
|
585 + | mut self,
|
586 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
587 + | ) -> Self {
|
588 + | self.field_list = input;
|
589 + | self
|
590 + | }
|
591 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
592 + | ///
|
593 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
|
594 + | ///
|
595 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
596 + | self.build_enforcing_all_constraints()
|
597 + | }
|
598 + | fn build_enforcing_all_constraints(
|
599 + | self,
|
600 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
601 + | Ok(crate::error::ValidationException {
|
602 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
603 + | field_list: self.field_list,
|
604 + | })
|
605 + | }
|
606 + | }
|
607 + | }
|