1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Error type for the `OperationWithNestedStructure` operation.
|
4 + | /// Each variant represents an error that can occur for the `OperationWithNestedStructure` operation.
|
5 + | #[derive(::std::fmt::Debug)]
|
6 + | pub enum OperationWithNestedStructureError {
|
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 OperationWithNestedStructureError {
|
11 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
12 + | match &self {
|
13 + | OperationWithNestedStructureError::ValidationException(_inner) => _inner.fmt(f),
|
14 + | }
|
15 + | }
|
16 + | }
|
17 + | impl OperationWithNestedStructureError {
|
18 + | /// Returns `true` if the error kind is `OperationWithNestedStructureError::ValidationException`.
|
19 + | pub fn is_validation_exception(&self) -> bool {
|
20 + | matches!(
|
21 + | &self,
|
22 + | OperationWithNestedStructureError::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 + | OperationWithNestedStructureError::ValidationException(_inner) => _inner.name(),
|
29 + | }
|
30 + | }
|
31 + | }
|
32 + | impl ::std::error::Error for OperationWithNestedStructureError {
|
33 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
34 + | match &self {
|
35 + | OperationWithNestedStructureError::ValidationException(_inner) => Some(_inner),
|
36 + | }
|
37 + | }
|
38 + | }
|
39 + | impl ::std::convert::From<crate::error::ValidationException>
|
40 + | for crate::error::OperationWithNestedStructureError
|
41 + | {
|
42 + | fn from(
|
43 + | variant: crate::error::ValidationException,
|
44 + | ) -> crate::error::OperationWithNestedStructureError {
|
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 `OperationWithDefaults` operation.
|
94 + | /// Each variant represents an error that can occur for the `OperationWithDefaults` operation.
|
95 + | #[derive(::std::fmt::Debug)]
|
96 + | pub enum OperationWithDefaultsError {
|
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 OperationWithDefaultsError {
|
101 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
102 + | match &self {
|
103 + | OperationWithDefaultsError::ValidationException(_inner) => _inner.fmt(f),
|
104 + | }
|
105 + | }
|
106 + | }
|
107 + | impl OperationWithDefaultsError {
|
108 + | /// Returns `true` if the error kind is `OperationWithDefaultsError::ValidationException`.
|
109 + | pub fn is_validation_exception(&self) -> bool {
|
110 + | matches!(&self, OperationWithDefaultsError::ValidationException(_))
|
111 + | }
|
112 + | /// Returns the error name string by matching the correct variant.
|
113 + | pub fn name(&self) -> &'static str {
|
114 + | match &self {
|
115 + | OperationWithDefaultsError::ValidationException(_inner) => _inner.name(),
|
116 + | }
|
117 + | }
|
118 + | }
|
119 + | impl ::std::error::Error for OperationWithDefaultsError {
|
120 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
121 + | match &self {
|
122 + | OperationWithDefaultsError::ValidationException(_inner) => Some(_inner),
|
123 + | }
|
124 + | }
|
125 + | }
|
126 + | impl ::std::convert::From<crate::error::ValidationException>
|
127 + | for crate::error::OperationWithDefaultsError
|
128 + | {
|
129 + | fn from(
|
130 + | variant: crate::error::ValidationException,
|
131 + | ) -> crate::error::OperationWithDefaultsError {
|
132 + | Self::ValidationException(variant)
|
133 + | }
|
134 + | }
|
135 + |
|
136 + | /// Error type for the `EndpointWithHostLabelOperation` operation.
|
137 + | /// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
|
138 + | #[derive(::std::fmt::Debug)]
|
139 + | pub enum EndpointWithHostLabelOperationError {
|
140 + | /// 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.
|
141 + | ValidationException(crate::error::ValidationException),
|
142 + | }
|
143 + | impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
|
144 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
145 + | match &self {
|
146 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
|
147 + | }
|
148 + | }
|
149 + | }
|
150 + | impl EndpointWithHostLabelOperationError {
|
151 + | /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
|
152 + | pub fn is_validation_exception(&self) -> bool {
|
153 + | matches!(
|
154 + | &self,
|
155 + | EndpointWithHostLabelOperationError::ValidationException(_)
|
156 + | )
|
157 + | }
|
158 + | /// Returns the error name string by matching the correct variant.
|
159 + | pub fn name(&self) -> &'static str {
|
160 + | match &self {
|
161 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
|
162 + | }
|
163 + | }
|
164 + | }
|
165 + | impl ::std::error::Error for EndpointWithHostLabelOperationError {
|
166 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
167 + | match &self {
|
168 + | EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
|
169 + | }
|
170 + | }
|
171 + | }
|
172 + | impl ::std::convert::From<crate::error::ValidationException>
|
173 + | for crate::error::EndpointWithHostLabelOperationError
|
174 + | {
|
175 + | fn from(
|
176 + | variant: crate::error::ValidationException,
|
177 + | ) -> crate::error::EndpointWithHostLabelOperationError {
|
178 + | Self::ValidationException(variant)
|
179 + | }
|
180 + | }
|
181 + |
|
182 + | /// Error type for the `JsonUnions` operation.
|
183 + | /// Each variant represents an error that can occur for the `JsonUnions` operation.
|
184 + | #[derive(::std::fmt::Debug)]
|
185 + | pub enum JsonUnionsError {
|
186 + | /// 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.
|
187 + | ValidationException(crate::error::ValidationException),
|
188 + | }
|
189 + | impl ::std::fmt::Display for JsonUnionsError {
|
190 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
191 + | match &self {
|
192 + | JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
|
193 + | }
|
194 + | }
|
195 + | }
|
196 + | impl JsonUnionsError {
|
197 + | /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
|
198 + | pub fn is_validation_exception(&self) -> bool {
|
199 + | matches!(&self, JsonUnionsError::ValidationException(_))
|
200 + | }
|
201 + | /// Returns the error name string by matching the correct variant.
|
202 + | pub fn name(&self) -> &'static str {
|
203 + | match &self {
|
204 + | JsonUnionsError::ValidationException(_inner) => _inner.name(),
|
205 + | }
|
206 + | }
|
207 + | }
|
208 + | impl ::std::error::Error for JsonUnionsError {
|
209 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
210 + | match &self {
|
211 + | JsonUnionsError::ValidationException(_inner) => Some(_inner),
|
212 + | }
|
213 + | }
|
214 + | }
|
215 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
|
216 + | fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
|
217 + | Self::ValidationException(variant)
|
218 + | }
|
219 + | }
|
220 + |
|
221 + | /// Error type for the `GreetingWithErrors` operation.
|
222 + | /// Each variant represents an error that can occur for the `GreetingWithErrors` operation.
|
223 + | #[derive(::std::fmt::Debug)]
|
224 + | pub enum GreetingWithErrorsError {
|
225 + | /// This error is thrown when an invalid greeting value is provided.
|
226 + | InvalidGreeting(crate::error::InvalidGreeting),
|
227 + | /// This error is thrown when a request is invalid.
|
228 + | ComplexError(crate::error::ComplexError),
|
229 + | /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
|
230 + | FooError(crate::error::FooError),
|
231 + | }
|
232 + | impl ::std::fmt::Display for GreetingWithErrorsError {
|
233 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
234 + | match &self {
|
235 + | GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.fmt(f),
|
236 + | GreetingWithErrorsError::ComplexError(_inner) => _inner.fmt(f),
|
237 + | GreetingWithErrorsError::FooError(_inner) => _inner.fmt(f),
|
238 + | }
|
239 + | }
|
240 + | }
|
241 + | impl GreetingWithErrorsError {
|
242 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
|
243 + | pub fn is_invalid_greeting(&self) -> bool {
|
244 + | matches!(&self, GreetingWithErrorsError::InvalidGreeting(_))
|
245 + | }
|
246 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
|
247 + | pub fn is_complex_error(&self) -> bool {
|
248 + | matches!(&self, GreetingWithErrorsError::ComplexError(_))
|
249 + | }
|
250 + | /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
|
251 + | pub fn is_foo_error(&self) -> bool {
|
252 + | matches!(&self, GreetingWithErrorsError::FooError(_))
|
253 + | }
|
254 + | /// Returns the error name string by matching the correct variant.
|
255 + | pub fn name(&self) -> &'static str {
|
256 + | match &self {
|
257 + | GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.name(),
|
258 + | GreetingWithErrorsError::ComplexError(_inner) => _inner.name(),
|
259 + | GreetingWithErrorsError::FooError(_inner) => _inner.name(),
|
260 + | }
|
261 + | }
|
262 + | }
|
263 + | impl ::std::error::Error for GreetingWithErrorsError {
|
264 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
265 + | match &self {
|
266 + | GreetingWithErrorsError::InvalidGreeting(_inner) => Some(_inner),
|
267 + | GreetingWithErrorsError::ComplexError(_inner) => Some(_inner),
|
268 + | GreetingWithErrorsError::FooError(_inner) => Some(_inner),
|
269 + | }
|
270 + | }
|
271 + | }
|
272 + | impl ::std::convert::From<crate::error::InvalidGreeting> for crate::error::GreetingWithErrorsError {
|
273 + | fn from(variant: crate::error::InvalidGreeting) -> crate::error::GreetingWithErrorsError {
|
274 + | Self::InvalidGreeting(variant)
|
275 + | }
|
276 + | }
|
277 + | impl ::std::convert::From<crate::error::ComplexError> for crate::error::GreetingWithErrorsError {
|
278 + | fn from(variant: crate::error::ComplexError) -> crate::error::GreetingWithErrorsError {
|
279 + | Self::ComplexError(variant)
|
280 + | }
|
281 + | }
|
282 + | impl ::std::convert::From<crate::error::FooError> for crate::error::GreetingWithErrorsError {
|
283 + | fn from(variant: crate::error::FooError) -> crate::error::GreetingWithErrorsError {
|
284 + | Self::FooError(variant)
|
285 + | }
|
286 + | }
|
287 + |
|
288 + | /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
|
289 + | #[derive(
|
290 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
291 + | )]
|
292 + | pub struct FooError {}
|
293 + | impl FooError {
|
294 + | #[doc(hidden)]
|
295 + | /// Returns the error name.
|
296 + | pub fn name(&self) -> &'static str {
|
297 + | "FooError"
|
298 + | }
|
299 + | }
|
300 + | impl ::std::fmt::Display for FooError {
|
301 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
302 + | ::std::write!(f, "FooError")?;
|
303 + | Ok(())
|
304 + | }
|
305 + | }
|
306 + | impl ::std::error::Error for FooError {}
|
307 + | impl FooError {
|
308 + | /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
|
309 + | pub fn builder() -> crate::error::foo_error::Builder {
|
310 + | crate::error::foo_error::Builder::default()
|
311 + | }
|
312 + | }
|
313 + |
|
314 + | /// This error is thrown when a request is invalid.
|
315 + | #[derive(
|
316 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
317 + | )]
|
318 + | pub struct ComplexError {
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub top_level: ::std::option::Option<::std::string::String>,
|
321 + | #[allow(missing_docs)] // documentation missing in model
|
322 + | pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
323 + | }
|
324 + | impl ComplexError {
|
325 + | #[allow(missing_docs)] // documentation missing in model
|
326 + | pub fn top_level(&self) -> ::std::option::Option<&str> {
|
327 + | self.top_level.as_deref()
|
328 + | }
|
329 + | #[allow(missing_docs)] // documentation missing in model
|
330 + | pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
|
331 + | self.nested.as_ref()
|
332 + | }
|
333 + | }
|
334 + | impl ComplexError {
|
335 + | #[doc(hidden)]
|
336 + | /// Returns the error name.
|
337 + | pub fn name(&self) -> &'static str {
|
338 + | "ComplexError"
|
339 + | }
|
340 + | }
|
341 + | impl ::std::fmt::Display for ComplexError {
|
342 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
343 + | ::std::write!(f, "ComplexError")?;
|
344 + | Ok(())
|
345 + | }
|
346 + | }
|
347 + | impl ::std::error::Error for ComplexError {}
|
348 + | impl ComplexError {
|
349 + | /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
|
350 + | pub fn builder() -> crate::error::complex_error::Builder {
|
351 + | crate::error::complex_error::Builder::default()
|
352 + | }
|
353 + | }
|
354 + |
|
355 + | /// This error is thrown when an invalid greeting value is provided.
|
356 + | #[derive(
|
357 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
358 + | )]
|
359 + | pub struct InvalidGreeting {
|
360 + | #[allow(missing_docs)] // documentation missing in model
|
361 + | pub message: ::std::option::Option<::std::string::String>,
|
362 + | }
|
363 + | impl InvalidGreeting {
|
364 + | /// Returns the error message.
|
365 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
366 + | self.message.as_deref()
|
367 + | }
|
368 + | #[doc(hidden)]
|
369 + | /// Returns the error name.
|
370 + | pub fn name(&self) -> &'static str {
|
371 + | "InvalidGreeting"
|
372 + | }
|
373 + | }
|
374 + | impl ::std::fmt::Display for InvalidGreeting {
|
375 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
376 + | ::std::write!(f, "InvalidGreeting")?;
|
377 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
378 + | {
|
379 + | ::std::write!(f, ": {inner_1}")?;
|
380 + | }
|
381 + | }
|
382 + | Ok(())
|
383 + | }
|
384 + | }
|
385 + | impl ::std::error::Error for InvalidGreeting {}
|
386 + | impl InvalidGreeting {
|
387 + | /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
|
388 + | pub fn builder() -> crate::error::invalid_greeting::Builder {
|
389 + | crate::error::invalid_greeting::Builder::default()
|
390 + | }
|
391 + | }
|
392 + |
|
393 + | /// See [`ValidationException`](crate::error::ValidationException).
|
394 + | pub mod validation_exception {
|
395 + |
|
396 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
397 + | /// Holds one variant for each of the ways the builder can fail.
|
398 + | #[non_exhaustive]
|
399 + | #[allow(clippy::enum_variant_names)]
|
400 + | pub enum ConstraintViolation {
|
401 + | /// `message` was not provided but it is required when building `ValidationException`.
|
402 + | MissingMessage,
|
403 + | }
|
404 + | impl ::std::fmt::Display for ConstraintViolation {
|
405 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
406 + | match self {
|
407 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
408 + | }
|
409 + | }
|
410 + | }
|
411 + | impl ::std::error::Error for ConstraintViolation {}
|
412 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
413 + | type Error = ConstraintViolation;
|
414 + |
|
415 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
416 + | builder.build()
|
417 + | }
|
418 + | }
|
419 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
420 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
421 + | pub struct Builder {
|
422 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
423 + | pub(crate) field_list:
|
424 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
425 + | }
|
426 + | impl Builder {
|
427 + | /// A summary of the validation failure.
|
428 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
429 + | self.message = Some(input);
|
430 + | self
|
431 + | }
|
432 + | /// 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.
|
433 + | pub fn field_list(
|
434 + | mut self,
|
435 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
436 + | ) -> Self {
|
437 + | self.field_list = input;
|
438 + | self
|
439 + | }
|
440 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
441 + | ///
|
442 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
|
443 + | ///
|
444 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
445 + | self.build_enforcing_all_constraints()
|
446 + | }
|
447 + | fn build_enforcing_all_constraints(
|
448 + | self,
|
449 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
450 + | Ok(crate::error::ValidationException {
|
451 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
452 + | field_list: self.field_list,
|
453 + | })
|
454 + | }
|
455 + | }
|
456 + | }
|
457 + | /// See [`FooError`](crate::error::FooError).
|
458 + | pub mod foo_error {
|
459 + |
|
460 + | impl ::std::convert::From<Builder> for crate::error::FooError {
|
461 + | fn from(builder: Builder) -> Self {
|
462 + | builder.build()
|
463 + | }
|
464 + | }
|
465 + | /// A builder for [`FooError`](crate::error::FooError).
|
466 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
467 + | pub struct Builder {}
|
468 + | impl Builder {
|
469 + | /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
|
470 + | pub fn build(self) -> crate::error::FooError {
|
471 + | self.build_enforcing_all_constraints()
|
472 + | }
|
473 + | fn build_enforcing_all_constraints(self) -> crate::error::FooError {
|
474 + | crate::error::FooError {}
|
475 + | }
|
476 + | }
|
477 + | }
|
478 + | /// See [`ComplexError`](crate::error::ComplexError).
|
479 + | pub mod complex_error {
|
480 + |
|
481 + | impl ::std::convert::From<Builder> for crate::error::ComplexError {
|
482 + | fn from(builder: Builder) -> Self {
|
483 + | builder.build()
|
484 + | }
|
485 + | }
|
486 + | /// A builder for [`ComplexError`](crate::error::ComplexError).
|
487 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
488 + | pub struct Builder {
|
489 + | pub(crate) top_level: ::std::option::Option<::std::string::String>,
|
490 + | pub(crate) nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
491 + | }
|
492 + | impl Builder {
|
493 + | #[allow(missing_docs)] // documentation missing in model
|
494 + | pub fn top_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
495 + | self.top_level = input;
|
496 + | self
|
497 + | }
|
498 + | #[allow(missing_docs)] // documentation missing in model
|
499 + | pub fn nested(
|
500 + | mut self,
|
501 + | input: ::std::option::Option<crate::model::ComplexNestedErrorData>,
|
502 + | ) -> Self {
|
503 + | self.nested = input;
|
504 + | self
|
505 + | }
|
506 + | /// Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
|
507 + | pub fn build(self) -> crate::error::ComplexError {
|
508 + | self.build_enforcing_all_constraints()
|
509 + | }
|
510 + | fn build_enforcing_all_constraints(self) -> crate::error::ComplexError {
|
511 + | crate::error::ComplexError {
|
512 + | top_level: self.top_level,
|
513 + | nested: self.nested,
|
514 + | }
|
515 + | }
|
516 + | }
|
517 + | }
|
518 + | /// See [`InvalidGreeting`](crate::error::InvalidGreeting).
|
519 + | pub mod invalid_greeting {
|
520 + |
|
521 + | impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
|
522 + | fn from(builder: Builder) -> Self {
|
523 + | builder.build()
|
524 + | }
|
525 + | }
|
526 + | /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
|
527 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
528 + | pub struct Builder {
|
529 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
530 + | }
|
531 + | impl Builder {
|
532 + | #[allow(missing_docs)] // documentation missing in model
|
533 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
534 + | self.message = input;
|
535 + | self
|
536 + | }
|
537 + | /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
|
538 + | pub fn build(self) -> crate::error::InvalidGreeting {
|
539 + | self.build_enforcing_all_constraints()
|
540 + | }
|
541 + | fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
|
542 + | crate::error::InvalidGreeting {
|
543 + | message: self.message,
|
544 + | }
|
545 + | }
|
546 + | }
|
547 + | }
|