1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
4 + | pub struct SensitiveValidationInput {
|
5 + | #[allow(missing_docs)] // documentation missing in model
|
6 + | pub string: ::std::option::Option<crate::model::SensitivePatternString>,
|
7 + | }
|
8 + | impl SensitiveValidationInput {
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub fn string(&self) -> ::std::option::Option<&crate::model::SensitivePatternString> {
|
11 + | self.string.as_ref()
|
12 + | }
|
13 + | }
|
14 + | impl ::std::fmt::Debug for SensitiveValidationInput {
|
15 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
16 + | let mut formatter = f.debug_struct("SensitiveValidationInput");
|
17 + | formatter.field("string", &"*** Sensitive Data Redacted ***");
|
18 + | formatter.finish()
|
19 + | }
|
20 + | }
|
21 + | impl SensitiveValidationInput {
|
22 + | /// Creates a new builder-style object to manufacture [`SensitiveValidationInput`](crate::input::SensitiveValidationInput).
|
23 + | pub fn builder() -> crate::input::sensitive_validation_input::Builder {
|
24 + | crate::input::sensitive_validation_input::Builder::default()
|
25 + | }
|
26 + | }
|
27 + | impl crate::constrained::Constrained for crate::input::SensitiveValidationInput {
|
28 + | type Unconstrained = crate::input::sensitive_validation_input::Builder;
|
29 + | }
|
30 + |
|
31 + | #[allow(missing_docs)] // documentation missing in model
|
32 + | #[derive(
|
33 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
34 + | )]
|
35 + | pub struct RecursiveStructuresInput {
|
36 + | #[allow(missing_docs)] // documentation missing in model
|
37 + | pub union: ::std::option::Option<crate::model::RecursiveUnionOne>,
|
38 + | }
|
39 + | impl RecursiveStructuresInput {
|
40 + | #[allow(missing_docs)] // documentation missing in model
|
41 + | pub fn union(&self) -> ::std::option::Option<&crate::model::RecursiveUnionOne> {
|
42 + | self.union.as_ref()
|
43 + | }
|
44 + | }
|
45 + | impl RecursiveStructuresInput {
|
46 + | /// Creates a new builder-style object to manufacture [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput).
|
47 + | pub fn builder() -> crate::input::recursive_structures_input::Builder {
|
48 + | crate::input::recursive_structures_input::Builder::default()
|
49 + | }
|
50 + | }
|
51 + | impl crate::constrained::Constrained for crate::input::RecursiveStructuresInput {
|
52 + | type Unconstrained = crate::input::recursive_structures_input::Builder;
|
53 + | }
|
54 + |
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | #[derive(
|
57 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
58 + | )]
|
59 + | pub struct MalformedUniqueItemsInput {
|
60 + | #[allow(missing_docs)] // documentation missing in model
|
61 + | pub blob_list: ::std::option::Option<crate::model::BlobSet>,
|
62 + | #[allow(missing_docs)] // documentation missing in model
|
63 + | pub boolean_list: ::std::option::Option<crate::model::BooleanSet>,
|
64 + | #[allow(missing_docs)] // documentation missing in model
|
65 + | pub string_list: ::std::option::Option<crate::model::StringSet>,
|
66 + | #[allow(missing_docs)] // documentation missing in model
|
67 + | pub byte_list: ::std::option::Option<crate::model::ByteSet>,
|
68 + | #[allow(missing_docs)] // documentation missing in model
|
69 + | pub short_list: ::std::option::Option<crate::model::ShortSet>,
|
70 + | #[allow(missing_docs)] // documentation missing in model
|
71 + | pub integer_list: ::std::option::Option<crate::model::IntegerSet>,
|
72 + | #[allow(missing_docs)] // documentation missing in model
|
73 + | pub long_list: ::std::option::Option<crate::model::LongSet>,
|
74 + | #[allow(missing_docs)] // documentation missing in model
|
75 + | pub timestamp_list: ::std::option::Option<crate::model::TimestampSet>,
|
76 + | #[allow(missing_docs)] // documentation missing in model
|
77 + | pub date_time_list: ::std::option::Option<crate::model::DateTimeSet>,
|
78 + | #[allow(missing_docs)] // documentation missing in model
|
79 + | pub http_date_list: ::std::option::Option<crate::model::HttpDateSet>,
|
80 + | #[allow(missing_docs)] // documentation missing in model
|
81 + | pub enum_list: ::std::option::Option<crate::model::FooEnumSet>,
|
82 + | #[allow(missing_docs)] // documentation missing in model
|
83 + | pub int_enum_list: ::std::option::Option<crate::model::IntegerEnumSet>,
|
84 + | #[allow(missing_docs)] // documentation missing in model
|
85 + | pub list_list: ::std::option::Option<crate::model::ListSet>,
|
86 + | #[allow(missing_docs)] // documentation missing in model
|
87 + | pub structure_list: ::std::option::Option<crate::model::StructureSet>,
|
88 + | #[allow(missing_docs)] // documentation missing in model
|
89 + | pub structure_list_with_no_key: ::std::option::Option<crate::model::StructureSetWithNoKey>,
|
90 + | #[allow(missing_docs)] // documentation missing in model
|
91 + | pub union_list: ::std::option::Option<crate::model::UnionSet>,
|
92 + | }
|
93 + | impl MalformedUniqueItemsInput {
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | pub fn blob_list(&self) -> ::std::option::Option<&crate::model::BlobSet> {
|
96 + | self.blob_list.as_ref()
|
97 + | }
|
98 + | #[allow(missing_docs)] // documentation missing in model
|
99 + | pub fn boolean_list(&self) -> ::std::option::Option<&crate::model::BooleanSet> {
|
100 + | self.boolean_list.as_ref()
|
101 + | }
|
102 + | #[allow(missing_docs)] // documentation missing in model
|
103 + | pub fn string_list(&self) -> ::std::option::Option<&crate::model::StringSet> {
|
104 + | self.string_list.as_ref()
|
105 + | }
|
106 + | #[allow(missing_docs)] // documentation missing in model
|
107 + | pub fn byte_list(&self) -> ::std::option::Option<&crate::model::ByteSet> {
|
108 + | self.byte_list.as_ref()
|
109 + | }
|
110 + | #[allow(missing_docs)] // documentation missing in model
|
111 + | pub fn short_list(&self) -> ::std::option::Option<&crate::model::ShortSet> {
|
112 + | self.short_list.as_ref()
|
113 + | }
|
114 + | #[allow(missing_docs)] // documentation missing in model
|
115 + | pub fn integer_list(&self) -> ::std::option::Option<&crate::model::IntegerSet> {
|
116 + | self.integer_list.as_ref()
|
117 + | }
|
118 + | #[allow(missing_docs)] // documentation missing in model
|
119 + | pub fn long_list(&self) -> ::std::option::Option<&crate::model::LongSet> {
|
120 + | self.long_list.as_ref()
|
121 + | }
|
122 + | #[allow(missing_docs)] // documentation missing in model
|
123 + | pub fn timestamp_list(&self) -> ::std::option::Option<&crate::model::TimestampSet> {
|
124 + | self.timestamp_list.as_ref()
|
125 + | }
|
126 + | #[allow(missing_docs)] // documentation missing in model
|
127 + | pub fn date_time_list(&self) -> ::std::option::Option<&crate::model::DateTimeSet> {
|
128 + | self.date_time_list.as_ref()
|
129 + | }
|
130 + | #[allow(missing_docs)] // documentation missing in model
|
131 + | pub fn http_date_list(&self) -> ::std::option::Option<&crate::model::HttpDateSet> {
|
132 + | self.http_date_list.as_ref()
|
133 + | }
|
134 + | #[allow(missing_docs)] // documentation missing in model
|
135 + | pub fn enum_list(&self) -> ::std::option::Option<&crate::model::FooEnumSet> {
|
136 + | self.enum_list.as_ref()
|
137 + | }
|
138 + | #[allow(missing_docs)] // documentation missing in model
|
139 + | pub fn int_enum_list(&self) -> ::std::option::Option<&crate::model::IntegerEnumSet> {
|
140 + | self.int_enum_list.as_ref()
|
141 + | }
|
142 + | #[allow(missing_docs)] // documentation missing in model
|
143 + | pub fn list_list(&self) -> ::std::option::Option<&crate::model::ListSet> {
|
144 + | self.list_list.as_ref()
|
145 + | }
|
146 + | #[allow(missing_docs)] // documentation missing in model
|
147 + | pub fn structure_list(&self) -> ::std::option::Option<&crate::model::StructureSet> {
|
148 + | self.structure_list.as_ref()
|
149 + | }
|
150 + | #[allow(missing_docs)] // documentation missing in model
|
151 + | pub fn structure_list_with_no_key(
|
152 + | &self,
|
153 + | ) -> ::std::option::Option<&crate::model::StructureSetWithNoKey> {
|
154 + | self.structure_list_with_no_key.as_ref()
|
155 + | }
|
156 + | #[allow(missing_docs)] // documentation missing in model
|
157 + | pub fn union_list(&self) -> ::std::option::Option<&crate::model::UnionSet> {
|
158 + | self.union_list.as_ref()
|
159 + | }
|
160 + | }
|
161 + | impl MalformedUniqueItemsInput {
|
162 + | /// Creates a new builder-style object to manufacture [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput).
|
163 + | pub fn builder() -> crate::input::malformed_unique_items_input::Builder {
|
164 + | crate::input::malformed_unique_items_input::Builder::default()
|
165 + | }
|
166 + | }
|
167 + | impl crate::constrained::Constrained for crate::input::MalformedUniqueItemsInput {
|
168 + | type Unconstrained = crate::input::malformed_unique_items_input::Builder;
|
169 + | }
|
170 + |
|
171 + | #[allow(missing_docs)] // documentation missing in model
|
172 + | #[derive(
|
173 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
174 + | )]
|
175 + | pub struct MalformedRequiredInput {
|
176 + | #[allow(missing_docs)] // documentation missing in model
|
177 + | pub string: ::std::string::String,
|
178 + | #[allow(missing_docs)] // documentation missing in model
|
179 + | pub string_in_query: ::std::string::String,
|
180 + | #[allow(missing_docs)] // documentation missing in model
|
181 + | pub string_in_header: ::std::string::String,
|
182 + | }
|
183 + | impl MalformedRequiredInput {
|
184 + | #[allow(missing_docs)] // documentation missing in model
|
185 + | pub fn string(&self) -> &str {
|
186 + | use std::ops::Deref;
|
187 + | self.string.deref()
|
188 + | }
|
189 + | #[allow(missing_docs)] // documentation missing in model
|
190 + | pub fn string_in_query(&self) -> &str {
|
191 + | use std::ops::Deref;
|
192 + | self.string_in_query.deref()
|
193 + | }
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | pub fn string_in_header(&self) -> &str {
|
196 + | use std::ops::Deref;
|
197 + | self.string_in_header.deref()
|
198 + | }
|
199 + | }
|
200 + | impl MalformedRequiredInput {
|
201 + | /// Creates a new builder-style object to manufacture [`MalformedRequiredInput`](crate::input::MalformedRequiredInput).
|
202 + | pub fn builder() -> crate::input::malformed_required_input::Builder {
|
203 + | crate::input::malformed_required_input::Builder::default()
|
204 + | }
|
205 + | }
|
206 + | impl crate::constrained::Constrained for crate::input::MalformedRequiredInput {
|
207 + | type Unconstrained = crate::input::malformed_required_input::Builder;
|
208 + | }
|
209 + |
|
210 + | #[allow(missing_docs)] // documentation missing in model
|
211 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
212 + | pub struct MalformedRangeOverrideInput {
|
213 + | #[allow(missing_docs)] // documentation missing in model
|
214 + | pub byte: ::std::option::Option<crate::input::malformed_range_override_input::Byte>,
|
215 + | #[allow(missing_docs)] // documentation missing in model
|
216 + | pub min_byte: ::std::option::Option<crate::input::malformed_range_override_input::MinByte>,
|
217 + | #[allow(missing_docs)] // documentation missing in model
|
218 + | pub max_byte: ::std::option::Option<crate::input::malformed_range_override_input::MaxByte>,
|
219 + | #[allow(missing_docs)] // documentation missing in model
|
220 + | pub short: ::std::option::Option<crate::input::malformed_range_override_input::Short>,
|
221 + | #[allow(missing_docs)] // documentation missing in model
|
222 + | pub min_short: ::std::option::Option<crate::input::malformed_range_override_input::MinShort>,
|
223 + | #[allow(missing_docs)] // documentation missing in model
|
224 + | pub max_short: ::std::option::Option<crate::input::malformed_range_override_input::MaxShort>,
|
225 + | #[allow(missing_docs)] // documentation missing in model
|
226 + | pub integer: ::std::option::Option<crate::input::malformed_range_override_input::Integer>,
|
227 + | #[allow(missing_docs)] // documentation missing in model
|
228 + | pub min_integer:
|
229 + | ::std::option::Option<crate::input::malformed_range_override_input::MinInteger>,
|
230 + | #[allow(missing_docs)] // documentation missing in model
|
231 + | pub max_integer:
|
232 + | ::std::option::Option<crate::input::malformed_range_override_input::MaxInteger>,
|
233 + | #[allow(missing_docs)] // documentation missing in model
|
234 + | pub long: ::std::option::Option<crate::input::malformed_range_override_input::Long>,
|
235 + | #[allow(missing_docs)] // documentation missing in model
|
236 + | pub min_long: ::std::option::Option<crate::input::malformed_range_override_input::MinLong>,
|
237 + | #[allow(missing_docs)] // documentation missing in model
|
238 + | pub max_long: ::std::option::Option<crate::input::malformed_range_override_input::MaxLong>,
|
239 + | #[allow(missing_docs)] // documentation missing in model
|
240 + | pub float: ::std::option::Option<f32>,
|
241 + | #[allow(missing_docs)] // documentation missing in model
|
242 + | pub min_float: ::std::option::Option<f32>,
|
243 + | #[allow(missing_docs)] // documentation missing in model
|
244 + | pub max_float: ::std::option::Option<f32>,
|
245 + | }
|
246 + | impl MalformedRangeOverrideInput {
|
247 + | #[allow(missing_docs)] // documentation missing in model
|
248 + | pub fn byte(
|
249 + | &self,
|
250 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::Byte> {
|
251 + | self.byte.as_ref()
|
252 + | }
|
253 + | #[allow(missing_docs)] // documentation missing in model
|
254 + | pub fn min_byte(
|
255 + | &self,
|
256 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MinByte> {
|
257 + | self.min_byte.as_ref()
|
258 + | }
|
259 + | #[allow(missing_docs)] // documentation missing in model
|
260 + | pub fn max_byte(
|
261 + | &self,
|
262 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MaxByte> {
|
263 + | self.max_byte.as_ref()
|
264 + | }
|
265 + | #[allow(missing_docs)] // documentation missing in model
|
266 + | pub fn short(
|
267 + | &self,
|
268 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::Short> {
|
269 + | self.short.as_ref()
|
270 + | }
|
271 + | #[allow(missing_docs)] // documentation missing in model
|
272 + | pub fn min_short(
|
273 + | &self,
|
274 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MinShort> {
|
275 + | self.min_short.as_ref()
|
276 + | }
|
277 + | #[allow(missing_docs)] // documentation missing in model
|
278 + | pub fn max_short(
|
279 + | &self,
|
280 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MaxShort> {
|
281 + | self.max_short.as_ref()
|
282 + | }
|
283 + | #[allow(missing_docs)] // documentation missing in model
|
284 + | pub fn integer(
|
285 + | &self,
|
286 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::Integer> {
|
287 + | self.integer.as_ref()
|
288 + | }
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | pub fn min_integer(
|
291 + | &self,
|
292 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MinInteger> {
|
293 + | self.min_integer.as_ref()
|
294 + | }
|
295 + | #[allow(missing_docs)] // documentation missing in model
|
296 + | pub fn max_integer(
|
297 + | &self,
|
298 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MaxInteger> {
|
299 + | self.max_integer.as_ref()
|
300 + | }
|
301 + | #[allow(missing_docs)] // documentation missing in model
|
302 + | pub fn long(
|
303 + | &self,
|
304 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::Long> {
|
305 + | self.long.as_ref()
|
306 + | }
|
307 + | #[allow(missing_docs)] // documentation missing in model
|
308 + | pub fn min_long(
|
309 + | &self,
|
310 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MinLong> {
|
311 + | self.min_long.as_ref()
|
312 + | }
|
313 + | #[allow(missing_docs)] // documentation missing in model
|
314 + | pub fn max_long(
|
315 + | &self,
|
316 + | ) -> ::std::option::Option<&crate::input::malformed_range_override_input::MaxLong> {
|
317 + | self.max_long.as_ref()
|
318 + | }
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
321 + | self.float
|
322 + | }
|
323 + | #[allow(missing_docs)] // documentation missing in model
|
324 + | pub fn min_float(&self) -> ::std::option::Option<f32> {
|
325 + | self.min_float
|
326 + | }
|
327 + | #[allow(missing_docs)] // documentation missing in model
|
328 + | pub fn max_float(&self) -> ::std::option::Option<f32> {
|
329 + | self.max_float
|
330 + | }
|
331 + | }
|
332 + | impl MalformedRangeOverrideInput {
|
333 + | /// Creates a new builder-style object to manufacture [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput).
|
334 + | pub fn builder() -> crate::input::malformed_range_override_input::Builder {
|
335 + | crate::input::malformed_range_override_input::Builder::default()
|
336 + | }
|
337 + | }
|
338 + | impl crate::constrained::Constrained for crate::input::MalformedRangeOverrideInput {
|
339 + | type Unconstrained = crate::input::malformed_range_override_input::Builder;
|
340 + | }
|
341 + |
|
342 + | #[allow(missing_docs)] // documentation missing in model
|
343 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
344 + | pub struct MalformedRangeInput {
|
345 + | #[allow(missing_docs)] // documentation missing in model
|
346 + | pub byte: ::std::option::Option<crate::model::RangeByte>,
|
347 + | #[allow(missing_docs)] // documentation missing in model
|
348 + | pub min_byte: ::std::option::Option<crate::model::MinByte>,
|
349 + | #[allow(missing_docs)] // documentation missing in model
|
350 + | pub max_byte: ::std::option::Option<crate::model::MaxByte>,
|
351 + | #[allow(missing_docs)] // documentation missing in model
|
352 + | pub short: ::std::option::Option<crate::model::RangeShort>,
|
353 + | #[allow(missing_docs)] // documentation missing in model
|
354 + | pub min_short: ::std::option::Option<crate::model::MinShort>,
|
355 + | #[allow(missing_docs)] // documentation missing in model
|
356 + | pub max_short: ::std::option::Option<crate::model::MaxShort>,
|
357 + | #[allow(missing_docs)] // documentation missing in model
|
358 + | pub integer: ::std::option::Option<crate::model::RangeInteger>,
|
359 + | #[allow(missing_docs)] // documentation missing in model
|
360 + | pub min_integer: ::std::option::Option<crate::model::MinInteger>,
|
361 + | #[allow(missing_docs)] // documentation missing in model
|
362 + | pub max_integer: ::std::option::Option<crate::model::MaxInteger>,
|
363 + | #[allow(missing_docs)] // documentation missing in model
|
364 + | pub long: ::std::option::Option<crate::model::RangeLong>,
|
365 + | #[allow(missing_docs)] // documentation missing in model
|
366 + | pub min_long: ::std::option::Option<crate::model::MinLong>,
|
367 + | #[allow(missing_docs)] // documentation missing in model
|
368 + | pub max_long: ::std::option::Option<crate::model::MaxLong>,
|
369 + | #[allow(missing_docs)] // documentation missing in model
|
370 + | pub float: ::std::option::Option<f32>,
|
371 + | #[allow(missing_docs)] // documentation missing in model
|
372 + | pub min_float: ::std::option::Option<f32>,
|
373 + | #[allow(missing_docs)] // documentation missing in model
|
374 + | pub max_float: ::std::option::Option<f32>,
|
375 + | }
|
376 + | impl MalformedRangeInput {
|
377 + | #[allow(missing_docs)] // documentation missing in model
|
378 + | pub fn byte(&self) -> ::std::option::Option<&crate::model::RangeByte> {
|
379 + | self.byte.as_ref()
|
380 + | }
|
381 + | #[allow(missing_docs)] // documentation missing in model
|
382 + | pub fn min_byte(&self) -> ::std::option::Option<&crate::model::MinByte> {
|
383 + | self.min_byte.as_ref()
|
384 + | }
|
385 + | #[allow(missing_docs)] // documentation missing in model
|
386 + | pub fn max_byte(&self) -> ::std::option::Option<&crate::model::MaxByte> {
|
387 + | self.max_byte.as_ref()
|
388 + | }
|
389 + | #[allow(missing_docs)] // documentation missing in model
|
390 + | pub fn short(&self) -> ::std::option::Option<&crate::model::RangeShort> {
|
391 + | self.short.as_ref()
|
392 + | }
|
393 + | #[allow(missing_docs)] // documentation missing in model
|
394 + | pub fn min_short(&self) -> ::std::option::Option<&crate::model::MinShort> {
|
395 + | self.min_short.as_ref()
|
396 + | }
|
397 + | #[allow(missing_docs)] // documentation missing in model
|
398 + | pub fn max_short(&self) -> ::std::option::Option<&crate::model::MaxShort> {
|
399 + | self.max_short.as_ref()
|
400 + | }
|
401 + | #[allow(missing_docs)] // documentation missing in model
|
402 + | pub fn integer(&self) -> ::std::option::Option<&crate::model::RangeInteger> {
|
403 + | self.integer.as_ref()
|
404 + | }
|
405 + | #[allow(missing_docs)] // documentation missing in model
|
406 + | pub fn min_integer(&self) -> ::std::option::Option<&crate::model::MinInteger> {
|
407 + | self.min_integer.as_ref()
|
408 + | }
|
409 + | #[allow(missing_docs)] // documentation missing in model
|
410 + | pub fn max_integer(&self) -> ::std::option::Option<&crate::model::MaxInteger> {
|
411 + | self.max_integer.as_ref()
|
412 + | }
|
413 + | #[allow(missing_docs)] // documentation missing in model
|
414 + | pub fn long(&self) -> ::std::option::Option<&crate::model::RangeLong> {
|
415 + | self.long.as_ref()
|
416 + | }
|
417 + | #[allow(missing_docs)] // documentation missing in model
|
418 + | pub fn min_long(&self) -> ::std::option::Option<&crate::model::MinLong> {
|
419 + | self.min_long.as_ref()
|
420 + | }
|
421 + | #[allow(missing_docs)] // documentation missing in model
|
422 + | pub fn max_long(&self) -> ::std::option::Option<&crate::model::MaxLong> {
|
423 + | self.max_long.as_ref()
|
424 + | }
|
425 + | #[allow(missing_docs)] // documentation missing in model
|
426 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
427 + | self.float
|
428 + | }
|
429 + | #[allow(missing_docs)] // documentation missing in model
|
430 + | pub fn min_float(&self) -> ::std::option::Option<f32> {
|
431 + | self.min_float
|
432 + | }
|
433 + | #[allow(missing_docs)] // documentation missing in model
|
434 + | pub fn max_float(&self) -> ::std::option::Option<f32> {
|
435 + | self.max_float
|
436 + | }
|
437 + | }
|
438 + | impl MalformedRangeInput {
|
439 + | /// Creates a new builder-style object to manufacture [`MalformedRangeInput`](crate::input::MalformedRangeInput).
|
440 + | pub fn builder() -> crate::input::malformed_range_input::Builder {
|
441 + | crate::input::malformed_range_input::Builder::default()
|
442 + | }
|
443 + | }
|
444 + | impl crate::constrained::Constrained for crate::input::MalformedRangeInput {
|
445 + | type Unconstrained = crate::input::malformed_range_input::Builder;
|
446 + | }
|
447 + |
|
448 + | #[allow(missing_docs)] // documentation missing in model
|
449 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
450 + | pub struct MalformedPatternOverrideInput {
|
451 + | #[allow(missing_docs)] // documentation missing in model
|
452 + | pub string: ::std::option::Option<crate::input::malformed_pattern_override_input::String>,
|
453 + | #[allow(missing_docs)] // documentation missing in model
|
454 + | pub list: ::std::option::Option<::std::vec::Vec<crate::model::pattern_list_override::Member>>,
|
455 + | #[allow(missing_docs)] // documentation missing in model
|
456 + | pub map: ::std::option::Option<
|
457 + | ::std::collections::HashMap<
|
458 + | crate::model::pattern_map_override::Key,
|
459 + | crate::model::pattern_map_override::Value,
|
460 + | >,
|
461 + | >,
|
462 + | #[allow(missing_docs)] // documentation missing in model
|
463 + | pub union: ::std::option::Option<crate::model::PatternUnionOverride>,
|
464 + | }
|
465 + | impl MalformedPatternOverrideInput {
|
466 + | #[allow(missing_docs)] // documentation missing in model
|
467 + | pub fn string(
|
468 + | &self,
|
469 + | ) -> ::std::option::Option<&crate::input::malformed_pattern_override_input::String> {
|
470 + | self.string.as_ref()
|
471 + | }
|
472 + | #[allow(missing_docs)] // documentation missing in model
|
473 + | pub fn list(&self) -> ::std::option::Option<&[crate::model::pattern_list_override::Member]> {
|
474 + | self.list.as_deref()
|
475 + | }
|
476 + | #[allow(missing_docs)] // documentation missing in model
|
477 + | pub fn map(
|
478 + | &self,
|
479 + | ) -> ::std::option::Option<
|
480 + | &::std::collections::HashMap<
|
481 + | crate::model::pattern_map_override::Key,
|
482 + | crate::model::pattern_map_override::Value,
|
483 + | >,
|
484 + | > {
|
485 + | self.map.as_ref()
|
486 + | }
|
487 + | #[allow(missing_docs)] // documentation missing in model
|
488 + | pub fn union(&self) -> ::std::option::Option<&crate::model::PatternUnionOverride> {
|
489 + | self.union.as_ref()
|
490 + | }
|
491 + | }
|
492 + | impl MalformedPatternOverrideInput {
|
493 + | /// Creates a new builder-style object to manufacture [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput).
|
494 + | pub fn builder() -> crate::input::malformed_pattern_override_input::Builder {
|
495 + | crate::input::malformed_pattern_override_input::Builder::default()
|
496 + | }
|
497 + | }
|
498 + | impl crate::constrained::Constrained for crate::input::MalformedPatternOverrideInput {
|
499 + | type Unconstrained = crate::input::malformed_pattern_override_input::Builder;
|
500 + | }
|
501 + |
|
502 + | #[allow(missing_docs)] // documentation missing in model
|
503 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
504 + | pub struct MalformedPatternInput {
|
505 + | #[allow(missing_docs)] // documentation missing in model
|
506 + | pub string: ::std::option::Option<crate::model::PatternString>,
|
507 + | #[allow(missing_docs)] // documentation missing in model
|
508 + | pub evil_string: ::std::option::Option<crate::model::EvilString>,
|
509 + | #[allow(missing_docs)] // documentation missing in model
|
510 + | pub list: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
511 + | #[allow(missing_docs)] // documentation missing in model
|
512 + | pub map: ::std::option::Option<
|
513 + | ::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
514 + | >,
|
515 + | #[allow(missing_docs)] // documentation missing in model
|
516 + | pub union: ::std::option::Option<crate::model::PatternUnion>,
|
517 + | }
|
518 + | impl MalformedPatternInput {
|
519 + | #[allow(missing_docs)] // documentation missing in model
|
520 + | pub fn string(&self) -> ::std::option::Option<&crate::model::PatternString> {
|
521 + | self.string.as_ref()
|
522 + | }
|
523 + | #[allow(missing_docs)] // documentation missing in model
|
524 + | pub fn evil_string(&self) -> ::std::option::Option<&crate::model::EvilString> {
|
525 + | self.evil_string.as_ref()
|
526 + | }
|
527 + | #[allow(missing_docs)] // documentation missing in model
|
528 + | pub fn list(&self) -> ::std::option::Option<&[crate::model::PatternString]> {
|
529 + | self.list.as_deref()
|
530 + | }
|
531 + | #[allow(missing_docs)] // documentation missing in model
|
532 + | pub fn map(
|
533 + | &self,
|
534 + | ) -> ::std::option::Option<
|
535 + | &::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
536 + | > {
|
537 + | self.map.as_ref()
|
538 + | }
|
539 + | #[allow(missing_docs)] // documentation missing in model
|
540 + | pub fn union(&self) -> ::std::option::Option<&crate::model::PatternUnion> {
|
541 + | self.union.as_ref()
|
542 + | }
|
543 + | }
|
544 + | impl MalformedPatternInput {
|
545 + | /// Creates a new builder-style object to manufacture [`MalformedPatternInput`](crate::input::MalformedPatternInput).
|
546 + | pub fn builder() -> crate::input::malformed_pattern_input::Builder {
|
547 + | crate::input::malformed_pattern_input::Builder::default()
|
548 + | }
|
549 + | }
|
550 + | impl crate::constrained::Constrained for crate::input::MalformedPatternInput {
|
551 + | type Unconstrained = crate::input::malformed_pattern_input::Builder;
|
552 + | }
|
553 + |
|
554 + | #[allow(missing_docs)] // documentation missing in model
|
555 + | #[derive(
|
556 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
557 + | )]
|
558 + | pub struct MalformedLengthQueryStringInput {
|
559 + | #[allow(missing_docs)] // documentation missing in model
|
560 + | pub string: ::std::option::Option<crate::model::LengthString>,
|
561 + | }
|
562 + | impl MalformedLengthQueryStringInput {
|
563 + | #[allow(missing_docs)] // documentation missing in model
|
564 + | pub fn string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
565 + | self.string.as_ref()
|
566 + | }
|
567 + | }
|
568 + | impl MalformedLengthQueryStringInput {
|
569 + | /// Creates a new builder-style object to manufacture [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput).
|
570 + | pub fn builder() -> crate::input::malformed_length_query_string_input::Builder {
|
571 + | crate::input::malformed_length_query_string_input::Builder::default()
|
572 + | }
|
573 + | }
|
574 + | impl crate::constrained::Constrained for crate::input::MalformedLengthQueryStringInput {
|
575 + | type Unconstrained = crate::input::malformed_length_query_string_input::Builder;
|
576 + | }
|
577 + |
|
578 + | #[allow(missing_docs)] // documentation missing in model
|
579 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
580 + | pub struct MalformedLengthOverrideInput {
|
581 + | #[allow(missing_docs)] // documentation missing in model
|
582 + | pub blob: ::std::option::Option<crate::input::malformed_length_override_input::Blob>,
|
583 + | #[allow(missing_docs)] // documentation missing in model
|
584 + | pub string: ::std::option::Option<crate::input::malformed_length_override_input::String>,
|
585 + | #[allow(missing_docs)] // documentation missing in model
|
586 + | pub min_string: ::std::option::Option<crate::input::malformed_length_override_input::MinString>,
|
587 + | #[allow(missing_docs)] // documentation missing in model
|
588 + | pub max_string: ::std::option::Option<crate::input::malformed_length_override_input::MaxString>,
|
589 + | #[allow(missing_docs)] // documentation missing in model
|
590 + | pub list: ::std::option::Option<crate::input::malformed_length_override_input::List>,
|
591 + | #[allow(missing_docs)] // documentation missing in model
|
592 + | pub map: ::std::option::Option<crate::input::malformed_length_override_input::Map>,
|
593 + | }
|
594 + | impl MalformedLengthOverrideInput {
|
595 + | #[allow(missing_docs)] // documentation missing in model
|
596 + | pub fn blob(
|
597 + | &self,
|
598 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::Blob> {
|
599 + | self.blob.as_ref()
|
600 + | }
|
601 + | #[allow(missing_docs)] // documentation missing in model
|
602 + | pub fn string(
|
603 + | &self,
|
604 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::String> {
|
605 + | self.string.as_ref()
|
606 + | }
|
607 + | #[allow(missing_docs)] // documentation missing in model
|
608 + | pub fn min_string(
|
609 + | &self,
|
610 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::MinString> {
|
611 + | self.min_string.as_ref()
|
612 + | }
|
613 + | #[allow(missing_docs)] // documentation missing in model
|
614 + | pub fn max_string(
|
615 + | &self,
|
616 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::MaxString> {
|
617 + | self.max_string.as_ref()
|
618 + | }
|
619 + | #[allow(missing_docs)] // documentation missing in model
|
620 + | pub fn list(
|
621 + | &self,
|
622 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::List> {
|
623 + | self.list.as_ref()
|
624 + | }
|
625 + | #[allow(missing_docs)] // documentation missing in model
|
626 + | pub fn map(
|
627 + | &self,
|
628 + | ) -> ::std::option::Option<&crate::input::malformed_length_override_input::Map> {
|
629 + | self.map.as_ref()
|
630 + | }
|
631 + | }
|
632 + | impl MalformedLengthOverrideInput {
|
633 + | /// Creates a new builder-style object to manufacture [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput).
|
634 + | pub fn builder() -> crate::input::malformed_length_override_input::Builder {
|
635 + | crate::input::malformed_length_override_input::Builder::default()
|
636 + | }
|
637 + | }
|
638 + | impl crate::constrained::Constrained for crate::input::MalformedLengthOverrideInput {
|
639 + | type Unconstrained = crate::input::malformed_length_override_input::Builder;
|
640 + | }
|
641 + |
|
642 + | #[allow(missing_docs)] // documentation missing in model
|
643 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
644 + | pub struct MalformedLengthInput {
|
645 + | #[allow(missing_docs)] // documentation missing in model
|
646 + | pub blob: ::std::option::Option<crate::model::LengthBlob>,
|
647 + | #[allow(missing_docs)] // documentation missing in model
|
648 + | pub string: ::std::option::Option<crate::model::LengthString>,
|
649 + | #[allow(missing_docs)] // documentation missing in model
|
650 + | pub min_string: ::std::option::Option<crate::model::MinLengthString>,
|
651 + | #[allow(missing_docs)] // documentation missing in model
|
652 + | pub max_string: ::std::option::Option<crate::model::MaxLengthString>,
|
653 + | #[allow(missing_docs)] // documentation missing in model
|
654 + | pub list: ::std::option::Option<crate::model::LengthList>,
|
655 + | #[allow(missing_docs)] // documentation missing in model
|
656 + | pub map: ::std::option::Option<crate::model::LengthMap>,
|
657 + | }
|
658 + | impl MalformedLengthInput {
|
659 + | #[allow(missing_docs)] // documentation missing in model
|
660 + | pub fn blob(&self) -> ::std::option::Option<&crate::model::LengthBlob> {
|
661 + | self.blob.as_ref()
|
662 + | }
|
663 + | #[allow(missing_docs)] // documentation missing in model
|
664 + | pub fn string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
665 + | self.string.as_ref()
|
666 + | }
|
667 + | #[allow(missing_docs)] // documentation missing in model
|
668 + | pub fn min_string(&self) -> ::std::option::Option<&crate::model::MinLengthString> {
|
669 + | self.min_string.as_ref()
|
670 + | }
|
671 + | #[allow(missing_docs)] // documentation missing in model
|
672 + | pub fn max_string(&self) -> ::std::option::Option<&crate::model::MaxLengthString> {
|
673 + | self.max_string.as_ref()
|
674 + | }
|
675 + | #[allow(missing_docs)] // documentation missing in model
|
676 + | pub fn list(&self) -> ::std::option::Option<&crate::model::LengthList> {
|
677 + | self.list.as_ref()
|
678 + | }
|
679 + | #[allow(missing_docs)] // documentation missing in model
|
680 + | pub fn map(&self) -> ::std::option::Option<&crate::model::LengthMap> {
|
681 + | self.map.as_ref()
|
682 + | }
|
683 + | }
|
684 + | impl MalformedLengthInput {
|
685 + | /// Creates a new builder-style object to manufacture [`MalformedLengthInput`](crate::input::MalformedLengthInput).
|
686 + | pub fn builder() -> crate::input::malformed_length_input::Builder {
|
687 + | crate::input::malformed_length_input::Builder::default()
|
688 + | }
|
689 + | }
|
690 + | impl crate::constrained::Constrained for crate::input::MalformedLengthInput {
|
691 + | type Unconstrained = crate::input::malformed_length_input::Builder;
|
692 + | }
|
693 + |
|
694 + | #[allow(missing_docs)] // documentation missing in model
|
695 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
696 + | pub struct MalformedEnumInput {
|
697 + | #[allow(missing_docs)] // documentation missing in model
|
698 + | pub string: ::std::option::Option<crate::model::EnumString>,
|
699 + | #[allow(missing_docs)] // documentation missing in model
|
700 + | pub string_with_enum_trait: ::std::option::Option<crate::model::EnumTraitString>,
|
701 + | #[allow(missing_docs)] // documentation missing in model
|
702 + | pub list: ::std::option::Option<::std::vec::Vec<crate::model::EnumString>>,
|
703 + | #[allow(missing_docs)] // documentation missing in model
|
704 + | pub map: ::std::option::Option<
|
705 + | ::std::collections::HashMap<crate::model::EnumString, crate::model::EnumString>,
|
706 + | >,
|
707 + | #[allow(missing_docs)] // documentation missing in model
|
708 + | pub union: ::std::option::Option<crate::model::EnumUnion>,
|
709 + | }
|
710 + | impl MalformedEnumInput {
|
711 + | #[allow(missing_docs)] // documentation missing in model
|
712 + | pub fn string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
713 + | self.string.as_ref()
|
714 + | }
|
715 + | #[allow(missing_docs)] // documentation missing in model
|
716 + | pub fn string_with_enum_trait(&self) -> ::std::option::Option<&crate::model::EnumTraitString> {
|
717 + | self.string_with_enum_trait.as_ref()
|
718 + | }
|
719 + | #[allow(missing_docs)] // documentation missing in model
|
720 + | pub fn list(&self) -> ::std::option::Option<&[crate::model::EnumString]> {
|
721 + | self.list.as_deref()
|
722 + | }
|
723 + | #[allow(missing_docs)] // documentation missing in model
|
724 + | pub fn map(
|
725 + | &self,
|
726 + | ) -> ::std::option::Option<
|
727 + | &::std::collections::HashMap<crate::model::EnumString, crate::model::EnumString>,
|
728 + | > {
|
729 + | self.map.as_ref()
|
730 + | }
|
731 + | #[allow(missing_docs)] // documentation missing in model
|
732 + | pub fn union(&self) -> ::std::option::Option<&crate::model::EnumUnion> {
|
733 + | self.union.as_ref()
|
734 + | }
|
735 + | }
|
736 + | impl MalformedEnumInput {
|
737 + | /// Creates a new builder-style object to manufacture [`MalformedEnumInput`](crate::input::MalformedEnumInput).
|
738 + | pub fn builder() -> crate::input::malformed_enum_input::Builder {
|
739 + | crate::input::malformed_enum_input::Builder::default()
|
740 + | }
|
741 + | }
|
742 + | impl crate::constrained::Constrained for crate::input::MalformedEnumInput {
|
743 + | type Unconstrained = crate::input::malformed_enum_input::Builder;
|
744 + | }
|
745 + | /// See [`SensitiveValidationInput`](crate::input::SensitiveValidationInput).
|
746 + | pub mod sensitive_validation_input {
|
747 + |
|
748 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
749 + | /// Holds one variant for each of the ways the builder can fail.
|
750 + | #[non_exhaustive]
|
751 + | #[allow(clippy::enum_variant_names)]
|
752 + | pub enum ConstraintViolation {
|
753 + | /// Constraint violation occurred building member `string` when building `SensitiveValidationInput`.
|
754 + | #[doc(hidden)]
|
755 + | String(crate::model::sensitive_pattern_string::ConstraintViolation),
|
756 + | }
|
757 + | impl ::std::fmt::Display for ConstraintViolation {
|
758 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
759 + | match self {
|
760 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `SensitiveValidationInput`"),
|
761 + | }
|
762 + | }
|
763 + | }
|
764 + | impl ::std::error::Error for ConstraintViolation {}
|
765 + | impl ConstraintViolation {
|
766 + | pub(crate) fn as_validation_exception_field(
|
767 + | self,
|
768 + | path: ::std::string::String,
|
769 + | ) -> crate::model::ValidationExceptionField {
|
770 + | match self {
|
771 + | ConstraintViolation::String(inner) => {
|
772 + | inner.as_validation_exception_field(path + "/string")
|
773 + | }
|
774 + | }
|
775 + | }
|
776 + | }
|
777 + | impl ::std::convert::From<ConstraintViolation>
|
778 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
779 + | {
|
780 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
781 + | let first_validation_exception_field =
|
782 + | constraint_violation.as_validation_exception_field("".to_owned());
|
783 + | let validation_exception = crate::error::ValidationException {
|
784 + | message: format!(
|
785 + | "1 validation error detected. {}",
|
786 + | &first_validation_exception_field.message
|
787 + | ),
|
788 + | field_list: Some(vec![first_validation_exception_field]),
|
789 + | };
|
790 + | Self::ConstraintViolation(
|
791 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
792 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
793 + | )
|
794 + | }
|
795 + | }
|
796 + | impl ::std::convert::From<Builder>
|
797 + | for crate::constrained::MaybeConstrained<crate::input::SensitiveValidationInput>
|
798 + | {
|
799 + | fn from(builder: Builder) -> Self {
|
800 + | Self::Unconstrained(builder)
|
801 + | }
|
802 + | }
|
803 + | impl ::std::convert::TryFrom<Builder> for crate::input::SensitiveValidationInput {
|
804 + | type Error = ConstraintViolation;
|
805 + |
|
806 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
807 + | builder.build()
|
808 + | }
|
809 + | }
|
810 + | /// A builder for [`SensitiveValidationInput`](crate::input::SensitiveValidationInput).
|
811 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
812 + | pub struct Builder {
|
813 + | pub(crate) string: ::std::option::Option<
|
814 + | crate::constrained::MaybeConstrained<crate::model::SensitivePatternString>,
|
815 + | >,
|
816 + | }
|
817 + | impl Builder {
|
818 + | #[allow(missing_docs)] // documentation missing in model
|
819 + | pub fn string(
|
820 + | mut self,
|
821 + | input: ::std::option::Option<crate::model::SensitivePatternString>,
|
822 + | ) -> Self {
|
823 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
824 + | self
|
825 + | }
|
826 + | #[allow(missing_docs)] // documentation missing in model
|
827 + | pub(crate) fn set_string(
|
828 + | mut self,
|
829 + | input: Option<
|
830 + | impl ::std::convert::Into<
|
831 + | crate::constrained::MaybeConstrained<crate::model::SensitivePatternString>,
|
832 + | >,
|
833 + | >,
|
834 + | ) -> Self {
|
835 + | self.string = input.map(|v| v.into());
|
836 + | self
|
837 + | }
|
838 + | /// Consumes the builder and constructs a [`SensitiveValidationInput`](crate::input::SensitiveValidationInput).
|
839 + | ///
|
840 + | /// The builder fails to construct a [`SensitiveValidationInput`](crate::input::SensitiveValidationInput) if a [`ConstraintViolation`] occurs.
|
841 + | ///
|
842 + | pub fn build(self) -> Result<crate::input::SensitiveValidationInput, ConstraintViolation> {
|
843 + | self.build_enforcing_all_constraints()
|
844 + | }
|
845 + | fn build_enforcing_all_constraints(
|
846 + | self,
|
847 + | ) -> Result<crate::input::SensitiveValidationInput, ConstraintViolation> {
|
848 + | Ok(crate::input::SensitiveValidationInput {
|
849 + | string: self
|
850 + | .string
|
851 + | .map(|v| match v {
|
852 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
853 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
854 + | })
|
855 + | .map(|res| res.map_err(ConstraintViolation::String))
|
856 + | .transpose()?,
|
857 + | })
|
858 + | }
|
859 + | }
|
860 + | impl ::std::fmt::Debug for Builder {
|
861 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
862 + | let mut formatter = f.debug_struct("Builder");
|
863 + | formatter.field("string", &"*** Sensitive Data Redacted ***");
|
864 + | formatter.finish()
|
865 + | }
|
866 + | }
|
867 + | }
|
868 + | /// See [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput).
|
869 + | pub mod recursive_structures_input {
|
870 + |
|
871 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
872 + | /// Holds one variant for each of the ways the builder can fail.
|
873 + | #[non_exhaustive]
|
874 + | #[allow(clippy::enum_variant_names)]
|
875 + | pub enum ConstraintViolation {
|
876 + | /// Constraint violation occurred building member `union` when building `RecursiveStructuresInput`.
|
877 + | #[doc(hidden)]
|
878 + | Union(crate::model::recursive_union_one::ConstraintViolation),
|
879 + | }
|
880 + | impl ::std::fmt::Display for ConstraintViolation {
|
881 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
882 + | match self {
|
883 + | ConstraintViolation::Union(_) => write!(f, "constraint violation occurred building member `union` when building `RecursiveStructuresInput`"),
|
884 + | }
|
885 + | }
|
886 + | }
|
887 + | impl ::std::error::Error for ConstraintViolation {}
|
888 + | impl ConstraintViolation {
|
889 + | pub(crate) fn as_validation_exception_field(
|
890 + | self,
|
891 + | path: ::std::string::String,
|
892 + | ) -> crate::model::ValidationExceptionField {
|
893 + | match self {
|
894 + | ConstraintViolation::Union(inner) => {
|
895 + | inner.as_validation_exception_field(path + "/union")
|
896 + | }
|
897 + | }
|
898 + | }
|
899 + | }
|
900 + | impl ::std::convert::From<ConstraintViolation>
|
901 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
902 + | {
|
903 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
904 + | let first_validation_exception_field =
|
905 + | constraint_violation.as_validation_exception_field("".to_owned());
|
906 + | let validation_exception = crate::error::ValidationException {
|
907 + | message: format!(
|
908 + | "1 validation error detected. {}",
|
909 + | &first_validation_exception_field.message
|
910 + | ),
|
911 + | field_list: Some(vec![first_validation_exception_field]),
|
912 + | };
|
913 + | Self::ConstraintViolation(
|
914 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
915 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
916 + | )
|
917 + | }
|
918 + | }
|
919 + | impl ::std::convert::From<Builder>
|
920 + | for crate::constrained::MaybeConstrained<crate::input::RecursiveStructuresInput>
|
921 + | {
|
922 + | fn from(builder: Builder) -> Self {
|
923 + | Self::Unconstrained(builder)
|
924 + | }
|
925 + | }
|
926 + | impl ::std::convert::TryFrom<Builder> for crate::input::RecursiveStructuresInput {
|
927 + | type Error = ConstraintViolation;
|
928 + |
|
929 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
930 + | builder.build()
|
931 + | }
|
932 + | }
|
933 + | /// A builder for [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput).
|
934 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
935 + | pub struct Builder {
|
936 + | pub(crate) union: ::std::option::Option<
|
937 + | crate::constrained::MaybeConstrained<crate::model::RecursiveUnionOne>,
|
938 + | >,
|
939 + | }
|
940 + | impl Builder {
|
941 + | #[allow(missing_docs)] // documentation missing in model
|
942 + | pub fn union(
|
943 + | mut self,
|
944 + | input: ::std::option::Option<crate::model::RecursiveUnionOne>,
|
945 + | ) -> Self {
|
946 + | self.union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
947 + | self
|
948 + | }
|
949 + | #[allow(missing_docs)] // documentation missing in model
|
950 + | pub(crate) fn set_union(
|
951 + | mut self,
|
952 + | input: Option<
|
953 + | impl ::std::convert::Into<
|
954 + | crate::constrained::MaybeConstrained<crate::model::RecursiveUnionOne>,
|
955 + | >,
|
956 + | >,
|
957 + | ) -> Self {
|
958 + | self.union = input.map(|v| v.into());
|
959 + | self
|
960 + | }
|
961 + | /// Consumes the builder and constructs a [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput).
|
962 + | ///
|
963 + | /// The builder fails to construct a [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput) if a [`ConstraintViolation`] occurs.
|
964 + | ///
|
965 + | pub fn build(self) -> Result<crate::input::RecursiveStructuresInput, ConstraintViolation> {
|
966 + | self.build_enforcing_all_constraints()
|
967 + | }
|
968 + | fn build_enforcing_all_constraints(
|
969 + | self,
|
970 + | ) -> Result<crate::input::RecursiveStructuresInput, ConstraintViolation> {
|
971 + | Ok(crate::input::RecursiveStructuresInput {
|
972 + | union: self
|
973 + | .union
|
974 + | .map(|v| match v {
|
975 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
976 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
977 + | })
|
978 + | .map(|res| res.map_err(ConstraintViolation::Union))
|
979 + | .transpose()?,
|
980 + | })
|
981 + | }
|
982 + | }
|
983 + | }
|
984 + | /// See [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput).
|
985 + | pub mod malformed_unique_items_input {
|
986 + |
|
987 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
988 + | /// Holds one variant for each of the ways the builder can fail.
|
989 + | #[non_exhaustive]
|
990 + | #[allow(clippy::enum_variant_names)]
|
991 + | pub enum ConstraintViolation {
|
992 + | /// Constraint violation occurred building member `blob_list` when building `MalformedUniqueItemsInput`.
|
993 + | #[doc(hidden)]
|
994 + | BlobList(crate::model::blob_set::ConstraintViolation),
|
995 + | /// Constraint violation occurred building member `boolean_list` when building `MalformedUniqueItemsInput`.
|
996 + | #[doc(hidden)]
|
997 + | BooleanList(crate::model::boolean_set::ConstraintViolation),
|
998 + | /// Constraint violation occurred building member `string_list` when building `MalformedUniqueItemsInput`.
|
999 + | #[doc(hidden)]
|
1000 + | StringList(crate::model::string_set::ConstraintViolation),
|
1001 + | /// Constraint violation occurred building member `byte_list` when building `MalformedUniqueItemsInput`.
|
1002 + | #[doc(hidden)]
|
1003 + | ByteList(crate::model::byte_set::ConstraintViolation),
|
1004 + | /// Constraint violation occurred building member `short_list` when building `MalformedUniqueItemsInput`.
|
1005 + | #[doc(hidden)]
|
1006 + | ShortList(crate::model::short_set::ConstraintViolation),
|
1007 + | /// Constraint violation occurred building member `integer_list` when building `MalformedUniqueItemsInput`.
|
1008 + | #[doc(hidden)]
|
1009 + | IntegerList(crate::model::integer_set::ConstraintViolation),
|
1010 + | /// Constraint violation occurred building member `long_list` when building `MalformedUniqueItemsInput`.
|
1011 + | #[doc(hidden)]
|
1012 + | LongList(crate::model::long_set::ConstraintViolation),
|
1013 + | /// Constraint violation occurred building member `timestamp_list` when building `MalformedUniqueItemsInput`.
|
1014 + | #[doc(hidden)]
|
1015 + | TimestampList(crate::model::timestamp_set::ConstraintViolation),
|
1016 + | /// Constraint violation occurred building member `date_time_list` when building `MalformedUniqueItemsInput`.
|
1017 + | #[doc(hidden)]
|
1018 + | DateTimeList(crate::model::date_time_set::ConstraintViolation),
|
1019 + | /// Constraint violation occurred building member `http_date_list` when building `MalformedUniqueItemsInput`.
|
1020 + | #[doc(hidden)]
|
1021 + | HttpDateList(crate::model::http_date_set::ConstraintViolation),
|
1022 + | /// Constraint violation occurred building member `enum_list` when building `MalformedUniqueItemsInput`.
|
1023 + | #[doc(hidden)]
|
1024 + | EnumList(crate::model::foo_enum_set::ConstraintViolation),
|
1025 + | /// Constraint violation occurred building member `int_enum_list` when building `MalformedUniqueItemsInput`.
|
1026 + | #[doc(hidden)]
|
1027 + | IntEnumList(crate::model::integer_enum_set::ConstraintViolation),
|
1028 + | /// Constraint violation occurred building member `list_list` when building `MalformedUniqueItemsInput`.
|
1029 + | #[doc(hidden)]
|
1030 + | ListList(crate::model::list_set::ConstraintViolation),
|
1031 + | /// Constraint violation occurred building member `structure_list` when building `MalformedUniqueItemsInput`.
|
1032 + | #[doc(hidden)]
|
1033 + | StructureList(crate::model::structure_set::ConstraintViolation),
|
1034 + | /// Constraint violation occurred building member `structure_list_with_no_key` when building `MalformedUniqueItemsInput`.
|
1035 + | #[doc(hidden)]
|
1036 + | StructureListWithNoKey(crate::model::structure_set_with_no_key::ConstraintViolation),
|
1037 + | /// Constraint violation occurred building member `union_list` when building `MalformedUniqueItemsInput`.
|
1038 + | #[doc(hidden)]
|
1039 + | UnionList(crate::model::union_set::ConstraintViolation),
|
1040 + | }
|
1041 + | impl ::std::fmt::Display for ConstraintViolation {
|
1042 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1043 + | match self {
|
1044 + | ConstraintViolation::BlobList(_) => write!(f, "constraint violation occurred building member `blob_list` when building `MalformedUniqueItemsInput`"),
|
1045 + | ConstraintViolation::BooleanList(_) => write!(f, "constraint violation occurred building member `boolean_list` when building `MalformedUniqueItemsInput`"),
|
1046 + | ConstraintViolation::StringList(_) => write!(f, "constraint violation occurred building member `string_list` when building `MalformedUniqueItemsInput`"),
|
1047 + | ConstraintViolation::ByteList(_) => write!(f, "constraint violation occurred building member `byte_list` when building `MalformedUniqueItemsInput`"),
|
1048 + | ConstraintViolation::ShortList(_) => write!(f, "constraint violation occurred building member `short_list` when building `MalformedUniqueItemsInput`"),
|
1049 + | ConstraintViolation::IntegerList(_) => write!(f, "constraint violation occurred building member `integer_list` when building `MalformedUniqueItemsInput`"),
|
1050 + | ConstraintViolation::LongList(_) => write!(f, "constraint violation occurred building member `long_list` when building `MalformedUniqueItemsInput`"),
|
1051 + | ConstraintViolation::TimestampList(_) => write!(f, "constraint violation occurred building member `timestamp_list` when building `MalformedUniqueItemsInput`"),
|
1052 + | ConstraintViolation::DateTimeList(_) => write!(f, "constraint violation occurred building member `date_time_list` when building `MalformedUniqueItemsInput`"),
|
1053 + | ConstraintViolation::HttpDateList(_) => write!(f, "constraint violation occurred building member `http_date_list` when building `MalformedUniqueItemsInput`"),
|
1054 + | ConstraintViolation::EnumList(_) => write!(f, "constraint violation occurred building member `enum_list` when building `MalformedUniqueItemsInput`"),
|
1055 + | ConstraintViolation::IntEnumList(_) => write!(f, "constraint violation occurred building member `int_enum_list` when building `MalformedUniqueItemsInput`"),
|
1056 + | ConstraintViolation::ListList(_) => write!(f, "constraint violation occurred building member `list_list` when building `MalformedUniqueItemsInput`"),
|
1057 + | ConstraintViolation::StructureList(_) => write!(f, "constraint violation occurred building member `structure_list` when building `MalformedUniqueItemsInput`"),
|
1058 + | ConstraintViolation::StructureListWithNoKey(_) => write!(f, "constraint violation occurred building member `structure_list_with_no_key` when building `MalformedUniqueItemsInput`"),
|
1059 + | ConstraintViolation::UnionList(_) => write!(f, "constraint violation occurred building member `union_list` when building `MalformedUniqueItemsInput`"),
|
1060 + | }
|
1061 + | }
|
1062 + | }
|
1063 + | impl ::std::error::Error for ConstraintViolation {}
|
1064 + | impl ConstraintViolation {
|
1065 + | pub(crate) fn as_validation_exception_field(
|
1066 + | self,
|
1067 + | path: ::std::string::String,
|
1068 + | ) -> crate::model::ValidationExceptionField {
|
1069 + | match self {
|
1070 + | ConstraintViolation::BlobList(inner) => {
|
1071 + | inner.as_validation_exception_field(path + "/blobList")
|
1072 + | }
|
1073 + | ConstraintViolation::BooleanList(inner) => {
|
1074 + | inner.as_validation_exception_field(path + "/booleanList")
|
1075 + | }
|
1076 + | ConstraintViolation::StringList(inner) => {
|
1077 + | inner.as_validation_exception_field(path + "/stringList")
|
1078 + | }
|
1079 + | ConstraintViolation::ByteList(inner) => {
|
1080 + | inner.as_validation_exception_field(path + "/byteList")
|
1081 + | }
|
1082 + | ConstraintViolation::ShortList(inner) => {
|
1083 + | inner.as_validation_exception_field(path + "/shortList")
|
1084 + | }
|
1085 + | ConstraintViolation::IntegerList(inner) => {
|
1086 + | inner.as_validation_exception_field(path + "/integerList")
|
1087 + | }
|
1088 + | ConstraintViolation::LongList(inner) => {
|
1089 + | inner.as_validation_exception_field(path + "/longList")
|
1090 + | }
|
1091 + | ConstraintViolation::TimestampList(inner) => {
|
1092 + | inner.as_validation_exception_field(path + "/timestampList")
|
1093 + | }
|
1094 + | ConstraintViolation::DateTimeList(inner) => {
|
1095 + | inner.as_validation_exception_field(path + "/dateTimeList")
|
1096 + | }
|
1097 + | ConstraintViolation::HttpDateList(inner) => {
|
1098 + | inner.as_validation_exception_field(path + "/httpDateList")
|
1099 + | }
|
1100 + | ConstraintViolation::EnumList(inner) => {
|
1101 + | inner.as_validation_exception_field(path + "/enumList")
|
1102 + | }
|
1103 + | ConstraintViolation::IntEnumList(inner) => {
|
1104 + | inner.as_validation_exception_field(path + "/intEnumList")
|
1105 + | }
|
1106 + | ConstraintViolation::ListList(inner) => {
|
1107 + | inner.as_validation_exception_field(path + "/listList")
|
1108 + | }
|
1109 + | ConstraintViolation::StructureList(inner) => {
|
1110 + | inner.as_validation_exception_field(path + "/structureList")
|
1111 + | }
|
1112 + | ConstraintViolation::StructureListWithNoKey(inner) => {
|
1113 + | inner.as_validation_exception_field(path + "/structureListWithNoKey")
|
1114 + | }
|
1115 + | ConstraintViolation::UnionList(inner) => {
|
1116 + | inner.as_validation_exception_field(path + "/unionList")
|
1117 + | }
|
1118 + | }
|
1119 + | }
|
1120 + | }
|
1121 + | impl ::std::convert::From<ConstraintViolation>
|
1122 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1123 + | {
|
1124 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1125 + | let first_validation_exception_field =
|
1126 + | constraint_violation.as_validation_exception_field("".to_owned());
|
1127 + | let validation_exception = crate::error::ValidationException {
|
1128 + | message: format!(
|
1129 + | "1 validation error detected. {}",
|
1130 + | &first_validation_exception_field.message
|
1131 + | ),
|
1132 + | field_list: Some(vec![first_validation_exception_field]),
|
1133 + | };
|
1134 + | Self::ConstraintViolation(
|
1135 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1136 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1137 + | )
|
1138 + | }
|
1139 + | }
|
1140 + | impl ::std::convert::From<Builder>
|
1141 + | for crate::constrained::MaybeConstrained<crate::input::MalformedUniqueItemsInput>
|
1142 + | {
|
1143 + | fn from(builder: Builder) -> Self {
|
1144 + | Self::Unconstrained(builder)
|
1145 + | }
|
1146 + | }
|
1147 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedUniqueItemsInput {
|
1148 + | type Error = ConstraintViolation;
|
1149 + |
|
1150 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1151 + | builder.build()
|
1152 + | }
|
1153 + | }
|
1154 + | /// A builder for [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput).
|
1155 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1156 + | pub struct Builder {
|
1157 + | pub(crate) blob_list:
|
1158 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlobSet>>,
|
1159 + | pub(crate) boolean_list:
|
1160 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BooleanSet>>,
|
1161 + | pub(crate) string_list:
|
1162 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::StringSet>>,
|
1163 + | pub(crate) byte_list:
|
1164 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ByteSet>>,
|
1165 + | pub(crate) short_list:
|
1166 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ShortSet>>,
|
1167 + | pub(crate) integer_list:
|
1168 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::IntegerSet>>,
|
1169 + | pub(crate) long_list:
|
1170 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LongSet>>,
|
1171 + | pub(crate) timestamp_list:
|
1172 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TimestampSet>>,
|
1173 + | pub(crate) date_time_list:
|
1174 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::DateTimeSet>>,
|
1175 + | pub(crate) http_date_list:
|
1176 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::HttpDateSet>>,
|
1177 + | pub(crate) enum_list:
|
1178 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FooEnumSet>>,
|
1179 + | pub(crate) int_enum_list: ::std::option::Option<
|
1180 + | crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>,
|
1181 + | >,
|
1182 + | pub(crate) list_list:
|
1183 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ListSet>>,
|
1184 + | pub(crate) structure_list:
|
1185 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::StructureSet>>,
|
1186 + | pub(crate) structure_list_with_no_key: ::std::option::Option<
|
1187 + | crate::constrained::MaybeConstrained<crate::model::StructureSetWithNoKey>,
|
1188 + | >,
|
1189 + | pub(crate) union_list:
|
1190 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::UnionSet>>,
|
1191 + | }
|
1192 + | impl Builder {
|
1193 + | #[allow(missing_docs)] // documentation missing in model
|
1194 + | pub fn blob_list(mut self, input: ::std::option::Option<crate::model::BlobSet>) -> Self {
|
1195 + | self.blob_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1196 + | self
|
1197 + | }
|
1198 + | #[allow(missing_docs)] // documentation missing in model
|
1199 + | pub(crate) fn set_blob_list(
|
1200 + | mut self,
|
1201 + | input: Option<
|
1202 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::BlobSet>>,
|
1203 + | >,
|
1204 + | ) -> Self {
|
1205 + | self.blob_list = input.map(|v| v.into());
|
1206 + | self
|
1207 + | }
|
1208 + | #[allow(missing_docs)] // documentation missing in model
|
1209 + | pub fn boolean_list(
|
1210 + | mut self,
|
1211 + | input: ::std::option::Option<crate::model::BooleanSet>,
|
1212 + | ) -> Self {
|
1213 + | self.boolean_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1214 + | self
|
1215 + | }
|
1216 + | #[allow(missing_docs)] // documentation missing in model
|
1217 + | pub(crate) fn set_boolean_list(
|
1218 + | mut self,
|
1219 + | input: Option<
|
1220 + | impl ::std::convert::Into<
|
1221 + | crate::constrained::MaybeConstrained<crate::model::BooleanSet>,
|
1222 + | >,
|
1223 + | >,
|
1224 + | ) -> Self {
|
1225 + | self.boolean_list = input.map(|v| v.into());
|
1226 + | self
|
1227 + | }
|
1228 + | #[allow(missing_docs)] // documentation missing in model
|
1229 + | pub fn string_list(
|
1230 + | mut self,
|
1231 + | input: ::std::option::Option<crate::model::StringSet>,
|
1232 + | ) -> Self {
|
1233 + | self.string_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1234 + | self
|
1235 + | }
|
1236 + | #[allow(missing_docs)] // documentation missing in model
|
1237 + | pub(crate) fn set_string_list(
|
1238 + | mut self,
|
1239 + | input: Option<
|
1240 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::StringSet>>,
|
1241 + | >,
|
1242 + | ) -> Self {
|
1243 + | self.string_list = input.map(|v| v.into());
|
1244 + | self
|
1245 + | }
|
1246 + | #[allow(missing_docs)] // documentation missing in model
|
1247 + | pub fn byte_list(mut self, input: ::std::option::Option<crate::model::ByteSet>) -> Self {
|
1248 + | self.byte_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1249 + | self
|
1250 + | }
|
1251 + | #[allow(missing_docs)] // documentation missing in model
|
1252 + | pub(crate) fn set_byte_list(
|
1253 + | mut self,
|
1254 + | input: Option<
|
1255 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ByteSet>>,
|
1256 + | >,
|
1257 + | ) -> Self {
|
1258 + | self.byte_list = input.map(|v| v.into());
|
1259 + | self
|
1260 + | }
|
1261 + | #[allow(missing_docs)] // documentation missing in model
|
1262 + | pub fn short_list(mut self, input: ::std::option::Option<crate::model::ShortSet>) -> Self {
|
1263 + | self.short_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1264 + | self
|
1265 + | }
|
1266 + | #[allow(missing_docs)] // documentation missing in model
|
1267 + | pub(crate) fn set_short_list(
|
1268 + | mut self,
|
1269 + | input: Option<
|
1270 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ShortSet>>,
|
1271 + | >,
|
1272 + | ) -> Self {
|
1273 + | self.short_list = input.map(|v| v.into());
|
1274 + | self
|
1275 + | }
|
1276 + | #[allow(missing_docs)] // documentation missing in model
|
1277 + | pub fn integer_list(
|
1278 + | mut self,
|
1279 + | input: ::std::option::Option<crate::model::IntegerSet>,
|
1280 + | ) -> Self {
|
1281 + | self.integer_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1282 + | self
|
1283 + | }
|
1284 + | #[allow(missing_docs)] // documentation missing in model
|
1285 + | pub(crate) fn set_integer_list(
|
1286 + | mut self,
|
1287 + | input: Option<
|
1288 + | impl ::std::convert::Into<
|
1289 + | crate::constrained::MaybeConstrained<crate::model::IntegerSet>,
|
1290 + | >,
|
1291 + | >,
|
1292 + | ) -> Self {
|
1293 + | self.integer_list = input.map(|v| v.into());
|
1294 + | self
|
1295 + | }
|
1296 + | #[allow(missing_docs)] // documentation missing in model
|
1297 + | pub fn long_list(mut self, input: ::std::option::Option<crate::model::LongSet>) -> Self {
|
1298 + | self.long_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1299 + | self
|
1300 + | }
|
1301 + | #[allow(missing_docs)] // documentation missing in model
|
1302 + | pub(crate) fn set_long_list(
|
1303 + | mut self,
|
1304 + | input: Option<
|
1305 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LongSet>>,
|
1306 + | >,
|
1307 + | ) -> Self {
|
1308 + | self.long_list = input.map(|v| v.into());
|
1309 + | self
|
1310 + | }
|
1311 + | #[allow(missing_docs)] // documentation missing in model
|
1312 + | pub fn timestamp_list(
|
1313 + | mut self,
|
1314 + | input: ::std::option::Option<crate::model::TimestampSet>,
|
1315 + | ) -> Self {
|
1316 + | self.timestamp_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1317 + | self
|
1318 + | }
|
1319 + | #[allow(missing_docs)] // documentation missing in model
|
1320 + | pub(crate) fn set_timestamp_list(
|
1321 + | mut self,
|
1322 + | input: Option<
|
1323 + | impl ::std::convert::Into<
|
1324 + | crate::constrained::MaybeConstrained<crate::model::TimestampSet>,
|
1325 + | >,
|
1326 + | >,
|
1327 + | ) -> Self {
|
1328 + | self.timestamp_list = input.map(|v| v.into());
|
1329 + | self
|
1330 + | }
|
1331 + | #[allow(missing_docs)] // documentation missing in model
|
1332 + | pub fn date_time_list(
|
1333 + | mut self,
|
1334 + | input: ::std::option::Option<crate::model::DateTimeSet>,
|
1335 + | ) -> Self {
|
1336 + | self.date_time_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1337 + | self
|
1338 + | }
|
1339 + | #[allow(missing_docs)] // documentation missing in model
|
1340 + | pub(crate) fn set_date_time_list(
|
1341 + | mut self,
|
1342 + | input: Option<
|
1343 + | impl ::std::convert::Into<
|
1344 + | crate::constrained::MaybeConstrained<crate::model::DateTimeSet>,
|
1345 + | >,
|
1346 + | >,
|
1347 + | ) -> Self {
|
1348 + | self.date_time_list = input.map(|v| v.into());
|
1349 + | self
|
1350 + | }
|
1351 + | #[allow(missing_docs)] // documentation missing in model
|
1352 + | pub fn http_date_list(
|
1353 + | mut self,
|
1354 + | input: ::std::option::Option<crate::model::HttpDateSet>,
|
1355 + | ) -> Self {
|
1356 + | self.http_date_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1357 + | self
|
1358 + | }
|
1359 + | #[allow(missing_docs)] // documentation missing in model
|
1360 + | pub(crate) fn set_http_date_list(
|
1361 + | mut self,
|
1362 + | input: Option<
|
1363 + | impl ::std::convert::Into<
|
1364 + | crate::constrained::MaybeConstrained<crate::model::HttpDateSet>,
|
1365 + | >,
|
1366 + | >,
|
1367 + | ) -> Self {
|
1368 + | self.http_date_list = input.map(|v| v.into());
|
1369 + | self
|
1370 + | }
|
1371 + | #[allow(missing_docs)] // documentation missing in model
|
1372 + | pub fn enum_list(mut self, input: ::std::option::Option<crate::model::FooEnumSet>) -> Self {
|
1373 + | self.enum_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1374 + | self
|
1375 + | }
|
1376 + | #[allow(missing_docs)] // documentation missing in model
|
1377 + | pub(crate) fn set_enum_list(
|
1378 + | mut self,
|
1379 + | input: Option<
|
1380 + | impl ::std::convert::Into<
|
1381 + | crate::constrained::MaybeConstrained<crate::model::FooEnumSet>,
|
1382 + | >,
|
1383 + | >,
|
1384 + | ) -> Self {
|
1385 + | self.enum_list = input.map(|v| v.into());
|
1386 + | self
|
1387 + | }
|
1388 + | #[allow(missing_docs)] // documentation missing in model
|
1389 + | pub fn int_enum_list(
|
1390 + | mut self,
|
1391 + | input: ::std::option::Option<crate::model::IntegerEnumSet>,
|
1392 + | ) -> Self {
|
1393 + | self.int_enum_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1394 + | self
|
1395 + | }
|
1396 + | #[allow(missing_docs)] // documentation missing in model
|
1397 + | pub(crate) fn set_int_enum_list(
|
1398 + | mut self,
|
1399 + | input: Option<
|
1400 + | impl ::std::convert::Into<
|
1401 + | crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>,
|
1402 + | >,
|
1403 + | >,
|
1404 + | ) -> Self {
|
1405 + | self.int_enum_list = input.map(|v| v.into());
|
1406 + | self
|
1407 + | }
|
1408 + | #[allow(missing_docs)] // documentation missing in model
|
1409 + | pub fn list_list(mut self, input: ::std::option::Option<crate::model::ListSet>) -> Self {
|
1410 + | self.list_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1411 + | self
|
1412 + | }
|
1413 + | #[allow(missing_docs)] // documentation missing in model
|
1414 + | pub(crate) fn set_list_list(
|
1415 + | mut self,
|
1416 + | input: Option<
|
1417 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ListSet>>,
|
1418 + | >,
|
1419 + | ) -> Self {
|
1420 + | self.list_list = input.map(|v| v.into());
|
1421 + | self
|
1422 + | }
|
1423 + | #[allow(missing_docs)] // documentation missing in model
|
1424 + | pub fn structure_list(
|
1425 + | mut self,
|
1426 + | input: ::std::option::Option<crate::model::StructureSet>,
|
1427 + | ) -> Self {
|
1428 + | self.structure_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1429 + | self
|
1430 + | }
|
1431 + | #[allow(missing_docs)] // documentation missing in model
|
1432 + | pub(crate) fn set_structure_list(
|
1433 + | mut self,
|
1434 + | input: Option<
|
1435 + | impl ::std::convert::Into<
|
1436 + | crate::constrained::MaybeConstrained<crate::model::StructureSet>,
|
1437 + | >,
|
1438 + | >,
|
1439 + | ) -> Self {
|
1440 + | self.structure_list = input.map(|v| v.into());
|
1441 + | self
|
1442 + | }
|
1443 + | #[allow(missing_docs)] // documentation missing in model
|
1444 + | pub fn structure_list_with_no_key(
|
1445 + | mut self,
|
1446 + | input: ::std::option::Option<crate::model::StructureSetWithNoKey>,
|
1447 + | ) -> Self {
|
1448 + | self.structure_list_with_no_key =
|
1449 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
1450 + | self
|
1451 + | }
|
1452 + | #[allow(missing_docs)] // documentation missing in model
|
1453 + | pub(crate) fn set_structure_list_with_no_key(
|
1454 + | mut self,
|
1455 + | input: Option<
|
1456 + | impl ::std::convert::Into<
|
1457 + | crate::constrained::MaybeConstrained<crate::model::StructureSetWithNoKey>,
|
1458 + | >,
|
1459 + | >,
|
1460 + | ) -> Self {
|
1461 + | self.structure_list_with_no_key = input.map(|v| v.into());
|
1462 + | self
|
1463 + | }
|
1464 + | #[allow(missing_docs)] // documentation missing in model
|
1465 + | pub fn union_list(mut self, input: ::std::option::Option<crate::model::UnionSet>) -> Self {
|
1466 + | self.union_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1467 + | self
|
1468 + | }
|
1469 + | #[allow(missing_docs)] // documentation missing in model
|
1470 + | pub(crate) fn set_union_list(
|
1471 + | mut self,
|
1472 + | input: Option<
|
1473 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::UnionSet>>,
|
1474 + | >,
|
1475 + | ) -> Self {
|
1476 + | self.union_list = input.map(|v| v.into());
|
1477 + | self
|
1478 + | }
|
1479 + | /// Consumes the builder and constructs a [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput).
|
1480 + | ///
|
1481 + | /// The builder fails to construct a [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput) if a [`ConstraintViolation`] occurs.
|
1482 + | ///
|
1483 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1484 + | pub fn build(self) -> Result<crate::input::MalformedUniqueItemsInput, ConstraintViolation> {
|
1485 + | self.build_enforcing_all_constraints()
|
1486 + | }
|
1487 + | fn build_enforcing_all_constraints(
|
1488 + | self,
|
1489 + | ) -> Result<crate::input::MalformedUniqueItemsInput, ConstraintViolation> {
|
1490 + | Ok(crate::input::MalformedUniqueItemsInput {
|
1491 + | blob_list: self
|
1492 + | .blob_list
|
1493 + | .map(|v| match v {
|
1494 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1495 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1496 + | })
|
1497 + | .map(|res| res.map_err(ConstraintViolation::BlobList))
|
1498 + | .transpose()?,
|
1499 + | boolean_list: self
|
1500 + | .boolean_list
|
1501 + | .map(|v| match v {
|
1502 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1503 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1504 + | })
|
1505 + | .map(|res| res.map_err(ConstraintViolation::BooleanList))
|
1506 + | .transpose()?,
|
1507 + | string_list: self
|
1508 + | .string_list
|
1509 + | .map(|v| match v {
|
1510 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1511 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1512 + | })
|
1513 + | .map(|res| res.map_err(ConstraintViolation::StringList))
|
1514 + | .transpose()?,
|
1515 + | byte_list: self
|
1516 + | .byte_list
|
1517 + | .map(|v| match v {
|
1518 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1519 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1520 + | })
|
1521 + | .map(|res| res.map_err(ConstraintViolation::ByteList))
|
1522 + | .transpose()?,
|
1523 + | short_list: self
|
1524 + | .short_list
|
1525 + | .map(|v| match v {
|
1526 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1527 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1528 + | })
|
1529 + | .map(|res| res.map_err(ConstraintViolation::ShortList))
|
1530 + | .transpose()?,
|
1531 + | integer_list: self
|
1532 + | .integer_list
|
1533 + | .map(|v| match v {
|
1534 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1535 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1536 + | })
|
1537 + | .map(|res| res.map_err(ConstraintViolation::IntegerList))
|
1538 + | .transpose()?,
|
1539 + | long_list: self
|
1540 + | .long_list
|
1541 + | .map(|v| match v {
|
1542 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1543 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1544 + | })
|
1545 + | .map(|res| res.map_err(ConstraintViolation::LongList))
|
1546 + | .transpose()?,
|
1547 + | timestamp_list: self
|
1548 + | .timestamp_list
|
1549 + | .map(|v| match v {
|
1550 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1551 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1552 + | })
|
1553 + | .map(|res| res.map_err(ConstraintViolation::TimestampList))
|
1554 + | .transpose()?,
|
1555 + | date_time_list: self
|
1556 + | .date_time_list
|
1557 + | .map(|v| match v {
|
1558 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1559 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1560 + | })
|
1561 + | .map(|res| res.map_err(ConstraintViolation::DateTimeList))
|
1562 + | .transpose()?,
|
1563 + | http_date_list: self
|
1564 + | .http_date_list
|
1565 + | .map(|v| match v {
|
1566 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1567 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1568 + | })
|
1569 + | .map(|res| res.map_err(ConstraintViolation::HttpDateList))
|
1570 + | .transpose()?,
|
1571 + | enum_list: self
|
1572 + | .enum_list
|
1573 + | .map(|v| match v {
|
1574 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1575 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1576 + | })
|
1577 + | .map(|res| res.map_err(ConstraintViolation::EnumList))
|
1578 + | .transpose()?,
|
1579 + | int_enum_list: self
|
1580 + | .int_enum_list
|
1581 + | .map(|v| match v {
|
1582 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1583 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1584 + | })
|
1585 + | .map(|res| res.map_err(ConstraintViolation::IntEnumList))
|
1586 + | .transpose()?,
|
1587 + | list_list: self
|
1588 + | .list_list
|
1589 + | .map(|v| match v {
|
1590 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1591 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1592 + | })
|
1593 + | .map(|res| res.map_err(ConstraintViolation::ListList))
|
1594 + | .transpose()?,
|
1595 + | structure_list: self
|
1596 + | .structure_list
|
1597 + | .map(|v| match v {
|
1598 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1599 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1600 + | })
|
1601 + | .map(|res| res.map_err(ConstraintViolation::StructureList))
|
1602 + | .transpose()?,
|
1603 + | structure_list_with_no_key: self
|
1604 + | .structure_list_with_no_key
|
1605 + | .map(|v| match v {
|
1606 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1607 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1608 + | })
|
1609 + | .map(|res| res.map_err(ConstraintViolation::StructureListWithNoKey))
|
1610 + | .transpose()?,
|
1611 + | union_list: self
|
1612 + | .union_list
|
1613 + | .map(|v| match v {
|
1614 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1615 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1616 + | })
|
1617 + | .map(|res| res.map_err(ConstraintViolation::UnionList))
|
1618 + | .transpose()?,
|
1619 + | })
|
1620 + | }
|
1621 + | }
|
1622 + | }
|
1623 + | /// See [`MalformedRequiredInput`](crate::input::MalformedRequiredInput).
|
1624 + | pub mod malformed_required_input {
|
1625 + |
|
1626 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1627 + | /// Holds one variant for each of the ways the builder can fail.
|
1628 + | #[non_exhaustive]
|
1629 + | #[allow(clippy::enum_variant_names)]
|
1630 + | pub enum ConstraintViolation {
|
1631 + | /// `string` was not provided but it is required when building `MalformedRequiredInput`.
|
1632 + | MissingString,
|
1633 + | /// `string_in_query` was not provided but it is required when building `MalformedRequiredInput`.
|
1634 + | MissingStringInQuery,
|
1635 + | /// `string_in_header` was not provided but it is required when building `MalformedRequiredInput`.
|
1636 + | MissingStringInHeader,
|
1637 + | }
|
1638 + | impl ::std::fmt::Display for ConstraintViolation {
|
1639 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1640 + | match self {
|
1641 + | ConstraintViolation::MissingString => write!(f, "`string` was not provided but it is required when building `MalformedRequiredInput`"),
|
1642 + | ConstraintViolation::MissingStringInQuery => write!(f, "`string_in_query` was not provided but it is required when building `MalformedRequiredInput`"),
|
1643 + | ConstraintViolation::MissingStringInHeader => write!(f, "`string_in_header` was not provided but it is required when building `MalformedRequiredInput`"),
|
1644 + | }
|
1645 + | }
|
1646 + | }
|
1647 + | impl ::std::error::Error for ConstraintViolation {}
|
1648 + | impl ConstraintViolation {
|
1649 + | pub(crate) fn as_validation_exception_field(
|
1650 + | self,
|
1651 + | path: ::std::string::String,
|
1652 + | ) -> crate::model::ValidationExceptionField {
|
1653 + | match self {
|
1654 + | ConstraintViolation::MissingString => crate::model::ValidationExceptionField {
|
1655 + | message: format!("Value at '{}/string' failed to satisfy constraint: Member must not be null", path),
|
1656 + | path: path + "/string",
|
1657 + | },
|
1658 + | ConstraintViolation::MissingStringInQuery => crate::model::ValidationExceptionField {
|
1659 + | message: format!("Value at '{}/stringInQuery' failed to satisfy constraint: Member must not be null", path),
|
1660 + | path: path + "/stringInQuery",
|
1661 + | },
|
1662 + | ConstraintViolation::MissingStringInHeader => crate::model::ValidationExceptionField {
|
1663 + | message: format!("Value at '{}/stringInHeader' failed to satisfy constraint: Member must not be null", path),
|
1664 + | path: path + "/stringInHeader",
|
1665 + | },
|
1666 + | }
|
1667 + | }
|
1668 + | }
|
1669 + | impl ::std::convert::From<ConstraintViolation>
|
1670 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1671 + | {
|
1672 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1673 + | let first_validation_exception_field =
|
1674 + | constraint_violation.as_validation_exception_field("".to_owned());
|
1675 + | let validation_exception = crate::error::ValidationException {
|
1676 + | message: format!(
|
1677 + | "1 validation error detected. {}",
|
1678 + | &first_validation_exception_field.message
|
1679 + | ),
|
1680 + | field_list: Some(vec![first_validation_exception_field]),
|
1681 + | };
|
1682 + | Self::ConstraintViolation(
|
1683 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1684 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1685 + | )
|
1686 + | }
|
1687 + | }
|
1688 + | impl ::std::convert::From<Builder>
|
1689 + | for crate::constrained::MaybeConstrained<crate::input::MalformedRequiredInput>
|
1690 + | {
|
1691 + | fn from(builder: Builder) -> Self {
|
1692 + | Self::Unconstrained(builder)
|
1693 + | }
|
1694 + | }
|
1695 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedRequiredInput {
|
1696 + | type Error = ConstraintViolation;
|
1697 + |
|
1698 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1699 + | builder.build()
|
1700 + | }
|
1701 + | }
|
1702 + | /// A builder for [`MalformedRequiredInput`](crate::input::MalformedRequiredInput).
|
1703 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1704 + | pub struct Builder {
|
1705 + | pub(crate) string: ::std::option::Option<::std::string::String>,
|
1706 + | pub(crate) string_in_query: ::std::option::Option<::std::string::String>,
|
1707 + | pub(crate) string_in_header: ::std::option::Option<::std::string::String>,
|
1708 + | }
|
1709 + | impl Builder {
|
1710 + | #[allow(missing_docs)] // documentation missing in model
|
1711 + | pub fn string(mut self, input: ::std::string::String) -> Self {
|
1712 + | self.string = Some(input);
|
1713 + | self
|
1714 + | }
|
1715 + | #[allow(missing_docs)] // documentation missing in model
|
1716 + | pub(crate) fn set_string(
|
1717 + | mut self,
|
1718 + | input: impl ::std::convert::Into<::std::string::String>,
|
1719 + | ) -> Self {
|
1720 + | self.string = Some(input.into());
|
1721 + | self
|
1722 + | }
|
1723 + | #[allow(missing_docs)] // documentation missing in model
|
1724 + | pub fn string_in_query(mut self, input: ::std::string::String) -> Self {
|
1725 + | self.string_in_query = Some(input);
|
1726 + | self
|
1727 + | }
|
1728 + | #[allow(missing_docs)] // documentation missing in model
|
1729 + | pub(crate) fn set_string_in_query(
|
1730 + | mut self,
|
1731 + | input: impl ::std::convert::Into<::std::string::String>,
|
1732 + | ) -> Self {
|
1733 + | self.string_in_query = Some(input.into());
|
1734 + | self
|
1735 + | }
|
1736 + | #[allow(missing_docs)] // documentation missing in model
|
1737 + | pub fn string_in_header(mut self, input: ::std::string::String) -> Self {
|
1738 + | self.string_in_header = Some(input);
|
1739 + | self
|
1740 + | }
|
1741 + | #[allow(missing_docs)] // documentation missing in model
|
1742 + | pub(crate) fn set_string_in_header(
|
1743 + | mut self,
|
1744 + | input: impl ::std::convert::Into<::std::string::String>,
|
1745 + | ) -> Self {
|
1746 + | self.string_in_header = Some(input.into());
|
1747 + | self
|
1748 + | }
|
1749 + | /// Consumes the builder and constructs a [`MalformedRequiredInput`](crate::input::MalformedRequiredInput).
|
1750 + | ///
|
1751 + | /// The builder fails to construct a [`MalformedRequiredInput`](crate::input::MalformedRequiredInput) if a [`ConstraintViolation`] occurs.
|
1752 + | ///
|
1753 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1754 + | pub fn build(self) -> Result<crate::input::MalformedRequiredInput, ConstraintViolation> {
|
1755 + | self.build_enforcing_all_constraints()
|
1756 + | }
|
1757 + | fn build_enforcing_all_constraints(
|
1758 + | self,
|
1759 + | ) -> Result<crate::input::MalformedRequiredInput, ConstraintViolation> {
|
1760 + | Ok(crate::input::MalformedRequiredInput {
|
1761 + | string: self.string.ok_or(ConstraintViolation::MissingString)?,
|
1762 + | string_in_query: self
|
1763 + | .string_in_query
|
1764 + | .ok_or(ConstraintViolation::MissingStringInQuery)?,
|
1765 + | string_in_header: self
|
1766 + | .string_in_header
|
1767 + | .ok_or(ConstraintViolation::MissingStringInHeader)?,
|
1768 + | })
|
1769 + | }
|
1770 + | }
|
1771 + | }
|
1772 + | /// See [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput).
|
1773 + | pub mod malformed_range_override_input {
|
1774 + |
|
1775 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1776 + | /// Holds one variant for each of the ways the builder can fail.
|
1777 + | #[non_exhaustive]
|
1778 + | #[allow(clippy::enum_variant_names)]
|
1779 + | pub enum ConstraintViolation {
|
1780 + | /// Constraint violation occurred building member `byte` when building `MalformedRangeOverrideInput`.
|
1781 + | #[doc(hidden)]
|
1782 + | Byte(crate::input::malformed_range_override_input::byte::ConstraintViolation),
|
1783 + | /// Constraint violation occurred building member `min_byte` when building `MalformedRangeOverrideInput`.
|
1784 + | #[doc(hidden)]
|
1785 + | MinByte(crate::input::malformed_range_override_input::min_byte::ConstraintViolation),
|
1786 + | /// Constraint violation occurred building member `max_byte` when building `MalformedRangeOverrideInput`.
|
1787 + | #[doc(hidden)]
|
1788 + | MaxByte(crate::input::malformed_range_override_input::max_byte::ConstraintViolation),
|
1789 + | /// Constraint violation occurred building member `short` when building `MalformedRangeOverrideInput`.
|
1790 + | #[doc(hidden)]
|
1791 + | Short(crate::input::malformed_range_override_input::short::ConstraintViolation),
|
1792 + | /// Constraint violation occurred building member `min_short` when building `MalformedRangeOverrideInput`.
|
1793 + | #[doc(hidden)]
|
1794 + | MinShort(crate::input::malformed_range_override_input::min_short::ConstraintViolation),
|
1795 + | /// Constraint violation occurred building member `max_short` when building `MalformedRangeOverrideInput`.
|
1796 + | #[doc(hidden)]
|
1797 + | MaxShort(crate::input::malformed_range_override_input::max_short::ConstraintViolation),
|
1798 + | /// Constraint violation occurred building member `integer` when building `MalformedRangeOverrideInput`.
|
1799 + | #[doc(hidden)]
|
1800 + | Integer(crate::input::malformed_range_override_input::integer::ConstraintViolation),
|
1801 + | /// Constraint violation occurred building member `min_integer` when building `MalformedRangeOverrideInput`.
|
1802 + | #[doc(hidden)]
|
1803 + | MinInteger(crate::input::malformed_range_override_input::min_integer::ConstraintViolation),
|
1804 + | /// Constraint violation occurred building member `max_integer` when building `MalformedRangeOverrideInput`.
|
1805 + | #[doc(hidden)]
|
1806 + | MaxInteger(crate::input::malformed_range_override_input::max_integer::ConstraintViolation),
|
1807 + | /// Constraint violation occurred building member `long` when building `MalformedRangeOverrideInput`.
|
1808 + | #[doc(hidden)]
|
1809 + | Long(crate::input::malformed_range_override_input::long::ConstraintViolation),
|
1810 + | /// Constraint violation occurred building member `min_long` when building `MalformedRangeOverrideInput`.
|
1811 + | #[doc(hidden)]
|
1812 + | MinLong(crate::input::malformed_range_override_input::min_long::ConstraintViolation),
|
1813 + | /// Constraint violation occurred building member `max_long` when building `MalformedRangeOverrideInput`.
|
1814 + | #[doc(hidden)]
|
1815 + | MaxLong(crate::input::malformed_range_override_input::max_long::ConstraintViolation),
|
1816 + | }
|
1817 + | impl ::std::fmt::Display for ConstraintViolation {
|
1818 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1819 + | match self {
|
1820 + | ConstraintViolation::Byte(_) => write!(f, "constraint violation occurred building member `byte` when building `MalformedRangeOverrideInput`"),
|
1821 + | ConstraintViolation::MinByte(_) => write!(f, "constraint violation occurred building member `min_byte` when building `MalformedRangeOverrideInput`"),
|
1822 + | ConstraintViolation::MaxByte(_) => write!(f, "constraint violation occurred building member `max_byte` when building `MalformedRangeOverrideInput`"),
|
1823 + | ConstraintViolation::Short(_) => write!(f, "constraint violation occurred building member `short` when building `MalformedRangeOverrideInput`"),
|
1824 + | ConstraintViolation::MinShort(_) => write!(f, "constraint violation occurred building member `min_short` when building `MalformedRangeOverrideInput`"),
|
1825 + | ConstraintViolation::MaxShort(_) => write!(f, "constraint violation occurred building member `max_short` when building `MalformedRangeOverrideInput`"),
|
1826 + | ConstraintViolation::Integer(_) => write!(f, "constraint violation occurred building member `integer` when building `MalformedRangeOverrideInput`"),
|
1827 + | ConstraintViolation::MinInteger(_) => write!(f, "constraint violation occurred building member `min_integer` when building `MalformedRangeOverrideInput`"),
|
1828 + | ConstraintViolation::MaxInteger(_) => write!(f, "constraint violation occurred building member `max_integer` when building `MalformedRangeOverrideInput`"),
|
1829 + | ConstraintViolation::Long(_) => write!(f, "constraint violation occurred building member `long` when building `MalformedRangeOverrideInput`"),
|
1830 + | ConstraintViolation::MinLong(_) => write!(f, "constraint violation occurred building member `min_long` when building `MalformedRangeOverrideInput`"),
|
1831 + | ConstraintViolation::MaxLong(_) => write!(f, "constraint violation occurred building member `max_long` when building `MalformedRangeOverrideInput`"),
|
1832 + | }
|
1833 + | }
|
1834 + | }
|
1835 + | impl ::std::error::Error for ConstraintViolation {}
|
1836 + | impl ConstraintViolation {
|
1837 + | pub(crate) fn as_validation_exception_field(
|
1838 + | self,
|
1839 + | path: ::std::string::String,
|
1840 + | ) -> crate::model::ValidationExceptionField {
|
1841 + | match self {
|
1842 + | ConstraintViolation::Byte(inner) => {
|
1843 + | inner.as_validation_exception_field(path + "/byte")
|
1844 + | }
|
1845 + | ConstraintViolation::MinByte(inner) => {
|
1846 + | inner.as_validation_exception_field(path + "/minByte")
|
1847 + | }
|
1848 + | ConstraintViolation::MaxByte(inner) => {
|
1849 + | inner.as_validation_exception_field(path + "/maxByte")
|
1850 + | }
|
1851 + | ConstraintViolation::Short(inner) => {
|
1852 + | inner.as_validation_exception_field(path + "/short")
|
1853 + | }
|
1854 + | ConstraintViolation::MinShort(inner) => {
|
1855 + | inner.as_validation_exception_field(path + "/minShort")
|
1856 + | }
|
1857 + | ConstraintViolation::MaxShort(inner) => {
|
1858 + | inner.as_validation_exception_field(path + "/maxShort")
|
1859 + | }
|
1860 + | ConstraintViolation::Integer(inner) => {
|
1861 + | inner.as_validation_exception_field(path + "/integer")
|
1862 + | }
|
1863 + | ConstraintViolation::MinInteger(inner) => {
|
1864 + | inner.as_validation_exception_field(path + "/minInteger")
|
1865 + | }
|
1866 + | ConstraintViolation::MaxInteger(inner) => {
|
1867 + | inner.as_validation_exception_field(path + "/maxInteger")
|
1868 + | }
|
1869 + | ConstraintViolation::Long(inner) => {
|
1870 + | inner.as_validation_exception_field(path + "/long")
|
1871 + | }
|
1872 + | ConstraintViolation::MinLong(inner) => {
|
1873 + | inner.as_validation_exception_field(path + "/minLong")
|
1874 + | }
|
1875 + | ConstraintViolation::MaxLong(inner) => {
|
1876 + | inner.as_validation_exception_field(path + "/maxLong")
|
1877 + | }
|
1878 + | }
|
1879 + | }
|
1880 + | }
|
1881 + | impl ::std::convert::From<ConstraintViolation>
|
1882 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1883 + | {
|
1884 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1885 + | let first_validation_exception_field =
|
1886 + | constraint_violation.as_validation_exception_field("".to_owned());
|
1887 + | let validation_exception = crate::error::ValidationException {
|
1888 + | message: format!(
|
1889 + | "1 validation error detected. {}",
|
1890 + | &first_validation_exception_field.message
|
1891 + | ),
|
1892 + | field_list: Some(vec![first_validation_exception_field]),
|
1893 + | };
|
1894 + | Self::ConstraintViolation(
|
1895 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1896 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1897 + | )
|
1898 + | }
|
1899 + | }
|
1900 + | impl ::std::convert::From<Builder>
|
1901 + | for crate::constrained::MaybeConstrained<crate::input::MalformedRangeOverrideInput>
|
1902 + | {
|
1903 + | fn from(builder: Builder) -> Self {
|
1904 + | Self::Unconstrained(builder)
|
1905 + | }
|
1906 + | }
|
1907 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedRangeOverrideInput {
|
1908 + | type Error = ConstraintViolation;
|
1909 + |
|
1910 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1911 + | builder.build()
|
1912 + | }
|
1913 + | }
|
1914 + | /// A builder for [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput).
|
1915 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1916 + | pub struct Builder {
|
1917 + | pub(crate) byte: ::std::option::Option<
|
1918 + | crate::constrained::MaybeConstrained<
|
1919 + | crate::input::malformed_range_override_input::Byte,
|
1920 + | >,
|
1921 + | >,
|
1922 + | pub(crate) min_byte: ::std::option::Option<
|
1923 + | crate::constrained::MaybeConstrained<
|
1924 + | crate::input::malformed_range_override_input::MinByte,
|
1925 + | >,
|
1926 + | >,
|
1927 + | pub(crate) max_byte: ::std::option::Option<
|
1928 + | crate::constrained::MaybeConstrained<
|
1929 + | crate::input::malformed_range_override_input::MaxByte,
|
1930 + | >,
|
1931 + | >,
|
1932 + | pub(crate) short: ::std::option::Option<
|
1933 + | crate::constrained::MaybeConstrained<
|
1934 + | crate::input::malformed_range_override_input::Short,
|
1935 + | >,
|
1936 + | >,
|
1937 + | pub(crate) min_short: ::std::option::Option<
|
1938 + | crate::constrained::MaybeConstrained<
|
1939 + | crate::input::malformed_range_override_input::MinShort,
|
1940 + | >,
|
1941 + | >,
|
1942 + | pub(crate) max_short: ::std::option::Option<
|
1943 + | crate::constrained::MaybeConstrained<
|
1944 + | crate::input::malformed_range_override_input::MaxShort,
|
1945 + | >,
|
1946 + | >,
|
1947 + | pub(crate) integer: ::std::option::Option<
|
1948 + | crate::constrained::MaybeConstrained<
|
1949 + | crate::input::malformed_range_override_input::Integer,
|
1950 + | >,
|
1951 + | >,
|
1952 + | pub(crate) min_integer: ::std::option::Option<
|
1953 + | crate::constrained::MaybeConstrained<
|
1954 + | crate::input::malformed_range_override_input::MinInteger,
|
1955 + | >,
|
1956 + | >,
|
1957 + | pub(crate) max_integer: ::std::option::Option<
|
1958 + | crate::constrained::MaybeConstrained<
|
1959 + | crate::input::malformed_range_override_input::MaxInteger,
|
1960 + | >,
|
1961 + | >,
|
1962 + | pub(crate) long: ::std::option::Option<
|
1963 + | crate::constrained::MaybeConstrained<
|
1964 + | crate::input::malformed_range_override_input::Long,
|
1965 + | >,
|
1966 + | >,
|
1967 + | pub(crate) min_long: ::std::option::Option<
|
1968 + | crate::constrained::MaybeConstrained<
|
1969 + | crate::input::malformed_range_override_input::MinLong,
|
1970 + | >,
|
1971 + | >,
|
1972 + | pub(crate) max_long: ::std::option::Option<
|
1973 + | crate::constrained::MaybeConstrained<
|
1974 + | crate::input::malformed_range_override_input::MaxLong,
|
1975 + | >,
|
1976 + | >,
|
1977 + | pub(crate) float: ::std::option::Option<f32>,
|
1978 + | pub(crate) min_float: ::std::option::Option<f32>,
|
1979 + | pub(crate) max_float: ::std::option::Option<f32>,
|
1980 + | }
|
1981 + | impl Builder {
|
1982 + | #[allow(missing_docs)] // documentation missing in model
|
1983 + | pub fn byte(
|
1984 + | mut self,
|
1985 + | input: ::std::option::Option<crate::input::malformed_range_override_input::Byte>,
|
1986 + | ) -> Self {
|
1987 + | self.byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1988 + | self
|
1989 + | }
|
1990 + | #[allow(missing_docs)] // documentation missing in model
|
1991 + | pub(crate) fn set_byte(
|
1992 + | mut self,
|
1993 + | input: Option<
|
1994 + | impl ::std::convert::Into<
|
1995 + | crate::constrained::MaybeConstrained<
|
1996 + | crate::input::malformed_range_override_input::Byte,
|
1997 + | >,
|
1998 + | >,
|
1999 + | >,
|
2000 + | ) -> Self {
|
2001 + | self.byte = input.map(|v| v.into());
|
2002 + | self
|
2003 + | }
|
2004 + | #[allow(missing_docs)] // documentation missing in model
|
2005 + | pub fn min_byte(
|
2006 + | mut self,
|
2007 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MinByte>,
|
2008 + | ) -> Self {
|
2009 + | self.min_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2010 + | self
|
2011 + | }
|
2012 + | #[allow(missing_docs)] // documentation missing in model
|
2013 + | pub(crate) fn set_min_byte(
|
2014 + | mut self,
|
2015 + | input: Option<
|
2016 + | impl ::std::convert::Into<
|
2017 + | crate::constrained::MaybeConstrained<
|
2018 + | crate::input::malformed_range_override_input::MinByte,
|
2019 + | >,
|
2020 + | >,
|
2021 + | >,
|
2022 + | ) -> Self {
|
2023 + | self.min_byte = input.map(|v| v.into());
|
2024 + | self
|
2025 + | }
|
2026 + | #[allow(missing_docs)] // documentation missing in model
|
2027 + | pub fn max_byte(
|
2028 + | mut self,
|
2029 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MaxByte>,
|
2030 + | ) -> Self {
|
2031 + | self.max_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2032 + | self
|
2033 + | }
|
2034 + | #[allow(missing_docs)] // documentation missing in model
|
2035 + | pub(crate) fn set_max_byte(
|
2036 + | mut self,
|
2037 + | input: Option<
|
2038 + | impl ::std::convert::Into<
|
2039 + | crate::constrained::MaybeConstrained<
|
2040 + | crate::input::malformed_range_override_input::MaxByte,
|
2041 + | >,
|
2042 + | >,
|
2043 + | >,
|
2044 + | ) -> Self {
|
2045 + | self.max_byte = input.map(|v| v.into());
|
2046 + | self
|
2047 + | }
|
2048 + | #[allow(missing_docs)] // documentation missing in model
|
2049 + | pub fn short(
|
2050 + | mut self,
|
2051 + | input: ::std::option::Option<crate::input::malformed_range_override_input::Short>,
|
2052 + | ) -> Self {
|
2053 + | self.short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2054 + | self
|
2055 + | }
|
2056 + | #[allow(missing_docs)] // documentation missing in model
|
2057 + | pub(crate) fn set_short(
|
2058 + | mut self,
|
2059 + | input: Option<
|
2060 + | impl ::std::convert::Into<
|
2061 + | crate::constrained::MaybeConstrained<
|
2062 + | crate::input::malformed_range_override_input::Short,
|
2063 + | >,
|
2064 + | >,
|
2065 + | >,
|
2066 + | ) -> Self {
|
2067 + | self.short = input.map(|v| v.into());
|
2068 + | self
|
2069 + | }
|
2070 + | #[allow(missing_docs)] // documentation missing in model
|
2071 + | pub fn min_short(
|
2072 + | mut self,
|
2073 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MinShort>,
|
2074 + | ) -> Self {
|
2075 + | self.min_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2076 + | self
|
2077 + | }
|
2078 + | #[allow(missing_docs)] // documentation missing in model
|
2079 + | pub(crate) fn set_min_short(
|
2080 + | mut self,
|
2081 + | input: Option<
|
2082 + | impl ::std::convert::Into<
|
2083 + | crate::constrained::MaybeConstrained<
|
2084 + | crate::input::malformed_range_override_input::MinShort,
|
2085 + | >,
|
2086 + | >,
|
2087 + | >,
|
2088 + | ) -> Self {
|
2089 + | self.min_short = input.map(|v| v.into());
|
2090 + | self
|
2091 + | }
|
2092 + | #[allow(missing_docs)] // documentation missing in model
|
2093 + | pub fn max_short(
|
2094 + | mut self,
|
2095 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MaxShort>,
|
2096 + | ) -> Self {
|
2097 + | self.max_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2098 + | self
|
2099 + | }
|
2100 + | #[allow(missing_docs)] // documentation missing in model
|
2101 + | pub(crate) fn set_max_short(
|
2102 + | mut self,
|
2103 + | input: Option<
|
2104 + | impl ::std::convert::Into<
|
2105 + | crate::constrained::MaybeConstrained<
|
2106 + | crate::input::malformed_range_override_input::MaxShort,
|
2107 + | >,
|
2108 + | >,
|
2109 + | >,
|
2110 + | ) -> Self {
|
2111 + | self.max_short = input.map(|v| v.into());
|
2112 + | self
|
2113 + | }
|
2114 + | #[allow(missing_docs)] // documentation missing in model
|
2115 + | pub fn integer(
|
2116 + | mut self,
|
2117 + | input: ::std::option::Option<crate::input::malformed_range_override_input::Integer>,
|
2118 + | ) -> Self {
|
2119 + | self.integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2120 + | self
|
2121 + | }
|
2122 + | #[allow(missing_docs)] // documentation missing in model
|
2123 + | pub(crate) fn set_integer(
|
2124 + | mut self,
|
2125 + | input: Option<
|
2126 + | impl ::std::convert::Into<
|
2127 + | crate::constrained::MaybeConstrained<
|
2128 + | crate::input::malformed_range_override_input::Integer,
|
2129 + | >,
|
2130 + | >,
|
2131 + | >,
|
2132 + | ) -> Self {
|
2133 + | self.integer = input.map(|v| v.into());
|
2134 + | self
|
2135 + | }
|
2136 + | #[allow(missing_docs)] // documentation missing in model
|
2137 + | pub fn min_integer(
|
2138 + | mut self,
|
2139 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MinInteger>,
|
2140 + | ) -> Self {
|
2141 + | self.min_integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2142 + | self
|
2143 + | }
|
2144 + | #[allow(missing_docs)] // documentation missing in model
|
2145 + | pub(crate) fn set_min_integer(
|
2146 + | mut self,
|
2147 + | input: Option<
|
2148 + | impl ::std::convert::Into<
|
2149 + | crate::constrained::MaybeConstrained<
|
2150 + | crate::input::malformed_range_override_input::MinInteger,
|
2151 + | >,
|
2152 + | >,
|
2153 + | >,
|
2154 + | ) -> Self {
|
2155 + | self.min_integer = input.map(|v| v.into());
|
2156 + | self
|
2157 + | }
|
2158 + | #[allow(missing_docs)] // documentation missing in model
|
2159 + | pub fn max_integer(
|
2160 + | mut self,
|
2161 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MaxInteger>,
|
2162 + | ) -> Self {
|
2163 + | self.max_integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2164 + | self
|
2165 + | }
|
2166 + | #[allow(missing_docs)] // documentation missing in model
|
2167 + | pub(crate) fn set_max_integer(
|
2168 + | mut self,
|
2169 + | input: Option<
|
2170 + | impl ::std::convert::Into<
|
2171 + | crate::constrained::MaybeConstrained<
|
2172 + | crate::input::malformed_range_override_input::MaxInteger,
|
2173 + | >,
|
2174 + | >,
|
2175 + | >,
|
2176 + | ) -> Self {
|
2177 + | self.max_integer = input.map(|v| v.into());
|
2178 + | self
|
2179 + | }
|
2180 + | #[allow(missing_docs)] // documentation missing in model
|
2181 + | pub fn long(
|
2182 + | mut self,
|
2183 + | input: ::std::option::Option<crate::input::malformed_range_override_input::Long>,
|
2184 + | ) -> Self {
|
2185 + | self.long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2186 + | self
|
2187 + | }
|
2188 + | #[allow(missing_docs)] // documentation missing in model
|
2189 + | pub(crate) fn set_long(
|
2190 + | mut self,
|
2191 + | input: Option<
|
2192 + | impl ::std::convert::Into<
|
2193 + | crate::constrained::MaybeConstrained<
|
2194 + | crate::input::malformed_range_override_input::Long,
|
2195 + | >,
|
2196 + | >,
|
2197 + | >,
|
2198 + | ) -> Self {
|
2199 + | self.long = input.map(|v| v.into());
|
2200 + | self
|
2201 + | }
|
2202 + | #[allow(missing_docs)] // documentation missing in model
|
2203 + | pub fn min_long(
|
2204 + | mut self,
|
2205 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MinLong>,
|
2206 + | ) -> Self {
|
2207 + | self.min_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2208 + | self
|
2209 + | }
|
2210 + | #[allow(missing_docs)] // documentation missing in model
|
2211 + | pub(crate) fn set_min_long(
|
2212 + | mut self,
|
2213 + | input: Option<
|
2214 + | impl ::std::convert::Into<
|
2215 + | crate::constrained::MaybeConstrained<
|
2216 + | crate::input::malformed_range_override_input::MinLong,
|
2217 + | >,
|
2218 + | >,
|
2219 + | >,
|
2220 + | ) -> Self {
|
2221 + | self.min_long = input.map(|v| v.into());
|
2222 + | self
|
2223 + | }
|
2224 + | #[allow(missing_docs)] // documentation missing in model
|
2225 + | pub fn max_long(
|
2226 + | mut self,
|
2227 + | input: ::std::option::Option<crate::input::malformed_range_override_input::MaxLong>,
|
2228 + | ) -> Self {
|
2229 + | self.max_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2230 + | self
|
2231 + | }
|
2232 + | #[allow(missing_docs)] // documentation missing in model
|
2233 + | pub(crate) fn set_max_long(
|
2234 + | mut self,
|
2235 + | input: Option<
|
2236 + | impl ::std::convert::Into<
|
2237 + | crate::constrained::MaybeConstrained<
|
2238 + | crate::input::malformed_range_override_input::MaxLong,
|
2239 + | >,
|
2240 + | >,
|
2241 + | >,
|
2242 + | ) -> Self {
|
2243 + | self.max_long = input.map(|v| v.into());
|
2244 + | self
|
2245 + | }
|
2246 + | #[allow(missing_docs)] // documentation missing in model
|
2247 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
2248 + | self.float = input;
|
2249 + | self
|
2250 + | }
|
2251 + | #[allow(missing_docs)] // documentation missing in model
|
2252 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
2253 + | self.float = input.map(|v| v.into());
|
2254 + | self
|
2255 + | }
|
2256 + | #[allow(missing_docs)] // documentation missing in model
|
2257 + | pub fn min_float(mut self, input: ::std::option::Option<f32>) -> Self {
|
2258 + | self.min_float = input;
|
2259 + | self
|
2260 + | }
|
2261 + | #[allow(missing_docs)] // documentation missing in model
|
2262 + | pub(crate) fn set_min_float(
|
2263 + | mut self,
|
2264 + | input: Option<impl ::std::convert::Into<f32>>,
|
2265 + | ) -> Self {
|
2266 + | self.min_float = input.map(|v| v.into());
|
2267 + | self
|
2268 + | }
|
2269 + | #[allow(missing_docs)] // documentation missing in model
|
2270 + | pub fn max_float(mut self, input: ::std::option::Option<f32>) -> Self {
|
2271 + | self.max_float = input;
|
2272 + | self
|
2273 + | }
|
2274 + | #[allow(missing_docs)] // documentation missing in model
|
2275 + | pub(crate) fn set_max_float(
|
2276 + | mut self,
|
2277 + | input: Option<impl ::std::convert::Into<f32>>,
|
2278 + | ) -> Self {
|
2279 + | self.max_float = input.map(|v| v.into());
|
2280 + | self
|
2281 + | }
|
2282 + | /// Consumes the builder and constructs a [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput).
|
2283 + | ///
|
2284 + | /// The builder fails to construct a [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput) if a [`ConstraintViolation`] occurs.
|
2285 + | ///
|
2286 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2287 + | pub fn build(
|
2288 + | self,
|
2289 + | ) -> Result<crate::input::MalformedRangeOverrideInput, ConstraintViolation> {
|
2290 + | self.build_enforcing_all_constraints()
|
2291 + | }
|
2292 + | fn build_enforcing_all_constraints(
|
2293 + | self,
|
2294 + | ) -> Result<crate::input::MalformedRangeOverrideInput, ConstraintViolation> {
|
2295 + | Ok(crate::input::MalformedRangeOverrideInput {
|
2296 + | byte: self
|
2297 + | .byte
|
2298 + | .map(|v| match v {
|
2299 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2300 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2301 + | })
|
2302 + | .map(|res| res.map_err(ConstraintViolation::Byte))
|
2303 + | .transpose()?,
|
2304 + | min_byte: self
|
2305 + | .min_byte
|
2306 + | .map(|v| match v {
|
2307 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2308 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2309 + | })
|
2310 + | .map(|res| res.map_err(ConstraintViolation::MinByte))
|
2311 + | .transpose()?,
|
2312 + | max_byte: self
|
2313 + | .max_byte
|
2314 + | .map(|v| match v {
|
2315 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2316 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2317 + | })
|
2318 + | .map(|res| res.map_err(ConstraintViolation::MaxByte))
|
2319 + | .transpose()?,
|
2320 + | short: self
|
2321 + | .short
|
2322 + | .map(|v| match v {
|
2323 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2324 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2325 + | })
|
2326 + | .map(|res| res.map_err(ConstraintViolation::Short))
|
2327 + | .transpose()?,
|
2328 + | min_short: self
|
2329 + | .min_short
|
2330 + | .map(|v| match v {
|
2331 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2332 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2333 + | })
|
2334 + | .map(|res| res.map_err(ConstraintViolation::MinShort))
|
2335 + | .transpose()?,
|
2336 + | max_short: self
|
2337 + | .max_short
|
2338 + | .map(|v| match v {
|
2339 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2340 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2341 + | })
|
2342 + | .map(|res| res.map_err(ConstraintViolation::MaxShort))
|
2343 + | .transpose()?,
|
2344 + | integer: self
|
2345 + | .integer
|
2346 + | .map(|v| match v {
|
2347 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2348 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2349 + | })
|
2350 + | .map(|res| res.map_err(ConstraintViolation::Integer))
|
2351 + | .transpose()?,
|
2352 + | min_integer: self
|
2353 + | .min_integer
|
2354 + | .map(|v| match v {
|
2355 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2356 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2357 + | })
|
2358 + | .map(|res| res.map_err(ConstraintViolation::MinInteger))
|
2359 + | .transpose()?,
|
2360 + | max_integer: self
|
2361 + | .max_integer
|
2362 + | .map(|v| match v {
|
2363 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2364 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2365 + | })
|
2366 + | .map(|res| res.map_err(ConstraintViolation::MaxInteger))
|
2367 + | .transpose()?,
|
2368 + | long: self
|
2369 + | .long
|
2370 + | .map(|v| match v {
|
2371 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2372 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2373 + | })
|
2374 + | .map(|res| res.map_err(ConstraintViolation::Long))
|
2375 + | .transpose()?,
|
2376 + | min_long: self
|
2377 + | .min_long
|
2378 + | .map(|v| match v {
|
2379 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2380 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2381 + | })
|
2382 + | .map(|res| res.map_err(ConstraintViolation::MinLong))
|
2383 + | .transpose()?,
|
2384 + | max_long: self
|
2385 + | .max_long
|
2386 + | .map(|v| match v {
|
2387 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2388 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2389 + | })
|
2390 + | .map(|res| res.map_err(ConstraintViolation::MaxLong))
|
2391 + | .transpose()?,
|
2392 + | float: self.float,
|
2393 + | min_float: self.min_float,
|
2394 + | max_float: self.max_float,
|
2395 + | })
|
2396 + | }
|
2397 + | }
|
2398 + | #[allow(missing_docs)] // documentation missing in model
|
2399 + | ///
|
2400 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2401 + | /// [constraint traits]. Use [`MaxLong::try_from`] to construct values of this type.
|
2402 + | ///
|
2403 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2404 + | ///
|
2405 + | #[derive(
|
2406 + | ::std::clone::Clone,
|
2407 + | ::std::cmp::Eq,
|
2408 + | ::std::cmp::PartialEq,
|
2409 + | ::std::fmt::Debug,
|
2410 + | ::std::hash::Hash,
|
2411 + | )]
|
2412 + | pub struct MaxLong(pub(crate) i64);
|
2413 + | impl MaxLong {
|
2414 + | /// Returns an immutable reference to the underlying [`i64`].
|
2415 + | pub fn inner(&self) -> &i64 {
|
2416 + | &self.0
|
2417 + | }
|
2418 + |
|
2419 + | /// Consumes the value, returning the underlying [`i64`].
|
2420 + | pub fn into_inner(self) -> i64 {
|
2421 + | self.0
|
2422 + | }
|
2423 + | }
|
2424 + |
|
2425 + | impl crate::constrained::Constrained for MaxLong {
|
2426 + | type Unconstrained = i64;
|
2427 + | }
|
2428 + |
|
2429 + | impl ::std::convert::From<i64>
|
2430 + | for crate::constrained::MaybeConstrained<
|
2431 + | crate::input::malformed_range_override_input::MaxLong,
|
2432 + | >
|
2433 + | {
|
2434 + | fn from(value: i64) -> Self {
|
2435 + | Self::Unconstrained(value)
|
2436 + | }
|
2437 + | }
|
2438 + |
|
2439 + | impl ::std::fmt::Display for MaxLong {
|
2440 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2441 + | self.0.fmt(f)
|
2442 + | }
|
2443 + | }
|
2444 + |
|
2445 + | impl ::std::convert::From<MaxLong> for i64 {
|
2446 + | fn from(value: MaxLong) -> Self {
|
2447 + | value.into_inner()
|
2448 + | }
|
2449 + | }
|
2450 + | impl MaxLong {
|
2451 + | fn check_range(
|
2452 + | value: i64,
|
2453 + | ) -> ::std::result::Result<
|
2454 + | (),
|
2455 + | crate::input::malformed_range_override_input::max_long::ConstraintViolation,
|
2456 + | > {
|
2457 + | if value <= 6 {
|
2458 + | Ok(())
|
2459 + | } else {
|
2460 + | Err(crate::input::malformed_range_override_input::max_long::ConstraintViolation::Range(value))
|
2461 + | }
|
2462 + | }
|
2463 + | }
|
2464 + | impl ::std::convert::TryFrom<i64> for MaxLong {
|
2465 + | type Error = crate::input::malformed_range_override_input::max_long::ConstraintViolation;
|
2466 + |
|
2467 + | /// Constructs a `MaxLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2468 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2469 + | Self::check_range(value)?;
|
2470 + |
|
2471 + | Ok(Self(value))
|
2472 + | }
|
2473 + | }
|
2474 + | #[allow(missing_docs)] // documentation missing in model
|
2475 + | ///
|
2476 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2477 + | /// [constraint traits]. Use [`MinLong::try_from`] to construct values of this type.
|
2478 + | ///
|
2479 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2480 + | ///
|
2481 + | #[derive(
|
2482 + | ::std::clone::Clone,
|
2483 + | ::std::cmp::Eq,
|
2484 + | ::std::cmp::PartialEq,
|
2485 + | ::std::fmt::Debug,
|
2486 + | ::std::hash::Hash,
|
2487 + | )]
|
2488 + | pub struct MinLong(pub(crate) i64);
|
2489 + | impl MinLong {
|
2490 + | /// Returns an immutable reference to the underlying [`i64`].
|
2491 + | pub fn inner(&self) -> &i64 {
|
2492 + | &self.0
|
2493 + | }
|
2494 + |
|
2495 + | /// Consumes the value, returning the underlying [`i64`].
|
2496 + | pub fn into_inner(self) -> i64 {
|
2497 + | self.0
|
2498 + | }
|
2499 + | }
|
2500 + |
|
2501 + | impl crate::constrained::Constrained for MinLong {
|
2502 + | type Unconstrained = i64;
|
2503 + | }
|
2504 + |
|
2505 + | impl ::std::convert::From<i64>
|
2506 + | for crate::constrained::MaybeConstrained<
|
2507 + | crate::input::malformed_range_override_input::MinLong,
|
2508 + | >
|
2509 + | {
|
2510 + | fn from(value: i64) -> Self {
|
2511 + | Self::Unconstrained(value)
|
2512 + | }
|
2513 + | }
|
2514 + |
|
2515 + | impl ::std::fmt::Display for MinLong {
|
2516 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2517 + | self.0.fmt(f)
|
2518 + | }
|
2519 + | }
|
2520 + |
|
2521 + | impl ::std::convert::From<MinLong> for i64 {
|
2522 + | fn from(value: MinLong) -> Self {
|
2523 + | value.into_inner()
|
2524 + | }
|
2525 + | }
|
2526 + | impl MinLong {
|
2527 + | fn check_range(
|
2528 + | value: i64,
|
2529 + | ) -> ::std::result::Result<
|
2530 + | (),
|
2531 + | crate::input::malformed_range_override_input::min_long::ConstraintViolation,
|
2532 + | > {
|
2533 + | if 4 <= value {
|
2534 + | Ok(())
|
2535 + | } else {
|
2536 + | Err(crate::input::malformed_range_override_input::min_long::ConstraintViolation::Range(value))
|
2537 + | }
|
2538 + | }
|
2539 + | }
|
2540 + | impl ::std::convert::TryFrom<i64> for MinLong {
|
2541 + | type Error = crate::input::malformed_range_override_input::min_long::ConstraintViolation;
|
2542 + |
|
2543 + | /// Constructs a `MinLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2544 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2545 + | Self::check_range(value)?;
|
2546 + |
|
2547 + | Ok(Self(value))
|
2548 + | }
|
2549 + | }
|
2550 + | #[allow(missing_docs)] // documentation missing in model
|
2551 + | ///
|
2552 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2553 + | /// [constraint traits]. Use [`Long::try_from`] to construct values of this type.
|
2554 + | ///
|
2555 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2556 + | ///
|
2557 + | #[derive(
|
2558 + | ::std::clone::Clone,
|
2559 + | ::std::cmp::Eq,
|
2560 + | ::std::cmp::PartialEq,
|
2561 + | ::std::fmt::Debug,
|
2562 + | ::std::hash::Hash,
|
2563 + | )]
|
2564 + | pub struct Long(pub(crate) i64);
|
2565 + | impl Long {
|
2566 + | /// Returns an immutable reference to the underlying [`i64`].
|
2567 + | pub fn inner(&self) -> &i64 {
|
2568 + | &self.0
|
2569 + | }
|
2570 + |
|
2571 + | /// Consumes the value, returning the underlying [`i64`].
|
2572 + | pub fn into_inner(self) -> i64 {
|
2573 + | self.0
|
2574 + | }
|
2575 + | }
|
2576 + |
|
2577 + | impl crate::constrained::Constrained for Long {
|
2578 + | type Unconstrained = i64;
|
2579 + | }
|
2580 + |
|
2581 + | impl ::std::convert::From<i64>
|
2582 + | for crate::constrained::MaybeConstrained<crate::input::malformed_range_override_input::Long>
|
2583 + | {
|
2584 + | fn from(value: i64) -> Self {
|
2585 + | Self::Unconstrained(value)
|
2586 + | }
|
2587 + | }
|
2588 + |
|
2589 + | impl ::std::fmt::Display for Long {
|
2590 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2591 + | self.0.fmt(f)
|
2592 + | }
|
2593 + | }
|
2594 + |
|
2595 + | impl ::std::convert::From<Long> for i64 {
|
2596 + | fn from(value: Long) -> Self {
|
2597 + | value.into_inner()
|
2598 + | }
|
2599 + | }
|
2600 + | impl Long {
|
2601 + | fn check_range(
|
2602 + | value: i64,
|
2603 + | ) -> ::std::result::Result<
|
2604 + | (),
|
2605 + | crate::input::malformed_range_override_input::long::ConstraintViolation,
|
2606 + | > {
|
2607 + | if (4..=6).contains(&value) {
|
2608 + | Ok(())
|
2609 + | } else {
|
2610 + | Err(
|
2611 + | crate::input::malformed_range_override_input::long::ConstraintViolation::Range(
|
2612 + | value,
|
2613 + | ),
|
2614 + | )
|
2615 + | }
|
2616 + | }
|
2617 + | }
|
2618 + | impl ::std::convert::TryFrom<i64> for Long {
|
2619 + | type Error = crate::input::malformed_range_override_input::long::ConstraintViolation;
|
2620 + |
|
2621 + | /// Constructs a `Long` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2622 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2623 + | Self::check_range(value)?;
|
2624 + |
|
2625 + | Ok(Self(value))
|
2626 + | }
|
2627 + | }
|
2628 + | #[allow(missing_docs)] // documentation missing in model
|
2629 + | ///
|
2630 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2631 + | /// [constraint traits]. Use [`MaxInteger::try_from`] to construct values of this type.
|
2632 + | ///
|
2633 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2634 + | ///
|
2635 + | #[derive(
|
2636 + | ::std::clone::Clone,
|
2637 + | ::std::cmp::Eq,
|
2638 + | ::std::cmp::PartialEq,
|
2639 + | ::std::fmt::Debug,
|
2640 + | ::std::hash::Hash,
|
2641 + | )]
|
2642 + | pub struct MaxInteger(pub(crate) i32);
|
2643 + | impl MaxInteger {
|
2644 + | /// Returns an immutable reference to the underlying [`i32`].
|
2645 + | pub fn inner(&self) -> &i32 {
|
2646 + | &self.0
|
2647 + | }
|
2648 + |
|
2649 + | /// Consumes the value, returning the underlying [`i32`].
|
2650 + | pub fn into_inner(self) -> i32 {
|
2651 + | self.0
|
2652 + | }
|
2653 + | }
|
2654 + |
|
2655 + | impl crate::constrained::Constrained for MaxInteger {
|
2656 + | type Unconstrained = i32;
|
2657 + | }
|
2658 + |
|
2659 + | impl ::std::convert::From<i32>
|
2660 + | for crate::constrained::MaybeConstrained<
|
2661 + | crate::input::malformed_range_override_input::MaxInteger,
|
2662 + | >
|
2663 + | {
|
2664 + | fn from(value: i32) -> Self {
|
2665 + | Self::Unconstrained(value)
|
2666 + | }
|
2667 + | }
|
2668 + |
|
2669 + | impl ::std::fmt::Display for MaxInteger {
|
2670 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2671 + | self.0.fmt(f)
|
2672 + | }
|
2673 + | }
|
2674 + |
|
2675 + | impl ::std::convert::From<MaxInteger> for i32 {
|
2676 + | fn from(value: MaxInteger) -> Self {
|
2677 + | value.into_inner()
|
2678 + | }
|
2679 + | }
|
2680 + | impl MaxInteger {
|
2681 + | fn check_range(
|
2682 + | value: i32,
|
2683 + | ) -> ::std::result::Result<
|
2684 + | (),
|
2685 + | crate::input::malformed_range_override_input::max_integer::ConstraintViolation,
|
2686 + | > {
|
2687 + | if value <= 6 {
|
2688 + | Ok(())
|
2689 + | } else {
|
2690 + | Err(crate::input::malformed_range_override_input::max_integer::ConstraintViolation::Range(value))
|
2691 + | }
|
2692 + | }
|
2693 + | }
|
2694 + | impl ::std::convert::TryFrom<i32> for MaxInteger {
|
2695 + | type Error = crate::input::malformed_range_override_input::max_integer::ConstraintViolation;
|
2696 + |
|
2697 + | /// Constructs a `MaxInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2698 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2699 + | Self::check_range(value)?;
|
2700 + |
|
2701 + | Ok(Self(value))
|
2702 + | }
|
2703 + | }
|
2704 + | #[allow(missing_docs)] // documentation missing in model
|
2705 + | ///
|
2706 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2707 + | /// [constraint traits]. Use [`MinInteger::try_from`] to construct values of this type.
|
2708 + | ///
|
2709 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2710 + | ///
|
2711 + | #[derive(
|
2712 + | ::std::clone::Clone,
|
2713 + | ::std::cmp::Eq,
|
2714 + | ::std::cmp::PartialEq,
|
2715 + | ::std::fmt::Debug,
|
2716 + | ::std::hash::Hash,
|
2717 + | )]
|
2718 + | pub struct MinInteger(pub(crate) i32);
|
2719 + | impl MinInteger {
|
2720 + | /// Returns an immutable reference to the underlying [`i32`].
|
2721 + | pub fn inner(&self) -> &i32 {
|
2722 + | &self.0
|
2723 + | }
|
2724 + |
|
2725 + | /// Consumes the value, returning the underlying [`i32`].
|
2726 + | pub fn into_inner(self) -> i32 {
|
2727 + | self.0
|
2728 + | }
|
2729 + | }
|
2730 + |
|
2731 + | impl crate::constrained::Constrained for MinInteger {
|
2732 + | type Unconstrained = i32;
|
2733 + | }
|
2734 + |
|
2735 + | impl ::std::convert::From<i32>
|
2736 + | for crate::constrained::MaybeConstrained<
|
2737 + | crate::input::malformed_range_override_input::MinInteger,
|
2738 + | >
|
2739 + | {
|
2740 + | fn from(value: i32) -> Self {
|
2741 + | Self::Unconstrained(value)
|
2742 + | }
|
2743 + | }
|
2744 + |
|
2745 + | impl ::std::fmt::Display for MinInteger {
|
2746 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2747 + | self.0.fmt(f)
|
2748 + | }
|
2749 + | }
|
2750 + |
|
2751 + | impl ::std::convert::From<MinInteger> for i32 {
|
2752 + | fn from(value: MinInteger) -> Self {
|
2753 + | value.into_inner()
|
2754 + | }
|
2755 + | }
|
2756 + | impl MinInteger {
|
2757 + | fn check_range(
|
2758 + | value: i32,
|
2759 + | ) -> ::std::result::Result<
|
2760 + | (),
|
2761 + | crate::input::malformed_range_override_input::min_integer::ConstraintViolation,
|
2762 + | > {
|
2763 + | if 4 <= value {
|
2764 + | Ok(())
|
2765 + | } else {
|
2766 + | Err(crate::input::malformed_range_override_input::min_integer::ConstraintViolation::Range(value))
|
2767 + | }
|
2768 + | }
|
2769 + | }
|
2770 + | impl ::std::convert::TryFrom<i32> for MinInteger {
|
2771 + | type Error = crate::input::malformed_range_override_input::min_integer::ConstraintViolation;
|
2772 + |
|
2773 + | /// Constructs a `MinInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2774 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2775 + | Self::check_range(value)?;
|
2776 + |
|
2777 + | Ok(Self(value))
|
2778 + | }
|
2779 + | }
|
2780 + | #[allow(missing_docs)] // documentation missing in model
|
2781 + | ///
|
2782 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2783 + | /// [constraint traits]. Use [`Integer::try_from`] to construct values of this type.
|
2784 + | ///
|
2785 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2786 + | ///
|
2787 + | #[derive(
|
2788 + | ::std::clone::Clone,
|
2789 + | ::std::cmp::Eq,
|
2790 + | ::std::cmp::PartialEq,
|
2791 + | ::std::fmt::Debug,
|
2792 + | ::std::hash::Hash,
|
2793 + | )]
|
2794 + | pub struct Integer(pub(crate) i32);
|
2795 + | impl Integer {
|
2796 + | /// Returns an immutable reference to the underlying [`i32`].
|
2797 + | pub fn inner(&self) -> &i32 {
|
2798 + | &self.0
|
2799 + | }
|
2800 + |
|
2801 + | /// Consumes the value, returning the underlying [`i32`].
|
2802 + | pub fn into_inner(self) -> i32 {
|
2803 + | self.0
|
2804 + | }
|
2805 + | }
|
2806 + |
|
2807 + | impl crate::constrained::Constrained for Integer {
|
2808 + | type Unconstrained = i32;
|
2809 + | }
|
2810 + |
|
2811 + | impl ::std::convert::From<i32>
|
2812 + | for crate::constrained::MaybeConstrained<
|
2813 + | crate::input::malformed_range_override_input::Integer,
|
2814 + | >
|
2815 + | {
|
2816 + | fn from(value: i32) -> Self {
|
2817 + | Self::Unconstrained(value)
|
2818 + | }
|
2819 + | }
|
2820 + |
|
2821 + | impl ::std::fmt::Display for Integer {
|
2822 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2823 + | self.0.fmt(f)
|
2824 + | }
|
2825 + | }
|
2826 + |
|
2827 + | impl ::std::convert::From<Integer> for i32 {
|
2828 + | fn from(value: Integer) -> Self {
|
2829 + | value.into_inner()
|
2830 + | }
|
2831 + | }
|
2832 + | impl Integer {
|
2833 + | fn check_range(
|
2834 + | value: i32,
|
2835 + | ) -> ::std::result::Result<
|
2836 + | (),
|
2837 + | crate::input::malformed_range_override_input::integer::ConstraintViolation,
|
2838 + | > {
|
2839 + | if (4..=6).contains(&value) {
|
2840 + | Ok(())
|
2841 + | } else {
|
2842 + | Err(crate::input::malformed_range_override_input::integer::ConstraintViolation::Range(value))
|
2843 + | }
|
2844 + | }
|
2845 + | }
|
2846 + | impl ::std::convert::TryFrom<i32> for Integer {
|
2847 + | type Error = crate::input::malformed_range_override_input::integer::ConstraintViolation;
|
2848 + |
|
2849 + | /// Constructs a `Integer` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2850 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2851 + | Self::check_range(value)?;
|
2852 + |
|
2853 + | Ok(Self(value))
|
2854 + | }
|
2855 + | }
|
2856 + | #[allow(missing_docs)] // documentation missing in model
|
2857 + | ///
|
2858 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2859 + | /// [constraint traits]. Use [`MaxShort::try_from`] to construct values of this type.
|
2860 + | ///
|
2861 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2862 + | ///
|
2863 + | #[derive(
|
2864 + | ::std::clone::Clone,
|
2865 + | ::std::cmp::Eq,
|
2866 + | ::std::cmp::PartialEq,
|
2867 + | ::std::fmt::Debug,
|
2868 + | ::std::hash::Hash,
|
2869 + | )]
|
2870 + | pub struct MaxShort(pub(crate) i16);
|
2871 + | impl MaxShort {
|
2872 + | /// Returns an immutable reference to the underlying [`i16`].
|
2873 + | pub fn inner(&self) -> &i16 {
|
2874 + | &self.0
|
2875 + | }
|
2876 + |
|
2877 + | /// Consumes the value, returning the underlying [`i16`].
|
2878 + | pub fn into_inner(self) -> i16 {
|
2879 + | self.0
|
2880 + | }
|
2881 + | }
|
2882 + |
|
2883 + | impl crate::constrained::Constrained for MaxShort {
|
2884 + | type Unconstrained = i16;
|
2885 + | }
|
2886 + |
|
2887 + | impl ::std::convert::From<i16>
|
2888 + | for crate::constrained::MaybeConstrained<
|
2889 + | crate::input::malformed_range_override_input::MaxShort,
|
2890 + | >
|
2891 + | {
|
2892 + | fn from(value: i16) -> Self {
|
2893 + | Self::Unconstrained(value)
|
2894 + | }
|
2895 + | }
|
2896 + |
|
2897 + | impl ::std::fmt::Display for MaxShort {
|
2898 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2899 + | self.0.fmt(f)
|
2900 + | }
|
2901 + | }
|
2902 + |
|
2903 + | impl ::std::convert::From<MaxShort> for i16 {
|
2904 + | fn from(value: MaxShort) -> Self {
|
2905 + | value.into_inner()
|
2906 + | }
|
2907 + | }
|
2908 + | impl MaxShort {
|
2909 + | fn check_range(
|
2910 + | value: i16,
|
2911 + | ) -> ::std::result::Result<
|
2912 + | (),
|
2913 + | crate::input::malformed_range_override_input::max_short::ConstraintViolation,
|
2914 + | > {
|
2915 + | if value <= 6 {
|
2916 + | Ok(())
|
2917 + | } else {
|
2918 + | Err(crate::input::malformed_range_override_input::max_short::ConstraintViolation::Range(value))
|
2919 + | }
|
2920 + | }
|
2921 + | }
|
2922 + | impl ::std::convert::TryFrom<i16> for MaxShort {
|
2923 + | type Error = crate::input::malformed_range_override_input::max_short::ConstraintViolation;
|
2924 + |
|
2925 + | /// Constructs a `MaxShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2926 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2927 + | Self::check_range(value)?;
|
2928 + |
|
2929 + | Ok(Self(value))
|
2930 + | }
|
2931 + | }
|
2932 + | #[allow(missing_docs)] // documentation missing in model
|
2933 + | ///
|
2934 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2935 + | /// [constraint traits]. Use [`MinShort::try_from`] to construct values of this type.
|
2936 + | ///
|
2937 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2938 + | ///
|
2939 + | #[derive(
|
2940 + | ::std::clone::Clone,
|
2941 + | ::std::cmp::Eq,
|
2942 + | ::std::cmp::PartialEq,
|
2943 + | ::std::fmt::Debug,
|
2944 + | ::std::hash::Hash,
|
2945 + | )]
|
2946 + | pub struct MinShort(pub(crate) i16);
|
2947 + | impl MinShort {
|
2948 + | /// Returns an immutable reference to the underlying [`i16`].
|
2949 + | pub fn inner(&self) -> &i16 {
|
2950 + | &self.0
|
2951 + | }
|
2952 + |
|
2953 + | /// Consumes the value, returning the underlying [`i16`].
|
2954 + | pub fn into_inner(self) -> i16 {
|
2955 + | self.0
|
2956 + | }
|
2957 + | }
|
2958 + |
|
2959 + | impl crate::constrained::Constrained for MinShort {
|
2960 + | type Unconstrained = i16;
|
2961 + | }
|
2962 + |
|
2963 + | impl ::std::convert::From<i16>
|
2964 + | for crate::constrained::MaybeConstrained<
|
2965 + | crate::input::malformed_range_override_input::MinShort,
|
2966 + | >
|
2967 + | {
|
2968 + | fn from(value: i16) -> Self {
|
2969 + | Self::Unconstrained(value)
|
2970 + | }
|
2971 + | }
|
2972 + |
|
2973 + | impl ::std::fmt::Display for MinShort {
|
2974 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2975 + | self.0.fmt(f)
|
2976 + | }
|
2977 + | }
|
2978 + |
|
2979 + | impl ::std::convert::From<MinShort> for i16 {
|
2980 + | fn from(value: MinShort) -> Self {
|
2981 + | value.into_inner()
|
2982 + | }
|
2983 + | }
|
2984 + | impl MinShort {
|
2985 + | fn check_range(
|
2986 + | value: i16,
|
2987 + | ) -> ::std::result::Result<
|
2988 + | (),
|
2989 + | crate::input::malformed_range_override_input::min_short::ConstraintViolation,
|
2990 + | > {
|
2991 + | if 4 <= value {
|
2992 + | Ok(())
|
2993 + | } else {
|
2994 + | Err(crate::input::malformed_range_override_input::min_short::ConstraintViolation::Range(value))
|
2995 + | }
|
2996 + | }
|
2997 + | }
|
2998 + | impl ::std::convert::TryFrom<i16> for MinShort {
|
2999 + | type Error = crate::input::malformed_range_override_input::min_short::ConstraintViolation;
|
3000 + |
|
3001 + | /// Constructs a `MinShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3002 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3003 + | Self::check_range(value)?;
|
3004 + |
|
3005 + | Ok(Self(value))
|
3006 + | }
|
3007 + | }
|
3008 + | #[allow(missing_docs)] // documentation missing in model
|
3009 + | ///
|
3010 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3011 + | /// [constraint traits]. Use [`Short::try_from`] to construct values of this type.
|
3012 + | ///
|
3013 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3014 + | ///
|
3015 + | #[derive(
|
3016 + | ::std::clone::Clone,
|
3017 + | ::std::cmp::Eq,
|
3018 + | ::std::cmp::PartialEq,
|
3019 + | ::std::fmt::Debug,
|
3020 + | ::std::hash::Hash,
|
3021 + | )]
|
3022 + | pub struct Short(pub(crate) i16);
|
3023 + | impl Short {
|
3024 + | /// Returns an immutable reference to the underlying [`i16`].
|
3025 + | pub fn inner(&self) -> &i16 {
|
3026 + | &self.0
|
3027 + | }
|
3028 + |
|
3029 + | /// Consumes the value, returning the underlying [`i16`].
|
3030 + | pub fn into_inner(self) -> i16 {
|
3031 + | self.0
|
3032 + | }
|
3033 + | }
|
3034 + |
|
3035 + | impl crate::constrained::Constrained for Short {
|
3036 + | type Unconstrained = i16;
|
3037 + | }
|
3038 + |
|
3039 + | impl ::std::convert::From<i16>
|
3040 + | for crate::constrained::MaybeConstrained<
|
3041 + | crate::input::malformed_range_override_input::Short,
|
3042 + | >
|
3043 + | {
|
3044 + | fn from(value: i16) -> Self {
|
3045 + | Self::Unconstrained(value)
|
3046 + | }
|
3047 + | }
|
3048 + |
|
3049 + | impl ::std::fmt::Display for Short {
|
3050 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3051 + | self.0.fmt(f)
|
3052 + | }
|
3053 + | }
|
3054 + |
|
3055 + | impl ::std::convert::From<Short> for i16 {
|
3056 + | fn from(value: Short) -> Self {
|
3057 + | value.into_inner()
|
3058 + | }
|
3059 + | }
|
3060 + | impl Short {
|
3061 + | fn check_range(
|
3062 + | value: i16,
|
3063 + | ) -> ::std::result::Result<
|
3064 + | (),
|
3065 + | crate::input::malformed_range_override_input::short::ConstraintViolation,
|
3066 + | > {
|
3067 + | if (4..=6).contains(&value) {
|
3068 + | Ok(())
|
3069 + | } else {
|
3070 + | Err(
|
3071 + | crate::input::malformed_range_override_input::short::ConstraintViolation::Range(
|
3072 + | value,
|
3073 + | ),
|
3074 + | )
|
3075 + | }
|
3076 + | }
|
3077 + | }
|
3078 + | impl ::std::convert::TryFrom<i16> for Short {
|
3079 + | type Error = crate::input::malformed_range_override_input::short::ConstraintViolation;
|
3080 + |
|
3081 + | /// Constructs a `Short` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3082 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3083 + | Self::check_range(value)?;
|
3084 + |
|
3085 + | Ok(Self(value))
|
3086 + | }
|
3087 + | }
|
3088 + | #[allow(missing_docs)] // documentation missing in model
|
3089 + | ///
|
3090 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3091 + | /// [constraint traits]. Use [`MaxByte::try_from`] to construct values of this type.
|
3092 + | ///
|
3093 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3094 + | ///
|
3095 + | #[derive(
|
3096 + | ::std::clone::Clone,
|
3097 + | ::std::cmp::Eq,
|
3098 + | ::std::cmp::PartialEq,
|
3099 + | ::std::fmt::Debug,
|
3100 + | ::std::hash::Hash,
|
3101 + | )]
|
3102 + | pub struct MaxByte(pub(crate) i8);
|
3103 + | impl MaxByte {
|
3104 + | /// Returns an immutable reference to the underlying [`i8`].
|
3105 + | pub fn inner(&self) -> &i8 {
|
3106 + | &self.0
|
3107 + | }
|
3108 + |
|
3109 + | /// Consumes the value, returning the underlying [`i8`].
|
3110 + | pub fn into_inner(self) -> i8 {
|
3111 + | self.0
|
3112 + | }
|
3113 + | }
|
3114 + |
|
3115 + | impl crate::constrained::Constrained for MaxByte {
|
3116 + | type Unconstrained = i8;
|
3117 + | }
|
3118 + |
|
3119 + | impl ::std::convert::From<i8>
|
3120 + | for crate::constrained::MaybeConstrained<
|
3121 + | crate::input::malformed_range_override_input::MaxByte,
|
3122 + | >
|
3123 + | {
|
3124 + | fn from(value: i8) -> Self {
|
3125 + | Self::Unconstrained(value)
|
3126 + | }
|
3127 + | }
|
3128 + |
|
3129 + | impl ::std::fmt::Display for MaxByte {
|
3130 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3131 + | self.0.fmt(f)
|
3132 + | }
|
3133 + | }
|
3134 + |
|
3135 + | impl ::std::convert::From<MaxByte> for i8 {
|
3136 + | fn from(value: MaxByte) -> Self {
|
3137 + | value.into_inner()
|
3138 + | }
|
3139 + | }
|
3140 + | impl MaxByte {
|
3141 + | fn check_range(
|
3142 + | value: i8,
|
3143 + | ) -> ::std::result::Result<
|
3144 + | (),
|
3145 + | crate::input::malformed_range_override_input::max_byte::ConstraintViolation,
|
3146 + | > {
|
3147 + | if value <= 6 {
|
3148 + | Ok(())
|
3149 + | } else {
|
3150 + | Err(crate::input::malformed_range_override_input::max_byte::ConstraintViolation::Range(value))
|
3151 + | }
|
3152 + | }
|
3153 + | }
|
3154 + | impl ::std::convert::TryFrom<i8> for MaxByte {
|
3155 + | type Error = crate::input::malformed_range_override_input::max_byte::ConstraintViolation;
|
3156 + |
|
3157 + | /// Constructs a `MaxByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3158 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3159 + | Self::check_range(value)?;
|
3160 + |
|
3161 + | Ok(Self(value))
|
3162 + | }
|
3163 + | }
|
3164 + | #[allow(missing_docs)] // documentation missing in model
|
3165 + | ///
|
3166 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3167 + | /// [constraint traits]. Use [`MinByte::try_from`] to construct values of this type.
|
3168 + | ///
|
3169 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3170 + | ///
|
3171 + | #[derive(
|
3172 + | ::std::clone::Clone,
|
3173 + | ::std::cmp::Eq,
|
3174 + | ::std::cmp::PartialEq,
|
3175 + | ::std::fmt::Debug,
|
3176 + | ::std::hash::Hash,
|
3177 + | )]
|
3178 + | pub struct MinByte(pub(crate) i8);
|
3179 + | impl MinByte {
|
3180 + | /// Returns an immutable reference to the underlying [`i8`].
|
3181 + | pub fn inner(&self) -> &i8 {
|
3182 + | &self.0
|
3183 + | }
|
3184 + |
|
3185 + | /// Consumes the value, returning the underlying [`i8`].
|
3186 + | pub fn into_inner(self) -> i8 {
|
3187 + | self.0
|
3188 + | }
|
3189 + | }
|
3190 + |
|
3191 + | impl crate::constrained::Constrained for MinByte {
|
3192 + | type Unconstrained = i8;
|
3193 + | }
|
3194 + |
|
3195 + | impl ::std::convert::From<i8>
|
3196 + | for crate::constrained::MaybeConstrained<
|
3197 + | crate::input::malformed_range_override_input::MinByte,
|
3198 + | >
|
3199 + | {
|
3200 + | fn from(value: i8) -> Self {
|
3201 + | Self::Unconstrained(value)
|
3202 + | }
|
3203 + | }
|
3204 + |
|
3205 + | impl ::std::fmt::Display for MinByte {
|
3206 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3207 + | self.0.fmt(f)
|
3208 + | }
|
3209 + | }
|
3210 + |
|
3211 + | impl ::std::convert::From<MinByte> for i8 {
|
3212 + | fn from(value: MinByte) -> Self {
|
3213 + | value.into_inner()
|
3214 + | }
|
3215 + | }
|
3216 + | impl MinByte {
|
3217 + | fn check_range(
|
3218 + | value: i8,
|
3219 + | ) -> ::std::result::Result<
|
3220 + | (),
|
3221 + | crate::input::malformed_range_override_input::min_byte::ConstraintViolation,
|
3222 + | > {
|
3223 + | if 4 <= value {
|
3224 + | Ok(())
|
3225 + | } else {
|
3226 + | Err(crate::input::malformed_range_override_input::min_byte::ConstraintViolation::Range(value))
|
3227 + | }
|
3228 + | }
|
3229 + | }
|
3230 + | impl ::std::convert::TryFrom<i8> for MinByte {
|
3231 + | type Error = crate::input::malformed_range_override_input::min_byte::ConstraintViolation;
|
3232 + |
|
3233 + | /// Constructs a `MinByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3234 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3235 + | Self::check_range(value)?;
|
3236 + |
|
3237 + | Ok(Self(value))
|
3238 + | }
|
3239 + | }
|
3240 + | #[allow(missing_docs)] // documentation missing in model
|
3241 + | ///
|
3242 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3243 + | /// [constraint traits]. Use [`Byte::try_from`] to construct values of this type.
|
3244 + | ///
|
3245 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3246 + | ///
|
3247 + | #[derive(
|
3248 + | ::std::clone::Clone,
|
3249 + | ::std::cmp::Eq,
|
3250 + | ::std::cmp::PartialEq,
|
3251 + | ::std::fmt::Debug,
|
3252 + | ::std::hash::Hash,
|
3253 + | )]
|
3254 + | pub struct Byte(pub(crate) i8);
|
3255 + | impl Byte {
|
3256 + | /// Returns an immutable reference to the underlying [`i8`].
|
3257 + | pub fn inner(&self) -> &i8 {
|
3258 + | &self.0
|
3259 + | }
|
3260 + |
|
3261 + | /// Consumes the value, returning the underlying [`i8`].
|
3262 + | pub fn into_inner(self) -> i8 {
|
3263 + | self.0
|
3264 + | }
|
3265 + | }
|
3266 + |
|
3267 + | impl crate::constrained::Constrained for Byte {
|
3268 + | type Unconstrained = i8;
|
3269 + | }
|
3270 + |
|
3271 + | impl ::std::convert::From<i8>
|
3272 + | for crate::constrained::MaybeConstrained<crate::input::malformed_range_override_input::Byte>
|
3273 + | {
|
3274 + | fn from(value: i8) -> Self {
|
3275 + | Self::Unconstrained(value)
|
3276 + | }
|
3277 + | }
|
3278 + |
|
3279 + | impl ::std::fmt::Display for Byte {
|
3280 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3281 + | self.0.fmt(f)
|
3282 + | }
|
3283 + | }
|
3284 + |
|
3285 + | impl ::std::convert::From<Byte> for i8 {
|
3286 + | fn from(value: Byte) -> Self {
|
3287 + | value.into_inner()
|
3288 + | }
|
3289 + | }
|
3290 + | impl Byte {
|
3291 + | fn check_range(
|
3292 + | value: i8,
|
3293 + | ) -> ::std::result::Result<
|
3294 + | (),
|
3295 + | crate::input::malformed_range_override_input::byte::ConstraintViolation,
|
3296 + | > {
|
3297 + | if (4..=6).contains(&value) {
|
3298 + | Ok(())
|
3299 + | } else {
|
3300 + | Err(
|
3301 + | crate::input::malformed_range_override_input::byte::ConstraintViolation::Range(
|
3302 + | value,
|
3303 + | ),
|
3304 + | )
|
3305 + | }
|
3306 + | }
|
3307 + | }
|
3308 + | impl ::std::convert::TryFrom<i8> for Byte {
|
3309 + | type Error = crate::input::malformed_range_override_input::byte::ConstraintViolation;
|
3310 + |
|
3311 + | /// Constructs a `Byte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3312 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3313 + | Self::check_range(value)?;
|
3314 + |
|
3315 + | Ok(Self(value))
|
3316 + | }
|
3317 + | }
|
3318 + |
|
3319 + | /// See [`MalformedRangeOverrideInputMaxLong`](crate::input::malformed_range_override_input::MaxLong).
|
3320 + | pub mod max_long {
|
3321 + |
|
3322 + | #[derive(Debug, PartialEq)]
|
3323 + | pub enum ConstraintViolation {
|
3324 + | Range(i64),
|
3325 + | }
|
3326 + |
|
3327 + | impl ::std::fmt::Display for ConstraintViolation {
|
3328 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3329 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMaxLong`failed to satisfy constraint: Member must be less than or equal to 6")
|
3330 + | }
|
3331 + | }
|
3332 + |
|
3333 + | impl ::std::error::Error for ConstraintViolation {}
|
3334 + | impl ConstraintViolation {
|
3335 + | pub(crate) fn as_validation_exception_field(
|
3336 + | self,
|
3337 + | path: ::std::string::String,
|
3338 + | ) -> crate::model::ValidationExceptionField {
|
3339 + | match self {
|
3340 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3341 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 6", &path),
|
3342 + | path,
|
3343 + | },
|
3344 + | }
|
3345 + | }
|
3346 + | }
|
3347 + | }
|
3348 + | /// See [`MalformedRangeOverrideInputMinLong`](crate::input::malformed_range_override_input::MinLong).
|
3349 + | pub mod min_long {
|
3350 + |
|
3351 + | #[derive(Debug, PartialEq)]
|
3352 + | pub enum ConstraintViolation {
|
3353 + | Range(i64),
|
3354 + | }
|
3355 + |
|
3356 + | impl ::std::fmt::Display for ConstraintViolation {
|
3357 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3358 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMinLong`failed to satisfy constraint: Member must be greater than or equal to 4")
|
3359 + | }
|
3360 + | }
|
3361 + |
|
3362 + | impl ::std::error::Error for ConstraintViolation {}
|
3363 + | impl ConstraintViolation {
|
3364 + | pub(crate) fn as_validation_exception_field(
|
3365 + | self,
|
3366 + | path: ::std::string::String,
|
3367 + | ) -> crate::model::ValidationExceptionField {
|
3368 + | match self {
|
3369 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3370 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 4", &path),
|
3371 + | path,
|
3372 + | },
|
3373 + | }
|
3374 + | }
|
3375 + | }
|
3376 + | }
|
3377 + | /// See [`MalformedRangeOverrideInputLong`](crate::input::malformed_range_override_input::Long).
|
3378 + | pub mod long {
|
3379 + |
|
3380 + | #[derive(Debug, PartialEq)]
|
3381 + | pub enum ConstraintViolation {
|
3382 + | Range(i64),
|
3383 + | }
|
3384 + |
|
3385 + | impl ::std::fmt::Display for ConstraintViolation {
|
3386 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3387 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputLong`failed to satisfy constraint: Member must be between 4 and 6, inclusive")
|
3388 + | }
|
3389 + | }
|
3390 + |
|
3391 + | impl ::std::error::Error for ConstraintViolation {}
|
3392 + | impl ConstraintViolation {
|
3393 + | pub(crate) fn as_validation_exception_field(
|
3394 + | self,
|
3395 + | path: ::std::string::String,
|
3396 + | ) -> crate::model::ValidationExceptionField {
|
3397 + | match self {
|
3398 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3399 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 4 and 6, inclusive", &path),
|
3400 + | path,
|
3401 + | },
|
3402 + | }
|
3403 + | }
|
3404 + | }
|
3405 + | }
|
3406 + | /// See [`MalformedRangeOverrideInputMaxInteger`](crate::input::malformed_range_override_input::MaxInteger).
|
3407 + | pub mod max_integer {
|
3408 + |
|
3409 + | #[derive(Debug, PartialEq)]
|
3410 + | pub enum ConstraintViolation {
|
3411 + | Range(i32),
|
3412 + | }
|
3413 + |
|
3414 + | impl ::std::fmt::Display for ConstraintViolation {
|
3415 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3416 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMaxInteger`failed to satisfy constraint: Member must be less than or equal to 6")
|
3417 + | }
|
3418 + | }
|
3419 + |
|
3420 + | impl ::std::error::Error for ConstraintViolation {}
|
3421 + | impl ConstraintViolation {
|
3422 + | pub(crate) fn as_validation_exception_field(
|
3423 + | self,
|
3424 + | path: ::std::string::String,
|
3425 + | ) -> crate::model::ValidationExceptionField {
|
3426 + | match self {
|
3427 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3428 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 6", &path),
|
3429 + | path,
|
3430 + | },
|
3431 + | }
|
3432 + | }
|
3433 + | }
|
3434 + | }
|
3435 + | /// See [`MalformedRangeOverrideInputMinInteger`](crate::input::malformed_range_override_input::MinInteger).
|
3436 + | pub mod min_integer {
|
3437 + |
|
3438 + | #[derive(Debug, PartialEq)]
|
3439 + | pub enum ConstraintViolation {
|
3440 + | Range(i32),
|
3441 + | }
|
3442 + |
|
3443 + | impl ::std::fmt::Display for ConstraintViolation {
|
3444 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3445 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMinInteger`failed to satisfy constraint: Member must be greater than or equal to 4")
|
3446 + | }
|
3447 + | }
|
3448 + |
|
3449 + | impl ::std::error::Error for ConstraintViolation {}
|
3450 + | impl ConstraintViolation {
|
3451 + | pub(crate) fn as_validation_exception_field(
|
3452 + | self,
|
3453 + | path: ::std::string::String,
|
3454 + | ) -> crate::model::ValidationExceptionField {
|
3455 + | match self {
|
3456 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3457 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 4", &path),
|
3458 + | path,
|
3459 + | },
|
3460 + | }
|
3461 + | }
|
3462 + | }
|
3463 + | }
|
3464 + | /// See [`MalformedRangeOverrideInputInteger`](crate::input::malformed_range_override_input::Integer).
|
3465 + | pub mod integer {
|
3466 + |
|
3467 + | #[derive(Debug, PartialEq)]
|
3468 + | pub enum ConstraintViolation {
|
3469 + | Range(i32),
|
3470 + | }
|
3471 + |
|
3472 + | impl ::std::fmt::Display for ConstraintViolation {
|
3473 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3474 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputInteger`failed to satisfy constraint: Member must be between 4 and 6, inclusive")
|
3475 + | }
|
3476 + | }
|
3477 + |
|
3478 + | impl ::std::error::Error for ConstraintViolation {}
|
3479 + | impl ConstraintViolation {
|
3480 + | pub(crate) fn as_validation_exception_field(
|
3481 + | self,
|
3482 + | path: ::std::string::String,
|
3483 + | ) -> crate::model::ValidationExceptionField {
|
3484 + | match self {
|
3485 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3486 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 4 and 6, inclusive", &path),
|
3487 + | path,
|
3488 + | },
|
3489 + | }
|
3490 + | }
|
3491 + | }
|
3492 + | }
|
3493 + | /// See [`MalformedRangeOverrideInputMaxShort`](crate::input::malformed_range_override_input::MaxShort).
|
3494 + | pub mod max_short {
|
3495 + |
|
3496 + | #[derive(Debug, PartialEq)]
|
3497 + | pub enum ConstraintViolation {
|
3498 + | Range(i16),
|
3499 + | }
|
3500 + |
|
3501 + | impl ::std::fmt::Display for ConstraintViolation {
|
3502 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3503 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMaxShort`failed to satisfy constraint: Member must be less than or equal to 6")
|
3504 + | }
|
3505 + | }
|
3506 + |
|
3507 + | impl ::std::error::Error for ConstraintViolation {}
|
3508 + | impl ConstraintViolation {
|
3509 + | pub(crate) fn as_validation_exception_field(
|
3510 + | self,
|
3511 + | path: ::std::string::String,
|
3512 + | ) -> crate::model::ValidationExceptionField {
|
3513 + | match self {
|
3514 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3515 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 6", &path),
|
3516 + | path,
|
3517 + | },
|
3518 + | }
|
3519 + | }
|
3520 + | }
|
3521 + | }
|
3522 + | /// See [`MalformedRangeOverrideInputMinShort`](crate::input::malformed_range_override_input::MinShort).
|
3523 + | pub mod min_short {
|
3524 + |
|
3525 + | #[derive(Debug, PartialEq)]
|
3526 + | pub enum ConstraintViolation {
|
3527 + | Range(i16),
|
3528 + | }
|
3529 + |
|
3530 + | impl ::std::fmt::Display for ConstraintViolation {
|
3531 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3532 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMinShort`failed to satisfy constraint: Member must be greater than or equal to 4")
|
3533 + | }
|
3534 + | }
|
3535 + |
|
3536 + | impl ::std::error::Error for ConstraintViolation {}
|
3537 + | impl ConstraintViolation {
|
3538 + | pub(crate) fn as_validation_exception_field(
|
3539 + | self,
|
3540 + | path: ::std::string::String,
|
3541 + | ) -> crate::model::ValidationExceptionField {
|
3542 + | match self {
|
3543 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3544 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 4", &path),
|
3545 + | path,
|
3546 + | },
|
3547 + | }
|
3548 + | }
|
3549 + | }
|
3550 + | }
|
3551 + | /// See [`MalformedRangeOverrideInputShort`](crate::input::malformed_range_override_input::Short).
|
3552 + | pub mod short {
|
3553 + |
|
3554 + | #[derive(Debug, PartialEq)]
|
3555 + | pub enum ConstraintViolation {
|
3556 + | Range(i16),
|
3557 + | }
|
3558 + |
|
3559 + | impl ::std::fmt::Display for ConstraintViolation {
|
3560 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3561 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputShort`failed to satisfy constraint: Member must be between 4 and 6, inclusive")
|
3562 + | }
|
3563 + | }
|
3564 + |
|
3565 + | impl ::std::error::Error for ConstraintViolation {}
|
3566 + | impl ConstraintViolation {
|
3567 + | pub(crate) fn as_validation_exception_field(
|
3568 + | self,
|
3569 + | path: ::std::string::String,
|
3570 + | ) -> crate::model::ValidationExceptionField {
|
3571 + | match self {
|
3572 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3573 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 4 and 6, inclusive", &path),
|
3574 + | path,
|
3575 + | },
|
3576 + | }
|
3577 + | }
|
3578 + | }
|
3579 + | }
|
3580 + | /// See [`MalformedRangeOverrideInputMaxByte`](crate::input::malformed_range_override_input::MaxByte).
|
3581 + | pub mod max_byte {
|
3582 + |
|
3583 + | #[derive(Debug, PartialEq)]
|
3584 + | pub enum ConstraintViolation {
|
3585 + | Range(i8),
|
3586 + | }
|
3587 + |
|
3588 + | impl ::std::fmt::Display for ConstraintViolation {
|
3589 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3590 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMaxByte`failed to satisfy constraint: Member must be less than or equal to 6")
|
3591 + | }
|
3592 + | }
|
3593 + |
|
3594 + | impl ::std::error::Error for ConstraintViolation {}
|
3595 + | impl ConstraintViolation {
|
3596 + | pub(crate) fn as_validation_exception_field(
|
3597 + | self,
|
3598 + | path: ::std::string::String,
|
3599 + | ) -> crate::model::ValidationExceptionField {
|
3600 + | match self {
|
3601 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3602 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 6", &path),
|
3603 + | path,
|
3604 + | },
|
3605 + | }
|
3606 + | }
|
3607 + | }
|
3608 + | }
|
3609 + | /// See [`MalformedRangeOverrideInputMinByte`](crate::input::malformed_range_override_input::MinByte).
|
3610 + | pub mod min_byte {
|
3611 + |
|
3612 + | #[derive(Debug, PartialEq)]
|
3613 + | pub enum ConstraintViolation {
|
3614 + | Range(i8),
|
3615 + | }
|
3616 + |
|
3617 + | impl ::std::fmt::Display for ConstraintViolation {
|
3618 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3619 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputMinByte`failed to satisfy constraint: Member must be greater than or equal to 4")
|
3620 + | }
|
3621 + | }
|
3622 + |
|
3623 + | impl ::std::error::Error for ConstraintViolation {}
|
3624 + | impl ConstraintViolation {
|
3625 + | pub(crate) fn as_validation_exception_field(
|
3626 + | self,
|
3627 + | path: ::std::string::String,
|
3628 + | ) -> crate::model::ValidationExceptionField {
|
3629 + | match self {
|
3630 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3631 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 4", &path),
|
3632 + | path,
|
3633 + | },
|
3634 + | }
|
3635 + | }
|
3636 + | }
|
3637 + | }
|
3638 + | /// See [`MalformedRangeOverrideInputByte`](crate::input::malformed_range_override_input::Byte).
|
3639 + | pub mod byte {
|
3640 + |
|
3641 + | #[derive(Debug, PartialEq)]
|
3642 + | pub enum ConstraintViolation {
|
3643 + | Range(i8),
|
3644 + | }
|
3645 + |
|
3646 + | impl ::std::fmt::Display for ConstraintViolation {
|
3647 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3648 + | write!(f, "Value for `aws.protocoltests.restjson.validation.synthetic#MalformedRangeOverrideInputByte`failed to satisfy constraint: Member must be between 4 and 6, inclusive")
|
3649 + | }
|
3650 + | }
|
3651 + |
|
3652 + | impl ::std::error::Error for ConstraintViolation {}
|
3653 + | impl ConstraintViolation {
|
3654 + | pub(crate) fn as_validation_exception_field(
|
3655 + | self,
|
3656 + | path: ::std::string::String,
|
3657 + | ) -> crate::model::ValidationExceptionField {
|
3658 + | match self {
|
3659 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
3660 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 4 and 6, inclusive", &path),
|
3661 + | path,
|
3662 + | },
|
3663 + | }
|
3664 + | }
|
3665 + | }
|
3666 + | }
|
3667 + | }
|
3668 + | /// See [`MalformedRangeInput`](crate::input::MalformedRangeInput).
|
3669 + | pub mod malformed_range_input {
|
3670 + |
|
3671 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3672 + | /// Holds one variant for each of the ways the builder can fail.
|
3673 + | #[non_exhaustive]
|
3674 + | #[allow(clippy::enum_variant_names)]
|
3675 + | pub enum ConstraintViolation {
|
3676 + | /// Constraint violation occurred building member `byte` when building `MalformedRangeInput`.
|
3677 + | #[doc(hidden)]
|
3678 + | Byte(crate::model::range_byte::ConstraintViolation),
|
3679 + | /// Constraint violation occurred building member `min_byte` when building `MalformedRangeInput`.
|
3680 + | #[doc(hidden)]
|
3681 + | MinByte(crate::model::min_byte::ConstraintViolation),
|
3682 + | /// Constraint violation occurred building member `max_byte` when building `MalformedRangeInput`.
|
3683 + | #[doc(hidden)]
|
3684 + | MaxByte(crate::model::max_byte::ConstraintViolation),
|
3685 + | /// Constraint violation occurred building member `short` when building `MalformedRangeInput`.
|
3686 + | #[doc(hidden)]
|
3687 + | Short(crate::model::range_short::ConstraintViolation),
|
3688 + | /// Constraint violation occurred building member `min_short` when building `MalformedRangeInput`.
|
3689 + | #[doc(hidden)]
|
3690 + | MinShort(crate::model::min_short::ConstraintViolation),
|
3691 + | /// Constraint violation occurred building member `max_short` when building `MalformedRangeInput`.
|
3692 + | #[doc(hidden)]
|
3693 + | MaxShort(crate::model::max_short::ConstraintViolation),
|
3694 + | /// Constraint violation occurred building member `integer` when building `MalformedRangeInput`.
|
3695 + | #[doc(hidden)]
|
3696 + | Integer(crate::model::range_integer::ConstraintViolation),
|
3697 + | /// Constraint violation occurred building member `min_integer` when building `MalformedRangeInput`.
|
3698 + | #[doc(hidden)]
|
3699 + | MinInteger(crate::model::min_integer::ConstraintViolation),
|
3700 + | /// Constraint violation occurred building member `max_integer` when building `MalformedRangeInput`.
|
3701 + | #[doc(hidden)]
|
3702 + | MaxInteger(crate::model::max_integer::ConstraintViolation),
|
3703 + | /// Constraint violation occurred building member `long` when building `MalformedRangeInput`.
|
3704 + | #[doc(hidden)]
|
3705 + | Long(crate::model::range_long::ConstraintViolation),
|
3706 + | /// Constraint violation occurred building member `min_long` when building `MalformedRangeInput`.
|
3707 + | #[doc(hidden)]
|
3708 + | MinLong(crate::model::min_long::ConstraintViolation),
|
3709 + | /// Constraint violation occurred building member `max_long` when building `MalformedRangeInput`.
|
3710 + | #[doc(hidden)]
|
3711 + | MaxLong(crate::model::max_long::ConstraintViolation),
|
3712 + | }
|
3713 + | impl ::std::fmt::Display for ConstraintViolation {
|
3714 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3715 + | match self {
|
3716 + | ConstraintViolation::Byte(_) => write!(f, "constraint violation occurred building member `byte` when building `MalformedRangeInput`"),
|
3717 + | ConstraintViolation::MinByte(_) => write!(f, "constraint violation occurred building member `min_byte` when building `MalformedRangeInput`"),
|
3718 + | ConstraintViolation::MaxByte(_) => write!(f, "constraint violation occurred building member `max_byte` when building `MalformedRangeInput`"),
|
3719 + | ConstraintViolation::Short(_) => write!(f, "constraint violation occurred building member `short` when building `MalformedRangeInput`"),
|
3720 + | ConstraintViolation::MinShort(_) => write!(f, "constraint violation occurred building member `min_short` when building `MalformedRangeInput`"),
|
3721 + | ConstraintViolation::MaxShort(_) => write!(f, "constraint violation occurred building member `max_short` when building `MalformedRangeInput`"),
|
3722 + | ConstraintViolation::Integer(_) => write!(f, "constraint violation occurred building member `integer` when building `MalformedRangeInput`"),
|
3723 + | ConstraintViolation::MinInteger(_) => write!(f, "constraint violation occurred building member `min_integer` when building `MalformedRangeInput`"),
|
3724 + | ConstraintViolation::MaxInteger(_) => write!(f, "constraint violation occurred building member `max_integer` when building `MalformedRangeInput`"),
|
3725 + | ConstraintViolation::Long(_) => write!(f, "constraint violation occurred building member `long` when building `MalformedRangeInput`"),
|
3726 + | ConstraintViolation::MinLong(_) => write!(f, "constraint violation occurred building member `min_long` when building `MalformedRangeInput`"),
|
3727 + | ConstraintViolation::MaxLong(_) => write!(f, "constraint violation occurred building member `max_long` when building `MalformedRangeInput`"),
|
3728 + | }
|
3729 + | }
|
3730 + | }
|
3731 + | impl ::std::error::Error for ConstraintViolation {}
|
3732 + | impl ConstraintViolation {
|
3733 + | pub(crate) fn as_validation_exception_field(
|
3734 + | self,
|
3735 + | path: ::std::string::String,
|
3736 + | ) -> crate::model::ValidationExceptionField {
|
3737 + | match self {
|
3738 + | ConstraintViolation::Byte(inner) => {
|
3739 + | inner.as_validation_exception_field(path + "/byte")
|
3740 + | }
|
3741 + | ConstraintViolation::MinByte(inner) => {
|
3742 + | inner.as_validation_exception_field(path + "/minByte")
|
3743 + | }
|
3744 + | ConstraintViolation::MaxByte(inner) => {
|
3745 + | inner.as_validation_exception_field(path + "/maxByte")
|
3746 + | }
|
3747 + | ConstraintViolation::Short(inner) => {
|
3748 + | inner.as_validation_exception_field(path + "/short")
|
3749 + | }
|
3750 + | ConstraintViolation::MinShort(inner) => {
|
3751 + | inner.as_validation_exception_field(path + "/minShort")
|
3752 + | }
|
3753 + | ConstraintViolation::MaxShort(inner) => {
|
3754 + | inner.as_validation_exception_field(path + "/maxShort")
|
3755 + | }
|
3756 + | ConstraintViolation::Integer(inner) => {
|
3757 + | inner.as_validation_exception_field(path + "/integer")
|
3758 + | }
|
3759 + | ConstraintViolation::MinInteger(inner) => {
|
3760 + | inner.as_validation_exception_field(path + "/minInteger")
|
3761 + | }
|
3762 + | ConstraintViolation::MaxInteger(inner) => {
|
3763 + | inner.as_validation_exception_field(path + "/maxInteger")
|
3764 + | }
|
3765 + | ConstraintViolation::Long(inner) => {
|
3766 + | inner.as_validation_exception_field(path + "/long")
|
3767 + | }
|
3768 + | ConstraintViolation::MinLong(inner) => {
|
3769 + | inner.as_validation_exception_field(path + "/minLong")
|
3770 + | }
|
3771 + | ConstraintViolation::MaxLong(inner) => {
|
3772 + | inner.as_validation_exception_field(path + "/maxLong")
|
3773 + | }
|
3774 + | }
|
3775 + | }
|
3776 + | }
|
3777 + | impl ::std::convert::From<ConstraintViolation>
|
3778 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
3779 + | {
|
3780 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
3781 + | let first_validation_exception_field =
|
3782 + | constraint_violation.as_validation_exception_field("".to_owned());
|
3783 + | let validation_exception = crate::error::ValidationException {
|
3784 + | message: format!(
|
3785 + | "1 validation error detected. {}",
|
3786 + | &first_validation_exception_field.message
|
3787 + | ),
|
3788 + | field_list: Some(vec![first_validation_exception_field]),
|
3789 + | };
|
3790 + | Self::ConstraintViolation(
|
3791 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
3792 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
3793 + | )
|
3794 + | }
|
3795 + | }
|
3796 + | impl ::std::convert::From<Builder>
|
3797 + | for crate::constrained::MaybeConstrained<crate::input::MalformedRangeInput>
|
3798 + | {
|
3799 + | fn from(builder: Builder) -> Self {
|
3800 + | Self::Unconstrained(builder)
|
3801 + | }
|
3802 + | }
|
3803 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedRangeInput {
|
3804 + | type Error = ConstraintViolation;
|
3805 + |
|
3806 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3807 + | builder.build()
|
3808 + | }
|
3809 + | }
|
3810 + | /// A builder for [`MalformedRangeInput`](crate::input::MalformedRangeInput).
|
3811 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3812 + | pub struct Builder {
|
3813 + | pub(crate) byte:
|
3814 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
3815 + | pub(crate) min_byte:
|
3816 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinByte>>,
|
3817 + | pub(crate) max_byte:
|
3818 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxByte>>,
|
3819 + | pub(crate) short:
|
3820 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
3821 + | pub(crate) min_short:
|
3822 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinShort>>,
|
3823 + | pub(crate) max_short:
|
3824 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxShort>>,
|
3825 + | pub(crate) integer:
|
3826 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
3827 + | pub(crate) min_integer:
|
3828 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinInteger>>,
|
3829 + | pub(crate) max_integer:
|
3830 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxInteger>>,
|
3831 + | pub(crate) long:
|
3832 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
3833 + | pub(crate) min_long:
|
3834 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLong>>,
|
3835 + | pub(crate) max_long:
|
3836 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLong>>,
|
3837 + | pub(crate) float: ::std::option::Option<f32>,
|
3838 + | pub(crate) min_float: ::std::option::Option<f32>,
|
3839 + | pub(crate) max_float: ::std::option::Option<f32>,
|
3840 + | }
|
3841 + | impl Builder {
|
3842 + | #[allow(missing_docs)] // documentation missing in model
|
3843 + | pub fn byte(mut self, input: ::std::option::Option<crate::model::RangeByte>) -> Self {
|
3844 + | self.byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3845 + | self
|
3846 + | }
|
3847 + | #[allow(missing_docs)] // documentation missing in model
|
3848 + | pub(crate) fn set_byte(
|
3849 + | mut self,
|
3850 + | input: Option<
|
3851 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
3852 + | >,
|
3853 + | ) -> Self {
|
3854 + | self.byte = input.map(|v| v.into());
|
3855 + | self
|
3856 + | }
|
3857 + | #[allow(missing_docs)] // documentation missing in model
|
3858 + | pub fn min_byte(mut self, input: ::std::option::Option<crate::model::MinByte>) -> Self {
|
3859 + | self.min_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3860 + | self
|
3861 + | }
|
3862 + | #[allow(missing_docs)] // documentation missing in model
|
3863 + | pub(crate) fn set_min_byte(
|
3864 + | mut self,
|
3865 + | input: Option<
|
3866 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MinByte>>,
|
3867 + | >,
|
3868 + | ) -> Self {
|
3869 + | self.min_byte = input.map(|v| v.into());
|
3870 + | self
|
3871 + | }
|
3872 + | #[allow(missing_docs)] // documentation missing in model
|
3873 + | pub fn max_byte(mut self, input: ::std::option::Option<crate::model::MaxByte>) -> Self {
|
3874 + | self.max_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3875 + | self
|
3876 + | }
|
3877 + | #[allow(missing_docs)] // documentation missing in model
|
3878 + | pub(crate) fn set_max_byte(
|
3879 + | mut self,
|
3880 + | input: Option<
|
3881 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MaxByte>>,
|
3882 + | >,
|
3883 + | ) -> Self {
|
3884 + | self.max_byte = input.map(|v| v.into());
|
3885 + | self
|
3886 + | }
|
3887 + | #[allow(missing_docs)] // documentation missing in model
|
3888 + | pub fn short(mut self, input: ::std::option::Option<crate::model::RangeShort>) -> Self {
|
3889 + | self.short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3890 + | self
|
3891 + | }
|
3892 + | #[allow(missing_docs)] // documentation missing in model
|
3893 + | pub(crate) fn set_short(
|
3894 + | mut self,
|
3895 + | input: Option<
|
3896 + | impl ::std::convert::Into<
|
3897 + | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
3898 + | >,
|
3899 + | >,
|
3900 + | ) -> Self {
|
3901 + | self.short = input.map(|v| v.into());
|
3902 + | self
|
3903 + | }
|
3904 + | #[allow(missing_docs)] // documentation missing in model
|
3905 + | pub fn min_short(mut self, input: ::std::option::Option<crate::model::MinShort>) -> Self {
|
3906 + | self.min_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3907 + | self
|
3908 + | }
|
3909 + | #[allow(missing_docs)] // documentation missing in model
|
3910 + | pub(crate) fn set_min_short(
|
3911 + | mut self,
|
3912 + | input: Option<
|
3913 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MinShort>>,
|
3914 + | >,
|
3915 + | ) -> Self {
|
3916 + | self.min_short = input.map(|v| v.into());
|
3917 + | self
|
3918 + | }
|
3919 + | #[allow(missing_docs)] // documentation missing in model
|
3920 + | pub fn max_short(mut self, input: ::std::option::Option<crate::model::MaxShort>) -> Self {
|
3921 + | self.max_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3922 + | self
|
3923 + | }
|
3924 + | #[allow(missing_docs)] // documentation missing in model
|
3925 + | pub(crate) fn set_max_short(
|
3926 + | mut self,
|
3927 + | input: Option<
|
3928 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MaxShort>>,
|
3929 + | >,
|
3930 + | ) -> Self {
|
3931 + | self.max_short = input.map(|v| v.into());
|
3932 + | self
|
3933 + | }
|
3934 + | #[allow(missing_docs)] // documentation missing in model
|
3935 + | pub fn integer(mut self, input: ::std::option::Option<crate::model::RangeInteger>) -> Self {
|
3936 + | self.integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3937 + | self
|
3938 + | }
|
3939 + | #[allow(missing_docs)] // documentation missing in model
|
3940 + | pub(crate) fn set_integer(
|
3941 + | mut self,
|
3942 + | input: Option<
|
3943 + | impl ::std::convert::Into<
|
3944 + | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
3945 + | >,
|
3946 + | >,
|
3947 + | ) -> Self {
|
3948 + | self.integer = input.map(|v| v.into());
|
3949 + | self
|
3950 + | }
|
3951 + | #[allow(missing_docs)] // documentation missing in model
|
3952 + | pub fn min_integer(
|
3953 + | mut self,
|
3954 + | input: ::std::option::Option<crate::model::MinInteger>,
|
3955 + | ) -> Self {
|
3956 + | self.min_integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3957 + | self
|
3958 + | }
|
3959 + | #[allow(missing_docs)] // documentation missing in model
|
3960 + | pub(crate) fn set_min_integer(
|
3961 + | mut self,
|
3962 + | input: Option<
|
3963 + | impl ::std::convert::Into<
|
3964 + | crate::constrained::MaybeConstrained<crate::model::MinInteger>,
|
3965 + | >,
|
3966 + | >,
|
3967 + | ) -> Self {
|
3968 + | self.min_integer = input.map(|v| v.into());
|
3969 + | self
|
3970 + | }
|
3971 + | #[allow(missing_docs)] // documentation missing in model
|
3972 + | pub fn max_integer(
|
3973 + | mut self,
|
3974 + | input: ::std::option::Option<crate::model::MaxInteger>,
|
3975 + | ) -> Self {
|
3976 + | self.max_integer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3977 + | self
|
3978 + | }
|
3979 + | #[allow(missing_docs)] // documentation missing in model
|
3980 + | pub(crate) fn set_max_integer(
|
3981 + | mut self,
|
3982 + | input: Option<
|
3983 + | impl ::std::convert::Into<
|
3984 + | crate::constrained::MaybeConstrained<crate::model::MaxInteger>,
|
3985 + | >,
|
3986 + | >,
|
3987 + | ) -> Self {
|
3988 + | self.max_integer = input.map(|v| v.into());
|
3989 + | self
|
3990 + | }
|
3991 + | #[allow(missing_docs)] // documentation missing in model
|
3992 + | pub fn long(mut self, input: ::std::option::Option<crate::model::RangeLong>) -> Self {
|
3993 + | self.long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
3994 + | self
|
3995 + | }
|
3996 + | #[allow(missing_docs)] // documentation missing in model
|
3997 + | pub(crate) fn set_long(
|
3998 + | mut self,
|
3999 + | input: Option<
|
4000 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
4001 + | >,
|
4002 + | ) -> Self {
|
4003 + | self.long = input.map(|v| v.into());
|
4004 + | self
|
4005 + | }
|
4006 + | #[allow(missing_docs)] // documentation missing in model
|
4007 + | pub fn min_long(mut self, input: ::std::option::Option<crate::model::MinLong>) -> Self {
|
4008 + | self.min_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4009 + | self
|
4010 + | }
|
4011 + | #[allow(missing_docs)] // documentation missing in model
|
4012 + | pub(crate) fn set_min_long(
|
4013 + | mut self,
|
4014 + | input: Option<
|
4015 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MinLong>>,
|
4016 + | >,
|
4017 + | ) -> Self {
|
4018 + | self.min_long = input.map(|v| v.into());
|
4019 + | self
|
4020 + | }
|
4021 + | #[allow(missing_docs)] // documentation missing in model
|
4022 + | pub fn max_long(mut self, input: ::std::option::Option<crate::model::MaxLong>) -> Self {
|
4023 + | self.max_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4024 + | self
|
4025 + | }
|
4026 + | #[allow(missing_docs)] // documentation missing in model
|
4027 + | pub(crate) fn set_max_long(
|
4028 + | mut self,
|
4029 + | input: Option<
|
4030 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::MaxLong>>,
|
4031 + | >,
|
4032 + | ) -> Self {
|
4033 + | self.max_long = input.map(|v| v.into());
|
4034 + | self
|
4035 + | }
|
4036 + | #[allow(missing_docs)] // documentation missing in model
|
4037 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
4038 + | self.float = input;
|
4039 + | self
|
4040 + | }
|
4041 + | #[allow(missing_docs)] // documentation missing in model
|
4042 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
4043 + | self.float = input.map(|v| v.into());
|
4044 + | self
|
4045 + | }
|
4046 + | #[allow(missing_docs)] // documentation missing in model
|
4047 + | pub fn min_float(mut self, input: ::std::option::Option<f32>) -> Self {
|
4048 + | self.min_float = input;
|
4049 + | self
|
4050 + | }
|
4051 + | #[allow(missing_docs)] // documentation missing in model
|
4052 + | pub(crate) fn set_min_float(
|
4053 + | mut self,
|
4054 + | input: Option<impl ::std::convert::Into<f32>>,
|
4055 + | ) -> Self {
|
4056 + | self.min_float = input.map(|v| v.into());
|
4057 + | self
|
4058 + | }
|
4059 + | #[allow(missing_docs)] // documentation missing in model
|
4060 + | pub fn max_float(mut self, input: ::std::option::Option<f32>) -> Self {
|
4061 + | self.max_float = input;
|
4062 + | self
|
4063 + | }
|
4064 + | #[allow(missing_docs)] // documentation missing in model
|
4065 + | pub(crate) fn set_max_float(
|
4066 + | mut self,
|
4067 + | input: Option<impl ::std::convert::Into<f32>>,
|
4068 + | ) -> Self {
|
4069 + | self.max_float = input.map(|v| v.into());
|
4070 + | self
|
4071 + | }
|
4072 + | /// Consumes the builder and constructs a [`MalformedRangeInput`](crate::input::MalformedRangeInput).
|
4073 + | ///
|
4074 + | /// The builder fails to construct a [`MalformedRangeInput`](crate::input::MalformedRangeInput) if a [`ConstraintViolation`] occurs.
|
4075 + | ///
|
4076 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4077 + | pub fn build(self) -> Result<crate::input::MalformedRangeInput, ConstraintViolation> {
|
4078 + | self.build_enforcing_all_constraints()
|
4079 + | }
|
4080 + | fn build_enforcing_all_constraints(
|
4081 + | self,
|
4082 + | ) -> Result<crate::input::MalformedRangeInput, ConstraintViolation> {
|
4083 + | Ok(crate::input::MalformedRangeInput {
|
4084 + | byte: self
|
4085 + | .byte
|
4086 + | .map(|v| match v {
|
4087 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4088 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4089 + | })
|
4090 + | .map(|res| res.map_err(ConstraintViolation::Byte))
|
4091 + | .transpose()?,
|
4092 + | min_byte: self
|
4093 + | .min_byte
|
4094 + | .map(|v| match v {
|
4095 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4096 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4097 + | })
|
4098 + | .map(|res| res.map_err(ConstraintViolation::MinByte))
|
4099 + | .transpose()?,
|
4100 + | max_byte: self
|
4101 + | .max_byte
|
4102 + | .map(|v| match v {
|
4103 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4104 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4105 + | })
|
4106 + | .map(|res| res.map_err(ConstraintViolation::MaxByte))
|
4107 + | .transpose()?,
|
4108 + | short: self
|
4109 + | .short
|
4110 + | .map(|v| match v {
|
4111 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4112 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4113 + | })
|
4114 + | .map(|res| res.map_err(ConstraintViolation::Short))
|
4115 + | .transpose()?,
|
4116 + | min_short: self
|
4117 + | .min_short
|
4118 + | .map(|v| match v {
|
4119 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4120 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4121 + | })
|
4122 + | .map(|res| res.map_err(ConstraintViolation::MinShort))
|
4123 + | .transpose()?,
|
4124 + | max_short: self
|
4125 + | .max_short
|
4126 + | .map(|v| match v {
|
4127 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4128 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4129 + | })
|
4130 + | .map(|res| res.map_err(ConstraintViolation::MaxShort))
|
4131 + | .transpose()?,
|
4132 + | integer: self
|
4133 + | .integer
|
4134 + | .map(|v| match v {
|
4135 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4136 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4137 + | })
|
4138 + | .map(|res| res.map_err(ConstraintViolation::Integer))
|
4139 + | .transpose()?,
|
4140 + | min_integer: self
|
4141 + | .min_integer
|
4142 + | .map(|v| match v {
|
4143 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4144 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4145 + | })
|
4146 + | .map(|res| res.map_err(ConstraintViolation::MinInteger))
|
4147 + | .transpose()?,
|
4148 + | max_integer: self
|
4149 + | .max_integer
|
4150 + | .map(|v| match v {
|
4151 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4152 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4153 + | })
|
4154 + | .map(|res| res.map_err(ConstraintViolation::MaxInteger))
|
4155 + | .transpose()?,
|
4156 + | long: self
|
4157 + | .long
|
4158 + | .map(|v| match v {
|
4159 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4160 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4161 + | })
|
4162 + | .map(|res| res.map_err(ConstraintViolation::Long))
|
4163 + | .transpose()?,
|
4164 + | min_long: self
|
4165 + | .min_long
|
4166 + | .map(|v| match v {
|
4167 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4168 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4169 + | })
|
4170 + | .map(|res| res.map_err(ConstraintViolation::MinLong))
|
4171 + | .transpose()?,
|
4172 + | max_long: self
|
4173 + | .max_long
|
4174 + | .map(|v| match v {
|
4175 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4176 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4177 + | })
|
4178 + | .map(|res| res.map_err(ConstraintViolation::MaxLong))
|
4179 + | .transpose()?,
|
4180 + | float: self.float,
|
4181 + | min_float: self.min_float,
|
4182 + | max_float: self.max_float,
|
4183 + | })
|
4184 + | }
|
4185 + | }
|
4186 + | }
|
4187 + | /// See [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput).
|
4188 + | pub mod malformed_pattern_override_input {
|
4189 + |
|
4190 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4191 + | /// Holds one variant for each of the ways the builder can fail.
|
4192 + | #[non_exhaustive]
|
4193 + | #[allow(clippy::enum_variant_names)]
|
4194 + | pub enum ConstraintViolation {
|
4195 + | /// Constraint violation occurred building member `string` when building `MalformedPatternOverrideInput`.
|
4196 + | #[doc(hidden)]
|
4197 + | String(crate::input::malformed_pattern_override_input::string::ConstraintViolation),
|
4198 + | /// Constraint violation occurred building member `list` when building `MalformedPatternOverrideInput`.
|
4199 + | #[doc(hidden)]
|
4200 + | List(crate::model::pattern_list_override::ConstraintViolation),
|
4201 + | /// Constraint violation occurred building member `map` when building `MalformedPatternOverrideInput`.
|
4202 + | #[doc(hidden)]
|
4203 + | Map(crate::model::pattern_map_override::ConstraintViolation),
|
4204 + | /// Constraint violation occurred building member `union` when building `MalformedPatternOverrideInput`.
|
4205 + | #[doc(hidden)]
|
4206 + | Union(crate::model::pattern_union_override::ConstraintViolation),
|
4207 + | }
|
4208 + | impl ::std::fmt::Display for ConstraintViolation {
|
4209 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4210 + | match self {
|
4211 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedPatternOverrideInput`"),
|
4212 + | ConstraintViolation::List(_) => write!(f, "constraint violation occurred building member `list` when building `MalformedPatternOverrideInput`"),
|
4213 + | ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MalformedPatternOverrideInput`"),
|
4214 + | ConstraintViolation::Union(_) => write!(f, "constraint violation occurred building member `union` when building `MalformedPatternOverrideInput`"),
|
4215 + | }
|
4216 + | }
|
4217 + | }
|
4218 + | impl ::std::error::Error for ConstraintViolation {}
|
4219 + | impl ConstraintViolation {
|
4220 + | pub(crate) fn as_validation_exception_field(
|
4221 + | self,
|
4222 + | path: ::std::string::String,
|
4223 + | ) -> crate::model::ValidationExceptionField {
|
4224 + | match self {
|
4225 + | ConstraintViolation::String(inner) => {
|
4226 + | inner.as_validation_exception_field(path + "/string")
|
4227 + | }
|
4228 + | ConstraintViolation::List(inner) => {
|
4229 + | inner.as_validation_exception_field(path + "/list")
|
4230 + | }
|
4231 + | ConstraintViolation::Map(inner) => {
|
4232 + | inner.as_validation_exception_field(path + "/map")
|
4233 + | }
|
4234 + | ConstraintViolation::Union(inner) => {
|
4235 + | inner.as_validation_exception_field(path + "/union")
|
4236 + | }
|
4237 + | }
|
4238 + | }
|
4239 + | }
|
4240 + | impl ::std::convert::From<ConstraintViolation>
|
4241 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
4242 + | {
|
4243 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
4244 + | let first_validation_exception_field =
|
4245 + | constraint_violation.as_validation_exception_field("".to_owned());
|
4246 + | let validation_exception = crate::error::ValidationException {
|
4247 + | message: format!(
|
4248 + | "1 validation error detected. {}",
|
4249 + | &first_validation_exception_field.message
|
4250 + | ),
|
4251 + | field_list: Some(vec![first_validation_exception_field]),
|
4252 + | };
|
4253 + | Self::ConstraintViolation(
|
4254 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
4255 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
4256 + | )
|
4257 + | }
|
4258 + | }
|
4259 + | impl ::std::convert::From<Builder>
|
4260 + | for crate::constrained::MaybeConstrained<crate::input::MalformedPatternOverrideInput>
|
4261 + | {
|
4262 + | fn from(builder: Builder) -> Self {
|
4263 + | Self::Unconstrained(builder)
|
4264 + | }
|
4265 + | }
|
4266 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedPatternOverrideInput {
|
4267 + | type Error = ConstraintViolation;
|
4268 + |
|
4269 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4270 + | builder.build()
|
4271 + | }
|
4272 + | }
|
4273 + | /// A builder for [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput).
|
4274 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4275 + | pub struct Builder {
|
4276 + | pub(crate) string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::input::malformed_pattern_override_input::String>>,
|
4277 + | pub(crate) list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::pattern_list_override_constrained::PatternListOverrideConstrained>>,
|
4278 + | pub(crate) map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::pattern_map_override_constrained::PatternMapOverrideConstrained>>,
|
4279 + | pub(crate) union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternUnionOverride>>,
|
4280 + | }
|
4281 + | impl Builder {
|
4282 + | #[allow(missing_docs)] // documentation missing in model
|
4283 + | pub fn string(
|
4284 + | mut self,
|
4285 + | input: ::std::option::Option<crate::input::malformed_pattern_override_input::String>,
|
4286 + | ) -> Self {
|
4287 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4288 + | self
|
4289 + | }
|
4290 + | #[allow(missing_docs)] // documentation missing in model
|
4291 + | pub(crate) fn set_string(
|
4292 + | mut self,
|
4293 + | input: Option<
|
4294 + | impl ::std::convert::Into<
|
4295 + | crate::constrained::MaybeConstrained<
|
4296 + | crate::input::malformed_pattern_override_input::String,
|
4297 + | >,
|
4298 + | >,
|
4299 + | >,
|
4300 + | ) -> Self {
|
4301 + | self.string = input.map(|v| v.into());
|
4302 + | self
|
4303 + | }
|
4304 + | #[allow(missing_docs)] // documentation missing in model
|
4305 + | pub fn list(
|
4306 + | mut self,
|
4307 + | input: ::std::option::Option<
|
4308 + | ::std::vec::Vec<crate::model::pattern_list_override::Member>,
|
4309 + | >,
|
4310 + | ) -> Self {
|
4311 + | self.list =
|
4312 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
4313 + | self
|
4314 + | }
|
4315 + | #[allow(missing_docs)] // documentation missing in model
|
4316 + | pub(crate) fn set_list(
|
4317 + | mut self,
|
4318 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::pattern_list_override_constrained::PatternListOverrideConstrained>>>,
|
4319 + | ) -> Self {
|
4320 + | self.list = input.map(|v| v.into());
|
4321 + | self
|
4322 + | }
|
4323 + | #[allow(missing_docs)] // documentation missing in model
|
4324 + | pub fn map(
|
4325 + | mut self,
|
4326 + | input: ::std::option::Option<
|
4327 + | ::std::collections::HashMap<
|
4328 + | crate::model::pattern_map_override::Key,
|
4329 + | crate::model::pattern_map_override::Value,
|
4330 + | >,
|
4331 + | >,
|
4332 + | ) -> Self {
|
4333 + | self.map = input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
4334 + | self
|
4335 + | }
|
4336 + | #[allow(missing_docs)] // documentation missing in model
|
4337 + | pub(crate) fn set_map(
|
4338 + | mut self,
|
4339 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::pattern_map_override_constrained::PatternMapOverrideConstrained>>>,
|
4340 + | ) -> Self {
|
4341 + | self.map = input.map(|v| v.into());
|
4342 + | self
|
4343 + | }
|
4344 + | #[allow(missing_docs)] // documentation missing in model
|
4345 + | pub fn union(
|
4346 + | mut self,
|
4347 + | input: ::std::option::Option<crate::model::PatternUnionOverride>,
|
4348 + | ) -> Self {
|
4349 + | self.union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4350 + | self
|
4351 + | }
|
4352 + | #[allow(missing_docs)] // documentation missing in model
|
4353 + | pub(crate) fn set_union(
|
4354 + | mut self,
|
4355 + | input: Option<
|
4356 + | impl ::std::convert::Into<
|
4357 + | crate::constrained::MaybeConstrained<crate::model::PatternUnionOverride>,
|
4358 + | >,
|
4359 + | >,
|
4360 + | ) -> Self {
|
4361 + | self.union = input.map(|v| v.into());
|
4362 + | self
|
4363 + | }
|
4364 + | /// Consumes the builder and constructs a [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput).
|
4365 + | ///
|
4366 + | /// The builder fails to construct a [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput) if a [`ConstraintViolation`] occurs.
|
4367 + | ///
|
4368 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4369 + | pub fn build(
|
4370 + | self,
|
4371 + | ) -> Result<crate::input::MalformedPatternOverrideInput, ConstraintViolation> {
|
4372 + | self.build_enforcing_all_constraints()
|
4373 + | }
|
4374 + | fn build_enforcing_all_constraints(
|
4375 + | self,
|
4376 + | ) -> Result<crate::input::MalformedPatternOverrideInput, ConstraintViolation> {
|
4377 + | Ok(crate::input::MalformedPatternOverrideInput {
|
4378 + | string: self
|
4379 + | .string
|
4380 + | .map(|v| match v {
|
4381 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4382 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4383 + | })
|
4384 + | .map(|res| res.map_err(ConstraintViolation::String))
|
4385 + | .transpose()?,
|
4386 + | list: self
|
4387 + | .list
|
4388 + | .map(|v| match v {
|
4389 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4390 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4391 + | })
|
4392 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::List))
|
4393 + | .transpose()?,
|
4394 + | map: self
|
4395 + | .map
|
4396 + | .map(|v| match v {
|
4397 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4398 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4399 + | })
|
4400 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Map))
|
4401 + | .transpose()?,
|
4402 + | union: self
|
4403 + | .union
|
4404 + | .map(|v| match v {
|
4405 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4406 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4407 + | })
|
4408 + | .map(|res| res.map_err(ConstraintViolation::Union))
|
4409 + | .transpose()?,
|
4410 + | })
|
4411 + | }
|
4412 + | }
|
4413 + | #[allow(missing_docs)] // documentation missing in model
|
4414 + | ///
|
4415 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4416 + | /// [constraint traits]. Use [`String::try_from`] to construct values of this type.
|
4417 + | ///
|
4418 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4419 + | ///
|
4420 + | #[derive(
|
4421 + | ::std::clone::Clone,
|
4422 + | ::std::cmp::Eq,
|
4423 + | ::std::cmp::PartialEq,
|
4424 + | ::std::fmt::Debug,
|
4425 + | ::std::hash::Hash,
|
4426 + | )]
|
4427 + | pub struct String(pub(crate) ::std::string::String);
|
4428 + | impl String {
|
4429 + | /// Extracts a string slice containing the entire underlying `String`.
|
4430 + | pub fn as_str(&self) -> &str {
|
4431 + | &self.0
|
4432 + | }
|
4433 + |
|
4434 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4435 + | pub fn inner(&self) -> &::std::string::String {
|
4436 + | &self.0
|
4437 + | }
|
4438 + |
|
4439 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4440 + | pub fn into_inner(self) -> ::std::string::String {
|
4441 + | self.0
|
4442 + | }
|
4443 + | }
|
4444 + | impl String {
|
4445 + | fn check_pattern(
|
4446 + | string: ::std::string::String,
|
4447 + | ) -> ::std::result::Result<
|
4448 + | ::std::string::String,
|
4449 + | crate::input::malformed_pattern_override_input::string::ConstraintViolation,
|
4450 + | > {
|
4451 + | let regex = Self::compile_regex();
|
4452 + |
|
4453 + | if regex.is_match(&string) {
|
4454 + | Ok(string)
|
4455 + | } else {
|
4456 + | Err(crate::input::malformed_pattern_override_input::string::ConstraintViolation::Pattern(string))
|
4457 + | }
|
4458 + | }
|
4459 + |
|
4460 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
4461 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
4462 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
4463 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
4464 + | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
4465 + | });
|
4466 + |
|
4467 + | ®EX
|
4468 + | }
|
4469 + | }
|
4470 + | impl ::std::convert::TryFrom<::std::string::String> for String {
|
4471 + | type Error = crate::input::malformed_pattern_override_input::string::ConstraintViolation;
|
4472 + |
|
4473 + | /// Constructs a `String` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4474 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4475 + | let value = Self::check_pattern(value)?;
|
4476 + |
|
4477 + | Ok(Self(value))
|
4478 + | }
|
4479 + | }
|
4480 + | impl crate::constrained::Constrained for String {
|
4481 + | type Unconstrained = ::std::string::String;
|
4482 + | }
|
4483 + |
|
4484 + | impl ::std::convert::From<::std::string::String>
|
4485 + | for crate::constrained::MaybeConstrained<
|
4486 + | crate::input::malformed_pattern_override_input::String,
|
4487 + | >
|
4488 + | {
|
4489 + | fn from(value: ::std::string::String) -> Self {
|
4490 + | Self::Unconstrained(value)
|
4491 + | }
|
4492 + | }
|
4493 + |
|
4494 + | impl ::std::fmt::Display for String {
|
4495 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4496 + | self.0.fmt(f)
|
4497 + | }
|
4498 + | }
|
4499 + |
|
4500 + | impl ::std::convert::From<String> for ::std::string::String {
|
4501 + | fn from(value: String) -> Self {
|
4502 + | value.into_inner()
|
4503 + | }
|
4504 + | }
|
4505 + | #[cfg(test)]
|
4506 + | mod test_string {
|
4507 + | #[test]
|
4508 + | fn regex_compiles() {
|
4509 + | crate::input::malformed_pattern_override_input::String::compile_regex();
|
4510 + | }
|
4511 + | }
|
4512 + |
|
4513 + | /// See [`MalformedPatternOverrideInputString`](crate::input::malformed_pattern_override_input::String).
|
4514 + | pub mod string {
|
4515 + |
|
4516 + | #[derive(Debug, PartialEq)]
|
4517 + | pub enum ConstraintViolation {
|
4518 + | /// Error when a string doesn't satisfy its `@pattern`.
|
4519 + | /// Contains the String that failed the pattern.
|
4520 + | Pattern(String),
|
4521 + | }
|
4522 + |
|
4523 + | impl ::std::fmt::Display for ConstraintViolation {
|
4524 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4525 + | let message = match self {
|
4526 + | Self::Pattern(_) => {
|
4527 + | format!(
|
4528 + | r#"Value provided for `aws.protocoltests.restjson.validation.synthetic#MalformedPatternOverrideInputString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4529 + | r#"^[g-m]+$"#
|
4530 + | )
|
4531 + | }
|
4532 + | };
|
4533 + | write!(f, "{message}")
|
4534 + | }
|
4535 + | }
|
4536 + |
|
4537 + | impl ::std::error::Error for ConstraintViolation {}
|
4538 + | impl ConstraintViolation {
|
4539 + | pub(crate) fn as_validation_exception_field(
|
4540 + | self,
|
4541 + | path: ::std::string::String,
|
4542 + | ) -> crate::model::ValidationExceptionField {
|
4543 + | match self {
|
4544 + | #[allow(unused_variables)]
|
4545 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4546 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
4547 + | path
|
4548 + | },
|
4549 + | }
|
4550 + | }
|
4551 + | }
|
4552 + | }
|
4553 + | }
|
4554 + | /// See [`MalformedPatternInput`](crate::input::MalformedPatternInput).
|
4555 + | pub mod malformed_pattern_input {
|
4556 + |
|
4557 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4558 + | /// Holds one variant for each of the ways the builder can fail.
|
4559 + | #[non_exhaustive]
|
4560 + | #[allow(clippy::enum_variant_names)]
|
4561 + | pub enum ConstraintViolation {
|
4562 + | /// Constraint violation occurred building member `string` when building `MalformedPatternInput`.
|
4563 + | #[doc(hidden)]
|
4564 + | String(crate::model::pattern_string::ConstraintViolation),
|
4565 + | /// Constraint violation occurred building member `evil_string` when building `MalformedPatternInput`.
|
4566 + | #[doc(hidden)]
|
4567 + | EvilString(crate::model::evil_string::ConstraintViolation),
|
4568 + | /// Constraint violation occurred building member `list` when building `MalformedPatternInput`.
|
4569 + | #[doc(hidden)]
|
4570 + | List(crate::model::pattern_list::ConstraintViolation),
|
4571 + | /// Constraint violation occurred building member `map` when building `MalformedPatternInput`.
|
4572 + | #[doc(hidden)]
|
4573 + | Map(crate::model::pattern_map::ConstraintViolation),
|
4574 + | /// Constraint violation occurred building member `union` when building `MalformedPatternInput`.
|
4575 + | #[doc(hidden)]
|
4576 + | Union(crate::model::pattern_union::ConstraintViolation),
|
4577 + | }
|
4578 + | impl ::std::fmt::Display for ConstraintViolation {
|
4579 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4580 + | match self {
|
4581 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedPatternInput`"),
|
4582 + | ConstraintViolation::EvilString(_) => write!(f, "constraint violation occurred building member `evil_string` when building `MalformedPatternInput`"),
|
4583 + | ConstraintViolation::List(_) => write!(f, "constraint violation occurred building member `list` when building `MalformedPatternInput`"),
|
4584 + | ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MalformedPatternInput`"),
|
4585 + | ConstraintViolation::Union(_) => write!(f, "constraint violation occurred building member `union` when building `MalformedPatternInput`"),
|
4586 + | }
|
4587 + | }
|
4588 + | }
|
4589 + | impl ::std::error::Error for ConstraintViolation {}
|
4590 + | impl ConstraintViolation {
|
4591 + | pub(crate) fn as_validation_exception_field(
|
4592 + | self,
|
4593 + | path: ::std::string::String,
|
4594 + | ) -> crate::model::ValidationExceptionField {
|
4595 + | match self {
|
4596 + | ConstraintViolation::String(inner) => {
|
4597 + | inner.as_validation_exception_field(path + "/string")
|
4598 + | }
|
4599 + | ConstraintViolation::EvilString(inner) => {
|
4600 + | inner.as_validation_exception_field(path + "/evilString")
|
4601 + | }
|
4602 + | ConstraintViolation::List(inner) => {
|
4603 + | inner.as_validation_exception_field(path + "/list")
|
4604 + | }
|
4605 + | ConstraintViolation::Map(inner) => {
|
4606 + | inner.as_validation_exception_field(path + "/map")
|
4607 + | }
|
4608 + | ConstraintViolation::Union(inner) => {
|
4609 + | inner.as_validation_exception_field(path + "/union")
|
4610 + | }
|
4611 + | }
|
4612 + | }
|
4613 + | }
|
4614 + | impl ::std::convert::From<ConstraintViolation>
|
4615 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
4616 + | {
|
4617 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
4618 + | let first_validation_exception_field =
|
4619 + | constraint_violation.as_validation_exception_field("".to_owned());
|
4620 + | let validation_exception = crate::error::ValidationException {
|
4621 + | message: format!(
|
4622 + | "1 validation error detected. {}",
|
4623 + | &first_validation_exception_field.message
|
4624 + | ),
|
4625 + | field_list: Some(vec![first_validation_exception_field]),
|
4626 + | };
|
4627 + | Self::ConstraintViolation(
|
4628 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
4629 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
4630 + | )
|
4631 + | }
|
4632 + | }
|
4633 + | impl ::std::convert::From<Builder>
|
4634 + | for crate::constrained::MaybeConstrained<crate::input::MalformedPatternInput>
|
4635 + | {
|
4636 + | fn from(builder: Builder) -> Self {
|
4637 + | Self::Unconstrained(builder)
|
4638 + | }
|
4639 + | }
|
4640 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedPatternInput {
|
4641 + | type Error = ConstraintViolation;
|
4642 + |
|
4643 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4644 + | builder.build()
|
4645 + | }
|
4646 + | }
|
4647 + | /// A builder for [`MalformedPatternInput`](crate::input::MalformedPatternInput).
|
4648 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4649 + | pub struct Builder {
|
4650 + | pub(crate) string: ::std::option::Option<
|
4651 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
4652 + | >,
|
4653 + | pub(crate) evil_string:
|
4654 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EvilString>>,
|
4655 + | pub(crate) list: ::std::option::Option<
|
4656 + | crate::constrained::MaybeConstrained<
|
4657 + | crate::constrained::pattern_list_constrained::PatternListConstrained,
|
4658 + | >,
|
4659 + | >,
|
4660 + | pub(crate) map: ::std::option::Option<
|
4661 + | crate::constrained::MaybeConstrained<
|
4662 + | crate::constrained::pattern_map_constrained::PatternMapConstrained,
|
4663 + | >,
|
4664 + | >,
|
4665 + | pub(crate) union:
|
4666 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternUnion>>,
|
4667 + | }
|
4668 + | impl Builder {
|
4669 + | #[allow(missing_docs)] // documentation missing in model
|
4670 + | pub fn string(mut self, input: ::std::option::Option<crate::model::PatternString>) -> Self {
|
4671 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4672 + | self
|
4673 + | }
|
4674 + | #[allow(missing_docs)] // documentation missing in model
|
4675 + | pub(crate) fn set_string(
|
4676 + | mut self,
|
4677 + | input: Option<
|
4678 + | impl ::std::convert::Into<
|
4679 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
4680 + | >,
|
4681 + | >,
|
4682 + | ) -> Self {
|
4683 + | self.string = input.map(|v| v.into());
|
4684 + | self
|
4685 + | }
|
4686 + | #[allow(missing_docs)] // documentation missing in model
|
4687 + | pub fn evil_string(
|
4688 + | mut self,
|
4689 + | input: ::std::option::Option<crate::model::EvilString>,
|
4690 + | ) -> Self {
|
4691 + | self.evil_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4692 + | self
|
4693 + | }
|
4694 + | #[allow(missing_docs)] // documentation missing in model
|
4695 + | pub(crate) fn set_evil_string(
|
4696 + | mut self,
|
4697 + | input: Option<
|
4698 + | impl ::std::convert::Into<
|
4699 + | crate::constrained::MaybeConstrained<crate::model::EvilString>,
|
4700 + | >,
|
4701 + | >,
|
4702 + | ) -> Self {
|
4703 + | self.evil_string = input.map(|v| v.into());
|
4704 + | self
|
4705 + | }
|
4706 + | #[allow(missing_docs)] // documentation missing in model
|
4707 + | pub fn list(
|
4708 + | mut self,
|
4709 + | input: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
4710 + | ) -> Self {
|
4711 + | self.list =
|
4712 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
4713 + | self
|
4714 + | }
|
4715 + | #[allow(missing_docs)] // documentation missing in model
|
4716 + | pub(crate) fn set_list(
|
4717 + | mut self,
|
4718 + | input: Option<
|
4719 + | impl ::std::convert::Into<
|
4720 + | crate::constrained::MaybeConstrained<
|
4721 + | crate::constrained::pattern_list_constrained::PatternListConstrained,
|
4722 + | >,
|
4723 + | >,
|
4724 + | >,
|
4725 + | ) -> Self {
|
4726 + | self.list = input.map(|v| v.into());
|
4727 + | self
|
4728 + | }
|
4729 + | #[allow(missing_docs)] // documentation missing in model
|
4730 + | pub fn map(
|
4731 + | mut self,
|
4732 + | input: ::std::option::Option<
|
4733 + | ::std::collections::HashMap<
|
4734 + | crate::model::PatternString,
|
4735 + | crate::model::PatternString,
|
4736 + | >,
|
4737 + | >,
|
4738 + | ) -> Self {
|
4739 + | self.map = input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
4740 + | self
|
4741 + | }
|
4742 + | #[allow(missing_docs)] // documentation missing in model
|
4743 + | pub(crate) fn set_map(
|
4744 + | mut self,
|
4745 + | input: Option<
|
4746 + | impl ::std::convert::Into<
|
4747 + | crate::constrained::MaybeConstrained<
|
4748 + | crate::constrained::pattern_map_constrained::PatternMapConstrained,
|
4749 + | >,
|
4750 + | >,
|
4751 + | >,
|
4752 + | ) -> Self {
|
4753 + | self.map = input.map(|v| v.into());
|
4754 + | self
|
4755 + | }
|
4756 + | #[allow(missing_docs)] // documentation missing in model
|
4757 + | pub fn union(mut self, input: ::std::option::Option<crate::model::PatternUnion>) -> Self {
|
4758 + | self.union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4759 + | self
|
4760 + | }
|
4761 + | #[allow(missing_docs)] // documentation missing in model
|
4762 + | pub(crate) fn set_union(
|
4763 + | mut self,
|
4764 + | input: Option<
|
4765 + | impl ::std::convert::Into<
|
4766 + | crate::constrained::MaybeConstrained<crate::model::PatternUnion>,
|
4767 + | >,
|
4768 + | >,
|
4769 + | ) -> Self {
|
4770 + | self.union = input.map(|v| v.into());
|
4771 + | self
|
4772 + | }
|
4773 + | /// Consumes the builder and constructs a [`MalformedPatternInput`](crate::input::MalformedPatternInput).
|
4774 + | ///
|
4775 + | /// The builder fails to construct a [`MalformedPatternInput`](crate::input::MalformedPatternInput) if a [`ConstraintViolation`] occurs.
|
4776 + | ///
|
4777 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4778 + | pub fn build(self) -> Result<crate::input::MalformedPatternInput, ConstraintViolation> {
|
4779 + | self.build_enforcing_all_constraints()
|
4780 + | }
|
4781 + | fn build_enforcing_all_constraints(
|
4782 + | self,
|
4783 + | ) -> Result<crate::input::MalformedPatternInput, ConstraintViolation> {
|
4784 + | Ok(crate::input::MalformedPatternInput {
|
4785 + | string: self
|
4786 + | .string
|
4787 + | .map(|v| match v {
|
4788 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4789 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4790 + | })
|
4791 + | .map(|res| res.map_err(ConstraintViolation::String))
|
4792 + | .transpose()?,
|
4793 + | evil_string: self
|
4794 + | .evil_string
|
4795 + | .map(|v| match v {
|
4796 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4797 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4798 + | })
|
4799 + | .map(|res| res.map_err(ConstraintViolation::EvilString))
|
4800 + | .transpose()?,
|
4801 + | list: self
|
4802 + | .list
|
4803 + | .map(|v| match v {
|
4804 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4805 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4806 + | })
|
4807 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::List))
|
4808 + | .transpose()?,
|
4809 + | map: self
|
4810 + | .map
|
4811 + | .map(|v| match v {
|
4812 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4813 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4814 + | })
|
4815 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Map))
|
4816 + | .transpose()?,
|
4817 + | union: self
|
4818 + | .union
|
4819 + | .map(|v| match v {
|
4820 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4821 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4822 + | })
|
4823 + | .map(|res| res.map_err(ConstraintViolation::Union))
|
4824 + | .transpose()?,
|
4825 + | })
|
4826 + | }
|
4827 + | }
|
4828 + | }
|
4829 + | /// See [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput).
|
4830 + | pub mod malformed_length_query_string_input {
|
4831 + |
|
4832 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4833 + | /// Holds one variant for each of the ways the builder can fail.
|
4834 + | #[non_exhaustive]
|
4835 + | #[allow(clippy::enum_variant_names)]
|
4836 + | pub enum ConstraintViolation {
|
4837 + | /// Constraint violation occurred building member `string` when building `MalformedLengthQueryStringInput`.
|
4838 + | #[doc(hidden)]
|
4839 + | String(crate::model::length_string::ConstraintViolation),
|
4840 + | }
|
4841 + | impl ::std::fmt::Display for ConstraintViolation {
|
4842 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4843 + | match self {
|
4844 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedLengthQueryStringInput`"),
|
4845 + | }
|
4846 + | }
|
4847 + | }
|
4848 + | impl ::std::error::Error for ConstraintViolation {}
|
4849 + | impl ConstraintViolation {
|
4850 + | pub(crate) fn as_validation_exception_field(
|
4851 + | self,
|
4852 + | path: ::std::string::String,
|
4853 + | ) -> crate::model::ValidationExceptionField {
|
4854 + | match self {
|
4855 + | ConstraintViolation::String(inner) => {
|
4856 + | inner.as_validation_exception_field(path + "/string")
|
4857 + | }
|
4858 + | }
|
4859 + | }
|
4860 + | }
|
4861 + | impl ::std::convert::From<ConstraintViolation>
|
4862 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
4863 + | {
|
4864 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
4865 + | let first_validation_exception_field =
|
4866 + | constraint_violation.as_validation_exception_field("".to_owned());
|
4867 + | let validation_exception = crate::error::ValidationException {
|
4868 + | message: format!(
|
4869 + | "1 validation error detected. {}",
|
4870 + | &first_validation_exception_field.message
|
4871 + | ),
|
4872 + | field_list: Some(vec![first_validation_exception_field]),
|
4873 + | };
|
4874 + | Self::ConstraintViolation(
|
4875 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
4876 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
4877 + | )
|
4878 + | }
|
4879 + | }
|
4880 + | impl ::std::convert::From<Builder>
|
4881 + | for crate::constrained::MaybeConstrained<crate::input::MalformedLengthQueryStringInput>
|
4882 + | {
|
4883 + | fn from(builder: Builder) -> Self {
|
4884 + | Self::Unconstrained(builder)
|
4885 + | }
|
4886 + | }
|
4887 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedLengthQueryStringInput {
|
4888 + | type Error = ConstraintViolation;
|
4889 + |
|
4890 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4891 + | builder.build()
|
4892 + | }
|
4893 + | }
|
4894 + | /// A builder for [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput).
|
4895 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4896 + | pub struct Builder {
|
4897 + | pub(crate) string:
|
4898 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
4899 + | }
|
4900 + | impl Builder {
|
4901 + | #[allow(missing_docs)] // documentation missing in model
|
4902 + | pub fn string(mut self, input: ::std::option::Option<crate::model::LengthString>) -> Self {
|
4903 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4904 + | self
|
4905 + | }
|
4906 + | #[allow(missing_docs)] // documentation missing in model
|
4907 + | pub(crate) fn set_string(
|
4908 + | mut self,
|
4909 + | input: Option<
|
4910 + | impl ::std::convert::Into<
|
4911 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
4912 + | >,
|
4913 + | >,
|
4914 + | ) -> Self {
|
4915 + | self.string = input.map(|v| v.into());
|
4916 + | self
|
4917 + | }
|
4918 + | /// Consumes the builder and constructs a [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput).
|
4919 + | ///
|
4920 + | /// The builder fails to construct a [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput) if a [`ConstraintViolation`] occurs.
|
4921 + | ///
|
4922 + | pub fn build(
|
4923 + | self,
|
4924 + | ) -> Result<crate::input::MalformedLengthQueryStringInput, ConstraintViolation> {
|
4925 + | self.build_enforcing_all_constraints()
|
4926 + | }
|
4927 + | fn build_enforcing_all_constraints(
|
4928 + | self,
|
4929 + | ) -> Result<crate::input::MalformedLengthQueryStringInput, ConstraintViolation> {
|
4930 + | Ok(crate::input::MalformedLengthQueryStringInput {
|
4931 + | string: self
|
4932 + | .string
|
4933 + | .map(|v| match v {
|
4934 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4935 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4936 + | })
|
4937 + | .map(|res| res.map_err(ConstraintViolation::String))
|
4938 + | .transpose()?,
|
4939 + | })
|
4940 + | }
|
4941 + | }
|
4942 + | }
|
4943 + | /// See [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput).
|
4944 + | pub mod malformed_length_override_input {
|
4945 + |
|
4946 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4947 + | /// Holds one variant for each of the ways the builder can fail.
|
4948 + | #[non_exhaustive]
|
4949 + | #[allow(clippy::enum_variant_names)]
|
4950 + | pub enum ConstraintViolation {
|
4951 + | /// Constraint violation occurred building member `blob` when building `MalformedLengthOverrideInput`.
|
4952 + | #[doc(hidden)]
|
4953 + | Blob(crate::input::malformed_length_override_input::blob::ConstraintViolation),
|
4954 + | /// Constraint violation occurred building member `string` when building `MalformedLengthOverrideInput`.
|
4955 + | #[doc(hidden)]
|
4956 + | String(crate::input::malformed_length_override_input::string::ConstraintViolation),
|
4957 + | /// Constraint violation occurred building member `min_string` when building `MalformedLengthOverrideInput`.
|
4958 + | #[doc(hidden)]
|
4959 + | MinString(crate::input::malformed_length_override_input::min_string::ConstraintViolation),
|
4960 + | /// Constraint violation occurred building member `max_string` when building `MalformedLengthOverrideInput`.
|
4961 + | #[doc(hidden)]
|
4962 + | MaxString(crate::input::malformed_length_override_input::max_string::ConstraintViolation),
|
4963 + | /// Constraint violation occurred building member `list` when building `MalformedLengthOverrideInput`.
|
4964 + | #[doc(hidden)]
|
4965 + | List(crate::input::malformed_length_override_input::list::ConstraintViolation),
|
4966 + | /// Constraint violation occurred building member `map` when building `MalformedLengthOverrideInput`.
|
4967 + | #[doc(hidden)]
|
4968 + | Map(crate::input::malformed_length_override_input::map::ConstraintViolation),
|
4969 + | }
|
4970 + | impl ::std::fmt::Display for ConstraintViolation {
|
4971 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4972 + | match self {
|
4973 + | ConstraintViolation::Blob(_) => write!(f, "constraint violation occurred building member `blob` when building `MalformedLengthOverrideInput`"),
|
4974 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedLengthOverrideInput`"),
|
4975 + | ConstraintViolation::MinString(_) => write!(f, "constraint violation occurred building member `min_string` when building `MalformedLengthOverrideInput`"),
|
4976 + | ConstraintViolation::MaxString(_) => write!(f, "constraint violation occurred building member `max_string` when building `MalformedLengthOverrideInput`"),
|
4977 + | ConstraintViolation::List(_) => write!(f, "constraint violation occurred building member `list` when building `MalformedLengthOverrideInput`"),
|
4978 + | ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MalformedLengthOverrideInput`"),
|
4979 + | }
|
4980 + | }
|
4981 + | }
|
4982 + | impl ::std::error::Error for ConstraintViolation {}
|
4983 + | impl ConstraintViolation {
|
4984 + | pub(crate) fn as_validation_exception_field(
|
4985 + | self,
|
4986 + | path: ::std::string::String,
|
4987 + | ) -> crate::model::ValidationExceptionField {
|
4988 + | match self {
|
4989 + | ConstraintViolation::Blob(inner) => {
|
4990 + | inner.as_validation_exception_field(path + "/blob")
|
4991 + | }
|
4992 + | ConstraintViolation::String(inner) => {
|
4993 + | inner.as_validation_exception_field(path + "/string")
|
4994 + | }
|
4995 + | ConstraintViolation::MinString(inner) => {
|
4996 + | inner.as_validation_exception_field(path + "/minString")
|
4997 + | }
|
4998 + | ConstraintViolation::MaxString(inner) => {
|
4999 + | inner.as_validation_exception_field(path + "/maxString")
|
5000 + | }
|
5001 + | ConstraintViolation::List(inner) => {
|
5002 + | inner.as_validation_exception_field(path + "/list")
|
5003 + | }
|
5004 + | ConstraintViolation::Map(inner) => {
|
5005 + | inner.as_validation_exception_field(path + "/map")
|
5006 + | }
|
5007 + | }
|
5008 + | }
|
5009 + | }
|
5010 + | impl ::std::convert::From<ConstraintViolation>
|
5011 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
5012 + | {
|
5013 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
5014 + | let first_validation_exception_field =
|
5015 + | constraint_violation.as_validation_exception_field("".to_owned());
|
5016 + | let validation_exception = crate::error::ValidationException {
|
5017 + | message: format!(
|
5018 + | "1 validation error detected. {}",
|
5019 + | &first_validation_exception_field.message
|
5020 + | ),
|
5021 + | field_list: Some(vec![first_validation_exception_field]),
|
5022 + | };
|
5023 + | Self::ConstraintViolation(
|
5024 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
5025 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
5026 + | )
|
5027 + | }
|
5028 + | }
|
5029 + | impl ::std::convert::From<Builder>
|
5030 + | for crate::constrained::MaybeConstrained<crate::input::MalformedLengthOverrideInput>
|
5031 + | {
|
5032 + | fn from(builder: Builder) -> Self {
|
5033 + | Self::Unconstrained(builder)
|
5034 + | }
|
5035 + | }
|
5036 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedLengthOverrideInput {
|
5037 + | type Error = ConstraintViolation;
|
5038 + |
|
5039 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5040 + | builder.build()
|
5041 + | }
|
5042 + | }
|
5043 + | /// A builder for [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput).
|
5044 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5045 + | pub struct Builder {
|
5046 + | pub(crate) blob: ::std::option::Option<
|
5047 + | crate::constrained::MaybeConstrained<
|
5048 + | crate::input::malformed_length_override_input::Blob,
|
5049 + | >,
|
5050 + | >,
|
5051 + | pub(crate) string: ::std::option::Option<
|
5052 + | crate::constrained::MaybeConstrained<
|
5053 + | crate::input::malformed_length_override_input::String,
|
5054 + | >,
|
5055 + | >,
|
5056 + | pub(crate) min_string: ::std::option::Option<
|
5057 + | crate::constrained::MaybeConstrained<
|
5058 + | crate::input::malformed_length_override_input::MinString,
|
5059 + | >,
|
5060 + | >,
|
5061 + | pub(crate) max_string: ::std::option::Option<
|
5062 + | crate::constrained::MaybeConstrained<
|
5063 + | crate::input::malformed_length_override_input::MaxString,
|
5064 + | >,
|
5065 + | >,
|
5066 + | pub(crate) list: ::std::option::Option<
|
5067 + | crate::constrained::MaybeConstrained<
|
5068 + | crate::input::malformed_length_override_input::List,
|
5069 + | >,
|
5070 + | >,
|
5071 + | pub(crate) map: ::std::option::Option<
|
5072 + | crate::constrained::MaybeConstrained<
|
5073 + | crate::input::malformed_length_override_input::Map,
|
5074 + | >,
|
5075 + | >,
|
5076 + | }
|
5077 + | impl Builder {
|
5078 + | #[allow(missing_docs)] // documentation missing in model
|
5079 + | pub fn blob(
|
5080 + | mut self,
|
5081 + | input: ::std::option::Option<crate::input::malformed_length_override_input::Blob>,
|
5082 + | ) -> Self {
|
5083 + | self.blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5084 + | self
|
5085 + | }
|
5086 + | #[allow(missing_docs)] // documentation missing in model
|
5087 + | pub(crate) fn set_blob(
|
5088 + | mut self,
|
5089 + | input: Option<
|
5090 + | impl ::std::convert::Into<
|
5091 + | crate::constrained::MaybeConstrained<
|
5092 + | crate::input::malformed_length_override_input::Blob,
|
5093 + | >,
|
5094 + | >,
|
5095 + | >,
|
5096 + | ) -> Self {
|
5097 + | self.blob = input.map(|v| v.into());
|
5098 + | self
|
5099 + | }
|
5100 + | #[allow(missing_docs)] // documentation missing in model
|
5101 + | pub fn string(
|
5102 + | mut self,
|
5103 + | input: ::std::option::Option<crate::input::malformed_length_override_input::String>,
|
5104 + | ) -> Self {
|
5105 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5106 + | self
|
5107 + | }
|
5108 + | #[allow(missing_docs)] // documentation missing in model
|
5109 + | pub(crate) fn set_string(
|
5110 + | mut self,
|
5111 + | input: Option<
|
5112 + | impl ::std::convert::Into<
|
5113 + | crate::constrained::MaybeConstrained<
|
5114 + | crate::input::malformed_length_override_input::String,
|
5115 + | >,
|
5116 + | >,
|
5117 + | >,
|
5118 + | ) -> Self {
|
5119 + | self.string = input.map(|v| v.into());
|
5120 + | self
|
5121 + | }
|
5122 + | #[allow(missing_docs)] // documentation missing in model
|
5123 + | pub fn min_string(
|
5124 + | mut self,
|
5125 + | input: ::std::option::Option<crate::input::malformed_length_override_input::MinString>,
|
5126 + | ) -> Self {
|
5127 + | self.min_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5128 + | self
|
5129 + | }
|
5130 + | #[allow(missing_docs)] // documentation missing in model
|
5131 + | pub(crate) fn set_min_string(
|
5132 + | mut self,
|
5133 + | input: Option<
|
5134 + | impl ::std::convert::Into<
|
5135 + | crate::constrained::MaybeConstrained<
|
5136 + | crate::input::malformed_length_override_input::MinString,
|
5137 + | >,
|
5138 + | >,
|
5139 + | >,
|
5140 + | ) -> Self {
|
5141 + | self.min_string = input.map(|v| v.into());
|
5142 + | self
|
5143 + | }
|
5144 + | #[allow(missing_docs)] // documentation missing in model
|
5145 + | pub fn max_string(
|
5146 + | mut self,
|
5147 + | input: ::std::option::Option<crate::input::malformed_length_override_input::MaxString>,
|
5148 + | ) -> Self {
|
5149 + | self.max_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5150 + | self
|
5151 + | }
|
5152 + | #[allow(missing_docs)] // documentation missing in model
|
5153 + | pub(crate) fn set_max_string(
|
5154 + | mut self,
|
5155 + | input: Option<
|
5156 + | impl ::std::convert::Into<
|
5157 + | crate::constrained::MaybeConstrained<
|
5158 + | crate::input::malformed_length_override_input::MaxString,
|
5159 + | >,
|
5160 + | >,
|
5161 + | >,
|
5162 + | ) -> Self {
|
5163 + | self.max_string = input.map(|v| v.into());
|
5164 + | self
|
5165 + | }
|
5166 + | #[allow(missing_docs)] // documentation missing in model
|
5167 + | pub fn list(
|
5168 + | mut self,
|
5169 + | input: ::std::option::Option<crate::input::malformed_length_override_input::List>,
|
5170 + | ) -> Self {
|
5171 + | self.list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5172 + | self
|
5173 + | }
|
5174 + | #[allow(missing_docs)] // documentation missing in model
|
5175 + | pub(crate) fn set_list(
|
5176 + | mut self,
|
5177 + | input: Option<
|
5178 + | impl ::std::convert::Into<
|
5179 + | crate::constrained::MaybeConstrained<
|
5180 + | crate::input::malformed_length_override_input::List,
|
5181 + | >,
|
5182 + | >,
|
5183 + | >,
|
5184 + | ) -> Self {
|
5185 + | self.list = input.map(|v| v.into());
|
5186 + | self
|
5187 + | }
|
5188 + | #[allow(missing_docs)] // documentation missing in model
|
5189 + | pub fn map(
|
5190 + | mut self,
|
5191 + | input: ::std::option::Option<crate::input::malformed_length_override_input::Map>,
|
5192 + | ) -> Self {
|
5193 + | self.map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5194 + | self
|
5195 + | }
|
5196 + | #[allow(missing_docs)] // documentation missing in model
|
5197 + | pub(crate) fn set_map(
|
5198 + | mut self,
|
5199 + | input: Option<
|
5200 + | impl ::std::convert::Into<
|
5201 + | crate::constrained::MaybeConstrained<
|
5202 + | crate::input::malformed_length_override_input::Map,
|
5203 + | >,
|
5204 + | >,
|
5205 + | >,
|
5206 + | ) -> Self {
|
5207 + | self.map = input.map(|v| v.into());
|
5208 + | self
|
5209 + | }
|
5210 + | /// Consumes the builder and constructs a [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput).
|
5211 + | ///
|
5212 + | /// The builder fails to construct a [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput) if a [`ConstraintViolation`] occurs.
|
5213 + | ///
|
5214 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
5215 + | pub fn build(
|
5216 + | self,
|
5217 + | ) -> Result<crate::input::MalformedLengthOverrideInput, ConstraintViolation> {
|
5218 + | self.build_enforcing_all_constraints()
|
5219 + | }
|
5220 + | fn build_enforcing_all_constraints(
|
5221 + | self,
|
5222 + | ) -> Result<crate::input::MalformedLengthOverrideInput, ConstraintViolation> {
|
5223 + | Ok(crate::input::MalformedLengthOverrideInput {
|
5224 + | blob: self
|
5225 + | .blob
|
5226 + | .map(|v| match v {
|
5227 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5228 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5229 + | })
|
5230 + | .map(|res| res.map_err(ConstraintViolation::Blob))
|
5231 + | .transpose()?,
|
5232 + | string: self
|
5233 + | .string
|
5234 + | .map(|v| match v {
|
5235 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5236 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5237 + | })
|
5238 + | .map(|res| res.map_err(ConstraintViolation::String))
|
5239 + | .transpose()?,
|
5240 + | min_string: self
|
5241 + | .min_string
|
5242 + | .map(|v| match v {
|
5243 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5244 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5245 + | })
|
5246 + | .map(|res| res.map_err(ConstraintViolation::MinString))
|
5247 + | .transpose()?,
|
5248 + | max_string: self
|
5249 + | .max_string
|
5250 + | .map(|v| match v {
|
5251 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5252 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5253 + | })
|
5254 + | .map(|res| res.map_err(ConstraintViolation::MaxString))
|
5255 + | .transpose()?,
|
5256 + | list: self
|
5257 + | .list
|
5258 + | .map(|v| match v {
|
5259 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5260 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5261 + | })
|
5262 + | .map(|res| res.map_err(ConstraintViolation::List))
|
5263 + | .transpose()?,
|
5264 + | map: self
|
5265 + | .map
|
5266 + | .map(|v| match v {
|
5267 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5268 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5269 + | })
|
5270 + | .map(|res| res.map_err(ConstraintViolation::Map))
|
5271 + | .transpose()?,
|
5272 + | })
|
5273 + | }
|
5274 + | }
|
5275 + | #[allow(missing_docs)] // documentation missing in model
|
5276 + | ///
|
5277 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5278 + | /// [constraint traits]. Use [`Map::try_from`] to construct values of this type.
|
5279 + | ///
|
5280 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5281 + | ///
|
5282 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5283 + | pub struct Map(
|
5284 + | pub(crate) ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
|
5285 + | );
|
5286 + | impl Map {
|
5287 + | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`].
|
5288 + | pub fn inner(
|
5289 + | &self,
|
5290 + | ) -> &::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>
|
5291 + | {
|
5292 + | &self.0
|
5293 + | }
|
5294 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`].
|
5295 + | pub fn into_inner(
|
5296 + | self,
|
5297 + | ) -> ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>
|
5298 + | {
|
5299 + | self.0
|
5300 + | }
|
5301 + | }
|
5302 + | impl
|
5303 + | ::std::convert::TryFrom<
|
5304 + | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
|
5305 + | > for Map
|
5306 + | {
|
5307 + | type Error = crate::input::malformed_length_override_input::map::ConstraintViolation;
|
5308 + |
|
5309 + | /// Constructs a `Map` from an [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`], failing when the provided value does not satisfy the modeled constraints.
|
5310 + | fn try_from(
|
5311 + | value: ::std::collections::HashMap<
|
5312 + | crate::model::LengthString,
|
5313 + | crate::model::LengthList,
|
5314 + | >,
|
5315 + | ) -> ::std::result::Result<Self, Self::Error> {
|
5316 + | let length = value.len();
|
5317 + | if (4..=6).contains(&length) {
|
5318 + | Ok(Self(value))
|
5319 + | } else {
|
5320 + | Err(
|
5321 + | crate::input::malformed_length_override_input::map::ConstraintViolation::Length(
|
5322 + | length,
|
5323 + | ),
|
5324 + | )
|
5325 + | }
|
5326 + | }
|
5327 + | }
|
5328 + |
|
5329 + | impl ::std::convert::From<Map>
|
5330 + | for ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>
|
5331 + | {
|
5332 + | fn from(value: Map) -> Self {
|
5333 + | value.into_inner()
|
5334 + | }
|
5335 + | }
|
5336 + | impl crate::constrained::Constrained for Map {
|
5337 + | type Unconstrained = crate::input::malformed_length_override_input::malformed_length_override_input_map_unconstrained::MalformedLengthOverrideInputMapUnconstrained;
|
5338 + | }
|
5339 + | #[allow(missing_docs)] // documentation missing in model
|
5340 + | ///
|
5341 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5342 + | /// [constraint traits]. Use [`List::try_from`] to construct values of this type.
|
5343 + | ///
|
5344 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5345 + | ///
|
5346 + | #[derive(
|
5347 + | ::std::clone::Clone,
|
5348 + | ::std::cmp::Eq,
|
5349 + | ::std::cmp::PartialEq,
|
5350 + | ::std::fmt::Debug,
|
5351 + | ::std::hash::Hash,
|
5352 + | )]
|
5353 + | pub struct List(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
5354 + | impl List {
|
5355 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
5356 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthString> {
|
5357 + | &self.0
|
5358 + | }
|
5359 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
5360 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
5361 + | self.0
|
5362 + | }
|
5363 + |
|
5364 + | fn check_length(
|
5365 + | length: usize,
|
5366 + | ) -> ::std::result::Result<
|
5367 + | (),
|
5368 + | crate::input::malformed_length_override_input::list::ConstraintViolation,
|
5369 + | > {
|
5370 + | if (4..=6).contains(&length) {
|
5371 + | Ok(())
|
5372 + | } else {
|
5373 + | Err(crate::input::malformed_length_override_input::list::ConstraintViolation::Length(length))
|
5374 + | }
|
5375 + | }
|
5376 + | }
|
5377 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for List {
|
5378 + | type Error = crate::input::malformed_length_override_input::list::ConstraintViolation;
|
5379 + |
|
5380 + | /// Constructs a `List` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
5381 + | fn try_from(
|
5382 + | value: ::std::vec::Vec<crate::model::LengthString>,
|
5383 + | ) -> ::std::result::Result<Self, Self::Error> {
|
5384 + | Self::check_length(value.len())?;
|
5385 + |
|
5386 + | Ok(Self(value))
|
5387 + | }
|
5388 + | }
|
5389 + |
|
5390 + | impl ::std::convert::From<List> for ::std::vec::Vec<crate::model::LengthString> {
|
5391 + | fn from(value: List) -> Self {
|
5392 + | value.into_inner()
|
5393 + | }
|
5394 + | }
|
5395 + | impl crate::constrained::Constrained for List {
|
5396 + | type Unconstrained = crate::input::malformed_length_override_input::malformed_length_override_input_list_unconstrained::MalformedLengthOverrideInputListUnconstrained;
|
5397 + | }
|
5398 + | #[allow(missing_docs)] // documentation missing in model
|
5399 + | ///
|
5400 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5401 + | /// [constraint traits]. Use [`MaxString::try_from`] to construct values of this type.
|
5402 + | ///
|
5403 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5404 + | ///
|
5405 + | #[derive(
|
5406 + | ::std::clone::Clone,
|
5407 + | ::std::cmp::Eq,
|
5408 + | ::std::cmp::PartialEq,
|
5409 + | ::std::fmt::Debug,
|
5410 + | ::std::hash::Hash,
|
5411 + | )]
|
5412 + | pub struct MaxString(pub(crate) ::std::string::String);
|
5413 + | impl MaxString {
|
5414 + | /// Extracts a string slice containing the entire underlying `String`.
|
5415 + | pub fn as_str(&self) -> &str {
|
5416 + | &self.0
|
5417 + | }
|
5418 + |
|
5419 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5420 + | pub fn inner(&self) -> &::std::string::String {
|
5421 + | &self.0
|
5422 + | }
|
5423 + |
|
5424 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5425 + | pub fn into_inner(self) -> ::std::string::String {
|
5426 + | self.0
|
5427 + | }
|
5428 + | }
|
5429 + | impl MaxString {
|
5430 + | fn check_length(
|
5431 + | string: &str,
|
5432 + | ) -> ::std::result::Result<
|
5433 + | (),
|
5434 + | crate::input::malformed_length_override_input::max_string::ConstraintViolation,
|
5435 + | > {
|
5436 + | let length = string.chars().count();
|
5437 + |
|
5438 + | if length <= 6 {
|
5439 + | Ok(())
|
5440 + | } else {
|
5441 + | Err(crate::input::malformed_length_override_input::max_string::ConstraintViolation::Length(length))
|
5442 + | }
|
5443 + | }
|
5444 + | }
|
5445 + | impl ::std::convert::TryFrom<::std::string::String> for MaxString {
|
5446 + | type Error = crate::input::malformed_length_override_input::max_string::ConstraintViolation;
|
5447 + |
|
5448 + | /// Constructs a `MaxString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5449 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5450 + | Self::check_length(&value)?;
|
5451 + |
|
5452 + | Ok(Self(value))
|
5453 + | }
|
5454 + | }
|
5455 + | impl crate::constrained::Constrained for MaxString {
|
5456 + | type Unconstrained = ::std::string::String;
|
5457 + | }
|
5458 + |
|
5459 + | impl ::std::convert::From<::std::string::String>
|
5460 + | for crate::constrained::MaybeConstrained<
|
5461 + | crate::input::malformed_length_override_input::MaxString,
|
5462 + | >
|
5463 + | {
|
5464 + | fn from(value: ::std::string::String) -> Self {
|
5465 + | Self::Unconstrained(value)
|
5466 + | }
|
5467 + | }
|
5468 + |
|
5469 + | impl ::std::fmt::Display for MaxString {
|
5470 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5471 + | self.0.fmt(f)
|
5472 + | }
|
5473 + | }
|
5474 + |
|
5475 + | impl ::std::convert::From<MaxString> for ::std::string::String {
|
5476 + | fn from(value: MaxString) -> Self {
|
5477 + | value.into_inner()
|
5478 + | }
|
5479 + | }
|
5480 + | #[allow(missing_docs)] // documentation missing in model
|
5481 + | ///
|
5482 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5483 + | /// [constraint traits]. Use [`MinString::try_from`] to construct values of this type.
|
5484 + | ///
|
5485 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5486 + | ///
|
5487 + | #[derive(
|
5488 + | ::std::clone::Clone,
|
5489 + | ::std::cmp::Eq,
|
5490 + | ::std::cmp::PartialEq,
|
5491 + | ::std::fmt::Debug,
|
5492 + | ::std::hash::Hash,
|
5493 + | )]
|
5494 + | pub struct MinString(pub(crate) ::std::string::String);
|
5495 + | impl MinString {
|
5496 + | /// Extracts a string slice containing the entire underlying `String`.
|
5497 + | pub fn as_str(&self) -> &str {
|
5498 + | &self.0
|
5499 + | }
|
5500 + |
|
5501 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5502 + | pub fn inner(&self) -> &::std::string::String {
|
5503 + | &self.0
|
5504 + | }
|
5505 + |
|
5506 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5507 + | pub fn into_inner(self) -> ::std::string::String {
|
5508 + | self.0
|
5509 + | }
|
5510 + | }
|
5511 + | impl MinString {
|
5512 + | fn check_length(
|
5513 + | string: &str,
|
5514 + | ) -> ::std::result::Result<
|
5515 + | (),
|
5516 + | crate::input::malformed_length_override_input::min_string::ConstraintViolation,
|
5517 + | > {
|
5518 + | let length = string.chars().count();
|
5519 + |
|
5520 + | if 4 <= length {
|
5521 + | Ok(())
|
5522 + | } else {
|
5523 + | Err(crate::input::malformed_length_override_input::min_string::ConstraintViolation::Length(length))
|
5524 + | }
|
5525 + | }
|
5526 + | }
|
5527 + | impl ::std::convert::TryFrom<::std::string::String> for MinString {
|
5528 + | type Error = crate::input::malformed_length_override_input::min_string::ConstraintViolation;
|
5529 + |
|
5530 + | /// Constructs a `MinString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5531 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5532 + | Self::check_length(&value)?;
|
5533 + |
|
5534 + | Ok(Self(value))
|
5535 + | }
|
5536 + | }
|
5537 + | impl crate::constrained::Constrained for MinString {
|
5538 + | type Unconstrained = ::std::string::String;
|
5539 + | }
|
5540 + |
|
5541 + | impl ::std::convert::From<::std::string::String>
|
5542 + | for crate::constrained::MaybeConstrained<
|
5543 + | crate::input::malformed_length_override_input::MinString,
|
5544 + | >
|
5545 + | {
|
5546 + | fn from(value: ::std::string::String) -> Self {
|
5547 + | Self::Unconstrained(value)
|
5548 + | }
|
5549 + | }
|
5550 + |
|
5551 + | impl ::std::fmt::Display for MinString {
|
5552 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5553 + | self.0.fmt(f)
|
5554 + | }
|
5555 + | }
|
5556 + |
|
5557 + | impl ::std::convert::From<MinString> for ::std::string::String {
|
5558 + | fn from(value: MinString) -> Self {
|
5559 + | value.into_inner()
|
5560 + | }
|
5561 + | }
|
5562 + | #[allow(missing_docs)] // documentation missing in model
|
5563 + | ///
|
5564 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5565 + | /// [constraint traits]. Use [`String::try_from`] to construct values of this type.
|
5566 + | ///
|
5567 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5568 + | ///
|
5569 + | #[derive(
|
5570 + | ::std::clone::Clone,
|
5571 + | ::std::cmp::Eq,
|
5572 + | ::std::cmp::PartialEq,
|
5573 + | ::std::fmt::Debug,
|
5574 + | ::std::hash::Hash,
|
5575 + | )]
|
5576 + | pub struct String(pub(crate) ::std::string::String);
|
5577 + | impl String {
|
5578 + | /// Extracts a string slice containing the entire underlying `String`.
|
5579 + | pub fn as_str(&self) -> &str {
|
5580 + | &self.0
|
5581 + | }
|
5582 + |
|
5583 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5584 + | pub fn inner(&self) -> &::std::string::String {
|
5585 + | &self.0
|
5586 + | }
|
5587 + |
|
5588 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5589 + | pub fn into_inner(self) -> ::std::string::String {
|
5590 + | self.0
|
5591 + | }
|
5592 + | }
|
5593 + | impl String {
|
5594 + | fn check_length(
|
5595 + | string: &str,
|
5596 + | ) -> ::std::result::Result<
|
5597 + | (),
|
5598 + | crate::input::malformed_length_override_input::string::ConstraintViolation,
|
5599 + | > {
|
5600 + | let length = string.chars().count();
|
5601 + |
|
5602 + | if (4..=6).contains(&length) {
|
5603 + | Ok(())
|
5604 + | } else {
|
5605 + | Err(crate::input::malformed_length_override_input::string::ConstraintViolation::Length(length))
|
5606 + | }
|
5607 + | }
|
5608 + | }
|
5609 + | impl ::std::convert::TryFrom<::std::string::String> for String {
|
5610 + | type Error = crate::input::malformed_length_override_input::string::ConstraintViolation;
|
5611 + |
|
5612 + | /// Constructs a `String` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5613 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5614 + | Self::check_length(&value)?;
|
5615 + |
|
5616 + | Ok(Self(value))
|
5617 + | }
|
5618 + | }
|
5619 + | impl crate::constrained::Constrained for String {
|
5620 + | type Unconstrained = ::std::string::String;
|
5621 + | }
|
5622 + |
|
5623 + | impl ::std::convert::From<::std::string::String>
|
5624 + | for crate::constrained::MaybeConstrained<
|
5625 + | crate::input::malformed_length_override_input::String,
|
5626 + | >
|
5627 + | {
|
5628 + | fn from(value: ::std::string::String) -> Self {
|
5629 + | Self::Unconstrained(value)
|
5630 + | }
|
5631 + | }
|
5632 + |
|
5633 + | impl ::std::fmt::Display for String {
|
5634 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5635 + | self.0.fmt(f)
|
5636 + | }
|
5637 + | }
|
5638 + |
|
5639 + | impl ::std::convert::From<String> for ::std::string::String {
|
5640 + | fn from(value: String) -> Self {
|
5641 + | value.into_inner()
|
5642 + | }
|
5643 + | }
|
5644 + | #[allow(missing_docs)] // documentation missing in model
|
5645 + | ///
|
5646 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5647 + | /// [constraint traits]. Use [`Blob::try_from`] to construct values of this type.
|
5648 + | ///
|
5649 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5650 + | ///
|
5651 + | #[derive(
|
5652 + | ::std::clone::Clone,
|
5653 + | ::std::cmp::Eq,
|
5654 + | ::std::cmp::PartialEq,
|
5655 + | ::std::fmt::Debug,
|
5656 + | ::std::hash::Hash,
|
5657 + | )]
|
5658 + | pub struct Blob(pub(crate) ::aws_smithy_types::Blob);
|
5659 + | impl Blob {
|
5660 + | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
5661 + | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
5662 + | &self.0
|
5663 + | }
|
5664 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
5665 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
5666 + | self.0
|
5667 + | }
|
5668 + | }
|
5669 + | impl Blob {
|
5670 + | fn check_length(
|
5671 + | blob: &::aws_smithy_types::Blob,
|
5672 + | ) -> ::std::result::Result<
|
5673 + | (),
|
5674 + | crate::input::malformed_length_override_input::blob::ConstraintViolation,
|
5675 + | > {
|
5676 + | let length = blob.as_ref().len();
|
5677 + |
|
5678 + | if (4..=6).contains(&length) {
|
5679 + | Ok(())
|
5680 + | } else {
|
5681 + | Err(crate::input::malformed_length_override_input::blob::ConstraintViolation::Length(length))
|
5682 + | }
|
5683 + | }
|
5684 + | }
|
5685 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for Blob {
|
5686 + | type Error = crate::input::malformed_length_override_input::blob::ConstraintViolation;
|
5687 + |
|
5688 + | /// Constructs a `Blob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
5689 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
5690 + | Self::check_length(&value)?;
|
5691 + |
|
5692 + | Ok(Self(value))
|
5693 + | }
|
5694 + | }
|
5695 + | impl crate::constrained::Constrained for Blob {
|
5696 + | type Unconstrained = ::aws_smithy_types::Blob;
|
5697 + | }
|
5698 + |
|
5699 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
5700 + | for crate::constrained::MaybeConstrained<
|
5701 + | crate::input::malformed_length_override_input::Blob,
|
5702 + | >
|
5703 + | {
|
5704 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
5705 + | Self::Unconstrained(value)
|
5706 + | }
|
5707 + | }
|
5708 + |
|
5709 + | impl ::std::convert::From<Blob> for ::aws_smithy_types::Blob {
|
5710 + | fn from(value: Blob) -> Self {
|
5711 + | value.into_inner()
|
5712 + | }
|
5713 + | }
|
5714 + |
|
5715 + | pub(crate) mod malformed_length_override_input_map_unconstrained {
|
5716 + |
|
5717 + | #[derive(Debug, Clone)]
|
5718 + | pub(crate) struct MalformedLengthOverrideInputMapUnconstrained(
|
5719 + | pub(crate) std::collections::HashMap<
|
5720 + | ::std::string::String,
|
5721 + | crate::unconstrained::length_list_unconstrained::LengthListUnconstrained,
|
5722 + | >,
|
5723 + | );
|
5724 + |
|
5725 + | impl From<MalformedLengthOverrideInputMapUnconstrained>
|
5726 + | for crate::constrained::MaybeConstrained<
|
5727 + | crate::input::malformed_length_override_input::Map,
|
5728 + | >
|
5729 + | {
|
5730 + | fn from(value: MalformedLengthOverrideInputMapUnconstrained) -> Self {
|
5731 + | Self::Unconstrained(value)
|
5732 + | }
|
5733 + | }
|
5734 + | impl std::convert::TryFrom<MalformedLengthOverrideInputMapUnconstrained>
|
5735 + | for crate::input::malformed_length_override_input::Map
|
5736 + | {
|
5737 + | type Error = crate::input::malformed_length_override_input::map::ConstraintViolation;
|
5738 + | fn try_from(
|
5739 + | value: MalformedLengthOverrideInputMapUnconstrained,
|
5740 + | ) -> std::result::Result<Self, Self::Error> {
|
5741 + | let res: ::std::result::Result<
|
5742 + | ::std::collections::HashMap<
|
5743 + | crate::model::LengthString,
|
5744 + | crate::model::LengthList,
|
5745 + | >,
|
5746 + | Self::Error,
|
5747 + | > = value
|
5748 + | .0
|
5749 + | .into_iter()
|
5750 + | .map(|(k, v)| {
|
5751 + | let k: crate::model::LengthString =
|
5752 + | k.try_into().map_err(Self::Error::Key)?;
|
5753 + |
|
5754 + | match crate::model::LengthList::try_from(v) {
|
5755 + | Ok(v) => Ok((k, v)),
|
5756 + | Err(inner_constraint_violation) => {
|
5757 + | Err(Self::Error::Value(k, inner_constraint_violation))
|
5758 + | }
|
5759 + | }
|
5760 + | })
|
5761 + | .collect();
|
5762 + | let hm = res?;
|
5763 + | Self::try_from(hm)
|
5764 + | }
|
5765 + | }
|
5766 + | }
|
5767 + | /// See [`MalformedLengthOverrideInputMap`](crate::input::malformed_length_override_input::Map).
|
5768 + | pub mod map {
|
5769 + |
|
5770 + | #[allow(clippy::enum_variant_names)]
|
5771 + | #[derive(Debug, PartialEq)]
|
5772 + | pub enum ConstraintViolation {
|
5773 + | Length(usize),
|
5774 + | #[doc(hidden)]
|
5775 + | Key(crate::model::length_string::ConstraintViolation),
|
5776 + | #[doc(hidden)]
|
5777 + | Value(
|
5778 + | crate::model::LengthString,
|
5779 + | crate::model::length_list::ConstraintViolation,
|
5780 + | ),
|
5781 + | }
|
5782 + |
|
5783 + | impl ::std::fmt::Display for ConstraintViolation {
|
5784 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5785 + | match self {
|
5786 + | Self::Length(length) => {
|
5787 + | write!(f, "Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputMap' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length)
|
5788 + | }
|
5789 + | Self::Key(key_constraint_violation) => {
|
5790 + | write!(f, "{}", key_constraint_violation)
|
5791 + | }
|
5792 + | Self::Value(_, value_constraint_violation) => {
|
5793 + | write!(f, "{}", value_constraint_violation)
|
5794 + | }
|
5795 + | }
|
5796 + | }
|
5797 + | }
|
5798 + |
|
5799 + | impl ::std::error::Error for ConstraintViolation {}
|
5800 + | impl ConstraintViolation {
|
5801 + | pub(crate) fn as_validation_exception_field(
|
5802 + | self,
|
5803 + | path: ::std::string::String,
|
5804 + | ) -> crate::model::ValidationExceptionField {
|
5805 + | match self {
|
5806 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
5807 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length, &path),
|
5808 + | path,
|
5809 + | },
|
5810 + | Self::Key(key_constraint_violation) => key_constraint_violation.as_validation_exception_field(path),
|
5811 + | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
5812 + | }
|
5813 + | }
|
5814 + | }
|
5815 + | }
|
5816 + | pub(crate) mod malformed_length_override_input_list_unconstrained {
|
5817 + |
|
5818 + | #[derive(Debug, Clone)]
|
5819 + | pub(crate) struct MalformedLengthOverrideInputListUnconstrained(
|
5820 + | pub(crate) std::vec::Vec<::std::string::String>,
|
5821 + | );
|
5822 + |
|
5823 + | impl From<MalformedLengthOverrideInputListUnconstrained>
|
5824 + | for crate::constrained::MaybeConstrained<
|
5825 + | crate::input::malformed_length_override_input::List,
|
5826 + | >
|
5827 + | {
|
5828 + | fn from(value: MalformedLengthOverrideInputListUnconstrained) -> Self {
|
5829 + | Self::Unconstrained(value)
|
5830 + | }
|
5831 + | }
|
5832 + | impl std::convert::TryFrom<MalformedLengthOverrideInputListUnconstrained>
|
5833 + | for crate::input::malformed_length_override_input::List
|
5834 + | {
|
5835 + | type Error = crate::input::malformed_length_override_input::list::ConstraintViolation;
|
5836 + | fn try_from(
|
5837 + | value: MalformedLengthOverrideInputListUnconstrained,
|
5838 + | ) -> std::result::Result<Self, Self::Error> {
|
5839 + | let res: ::std::result::Result<
|
5840 + | ::std::vec::Vec<crate::model::LengthString>,
|
5841 + | (usize, crate::model::length_string::ConstraintViolation),
|
5842 + | > = value
|
5843 + | .0
|
5844 + | .into_iter()
|
5845 + | .enumerate()
|
5846 + | .map(|(idx, inner)| {
|
5847 + | inner
|
5848 + | .try_into()
|
5849 + | .map_err(|inner_violation| (idx, inner_violation))
|
5850 + | })
|
5851 + | .collect();
|
5852 + | let inner = res
|
5853 + | .map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
|
5854 + | Self::try_from(inner)
|
5855 + | }
|
5856 + | }
|
5857 + | }
|
5858 + | /// See [`MalformedLengthOverrideInputList`](crate::input::malformed_length_override_input::List).
|
5859 + | pub mod list {
|
5860 + |
|
5861 + | #[allow(clippy::enum_variant_names)]
|
5862 + | #[derive(Debug, PartialEq)]
|
5863 + | pub enum ConstraintViolation {
|
5864 + | /// Constraint violation error when the list doesn't have the required length
|
5865 + | Length(usize),
|
5866 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5867 + | /// The first component of the tuple is the index in the collection where the
|
5868 + | /// first constraint violation was found.
|
5869 + | #[doc(hidden)]
|
5870 + | Member(usize, crate::model::length_string::ConstraintViolation),
|
5871 + | }
|
5872 + |
|
5873 + | impl ::std::fmt::Display for ConstraintViolation {
|
5874 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5875 + | let message = match self {
|
5876 + | Self::Length(length) => {
|
5877 + | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputList' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length)
|
5878 + | }
|
5879 + | Self::Member(index, failing_member) => format!(
|
5880 + | "Value at index {index} failed to satisfy constraint. {}",
|
5881 + | failing_member
|
5882 + | ),
|
5883 + | };
|
5884 + | write!(f, "{message}")
|
5885 + | }
|
5886 + | }
|
5887 + |
|
5888 + | impl ::std::error::Error for ConstraintViolation {}
|
5889 + | impl ConstraintViolation {
|
5890 + | pub(crate) fn as_validation_exception_field(
|
5891 + | self,
|
5892 + | path: ::std::string::String,
|
5893 + | ) -> crate::model::ValidationExceptionField {
|
5894 + | match self {
|
5895 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
5896 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length, &path),
|
5897 + | path,
|
5898 + | },
|
5899 + | Self::Member(index, member_constraint_violation) =>
|
5900 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
5901 + | }
|
5902 + | }
|
5903 + | }
|
5904 + | }
|
5905 + | /// See [`MalformedLengthOverrideInputMaxString`](crate::input::malformed_length_override_input::MaxString).
|
5906 + | pub mod max_string {
|
5907 + |
|
5908 + | #[derive(Debug, PartialEq)]
|
5909 + | pub enum ConstraintViolation {
|
5910 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
5911 + | Length(usize),
|
5912 + | }
|
5913 + |
|
5914 + | impl ::std::fmt::Display for ConstraintViolation {
|
5915 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5916 + | let message = match self {
|
5917 + | Self::Length(length) => {
|
5918 + | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputMaxString' failed to satisfy constraint: Member must have length less than or equal to 6", length)
|
5919 + | }
|
5920 + | };
|
5921 + | write!(f, "{message}")
|
5922 + | }
|
5923 + | }
|
5924 + |
|
5925 + | impl ::std::error::Error for ConstraintViolation {}
|
5926 + | impl ConstraintViolation {
|
5927 + | pub(crate) fn as_validation_exception_field(
|
5928 + | self,
|
5929 + | path: ::std::string::String,
|
5930 + | ) -> crate::model::ValidationExceptionField {
|
5931 + | match self {
|
5932 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
5933 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 6", length, &path),
|
5934 + | path,
|
5935 + | },
|
5936 + | }
|
5937 + | }
|
5938 + | }
|
5939 + | }
|
5940 + | /// See [`MalformedLengthOverrideInputMinString`](crate::input::malformed_length_override_input::MinString).
|
5941 + | pub mod min_string {
|
5942 + |
|
5943 + | #[derive(Debug, PartialEq)]
|
5944 + | pub enum ConstraintViolation {
|
5945 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
5946 + | Length(usize),
|
5947 + | }
|
5948 + |
|
5949 + | impl ::std::fmt::Display for ConstraintViolation {
|
5950 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5951 + | let message = match self {
|
5952 + | Self::Length(length) => {
|
5953 + | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputMinString' failed to satisfy constraint: Member must have length greater than or equal to 4", length)
|
5954 + | }
|
5955 + | };
|
5956 + | write!(f, "{message}")
|
5957 + | }
|
5958 + | }
|
5959 + |
|
5960 + | impl ::std::error::Error for ConstraintViolation {}
|
5961 + | impl ConstraintViolation {
|
5962 + | pub(crate) fn as_validation_exception_field(
|
5963 + | self,
|
5964 + | path: ::std::string::String,
|
5965 + | ) -> crate::model::ValidationExceptionField {
|
5966 + | match self {
|
5967 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
5968 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 4", length, &path),
|
5969 + | path,
|
5970 + | },
|
5971 + | }
|
5972 + | }
|
5973 + | }
|
5974 + | }
|
5975 + | /// See [`MalformedLengthOverrideInputString`](crate::input::malformed_length_override_input::String).
|
5976 + | pub mod string {
|
5977 + |
|
5978 + | #[derive(Debug, PartialEq)]
|
5979 + | pub enum ConstraintViolation {
|
5980 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
5981 + | Length(usize),
|
5982 + | }
|
5983 + |
|
5984 + | impl ::std::fmt::Display for ConstraintViolation {
|
5985 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5986 + | let message = match self {
|
5987 + | Self::Length(length) => {
|
5988 + | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputString' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length)
|
5989 + | }
|
5990 + | };
|
5991 + | write!(f, "{message}")
|
5992 + | }
|
5993 + | }
|
5994 + |
|
5995 + | impl ::std::error::Error for ConstraintViolation {}
|
5996 + | impl ConstraintViolation {
|
5997 + | pub(crate) fn as_validation_exception_field(
|
5998 + | self,
|
5999 + | path: ::std::string::String,
|
6000 + | ) -> crate::model::ValidationExceptionField {
|
6001 + | match self {
|
6002 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
6003 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length, &path),
|
6004 + | path,
|
6005 + | },
|
6006 + | }
|
6007 + | }
|
6008 + | }
|
6009 + | }
|
6010 + | /// See [`MalformedLengthOverrideInputBlob`](crate::input::malformed_length_override_input::Blob).
|
6011 + | pub mod blob {
|
6012 + |
|
6013 + | #[derive(Debug, PartialEq)]
|
6014 + | pub enum ConstraintViolation {
|
6015 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
6016 + | Length(usize),
|
6017 + | }
|
6018 + |
|
6019 + | impl ::std::fmt::Display for ConstraintViolation {
|
6020 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6021 + | let message = match self {
|
6022 + | Self::Length(length) => {
|
6023 + | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation.synthetic#MalformedLengthOverrideInputBlob' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length)
|
6024 + | }
|
6025 + | };
|
6026 + | write!(f, "{message}")
|
6027 + | }
|
6028 + | }
|
6029 + |
|
6030 + | impl ::std::error::Error for ConstraintViolation {}
|
6031 + | impl ConstraintViolation {
|
6032 + | pub(crate) fn as_validation_exception_field(
|
6033 + | self,
|
6034 + | path: ::std::string::String,
|
6035 + | ) -> crate::model::ValidationExceptionField {
|
6036 + | match self {
|
6037 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
6038 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 4 and 6, inclusive", length, &path),
|
6039 + | path,
|
6040 + | },
|
6041 + | }
|
6042 + | }
|
6043 + | }
|
6044 + | }
|
6045 + | }
|
6046 + | /// See [`MalformedLengthInput`](crate::input::MalformedLengthInput).
|
6047 + | pub mod malformed_length_input {
|
6048 + |
|
6049 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6050 + | /// Holds one variant for each of the ways the builder can fail.
|
6051 + | #[non_exhaustive]
|
6052 + | #[allow(clippy::enum_variant_names)]
|
6053 + | pub enum ConstraintViolation {
|
6054 + | /// Constraint violation occurred building member `blob` when building `MalformedLengthInput`.
|
6055 + | #[doc(hidden)]
|
6056 + | Blob(crate::model::length_blob::ConstraintViolation),
|
6057 + | /// Constraint violation occurred building member `string` when building `MalformedLengthInput`.
|
6058 + | #[doc(hidden)]
|
6059 + | String(crate::model::length_string::ConstraintViolation),
|
6060 + | /// Constraint violation occurred building member `min_string` when building `MalformedLengthInput`.
|
6061 + | #[doc(hidden)]
|
6062 + | MinString(crate::model::min_length_string::ConstraintViolation),
|
6063 + | /// Constraint violation occurred building member `max_string` when building `MalformedLengthInput`.
|
6064 + | #[doc(hidden)]
|
6065 + | MaxString(crate::model::max_length_string::ConstraintViolation),
|
6066 + | /// Constraint violation occurred building member `list` when building `MalformedLengthInput`.
|
6067 + | #[doc(hidden)]
|
6068 + | List(crate::model::length_list::ConstraintViolation),
|
6069 + | /// Constraint violation occurred building member `map` when building `MalformedLengthInput`.
|
6070 + | #[doc(hidden)]
|
6071 + | Map(crate::model::length_map::ConstraintViolation),
|
6072 + | }
|
6073 + | impl ::std::fmt::Display for ConstraintViolation {
|
6074 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6075 + | match self {
|
6076 + | ConstraintViolation::Blob(_) => write!(f, "constraint violation occurred building member `blob` when building `MalformedLengthInput`"),
|
6077 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedLengthInput`"),
|
6078 + | ConstraintViolation::MinString(_) => write!(f, "constraint violation occurred building member `min_string` when building `MalformedLengthInput`"),
|
6079 + | ConstraintViolation::MaxString(_) => write!(f, "constraint violation occurred building member `max_string` when building `MalformedLengthInput`"),
|
6080 + | ConstraintViolation::List(_) => write!(f, "constraint violation occurred building member `list` when building `MalformedLengthInput`"),
|
6081 + | ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MalformedLengthInput`"),
|
6082 + | }
|
6083 + | }
|
6084 + | }
|
6085 + | impl ::std::error::Error for ConstraintViolation {}
|
6086 + | impl ConstraintViolation {
|
6087 + | pub(crate) fn as_validation_exception_field(
|
6088 + | self,
|
6089 + | path: ::std::string::String,
|
6090 + | ) -> crate::model::ValidationExceptionField {
|
6091 + | match self {
|
6092 + | ConstraintViolation::Blob(inner) => {
|
6093 + | inner.as_validation_exception_field(path + "/blob")
|
6094 + | }
|
6095 + | ConstraintViolation::String(inner) => {
|
6096 + | inner.as_validation_exception_field(path + "/string")
|
6097 + | }
|
6098 + | ConstraintViolation::MinString(inner) => {
|
6099 + | inner.as_validation_exception_field(path + "/minString")
|
6100 + | }
|
6101 + | ConstraintViolation::MaxString(inner) => {
|
6102 + | inner.as_validation_exception_field(path + "/maxString")
|
6103 + | }
|
6104 + | ConstraintViolation::List(inner) => {
|
6105 + | inner.as_validation_exception_field(path + "/list")
|
6106 + | }
|
6107 + | ConstraintViolation::Map(inner) => {
|
6108 + | inner.as_validation_exception_field(path + "/map")
|
6109 + | }
|
6110 + | }
|
6111 + | }
|
6112 + | }
|
6113 + | impl ::std::convert::From<ConstraintViolation>
|
6114 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
6115 + | {
|
6116 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
6117 + | let first_validation_exception_field =
|
6118 + | constraint_violation.as_validation_exception_field("".to_owned());
|
6119 + | let validation_exception = crate::error::ValidationException {
|
6120 + | message: format!(
|
6121 + | "1 validation error detected. {}",
|
6122 + | &first_validation_exception_field.message
|
6123 + | ),
|
6124 + | field_list: Some(vec![first_validation_exception_field]),
|
6125 + | };
|
6126 + | Self::ConstraintViolation(
|
6127 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
6128 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
6129 + | )
|
6130 + | }
|
6131 + | }
|
6132 + | impl ::std::convert::From<Builder>
|
6133 + | for crate::constrained::MaybeConstrained<crate::input::MalformedLengthInput>
|
6134 + | {
|
6135 + | fn from(builder: Builder) -> Self {
|
6136 + | Self::Unconstrained(builder)
|
6137 + | }
|
6138 + | }
|
6139 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedLengthInput {
|
6140 + | type Error = ConstraintViolation;
|
6141 + |
|
6142 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6143 + | builder.build()
|
6144 + | }
|
6145 + | }
|
6146 + | /// A builder for [`MalformedLengthInput`](crate::input::MalformedLengthInput).
|
6147 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6148 + | pub struct Builder {
|
6149 + | pub(crate) blob:
|
6150 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
6151 + | pub(crate) string:
|
6152 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
6153 + | pub(crate) min_string: ::std::option::Option<
|
6154 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
6155 + | >,
|
6156 + | pub(crate) max_string: ::std::option::Option<
|
6157 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
6158 + | >,
|
6159 + | pub(crate) list:
|
6160 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
6161 + | pub(crate) map:
|
6162 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6163 + | }
|
6164 + | impl Builder {
|
6165 + | #[allow(missing_docs)] // documentation missing in model
|
6166 + | pub fn blob(mut self, input: ::std::option::Option<crate::model::LengthBlob>) -> Self {
|
6167 + | self.blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6168 + | self
|
6169 + | }
|
6170 + | #[allow(missing_docs)] // documentation missing in model
|
6171 + | pub(crate) fn set_blob(
|
6172 + | mut self,
|
6173 + | input: Option<
|
6174 + | impl ::std::convert::Into<
|
6175 + | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
6176 + | >,
|
6177 + | >,
|
6178 + | ) -> Self {
|
6179 + | self.blob = input.map(|v| v.into());
|
6180 + | self
|
6181 + | }
|
6182 + | #[allow(missing_docs)] // documentation missing in model
|
6183 + | pub fn string(mut self, input: ::std::option::Option<crate::model::LengthString>) -> Self {
|
6184 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6185 + | self
|
6186 + | }
|
6187 + | #[allow(missing_docs)] // documentation missing in model
|
6188 + | pub(crate) fn set_string(
|
6189 + | mut self,
|
6190 + | input: Option<
|
6191 + | impl ::std::convert::Into<
|
6192 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
6193 + | >,
|
6194 + | >,
|
6195 + | ) -> Self {
|
6196 + | self.string = input.map(|v| v.into());
|
6197 + | self
|
6198 + | }
|
6199 + | #[allow(missing_docs)] // documentation missing in model
|
6200 + | pub fn min_string(
|
6201 + | mut self,
|
6202 + | input: ::std::option::Option<crate::model::MinLengthString>,
|
6203 + | ) -> Self {
|
6204 + | self.min_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6205 + | self
|
6206 + | }
|
6207 + | #[allow(missing_docs)] // documentation missing in model
|
6208 + | pub(crate) fn set_min_string(
|
6209 + | mut self,
|
6210 + | input: Option<
|
6211 + | impl ::std::convert::Into<
|
6212 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
6213 + | >,
|
6214 + | >,
|
6215 + | ) -> Self {
|
6216 + | self.min_string = input.map(|v| v.into());
|
6217 + | self
|
6218 + | }
|
6219 + | #[allow(missing_docs)] // documentation missing in model
|
6220 + | pub fn max_string(
|
6221 + | mut self,
|
6222 + | input: ::std::option::Option<crate::model::MaxLengthString>,
|
6223 + | ) -> Self {
|
6224 + | self.max_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6225 + | self
|
6226 + | }
|
6227 + | #[allow(missing_docs)] // documentation missing in model
|
6228 + | pub(crate) fn set_max_string(
|
6229 + | mut self,
|
6230 + | input: Option<
|
6231 + | impl ::std::convert::Into<
|
6232 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
6233 + | >,
|
6234 + | >,
|
6235 + | ) -> Self {
|
6236 + | self.max_string = input.map(|v| v.into());
|
6237 + | self
|
6238 + | }
|
6239 + | #[allow(missing_docs)] // documentation missing in model
|
6240 + | pub fn list(mut self, input: ::std::option::Option<crate::model::LengthList>) -> Self {
|
6241 + | self.list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6242 + | self
|
6243 + | }
|
6244 + | #[allow(missing_docs)] // documentation missing in model
|
6245 + | pub(crate) fn set_list(
|
6246 + | mut self,
|
6247 + | input: Option<
|
6248 + | impl ::std::convert::Into<
|
6249 + | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
6250 + | >,
|
6251 + | >,
|
6252 + | ) -> Self {
|
6253 + | self.list = input.map(|v| v.into());
|
6254 + | self
|
6255 + | }
|
6256 + | #[allow(missing_docs)] // documentation missing in model
|
6257 + | pub fn map(mut self, input: ::std::option::Option<crate::model::LengthMap>) -> Self {
|
6258 + | self.map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6259 + | self
|
6260 + | }
|
6261 + | #[allow(missing_docs)] // documentation missing in model
|
6262 + | pub(crate) fn set_map(
|
6263 + | mut self,
|
6264 + | input: Option<
|
6265 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6266 + | >,
|
6267 + | ) -> Self {
|
6268 + | self.map = input.map(|v| v.into());
|
6269 + | self
|
6270 + | }
|
6271 + | /// Consumes the builder and constructs a [`MalformedLengthInput`](crate::input::MalformedLengthInput).
|
6272 + | ///
|
6273 + | /// The builder fails to construct a [`MalformedLengthInput`](crate::input::MalformedLengthInput) if a [`ConstraintViolation`] occurs.
|
6274 + | ///
|
6275 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6276 + | pub fn build(self) -> Result<crate::input::MalformedLengthInput, ConstraintViolation> {
|
6277 + | self.build_enforcing_all_constraints()
|
6278 + | }
|
6279 + | fn build_enforcing_all_constraints(
|
6280 + | self,
|
6281 + | ) -> Result<crate::input::MalformedLengthInput, ConstraintViolation> {
|
6282 + | Ok(crate::input::MalformedLengthInput {
|
6283 + | blob: self
|
6284 + | .blob
|
6285 + | .map(|v| match v {
|
6286 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6287 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6288 + | })
|
6289 + | .map(|res| res.map_err(ConstraintViolation::Blob))
|
6290 + | .transpose()?,
|
6291 + | string: self
|
6292 + | .string
|
6293 + | .map(|v| match v {
|
6294 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6295 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6296 + | })
|
6297 + | .map(|res| res.map_err(ConstraintViolation::String))
|
6298 + | .transpose()?,
|
6299 + | min_string: self
|
6300 + | .min_string
|
6301 + | .map(|v| match v {
|
6302 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6303 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6304 + | })
|
6305 + | .map(|res| res.map_err(ConstraintViolation::MinString))
|
6306 + | .transpose()?,
|
6307 + | max_string: self
|
6308 + | .max_string
|
6309 + | .map(|v| match v {
|
6310 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6311 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6312 + | })
|
6313 + | .map(|res| res.map_err(ConstraintViolation::MaxString))
|
6314 + | .transpose()?,
|
6315 + | list: self
|
6316 + | .list
|
6317 + | .map(|v| match v {
|
6318 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6319 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6320 + | })
|
6321 + | .map(|res| res.map_err(ConstraintViolation::List))
|
6322 + | .transpose()?,
|
6323 + | map: self
|
6324 + | .map
|
6325 + | .map(|v| match v {
|
6326 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6327 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6328 + | })
|
6329 + | .map(|res| res.map_err(ConstraintViolation::Map))
|
6330 + | .transpose()?,
|
6331 + | })
|
6332 + | }
|
6333 + | }
|
6334 + | }
|
6335 + | /// See [`MalformedEnumInput`](crate::input::MalformedEnumInput).
|
6336 + | pub mod malformed_enum_input {
|
6337 + |
|
6338 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6339 + | /// Holds one variant for each of the ways the builder can fail.
|
6340 + | #[non_exhaustive]
|
6341 + | #[allow(clippy::enum_variant_names)]
|
6342 + | pub enum ConstraintViolation {
|
6343 + | /// Constraint violation occurred building member `string` when building `MalformedEnumInput`.
|
6344 + | #[doc(hidden)]
|
6345 + | String(crate::model::enum_string::ConstraintViolation),
|
6346 + | /// Constraint violation occurred building member `string_with_enum_trait` when building `MalformedEnumInput`.
|
6347 + | #[doc(hidden)]
|
6348 + | StringWithEnumTrait(crate::model::enum_trait_string::ConstraintViolation),
|
6349 + | /// Constraint violation occurred building member `list` when building `MalformedEnumInput`.
|
6350 + | #[doc(hidden)]
|
6351 + | List(crate::model::enum_list::ConstraintViolation),
|
6352 + | /// Constraint violation occurred building member `map` when building `MalformedEnumInput`.
|
6353 + | #[doc(hidden)]
|
6354 + | Map(crate::model::enum_map::ConstraintViolation),
|
6355 + | /// Constraint violation occurred building member `union` when building `MalformedEnumInput`.
|
6356 + | #[doc(hidden)]
|
6357 + | Union(crate::model::enum_union::ConstraintViolation),
|
6358 + | }
|
6359 + | impl ::std::fmt::Display for ConstraintViolation {
|
6360 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6361 + | match self {
|
6362 + | ConstraintViolation::String(_) => write!(f, "constraint violation occurred building member `string` when building `MalformedEnumInput`"),
|
6363 + | ConstraintViolation::StringWithEnumTrait(_) => write!(f, "constraint violation occurred building member `string_with_enum_trait` when building `MalformedEnumInput`"),
|
6364 + | ConstraintViolation::List(_) => write!(f, "constraint violation occurred building member `list` when building `MalformedEnumInput`"),
|
6365 + | ConstraintViolation::Map(_) => write!(f, "constraint violation occurred building member `map` when building `MalformedEnumInput`"),
|
6366 + | ConstraintViolation::Union(_) => write!(f, "constraint violation occurred building member `union` when building `MalformedEnumInput`"),
|
6367 + | }
|
6368 + | }
|
6369 + | }
|
6370 + | impl ::std::error::Error for ConstraintViolation {}
|
6371 + | impl ConstraintViolation {
|
6372 + | pub(crate) fn as_validation_exception_field(
|
6373 + | self,
|
6374 + | path: ::std::string::String,
|
6375 + | ) -> crate::model::ValidationExceptionField {
|
6376 + | match self {
|
6377 + | ConstraintViolation::String(inner) => {
|
6378 + | inner.as_validation_exception_field(path + "/string")
|
6379 + | }
|
6380 + | ConstraintViolation::StringWithEnumTrait(inner) => {
|
6381 + | inner.as_validation_exception_field(path + "/stringWithEnumTrait")
|
6382 + | }
|
6383 + | ConstraintViolation::List(inner) => {
|
6384 + | inner.as_validation_exception_field(path + "/list")
|
6385 + | }
|
6386 + | ConstraintViolation::Map(inner) => {
|
6387 + | inner.as_validation_exception_field(path + "/map")
|
6388 + | }
|
6389 + | ConstraintViolation::Union(inner) => {
|
6390 + | inner.as_validation_exception_field(path + "/union")
|
6391 + | }
|
6392 + | }
|
6393 + | }
|
6394 + | }
|
6395 + | impl ::std::convert::From<ConstraintViolation>
|
6396 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
6397 + | {
|
6398 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
6399 + | let first_validation_exception_field =
|
6400 + | constraint_violation.as_validation_exception_field("".to_owned());
|
6401 + | let validation_exception = crate::error::ValidationException {
|
6402 + | message: format!(
|
6403 + | "1 validation error detected. {}",
|
6404 + | &first_validation_exception_field.message
|
6405 + | ),
|
6406 + | field_list: Some(vec![first_validation_exception_field]),
|
6407 + | };
|
6408 + | Self::ConstraintViolation(
|
6409 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
6410 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
6411 + | )
|
6412 + | }
|
6413 + | }
|
6414 + | impl ::std::convert::From<Builder>
|
6415 + | for crate::constrained::MaybeConstrained<crate::input::MalformedEnumInput>
|
6416 + | {
|
6417 + | fn from(builder: Builder) -> Self {
|
6418 + | Self::Unconstrained(builder)
|
6419 + | }
|
6420 + | }
|
6421 + | impl ::std::convert::TryFrom<Builder> for crate::input::MalformedEnumInput {
|
6422 + | type Error = ConstraintViolation;
|
6423 + |
|
6424 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6425 + | builder.build()
|
6426 + | }
|
6427 + | }
|
6428 + | /// A builder for [`MalformedEnumInput`](crate::input::MalformedEnumInput).
|
6429 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6430 + | pub struct Builder {
|
6431 + | pub(crate) string:
|
6432 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
6433 + | pub(crate) string_with_enum_trait: ::std::option::Option<
|
6434 + | crate::constrained::MaybeConstrained<crate::model::EnumTraitString>,
|
6435 + | >,
|
6436 + | pub(crate) list: ::std::option::Option<
|
6437 + | crate::constrained::MaybeConstrained<
|
6438 + | crate::constrained::enum_list_constrained::EnumListConstrained,
|
6439 + | >,
|
6440 + | >,
|
6441 + | pub(crate) map: ::std::option::Option<
|
6442 + | crate::constrained::MaybeConstrained<
|
6443 + | crate::constrained::enum_map_constrained::EnumMapConstrained,
|
6444 + | >,
|
6445 + | >,
|
6446 + | pub(crate) union:
|
6447 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumUnion>>,
|
6448 + | }
|
6449 + | impl Builder {
|
6450 + | #[allow(missing_docs)] // documentation missing in model
|
6451 + | pub fn string(mut self, input: ::std::option::Option<crate::model::EnumString>) -> Self {
|
6452 + | self.string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6453 + | self
|
6454 + | }
|
6455 + | #[allow(missing_docs)] // documentation missing in model
|
6456 + | pub(crate) fn set_string(
|
6457 + | mut self,
|
6458 + | input: Option<
|
6459 + | impl ::std::convert::Into<
|
6460 + | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6461 + | >,
|
6462 + | >,
|
6463 + | ) -> Self {
|
6464 + | self.string = input.map(|v| v.into());
|
6465 + | self
|
6466 + | }
|
6467 + | #[allow(missing_docs)] // documentation missing in model
|
6468 + | pub fn string_with_enum_trait(
|
6469 + | mut self,
|
6470 + | input: ::std::option::Option<crate::model::EnumTraitString>,
|
6471 + | ) -> Self {
|
6472 + | self.string_with_enum_trait =
|
6473 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6474 + | self
|
6475 + | }
|
6476 + | #[allow(missing_docs)] // documentation missing in model
|
6477 + | pub(crate) fn set_string_with_enum_trait(
|
6478 + | mut self,
|
6479 + | input: Option<
|
6480 + | impl ::std::convert::Into<
|
6481 + | crate::constrained::MaybeConstrained<crate::model::EnumTraitString>,
|
6482 + | >,
|
6483 + | >,
|
6484 + | ) -> Self {
|
6485 + | self.string_with_enum_trait = input.map(|v| v.into());
|
6486 + | self
|
6487 + | }
|
6488 + | #[allow(missing_docs)] // documentation missing in model
|
6489 + | pub fn list(
|
6490 + | mut self,
|
6491 + | input: ::std::option::Option<::std::vec::Vec<crate::model::EnumString>>,
|
6492 + | ) -> Self {
|
6493 + | self.list =
|
6494 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6495 + | self
|
6496 + | }
|
6497 + | #[allow(missing_docs)] // documentation missing in model
|
6498 + | pub(crate) fn set_list(
|
6499 + | mut self,
|
6500 + | input: Option<
|
6501 + | impl ::std::convert::Into<
|
6502 + | crate::constrained::MaybeConstrained<
|
6503 + | crate::constrained::enum_list_constrained::EnumListConstrained,
|
6504 + | >,
|
6505 + | >,
|
6506 + | >,
|
6507 + | ) -> Self {
|
6508 + | self.list = input.map(|v| v.into());
|
6509 + | self
|
6510 + | }
|
6511 + | #[allow(missing_docs)] // documentation missing in model
|
6512 + | pub fn map(
|
6513 + | mut self,
|
6514 + | input: ::std::option::Option<
|
6515 + | ::std::collections::HashMap<crate::model::EnumString, crate::model::EnumString>,
|
6516 + | >,
|
6517 + | ) -> Self {
|
6518 + | self.map = input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6519 + | self
|
6520 + | }
|
6521 + | #[allow(missing_docs)] // documentation missing in model
|
6522 + | pub(crate) fn set_map(
|
6523 + | mut self,
|
6524 + | input: Option<
|
6525 + | impl ::std::convert::Into<
|
6526 + | crate::constrained::MaybeConstrained<
|
6527 + | crate::constrained::enum_map_constrained::EnumMapConstrained,
|
6528 + | >,
|
6529 + | >,
|
6530 + | >,
|
6531 + | ) -> Self {
|
6532 + | self.map = input.map(|v| v.into());
|
6533 + | self
|
6534 + | }
|
6535 + | #[allow(missing_docs)] // documentation missing in model
|
6536 + | pub fn union(mut self, input: ::std::option::Option<crate::model::EnumUnion>) -> Self {
|
6537 + | self.union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6538 + | self
|
6539 + | }
|
6540 + | #[allow(missing_docs)] // documentation missing in model
|
6541 + | pub(crate) fn set_union(
|
6542 + | mut self,
|
6543 + | input: Option<
|
6544 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::EnumUnion>>,
|
6545 + | >,
|
6546 + | ) -> Self {
|
6547 + | self.union = input.map(|v| v.into());
|
6548 + | self
|
6549 + | }
|
6550 + | /// Consumes the builder and constructs a [`MalformedEnumInput`](crate::input::MalformedEnumInput).
|
6551 + | ///
|
6552 + | /// The builder fails to construct a [`MalformedEnumInput`](crate::input::MalformedEnumInput) if a [`ConstraintViolation`] occurs.
|
6553 + | ///
|
6554 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6555 + | pub fn build(self) -> Result<crate::input::MalformedEnumInput, ConstraintViolation> {
|
6556 + | self.build_enforcing_all_constraints()
|
6557 + | }
|
6558 + | fn build_enforcing_all_constraints(
|
6559 + | self,
|
6560 + | ) -> Result<crate::input::MalformedEnumInput, ConstraintViolation> {
|
6561 + | Ok(crate::input::MalformedEnumInput {
|
6562 + | string: self
|
6563 + | .string
|
6564 + | .map(|v| match v {
|
6565 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6566 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6567 + | })
|
6568 + | .map(|res| res.map_err(ConstraintViolation::String))
|
6569 + | .transpose()?,
|
6570 + | string_with_enum_trait: self
|
6571 + | .string_with_enum_trait
|
6572 + | .map(|v| match v {
|
6573 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6574 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6575 + | })
|
6576 + | .map(|res| res.map_err(ConstraintViolation::StringWithEnumTrait))
|
6577 + | .transpose()?,
|
6578 + | list: self
|
6579 + | .list
|
6580 + | .map(|v| match v {
|
6581 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6582 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6583 + | })
|
6584 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::List))
|
6585 + | .transpose()?,
|
6586 + | map: self
|
6587 + | .map
|
6588 + | .map(|v| match v {
|
6589 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6590 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6591 + | })
|
6592 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Map))
|
6593 + | .transpose()?,
|
6594 + | union: self
|
6595 + | .union
|
6596 + | .map(|v| match v {
|
6597 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6598 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6599 + | })
|
6600 + | .map(|res| res.map_err(ConstraintViolation::Union))
|
6601 + | .transpose()?,
|
6602 + | })
|
6603 + | }
|
6604 + | }
|
6605 + | }
|