1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// Describes one specific validation failure for an input member.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
4 3 | #[derive(
|
5 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4 + | ::std::clone::Clone,
|
5 + | ::std::cmp::Eq,
|
6 + | ::std::cmp::Ord,
|
7 + | ::std::cmp::PartialEq,
|
8 + | ::std::cmp::PartialOrd,
|
9 + | ::std::fmt::Debug,
|
10 + | ::std::hash::Hash,
|
6 11 | )]
|
7 - | pub struct ValidationExceptionField {
|
8 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 - | pub path: ::std::string::String,
|
10 - | /// A detailed description of the validation failure.
|
11 - | pub message: ::std::string::String,
|
12 - | }
|
13 - | impl ValidationExceptionField {
|
14 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 - | pub fn path(&self) -> &str {
|
16 - | use std::ops::Deref;
|
17 - | self.path.deref()
|
18 - | }
|
19 - | /// A detailed description of the validation failure.
|
20 - | pub fn message(&self) -> &str {
|
21 - | use std::ops::Deref;
|
22 - | self.message.deref()
|
23 - | }
|
24 - | }
|
25 - | impl ValidationExceptionField {
|
26 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 - | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 - | crate::model::validation_exception_field::Builder::default()
|
29 - | }
|
30 - | }
|
31 - |
|
32 - | #[allow(missing_docs)] // documentation missing in model
|
33 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
34 - | pub enum Events {
|
12 + | pub enum Suit {
|
35 13 | #[allow(missing_docs)] // documentation missing in model
|
36 - | A(crate::model::Event),
|
14 + | Club,
|
37 15 | #[allow(missing_docs)] // documentation missing in model
|
38 - | B(crate::model::Event),
|
16 + | Diamond,
|
39 17 | #[allow(missing_docs)] // documentation missing in model
|
40 - | C(crate::model::Event),
|
18 + | Heart,
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | Spade,
|
41 21 | }
|
42 - | impl Events {
|
43 - | /// Tries to convert the enum instance into [`A`](crate::model::Events::A), extracting the inner [`Event`](crate::model::Event).
|
44 - | /// Returns `Err(&Self)` if it can't be converted.
|
45 - | pub fn as_a(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
46 - | if let Events::A(val) = &self {
|
47 - | ::std::result::Result::Ok(val)
|
48 - | } else {
|
49 - | ::std::result::Result::Err(self)
|
22 + | /// See [`Suit`](crate::model::Suit).
|
23 + | pub mod suit {
|
24 + | #[derive(Debug, PartialEq)]
|
25 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
26 + |
|
27 + | impl ::std::fmt::Display for ConstraintViolation {
|
28 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
29 + | write!(
|
30 + | f,
|
31 + | r#"Value provided for 'smithy.protocoltests.rpcv2Cbor#Suit' failed to satisfy constraint: Member must satisfy enum value set: [DIAMOND, CLUB, HEART, SPADE]"#
|
32 + | )
|
50 33 | }
|
51 34 | }
|
52 - | /// Returns true if this is a [`A`](crate::model::Events::A).
|
53 - | pub fn is_a(&self) -> bool {
|
54 - | self.as_a().is_ok()
|
35 + |
|
36 + | impl ::std::error::Error for ConstraintViolation {}
|
37 + | impl ConstraintViolation {
|
38 + | pub(crate) fn as_validation_exception_field(
|
39 + | self,
|
40 + | path: ::std::string::String,
|
41 + | ) -> crate::model::ValidationExceptionField {
|
42 + | crate::model::ValidationExceptionField {
|
43 + | message: format!(
|
44 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [DIAMOND, CLUB, HEART, SPADE]"#,
|
45 + | &path
|
46 + | ),
|
47 + | path,
|
48 + | }
|
49 + | }
|
55 50 | }
|
56 - | /// Tries to convert the enum instance into [`B`](crate::model::Events::B), extracting the inner [`Event`](crate::model::Event).
|
57 - | /// Returns `Err(&Self)` if it can't be converted.
|
58 - | pub fn as_b(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
59 - | if let Events::B(val) = &self {
|
60 - | ::std::result::Result::Ok(val)
|
61 - | } else {
|
62 - | ::std::result::Result::Err(self)
|
51 + | }
|
52 + | impl ::std::convert::TryFrom<&str> for Suit {
|
53 + | type Error = crate::model::suit::ConstraintViolation;
|
54 + | fn try_from(
|
55 + | s: &str,
|
56 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
57 + | match s {
|
58 + | "CLUB" => Ok(Suit::Club),
|
59 + | "DIAMOND" => Ok(Suit::Diamond),
|
60 + | "HEART" => Ok(Suit::Heart),
|
61 + | "SPADE" => Ok(Suit::Spade),
|
62 + | _ => Err(crate::model::suit::ConstraintViolation(s.to_owned())),
|
63 63 | }
|
64 64 | }
|
65 - | /// Returns true if this is a [`B`](crate::model::Events::B).
|
66 - | pub fn is_b(&self) -> bool {
|
67 - | self.as_b().is_ok()
|
65 + | }
|
66 + | impl ::std::convert::TryFrom<::std::string::String> for Suit {
|
67 + | type Error = crate::model::suit::ConstraintViolation;
|
68 + | fn try_from(
|
69 + | s: ::std::string::String,
|
70 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
71 + | {
|
72 + | s.as_str().try_into()
|
68 73 | }
|
69 - | /// Tries to convert the enum instance into [`C`](crate::model::Events::C), extracting the inner [`Event`](crate::model::Event).
|
70 - | /// Returns `Err(&Self)` if it can't be converted.
|
71 - | pub fn as_c(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
72 - | if let Events::C(val) = &self {
|
73 - | ::std::result::Result::Ok(val)
|
74 - | } else {
|
75 - | ::std::result::Result::Err(self)
|
74 + | }
|
75 + | impl std::str::FromStr for Suit {
|
76 + | type Err = crate::model::suit::ConstraintViolation;
|
77 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
78 + | Self::try_from(s)
|
79 + | }
|
80 + | }
|
81 + | impl Suit {
|
82 + | /// Returns the `&str` value of the enum member.
|
83 + | pub fn as_str(&self) -> &str {
|
84 + | match self {
|
85 + | Suit::Club => "CLUB",
|
86 + | Suit::Diamond => "DIAMOND",
|
87 + | Suit::Heart => "HEART",
|
88 + | Suit::Spade => "SPADE",
|
76 89 | }
|
77 90 | }
|
78 - | /// Returns true if this is a [`C`](crate::model::Events::C).
|
79 - | pub fn is_c(&self) -> bool {
|
80 - | self.as_c().is_ok()
|
91 + | /// Returns all the `&str` representations of the enum members.
|
92 + | pub const fn values() -> &'static [&'static str] {
|
93 + | &["CLUB", "DIAMOND", "HEART", "SPADE"]
|
81 94 | }
|
82 95 | }
|
83 - |
|
84 - | #[allow(missing_docs)] // documentation missing in model
|
85 - | #[derive(
|
86 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
87 - | )]
|
88 - | pub struct Event {}
|
89 - | impl Event {
|
90 - | /// Creates a new builder-style object to manufacture [`Event`](crate::model::Event).
|
91 - | pub fn builder() -> crate::model::event::Builder {
|
92 - | crate::model::event::Builder::default()
|
96 + | impl ::std::convert::AsRef<str> for Suit {
|
97 + | fn as_ref(&self) -> &str {
|
98 + | self.as_str()
|
93 99 | }
|
94 100 | }
|
95 - | impl crate::constrained::Constrained for crate::model::Event {
|
96 - | type Unconstrained = crate::model::event::Builder;
|
101 + | impl crate::constrained::Constrained for Suit {
|
102 + | type Unconstrained = ::std::string::String;
|
103 + | }
|
104 + |
|
105 + | impl ::std::convert::From<::std::string::String>
|
106 + | for crate::constrained::MaybeConstrained<crate::model::Suit>
|
107 + | {
|
108 + | fn from(value: ::std::string::String) -> Self {
|
109 + | Self::Unconstrained(value)
|
110 + | }
|
97 111 | }
|
98 112 |
|
99 113 | #[allow(missing_docs)] // documentation missing in model
|
100 - | #[derive(
|
101 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
102 - | )]
|
103 - | pub struct RecursiveOperationInputOutputNested1 {
|
114 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
115 + | pub struct SimpleStruct {
|
104 116 | #[allow(missing_docs)] // documentation missing in model
|
105 - | pub foo: ::std::option::Option<::std::string::String>,
|
117 + | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
106 118 | #[allow(missing_docs)] // documentation missing in model
|
107 - | pub nested: ::std::option::Option<
|
108 - | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
109 - | >,
|
119 + | pub boolean: ::std::option::Option<bool>,
|
110 120 | #[allow(missing_docs)] // documentation missing in model
|
111 - | pub variant: ::std::option::Option<crate::model::FooChoice>,
|
121 + | pub string: ::std::option::Option<::std::string::String>,
|
122 + | #[allow(missing_docs)] // documentation missing in model
|
123 + | pub byte: ::std::option::Option<i8>,
|
124 + | #[allow(missing_docs)] // documentation missing in model
|
125 + | pub short: ::std::option::Option<i16>,
|
126 + | #[allow(missing_docs)] // documentation missing in model
|
127 + | pub integer: ::std::option::Option<i32>,
|
128 + | #[allow(missing_docs)] // documentation missing in model
|
129 + | pub long: ::std::option::Option<i64>,
|
130 + | #[allow(missing_docs)] // documentation missing in model
|
131 + | pub float: ::std::option::Option<f32>,
|
132 + | #[allow(missing_docs)] // documentation missing in model
|
133 + | pub double: ::std::option::Option<f64>,
|
134 + | #[allow(missing_docs)] // documentation missing in model
|
135 + | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
136 + | #[allow(missing_docs)] // documentation missing in model
|
137 + | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
138 + | #[allow(missing_docs)] // documentation missing in model
|
139 + | pub required_blob: ::aws_smithy_types::Blob,
|
140 + | #[allow(missing_docs)] // documentation missing in model
|
141 + | pub required_boolean: bool,
|
142 + | #[allow(missing_docs)] // documentation missing in model
|
143 + | pub required_string: ::std::string::String,
|
144 + | #[allow(missing_docs)] // documentation missing in model
|
145 + | pub required_byte: i8,
|
146 + | #[allow(missing_docs)] // documentation missing in model
|
147 + | pub required_short: i16,
|
148 + | #[allow(missing_docs)] // documentation missing in model
|
149 + | pub required_integer: i32,
|
150 + | #[allow(missing_docs)] // documentation missing in model
|
151 + | pub required_long: i64,
|
152 + | #[allow(missing_docs)] // documentation missing in model
|
153 + | pub required_float: f32,
|
154 + | #[allow(missing_docs)] // documentation missing in model
|
155 + | pub required_double: f64,
|
156 + | #[allow(missing_docs)] // documentation missing in model
|
157 + | pub required_timestamp: ::aws_smithy_types::DateTime,
|
158 + | #[allow(missing_docs)] // documentation missing in model
|
159 + | pub required_enum: crate::model::Suit,
|
112 160 | }
|
113 - | impl RecursiveOperationInputOutputNested1 {
|
161 + | impl SimpleStruct {
|
114 162 | #[allow(missing_docs)] // documentation missing in model
|
115 - | pub fn foo(&self) -> ::std::option::Option<&str> {
|
116 - | self.foo.as_deref()
|
163 + | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
164 + | self.blob.as_ref()
|
117 165 | }
|
118 166 | #[allow(missing_docs)] // documentation missing in model
|
119 - | pub fn nested(
|
120 - | &self,
|
121 - | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested2> {
|
122 - | self.nested.as_deref()
|
167 + | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
168 + | self.boolean
|
123 169 | }
|
124 170 | #[allow(missing_docs)] // documentation missing in model
|
125 - | pub fn variant(&self) -> ::std::option::Option<&crate::model::FooChoice> {
|
126 - | self.variant.as_ref()
|
127 - | }
|
128 - | }
|
129 - | impl RecursiveOperationInputOutputNested1 {
|
130 - | /// Creates a new builder-style object to manufacture [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
131 - | pub fn builder() -> crate::model::recursive_operation_input_output_nested1::Builder {
|
132 - | crate::model::recursive_operation_input_output_nested1::Builder::default()
|
171 + | pub fn string(&self) -> ::std::option::Option<&str> {
|
172 + | self.string.as_deref()
|
133 173 | }
|
134 - | }
|
135 - | impl crate::constrained::Constrained for crate::model::RecursiveOperationInputOutputNested1 {
|
136 - | type Unconstrained = crate::model::recursive_operation_input_output_nested1::Builder;
|
137 - | }
|
138 - |
|
139 - | #[allow(missing_docs)] // documentation missing in model
|
140 - | #[derive(
|
141 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
142 - | )]
|
143 - | pub enum FooChoice {
|
144 174 | #[allow(missing_docs)] // documentation missing in model
|
145 - | Choice1(::std::string::String),
|
175 + | pub fn byte(&self) -> ::std::option::Option<i8> {
|
176 + | self.byte
|
177 + | }
|
146 178 | #[allow(missing_docs)] // documentation missing in model
|
147 - | Choice2(::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested1>),
|
179 + | pub fn short(&self) -> ::std::option::Option<i16> {
|
180 + | self.short
|
181 + | }
|
182 + | #[allow(missing_docs)] // documentation missing in model
|
183 + | pub fn integer(&self) -> ::std::option::Option<i32> {
|
184 + | self.integer
|
185 + | }
|
186 + | #[allow(missing_docs)] // documentation missing in model
|
187 + | pub fn long(&self) -> ::std::option::Option<i64> {
|
188 + | self.long
|
189 + | }
|
190 + | #[allow(missing_docs)] // documentation missing in model
|
191 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
192 + | self.float
|
193 + | }
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | pub fn double(&self) -> ::std::option::Option<f64> {
|
196 + | self.double
|
197 + | }
|
198 + | #[allow(missing_docs)] // documentation missing in model
|
199 + | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
200 + | self.timestamp.as_ref()
|
201 + | }
|
202 + | #[allow(missing_docs)] // documentation missing in model
|
203 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::Suit> {
|
204 + | self.r#enum.as_ref()
|
205 + | }
|
206 + | #[allow(missing_docs)] // documentation missing in model
|
207 + | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
208 + | &self.required_blob
|
209 + | }
|
210 + | #[allow(missing_docs)] // documentation missing in model
|
211 + | pub fn required_boolean(&self) -> bool {
|
212 + | self.required_boolean
|
213 + | }
|
214 + | #[allow(missing_docs)] // documentation missing in model
|
215 + | pub fn required_string(&self) -> &str {
|
216 + | use std::ops::Deref;
|
217 + | self.required_string.deref()
|
218 + | }
|
219 + | #[allow(missing_docs)] // documentation missing in model
|
220 + | pub fn required_byte(&self) -> i8 {
|
221 + | self.required_byte
|
222 + | }
|
223 + | #[allow(missing_docs)] // documentation missing in model
|
224 + | pub fn required_short(&self) -> i16 {
|
225 + | self.required_short
|
226 + | }
|
227 + | #[allow(missing_docs)] // documentation missing in model
|
228 + | pub fn required_integer(&self) -> i32 {
|
229 + | self.required_integer
|
230 + | }
|
231 + | #[allow(missing_docs)] // documentation missing in model
|
232 + | pub fn required_long(&self) -> i64 {
|
233 + | self.required_long
|
234 + | }
|
235 + | #[allow(missing_docs)] // documentation missing in model
|
236 + | pub fn required_float(&self) -> f32 {
|
237 + | self.required_float
|
238 + | }
|
239 + | #[allow(missing_docs)] // documentation missing in model
|
240 + | pub fn required_double(&self) -> f64 {
|
241 + | self.required_double
|
242 + | }
|
243 + | #[allow(missing_docs)] // documentation missing in model
|
244 + | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
245 + | &self.required_timestamp
|
246 + | }
|
247 + | #[allow(missing_docs)] // documentation missing in model
|
248 + | pub fn required_enum(&self) -> &crate::model::Suit {
|
249 + | &self.required_enum
|
250 + | }
|
148 251 | }
|
149 - | impl FooChoice {
|
150 - | /// Tries to convert the enum instance into [`Choice1`](crate::model::FooChoice::Choice1), extracting the inner [`String`](::std::string::String).
|
252 + | impl SimpleStruct {
|
253 + | /// Creates a new builder-style object to manufacture [`SimpleStruct`](crate::model::SimpleStruct).
|
254 + | pub fn builder() -> crate::model::simple_struct::Builder {
|
255 + | crate::model::simple_struct::Builder::default()
|
256 + | }
|
257 + | }
|
258 + | impl crate::constrained::Constrained for crate::model::SimpleStruct {
|
259 + | type Unconstrained = crate::model::simple_struct::Builder;
|
260 + | }
|
261 + |
|
262 + | #[allow(missing_docs)] // documentation missing in model
|
263 + | #[derive(
|
264 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
265 + | )]
|
266 + | pub struct EmptyStruct {}
|
267 + | impl EmptyStruct {
|
268 + | /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
|
269 + | pub fn builder() -> crate::model::empty_struct::Builder {
|
270 + | crate::model::empty_struct::Builder::default()
|
271 + | }
|
272 + | }
|
273 + | impl crate::constrained::Constrained for crate::model::EmptyStruct {
|
274 + | type Unconstrained = crate::model::empty_struct::Builder;
|
275 + | }
|
276 + |
|
277 + | #[allow(missing_docs)] // documentation missing in model
|
278 + | #[derive(
|
279 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
280 + | )]
|
281 + | pub enum SimpleUnion {
|
282 + | #[allow(missing_docs)] // documentation missing in model
|
283 + | Blob(::aws_smithy_types::Blob),
|
284 + | #[allow(missing_docs)] // documentation missing in model
|
285 + | Boolean(bool),
|
286 + | #[allow(missing_docs)] // documentation missing in model
|
287 + | String(::std::string::String),
|
288 + | #[allow(missing_docs)] // documentation missing in model
|
289 + | Unit,
|
290 + | }
|
291 + | impl SimpleUnion {
|
292 + | /// Tries to convert the enum instance into [`Blob`](crate::model::SimpleUnion::Blob), extracting the inner [`Blob`](::aws_smithy_types::Blob).
|
151 293 | /// Returns `Err(&Self)` if it can't be converted.
|
152 - | pub fn as_choice1(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
153 - | if let FooChoice::Choice1(val) = &self {
|
294 + | pub fn as_blob(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
|
295 + | if let SimpleUnion::Blob(val) = &self {
|
154 296 | ::std::result::Result::Ok(val)
|
155 297 | } else {
|
156 298 | ::std::result::Result::Err(self)
|
157 299 | }
|
158 300 | }
|
159 - | /// Returns true if this is a [`Choice1`](crate::model::FooChoice::Choice1).
|
160 - | pub fn is_choice1(&self) -> bool {
|
161 - | self.as_choice1().is_ok()
|
301 + | /// Returns true if this is a [`Blob`](crate::model::SimpleUnion::Blob).
|
302 + | pub fn is_blob(&self) -> bool {
|
303 + | self.as_blob().is_ok()
|
162 304 | }
|
163 - | /// Tries to convert the enum instance into [`Choice2`](crate::model::FooChoice::Choice2), extracting the inner [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
305 + | /// Tries to convert the enum instance into [`Boolean`](crate::model::SimpleUnion::Boolean), extracting the inner [`bool`](bool).
|
164 306 | /// Returns `Err(&Self)` if it can't be converted.
|
165 - | pub fn as_choice2(
|
166 - | &self,
|
167 - | ) -> ::std::result::Result<
|
168 - | &::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested1>,
|
169 - | &Self,
|
170 - | > {
|
171 - | if let FooChoice::Choice2(val) = &self {
|
307 + | pub fn as_boolean(&self) -> ::std::result::Result<&bool, &Self> {
|
308 + | if let SimpleUnion::Boolean(val) = &self {
|
172 309 | ::std::result::Result::Ok(val)
|
173 310 | } else {
|
174 311 | ::std::result::Result::Err(self)
|
175 312 | }
|
176 313 | }
|
177 - | /// Returns true if this is a [`Choice2`](crate::model::FooChoice::Choice2).
|
178 - | pub fn is_choice2(&self) -> bool {
|
179 - | self.as_choice2().is_ok()
|
314 + | /// Returns true if this is a [`Boolean`](crate::model::SimpleUnion::Boolean).
|
315 + | pub fn is_boolean(&self) -> bool {
|
316 + | self.as_boolean().is_ok()
|
317 + | }
|
318 + | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
319 + | /// Returns `Err(&Self)` if it can't be converted.
|
320 + | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
321 + | if let SimpleUnion::String(val) = &self {
|
322 + | ::std::result::Result::Ok(val)
|
323 + | } else {
|
324 + | ::std::result::Result::Err(self)
|
325 + | }
|
326 + | }
|
327 + | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
328 + | pub fn is_string(&self) -> bool {
|
329 + | self.as_string().is_ok()
|
330 + | }
|
331 + | /// Tries to convert the enum instance into [`Unit`](crate::model::SimpleUnion::Unit), extracting the inner `()`.
|
332 + | /// Returns `Err(&Self)` if it can't be converted.
|
333 + | pub fn as_unit(&self) -> ::std::result::Result<(), &Self> {
|
334 + | if let SimpleUnion::Unit = &self {
|
335 + | ::std::result::Result::Ok(())
|
336 + | } else {
|
337 + | ::std::result::Result::Err(self)
|
338 + | }
|
339 + | }
|
340 + | /// Returns true if this is a [`Unit`](crate::model::SimpleUnion::Unit).
|
341 + | pub fn is_unit(&self) -> bool {
|
342 + | self.as_unit().is_ok()
|
180 343 | }
|
181 344 | }
|
182 345 |
|
183 346 | #[allow(missing_docs)] // documentation missing in model
|
184 347 | #[derive(
|
185 348 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
186 349 | )]
|
187 - | pub struct RecursiveOperationInputOutputNested2 {
|
350 + | pub enum UnitUnion {
|
188 351 | #[allow(missing_docs)] // documentation missing in model
|
189 - | pub bar: ::std::option::Option<::std::string::String>,
|
352 + | UnitA,
|
190 353 | #[allow(missing_docs)] // documentation missing in model
|
191 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
354 + | UnitB,
|
192 355 | }
|
193 - | impl RecursiveOperationInputOutputNested2 {
|
194 - | #[allow(missing_docs)] // documentation missing in model
|
195 - | pub fn bar(&self) -> ::std::option::Option<&str> {
|
196 - | self.bar.as_deref()
|
356 + | impl UnitUnion {
|
357 + | /// Tries to convert the enum instance into [`UnitA`](crate::model::UnitUnion::UnitA), extracting the inner `()`.
|
358 + | /// Returns `Err(&Self)` if it can't be converted.
|
359 + | pub fn as_unit_a(&self) -> ::std::result::Result<(), &Self> {
|
360 + | if let UnitUnion::UnitA = &self {
|
361 + | ::std::result::Result::Ok(())
|
362 + | } else {
|
363 + | ::std::result::Result::Err(self)
|
364 + | }
|
197 365 | }
|
198 - | #[allow(missing_docs)] // documentation missing in model
|
199 - | pub fn recursive_member(
|
200 - | &self,
|
201 - | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested1> {
|
202 - | self.recursive_member.as_ref()
|
366 + | /// Returns true if this is a [`UnitA`](crate::model::UnitUnion::UnitA).
|
367 + | pub fn is_unit_a(&self) -> bool {
|
368 + | self.as_unit_a().is_ok()
|
203 369 | }
|
204 - | }
|
205 - | impl RecursiveOperationInputOutputNested2 {
|
206 - | /// Creates a new builder-style object to manufacture [`RecursiveOperationInputOutputNested2`](crate::model::RecursiveOperationInputOutputNested2).
|
207 - | pub fn builder() -> crate::model::recursive_operation_input_output_nested2::Builder {
|
208 - | crate::model::recursive_operation_input_output_nested2::Builder::default()
|
370 + | /// Tries to convert the enum instance into [`UnitB`](crate::model::UnitUnion::UnitB), extracting the inner `()`.
|
371 + | /// Returns `Err(&Self)` if it can't be converted.
|
372 + | pub fn as_unit_b(&self) -> ::std::result::Result<(), &Self> {
|
373 + | if let UnitUnion::UnitB = &self {
|
374 + | ::std::result::Result::Ok(())
|
375 + | } else {
|
376 + | ::std::result::Result::Err(self)
|
377 + | }
|
378 + | }
|
379 + | /// Returns true if this is a [`UnitB`](crate::model::UnitUnion::UnitB).
|
380 + | pub fn is_unit_b(&self) -> bool {
|
381 + | self.as_unit_b().is_ok()
|
209 382 | }
|
210 - | }
|
211 - | impl crate::constrained::Constrained for crate::model::RecursiveOperationInputOutputNested2 {
|
212 - | type Unconstrained = crate::model::recursive_operation_input_output_nested2::Builder;
|
213 383 | }
|
214 384 |
|
215 385 | #[allow(missing_docs)] // documentation missing in model
|
216 386 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
217 387 | pub enum ComplexUnion {
|
218 388 | #[allow(missing_docs)] // documentation missing in model
|
219 389 | ComplexStruct(crate::model::ComplexStruct),
|
220 390 | #[allow(missing_docs)] // documentation missing in model
|
221 391 | List(::std::vec::Vec<::std::string::String>),
|
222 392 | #[allow(missing_docs)] // documentation missing in model
|
294 464 | /// Returns true if this is a [`Union`](crate::model::ComplexUnion::Union).
|
295 465 | pub fn is_union(&self) -> bool {
|
296 466 | self.as_union().is_ok()
|
297 467 | }
|
298 468 | }
|
299 469 |
|
300 470 | #[allow(missing_docs)] // documentation missing in model
|
301 471 | #[derive(
|
302 472 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
303 473 | )]
|
304 - | pub enum SimpleUnion {
|
305 - | #[allow(missing_docs)] // documentation missing in model
|
306 - | Blob(::aws_smithy_types::Blob),
|
474 + | pub struct RecursiveOperationInputOutputNested1 {
|
307 475 | #[allow(missing_docs)] // documentation missing in model
|
308 - | Boolean(bool),
|
476 + | pub foo: ::std::option::Option<::std::string::String>,
|
309 477 | #[allow(missing_docs)] // documentation missing in model
|
310 - | String(::std::string::String),
|
478 + | pub nested: ::std::option::Option<
|
479 + | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
480 + | >,
|
311 481 | #[allow(missing_docs)] // documentation missing in model
|
312 - | Unit,
|
482 + | pub variant: ::std::option::Option<crate::model::FooChoice>,
|
313 483 | }
|
314 - | impl SimpleUnion {
|
315 - | /// Tries to convert the enum instance into [`Blob`](crate::model::SimpleUnion::Blob), extracting the inner [`Blob`](::aws_smithy_types::Blob).
|
316 - | /// Returns `Err(&Self)` if it can't be converted.
|
317 - | pub fn as_blob(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
|
318 - | if let SimpleUnion::Blob(val) = &self {
|
319 - | ::std::result::Result::Ok(val)
|
320 - | } else {
|
321 - | ::std::result::Result::Err(self)
|
322 - | }
|
484 + | impl RecursiveOperationInputOutputNested1 {
|
485 + | #[allow(missing_docs)] // documentation missing in model
|
486 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
487 + | self.foo.as_deref()
|
323 488 | }
|
324 - | /// Returns true if this is a [`Blob`](crate::model::SimpleUnion::Blob).
|
325 - | pub fn is_blob(&self) -> bool {
|
326 - | self.as_blob().is_ok()
|
489 + | #[allow(missing_docs)] // documentation missing in model
|
490 + | pub fn nested(
|
491 + | &self,
|
492 + | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested2> {
|
493 + | self.nested.as_deref()
|
327 494 | }
|
328 - | /// Tries to convert the enum instance into [`Boolean`](crate::model::SimpleUnion::Boolean), extracting the inner [`bool`](bool).
|
329 - | /// Returns `Err(&Self)` if it can't be converted.
|
330 - | pub fn as_boolean(&self) -> ::std::result::Result<&bool, &Self> {
|
331 - | if let SimpleUnion::Boolean(val) = &self {
|
332 - | ::std::result::Result::Ok(val)
|
333 - | } else {
|
334 - | ::std::result::Result::Err(self)
|
495 + | #[allow(missing_docs)] // documentation missing in model
|
496 + | pub fn variant(&self) -> ::std::option::Option<&crate::model::FooChoice> {
|
497 + | self.variant.as_ref()
|
498 + | }
|
499 + | }
|
500 + | impl RecursiveOperationInputOutputNested1 {
|
501 + | /// Creates a new builder-style object to manufacture [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
502 + | pub fn builder() -> crate::model::recursive_operation_input_output_nested1::Builder {
|
503 + | crate::model::recursive_operation_input_output_nested1::Builder::default()
|
504 + | }
|
505 + | }
|
506 + | impl crate::constrained::Constrained for crate::model::RecursiveOperationInputOutputNested1 {
|
507 + | type Unconstrained = crate::model::recursive_operation_input_output_nested1::Builder;
|
508 + | }
|
509 + |
|
510 + | #[allow(missing_docs)] // documentation missing in model
|
511 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
512 + | pub enum Events {
|
513 + | #[allow(missing_docs)] // documentation missing in model
|
514 + | A(crate::model::Event),
|
515 + | #[allow(missing_docs)] // documentation missing in model
|
516 + | B(crate::model::Event),
|
517 + | #[allow(missing_docs)] // documentation missing in model
|
518 + | C(crate::model::Event),
|
519 + | }
|
520 + | impl Events {
|
521 + | /// Tries to convert the enum instance into [`A`](crate::model::Events::A), extracting the inner [`Event`](crate::model::Event).
|
522 + | /// Returns `Err(&Self)` if it can't be converted.
|
523 + | pub fn as_a(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
524 + | if let Events::A(val) = &self {
|
525 + | ::std::result::Result::Ok(val)
|
526 + | } else {
|
527 + | ::std::result::Result::Err(self)
|
335 528 | }
|
336 529 | }
|
337 - | /// Returns true if this is a [`Boolean`](crate::model::SimpleUnion::Boolean).
|
338 - | pub fn is_boolean(&self) -> bool {
|
339 - | self.as_boolean().is_ok()
|
530 + | /// Returns true if this is a [`A`](crate::model::Events::A).
|
531 + | pub fn is_a(&self) -> bool {
|
532 + | self.as_a().is_ok()
|
340 533 | }
|
341 - | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
534 + | /// Tries to convert the enum instance into [`B`](crate::model::Events::B), extracting the inner [`Event`](crate::model::Event).
|
342 535 | /// Returns `Err(&Self)` if it can't be converted.
|
343 - | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
344 - | if let SimpleUnion::String(val) = &self {
|
536 + | pub fn as_b(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
537 + | if let Events::B(val) = &self {
|
345 538 | ::std::result::Result::Ok(val)
|
346 539 | } else {
|
347 540 | ::std::result::Result::Err(self)
|
348 541 | }
|
349 542 | }
|
350 - | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
351 - | pub fn is_string(&self) -> bool {
|
352 - | self.as_string().is_ok()
|
543 + | /// Returns true if this is a [`B`](crate::model::Events::B).
|
544 + | pub fn is_b(&self) -> bool {
|
545 + | self.as_b().is_ok()
|
353 546 | }
|
354 - | /// Tries to convert the enum instance into [`Unit`](crate::model::SimpleUnion::Unit), extracting the inner `()`.
|
547 + | /// Tries to convert the enum instance into [`C`](crate::model::Events::C), extracting the inner [`Event`](crate::model::Event).
|
355 548 | /// Returns `Err(&Self)` if it can't be converted.
|
356 - | pub fn as_unit(&self) -> ::std::result::Result<(), &Self> {
|
357 - | if let SimpleUnion::Unit = &self {
|
358 - | ::std::result::Result::Ok(())
|
549 + | pub fn as_c(&self) -> ::std::result::Result<&crate::model::Event, &Self> {
|
550 + | if let Events::C(val) = &self {
|
551 + | ::std::result::Result::Ok(val)
|
359 552 | } else {
|
360 553 | ::std::result::Result::Err(self)
|
361 554 | }
|
362 555 | }
|
363 - | /// Returns true if this is a [`Unit`](crate::model::SimpleUnion::Unit).
|
364 - | pub fn is_unit(&self) -> bool {
|
365 - | self.as_unit().is_ok()
|
556 + | /// Returns true if this is a [`C`](crate::model::Events::C).
|
557 + | pub fn is_c(&self) -> bool {
|
558 + | self.as_c().is_ok()
|
559 + | }
|
560 + | }
|
561 + |
|
562 + | /// Describes one specific validation failure for an input member.
|
563 + | #[derive(
|
564 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
565 + | )]
|
566 + | pub struct ValidationExceptionField {
|
567 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
568 + | pub path: ::std::string::String,
|
569 + | /// A detailed description of the validation failure.
|
570 + | pub message: ::std::string::String,
|
571 + | }
|
572 + | impl ValidationExceptionField {
|
573 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
574 + | pub fn path(&self) -> &str {
|
575 + | use std::ops::Deref;
|
576 + | self.path.deref()
|
577 + | }
|
578 + | /// A detailed description of the validation failure.
|
579 + | pub fn message(&self) -> &str {
|
580 + | use std::ops::Deref;
|
581 + | self.message.deref()
|
582 + | }
|
583 + | }
|
584 + | impl ValidationExceptionField {
|
585 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
586 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
587 + | crate::model::validation_exception_field::Builder::default()
|
366 588 | }
|
367 589 | }
|
368 590 |
|
369 591 | #[allow(missing_docs)] // documentation missing in model
|
370 592 | #[derive(
|
371 593 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
372 594 | )]
|
373 595 | pub struct Unit {}
|
374 596 | impl Unit {
|
375 597 | /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit).
|
376 598 | pub fn builder() -> crate::model::unit::Builder {
|
377 599 | crate::model::unit::Builder::default()
|
378 600 | }
|
379 601 | }
|
380 602 | impl crate::constrained::Constrained for crate::model::Unit {
|
381 603 | type Unconstrained = crate::model::unit::Builder;
|
382 604 | }
|
383 605 |
|
384 606 | #[allow(missing_docs)] // documentation missing in model
|
385 607 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
386 - | pub struct SimpleStruct {
|
387 - | #[allow(missing_docs)] // documentation missing in model
|
388 - | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
389 - | #[allow(missing_docs)] // documentation missing in model
|
390 - | pub boolean: ::std::option::Option<bool>,
|
391 - | #[allow(missing_docs)] // documentation missing in model
|
392 - | pub string: ::std::option::Option<::std::string::String>,
|
393 - | #[allow(missing_docs)] // documentation missing in model
|
394 - | pub byte: ::std::option::Option<i8>,
|
395 - | #[allow(missing_docs)] // documentation missing in model
|
396 - | pub short: ::std::option::Option<i16>,
|
397 - | #[allow(missing_docs)] // documentation missing in model
|
398 - | pub integer: ::std::option::Option<i32>,
|
399 - | #[allow(missing_docs)] // documentation missing in model
|
400 - | pub long: ::std::option::Option<i64>,
|
401 - | #[allow(missing_docs)] // documentation missing in model
|
402 - | pub float: ::std::option::Option<f32>,
|
403 - | #[allow(missing_docs)] // documentation missing in model
|
404 - | pub double: ::std::option::Option<f64>,
|
405 - | #[allow(missing_docs)] // documentation missing in model
|
406 - | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
407 - | #[allow(missing_docs)] // documentation missing in model
|
408 - | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
409 - | #[allow(missing_docs)] // documentation missing in model
|
410 - | pub required_blob: ::aws_smithy_types::Blob,
|
608 + | pub struct ComplexStruct {
|
411 609 | #[allow(missing_docs)] // documentation missing in model
|
412 - | pub required_boolean: bool,
|
610 + | pub structure: ::std::option::Option<crate::model::SimpleStruct>,
|
413 611 | #[allow(missing_docs)] // documentation missing in model
|
414 - | pub required_string: ::std::string::String,
|
612 + | pub empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
415 613 | #[allow(missing_docs)] // documentation missing in model
|
416 - | pub required_byte: i8,
|
614 + | pub list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
417 615 | #[allow(missing_docs)] // documentation missing in model
|
418 - | pub required_short: i16,
|
616 + | pub map: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
419 617 | #[allow(missing_docs)] // documentation missing in model
|
420 - | pub required_integer: i32,
|
618 + | pub union: ::std::option::Option<crate::model::SimpleUnion>,
|
421 619 | #[allow(missing_docs)] // documentation missing in model
|
422 - | pub required_long: i64,
|
620 + | pub unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
423 621 | #[allow(missing_docs)] // documentation missing in model
|
424 - | pub required_float: f32,
|
622 + | pub structure_list: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
425 623 | #[allow(missing_docs)] // documentation missing in model
|
426 - | pub required_double: f64,
|
624 + | pub complex_list: ::std::vec::Vec<
|
625 + | ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
626 + | >,
|
427 627 | #[allow(missing_docs)] // documentation missing in model
|
428 - | pub required_timestamp: ::aws_smithy_types::DateTime,
|
628 + | pub complex_map: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
429 629 | #[allow(missing_docs)] // documentation missing in model
|
430 - | pub required_enum: crate::model::Suit,
|
630 + | pub complex_union: ::std::boxed::Box<crate::model::ComplexUnion>,
|
431 631 | }
|
432 - | impl SimpleStruct {
|
433 - | #[allow(missing_docs)] // documentation missing in model
|
434 - | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
435 - | self.blob.as_ref()
|
436 - | }
|
437 - | #[allow(missing_docs)] // documentation missing in model
|
438 - | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
439 - | self.boolean
|
440 - | }
|
441 - | #[allow(missing_docs)] // documentation missing in model
|
442 - | pub fn string(&self) -> ::std::option::Option<&str> {
|
443 - | self.string.as_deref()
|
444 - | }
|
445 - | #[allow(missing_docs)] // documentation missing in model
|
446 - | pub fn byte(&self) -> ::std::option::Option<i8> {
|
447 - | self.byte
|
448 - | }
|
632 + | impl ComplexStruct {
|
449 633 | #[allow(missing_docs)] // documentation missing in model
|
450 - | pub fn short(&self) -> ::std::option::Option<i16> {
|
451 - | self.short
|
634 + | pub fn structure(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
635 + | self.structure.as_ref()
|
452 636 | }
|
453 637 | #[allow(missing_docs)] // documentation missing in model
|
454 - | pub fn integer(&self) -> ::std::option::Option<i32> {
|
455 - | self.integer
|
638 + | pub fn empty_structure(&self) -> ::std::option::Option<&crate::model::EmptyStruct> {
|
639 + | self.empty_structure.as_ref()
|
456 640 | }
|
457 641 | #[allow(missing_docs)] // documentation missing in model
|
458 - | pub fn long(&self) -> ::std::option::Option<i64> {
|
459 - | self.long
|
642 + | pub fn list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
643 + | self.list.as_deref()
|
460 644 | }
|
461 645 | #[allow(missing_docs)] // documentation missing in model
|
462 - | pub fn float(&self) -> ::std::option::Option<f32> {
|
463 - | self.float
|
646 + | pub fn map(
|
647 + | &self,
|
648 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
649 + | self.map.as_ref()
|
464 650 | }
|
465 651 | #[allow(missing_docs)] // documentation missing in model
|
466 - | pub fn double(&self) -> ::std::option::Option<f64> {
|
467 - | self.double
|
652 + | pub fn union(&self) -> ::std::option::Option<&crate::model::SimpleUnion> {
|
653 + | self.union.as_ref()
|
468 654 | }
|
469 655 | #[allow(missing_docs)] // documentation missing in model
|
470 - | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
471 - | self.timestamp.as_ref()
|
656 + | pub fn unit_union(&self) -> ::std::option::Option<&crate::model::UnitUnion> {
|
657 + | self.unit_union.as_ref()
|
472 658 | }
|
473 659 | #[allow(missing_docs)] // documentation missing in model
|
474 - | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::Suit> {
|
475 - | self.r#enum.as_ref()
|
660 + | pub fn structure_list(&self) -> ::std::option::Option<&[crate::model::SimpleStruct]> {
|
661 + | self.structure_list.as_deref()
|
476 662 | }
|
477 663 | #[allow(missing_docs)] // documentation missing in model
|
478 - | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
479 - | &self.required_blob
|
664 + | pub fn complex_list(
|
665 + | &self,
|
666 + | ) -> &[::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>] {
|
667 + | use std::ops::Deref;
|
668 + | self.complex_list.deref()
|
480 669 | }
|
481 670 | #[allow(missing_docs)] // documentation missing in model
|
482 - | pub fn required_boolean(&self) -> bool {
|
483 - | self.required_boolean
|
671 + | pub fn complex_map(
|
672 + | &self,
|
673 + | ) -> &::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion> {
|
674 + | &self.complex_map
|
484 675 | }
|
485 676 | #[allow(missing_docs)] // documentation missing in model
|
486 - | pub fn required_string(&self) -> &str {
|
677 + | pub fn complex_union(&self) -> &crate::model::ComplexUnion {
|
487 678 | use std::ops::Deref;
|
488 - | self.required_string.deref()
|
679 + | self.complex_union.deref()
|
489 680 | }
|
490 - | #[allow(missing_docs)] // documentation missing in model
|
491 - | pub fn required_byte(&self) -> i8 {
|
492 - | self.required_byte
|
681 + | }
|
682 + | impl ComplexStruct {
|
683 + | /// Creates a new builder-style object to manufacture [`ComplexStruct`](crate::model::ComplexStruct).
|
684 + | pub fn builder() -> crate::model::complex_struct::Builder {
|
685 + | crate::model::complex_struct::Builder::default()
|
493 686 | }
|
687 + | }
|
688 + | impl crate::constrained::Constrained for crate::model::ComplexStruct {
|
689 + | type Unconstrained = crate::model::complex_struct::Builder;
|
690 + | }
|
691 + |
|
692 + | #[allow(missing_docs)] // documentation missing in model
|
693 + | #[derive(
|
694 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
695 + | )]
|
696 + | pub struct RecursiveOperationInputOutputNested2 {
|
494 697 | #[allow(missing_docs)] // documentation missing in model
|
495 - | pub fn required_short(&self) -> i16 {
|
496 - | self.required_short
|
497 - | }
|
698 + | pub bar: ::std::option::Option<::std::string::String>,
|
498 699 | #[allow(missing_docs)] // documentation missing in model
|
499 - | pub fn required_integer(&self) -> i32 {
|
500 - | self.required_integer
|
501 - | }
|
700 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
701 + | }
|
702 + | impl RecursiveOperationInputOutputNested2 {
|
502 703 | #[allow(missing_docs)] // documentation missing in model
|
503 - | pub fn required_long(&self) -> i64 {
|
504 - | self.required_long
|
704 + | pub fn bar(&self) -> ::std::option::Option<&str> {
|
705 + | self.bar.as_deref()
|
505 706 | }
|
506 707 | #[allow(missing_docs)] // documentation missing in model
|
507 - | pub fn required_float(&self) -> f32 {
|
508 - | self.required_float
|
708 + | pub fn recursive_member(
|
709 + | &self,
|
710 + | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested1> {
|
711 + | self.recursive_member.as_ref()
|
509 712 | }
|
510 - | #[allow(missing_docs)] // documentation missing in model
|
511 - | pub fn required_double(&self) -> f64 {
|
512 - | self.required_double
|
513 - | }
|
514 - | #[allow(missing_docs)] // documentation missing in model
|
515 - | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
516 - | &self.required_timestamp
|
517 - | }
|
518 - | #[allow(missing_docs)] // documentation missing in model
|
519 - | pub fn required_enum(&self) -> &crate::model::Suit {
|
520 - | &self.required_enum
|
521 - | }
|
522 - | }
|
523 - | impl SimpleStruct {
|
524 - | /// Creates a new builder-style object to manufacture [`SimpleStruct`](crate::model::SimpleStruct).
|
525 - | pub fn builder() -> crate::model::simple_struct::Builder {
|
526 - | crate::model::simple_struct::Builder::default()
|
527 - | }
|
528 - | }
|
529 - | impl crate::constrained::Constrained for crate::model::SimpleStruct {
|
530 - | type Unconstrained = crate::model::simple_struct::Builder;
|
531 - | }
|
532 - |
|
533 - | #[allow(missing_docs)] // documentation missing in model
|
534 - | #[derive(
|
535 - | ::std::clone::Clone,
|
536 - | ::std::cmp::Eq,
|
537 - | ::std::cmp::Ord,
|
538 - | ::std::cmp::PartialEq,
|
539 - | ::std::cmp::PartialOrd,
|
540 - | ::std::fmt::Debug,
|
541 - | ::std::hash::Hash,
|
542 - | )]
|
543 - | pub enum Suit {
|
544 - | #[allow(missing_docs)] // documentation missing in model
|
545 - | Club,
|
546 - | #[allow(missing_docs)] // documentation missing in model
|
547 - | Diamond,
|
548 - | #[allow(missing_docs)] // documentation missing in model
|
549 - | Heart,
|
550 - | #[allow(missing_docs)] // documentation missing in model
|
551 - | Spade,
|
552 - | }
|
553 - | /// See [`Suit`](crate::model::Suit).
|
554 - | pub mod suit {
|
555 - | #[derive(Debug, PartialEq)]
|
556 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
557 - |
|
558 - | impl ::std::fmt::Display for ConstraintViolation {
|
559 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
560 - | write!(
|
561 - | f,
|
562 - | r#"Value provided for 'smithy.protocoltests.rpcv2Cbor#Suit' failed to satisfy constraint: Member must satisfy enum value set: [DIAMOND, CLUB, HEART, SPADE]"#
|
563 - | )
|
564 - | }
|
565 - | }
|
566 - |
|
567 - | impl ::std::error::Error for ConstraintViolation {}
|
568 - | impl ConstraintViolation {
|
569 - | pub(crate) fn as_validation_exception_field(
|
570 - | self,
|
571 - | path: ::std::string::String,
|
572 - | ) -> crate::model::ValidationExceptionField {
|
573 - | crate::model::ValidationExceptionField {
|
574 - | message: format!(
|
575 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [DIAMOND, CLUB, HEART, SPADE]"#,
|
576 - | &path
|
577 - | ),
|
578 - | path,
|
579 - | }
|
580 - | }
|
581 - | }
|
582 - | }
|
583 - | impl ::std::convert::TryFrom<&str> for Suit {
|
584 - | type Error = crate::model::suit::ConstraintViolation;
|
585 - | fn try_from(
|
586 - | s: &str,
|
587 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
588 - | match s {
|
589 - | "CLUB" => Ok(Suit::Club),
|
590 - | "DIAMOND" => Ok(Suit::Diamond),
|
591 - | "HEART" => Ok(Suit::Heart),
|
592 - | "SPADE" => Ok(Suit::Spade),
|
593 - | _ => Err(crate::model::suit::ConstraintViolation(s.to_owned())),
|
594 - | }
|
595 - | }
|
596 - | }
|
597 - | impl ::std::convert::TryFrom<::std::string::String> for Suit {
|
598 - | type Error = crate::model::suit::ConstraintViolation;
|
599 - | fn try_from(
|
600 - | s: ::std::string::String,
|
601 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
602 - | {
|
603 - | s.as_str().try_into()
|
604 - | }
|
605 - | }
|
606 - | impl std::str::FromStr for Suit {
|
607 - | type Err = crate::model::suit::ConstraintViolation;
|
608 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
609 - | Self::try_from(s)
|
610 - | }
|
611 - | }
|
612 - | impl Suit {
|
613 - | /// Returns the `&str` value of the enum member.
|
614 - | pub fn as_str(&self) -> &str {
|
615 - | match self {
|
616 - | Suit::Club => "CLUB",
|
617 - | Suit::Diamond => "DIAMOND",
|
618 - | Suit::Heart => "HEART",
|
619 - | Suit::Spade => "SPADE",
|
620 - | }
|
621 - | }
|
622 - | /// Returns all the `&str` representations of the enum members.
|
623 - | pub const fn values() -> &'static [&'static str] {
|
624 - | &["CLUB", "DIAMOND", "HEART", "SPADE"]
|
625 - | }
|
626 - | }
|
627 - | impl ::std::convert::AsRef<str> for Suit {
|
628 - | fn as_ref(&self) -> &str {
|
629 - | self.as_str()
|
630 - | }
|
631 - | }
|
632 - | impl crate::constrained::Constrained for Suit {
|
633 - | type Unconstrained = ::std::string::String;
|
634 - | }
|
635 - |
|
636 - | impl ::std::convert::From<::std::string::String>
|
637 - | for crate::constrained::MaybeConstrained<crate::model::Suit>
|
638 - | {
|
639 - | fn from(value: ::std::string::String) -> Self {
|
640 - | Self::Unconstrained(value)
|
713 + | }
|
714 + | impl RecursiveOperationInputOutputNested2 {
|
715 + | /// Creates a new builder-style object to manufacture [`RecursiveOperationInputOutputNested2`](crate::model::RecursiveOperationInputOutputNested2).
|
716 + | pub fn builder() -> crate::model::recursive_operation_input_output_nested2::Builder {
|
717 + | crate::model::recursive_operation_input_output_nested2::Builder::default()
|
641 718 | }
|
642 719 | }
|
643 - |
|
644 - | #[allow(missing_docs)] // documentation missing in model
|
645 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
646 - | pub struct ComplexStruct {
|
647 - | #[allow(missing_docs)] // documentation missing in model
|
648 - | pub structure: ::std::option::Option<crate::model::SimpleStruct>,
|
649 - | #[allow(missing_docs)] // documentation missing in model
|
650 - | pub empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
651 - | #[allow(missing_docs)] // documentation missing in model
|
652 - | pub list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
653 - | #[allow(missing_docs)] // documentation missing in model
|
654 - | pub map: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
655 - | #[allow(missing_docs)] // documentation missing in model
|
656 - | pub union: ::std::option::Option<crate::model::SimpleUnion>,
|
657 - | #[allow(missing_docs)] // documentation missing in model
|
658 - | pub unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
659 - | #[allow(missing_docs)] // documentation missing in model
|
660 - | pub structure_list: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
661 - | #[allow(missing_docs)] // documentation missing in model
|
662 - | pub complex_list: ::std::vec::Vec<
|
663 - | ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
664 - | >,
|
665 - | #[allow(missing_docs)] // documentation missing in model
|
666 - | pub complex_map: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
667 - | #[allow(missing_docs)] // documentation missing in model
|
668 - | pub complex_union: ::std::boxed::Box<crate::model::ComplexUnion>,
|
669 - | }
|
670 - | impl ComplexStruct {
|
671 - | #[allow(missing_docs)] // documentation missing in model
|
672 - | pub fn structure(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
673 - | self.structure.as_ref()
|
674 - | }
|
675 - | #[allow(missing_docs)] // documentation missing in model
|
676 - | pub fn empty_structure(&self) -> ::std::option::Option<&crate::model::EmptyStruct> {
|
677 - | self.empty_structure.as_ref()
|
678 - | }
|
679 - | #[allow(missing_docs)] // documentation missing in model
|
680 - | pub fn list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
681 - | self.list.as_deref()
|
682 - | }
|
683 - | #[allow(missing_docs)] // documentation missing in model
|
684 - | pub fn map(
|
685 - | &self,
|
686 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
687 - | self.map.as_ref()
|
688 - | }
|
689 - | #[allow(missing_docs)] // documentation missing in model
|
690 - | pub fn union(&self) -> ::std::option::Option<&crate::model::SimpleUnion> {
|
691 - | self.union.as_ref()
|
692 - | }
|
693 - | #[allow(missing_docs)] // documentation missing in model
|
694 - | pub fn unit_union(&self) -> ::std::option::Option<&crate::model::UnitUnion> {
|
695 - | self.unit_union.as_ref()
|
696 - | }
|
697 - | #[allow(missing_docs)] // documentation missing in model
|
698 - | pub fn structure_list(&self) -> ::std::option::Option<&[crate::model::SimpleStruct]> {
|
699 - | self.structure_list.as_deref()
|
700 - | }
|
701 - | #[allow(missing_docs)] // documentation missing in model
|
702 - | pub fn complex_list(
|
703 - | &self,
|
704 - | ) -> &[::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>] {
|
705 - | use std::ops::Deref;
|
706 - | self.complex_list.deref()
|
707 - | }
|
708 - | #[allow(missing_docs)] // documentation missing in model
|
709 - | pub fn complex_map(
|
710 - | &self,
|
711 - | ) -> &::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion> {
|
712 - | &self.complex_map
|
713 - | }
|
714 - | #[allow(missing_docs)] // documentation missing in model
|
715 - | pub fn complex_union(&self) -> &crate::model::ComplexUnion {
|
716 - | use std::ops::Deref;
|
717 - | self.complex_union.deref()
|
718 - | }
|
719 - | }
|
720 - | impl ComplexStruct {
|
721 - | /// Creates a new builder-style object to manufacture [`ComplexStruct`](crate::model::ComplexStruct).
|
722 - | pub fn builder() -> crate::model::complex_struct::Builder {
|
723 - | crate::model::complex_struct::Builder::default()
|
724 - | }
|
725 - | }
|
726 - | impl crate::constrained::Constrained for crate::model::ComplexStruct {
|
727 - | type Unconstrained = crate::model::complex_struct::Builder;
|
728 - | }
|
729 - |
|
730 - | #[allow(missing_docs)] // documentation missing in model
|
731 - | #[derive(
|
732 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
733 - | )]
|
734 - | pub enum UnitUnion {
|
735 - | #[allow(missing_docs)] // documentation missing in model
|
736 - | UnitA,
|
737 - | #[allow(missing_docs)] // documentation missing in model
|
738 - | UnitB,
|
739 - | }
|
740 - | impl UnitUnion {
|
741 - | /// Tries to convert the enum instance into [`UnitA`](crate::model::UnitUnion::UnitA), extracting the inner `()`.
|
742 - | /// Returns `Err(&Self)` if it can't be converted.
|
743 - | pub fn as_unit_a(&self) -> ::std::result::Result<(), &Self> {
|
744 - | if let UnitUnion::UnitA = &self {
|
745 - | ::std::result::Result::Ok(())
|
746 - | } else {
|
747 - | ::std::result::Result::Err(self)
|
748 - | }
|
749 - | }
|
750 - | /// Returns true if this is a [`UnitA`](crate::model::UnitUnion::UnitA).
|
751 - | pub fn is_unit_a(&self) -> bool {
|
752 - | self.as_unit_a().is_ok()
|
753 - | }
|
754 - | /// Tries to convert the enum instance into [`UnitB`](crate::model::UnitUnion::UnitB), extracting the inner `()`.
|
755 - | /// Returns `Err(&Self)` if it can't be converted.
|
756 - | pub fn as_unit_b(&self) -> ::std::result::Result<(), &Self> {
|
757 - | if let UnitUnion::UnitB = &self {
|
758 - | ::std::result::Result::Ok(())
|
759 - | } else {
|
760 - | ::std::result::Result::Err(self)
|
761 - | }
|
762 - | }
|
763 - | /// Returns true if this is a [`UnitB`](crate::model::UnitUnion::UnitB).
|
764 - | pub fn is_unit_b(&self) -> bool {
|
765 - | self.as_unit_b().is_ok()
|
766 - | }
|
767 - | }
|
768 - |
|
769 - | #[allow(missing_docs)] // documentation missing in model
|
770 - | #[derive(
|
771 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
772 - | )]
|
773 - | pub struct EmptyStruct {}
|
774 - | impl EmptyStruct {
|
775 - | /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
|
776 - | pub fn builder() -> crate::model::empty_struct::Builder {
|
777 - | crate::model::empty_struct::Builder::default()
|
778 - | }
|
779 - | }
|
780 - | impl crate::constrained::Constrained for crate::model::EmptyStruct {
|
781 - | type Unconstrained = crate::model::empty_struct::Builder;
|
782 - | }
|
783 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
784 - | pub mod validation_exception_field {
|
785 - |
|
786 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
787 - | /// Holds one variant for each of the ways the builder can fail.
|
788 - | #[non_exhaustive]
|
789 - | #[allow(clippy::enum_variant_names)]
|
790 - | pub enum ConstraintViolation {
|
791 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
792 - | MissingPath,
|
793 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
794 - | MissingMessage,
|
795 - | }
|
796 - | impl ::std::fmt::Display for ConstraintViolation {
|
797 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
798 - | match self {
|
799 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
800 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
801 - | }
|
802 - | }
|
803 - | }
|
804 - | impl ::std::error::Error for ConstraintViolation {}
|
805 - | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
806 - | type Error = ConstraintViolation;
|
807 - |
|
808 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
809 - | builder.build()
|
810 - | }
|
811 - | }
|
812 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
813 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
814 - | pub struct Builder {
|
815 - | pub(crate) path: ::std::option::Option<::std::string::String>,
|
816 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
817 - | }
|
818 - | impl Builder {
|
819 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
820 - | pub fn path(mut self, input: ::std::string::String) -> Self {
|
821 - | self.path = Some(input);
|
822 - | self
|
823 - | }
|
824 - | /// A detailed description of the validation failure.
|
825 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
826 - | self.message = Some(input);
|
827 - | self
|
828 - | }
|
829 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
830 - | ///
|
831 - | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
832 - | ///
|
833 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
834 - | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
835 - | self.build_enforcing_all_constraints()
|
836 - | }
|
837 - | fn build_enforcing_all_constraints(
|
838 - | self,
|
839 - | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
840 - | Ok(crate::model::ValidationExceptionField {
|
841 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
842 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
843 - | })
|
844 - | }
|
845 - | }
|
846 - | }
|
847 - | /// See [`Event`](crate::model::Event).
|
848 - | pub mod event {
|
849 - |
|
850 - | impl ::std::convert::From<Builder> for crate::model::Event {
|
851 - | fn from(builder: Builder) -> Self {
|
852 - | builder.build()
|
853 - | }
|
854 - | }
|
855 - | /// A builder for [`Event`](crate::model::Event).
|
856 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
857 - | pub struct Builder {}
|
858 - | impl Builder {
|
859 - | /// Consumes the builder and constructs a [`Event`](crate::model::Event).
|
860 - | pub fn build(self) -> crate::model::Event {
|
861 - | self.build_enforcing_all_constraints()
|
862 - | }
|
863 - | fn build_enforcing_all_constraints(self) -> crate::model::Event {
|
864 - | crate::model::Event {}
|
865 - | }
|
866 - | }
|
867 - | }
|
868 - | /// See [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
869 - | pub mod recursive_operation_input_output_nested1 {
|
870 - |
|
871 - | impl ::std::convert::From<Builder> for crate::model::RecursiveOperationInputOutputNested1 {
|
872 - | fn from(builder: Builder) -> Self {
|
873 - | builder.build()
|
874 - | }
|
875 - | }
|
876 - | /// A builder for [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
877 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
878 - | pub struct Builder {
|
879 - | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
880 - | pub(crate) nested: ::std::option::Option<
|
881 - | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
882 - | >,
|
883 - | pub(crate) variant: ::std::option::Option<crate::model::FooChoice>,
|
884 - | }
|
885 - | impl Builder {
|
886 - | #[allow(missing_docs)] // documentation missing in model
|
887 - | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
888 - | self.foo = input;
|
889 - | self
|
890 - | }
|
891 - | #[allow(missing_docs)] // documentation missing in model
|
892 - | pub(crate) fn set_foo(
|
893 - | mut self,
|
894 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
895 - | ) -> Self {
|
896 - | self.foo = input.map(|v| v.into());
|
897 - | self
|
898 - | }
|
899 - | #[allow(missing_docs)] // documentation missing in model
|
900 - | pub fn nested(
|
901 - | mut self,
|
902 - | input: ::std::option::Option<
|
903 - | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
904 - | >,
|
905 - | ) -> Self {
|
906 - | self.nested = input;
|
907 - | self
|
908 - | }
|
909 - | #[allow(missing_docs)] // documentation missing in model
|
910 - | pub(crate) fn set_nested(
|
911 - | mut self,
|
912 - | input: Option<
|
913 - | impl ::std::convert::Into<
|
914 - | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
915 - | >,
|
916 - | >,
|
917 - | ) -> Self {
|
918 - | self.nested = input.map(|v| v.into());
|
919 - | self
|
920 - | }
|
921 - | #[allow(missing_docs)] // documentation missing in model
|
922 - | pub fn variant(mut self, input: ::std::option::Option<crate::model::FooChoice>) -> Self {
|
923 - | self.variant = input;
|
924 - | self
|
925 - | }
|
926 - | #[allow(missing_docs)] // documentation missing in model
|
927 - | pub(crate) fn set_variant(
|
928 - | mut self,
|
929 - | input: Option<impl ::std::convert::Into<crate::model::FooChoice>>,
|
930 - | ) -> Self {
|
931 - | self.variant = input.map(|v| v.into());
|
932 - | self
|
933 - | }
|
934 - | /// Consumes the builder and constructs a [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
935 - | pub fn build(self) -> crate::model::RecursiveOperationInputOutputNested1 {
|
936 - | self.build_enforcing_all_constraints()
|
937 - | }
|
938 - | fn build_enforcing_all_constraints(
|
939 - | self,
|
940 - | ) -> crate::model::RecursiveOperationInputOutputNested1 {
|
941 - | crate::model::RecursiveOperationInputOutputNested1 {
|
942 - | foo: self.foo,
|
943 - | nested: self.nested,
|
944 - | variant: self.variant,
|
945 - | }
|
946 - | }
|
947 - | }
|
948 - | }
|
949 - | /// See [`RecursiveOperationInputOutputNested2`](crate::model::RecursiveOperationInputOutputNested2).
|
950 - | pub mod recursive_operation_input_output_nested2 {
|
951 - |
|
952 - | impl ::std::convert::From<Builder> for crate::model::RecursiveOperationInputOutputNested2 {
|
953 - | fn from(builder: Builder) -> Self {
|
954 - | builder.build()
|
955 - | }
|
956 - | }
|
957 - | /// A builder for [`RecursiveOperationInputOutputNested2`](crate::model::RecursiveOperationInputOutputNested2).
|
958 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
959 - | pub struct Builder {
|
960 - | pub(crate) bar: ::std::option::Option<::std::string::String>,
|
961 - | pub(crate) recursive_member:
|
962 - | ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
963 - | }
|
964 - | impl Builder {
|
965 - | #[allow(missing_docs)] // documentation missing in model
|
966 - | pub fn bar(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
967 - | self.bar = input;
|
968 - | self
|
969 - | }
|
970 - | #[allow(missing_docs)] // documentation missing in model
|
971 - | pub(crate) fn set_bar(
|
972 - | mut self,
|
973 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
974 - | ) -> Self {
|
975 - | self.bar = input.map(|v| v.into());
|
976 - | self
|
977 - | }
|
978 - | #[allow(missing_docs)] // documentation missing in model
|
979 - | pub fn recursive_member(
|
980 - | mut self,
|
981 - | input: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
982 - | ) -> Self {
|
983 - | self.recursive_member = input;
|
984 - | self
|
985 - | }
|
986 - | #[allow(missing_docs)] // documentation missing in model
|
987 - | pub(crate) fn set_recursive_member(
|
988 - | mut self,
|
989 - | input: Option<
|
990 - | impl ::std::convert::Into<crate::model::RecursiveOperationInputOutputNested1>,
|
991 - | >,
|
992 - | ) -> Self {
|
993 - | self.recursive_member = input.map(|v| v.into());
|
994 - | self
|
995 - | }
|
996 - | /// Consumes the builder and constructs a [`RecursiveOperationInputOutputNested2`](crate::model::RecursiveOperationInputOutputNested2).
|
997 - | pub fn build(self) -> crate::model::RecursiveOperationInputOutputNested2 {
|
998 - | self.build_enforcing_all_constraints()
|
999 - | }
|
1000 - | fn build_enforcing_all_constraints(
|
1001 - | self,
|
1002 - | ) -> crate::model::RecursiveOperationInputOutputNested2 {
|
1003 - | crate::model::RecursiveOperationInputOutputNested2 {
|
1004 - | bar: self.bar,
|
1005 - | recursive_member: self.recursive_member,
|
1006 - | }
|
1007 - | }
|
1008 - | }
|
720 + | impl crate::constrained::Constrained for crate::model::RecursiveOperationInputOutputNested2 {
|
721 + | type Unconstrained = crate::model::recursive_operation_input_output_nested2::Builder;
|
1009 722 | }
|
1010 - | pub mod complex_union {
|
1011 723 |
|
1012 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1013 - | #[allow(clippy::enum_variant_names)]
|
1014 - | pub enum ConstraintViolation {
|
1015 - | ComplexStruct(crate::model::complex_struct::ConstraintViolation),
|
1016 - | Structure(crate::model::simple_struct::ConstraintViolation),
|
1017 - | }
|
1018 - | impl ::std::fmt::Display for ConstraintViolation {
|
1019 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1020 - | match self {
|
1021 - | Self::ComplexStruct(inner) => write!(f, "{inner}"),
|
1022 - | Self::Structure(inner) => write!(f, "{inner}"),
|
1023 - | }
|
724 + | #[allow(missing_docs)] // documentation missing in model
|
725 + | #[derive(
|
726 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
727 + | )]
|
728 + | pub enum FooChoice {
|
729 + | #[allow(missing_docs)] // documentation missing in model
|
730 + | Choice1(::std::string::String),
|
731 + | #[allow(missing_docs)] // documentation missing in model
|
732 + | Choice2(::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested1>),
|
733 + | }
|
734 + | impl FooChoice {
|
735 + | /// Tries to convert the enum instance into [`Choice1`](crate::model::FooChoice::Choice1), extracting the inner [`String`](::std::string::String).
|
736 + | /// Returns `Err(&Self)` if it can't be converted.
|
737 + | pub fn as_choice1(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
738 + | if let FooChoice::Choice1(val) = &self {
|
739 + | ::std::result::Result::Ok(val)
|
740 + | } else {
|
741 + | ::std::result::Result::Err(self)
|
1024 742 | }
|
1025 743 | }
|
1026 - |
|
1027 - | impl ::std::error::Error for ConstraintViolation {}
|
1028 - | impl ConstraintViolation {
|
1029 - | pub(crate) fn as_validation_exception_field(
|
1030 - | self,
|
1031 - | path: ::std::string::String,
|
1032 - | ) -> crate::model::ValidationExceptionField {
|
1033 - | match self {
|
1034 - | Self::ComplexStruct(inner) => {
|
1035 - | inner.as_validation_exception_field(path + "/complexStruct")
|
1036 - | }
|
1037 - | Self::Structure(inner) => inner.as_validation_exception_field(path + "/structure"),
|
1038 - | }
|
744 + | /// Returns true if this is a [`Choice1`](crate::model::FooChoice::Choice1).
|
745 + | pub fn is_choice1(&self) -> bool {
|
746 + | self.as_choice1().is_ok()
|
747 + | }
|
748 + | /// Tries to convert the enum instance into [`Choice2`](crate::model::FooChoice::Choice2), extracting the inner [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
749 + | /// Returns `Err(&Self)` if it can't be converted.
|
750 + | pub fn as_choice2(
|
751 + | &self,
|
752 + | ) -> ::std::result::Result<
|
753 + | &::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested1>,
|
754 + | &Self,
|
755 + | > {
|
756 + | if let FooChoice::Choice2(val) = &self {
|
757 + | ::std::result::Result::Ok(val)
|
758 + | } else {
|
759 + | ::std::result::Result::Err(self)
|
1039 760 | }
|
1040 761 | }
|
762 + | /// Returns true if this is a [`Choice2`](crate::model::FooChoice::Choice2).
|
763 + | pub fn is_choice2(&self) -> bool {
|
764 + | self.as_choice2().is_ok()
|
765 + | }
|
1041 766 | }
|
1042 - | /// See [`Unit`](crate::model::Unit).
|
1043 - | pub mod unit {
|
1044 767 |
|
1045 - | impl ::std::convert::From<Builder> for crate::model::Unit {
|
1046 - | fn from(builder: Builder) -> Self {
|
1047 - | builder.build()
|
1048 - | }
|
1049 - | }
|
1050 - | /// A builder for [`Unit`](crate::model::Unit).
|
1051 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1052 - | pub struct Builder {}
|
1053 - | impl Builder {
|
1054 - | /// Consumes the builder and constructs a [`Unit`](crate::model::Unit).
|
1055 - | pub fn build(self) -> crate::model::Unit {
|
1056 - | self.build_enforcing_all_constraints()
|
1057 - | }
|
1058 - | fn build_enforcing_all_constraints(self) -> crate::model::Unit {
|
1059 - | crate::model::Unit {}
|
1060 - | }
|
768 + | #[allow(missing_docs)] // documentation missing in model
|
769 + | #[derive(
|
770 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
771 + | )]
|
772 + | pub struct Event {}
|
773 + | impl Event {
|
774 + | /// Creates a new builder-style object to manufacture [`Event`](crate::model::Event).
|
775 + | pub fn builder() -> crate::model::event::Builder {
|
776 + | crate::model::event::Builder::default()
|
1061 777 | }
|
1062 778 | }
|
779 + | impl crate::constrained::Constrained for crate::model::Event {
|
780 + | type Unconstrained = crate::model::event::Builder;
|
781 + | }
|
1063 782 | /// See [`SimpleStruct`](crate::model::SimpleStruct).
|
1064 783 | pub mod simple_struct {
|
1065 784 |
|
1066 785 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1067 786 | /// Holds one variant for each of the ways the builder can fail.
|
1068 787 | #[non_exhaustive]
|
1069 788 | #[allow(clippy::enum_variant_names)]
|
1070 789 | pub enum ConstraintViolation {
|
1071 790 | /// Constraint violation occurred building member `r#enum` when building `SimpleStruct`.
|
1072 791 | #[doc(hidden)]
|
1235 954 | }
|
1236 955 | #[allow(missing_docs)] // documentation missing in model
|
1237 956 | pub(crate) fn set_boolean(
|
1238 957 | mut self,
|
1239 958 | input: Option<impl ::std::convert::Into<bool>>,
|
1240 959 | ) -> Self {
|
1241 960 | self.boolean = input.map(|v| v.into());
|
1242 961 | self
|
1243 962 | }
|
1244 963 | #[allow(missing_docs)] // documentation missing in model
|
1245 - | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1246 - | self.string = input;
|
964 + | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
965 + | self.string = input;
|
966 + | self
|
967 + | }
|
968 + | #[allow(missing_docs)] // documentation missing in model
|
969 + | pub(crate) fn set_string(
|
970 + | mut self,
|
971 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
972 + | ) -> Self {
|
973 + | self.string = input.map(|v| v.into());
|
974 + | self
|
975 + | }
|
976 + | #[allow(missing_docs)] // documentation missing in model
|
977 + | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
978 + | self.byte = input;
|
979 + | self
|
980 + | }
|
981 + | #[allow(missing_docs)] // documentation missing in model
|
982 + | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
983 + | self.byte = input.map(|v| v.into());
|
984 + | self
|
985 + | }
|
986 + | #[allow(missing_docs)] // documentation missing in model
|
987 + | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
988 + | self.short = input;
|
989 + | self
|
990 + | }
|
991 + | #[allow(missing_docs)] // documentation missing in model
|
992 + | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
993 + | self.short = input.map(|v| v.into());
|
994 + | self
|
995 + | }
|
996 + | #[allow(missing_docs)] // documentation missing in model
|
997 + | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
998 + | self.integer = input;
|
999 + | self
|
1000 + | }
|
1001 + | #[allow(missing_docs)] // documentation missing in model
|
1002 + | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
1003 + | self.integer = input.map(|v| v.into());
|
1004 + | self
|
1005 + | }
|
1006 + | #[allow(missing_docs)] // documentation missing in model
|
1007 + | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
1008 + | self.long = input;
|
1009 + | self
|
1010 + | }
|
1011 + | #[allow(missing_docs)] // documentation missing in model
|
1012 + | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
1013 + | self.long = input.map(|v| v.into());
|
1014 + | self
|
1015 + | }
|
1016 + | #[allow(missing_docs)] // documentation missing in model
|
1017 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
1018 + | self.float = input;
|
1019 + | self
|
1020 + | }
|
1021 + | #[allow(missing_docs)] // documentation missing in model
|
1022 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
1023 + | self.float = input.map(|v| v.into());
|
1024 + | self
|
1025 + | }
|
1026 + | #[allow(missing_docs)] // documentation missing in model
|
1027 + | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
1028 + | self.double = input;
|
1029 + | self
|
1030 + | }
|
1031 + | #[allow(missing_docs)] // documentation missing in model
|
1032 + | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
1033 + | self.double = input.map(|v| v.into());
|
1034 + | self
|
1035 + | }
|
1036 + | #[allow(missing_docs)] // documentation missing in model
|
1037 + | pub fn timestamp(
|
1038 + | mut self,
|
1039 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1040 + | ) -> Self {
|
1041 + | self.timestamp = input;
|
1042 + | self
|
1043 + | }
|
1044 + | #[allow(missing_docs)] // documentation missing in model
|
1045 + | pub(crate) fn set_timestamp(
|
1046 + | mut self,
|
1047 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1048 + | ) -> Self {
|
1049 + | self.timestamp = input.map(|v| v.into());
|
1050 + | self
|
1051 + | }
|
1052 + | #[allow(missing_docs)] // documentation missing in model
|
1053 + | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
1054 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1055 + | self
|
1056 + | }
|
1057 + | #[allow(missing_docs)] // documentation missing in model
|
1058 + | pub(crate) fn set_enum(
|
1059 + | mut self,
|
1060 + | input: Option<
|
1061 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1062 + | >,
|
1063 + | ) -> Self {
|
1064 + | self.r#enum = input.map(|v| v.into());
|
1065 + | self
|
1066 + | }
|
1067 + | #[allow(missing_docs)] // documentation missing in model
|
1068 + | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
1069 + | self.required_blob = Some(input);
|
1070 + | self
|
1071 + | }
|
1072 + | #[allow(missing_docs)] // documentation missing in model
|
1073 + | pub(crate) fn set_required_blob(
|
1074 + | mut self,
|
1075 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
1076 + | ) -> Self {
|
1077 + | self.required_blob = Some(input.into());
|
1078 + | self
|
1079 + | }
|
1080 + | #[allow(missing_docs)] // documentation missing in model
|
1081 + | pub fn required_boolean(mut self, input: bool) -> Self {
|
1082 + | self.required_boolean = Some(input);
|
1083 + | self
|
1084 + | }
|
1085 + | #[allow(missing_docs)] // documentation missing in model
|
1086 + | pub(crate) fn set_required_boolean(
|
1087 + | mut self,
|
1088 + | input: impl ::std::convert::Into<bool>,
|
1089 + | ) -> Self {
|
1090 + | self.required_boolean = Some(input.into());
|
1091 + | self
|
1092 + | }
|
1093 + | #[allow(missing_docs)] // documentation missing in model
|
1094 + | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
1095 + | self.required_string = Some(input);
|
1096 + | self
|
1097 + | }
|
1098 + | #[allow(missing_docs)] // documentation missing in model
|
1099 + | pub(crate) fn set_required_string(
|
1100 + | mut self,
|
1101 + | input: impl ::std::convert::Into<::std::string::String>,
|
1102 + | ) -> Self {
|
1103 + | self.required_string = Some(input.into());
|
1104 + | self
|
1105 + | }
|
1106 + | #[allow(missing_docs)] // documentation missing in model
|
1107 + | pub fn required_byte(mut self, input: i8) -> Self {
|
1108 + | self.required_byte = Some(input);
|
1109 + | self
|
1110 + | }
|
1111 + | #[allow(missing_docs)] // documentation missing in model
|
1112 + | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
1113 + | self.required_byte = Some(input.into());
|
1114 + | self
|
1115 + | }
|
1116 + | #[allow(missing_docs)] // documentation missing in model
|
1117 + | pub fn required_short(mut self, input: i16) -> Self {
|
1118 + | self.required_short = Some(input);
|
1119 + | self
|
1120 + | }
|
1121 + | #[allow(missing_docs)] // documentation missing in model
|
1122 + | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
1123 + | self.required_short = Some(input.into());
|
1124 + | self
|
1125 + | }
|
1126 + | #[allow(missing_docs)] // documentation missing in model
|
1127 + | pub fn required_integer(mut self, input: i32) -> Self {
|
1128 + | self.required_integer = Some(input);
|
1247 1129 | self
|
1248 1130 | }
|
1249 1131 | #[allow(missing_docs)] // documentation missing in model
|
1250 - | pub(crate) fn set_string(
|
1132 + | pub(crate) fn set_required_integer(
|
1251 1133 | mut self,
|
1252 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1134 + | input: impl ::std::convert::Into<i32>,
|
1253 1135 | ) -> Self {
|
1254 - | self.string = input.map(|v| v.into());
|
1136 + | self.required_integer = Some(input.into());
|
1255 1137 | self
|
1256 1138 | }
|
1257 1139 | #[allow(missing_docs)] // documentation missing in model
|
1258 - | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
1259 - | self.byte = input;
|
1140 + | pub fn required_long(mut self, input: i64) -> Self {
|
1141 + | self.required_long = Some(input);
|
1260 1142 | self
|
1261 1143 | }
|
1262 1144 | #[allow(missing_docs)] // documentation missing in model
|
1263 - | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
1264 - | self.byte = input.map(|v| v.into());
|
1145 + | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
1146 + | self.required_long = Some(input.into());
|
1265 1147 | self
|
1266 1148 | }
|
1267 1149 | #[allow(missing_docs)] // documentation missing in model
|
1268 - | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
1269 - | self.short = input;
|
1150 + | pub fn required_float(mut self, input: f32) -> Self {
|
1151 + | self.required_float = Some(input);
|
1270 1152 | self
|
1271 1153 | }
|
1272 1154 | #[allow(missing_docs)] // documentation missing in model
|
1273 - | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
1274 - | self.short = input.map(|v| v.into());
|
1155 + | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
1156 + | self.required_float = Some(input.into());
|
1275 1157 | self
|
1276 1158 | }
|
1277 1159 | #[allow(missing_docs)] // documentation missing in model
|
1278 - | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
1279 - | self.integer = input;
|
1160 + | pub fn required_double(mut self, input: f64) -> Self {
|
1161 + | self.required_double = Some(input);
|
1280 1162 | self
|
1281 1163 | }
|
1282 1164 | #[allow(missing_docs)] // documentation missing in model
|
1283 - | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
1284 - | self.integer = input.map(|v| v.into());
|
1165 + | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
1166 + | self.required_double = Some(input.into());
|
1285 1167 | self
|
1286 1168 | }
|
1287 1169 | #[allow(missing_docs)] // documentation missing in model
|
1288 - | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
1289 - | self.long = input;
|
1170 + | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
1171 + | self.required_timestamp = Some(input);
|
1290 1172 | self
|
1291 1173 | }
|
1292 1174 | #[allow(missing_docs)] // documentation missing in model
|
1293 - | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
1294 - | self.long = input.map(|v| v.into());
|
1175 + | pub(crate) fn set_required_timestamp(
|
1176 + | mut self,
|
1177 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
1178 + | ) -> Self {
|
1179 + | self.required_timestamp = Some(input.into());
|
1295 1180 | self
|
1296 1181 | }
|
1297 1182 | #[allow(missing_docs)] // documentation missing in model
|
1298 - | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
1299 - | self.float = input;
|
1183 + | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
1184 + | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1300 1185 | self
|
1301 1186 | }
|
1302 1187 | #[allow(missing_docs)] // documentation missing in model
|
1303 - | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
1304 - | self.float = input.map(|v| v.into());
|
1188 + | pub(crate) fn set_required_enum(
|
1189 + | mut self,
|
1190 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1191 + | ) -> Self {
|
1192 + | self.required_enum = Some(input.into());
|
1305 1193 | self
|
1306 1194 | }
|
1307 - | #[allow(missing_docs)] // documentation missing in model
|
1308 - | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
1309 - | self.double = input;
|
1310 - | self
|
1195 + | /// Consumes the builder and constructs a [`SimpleStruct`](crate::model::SimpleStruct).
|
1196 + | ///
|
1197 + | /// The builder fails to construct a [`SimpleStruct`](crate::model::SimpleStruct) if a [`ConstraintViolation`] occurs.
|
1198 + | ///
|
1199 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1200 + | pub fn build(self) -> Result<crate::model::SimpleStruct, ConstraintViolation> {
|
1201 + | self.build_enforcing_all_constraints()
|
1311 1202 | }
|
1312 - | #[allow(missing_docs)] // documentation missing in model
|
1313 - | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
1314 - | self.double = input.map(|v| v.into());
|
1315 - | self
|
1203 + | fn build_enforcing_all_constraints(
|
1204 + | self,
|
1205 + | ) -> Result<crate::model::SimpleStruct, ConstraintViolation> {
|
1206 + | Ok(crate::model::SimpleStruct {
|
1207 + | blob: self.blob,
|
1208 + | boolean: self.boolean,
|
1209 + | string: self.string,
|
1210 + | byte: self.byte,
|
1211 + | short: self.short,
|
1212 + | integer: self.integer,
|
1213 + | long: self.long,
|
1214 + | float: self.float,
|
1215 + | double: self.double,
|
1216 + | timestamp: self.timestamp,
|
1217 + | r#enum: self
|
1218 + | .r#enum
|
1219 + | .map(|v| match v {
|
1220 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1221 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1222 + | })
|
1223 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
1224 + | .transpose()?,
|
1225 + | required_blob: self
|
1226 + | .required_blob
|
1227 + | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
1228 + | required_boolean: self
|
1229 + | .required_boolean
|
1230 + | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
1231 + | required_string: self
|
1232 + | .required_string
|
1233 + | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
1234 + | required_byte: self
|
1235 + | .required_byte
|
1236 + | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
1237 + | required_short: self
|
1238 + | .required_short
|
1239 + | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
1240 + | required_integer: self
|
1241 + | .required_integer
|
1242 + | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
1243 + | required_long: self
|
1244 + | .required_long
|
1245 + | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
1246 + | required_float: self
|
1247 + | .required_float
|
1248 + | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
1249 + | required_double: self
|
1250 + | .required_double
|
1251 + | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
1252 + | required_timestamp: self
|
1253 + | .required_timestamp
|
1254 + | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
1255 + | required_enum: self
|
1256 + | .required_enum
|
1257 + | .map(|v| match v {
|
1258 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1259 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1260 + | })
|
1261 + | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
1262 + | .transpose()?
|
1263 + | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
1264 + | })
|
1265 + | }
|
1266 + | }
|
1267 + | }
|
1268 + | /// See [`EmptyStruct`](crate::model::EmptyStruct).
|
1269 + | pub mod empty_struct {
|
1270 + |
|
1271 + | impl ::std::convert::From<Builder> for crate::model::EmptyStruct {
|
1272 + | fn from(builder: Builder) -> Self {
|
1273 + | builder.build()
|
1274 + | }
|
1275 + | }
|
1276 + | /// A builder for [`EmptyStruct`](crate::model::EmptyStruct).
|
1277 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1278 + | pub struct Builder {}
|
1279 + | impl Builder {
|
1280 + | /// Consumes the builder and constructs a [`EmptyStruct`](crate::model::EmptyStruct).
|
1281 + | pub fn build(self) -> crate::model::EmptyStruct {
|
1282 + | self.build_enforcing_all_constraints()
|
1283 + | }
|
1284 + | fn build_enforcing_all_constraints(self) -> crate::model::EmptyStruct {
|
1285 + | crate::model::EmptyStruct {}
|
1286 + | }
|
1287 + | }
|
1288 + | }
|
1289 + | pub mod struct_list {
|
1290 + |
|
1291 + | #[allow(clippy::enum_variant_names)]
|
1292 + | #[derive(Debug, PartialEq)]
|
1293 + | pub enum ConstraintViolation {
|
1294 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
1295 + | /// The first component of the tuple is the index in the collection where the
|
1296 + | /// first constraint violation was found.
|
1297 + | #[doc(hidden)]
|
1298 + | Member(usize, crate::model::simple_struct::ConstraintViolation),
|
1299 + | }
|
1300 + |
|
1301 + | impl ::std::fmt::Display for ConstraintViolation {
|
1302 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1303 + | let message = match self {
|
1304 + | Self::Member(index, failing_member) => format!(
|
1305 + | "Value at index {index} failed to satisfy constraint. {}",
|
1306 + | failing_member
|
1307 + | ),
|
1308 + | };
|
1309 + | write!(f, "{message}")
|
1310 + | }
|
1311 + | }
|
1312 + |
|
1313 + | impl ::std::error::Error for ConstraintViolation {}
|
1314 + | impl ConstraintViolation {
|
1315 + | pub(crate) fn as_validation_exception_field(
|
1316 + | self,
|
1317 + | path: ::std::string::String,
|
1318 + | ) -> crate::model::ValidationExceptionField {
|
1319 + | match self {
|
1320 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
1321 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
1322 + | }
|
1323 + | }
|
1324 + | }
|
1325 + | }
|
1326 + | pub mod complex_list {
|
1327 + |
|
1328 + | #[allow(clippy::enum_variant_names)]
|
1329 + | #[derive(Debug, PartialEq)]
|
1330 + | pub enum ConstraintViolation {
|
1331 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
1332 + | /// The first component of the tuple is the index in the collection where the
|
1333 + | /// first constraint violation was found.
|
1334 + | #[doc(hidden)]
|
1335 + | Member(
|
1336 + | usize,
|
1337 + | ::std::boxed::Box<crate::model::complex_map::ConstraintViolation>,
|
1338 + | ),
|
1339 + | }
|
1340 + |
|
1341 + | impl ::std::fmt::Display for ConstraintViolation {
|
1342 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1343 + | let message = match self {
|
1344 + | Self::Member(index, failing_member) => format!(
|
1345 + | "Value at index {index} failed to satisfy constraint. {}",
|
1346 + | failing_member
|
1347 + | ),
|
1348 + | };
|
1349 + | write!(f, "{message}")
|
1350 + | }
|
1351 + | }
|
1352 + |
|
1353 + | impl ::std::error::Error for ConstraintViolation {}
|
1354 + | impl ConstraintViolation {
|
1355 + | pub(crate) fn as_validation_exception_field(
|
1356 + | self,
|
1357 + | path: ::std::string::String,
|
1358 + | ) -> crate::model::ValidationExceptionField {
|
1359 + | match self {
|
1360 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
1361 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
1362 + | }
|
1363 + | }
|
1364 + | }
|
1365 + | }
|
1366 + | pub mod complex_map {
|
1367 + |
|
1368 + | #[allow(clippy::enum_variant_names)]
|
1369 + | #[derive(Debug, PartialEq)]
|
1370 + | pub enum ConstraintViolation {
|
1371 + | #[doc(hidden)]
|
1372 + | Value(
|
1373 + | ::std::string::String,
|
1374 + | ::std::boxed::Box<crate::model::complex_union::ConstraintViolation>,
|
1375 + | ),
|
1376 + | }
|
1377 + |
|
1378 + | impl ::std::fmt::Display for ConstraintViolation {
|
1379 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1380 + | match self {
|
1381 + | Self::Value(_, value_constraint_violation) => {
|
1382 + | write!(f, "{}", value_constraint_violation)
|
1383 + | }
|
1384 + | }
|
1316 1385 | }
|
1317 - | #[allow(missing_docs)] // documentation missing in model
|
1318 - | pub fn timestamp(
|
1319 - | mut self,
|
1320 - | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1321 - | ) -> Self {
|
1322 - | self.timestamp = input;
|
1323 - | self
|
1386 + | }
|
1387 + |
|
1388 + | impl ::std::error::Error for ConstraintViolation {}
|
1389 + | impl ConstraintViolation {
|
1390 + | pub(crate) fn as_validation_exception_field(
|
1391 + | self,
|
1392 + | path: ::std::string::String,
|
1393 + | ) -> crate::model::ValidationExceptionField {
|
1394 + | match self {
|
1395 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
1396 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
1397 + | }
|
1324 1398 | }
|
1325 - | #[allow(missing_docs)] // documentation missing in model
|
1326 - | pub(crate) fn set_timestamp(
|
1327 - | mut self,
|
1328 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1329 - | ) -> Self {
|
1330 - | self.timestamp = input.map(|v| v.into());
|
1331 - | self
|
1399 + | }
|
1400 + | }
|
1401 + | pub mod complex_union {
|
1402 + |
|
1403 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1404 + | #[allow(clippy::enum_variant_names)]
|
1405 + | pub enum ConstraintViolation {
|
1406 + | ComplexStruct(crate::model::complex_struct::ConstraintViolation),
|
1407 + | Structure(crate::model::simple_struct::ConstraintViolation),
|
1408 + | }
|
1409 + | impl ::std::fmt::Display for ConstraintViolation {
|
1410 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1411 + | match self {
|
1412 + | Self::ComplexStruct(inner) => write!(f, "{inner}"),
|
1413 + | Self::Structure(inner) => write!(f, "{inner}"),
|
1414 + | }
|
1332 1415 | }
|
1333 - | #[allow(missing_docs)] // documentation missing in model
|
1334 - | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
1335 - | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1336 - | self
|
1416 + | }
|
1417 + |
|
1418 + | impl ::std::error::Error for ConstraintViolation {}
|
1419 + | impl ConstraintViolation {
|
1420 + | pub(crate) fn as_validation_exception_field(
|
1421 + | self,
|
1422 + | path: ::std::string::String,
|
1423 + | ) -> crate::model::ValidationExceptionField {
|
1424 + | match self {
|
1425 + | Self::ComplexStruct(inner) => {
|
1426 + | inner.as_validation_exception_field(path + "/complexStruct")
|
1427 + | }
|
1428 + | Self::Structure(inner) => inner.as_validation_exception_field(path + "/structure"),
|
1429 + | }
|
1337 1430 | }
|
1338 - | #[allow(missing_docs)] // documentation missing in model
|
1339 - | pub(crate) fn set_enum(
|
1340 - | mut self,
|
1341 - | input: Option<
|
1342 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1343 - | >,
|
1344 - | ) -> Self {
|
1345 - | self.r#enum = input.map(|v| v.into());
|
1346 - | self
|
1431 + | }
|
1432 + | }
|
1433 + | /// See [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
1434 + | pub mod recursive_operation_input_output_nested1 {
|
1435 + |
|
1436 + | impl ::std::convert::From<Builder> for crate::model::RecursiveOperationInputOutputNested1 {
|
1437 + | fn from(builder: Builder) -> Self {
|
1438 + | builder.build()
|
1347 1439 | }
|
1440 + | }
|
1441 + | /// A builder for [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
1442 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1443 + | pub struct Builder {
|
1444 + | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
1445 + | pub(crate) nested: ::std::option::Option<
|
1446 + | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
1447 + | >,
|
1448 + | pub(crate) variant: ::std::option::Option<crate::model::FooChoice>,
|
1449 + | }
|
1450 + | impl Builder {
|
1348 1451 | #[allow(missing_docs)] // documentation missing in model
|
1349 - | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
1350 - | self.required_blob = Some(input);
|
1452 + | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1453 + | self.foo = input;
|
1351 1454 | self
|
1352 1455 | }
|
1353 1456 | #[allow(missing_docs)] // documentation missing in model
|
1354 - | pub(crate) fn set_required_blob(
|
1457 + | pub(crate) fn set_foo(
|
1355 1458 | mut self,
|
1356 - | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
1459 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1357 1460 | ) -> Self {
|
1358 - | self.required_blob = Some(input.into());
|
1359 - | self
|
1360 - | }
|
1361 - | #[allow(missing_docs)] // documentation missing in model
|
1362 - | pub fn required_boolean(mut self, input: bool) -> Self {
|
1363 - | self.required_boolean = Some(input);
|
1461 + | self.foo = input.map(|v| v.into());
|
1364 1462 | self
|
1365 1463 | }
|
1366 1464 | #[allow(missing_docs)] // documentation missing in model
|
1367 - | pub(crate) fn set_required_boolean(
|
1465 + | pub fn nested(
|
1368 1466 | mut self,
|
1369 - | input: impl ::std::convert::Into<bool>,
|
1467 + | input: ::std::option::Option<
|
1468 + | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
1469 + | >,
|
1370 1470 | ) -> Self {
|
1371 - | self.required_boolean = Some(input.into());
|
1372 - | self
|
1373 - | }
|
1374 - | #[allow(missing_docs)] // documentation missing in model
|
1375 - | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
1376 - | self.required_string = Some(input);
|
1471 + | self.nested = input;
|
1377 1472 | self
|
1378 1473 | }
|
1379 1474 | #[allow(missing_docs)] // documentation missing in model
|
1380 - | pub(crate) fn set_required_string(
|
1475 + | pub(crate) fn set_nested(
|
1381 1476 | mut self,
|
1382 - | input: impl ::std::convert::Into<::std::string::String>,
|
1477 + | input: Option<
|
1478 + | impl ::std::convert::Into<
|
1479 + | ::std::boxed::Box<crate::model::RecursiveOperationInputOutputNested2>,
|
1480 + | >,
|
1481 + | >,
|
1383 1482 | ) -> Self {
|
1384 - | self.required_string = Some(input.into());
|
1385 - | self
|
1386 - | }
|
1387 - | #[allow(missing_docs)] // documentation missing in model
|
1388 - | pub fn required_byte(mut self, input: i8) -> Self {
|
1389 - | self.required_byte = Some(input);
|
1390 - | self
|
1391 - | }
|
1392 - | #[allow(missing_docs)] // documentation missing in model
|
1393 - | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
1394 - | self.required_byte = Some(input.into());
|
1395 - | self
|
1396 - | }
|
1397 - | #[allow(missing_docs)] // documentation missing in model
|
1398 - | pub fn required_short(mut self, input: i16) -> Self {
|
1399 - | self.required_short = Some(input);
|
1400 - | self
|
1401 - | }
|
1402 - | #[allow(missing_docs)] // documentation missing in model
|
1403 - | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
1404 - | self.required_short = Some(input.into());
|
1483 + | self.nested = input.map(|v| v.into());
|
1405 1484 | self
|
1406 1485 | }
|
1407 1486 | #[allow(missing_docs)] // documentation missing in model
|
1408 - | pub fn required_integer(mut self, input: i32) -> Self {
|
1409 - | self.required_integer = Some(input);
|
1487 + | pub fn variant(mut self, input: ::std::option::Option<crate::model::FooChoice>) -> Self {
|
1488 + | self.variant = input;
|
1410 1489 | self
|
1411 1490 | }
|
1412 1491 | #[allow(missing_docs)] // documentation missing in model
|
1413 - | pub(crate) fn set_required_integer(
|
1492 + | pub(crate) fn set_variant(
|
1414 1493 | mut self,
|
1415 - | input: impl ::std::convert::Into<i32>,
|
1494 + | input: Option<impl ::std::convert::Into<crate::model::FooChoice>>,
|
1416 1495 | ) -> Self {
|
1417 - | self.required_integer = Some(input.into());
|
1418 - | self
|
1419 - | }
|
1420 - | #[allow(missing_docs)] // documentation missing in model
|
1421 - | pub fn required_long(mut self, input: i64) -> Self {
|
1422 - | self.required_long = Some(input);
|
1423 - | self
|
1424 - | }
|
1425 - | #[allow(missing_docs)] // documentation missing in model
|
1426 - | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
1427 - | self.required_long = Some(input.into());
|
1428 - | self
|
1429 - | }
|
1430 - | #[allow(missing_docs)] // documentation missing in model
|
1431 - | pub fn required_float(mut self, input: f32) -> Self {
|
1432 - | self.required_float = Some(input);
|
1433 - | self
|
1434 - | }
|
1435 - | #[allow(missing_docs)] // documentation missing in model
|
1436 - | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
1437 - | self.required_float = Some(input.into());
|
1496 + | self.variant = input.map(|v| v.into());
|
1438 1497 | self
|
1439 1498 | }
|
1440 - | #[allow(missing_docs)] // documentation missing in model
|
1441 - | pub fn required_double(mut self, input: f64) -> Self {
|
1442 - | self.required_double = Some(input);
|
1443 - | self
|
1499 + | /// Consumes the builder and constructs a [`RecursiveOperationInputOutputNested1`](crate::model::RecursiveOperationInputOutputNested1).
|
1500 + | pub fn build(self) -> crate::model::RecursiveOperationInputOutputNested1 {
|
1501 + | self.build_enforcing_all_constraints()
|
1444 1502 | }
|
1445 - | #[allow(missing_docs)] // documentation missing in model
|
1446 - | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
1447 - | self.required_double = Some(input.into());
|
1448 - | self
|
1503 + | fn build_enforcing_all_constraints(
|
1504 + | self,
|
1505 + | ) -> crate::model::RecursiveOperationInputOutputNested1 {
|
1506 + | crate::model::RecursiveOperationInputOutputNested1 {
|
1507 + | foo: self.foo,
|
1508 + | nested: self.nested,
|
1509 + | variant: self.variant,
|
1510 + | }
|
1449 1511 | }
|
1450 - | #[allow(missing_docs)] // documentation missing in model
|
1451 - | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
1452 - | self.required_timestamp = Some(input);
|
1453 - | self
|
1512 + | }
|
1513 + | }
|
1514 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1515 + | pub mod validation_exception_field {
|
1516 + |
|
1517 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1518 + | /// Holds one variant for each of the ways the builder can fail.
|
1519 + | #[non_exhaustive]
|
1520 + | #[allow(clippy::enum_variant_names)]
|
1521 + | pub enum ConstraintViolation {
|
1522 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
1523 + | MissingPath,
|
1524 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
1525 + | MissingMessage,
|
1526 + | }
|
1527 + | impl ::std::fmt::Display for ConstraintViolation {
|
1528 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1529 + | match self {
|
1530 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
1531 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
1532 + | }
|
1454 1533 | }
|
1455 - | #[allow(missing_docs)] // documentation missing in model
|
1456 - | pub(crate) fn set_required_timestamp(
|
1457 - | mut self,
|
1458 - | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
1459 - | ) -> Self {
|
1460 - | self.required_timestamp = Some(input.into());
|
1461 - | self
|
1534 + | }
|
1535 + | impl ::std::error::Error for ConstraintViolation {}
|
1536 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
1537 + | type Error = ConstraintViolation;
|
1538 + |
|
1539 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1540 + | builder.build()
|
1462 1541 | }
|
1463 - | #[allow(missing_docs)] // documentation missing in model
|
1464 - | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
1465 - | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1542 + | }
|
1543 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1544 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1545 + | pub struct Builder {
|
1546 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
1547 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1548 + | }
|
1549 + | impl Builder {
|
1550 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
1551 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
1552 + | self.path = Some(input);
|
1466 1553 | self
|
1467 1554 | }
|
1468 - | #[allow(missing_docs)] // documentation missing in model
|
1469 - | pub(crate) fn set_required_enum(
|
1470 - | mut self,
|
1471 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1472 - | ) -> Self {
|
1473 - | self.required_enum = Some(input.into());
|
1555 + | /// A detailed description of the validation failure.
|
1556 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1557 + | self.message = Some(input);
|
1474 1558 | self
|
1475 1559 | }
|
1476 - | /// Consumes the builder and constructs a [`SimpleStruct`](crate::model::SimpleStruct).
|
1560 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1477 1561 | ///
|
1478 - | /// The builder fails to construct a [`SimpleStruct`](crate::model::SimpleStruct) if a [`ConstraintViolation`] occurs.
|
1562 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
1479 1563 | ///
|
1480 1564 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1481 - | pub fn build(self) -> Result<crate::model::SimpleStruct, ConstraintViolation> {
|
1565 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
1482 1566 | self.build_enforcing_all_constraints()
|
1483 1567 | }
|
1484 1568 | fn build_enforcing_all_constraints(
|
1485 1569 | self,
|
1486 - | ) -> Result<crate::model::SimpleStruct, ConstraintViolation> {
|
1487 - | Ok(crate::model::SimpleStruct {
|
1488 - | blob: self.blob,
|
1489 - | boolean: self.boolean,
|
1490 - | string: self.string,
|
1491 - | byte: self.byte,
|
1492 - | short: self.short,
|
1493 - | integer: self.integer,
|
1494 - | long: self.long,
|
1495 - | float: self.float,
|
1496 - | double: self.double,
|
1497 - | timestamp: self.timestamp,
|
1498 - | r#enum: self
|
1499 - | .r#enum
|
1500 - | .map(|v| match v {
|
1501 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1502 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1503 - | })
|
1504 - | .map(|res| res.map_err(ConstraintViolation::Enum))
|
1505 - | .transpose()?,
|
1506 - | required_blob: self
|
1507 - | .required_blob
|
1508 - | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
1509 - | required_boolean: self
|
1510 - | .required_boolean
|
1511 - | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
1512 - | required_string: self
|
1513 - | .required_string
|
1514 - | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
1515 - | required_byte: self
|
1516 - | .required_byte
|
1517 - | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
1518 - | required_short: self
|
1519 - | .required_short
|
1520 - | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
1521 - | required_integer: self
|
1522 - | .required_integer
|
1523 - | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
1524 - | required_long: self
|
1525 - | .required_long
|
1526 - | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
1527 - | required_float: self
|
1528 - | .required_float
|
1529 - | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
1530 - | required_double: self
|
1531 - | .required_double
|
1532 - | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
1533 - | required_timestamp: self
|
1534 - | .required_timestamp
|
1535 - | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
1536 - | required_enum: self
|
1537 - | .required_enum
|
1538 - | .map(|v| match v {
|
1539 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1540 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1541 - | })
|
1542 - | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
1543 - | .transpose()?
|
1544 - | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
1570 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
1571 + | Ok(crate::model::ValidationExceptionField {
|
1572 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
1573 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
1545 1574 | })
|
1546 1575 | }
|
1547 1576 | }
|
1548 1577 | }
|
1578 + | /// See [`Unit`](crate::model::Unit).
|
1579 + | pub mod unit {
|
1580 + |
|
1581 + | impl ::std::convert::From<Builder> for crate::model::Unit {
|
1582 + | fn from(builder: Builder) -> Self {
|
1583 + | builder.build()
|
1584 + | }
|
1585 + | }
|
1586 + | /// A builder for [`Unit`](crate::model::Unit).
|
1587 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1588 + | pub struct Builder {}
|
1589 + | impl Builder {
|
1590 + | /// Consumes the builder and constructs a [`Unit`](crate::model::Unit).
|
1591 + | pub fn build(self) -> crate::model::Unit {
|
1592 + | self.build_enforcing_all_constraints()
|
1593 + | }
|
1594 + | fn build_enforcing_all_constraints(self) -> crate::model::Unit {
|
1595 + | crate::model::Unit {}
|
1596 + | }
|
1597 + | }
|
1598 + | }
|
1549 1599 | /// See [`ComplexStruct`](crate::model::ComplexStruct).
|
1550 1600 | pub mod complex_struct {
|
1551 1601 |
|
1552 1602 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1553 1603 | /// Holds one variant for each of the ways the builder can fail.
|
1554 1604 | #[non_exhaustive]
|
1555 1605 | #[allow(clippy::enum_variant_names)]
|
1556 1606 | pub enum ConstraintViolation {
|
1557 1607 | /// Constraint violation occurred building member `structure` when building `ComplexStruct`.
|
1558 1608 | #[doc(hidden)]
|