1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Error type for the `EndpointWithHostLabelOperation` operation.
|
4 + | /// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
|
5 + | #[derive(::std::fmt::Debug)]
|
6 + | pub enum EndpointWithHostLabelOperationError {
|
7 + | /// 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.
|
8 + | ValidationException(crate::error::ValidationException),
|
9 + | }
|
10 + | impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
|
11 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
12 + | match &self {
|
13 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
|
14 + | }
|
15 + | }
|
16 + | }
|
17 + | impl EndpointWithHostLabelOperationError {
|
18 + | /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
|
19 + | pub fn is_validation_exception(&self) -> bool {
|
20 + | matches!(
|
21 + | &self,
|
22 + | EndpointWithHostLabelOperationError::ValidationException(_)
|
23 + | )
|
24 + | }
|
25 + | /// Returns the error name string by matching the correct variant.
|
26 + | pub fn name(&self) -> &'static str {
|
27 + | match &self {
|
28 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
|
29 + | }
|
30 + | }
|
31 + | }
|
32 + | impl ::std::error::Error for EndpointWithHostLabelOperationError {
|
33 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
34 + | match &self {
|
35 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
|
36 + | }
|
37 + | }
|
38 + | }
|
39 + | impl ::std::convert::From<crate::error::ValidationException>
|
40 + | for crate::error::EndpointWithHostLabelOperationError
|
41 + | {
|
42 + | fn from(
|
43 + | variant: crate::error::ValidationException,
|
44 + | ) -> crate::error::EndpointWithHostLabelOperationError {
|
45 + | Self::ValidationException(variant)
|
46 + | }
|
47 + | }
|
48 + |
|
49 + | /// 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.
|
50 + | #[derive(
|
51 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
52 + | )]
|
53 + | pub struct ValidationException {
|
54 + | /// A summary of the validation failure.
|
55 + | pub message: ::std::string::String,
|
56 + | /// 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.
|
57 + | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
58 + | }
|
59 + | impl ValidationException {
|
60 + | /// 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.
|
61 + | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
62 + | self.field_list.as_deref()
|
63 + | }
|
64 + | }
|
65 + | impl ValidationException {
|
66 + | /// Returns the error message.
|
67 + | pub fn message(&self) -> &str {
|
68 + | &self.message
|
69 + | }
|
70 + | #[doc(hidden)]
|
71 + | /// Returns the error name.
|
72 + | pub fn name(&self) -> &'static str {
|
73 + | "ValidationException"
|
74 + | }
|
75 + | }
|
76 + | impl ::std::fmt::Display for ValidationException {
|
77 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
78 + | ::std::write!(f, "ValidationException")?;
|
79 + | {
|
80 + | ::std::write!(f, ": {}", &self.message)?;
|
81 + | }
|
82 + | Ok(())
|
83 + | }
|
84 + | }
|
85 + | impl ::std::error::Error for ValidationException {}
|
86 + | impl ValidationException {
|
87 + | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
88 + | pub fn builder() -> crate::error::validation_exception::Builder {
|
89 + | crate::error::validation_exception::Builder::default()
|
90 + | }
|
91 + | }
|
92 + |
|
93 + | /// Error type for the `JsonUnions` operation.
|
94 + | /// Each variant represents an error that can occur for the `JsonUnions` operation.
|
95 + | #[derive(::std::fmt::Debug)]
|
96 + | pub enum JsonUnionsError {
|
97 + | /// 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.
|
98 + | ValidationException(crate::error::ValidationException),
|
99 + | }
|
100 + | impl ::std::fmt::Display for JsonUnionsError {
|
101 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
102 + | match &self {
|
103 + | JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
|
104 + | }
|
105 + | }
|
106 + | }
|
107 + | impl JsonUnionsError {
|
108 + | /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
|
109 + | pub fn is_validation_exception(&self) -> bool {
|
110 + | matches!(&self, JsonUnionsError::ValidationException(_))
|
111 + | }
|
112 + | /// Returns the error name string by matching the correct variant.
|
113 + | pub fn name(&self) -> &'static str {
|
114 + | match &self {
|
115 + | JsonUnionsError::ValidationException(_inner) => _inner.name(),
|
116 + | }
|
117 + | }
|
118 + | }
|
119 + | impl ::std::error::Error for JsonUnionsError {
|
120 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
121 + | match &self {
|
122 + | JsonUnionsError::ValidationException(_inner) => Some(_inner),
|
123 + | }
|
124 + | }
|
125 + | }
|
126 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
|
127 + | fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
|
128 + | Self::ValidationException(variant)
|
129 + | }
|
130 + | }
|
131 + |
|
132 + | /// Error type for the `GreetingWithErrors` operation.
|
133 + | /// Each variant represents an error that can occur for the `GreetingWithErrors` operation.
|
134 + | #[derive(::std::fmt::Debug)]
|
135 + | pub enum GreetingWithErrorsError {
|
136 + | /// This error is thrown when an invalid greeting value is provided.
|
137 + | InvalidGreeting(crate::error::InvalidGreeting),
|
138 + | /// This error is thrown when a request is invalid.
|
139 + | ComplexError(crate::error::ComplexError),
|
140 + | /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
|
141 + | FooError(crate::error::FooError),
|
142 + | }
|
143 + | impl ::std::fmt::Display for GreetingWithErrorsError {
|
144 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
145 + | match &self {
|
146 + | GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.fmt(f),
|
147 + | GreetingWithErrorsError::ComplexError(_inner) => _inner.fmt(f),
|
148 + | GreetingWithErrorsError::FooError(_inner) => _inner.fmt(f),
|
149 + | }
|
150 + | }
|
151 + | }
|
152 + | impl GreetingWithErrorsError {
|
153 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
|
154 + | pub fn is_invalid_greeting(&self) -> bool {
|
155 + | matches!(&self, GreetingWithErrorsError::InvalidGreeting(_))
|
156 + | }
|
157 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
|
158 + | pub fn is_complex_error(&self) -> bool {
|
159 + | matches!(&self, GreetingWithErrorsError::ComplexError(_))
|
160 + | }
|
161 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
|
162 + | pub fn is_foo_error(&self) -> bool {
|
163 + | matches!(&self, GreetingWithErrorsError::FooError(_))
|
164 + | }
|
165 + | /// Returns the error name string by matching the correct variant.
|
166 + | pub fn name(&self) -> &'static str {
|
167 + | match &self {
|
168 + | GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.name(),
|
169 + | GreetingWithErrorsError::ComplexError(_inner) => _inner.name(),
|
170 + | GreetingWithErrorsError::FooError(_inner) => _inner.name(),
|
171 + | }
|
172 + | }
|
173 + | }
|
174 + | impl ::std::error::Error for GreetingWithErrorsError {
|
175 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
176 + | match &self {
|
177 + | GreetingWithErrorsError::InvalidGreeting(_inner) => Some(_inner),
|
178 + | GreetingWithErrorsError::ComplexError(_inner) => Some(_inner),
|
179 + | GreetingWithErrorsError::FooError(_inner) => Some(_inner),
|
180 + | }
|
181 + | }
|
182 + | }
|
183 + | impl ::std::convert::From<crate::error::InvalidGreeting> for crate::error::GreetingWithErrorsError {
|
184 + | fn from(variant: crate::error::InvalidGreeting) -> crate::error::GreetingWithErrorsError {
|
185 + | Self::InvalidGreeting(variant)
|
186 + | }
|
187 + | }
|
188 + | impl ::std::convert::From<crate::error::ComplexError> for crate::error::GreetingWithErrorsError {
|
189 + | fn from(variant: crate::error::ComplexError) -> crate::error::GreetingWithErrorsError {
|
190 + | Self::ComplexError(variant)
|
191 + | }
|
192 + | }
|
193 + | impl ::std::convert::From<crate::error::FooError> for crate::error::GreetingWithErrorsError {
|
194 + | fn from(variant: crate::error::FooError) -> crate::error::GreetingWithErrorsError {
|
195 + | Self::FooError(variant)
|
196 + | }
|
197 + | }
|
198 + |
|
199 + | /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
|
200 + | #[derive(
|
201 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
202 + | )]
|
203 + | pub struct FooError {}
|
204 + | impl FooError {
|
205 + | #[doc(hidden)]
|
206 + | /// Returns the error name.
|
207 + | pub fn name(&self) -> &'static str {
|
208 + | "FooError"
|
209 + | }
|
210 + | }
|
211 + | impl ::std::fmt::Display for FooError {
|
212 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
213 + | ::std::write!(f, "FooError")?;
|
214 + | Ok(())
|
215 + | }
|
216 + | }
|
217 + | impl ::std::error::Error for FooError {}
|
218 + | impl FooError {
|
219 + | /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
|
220 + | pub fn builder() -> crate::error::foo_error::Builder {
|
221 + | crate::error::foo_error::Builder::default()
|
222 + | }
|
223 + | }
|
224 + |
|
225 + | /// This error is thrown when a request is invalid.
|
226 + | #[derive(
|
227 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
228 + | )]
|
229 + | pub struct ComplexError {
|
230 + | #[allow(missing_docs)] // documentation missing in model
|
231 + | pub top_level: ::std::option::Option<::std::string::String>,
|
232 + | #[allow(missing_docs)] // documentation missing in model
|
233 + | pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
234 + | }
|
235 + | impl ComplexError {
|
236 + | #[allow(missing_docs)] // documentation missing in model
|
237 + | pub fn top_level(&self) -> ::std::option::Option<&str> {
|
238 + | self.top_level.as_deref()
|
239 + | }
|
240 + | #[allow(missing_docs)] // documentation missing in model
|
241 + | pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
|
242 + | self.nested.as_ref()
|
243 + | }
|
244 + | }
|
245 + | impl ComplexError {
|
246 + | #[doc(hidden)]
|
247 + | /// Returns the error name.
|
248 + | pub fn name(&self) -> &'static str {
|
249 + | "ComplexError"
|
250 + | }
|
251 + | }
|
252 + | impl ::std::fmt::Display for ComplexError {
|
253 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
254 + | ::std::write!(f, "ComplexError")?;
|
255 + | Ok(())
|
256 + | }
|
257 + | }
|
258 + | impl ::std::error::Error for ComplexError {}
|
259 + | impl ComplexError {
|
260 + | /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
|
261 + | pub fn builder() -> crate::error::complex_error::Builder {
|
262 + | crate::error::complex_error::Builder::default()
|
263 + | }
|
264 + | }
|
265 + |
|
266 + | /// This error is thrown when an invalid greeting value is provided.
|
267 + | #[derive(
|
268 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
269 + | )]
|
270 + | pub struct InvalidGreeting {
|
271 + | #[allow(missing_docs)] // documentation missing in model
|
272 + | pub message: ::std::option::Option<::std::string::String>,
|
273 + | }
|
274 + | impl InvalidGreeting {
|
275 + | /// Returns the error message.
|
276 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
277 + | self.message.as_deref()
|
278 + | }
|
279 + | #[doc(hidden)]
|
280 + | /// Returns the error name.
|
281 + | pub fn name(&self) -> &'static str {
|
282 + | "InvalidGreeting"
|
283 + | }
|
284 + | }
|
285 + | impl ::std::fmt::Display for InvalidGreeting {
|
286 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
287 + | ::std::write!(f, "InvalidGreeting")?;
|
288 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
289 + | {
|
290 + | ::std::write!(f, ": {inner_1}")?;
|
291 + | }
|
292 + | }
|
293 + | Ok(())
|
294 + | }
|
295 + | }
|
296 + | impl ::std::error::Error for InvalidGreeting {}
|
297 + | impl InvalidGreeting {
|
298 + | /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
|
299 + | pub fn builder() -> crate::error::invalid_greeting::Builder {
|
300 + | crate::error::invalid_greeting::Builder::default()
|
301 + | }
|
302 + | }
|
303 + |
|
304 + | /// Error type for the `JsonIntEnums` operation.
|
305 + | /// Each variant represents an error that can occur for the `JsonIntEnums` operation.
|
306 + | #[derive(::std::fmt::Debug)]
|
307 + | pub enum JsonIntEnumsError {
|
308 + | /// 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.
|
309 + | ValidationException(crate::error::ValidationException),
|
310 + | }
|
311 + | impl ::std::fmt::Display for JsonIntEnumsError {
|
312 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
313 + | match &self {
|
314 + | JsonIntEnumsError::ValidationException(_inner) => _inner.fmt(f),
|
315 + | }
|
316 + | }
|
317 + | }
|
318 + | impl JsonIntEnumsError {
|
319 + | /// Returns `true` if the error kind is `JsonIntEnumsError::ValidationException`.
|
320 + | pub fn is_validation_exception(&self) -> bool {
|
321 + | matches!(&self, JsonIntEnumsError::ValidationException(_))
|
322 + | }
|
323 + | /// Returns the error name string by matching the correct variant.
|
324 + | pub fn name(&self) -> &'static str {
|
325 + | match &self {
|
326 + | JsonIntEnumsError::ValidationException(_inner) => _inner.name(),
|
327 + | }
|
328 + | }
|
329 + | }
|
330 + | impl ::std::error::Error for JsonIntEnumsError {
|
331 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
332 + | match &self {
|
333 + | JsonIntEnumsError::ValidationException(_inner) => Some(_inner),
|
334 + | }
|
335 + | }
|
336 + | }
|
337 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonIntEnumsError {
|
338 + | fn from(variant: crate::error::ValidationException) -> crate::error::JsonIntEnumsError {
|
339 + | Self::ValidationException(variant)
|
340 + | }
|
341 + | }
|
342 + |
|
343 + | /// Error type for the `JsonEnums` operation.
|
344 + | /// Each variant represents an error that can occur for the `JsonEnums` operation.
|
345 + | #[derive(::std::fmt::Debug)]
|
346 + | pub enum JsonEnumsError {
|
347 + | /// 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.
|
348 + | ValidationException(crate::error::ValidationException),
|
349 + | }
|
350 + | impl ::std::fmt::Display for JsonEnumsError {
|
351 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
352 + | match &self {
|
353 + | JsonEnumsError::ValidationException(_inner) => _inner.fmt(f),
|
354 + | }
|
355 + | }
|
356 + | }
|
357 + | impl JsonEnumsError {
|
358 + | /// Returns `true` if the error kind is `JsonEnumsError::ValidationException`.
|
359 + | pub fn is_validation_exception(&self) -> bool {
|
360 + | matches!(&self, JsonEnumsError::ValidationException(_))
|
361 + | }
|
362 + | /// Returns the error name string by matching the correct variant.
|
363 + | pub fn name(&self) -> &'static str {
|
364 + | match &self {
|
365 + | JsonEnumsError::ValidationException(_inner) => _inner.name(),
|
366 + | }
|
367 + | }
|
368 + | }
|
369 + | impl ::std::error::Error for JsonEnumsError {
|
370 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
371 + | match &self {
|
372 + | JsonEnumsError::ValidationException(_inner) => Some(_inner),
|
373 + | }
|
374 + | }
|
375 + | }
|
376 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonEnumsError {
|
377 + | fn from(variant: crate::error::ValidationException) -> crate::error::JsonEnumsError {
|
378 + | Self::ValidationException(variant)
|
379 + | }
|
380 + | }
|
381 + |
|
382 + | /// Error type for the `KitchenSinkOperation` operation.
|
383 + | /// Each variant represents an error that can occur for the `KitchenSinkOperation` operation.
|
384 + | #[derive(::std::fmt::Debug)]
|
385 + | pub enum KitchenSinkOperationError {
|
386 + | #[allow(missing_docs)] // documentation missing in model
|
387 + | ErrorWithMembers(crate::error::ErrorWithMembers),
|
388 + | #[allow(missing_docs)] // documentation missing in model
|
389 + | ErrorWithoutMembers(crate::error::ErrorWithoutMembers),
|
390 + | }
|
391 + | impl ::std::fmt::Display for KitchenSinkOperationError {
|
392 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
393 + | match &self {
|
394 + | KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.fmt(f),
|
395 + | KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.fmt(f),
|
396 + | }
|
397 + | }
|
398 + | }
|
399 + | impl KitchenSinkOperationError {
|
400 + | /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithMembers`.
|
401 + | pub fn is_error_with_members(&self) -> bool {
|
402 + | matches!(&self, KitchenSinkOperationError::ErrorWithMembers(_))
|
403 + | }
|
404 + | /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithoutMembers`.
|
405 + | pub fn is_error_without_members(&self) -> bool {
|
406 + | matches!(&self, KitchenSinkOperationError::ErrorWithoutMembers(_))
|
407 + | }
|
408 + | /// Returns the error name string by matching the correct variant.
|
409 + | pub fn name(&self) -> &'static str {
|
410 + | match &self {
|
411 + | KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.name(),
|
412 + | KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.name(),
|
413 + | }
|
414 + | }
|
415 + | }
|
416 + | impl ::std::error::Error for KitchenSinkOperationError {
|
417 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
418 + | match &self {
|
419 + | KitchenSinkOperationError::ErrorWithMembers(_inner) => Some(_inner),
|
420 + | KitchenSinkOperationError::ErrorWithoutMembers(_inner) => Some(_inner),
|
421 + | }
|
422 + | }
|
423 + | }
|
424 + | impl ::std::convert::From<crate::error::ErrorWithMembers>
|
425 + | for crate::error::KitchenSinkOperationError
|
426 + | {
|
427 + | fn from(variant: crate::error::ErrorWithMembers) -> crate::error::KitchenSinkOperationError {
|
428 + | Self::ErrorWithMembers(variant)
|
429 + | }
|
430 + | }
|
431 + | impl ::std::convert::From<crate::error::ErrorWithoutMembers>
|
432 + | for crate::error::KitchenSinkOperationError
|
433 + | {
|
434 + | fn from(variant: crate::error::ErrorWithoutMembers) -> crate::error::KitchenSinkOperationError {
|
435 + | Self::ErrorWithoutMembers(variant)
|
436 + | }
|
437 + | }
|
438 + |
|
439 + | #[allow(missing_docs)] // documentation missing in model
|
440 + | #[derive(
|
441 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
442 + | )]
|
443 + | pub struct ErrorWithoutMembers {}
|
444 + | impl ErrorWithoutMembers {
|
445 + | #[doc(hidden)]
|
446 + | /// Returns the error name.
|
447 + | pub fn name(&self) -> &'static str {
|
448 + | "ErrorWithoutMembers"
|
449 + | }
|
450 + | }
|
451 + | impl ::std::fmt::Display for ErrorWithoutMembers {
|
452 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
453 + | ::std::write!(f, "ErrorWithoutMembers")?;
|
454 + | Ok(())
|
455 + | }
|
456 + | }
|
457 + | impl ::std::error::Error for ErrorWithoutMembers {}
|
458 + | impl ErrorWithoutMembers {
|
459 + | /// Creates a new builder-style object to manufacture [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
|
460 + | pub fn builder() -> crate::error::error_without_members::Builder {
|
461 + | crate::error::error_without_members::Builder::default()
|
462 + | }
|
463 + | }
|
464 + |
|
465 + | #[allow(missing_docs)] // documentation missing in model
|
466 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
467 + | pub struct ErrorWithMembers {
|
468 + | #[allow(missing_docs)] // documentation missing in model
|
469 + | pub code: ::std::option::Option<::std::string::String>,
|
470 + | #[allow(missing_docs)] // documentation missing in model
|
471 + | pub complex_data: ::std::option::Option<crate::model::KitchenSink>,
|
472 + | #[allow(missing_docs)] // documentation missing in model
|
473 + | pub integer_field: ::std::option::Option<i32>,
|
474 + | #[allow(missing_docs)] // documentation missing in model
|
475 + | pub list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
476 + | #[allow(missing_docs)] // documentation missing in model
|
477 + | pub map_field: ::std::option::Option<
|
478 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
479 + | >,
|
480 + | #[allow(missing_docs)] // documentation missing in model
|
481 + | pub message: ::std::option::Option<::std::string::String>,
|
482 + | /// abc
|
483 + | pub string_field: ::std::option::Option<::std::string::String>,
|
484 + | }
|
485 + | impl ErrorWithMembers {
|
486 + | #[allow(missing_docs)] // documentation missing in model
|
487 + | pub fn code(&self) -> ::std::option::Option<&str> {
|
488 + | self.code.as_deref()
|
489 + | }
|
490 + | #[allow(missing_docs)] // documentation missing in model
|
491 + | pub fn complex_data(&self) -> ::std::option::Option<&crate::model::KitchenSink> {
|
492 + | self.complex_data.as_ref()
|
493 + | }
|
494 + | #[allow(missing_docs)] // documentation missing in model
|
495 + | pub fn integer_field(&self) -> ::std::option::Option<i32> {
|
496 + | self.integer_field
|
497 + | }
|
498 + | #[allow(missing_docs)] // documentation missing in model
|
499 + | pub fn list_field(&self) -> ::std::option::Option<&[::std::string::String]> {
|
500 + | self.list_field.as_deref()
|
501 + | }
|
502 + | #[allow(missing_docs)] // documentation missing in model
|
503 + | pub fn map_field(
|
504 + | &self,
|
505 + | ) -> ::std::option::Option<
|
506 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
507 + | > {
|
508 + | self.map_field.as_ref()
|
509 + | }
|
510 + | /// abc
|
511 + | pub fn string_field(&self) -> ::std::option::Option<&str> {
|
512 + | self.string_field.as_deref()
|
513 + | }
|
514 + | }
|
515 + | impl ErrorWithMembers {
|
516 + | /// Returns the error message.
|
517 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
518 + | self.message.as_deref()
|
519 + | }
|
520 + | #[doc(hidden)]
|
521 + | /// Returns the error name.
|
522 + | pub fn name(&self) -> &'static str {
|
523 + | "ErrorWithMembers"
|
524 + | }
|
525 + | }
|
526 + | impl ::std::fmt::Display for ErrorWithMembers {
|
527 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
528 + | ::std::write!(f, "ErrorWithMembers")?;
|
529 + | if let ::std::option::Option::Some(inner_2) = &self.message {
|
530 + | {
|
531 + | ::std::write!(f, ": {inner_2}")?;
|
532 + | }
|
533 + | }
|
534 + | Ok(())
|
535 + | }
|
536 + | }
|
537 + | impl ::std::error::Error for ErrorWithMembers {}
|
538 + | impl ErrorWithMembers {
|
539 + | /// Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::error::ErrorWithMembers).
|
540 + | pub fn builder() -> crate::error::error_with_members::Builder {
|
541 + | crate::error::error_with_members::Builder::default()
|
542 + | }
|
543 + | }
|
544 + |
|
545 + | /// See [`ValidationException`](crate::error::ValidationException).
|
546 + | pub mod validation_exception {
|
547 + |
|
548 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
549 + | /// Holds one variant for each of the ways the builder can fail.
|
550 + | #[non_exhaustive]
|
551 + | #[allow(clippy::enum_variant_names)]
|
552 + | pub enum ConstraintViolation {
|
553 + | /// `message` was not provided but it is required when building `ValidationException`.
|
554 + | MissingMessage,
|
555 + | }
|
556 + | impl ::std::fmt::Display for ConstraintViolation {
|
557 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
558 + | match self {
|
559 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
560 + | }
|
561 + | }
|
562 + | }
|
563 + | impl ::std::error::Error for ConstraintViolation {}
|
564 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
565 + | type Error = ConstraintViolation;
|
566 + |
|
567 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
568 + | builder.build()
|
569 + | }
|
570 + | }
|
571 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
572 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
573 + | pub struct Builder {
|
574 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
575 + | pub(crate) field_list:
|
576 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
577 + | }
|
578 + | impl Builder {
|
579 + | /// A summary of the validation failure.
|
580 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
581 + | self.message = Some(input);
|
582 + | self
|
583 + | }
|
584 + | /// 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.
|
585 + | pub fn field_list(
|
586 + | mut self,
|
587 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
588 + | ) -> Self {
|
589 + | self.field_list = input;
|
590 + | self
|
591 + | }
|
592 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
593 + | ///
|
594 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
|
595 + | ///
|
596 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
597 + | self.build_enforcing_all_constraints()
|
598 + | }
|
599 + | fn build_enforcing_all_constraints(
|
600 + | self,
|
601 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
602 + | Ok(crate::error::ValidationException {
|
603 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
604 + | field_list: self.field_list,
|
605 + | })
|
606 + | }
|
607 + | }
|
608 + | }
|
609 + | /// See [`FooError`](crate::error::FooError).
|
610 + | pub mod foo_error {
|
611 + |
|
612 + | impl ::std::convert::From<Builder> for crate::error::FooError {
|
613 + | fn from(builder: Builder) -> Self {
|
614 + | builder.build()
|
615 + | }
|
616 + | }
|
617 + | /// A builder for [`FooError`](crate::error::FooError).
|
618 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
619 + | pub struct Builder {}
|
620 + | impl Builder {
|
621 + | /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
|
622 + | pub fn build(self) -> crate::error::FooError {
|
623 + | self.build_enforcing_all_constraints()
|
624 + | }
|
625 + | fn build_enforcing_all_constraints(self) -> crate::error::FooError {
|
626 + | crate::error::FooError {}
|
627 + | }
|
628 + | }
|
629 + | }
|
630 + | /// See [`ComplexError`](crate::error::ComplexError).
|
631 + | pub mod complex_error {
|
632 + |
|
633 + | impl ::std::convert::From<Builder> for crate::error::ComplexError {
|
634 + | fn from(builder: Builder) -> Self {
|
635 + | builder.build()
|
636 + | }
|
637 + | }
|
638 + | /// A builder for [`ComplexError`](crate::error::ComplexError).
|
639 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
640 + | pub struct Builder {
|
641 + | pub(crate) top_level: ::std::option::Option<::std::string::String>,
|
642 + | pub(crate) nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
643 + | }
|
644 + | impl Builder {
|
645 + | #[allow(missing_docs)] // documentation missing in model
|
646 + | pub fn top_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
647 + | self.top_level = input;
|
648 + | self
|
649 + | }
|
650 + | #[allow(missing_docs)] // documentation missing in model
|
651 + | pub fn nested(
|
652 + | mut self,
|
653 + | input: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
654 + | ) -> Self {
|
655 + | self.nested = input;
|
656 + | self
|
657 + | }
|
658 + | /// Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
|
659 + | pub fn build(self) -> crate::error::ComplexError {
|
660 + | self.build_enforcing_all_constraints()
|
661 + | }
|
662 + | fn build_enforcing_all_constraints(self) -> crate::error::ComplexError {
|
663 + | crate::error::ComplexError {
|
664 + | top_level: self.top_level,
|
665 + | nested: self.nested,
|
666 + | }
|
667 + | }
|
668 + | }
|
669 + | }
|
670 + | /// See [`InvalidGreeting`](crate::error::InvalidGreeting).
|
671 + | pub mod invalid_greeting {
|
672 + |
|
673 + | impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
|
674 + | fn from(builder: Builder) -> Self {
|
675 + | builder.build()
|
676 + | }
|
677 + | }
|
678 + | /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
|
679 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
680 + | pub struct Builder {
|
681 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
682 + | }
|
683 + | impl Builder {
|
684 + | #[allow(missing_docs)] // documentation missing in model
|
685 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
686 + | self.message = input;
|
687 + | self
|
688 + | }
|
689 + | /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
|
690 + | pub fn build(self) -> crate::error::InvalidGreeting {
|
691 + | self.build_enforcing_all_constraints()
|
692 + | }
|
693 + | fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
|
694 + | crate::error::InvalidGreeting {
|
695 + | message: self.message,
|
696 + | }
|
697 + | }
|
698 + | }
|
699 + | }
|
700 + | /// See [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
|
701 + | pub mod error_without_members {
|
702 + |
|
703 + | impl ::std::convert::From<Builder> for crate::error::ErrorWithoutMembers {
|
704 + | fn from(builder: Builder) -> Self {
|
705 + | builder.build()
|
706 + | }
|
707 + | }
|
708 + | /// A builder for [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
|
709 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
710 + | pub struct Builder {}
|
711 + | impl Builder {
|
712 + | /// Consumes the builder and constructs a [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
|
713 + | pub fn build(self) -> crate::error::ErrorWithoutMembers {
|
714 + | self.build_enforcing_all_constraints()
|
715 + | }
|
716 + | fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithoutMembers {
|
717 + | crate::error::ErrorWithoutMembers {}
|
718 + | }
|
719 + | }
|
720 + | }
|
721 + | /// See [`ErrorWithMembers`](crate::error::ErrorWithMembers).
|
722 + | pub mod error_with_members {
|
723 + |
|
724 + | impl ::std::convert::From<Builder> for crate::error::ErrorWithMembers {
|
725 + | fn from(builder: Builder) -> Self {
|
726 + | builder.build()
|
727 + | }
|
728 + | }
|
729 + | /// A builder for [`ErrorWithMembers`](crate::error::ErrorWithMembers).
|
730 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
731 + | pub struct Builder {
|
732 + | pub(crate) code: ::std::option::Option<::std::string::String>,
|
733 + | pub(crate) complex_data: ::std::option::Option<crate::model::KitchenSink>,
|
734 + | pub(crate) integer_field: ::std::option::Option<i32>,
|
735 + | pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
736 + | pub(crate) map_field: ::std::option::Option<
|
737 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
738 + | >,
|
739 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
740 + | pub(crate) string_field: ::std::option::Option<::std::string::String>,
|
741 + | }
|
742 + | impl Builder {
|
743 + | #[allow(missing_docs)] // documentation missing in model
|
744 + | pub fn code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
745 + | self.code = input;
|
746 + | self
|
747 + | }
|
748 + | #[allow(missing_docs)] // documentation missing in model
|
749 + | pub fn complex_data(
|
750 + | mut self,
|
751 + | input: ::std::option::Option<crate::model::KitchenSink>,
|
752 + | ) -> Self {
|
753 + | self.complex_data = input;
|
754 + | self
|
755 + | }
|
756 + | #[allow(missing_docs)] // documentation missing in model
|
757 + | pub fn integer_field(mut self, input: ::std::option::Option<i32>) -> Self {
|
758 + | self.integer_field = input;
|
759 + | self
|
760 + | }
|
761 + | #[allow(missing_docs)] // documentation missing in model
|
762 + | pub fn list_field(
|
763 + | mut self,
|
764 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
765 + | ) -> Self {
|
766 + | self.list_field = input;
|
767 + | self
|
768 + | }
|
769 + | #[allow(missing_docs)] // documentation missing in model
|
770 + | pub fn map_field(
|
771 + | mut self,
|
772 + | input: ::std::option::Option<
|
773 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
774 + | >,
|
775 + | ) -> Self {
|
776 + | self.map_field = input;
|
777 + | self
|
778 + | }
|
779 + | #[allow(missing_docs)] // documentation missing in model
|
780 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
781 + | self.message = input;
|
782 + | self
|
783 + | }
|
784 + | /// abc
|
785 + | pub fn string_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
786 + | self.string_field = input;
|
787 + | self
|
788 + | }
|
789 + | /// Consumes the builder and constructs a [`ErrorWithMembers`](crate::error::ErrorWithMembers).
|
790 + | pub fn build(self) -> crate::error::ErrorWithMembers {
|
791 + | self.build_enforcing_all_constraints()
|
792 + | }
|
793 + | fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithMembers {
|
794 + | crate::error::ErrorWithMembers {
|
795 + | code: self.code,
|
796 + | complex_data: self.complex_data,
|
797 + | integer_field: self.integer_field,
|
798 + | list_field: self.list_field,
|
799 + | map_field: self.map_field,
|
800 + | message: self.message,
|
801 + | string_field: self.string_field,
|
802 + | }
|
803 + | }
|
804 + | }
|
805 + | }
|