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