1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Describes one specific validation failure for an input member.
|
4 + | #[derive(
|
5 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 + | )]
|
7 + | pub struct ValidationExceptionField {
|
8 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 + | pub path: ::std::string::String,
|
10 + | /// A detailed description of the validation failure.
|
11 + | pub message: ::std::string::String,
|
12 + | }
|
13 + | impl ValidationExceptionField {
|
14 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 + | pub fn path(&self) -> &str {
|
16 + | use std::ops::Deref;
|
17 + | self.path.deref()
|
18 + | }
|
19 + | /// A detailed description of the validation failure.
|
20 + | pub fn message(&self) -> &str {
|
21 + | use std::ops::Deref;
|
22 + | self.message.deref()
|
23 + | }
|
24 + | }
|
25 + | impl ValidationExceptionField {
|
26 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 + | crate::model::validation_exception_field::Builder::default()
|
29 + | }
|
30 + | }
|
31 + |
|
32 + | #[allow(missing_docs)] // documentation missing in model
|
33 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
34 + | pub enum Event {
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | RegularMessage(crate::model::EventStreamRegularMessage),
|
37 + | }
|
38 + | impl Event {
|
39 + | #[allow(irrefutable_let_patterns)]
|
40 + | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
41 + | /// Returns `Err(&Self)` if it can't be converted.
|
42 + | pub fn as_regular_message(
|
43 + | &self,
|
44 + | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
45 + | if let Event::RegularMessage(val) = &self {
|
46 + | ::std::result::Result::Ok(val)
|
47 + | } else {
|
48 + | ::std::result::Result::Err(self)
|
49 + | }
|
50 + | }
|
51 + | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
52 + | pub fn is_regular_message(&self) -> bool {
|
53 + | self.as_regular_message().is_ok()
|
54 + | }
|
55 + | }
|
56 + |
|
57 + | #[allow(missing_docs)] // documentation missing in model
|
58 + | #[derive(
|
59 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
60 + | )]
|
61 + | pub struct EventStreamRegularMessage {
|
62 + | #[allow(missing_docs)] // documentation missing in model
|
63 + | pub message_content: ::std::option::Option<::std::string::String>,
|
64 + | }
|
65 + | impl EventStreamRegularMessage {
|
66 + | #[allow(missing_docs)] // documentation missing in model
|
67 + | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
68 + | self.message_content.as_deref()
|
69 + | }
|
70 + | }
|
71 + | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
72 + | type Unconstrained = crate::model::event_stream_regular_message_internal::Builder;
|
73 + | }
|
74 + | impl EventStreamRegularMessage {
|
75 + | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
76 + | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
77 + | crate::model::event_stream_regular_message::Builder::default()
|
78 + | }
|
79 + | }
|
80 + |
|
81 + | #[allow(missing_docs)] // documentation missing in model
|
82 + | #[derive(
|
83 + | ::std::clone::Clone,
|
84 + | ::std::cmp::Eq,
|
85 + | ::std::cmp::Ord,
|
86 + | ::std::cmp::PartialEq,
|
87 + | ::std::cmp::PartialOrd,
|
88 + | ::std::fmt::Debug,
|
89 + | ::std::hash::Hash,
|
90 + | )]
|
91 + | pub enum EnumString {
|
92 + | #[allow(missing_docs)] // documentation missing in model
|
93 + | M256Mega,
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | T2Micro,
|
96 + | #[allow(missing_docs)] // documentation missing in model
|
97 + | T2Nano,
|
98 + | }
|
99 + | pub(crate) mod enum_string_internal {
|
100 + | #[derive(Debug, PartialEq)]
|
101 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
102 + |
|
103 + | impl ::std::fmt::Display for ConstraintViolation {
|
104 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
105 + | write!(
|
106 + | f,
|
107 + | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
108 + | )
|
109 + | }
|
110 + | }
|
111 + |
|
112 + | impl ::std::error::Error for ConstraintViolation {}
|
113 + | impl ConstraintViolation {
|
114 + | pub(crate) fn as_validation_exception_field(
|
115 + | self,
|
116 + | path: ::std::string::String,
|
117 + | ) -> crate::model::ValidationExceptionField {
|
118 + | crate::model::ValidationExceptionField {
|
119 + | message: format!(
|
120 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
121 + | &path
|
122 + | ),
|
123 + | path,
|
124 + | }
|
125 + | }
|
126 + | }
|
127 + | }
|
128 + | impl ::std::convert::TryFrom<&str> for EnumString {
|
129 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
130 + | fn try_from(
|
131 + | s: &str,
|
132 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
133 + | match s {
|
134 + | "m256.mega" => Ok(EnumString::M256Mega),
|
135 + | "t2.micro" => Ok(EnumString::T2Micro),
|
136 + | "t2.nano" => Ok(EnumString::T2Nano),
|
137 + | _ => Err(crate::model::enum_string_internal::ConstraintViolation(
|
138 + | s.to_owned(),
|
139 + | )),
|
140 + | }
|
141 + | }
|
142 + | }
|
143 + | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
144 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
145 + | fn try_from(
|
146 + | s: ::std::string::String,
|
147 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
148 + | {
|
149 + | s.as_str().try_into()
|
150 + | }
|
151 + | }
|
152 + | impl std::str::FromStr for EnumString {
|
153 + | type Err = crate::model::enum_string_internal::ConstraintViolation;
|
154 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
155 + | Self::try_from(s)
|
156 + | }
|
157 + | }
|
158 + | impl EnumString {
|
159 + | /// Returns the `&str` value of the enum member.
|
160 + | pub fn as_str(&self) -> &str {
|
161 + | match self {
|
162 + | EnumString::M256Mega => "m256.mega",
|
163 + | EnumString::T2Micro => "t2.micro",
|
164 + | EnumString::T2Nano => "t2.nano",
|
165 + | }
|
166 + | }
|
167 + | /// Returns all the `&str` representations of the enum members.
|
168 + | pub const fn values() -> &'static [&'static str] {
|
169 + | &["m256.mega", "t2.micro", "t2.nano"]
|
170 + | }
|
171 + | }
|
172 + | impl ::std::convert::AsRef<str> for EnumString {
|
173 + | fn as_ref(&self) -> &str {
|
174 + | self.as_str()
|
175 + | }
|
176 + | }
|
177 + | impl crate::constrained::Constrained for EnumString {
|
178 + | type Unconstrained = ::std::string::String;
|
179 + | }
|
180 + |
|
181 + | impl ::std::convert::From<::std::string::String>
|
182 + | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
183 + | {
|
184 + | fn from(value: ::std::string::String) -> Self {
|
185 + | Self::Unconstrained(value)
|
186 + | }
|
187 + | }
|
188 + |
|
189 + | #[allow(missing_docs)] // documentation missing in model
|
190 + | ///
|
191 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
192 + | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
193 + | ///
|
194 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
195 + | ///
|
196 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
197 + | pub(crate) struct ConBMap(
|
198 + | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
199 + | );
|
200 + | impl ConBMap {
|
201 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
202 + | pub fn into_inner(
|
203 + | self,
|
204 + | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
205 + | self.0
|
206 + | }
|
207 + | }
|
208 + | impl
|
209 + | ::std::convert::TryFrom<
|
210 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
211 + | > for ConBMap
|
212 + | {
|
213 + | type Error = crate::model::con_b_map_internal::ConstraintViolation;
|
214 + |
|
215 + | /// Constructs a `ConBMap` from an [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
216 + | fn try_from(
|
217 + | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
218 + | ) -> ::std::result::Result<Self, Self::Error> {
|
219 + | let length = value.len();
|
220 + | if (1..=69).contains(&length) {
|
221 + | Ok(Self(value))
|
222 + | } else {
|
223 + | Err(crate::model::con_b_map_internal::ConstraintViolation::Length(length))
|
224 + | }
|
225 + | }
|
226 + | }
|
227 + |
|
228 + | impl ::std::convert::From<ConBMap>
|
229 + | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
230 + | {
|
231 + | fn from(value: ConBMap) -> Self {
|
232 + | value.into_inner()
|
233 + | }
|
234 + | }
|
235 + | impl ::std::convert::From<ConBMap>
|
236 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
237 + | {
|
238 + | fn from(value: ConBMap) -> Self {
|
239 + | value
|
240 + | .into_inner()
|
241 + | .into_iter()
|
242 + | .map(|(k, v)| (k, v.into()))
|
243 + | .collect()
|
244 + | }
|
245 + | }
|
246 + | impl crate::constrained::Constrained for ConBMap {
|
247 + | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
248 + | }
|
249 + |
|
250 + | #[allow(missing_docs)] // documentation missing in model
|
251 + | ///
|
252 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
253 + | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
254 + | ///
|
255 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
256 + | ///
|
257 + | #[derive(
|
258 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
259 + | )]
|
260 + | pub(crate) struct LengthString(pub(crate) ::std::string::String);
|
261 + | #[allow(dead_code)]
|
262 + | impl LengthString {
|
263 + | /// Extracts a string slice containing the entire underlying `String`.
|
264 + | pub fn as_str(&self) -> &str {
|
265 + | &self.0
|
266 + | }
|
267 + |
|
268 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
269 + | pub fn inner(&self) -> &::std::string::String {
|
270 + | &self.0
|
271 + | }
|
272 + |
|
273 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
274 + | pub fn into_inner(self) -> ::std::string::String {
|
275 + | self.0
|
276 + | }
|
277 + | }
|
278 + | impl LengthString {
|
279 + | fn check_length(
|
280 + | string: &str,
|
281 + | ) -> ::std::result::Result<(), crate::model::length_string_internal::ConstraintViolation> {
|
282 + | let length = string.chars().count();
|
283 + |
|
284 + | if (2..=69).contains(&length) {
|
285 + | Ok(())
|
286 + | } else {
|
287 + | Err(crate::model::length_string_internal::ConstraintViolation::Length(length))
|
288 + | }
|
289 + | }
|
290 + | }
|
291 + | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
292 + | type Error = crate::model::length_string_internal::ConstraintViolation;
|
293 + |
|
294 + | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
295 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
296 + | Self::check_length(&value)?;
|
297 + |
|
298 + | Ok(Self(value))
|
299 + | }
|
300 + | }
|
301 + | impl crate::constrained::Constrained for LengthString {
|
302 + | type Unconstrained = ::std::string::String;
|
303 + | }
|
304 + |
|
305 + | impl ::std::convert::From<::std::string::String>
|
306 + | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
307 + | {
|
308 + | fn from(value: ::std::string::String) -> Self {
|
309 + | Self::Unconstrained(value)
|
310 + | }
|
311 + | }
|
312 + |
|
313 + | impl ::std::fmt::Display for LengthString {
|
314 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
315 + | self.0.fmt(f)
|
316 + | }
|
317 + | }
|
318 + |
|
319 + | impl ::std::convert::From<LengthString> for ::std::string::String {
|
320 + | fn from(value: LengthString) -> Self {
|
321 + | value.into_inner()
|
322 + | }
|
323 + | }
|
324 + |
|
325 + | #[allow(missing_docs)] // documentation missing in model
|
326 + | ///
|
327 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
328 + | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
329 + | ///
|
330 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
331 + | ///
|
332 + | #[derive(
|
333 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
334 + | )]
|
335 + | pub(crate) struct LengthPatternString(pub(crate) ::std::string::String);
|
336 + | #[allow(dead_code)]
|
337 + | impl LengthPatternString {
|
338 + | /// Extracts a string slice containing the entire underlying `String`.
|
339 + | pub fn as_str(&self) -> &str {
|
340 + | &self.0
|
341 + | }
|
342 + |
|
343 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
344 + | pub fn inner(&self) -> &::std::string::String {
|
345 + | &self.0
|
346 + | }
|
347 + |
|
348 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
349 + | pub fn into_inner(self) -> ::std::string::String {
|
350 + | self.0
|
351 + | }
|
352 + | }
|
353 + | impl LengthPatternString {
|
354 + | fn check_length(
|
355 + | string: &str,
|
356 + | ) -> ::std::result::Result<(), crate::model::length_pattern_string_internal::ConstraintViolation>
|
357 + | {
|
358 + | let length = string.chars().count();
|
359 + |
|
360 + | if (5..=10).contains(&length) {
|
361 + | Ok(())
|
362 + | } else {
|
363 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Length(length))
|
364 + | }
|
365 + | }
|
366 + |
|
367 + | fn check_pattern(
|
368 + | string: ::std::string::String,
|
369 + | ) -> ::std::result::Result<
|
370 + | ::std::string::String,
|
371 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
372 + | > {
|
373 + | let regex = Self::compile_regex();
|
374 + |
|
375 + | if regex.is_match(&string) {
|
376 + | Ok(string)
|
377 + | } else {
|
378 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Pattern(string))
|
379 + | }
|
380 + | }
|
381 + |
|
382 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
383 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
384 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
385 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
386 + | ::regex::Regex::new(r#"[a-f0-5]*"#).expect(r#"The regular expression [a-f0-5]* is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
387 + | });
|
388 + |
|
389 + | ®EX
|
390 + | }
|
391 + | }
|
392 + | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
393 + | type Error = crate::model::length_pattern_string_internal::ConstraintViolation;
|
394 + |
|
395 + | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
396 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
397 + | Self::check_length(&value)?;
|
398 + |
|
399 + | let value = Self::check_pattern(value)?;
|
400 + |
|
401 + | Ok(Self(value))
|
402 + | }
|
403 + | }
|
404 + | impl crate::constrained::Constrained for LengthPatternString {
|
405 + | type Unconstrained = ::std::string::String;
|
406 + | }
|
407 + |
|
408 + | impl ::std::convert::From<::std::string::String>
|
409 + | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
410 + | {
|
411 + | fn from(value: ::std::string::String) -> Self {
|
412 + | Self::Unconstrained(value)
|
413 + | }
|
414 + | }
|
415 + |
|
416 + | impl ::std::fmt::Display for LengthPatternString {
|
417 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
418 + | self.0.fmt(f)
|
419 + | }
|
420 + | }
|
421 + |
|
422 + | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
423 + | fn from(value: LengthPatternString) -> Self {
|
424 + | value.into_inner()
|
425 + | }
|
426 + | }
|
427 + |
|
428 + | #[cfg(test)]
|
429 + | mod test_length_pattern_string {
|
430 + | #[test]
|
431 + | fn regex_compiles() {
|
432 + | crate::model::LengthPatternString::compile_regex();
|
433 + | }
|
434 + | }
|
435 + |
|
436 + | #[allow(missing_docs)] // documentation missing in model
|
437 + | ///
|
438 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
439 + | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
440 + | ///
|
441 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
442 + | ///
|
443 + | #[derive(
|
444 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
445 + | )]
|
446 + | pub(crate) struct PatternString(pub(crate) ::std::string::String);
|
447 + | #[allow(dead_code)]
|
448 + | impl PatternString {
|
449 + | /// Extracts a string slice containing the entire underlying `String`.
|
450 + | pub fn as_str(&self) -> &str {
|
451 + | &self.0
|
452 + | }
|
453 + |
|
454 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
455 + | pub fn inner(&self) -> &::std::string::String {
|
456 + | &self.0
|
457 + | }
|
458 + |
|
459 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
460 + | pub fn into_inner(self) -> ::std::string::String {
|
461 + | self.0
|
462 + | }
|
463 + | }
|
464 + | impl PatternString {
|
465 + | fn check_pattern(
|
466 + | string: ::std::string::String,
|
467 + | ) -> ::std::result::Result<
|
468 + | ::std::string::String,
|
469 + | crate::model::pattern_string_internal::ConstraintViolation,
|
470 + | > {
|
471 + | let regex = Self::compile_regex();
|
472 + |
|
473 + | if regex.is_match(&string) {
|
474 + | Ok(string)
|
475 + | } else {
|
476 + | Err(crate::model::pattern_string_internal::ConstraintViolation::Pattern(string))
|
477 + | }
|
478 + | }
|
479 + |
|
480 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
481 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
482 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
483 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
484 + | ::regex::Regex::new(r#"[a-d]{5}"#).expect(r#"The regular expression [a-d]{5} is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
485 + | });
|
486 + |
|
487 + | ®EX
|
488 + | }
|
489 + | }
|
490 + | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
491 + | type Error = crate::model::pattern_string_internal::ConstraintViolation;
|
492 + |
|
493 + | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
494 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
495 + | let value = Self::check_pattern(value)?;
|
496 + |
|
497 + | Ok(Self(value))
|
498 + | }
|
499 + | }
|
500 + | impl crate::constrained::Constrained for PatternString {
|
501 + | type Unconstrained = ::std::string::String;
|
502 + | }
|
503 + |
|
504 + | impl ::std::convert::From<::std::string::String>
|
505 + | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
506 + | {
|
507 + | fn from(value: ::std::string::String) -> Self {
|
508 + | Self::Unconstrained(value)
|
509 + | }
|
510 + | }
|
511 + |
|
512 + | impl ::std::fmt::Display for PatternString {
|
513 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
514 + | self.0.fmt(f)
|
515 + | }
|
516 + | }
|
517 + |
|
518 + | impl ::std::convert::From<PatternString> for ::std::string::String {
|
519 + | fn from(value: PatternString) -> Self {
|
520 + | value.into_inner()
|
521 + | }
|
522 + | }
|
523 + |
|
524 + | #[cfg(test)]
|
525 + | mod test_pattern_string {
|
526 + | #[test]
|
527 + | fn regex_compiles() {
|
528 + | crate::model::PatternString::compile_regex();
|
529 + | }
|
530 + | }
|
531 + |
|
532 + | #[allow(missing_docs)] // documentation missing in model
|
533 + | ///
|
534 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
535 + | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
536 + | ///
|
537 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
538 + | ///
|
539 + | #[derive(
|
540 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
541 + | )]
|
542 + | pub(crate) struct LengthListOfPatternString(
|
543 + | pub(crate) ::std::vec::Vec<crate::model::PatternString>,
|
544 + | );
|
545 + | impl LengthListOfPatternString {
|
546 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
547 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
548 + | self.0
|
549 + | }
|
550 + |
|
551 + | fn check_length(
|
552 + | length: usize,
|
553 + | ) -> ::std::result::Result<
|
554 + | (),
|
555 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
556 + | > {
|
557 + | if (12..=39).contains(&length) {
|
558 + | Ok(())
|
559 + | } else {
|
560 + | Err(
|
561 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation::Length(
|
562 + | length,
|
563 + | ),
|
564 + | )
|
565 + | }
|
566 + | }
|
567 + | }
|
568 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
569 + | for LengthListOfPatternString
|
570 + | {
|
571 + | type Error = crate::model::length_list_of_pattern_string_internal::ConstraintViolation;
|
572 + |
|
573 + | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
574 + | fn try_from(
|
575 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
576 + | ) -> ::std::result::Result<Self, Self::Error> {
|
577 + | Self::check_length(value.len())?;
|
578 + |
|
579 + | Ok(Self(value))
|
580 + | }
|
581 + | }
|
582 + |
|
583 + | impl ::std::convert::From<LengthListOfPatternString>
|
584 + | for ::std::vec::Vec<crate::model::PatternString>
|
585 + | {
|
586 + | fn from(value: LengthListOfPatternString) -> Self {
|
587 + | value.into_inner()
|
588 + | }
|
589 + | }
|
590 + | impl ::std::convert::From<LengthListOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
591 + | fn from(value: LengthListOfPatternString) -> Self {
|
592 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
593 + | }
|
594 + | }
|
595 + | impl crate::constrained::Constrained for LengthListOfPatternString {
|
596 + | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
597 + | }
|
598 + |
|
599 + | #[allow(missing_docs)] // documentation missing in model
|
600 + | ///
|
601 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
602 + | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
603 + | ///
|
604 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
605 + | ///
|
606 + | #[derive(
|
607 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
608 + | )]
|
609 + | pub(crate) struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
610 + | impl SetOfLengthString {
|
611 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
612 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
613 + | self.0
|
614 + | }
|
615 + |
|
616 + | fn check_unique_items(
|
617 + | items: ::std::vec::Vec<crate::model::LengthString>,
|
618 + | ) -> ::std::result::Result<
|
619 + | ::std::vec::Vec<crate::model::LengthString>,
|
620 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
621 + | > {
|
622 + | let mut seen = ::std::collections::HashMap::new();
|
623 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
624 + | for (idx, item) in items.iter().enumerate() {
|
625 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
626 + | duplicate_indices.push(prev_idx);
|
627 + | }
|
628 + | }
|
629 + |
|
630 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
631 + | for idx in &duplicate_indices {
|
632 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
633 + | last_duplicate_indices.push(prev_idx);
|
634 + | }
|
635 + | }
|
636 + | duplicate_indices.extend(last_duplicate_indices);
|
637 + |
|
638 + | if !duplicate_indices.is_empty() {
|
639 + | debug_assert!(duplicate_indices.len() >= 2);
|
640 + | Err(
|
641 + | crate::model::set_of_length_string_internal::ConstraintViolation::UniqueItems {
|
642 + | duplicate_indices,
|
643 + | original: items,
|
644 + | },
|
645 + | )
|
646 + | } else {
|
647 + | Ok(items)
|
648 + | }
|
649 + | }
|
650 + | }
|
651 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
652 + | type Error = crate::model::set_of_length_string_internal::ConstraintViolation;
|
653 + |
|
654 + | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
655 + | fn try_from(
|
656 + | value: ::std::vec::Vec<crate::model::LengthString>,
|
657 + | ) -> ::std::result::Result<Self, Self::Error> {
|
658 + | let value = Self::check_unique_items(value)?;
|
659 + |
|
660 + | Ok(Self(value))
|
661 + | }
|
662 + | }
|
663 + |
|
664 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
665 + | fn from(value: SetOfLengthString) -> Self {
|
666 + | value.into_inner()
|
667 + | }
|
668 + | }
|
669 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
|
670 + | fn from(value: SetOfLengthString) -> Self {
|
671 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
672 + | }
|
673 + | }
|
674 + | impl crate::constrained::Constrained for SetOfLengthString {
|
675 + | type Unconstrained =
|
676 + | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
677 + | }
|
678 + |
|
679 + | #[allow(missing_docs)] // documentation missing in model
|
680 + | #[derive(
|
681 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
682 + | )]
|
683 + | pub struct RecursiveShapesInputOutputNested1 {
|
684 + | #[allow(missing_docs)] // documentation missing in model
|
685 + | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
686 + | }
|
687 + | impl RecursiveShapesInputOutputNested1 {
|
688 + | #[allow(missing_docs)] // documentation missing in model
|
689 + | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
690 + | use std::ops::Deref;
|
691 + | self.recursive_member.deref()
|
692 + | }
|
693 + | }
|
694 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
695 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
696 + | }
|
697 + | impl RecursiveShapesInputOutputNested1 {
|
698 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
699 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
700 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
701 + | }
|
702 + | }
|
703 + |
|
704 + | #[allow(missing_docs)] // documentation missing in model
|
705 + | #[derive(
|
706 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
707 + | )]
|
708 + | pub struct RecursiveShapesInputOutputNested2 {
|
709 + | #[allow(missing_docs)] // documentation missing in model
|
710 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
711 + | }
|
712 + | impl RecursiveShapesInputOutputNested2 {
|
713 + | #[allow(missing_docs)] // documentation missing in model
|
714 + | pub fn recursive_member(
|
715 + | &self,
|
716 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
717 + | self.recursive_member.as_ref()
|
718 + | }
|
719 + | }
|
720 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
721 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
722 + | }
|
723 + | impl RecursiveShapesInputOutputNested2 {
|
724 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
725 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
726 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
727 + | }
|
728 + | }
|
729 + |
|
730 + | #[allow(missing_docs)] // documentation missing in model
|
731 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
732 + | pub struct ConA {
|
733 + | #[allow(missing_docs)] // documentation missing in model
|
734 + | pub con_b: crate::model::ConB,
|
735 + | #[allow(missing_docs)] // documentation missing in model
|
736 + | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
737 + | #[allow(missing_docs)] // documentation missing in model
|
738 + | pub length_string: ::std::option::Option<::std::string::String>,
|
739 + | #[allow(missing_docs)] // documentation missing in model
|
740 + | pub min_length_string: ::std::option::Option<::std::string::String>,
|
741 + | #[allow(missing_docs)] // documentation missing in model
|
742 + | pub max_length_string: ::std::option::Option<::std::string::String>,
|
743 + | #[allow(missing_docs)] // documentation missing in model
|
744 + | pub fixed_length_string: ::std::option::Option<::std::string::String>,
|
745 + | #[allow(missing_docs)] // documentation missing in model
|
746 + | pub length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
747 + | #[allow(missing_docs)] // documentation missing in model
|
748 + | pub min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
749 + | #[allow(missing_docs)] // documentation missing in model
|
750 + | pub max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
751 + | #[allow(missing_docs)] // documentation missing in model
|
752 + | pub fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
753 + | #[allow(missing_docs)] // documentation missing in model
|
754 + | pub range_integer: i32,
|
755 + | #[allow(missing_docs)] // documentation missing in model
|
756 + | pub min_range_integer: i32,
|
757 + | #[allow(missing_docs)] // documentation missing in model
|
758 + | pub max_range_integer: i32,
|
759 + | #[allow(missing_docs)] // documentation missing in model
|
760 + | pub fixed_value_integer: i32,
|
761 + | #[allow(missing_docs)] // documentation missing in model
|
762 + | pub range_short: i16,
|
763 + | #[allow(missing_docs)] // documentation missing in model
|
764 + | pub min_range_short: i16,
|
765 + | #[allow(missing_docs)] // documentation missing in model
|
766 + | pub max_range_short: i16,
|
767 + | #[allow(missing_docs)] // documentation missing in model
|
768 + | pub fixed_value_short: i16,
|
769 + | #[allow(missing_docs)] // documentation missing in model
|
770 + | pub range_long: i64,
|
771 + | #[allow(missing_docs)] // documentation missing in model
|
772 + | pub min_range_long: i64,
|
773 + | #[allow(missing_docs)] // documentation missing in model
|
774 + | pub max_range_long: i64,
|
775 + | #[allow(missing_docs)] // documentation missing in model
|
776 + | pub fixed_value_long: i64,
|
777 + | #[allow(missing_docs)] // documentation missing in model
|
778 + | pub range_byte: i8,
|
779 + | #[allow(missing_docs)] // documentation missing in model
|
780 + | pub min_range_byte: i8,
|
781 + | #[allow(missing_docs)] // documentation missing in model
|
782 + | pub max_range_byte: i8,
|
783 + | #[allow(missing_docs)] // documentation missing in model
|
784 + | pub fixed_value_byte: i8,
|
785 + | #[allow(missing_docs)] // documentation missing in model
|
786 + | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
787 + | #[allow(missing_docs)] // documentation missing in model
|
788 + | pub length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
789 + | #[allow(missing_docs)] // documentation missing in model
|
790 + | pub sensitive_length_list:
|
791 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
792 + | #[allow(missing_docs)] // documentation missing in model
|
793 + | pub con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
794 + | #[allow(missing_docs)] // documentation missing in model
|
795 + | pub con_b_map: ::std::option::Option<
|
796 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
797 + | >,
|
798 + | #[allow(missing_docs)] // documentation missing in model
|
799 + | pub length_map: ::std::option::Option<
|
800 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
801 + | >,
|
802 + | #[allow(missing_docs)] // documentation missing in model
|
803 + | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
804 + | ::std::collections::HashMap<
|
805 + | ::std::string::String,
|
806 + | ::std::collections::HashMap<
|
807 + | ::std::string::String,
|
808 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
809 + | >,
|
810 + | >,
|
811 + | >,
|
812 + | #[allow(missing_docs)] // documentation missing in model
|
813 + | pub sparse_map: ::std::option::Option<
|
814 + | ::std::collections::HashMap<
|
815 + | ::std::string::String,
|
816 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
817 + | >,
|
818 + | >,
|
819 + | #[allow(missing_docs)] // documentation missing in model
|
820 + | pub sparse_list:
|
821 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
822 + | #[allow(missing_docs)] // documentation missing in model
|
823 + | pub sparse_length_map: ::std::option::Option<
|
824 + | ::std::collections::HashMap<
|
825 + | ::std::string::String,
|
826 + | ::std::option::Option<::std::string::String>,
|
827 + | >,
|
828 + | >,
|
829 + | #[allow(missing_docs)] // documentation missing in model
|
830 + | pub sparse_length_list:
|
831 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
832 + | /// A union with constrained members.
|
833 + | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
834 + | #[allow(missing_docs)] // documentation missing in model
|
835 + | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
836 + | #[allow(missing_docs)] // documentation missing in model
|
837 + | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
838 + | #[allow(missing_docs)] // documentation missing in model
|
839 + | pub set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
840 + | #[allow(missing_docs)] // documentation missing in model
|
841 + | pub map_of_length_string: ::std::option::Option<
|
842 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
843 + | >,
|
844 + | #[allow(missing_docs)] // documentation missing in model
|
845 + | pub list_of_length_blob: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
846 + | #[allow(missing_docs)] // documentation missing in model
|
847 + | pub map_of_length_blob: ::std::option::Option<
|
848 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
849 + | >,
|
850 + | #[allow(missing_docs)] // documentation missing in model
|
851 + | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
852 + | #[allow(missing_docs)] // documentation missing in model
|
853 + | pub set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
854 + | #[allow(missing_docs)] // documentation missing in model
|
855 + | pub map_of_range_integer:
|
856 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
857 + | #[allow(missing_docs)] // documentation missing in model
|
858 + | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
859 + | #[allow(missing_docs)] // documentation missing in model
|
860 + | pub set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
861 + | #[allow(missing_docs)] // documentation missing in model
|
862 + | pub map_of_range_short:
|
863 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
864 + | #[allow(missing_docs)] // documentation missing in model
|
865 + | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
866 + | #[allow(missing_docs)] // documentation missing in model
|
867 + | pub set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
868 + | #[allow(missing_docs)] // documentation missing in model
|
869 + | pub map_of_range_long:
|
870 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
871 + | #[allow(missing_docs)] // documentation missing in model
|
872 + | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
873 + | #[allow(missing_docs)] // documentation missing in model
|
874 + | pub set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
875 + | #[allow(missing_docs)] // documentation missing in model
|
876 + | pub map_of_range_byte:
|
877 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
878 + | #[allow(missing_docs)] // documentation missing in model
|
879 + | pub non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
880 + | #[allow(missing_docs)] // documentation missing in model
|
881 + | pub pattern_string: ::std::option::Option<::std::string::String>,
|
882 + | #[allow(missing_docs)] // documentation missing in model
|
883 + | pub map_of_pattern_string: ::std::option::Option<
|
884 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
885 + | >,
|
886 + | #[allow(missing_docs)] // documentation missing in model
|
887 + | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
888 + | #[allow(missing_docs)] // documentation missing in model
|
889 + | pub set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
890 + | #[allow(missing_docs)] // documentation missing in model
|
891 + | pub length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
892 + | #[allow(missing_docs)] // documentation missing in model
|
893 + | pub map_of_length_pattern_string: ::std::option::Option<
|
894 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
895 + | >,
|
896 + | #[allow(missing_docs)] // documentation missing in model
|
897 + | pub list_of_length_pattern_string:
|
898 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
899 + | #[allow(missing_docs)] // documentation missing in model
|
900 + | pub set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
901 + | #[allow(missing_docs)] // documentation missing in model
|
902 + | pub length_list_of_pattern_string:
|
903 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
904 + | #[allow(missing_docs)] // documentation missing in model
|
905 + | pub length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
906 + | }
|
907 + | impl ConA {
|
908 + | #[allow(missing_docs)] // documentation missing in model
|
909 + | pub fn con_b(&self) -> &crate::model::ConB {
|
910 + | &self.con_b
|
911 + | }
|
912 + | #[allow(missing_docs)] // documentation missing in model
|
913 + | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
914 + | self.opt_con_b.as_ref()
|
915 + | }
|
916 + | #[allow(missing_docs)] // documentation missing in model
|
917 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
918 + | self.length_string.as_deref()
|
919 + | }
|
920 + | #[allow(missing_docs)] // documentation missing in model
|
921 + | pub fn min_length_string(&self) -> ::std::option::Option<&str> {
|
922 + | self.min_length_string.as_deref()
|
923 + | }
|
924 + | #[allow(missing_docs)] // documentation missing in model
|
925 + | pub fn max_length_string(&self) -> ::std::option::Option<&str> {
|
926 + | self.max_length_string.as_deref()
|
927 + | }
|
928 + | #[allow(missing_docs)] // documentation missing in model
|
929 + | pub fn fixed_length_string(&self) -> ::std::option::Option<&str> {
|
930 + | self.fixed_length_string.as_deref()
|
931 + | }
|
932 + | #[allow(missing_docs)] // documentation missing in model
|
933 + | pub fn length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
934 + | self.length_blob.as_ref()
|
935 + | }
|
936 + | #[allow(missing_docs)] // documentation missing in model
|
937 + | pub fn min_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
938 + | self.min_length_blob.as_ref()
|
939 + | }
|
940 + | #[allow(missing_docs)] // documentation missing in model
|
941 + | pub fn max_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
942 + | self.max_length_blob.as_ref()
|
943 + | }
|
944 + | #[allow(missing_docs)] // documentation missing in model
|
945 + | pub fn fixed_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
946 + | self.fixed_length_blob.as_ref()
|
947 + | }
|
948 + | #[allow(missing_docs)] // documentation missing in model
|
949 + | pub fn range_integer(&self) -> i32 {
|
950 + | self.range_integer
|
951 + | }
|
952 + | #[allow(missing_docs)] // documentation missing in model
|
953 + | pub fn min_range_integer(&self) -> i32 {
|
954 + | self.min_range_integer
|
955 + | }
|
956 + | #[allow(missing_docs)] // documentation missing in model
|
957 + | pub fn max_range_integer(&self) -> i32 {
|
958 + | self.max_range_integer
|
959 + | }
|
960 + | #[allow(missing_docs)] // documentation missing in model
|
961 + | pub fn fixed_value_integer(&self) -> i32 {
|
962 + | self.fixed_value_integer
|
963 + | }
|
964 + | #[allow(missing_docs)] // documentation missing in model
|
965 + | pub fn range_short(&self) -> i16 {
|
966 + | self.range_short
|
967 + | }
|
968 + | #[allow(missing_docs)] // documentation missing in model
|
969 + | pub fn min_range_short(&self) -> i16 {
|
970 + | self.min_range_short
|
971 + | }
|
972 + | #[allow(missing_docs)] // documentation missing in model
|
973 + | pub fn max_range_short(&self) -> i16 {
|
974 + | self.max_range_short
|
975 + | }
|
976 + | #[allow(missing_docs)] // documentation missing in model
|
977 + | pub fn fixed_value_short(&self) -> i16 {
|
978 + | self.fixed_value_short
|
979 + | }
|
980 + | #[allow(missing_docs)] // documentation missing in model
|
981 + | pub fn range_long(&self) -> i64 {
|
982 + | self.range_long
|
983 + | }
|
984 + | #[allow(missing_docs)] // documentation missing in model
|
985 + | pub fn min_range_long(&self) -> i64 {
|
986 + | self.min_range_long
|
987 + | }
|
988 + | #[allow(missing_docs)] // documentation missing in model
|
989 + | pub fn max_range_long(&self) -> i64 {
|
990 + | self.max_range_long
|
991 + | }
|
992 + | #[allow(missing_docs)] // documentation missing in model
|
993 + | pub fn fixed_value_long(&self) -> i64 {
|
994 + | self.fixed_value_long
|
995 + | }
|
996 + | #[allow(missing_docs)] // documentation missing in model
|
997 + | pub fn range_byte(&self) -> i8 {
|
998 + | self.range_byte
|
999 + | }
|
1000 + | #[allow(missing_docs)] // documentation missing in model
|
1001 + | pub fn min_range_byte(&self) -> i8 {
|
1002 + | self.min_range_byte
|
1003 + | }
|
1004 + | #[allow(missing_docs)] // documentation missing in model
|
1005 + | pub fn max_range_byte(&self) -> i8 {
|
1006 + | self.max_range_byte
|
1007 + | }
|
1008 + | #[allow(missing_docs)] // documentation missing in model
|
1009 + | pub fn fixed_value_byte(&self) -> i8 {
|
1010 + | self.fixed_value_byte
|
1011 + | }
|
1012 + | #[allow(missing_docs)] // documentation missing in model
|
1013 + | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
1014 + | self.con_b_list.as_deref()
|
1015 + | }
|
1016 + | #[allow(missing_docs)] // documentation missing in model
|
1017 + | pub fn length_list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1018 + | self.length_list.as_deref()
|
1019 + | }
|
1020 + | #[allow(missing_docs)] // documentation missing in model
|
1021 + | pub fn sensitive_length_list(
|
1022 + | &self,
|
1023 + | ) -> ::std::option::Option<&[crate::model::SensitiveStructure]> {
|
1024 + | self.sensitive_length_list.as_deref()
|
1025 + | }
|
1026 + | #[allow(missing_docs)] // documentation missing in model
|
1027 + | pub fn con_b_set(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
1028 + | self.con_b_set.as_deref()
|
1029 + | }
|
1030 + | #[allow(missing_docs)] // documentation missing in model
|
1031 + | pub fn con_b_map(
|
1032 + | &self,
|
1033 + | ) -> ::std::option::Option<
|
1034 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1035 + | > {
|
1036 + | self.con_b_map.as_ref()
|
1037 + | }
|
1038 + | #[allow(missing_docs)] // documentation missing in model
|
1039 + | pub fn length_map(
|
1040 + | &self,
|
1041 + | ) -> ::std::option::Option<
|
1042 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1043 + | > {
|
1044 + | self.length_map.as_ref()
|
1045 + | }
|
1046 + | #[allow(missing_docs)] // documentation missing in model
|
1047 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
1048 + | &self,
|
1049 + | ) -> ::std::option::Option<
|
1050 + | &::std::collections::HashMap<
|
1051 + | ::std::string::String,
|
1052 + | ::std::collections::HashMap<
|
1053 + | ::std::string::String,
|
1054 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1055 + | >,
|
1056 + | >,
|
1057 + | > {
|
1058 + | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
1059 + | }
|
1060 + | #[allow(missing_docs)] // documentation missing in model
|
1061 + | pub fn sparse_map(
|
1062 + | &self,
|
1063 + | ) -> ::std::option::Option<
|
1064 + | &::std::collections::HashMap<
|
1065 + | ::std::string::String,
|
1066 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1067 + | >,
|
1068 + | > {
|
1069 + | self.sparse_map.as_ref()
|
1070 + | }
|
1071 + | #[allow(missing_docs)] // documentation missing in model
|
1072 + | pub fn sparse_list(
|
1073 + | &self,
|
1074 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1075 + | self.sparse_list.as_deref()
|
1076 + | }
|
1077 + | #[allow(missing_docs)] // documentation missing in model
|
1078 + | pub fn sparse_length_map(
|
1079 + | &self,
|
1080 + | ) -> ::std::option::Option<
|
1081 + | &::std::collections::HashMap<
|
1082 + | ::std::string::String,
|
1083 + | ::std::option::Option<::std::string::String>,
|
1084 + | >,
|
1085 + | > {
|
1086 + | self.sparse_length_map.as_ref()
|
1087 + | }
|
1088 + | #[allow(missing_docs)] // documentation missing in model
|
1089 + | pub fn sparse_length_list(
|
1090 + | &self,
|
1091 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1092 + | self.sparse_length_list.as_deref()
|
1093 + | }
|
1094 + | /// A union with constrained members.
|
1095 + | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
1096 + | self.constrained_union.as_ref()
|
1097 + | }
|
1098 + | #[allow(missing_docs)] // documentation missing in model
|
1099 + | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
1100 + | self.enum_string.as_ref()
|
1101 + | }
|
1102 + | #[allow(missing_docs)] // documentation missing in model
|
1103 + | pub fn list_of_length_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1104 + | self.list_of_length_string.as_deref()
|
1105 + | }
|
1106 + | #[allow(missing_docs)] // documentation missing in model
|
1107 + | pub fn set_of_length_string(
|
1108 + | &self,
|
1109 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1110 + | self.set_of_length_string.as_ref()
|
1111 + | }
|
1112 + | #[allow(missing_docs)] // documentation missing in model
|
1113 + | pub fn map_of_length_string(
|
1114 + | &self,
|
1115 + | ) -> ::std::option::Option<
|
1116 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1117 + | > {
|
1118 + | self.map_of_length_string.as_ref()
|
1119 + | }
|
1120 + | #[allow(missing_docs)] // documentation missing in model
|
1121 + | pub fn list_of_length_blob(&self) -> ::std::option::Option<&[::aws_smithy_types::Blob]> {
|
1122 + | self.list_of_length_blob.as_deref()
|
1123 + | }
|
1124 + | #[allow(missing_docs)] // documentation missing in model
|
1125 + | pub fn map_of_length_blob(
|
1126 + | &self,
|
1127 + | ) -> ::std::option::Option<
|
1128 + | &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
1129 + | > {
|
1130 + | self.map_of_length_blob.as_ref()
|
1131 + | }
|
1132 + | #[allow(missing_docs)] // documentation missing in model
|
1133 + | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1134 + | self.list_of_range_integer.as_deref()
|
1135 + | }
|
1136 + | #[allow(missing_docs)] // documentation missing in model
|
1137 + | pub fn set_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1138 + | self.set_of_range_integer.as_deref()
|
1139 + | }
|
1140 + | #[allow(missing_docs)] // documentation missing in model
|
1141 + | pub fn map_of_range_integer(
|
1142 + | &self,
|
1143 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
1144 + | self.map_of_range_integer.as_ref()
|
1145 + | }
|
1146 + | #[allow(missing_docs)] // documentation missing in model
|
1147 + | pub fn list_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1148 + | self.list_of_range_short.as_deref()
|
1149 + | }
|
1150 + | #[allow(missing_docs)] // documentation missing in model
|
1151 + | pub fn set_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1152 + | self.set_of_range_short.as_deref()
|
1153 + | }
|
1154 + | #[allow(missing_docs)] // documentation missing in model
|
1155 + | pub fn map_of_range_short(
|
1156 + | &self,
|
1157 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i16>> {
|
1158 + | self.map_of_range_short.as_ref()
|
1159 + | }
|
1160 + | #[allow(missing_docs)] // documentation missing in model
|
1161 + | pub fn list_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1162 + | self.list_of_range_long.as_deref()
|
1163 + | }
|
1164 + | #[allow(missing_docs)] // documentation missing in model
|
1165 + | pub fn set_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1166 + | self.set_of_range_long.as_deref()
|
1167 + | }
|
1168 + | #[allow(missing_docs)] // documentation missing in model
|
1169 + | pub fn map_of_range_long(
|
1170 + | &self,
|
1171 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i64>> {
|
1172 + | self.map_of_range_long.as_ref()
|
1173 + | }
|
1174 + | #[allow(missing_docs)] // documentation missing in model
|
1175 + | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1176 + | self.list_of_range_byte.as_deref()
|
1177 + | }
|
1178 + | #[allow(missing_docs)] // documentation missing in model
|
1179 + | pub fn set_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1180 + | self.set_of_range_byte.as_deref()
|
1181 + | }
|
1182 + | #[allow(missing_docs)] // documentation missing in model
|
1183 + | pub fn map_of_range_byte(
|
1184 + | &self,
|
1185 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i8>> {
|
1186 + | self.map_of_range_byte.as_ref()
|
1187 + | }
|
1188 + | #[allow(missing_docs)] // documentation missing in model
|
1189 + | pub fn non_streaming_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
1190 + | self.non_streaming_blob.as_ref()
|
1191 + | }
|
1192 + | #[allow(missing_docs)] // documentation missing in model
|
1193 + | pub fn pattern_string(&self) -> ::std::option::Option<&str> {
|
1194 + | self.pattern_string.as_deref()
|
1195 + | }
|
1196 + | #[allow(missing_docs)] // documentation missing in model
|
1197 + | pub fn map_of_pattern_string(
|
1198 + | &self,
|
1199 + | ) -> ::std::option::Option<
|
1200 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1201 + | > {
|
1202 + | self.map_of_pattern_string.as_ref()
|
1203 + | }
|
1204 + | #[allow(missing_docs)] // documentation missing in model
|
1205 + | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1206 + | self.list_of_pattern_string.as_deref()
|
1207 + | }
|
1208 + | #[allow(missing_docs)] // documentation missing in model
|
1209 + | pub fn set_of_pattern_string(
|
1210 + | &self,
|
1211 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1212 + | self.set_of_pattern_string.as_ref()
|
1213 + | }
|
1214 + | #[allow(missing_docs)] // documentation missing in model
|
1215 + | pub fn length_length_pattern_string(&self) -> ::std::option::Option<&str> {
|
1216 + | self.length_length_pattern_string.as_deref()
|
1217 + | }
|
1218 + | #[allow(missing_docs)] // documentation missing in model
|
1219 + | pub fn map_of_length_pattern_string(
|
1220 + | &self,
|
1221 + | ) -> ::std::option::Option<
|
1222 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1223 + | > {
|
1224 + | self.map_of_length_pattern_string.as_ref()
|
1225 + | }
|
1226 + | #[allow(missing_docs)] // documentation missing in model
|
1227 + | pub fn list_of_length_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1228 + | self.list_of_length_pattern_string.as_deref()
|
1229 + | }
|
1230 + | #[allow(missing_docs)] // documentation missing in model
|
1231 + | pub fn set_of_length_pattern_string(
|
1232 + | &self,
|
1233 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1234 + | self.set_of_length_pattern_string.as_ref()
|
1235 + | }
|
1236 + | #[allow(missing_docs)] // documentation missing in model
|
1237 + | pub fn length_list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1238 + | self.length_list_of_pattern_string.as_deref()
|
1239 + | }
|
1240 + | #[allow(missing_docs)] // documentation missing in model
|
1241 + | pub fn length_set_of_pattern_string(
|
1242 + | &self,
|
1243 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1244 + | self.length_set_of_pattern_string.as_ref()
|
1245 + | }
|
1246 + | }
|
1247 + | impl crate::constrained::Constrained for crate::model::ConA {
|
1248 + | type Unconstrained = crate::model::con_a_internal::Builder;
|
1249 + | }
|
1250 + | impl ConA {
|
1251 + | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
1252 + | pub fn builder() -> crate::model::con_a::Builder {
|
1253 + | crate::model::con_a::Builder::default()
|
1254 + | }
|
1255 + | }
|
1256 + |
|
1257 + | #[allow(missing_docs)] // documentation missing in model
|
1258 + | ///
|
1259 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1260 + | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1261 + | ///
|
1262 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1263 + | ///
|
1264 + | #[derive(
|
1265 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1266 + | )]
|
1267 + | pub(crate) struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1268 + | impl LengthSetOfPatternString {
|
1269 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1270 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1271 + | self.0
|
1272 + | }
|
1273 + |
|
1274 + | fn check_length(
|
1275 + | length: usize,
|
1276 + | ) -> ::std::result::Result<
|
1277 + | (),
|
1278 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1279 + | > {
|
1280 + | if (5..=9).contains(&length) {
|
1281 + | Ok(())
|
1282 + | } else {
|
1283 + | Err(
|
1284 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation::Length(
|
1285 + | length,
|
1286 + | ),
|
1287 + | )
|
1288 + | }
|
1289 + | }
|
1290 + |
|
1291 + | fn check_unique_items(
|
1292 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
1293 + | ) -> ::std::result::Result<
|
1294 + | ::std::vec::Vec<crate::model::PatternString>,
|
1295 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1296 + | > {
|
1297 + | let mut seen = ::std::collections::HashMap::new();
|
1298 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1299 + | for (idx, item) in items.iter().enumerate() {
|
1300 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1301 + | duplicate_indices.push(prev_idx);
|
1302 + | }
|
1303 + | }
|
1304 + |
|
1305 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1306 + | for idx in &duplicate_indices {
|
1307 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1308 + | last_duplicate_indices.push(prev_idx);
|
1309 + | }
|
1310 + | }
|
1311 + | duplicate_indices.extend(last_duplicate_indices);
|
1312 + |
|
1313 + | if !duplicate_indices.is_empty() {
|
1314 + | debug_assert!(duplicate_indices.len() >= 2);
|
1315 + | Err(crate::model::length_set_of_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1316 + | } else {
|
1317 + | Ok(items)
|
1318 + | }
|
1319 + | }
|
1320 + | }
|
1321 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1322 + | for LengthSetOfPatternString
|
1323 + | {
|
1324 + | type Error = crate::model::length_set_of_pattern_string_internal::ConstraintViolation;
|
1325 + |
|
1326 + | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1327 + | fn try_from(
|
1328 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
1329 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1330 + | Self::check_length(value.len())?;
|
1331 + |
|
1332 + | let value = Self::check_unique_items(value)?;
|
1333 + |
|
1334 + | Ok(Self(value))
|
1335 + | }
|
1336 + | }
|
1337 + |
|
1338 + | impl ::std::convert::From<LengthSetOfPatternString>
|
1339 + | for ::std::vec::Vec<crate::model::PatternString>
|
1340 + | {
|
1341 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1342 + | value.into_inner()
|
1343 + | }
|
1344 + | }
|
1345 + | impl ::std::convert::From<LengthSetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1346 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1347 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1348 + | }
|
1349 + | }
|
1350 + | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1351 + | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1352 + | }
|
1353 + |
|
1354 + | #[allow(missing_docs)] // documentation missing in model
|
1355 + | ///
|
1356 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1357 + | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
1358 + | ///
|
1359 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1360 + | ///
|
1361 + | #[derive(
|
1362 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1363 + | )]
|
1364 + | pub(crate) struct SetOfLengthPatternString(
|
1365 + | pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>,
|
1366 + | );
|
1367 + | impl SetOfLengthPatternString {
|
1368 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
1369 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
1370 + | self.0
|
1371 + | }
|
1372 + |
|
1373 + | fn check_unique_items(
|
1374 + | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1375 + | ) -> ::std::result::Result<
|
1376 + | ::std::vec::Vec<crate::model::LengthPatternString>,
|
1377 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
1378 + | > {
|
1379 + | let mut seen = ::std::collections::HashMap::new();
|
1380 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1381 + | for (idx, item) in items.iter().enumerate() {
|
1382 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1383 + | duplicate_indices.push(prev_idx);
|
1384 + | }
|
1385 + | }
|
1386 + |
|
1387 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1388 + | for idx in &duplicate_indices {
|
1389 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1390 + | last_duplicate_indices.push(prev_idx);
|
1391 + | }
|
1392 + | }
|
1393 + | duplicate_indices.extend(last_duplicate_indices);
|
1394 + |
|
1395 + | if !duplicate_indices.is_empty() {
|
1396 + | debug_assert!(duplicate_indices.len() >= 2);
|
1397 + | Err(crate::model::set_of_length_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1398 + | } else {
|
1399 + | Ok(items)
|
1400 + | }
|
1401 + | }
|
1402 + | }
|
1403 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
1404 + | for SetOfLengthPatternString
|
1405 + | {
|
1406 + | type Error = crate::model::set_of_length_pattern_string_internal::ConstraintViolation;
|
1407 + |
|
1408 + | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1409 + | fn try_from(
|
1410 + | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1411 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1412 + | let value = Self::check_unique_items(value)?;
|
1413 + |
|
1414 + | Ok(Self(value))
|
1415 + | }
|
1416 + | }
|
1417 + |
|
1418 + | impl ::std::convert::From<SetOfLengthPatternString>
|
1419 + | for ::std::vec::Vec<crate::model::LengthPatternString>
|
1420 + | {
|
1421 + | fn from(value: SetOfLengthPatternString) -> Self {
|
1422 + | value.into_inner()
|
1423 + | }
|
1424 + | }
|
1425 + | impl ::std::convert::From<SetOfLengthPatternString> for ::std::vec::Vec<::std::string::String> {
|
1426 + | fn from(value: SetOfLengthPatternString) -> Self {
|
1427 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1428 + | }
|
1429 + | }
|
1430 + | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
1431 + | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
1432 + | }
|
1433 + |
|
1434 + | #[allow(missing_docs)] // documentation missing in model
|
1435 + | ///
|
1436 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1437 + | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
1438 + | ///
|
1439 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1440 + | ///
|
1441 + | #[derive(
|
1442 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1443 + | )]
|
1444 + | pub(crate) struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1445 + | impl SetOfPatternString {
|
1446 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1447 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1448 + | self.0
|
1449 + | }
|
1450 + |
|
1451 + | fn check_unique_items(
|
1452 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
1453 + | ) -> ::std::result::Result<
|
1454 + | ::std::vec::Vec<crate::model::PatternString>,
|
1455 + | crate::model::set_of_pattern_string_internal::ConstraintViolation,
|
1456 + | > {
|
1457 + | let mut seen = ::std::collections::HashMap::new();
|
1458 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1459 + | for (idx, item) in items.iter().enumerate() {
|
1460 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1461 + | duplicate_indices.push(prev_idx);
|
1462 + | }
|
1463 + | }
|
1464 + |
|
1465 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1466 + | for idx in &duplicate_indices {
|
1467 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1468 + | last_duplicate_indices.push(prev_idx);
|
1469 + | }
|
1470 + | }
|
1471 + | duplicate_indices.extend(last_duplicate_indices);
|
1472 + |
|
1473 + | if !duplicate_indices.is_empty() {
|
1474 + | debug_assert!(duplicate_indices.len() >= 2);
|
1475 + | Err(
|
1476 + | crate::model::set_of_pattern_string_internal::ConstraintViolation::UniqueItems {
|
1477 + | duplicate_indices,
|
1478 + | original: items,
|
1479 + | },
|
1480 + | )
|
1481 + | } else {
|
1482 + | Ok(items)
|
1483 + | }
|
1484 + | }
|
1485 + | }
|
1486 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
1487 + | type Error = crate::model::set_of_pattern_string_internal::ConstraintViolation;
|
1488 + |
|
1489 + | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1490 + | fn try_from(
|
1491 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
1492 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1493 + | let value = Self::check_unique_items(value)?;
|
1494 + |
|
1495 + | Ok(Self(value))
|
1496 + | }
|
1497 + | }
|
1498 + |
|
1499 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
1500 + | fn from(value: SetOfPatternString) -> Self {
|
1501 + | value.into_inner()
|
1502 + | }
|
1503 + | }
|
1504 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1505 + | fn from(value: SetOfPatternString) -> Self {
|
1506 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1507 + | }
|
1508 + | }
|
1509 + | impl crate::constrained::Constrained for SetOfPatternString {
|
1510 + | type Unconstrained =
|
1511 + | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
1512 + | }
|
1513 + |
|
1514 + | #[allow(missing_docs)] // documentation missing in model
|
1515 + | ///
|
1516 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1517 + | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
1518 + | ///
|
1519 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1520 + | ///
|
1521 + | #[derive(
|
1522 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1523 + | )]
|
1524 + | pub(crate) struct RangeByte(pub(crate) i8);
|
1525 + | #[allow(dead_code)]
|
1526 + | impl RangeByte {
|
1527 + | /// Returns an immutable reference to the underlying [`i8`].
|
1528 + | pub fn inner(&self) -> &i8 {
|
1529 + | &self.0
|
1530 + | }
|
1531 + |
|
1532 + | /// Consumes the value, returning the underlying [`i8`].
|
1533 + | pub fn into_inner(self) -> i8 {
|
1534 + | self.0
|
1535 + | }
|
1536 + | }
|
1537 + |
|
1538 + | impl crate::constrained::Constrained for RangeByte {
|
1539 + | type Unconstrained = i8;
|
1540 + | }
|
1541 + |
|
1542 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
1543 + | fn from(value: i8) -> Self {
|
1544 + | Self::Unconstrained(value)
|
1545 + | }
|
1546 + | }
|
1547 + |
|
1548 + | impl ::std::fmt::Display for RangeByte {
|
1549 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1550 + | self.0.fmt(f)
|
1551 + | }
|
1552 + | }
|
1553 + |
|
1554 + | impl ::std::convert::From<RangeByte> for i8 {
|
1555 + | fn from(value: RangeByte) -> Self {
|
1556 + | value.into_inner()
|
1557 + | }
|
1558 + | }
|
1559 + | impl RangeByte {
|
1560 + | fn check_range(
|
1561 + | value: i8,
|
1562 + | ) -> ::std::result::Result<(), crate::model::range_byte_internal::ConstraintViolation> {
|
1563 + | if (0..=10).contains(&value) {
|
1564 + | Ok(())
|
1565 + | } else {
|
1566 + | Err(crate::model::range_byte_internal::ConstraintViolation::Range(value))
|
1567 + | }
|
1568 + | }
|
1569 + | }
|
1570 + | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1571 + | type Error = crate::model::range_byte_internal::ConstraintViolation;
|
1572 + |
|
1573 + | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1574 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1575 + | Self::check_range(value)?;
|
1576 + |
|
1577 + | Ok(Self(value))
|
1578 + | }
|
1579 + | }
|
1580 + |
|
1581 + | #[allow(missing_docs)] // documentation missing in model
|
1582 + | ///
|
1583 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1584 + | /// [constraint traits]. Use [`SetOfRangeByte::try_from`] to construct values of this type.
|
1585 + | ///
|
1586 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1587 + | ///
|
1588 + | #[derive(
|
1589 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1590 + | )]
|
1591 + | pub(crate) struct SetOfRangeByte(pub(crate) ::std::vec::Vec<crate::model::RangeByte>);
|
1592 + | impl SetOfRangeByte {
|
1593 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeByte>`].
|
1594 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeByte> {
|
1595 + | self.0
|
1596 + | }
|
1597 + |
|
1598 + | fn check_unique_items(
|
1599 + | items: ::std::vec::Vec<crate::model::RangeByte>,
|
1600 + | ) -> ::std::result::Result<
|
1601 + | ::std::vec::Vec<crate::model::RangeByte>,
|
1602 + | crate::model::set_of_range_byte_internal::ConstraintViolation,
|
1603 + | > {
|
1604 + | let mut seen = ::std::collections::HashMap::new();
|
1605 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1606 + | for (idx, item) in items.iter().enumerate() {
|
1607 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1608 + | duplicate_indices.push(prev_idx);
|
1609 + | }
|
1610 + | }
|
1611 + |
|
1612 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1613 + | for idx in &duplicate_indices {
|
1614 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1615 + | last_duplicate_indices.push(prev_idx);
|
1616 + | }
|
1617 + | }
|
1618 + | duplicate_indices.extend(last_duplicate_indices);
|
1619 + |
|
1620 + | if !duplicate_indices.is_empty() {
|
1621 + | debug_assert!(duplicate_indices.len() >= 2);
|
1622 + | Err(
|
1623 + | crate::model::set_of_range_byte_internal::ConstraintViolation::UniqueItems {
|
1624 + | duplicate_indices,
|
1625 + | original: items,
|
1626 + | },
|
1627 + | )
|
1628 + | } else {
|
1629 + | Ok(items)
|
1630 + | }
|
1631 + | }
|
1632 + | }
|
1633 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeByte>> for SetOfRangeByte {
|
1634 + | type Error = crate::model::set_of_range_byte_internal::ConstraintViolation;
|
1635 + |
|
1636 + | /// Constructs a `SetOfRangeByte` from an [`::std::vec::Vec<crate::model::RangeByte>`], failing when the provided value does not satisfy the modeled constraints.
|
1637 + | fn try_from(
|
1638 + | value: ::std::vec::Vec<crate::model::RangeByte>,
|
1639 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1640 + | let value = Self::check_unique_items(value)?;
|
1641 + |
|
1642 + | Ok(Self(value))
|
1643 + | }
|
1644 + | }
|
1645 + |
|
1646 + | impl ::std::convert::From<SetOfRangeByte> for ::std::vec::Vec<crate::model::RangeByte> {
|
1647 + | fn from(value: SetOfRangeByte) -> Self {
|
1648 + | value.into_inner()
|
1649 + | }
|
1650 + | }
|
1651 + | impl ::std::convert::From<SetOfRangeByte> for ::std::vec::Vec<i8> {
|
1652 + | fn from(value: SetOfRangeByte) -> Self {
|
1653 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1654 + | }
|
1655 + | }
|
1656 + | impl crate::constrained::Constrained for SetOfRangeByte {
|
1657 + | type Unconstrained =
|
1658 + | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained;
|
1659 + | }
|
1660 + |
|
1661 + | #[allow(missing_docs)] // documentation missing in model
|
1662 + | ///
|
1663 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1664 + | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1665 + | ///
|
1666 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1667 + | ///
|
1668 + | #[derive(
|
1669 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1670 + | )]
|
1671 + | pub(crate) struct RangeLong(pub(crate) i64);
|
1672 + | #[allow(dead_code)]
|
1673 + | impl RangeLong {
|
1674 + | /// Returns an immutable reference to the underlying [`i64`].
|
1675 + | pub fn inner(&self) -> &i64 {
|
1676 + | &self.0
|
1677 + | }
|
1678 + |
|
1679 + | /// Consumes the value, returning the underlying [`i64`].
|
1680 + | pub fn into_inner(self) -> i64 {
|
1681 + | self.0
|
1682 + | }
|
1683 + | }
|
1684 + |
|
1685 + | impl crate::constrained::Constrained for RangeLong {
|
1686 + | type Unconstrained = i64;
|
1687 + | }
|
1688 + |
|
1689 + | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
1690 + | fn from(value: i64) -> Self {
|
1691 + | Self::Unconstrained(value)
|
1692 + | }
|
1693 + | }
|
1694 + |
|
1695 + | impl ::std::fmt::Display for RangeLong {
|
1696 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1697 + | self.0.fmt(f)
|
1698 + | }
|
1699 + | }
|
1700 + |
|
1701 + | impl ::std::convert::From<RangeLong> for i64 {
|
1702 + | fn from(value: RangeLong) -> Self {
|
1703 + | value.into_inner()
|
1704 + | }
|
1705 + | }
|
1706 + | impl RangeLong {
|
1707 + | fn check_range(
|
1708 + | value: i64,
|
1709 + | ) -> ::std::result::Result<(), crate::model::range_long_internal::ConstraintViolation> {
|
1710 + | if (0..=10).contains(&value) {
|
1711 + | Ok(())
|
1712 + | } else {
|
1713 + | Err(crate::model::range_long_internal::ConstraintViolation::Range(value))
|
1714 + | }
|
1715 + | }
|
1716 + | }
|
1717 + | impl ::std::convert::TryFrom<i64> for RangeLong {
|
1718 + | type Error = crate::model::range_long_internal::ConstraintViolation;
|
1719 + |
|
1720 + | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1721 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1722 + | Self::check_range(value)?;
|
1723 + |
|
1724 + | Ok(Self(value))
|
1725 + | }
|
1726 + | }
|
1727 + |
|
1728 + | #[allow(missing_docs)] // documentation missing in model
|
1729 + | ///
|
1730 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1731 + | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
1732 + | ///
|
1733 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1734 + | ///
|
1735 + | #[derive(
|
1736 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1737 + | )]
|
1738 + | pub(crate) struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
1739 + | impl SetOfRangeLong {
|
1740 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1741 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
1742 + | self.0
|
1743 + | }
|
1744 + |
|
1745 + | fn check_unique_items(
|
1746 + | items: ::std::vec::Vec<crate::model::RangeLong>,
|
1747 + | ) -> ::std::result::Result<
|
1748 + | ::std::vec::Vec<crate::model::RangeLong>,
|
1749 + | crate::model::set_of_range_long_internal::ConstraintViolation,
|
1750 + | > {
|
1751 + | let mut seen = ::std::collections::HashMap::new();
|
1752 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1753 + | for (idx, item) in items.iter().enumerate() {
|
1754 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1755 + | duplicate_indices.push(prev_idx);
|
1756 + | }
|
1757 + | }
|
1758 + |
|
1759 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1760 + | for idx in &duplicate_indices {
|
1761 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1762 + | last_duplicate_indices.push(prev_idx);
|
1763 + | }
|
1764 + | }
|
1765 + | duplicate_indices.extend(last_duplicate_indices);
|
1766 + |
|
1767 + | if !duplicate_indices.is_empty() {
|
1768 + | debug_assert!(duplicate_indices.len() >= 2);
|
1769 + | Err(
|
1770 + | crate::model::set_of_range_long_internal::ConstraintViolation::UniqueItems {
|
1771 + | duplicate_indices,
|
1772 + | original: items,
|
1773 + | },
|
1774 + | )
|
1775 + | } else {
|
1776 + | Ok(items)
|
1777 + | }
|
1778 + | }
|
1779 + | }
|
1780 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
1781 + | type Error = crate::model::set_of_range_long_internal::ConstraintViolation;
|
1782 + |
|
1783 + | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
1784 + | fn try_from(
|
1785 + | value: ::std::vec::Vec<crate::model::RangeLong>,
|
1786 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1787 + | let value = Self::check_unique_items(value)?;
|
1788 + |
|
1789 + | Ok(Self(value))
|
1790 + | }
|
1791 + | }
|
1792 + |
|
1793 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
1794 + | fn from(value: SetOfRangeLong) -> Self {
|
1795 + | value.into_inner()
|
1796 + | }
|
1797 + | }
|
1798 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<i64> {
|
1799 + | fn from(value: SetOfRangeLong) -> Self {
|
1800 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1801 + | }
|
1802 + | }
|
1803 + | impl crate::constrained::Constrained for SetOfRangeLong {
|
1804 + | type Unconstrained =
|
1805 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
1806 + | }
|
1807 + |
|
1808 + | #[allow(missing_docs)] // documentation missing in model
|
1809 + | ///
|
1810 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1811 + | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
1812 + | ///
|
1813 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1814 + | ///
|
1815 + | #[derive(
|
1816 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1817 + | )]
|
1818 + | pub(crate) struct RangeShort(pub(crate) i16);
|
1819 + | #[allow(dead_code)]
|
1820 + | impl RangeShort {
|
1821 + | /// Returns an immutable reference to the underlying [`i16`].
|
1822 + | pub fn inner(&self) -> &i16 {
|
1823 + | &self.0
|
1824 + | }
|
1825 + |
|
1826 + | /// Consumes the value, returning the underlying [`i16`].
|
1827 + | pub fn into_inner(self) -> i16 {
|
1828 + | self.0
|
1829 + | }
|
1830 + | }
|
1831 + |
|
1832 + | impl crate::constrained::Constrained for RangeShort {
|
1833 + | type Unconstrained = i16;
|
1834 + | }
|
1835 + |
|
1836 + | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
1837 + | fn from(value: i16) -> Self {
|
1838 + | Self::Unconstrained(value)
|
1839 + | }
|
1840 + | }
|
1841 + |
|
1842 + | impl ::std::fmt::Display for RangeShort {
|
1843 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1844 + | self.0.fmt(f)
|
1845 + | }
|
1846 + | }
|
1847 + |
|
1848 + | impl ::std::convert::From<RangeShort> for i16 {
|
1849 + | fn from(value: RangeShort) -> Self {
|
1850 + | value.into_inner()
|
1851 + | }
|
1852 + | }
|
1853 + | impl RangeShort {
|
1854 + | fn check_range(
|
1855 + | value: i16,
|
1856 + | ) -> ::std::result::Result<(), crate::model::range_short_internal::ConstraintViolation> {
|
1857 + | if (0..=10).contains(&value) {
|
1858 + | Ok(())
|
1859 + | } else {
|
1860 + | Err(crate::model::range_short_internal::ConstraintViolation::Range(value))
|
1861 + | }
|
1862 + | }
|
1863 + | }
|
1864 + | impl ::std::convert::TryFrom<i16> for RangeShort {
|
1865 + | type Error = crate::model::range_short_internal::ConstraintViolation;
|
1866 + |
|
1867 + | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
1868 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
1869 + | Self::check_range(value)?;
|
1870 + |
|
1871 + | Ok(Self(value))
|
1872 + | }
|
1873 + | }
|
1874 + |
|
1875 + | #[allow(missing_docs)] // documentation missing in model
|
1876 + | ///
|
1877 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1878 + | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
1879 + | ///
|
1880 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1881 + | ///
|
1882 + | #[derive(
|
1883 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1884 + | )]
|
1885 + | pub(crate) struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1886 + | impl SetOfRangeShort {
|
1887 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1888 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1889 + | self.0
|
1890 + | }
|
1891 + |
|
1892 + | fn check_unique_items(
|
1893 + | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1894 + | ) -> ::std::result::Result<
|
1895 + | ::std::vec::Vec<crate::model::RangeShort>,
|
1896 + | crate::model::set_of_range_short_internal::ConstraintViolation,
|
1897 + | > {
|
1898 + | let mut seen = ::std::collections::HashMap::new();
|
1899 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1900 + | for (idx, item) in items.iter().enumerate() {
|
1901 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1902 + | duplicate_indices.push(prev_idx);
|
1903 + | }
|
1904 + | }
|
1905 + |
|
1906 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1907 + | for idx in &duplicate_indices {
|
1908 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1909 + | last_duplicate_indices.push(prev_idx);
|
1910 + | }
|
1911 + | }
|
1912 + | duplicate_indices.extend(last_duplicate_indices);
|
1913 + |
|
1914 + | if !duplicate_indices.is_empty() {
|
1915 + | debug_assert!(duplicate_indices.len() >= 2);
|
1916 + | Err(
|
1917 + | crate::model::set_of_range_short_internal::ConstraintViolation::UniqueItems {
|
1918 + | duplicate_indices,
|
1919 + | original: items,
|
1920 + | },
|
1921 + | )
|
1922 + | } else {
|
1923 + | Ok(items)
|
1924 + | }
|
1925 + | }
|
1926 + | }
|
1927 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
1928 + | type Error = crate::model::set_of_range_short_internal::ConstraintViolation;
|
1929 + |
|
1930 + | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
1931 + | fn try_from(
|
1932 + | value: ::std::vec::Vec<crate::model::RangeShort>,
|
1933 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1934 + | let value = Self::check_unique_items(value)?;
|
1935 + |
|
1936 + | Ok(Self(value))
|
1937 + | }
|
1938 + | }
|
1939 + |
|
1940 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
1941 + | fn from(value: SetOfRangeShort) -> Self {
|
1942 + | value.into_inner()
|
1943 + | }
|
1944 + | }
|
1945 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<i16> {
|
1946 + | fn from(value: SetOfRangeShort) -> Self {
|
1947 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1948 + | }
|
1949 + | }
|
1950 + | impl crate::constrained::Constrained for SetOfRangeShort {
|
1951 + | type Unconstrained =
|
1952 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
1953 + | }
|
1954 + |
|
1955 + | #[allow(missing_docs)] // documentation missing in model
|
1956 + | ///
|
1957 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1958 + | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
1959 + | ///
|
1960 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1961 + | ///
|
1962 + | #[derive(
|
1963 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1964 + | )]
|
1965 + | pub(crate) struct RangeInteger(pub(crate) i32);
|
1966 + | #[allow(dead_code)]
|
1967 + | impl RangeInteger {
|
1968 + | /// Returns an immutable reference to the underlying [`i32`].
|
1969 + | pub fn inner(&self) -> &i32 {
|
1970 + | &self.0
|
1971 + | }
|
1972 + |
|
1973 + | /// Consumes the value, returning the underlying [`i32`].
|
1974 + | pub fn into_inner(self) -> i32 {
|
1975 + | self.0
|
1976 + | }
|
1977 + | }
|
1978 + |
|
1979 + | impl crate::constrained::Constrained for RangeInteger {
|
1980 + | type Unconstrained = i32;
|
1981 + | }
|
1982 + |
|
1983 + | impl ::std::convert::From<i32>
|
1984 + | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
1985 + | {
|
1986 + | fn from(value: i32) -> Self {
|
1987 + | Self::Unconstrained(value)
|
1988 + | }
|
1989 + | }
|
1990 + |
|
1991 + | impl ::std::fmt::Display for RangeInteger {
|
1992 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1993 + | self.0.fmt(f)
|
1994 + | }
|
1995 + | }
|
1996 + |
|
1997 + | impl ::std::convert::From<RangeInteger> for i32 {
|
1998 + | fn from(value: RangeInteger) -> Self {
|
1999 + | value.into_inner()
|
2000 + | }
|
2001 + | }
|
2002 + | impl RangeInteger {
|
2003 + | fn check_range(
|
2004 + | value: i32,
|
2005 + | ) -> ::std::result::Result<(), crate::model::range_integer_internal::ConstraintViolation> {
|
2006 + | if (0..=69).contains(&value) {
|
2007 + | Ok(())
|
2008 + | } else {
|
2009 + | Err(crate::model::range_integer_internal::ConstraintViolation::Range(value))
|
2010 + | }
|
2011 + | }
|
2012 + | }
|
2013 + | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
2014 + | type Error = crate::model::range_integer_internal::ConstraintViolation;
|
2015 + |
|
2016 + | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2017 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2018 + | Self::check_range(value)?;
|
2019 + |
|
2020 + | Ok(Self(value))
|
2021 + | }
|
2022 + | }
|
2023 + |
|
2024 + | #[allow(missing_docs)] // documentation missing in model
|
2025 + | ///
|
2026 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2027 + | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
2028 + | ///
|
2029 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2030 + | ///
|
2031 + | #[derive(
|
2032 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2033 + | )]
|
2034 + | pub(crate) struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
2035 + | impl SetOfRangeInteger {
|
2036 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2037 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
2038 + | self.0
|
2039 + | }
|
2040 + |
|
2041 + | fn check_unique_items(
|
2042 + | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
2043 + | ) -> ::std::result::Result<
|
2044 + | ::std::vec::Vec<crate::model::RangeInteger>,
|
2045 + | crate::model::set_of_range_integer_internal::ConstraintViolation,
|
2046 + | > {
|
2047 + | let mut seen = ::std::collections::HashMap::new();
|
2048 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
2049 + | for (idx, item) in items.iter().enumerate() {
|
2050 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
2051 + | duplicate_indices.push(prev_idx);
|
2052 + | }
|
2053 + | }
|
2054 + |
|
2055 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2056 + | for idx in &duplicate_indices {
|
2057 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2058 + | last_duplicate_indices.push(prev_idx);
|
2059 + | }
|
2060 + | }
|
2061 + | duplicate_indices.extend(last_duplicate_indices);
|
2062 + |
|
2063 + | if !duplicate_indices.is_empty() {
|
2064 + | debug_assert!(duplicate_indices.len() >= 2);
|
2065 + | Err(
|
2066 + | crate::model::set_of_range_integer_internal::ConstraintViolation::UniqueItems {
|
2067 + | duplicate_indices,
|
2068 + | original: items,
|
2069 + | },
|
2070 + | )
|
2071 + | } else {
|
2072 + | Ok(items)
|
2073 + | }
|
2074 + | }
|
2075 + | }
|
2076 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
2077 + | type Error = crate::model::set_of_range_integer_internal::ConstraintViolation;
|
2078 + |
|
2079 + | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
2080 + | fn try_from(
|
2081 + | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
2082 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2083 + | let value = Self::check_unique_items(value)?;
|
2084 + |
|
2085 + | Ok(Self(value))
|
2086 + | }
|
2087 + | }
|
2088 + |
|
2089 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
2090 + | fn from(value: SetOfRangeInteger) -> Self {
|
2091 + | value.into_inner()
|
2092 + | }
|
2093 + | }
|
2094 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<i32> {
|
2095 + | fn from(value: SetOfRangeInteger) -> Self {
|
2096 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2097 + | }
|
2098 + | }
|
2099 + | impl crate::constrained::Constrained for SetOfRangeInteger {
|
2100 + | type Unconstrained =
|
2101 + | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
2102 + | }
|
2103 + |
|
2104 + | #[allow(missing_docs)] // documentation missing in model
|
2105 + | ///
|
2106 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2107 + | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2108 + | ///
|
2109 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2110 + | ///
|
2111 + | #[derive(
|
2112 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2113 + | )]
|
2114 + | pub(crate) struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2115 + | impl LengthBlob {
|
2116 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2117 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2118 + | self.0
|
2119 + | }
|
2120 + | }
|
2121 + | impl LengthBlob {
|
2122 + | fn check_length(
|
2123 + | blob: &::aws_smithy_types::Blob,
|
2124 + | ) -> ::std::result::Result<(), crate::model::length_blob_internal::ConstraintViolation> {
|
2125 + | let length = blob.as_ref().len();
|
2126 + |
|
2127 + | if (2..=70).contains(&length) {
|
2128 + | Ok(())
|
2129 + | } else {
|
2130 + | Err(crate::model::length_blob_internal::ConstraintViolation::Length(length))
|
2131 + | }
|
2132 + | }
|
2133 + | }
|
2134 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2135 + | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2136 + |
|
2137 + | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2138 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2139 + | Self::check_length(&value)?;
|
2140 + |
|
2141 + | Ok(Self(value))
|
2142 + | }
|
2143 + | }
|
2144 + | impl crate::constrained::Constrained for LengthBlob {
|
2145 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2146 + | }
|
2147 + |
|
2148 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2149 + | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2150 + | {
|
2151 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2152 + | Self::Unconstrained(value)
|
2153 + | }
|
2154 + | }
|
2155 + |
|
2156 + | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2157 + | fn from(value: LengthBlob) -> Self {
|
2158 + | value.into_inner()
|
2159 + | }
|
2160 + | }
|
2161 + |
|
2162 + | /// A union with constrained members.
|
2163 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2164 + | pub enum ConstrainedUnion {
|
2165 + | #[allow(missing_docs)] // documentation missing in model
|
2166 + | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
2167 + | #[allow(missing_docs)] // documentation missing in model
|
2168 + | ConBMap(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
2169 + | #[allow(missing_docs)] // documentation missing in model
|
2170 + | ConBSet(::std::vec::Vec<::std::vec::Vec<::std::string::String>>),
|
2171 + | #[allow(missing_docs)] // documentation missing in model
|
2172 + | ConstrainedStructure(crate::model::ConB),
|
2173 + | #[allow(missing_docs)] // documentation missing in model
|
2174 + | EnumString(crate::model::EnumString),
|
2175 + | #[allow(missing_docs)] // documentation missing in model
|
2176 + | LengthString(::std::string::String),
|
2177 + | }
|
2178 + | impl ConstrainedUnion {
|
2179 + | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
2180 + | /// Returns `Err(&Self)` if it can't be converted.
|
2181 + | pub fn as_con_b_list(
|
2182 + | &self,
|
2183 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
2184 + | if let ConstrainedUnion::ConBList(val) = &self {
|
2185 + | ::std::result::Result::Ok(val)
|
2186 + | } else {
|
2187 + | ::std::result::Result::Err(self)
|
2188 + | }
|
2189 + | }
|
2190 + | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
2191 + | pub fn is_con_b_list(&self) -> bool {
|
2192 + | self.as_con_b_list().is_ok()
|
2193 + | }
|
2194 + | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
2195 + | /// Returns `Err(&Self)` if it can't be converted.
|
2196 + | pub fn as_con_b_map(
|
2197 + | &self,
|
2198 + | ) -> ::std::result::Result<
|
2199 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2200 + | &Self,
|
2201 + | > {
|
2202 + | if let ConstrainedUnion::ConBMap(val) = &self {
|
2203 + | ::std::result::Result::Ok(val)
|
2204 + | } else {
|
2205 + | ::std::result::Result::Err(self)
|
2206 + | }
|
2207 + | }
|
2208 + | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
2209 + | pub fn is_con_b_map(&self) -> bool {
|
2210 + | self.as_con_b_map().is_ok()
|
2211 + | }
|
2212 + | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
2213 + | /// Returns `Err(&Self)` if it can't be converted.
|
2214 + | pub fn as_con_b_set(
|
2215 + | &self,
|
2216 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<::std::string::String>>, &Self>
|
2217 + | {
|
2218 + | if let ConstrainedUnion::ConBSet(val) = &self {
|
2219 + | ::std::result::Result::Ok(val)
|
2220 + | } else {
|
2221 + | ::std::result::Result::Err(self)
|
2222 + | }
|
2223 + | }
|
2224 + | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
2225 + | pub fn is_con_b_set(&self) -> bool {
|
2226 + | self.as_con_b_set().is_ok()
|
2227 + | }
|
2228 + | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
2229 + | /// Returns `Err(&Self)` if it can't be converted.
|
2230 + | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
2231 + | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
2232 + | ::std::result::Result::Ok(val)
|
2233 + | } else {
|
2234 + | ::std::result::Result::Err(self)
|
2235 + | }
|
2236 + | }
|
2237 + | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
2238 + | pub fn is_constrained_structure(&self) -> bool {
|
2239 + | self.as_constrained_structure().is_ok()
|
2240 + | }
|
2241 + | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
2242 + | /// Returns `Err(&Self)` if it can't be converted.
|
2243 + | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
2244 + | if let ConstrainedUnion::EnumString(val) = &self {
|
2245 + | ::std::result::Result::Ok(val)
|
2246 + | } else {
|
2247 + | ::std::result::Result::Err(self)
|
2248 + | }
|
2249 + | }
|
2250 + | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
2251 + | pub fn is_enum_string(&self) -> bool {
|
2252 + | self.as_enum_string().is_ok()
|
2253 + | }
|
2254 + | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
2255 + | /// Returns `Err(&Self)` if it can't be converted.
|
2256 + | pub fn as_length_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
2257 + | if let ConstrainedUnion::LengthString(val) = &self {
|
2258 + | ::std::result::Result::Ok(val)
|
2259 + | } else {
|
2260 + | ::std::result::Result::Err(self)
|
2261 + | }
|
2262 + | }
|
2263 + | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
2264 + | pub fn is_length_string(&self) -> bool {
|
2265 + | self.as_length_string().is_ok()
|
2266 + | }
|
2267 + | }
|
2268 + |
|
2269 + | #[allow(missing_docs)] // documentation missing in model
|
2270 + | ///
|
2271 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2272 + | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
2273 + | ///
|
2274 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2275 + | ///
|
2276 + | #[derive(
|
2277 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2278 + | )]
|
2279 + | pub(crate) struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
2280 + | impl ConBSet {
|
2281 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
2282 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
2283 + | self.0
|
2284 + | }
|
2285 + |
|
2286 + | fn check_unique_items(
|
2287 + | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2288 + | ) -> ::std::result::Result<
|
2289 + | ::std::vec::Vec<crate::model::ConBSetInner>,
|
2290 + | crate::model::con_b_set_internal::ConstraintViolation,
|
2291 + | > {
|
2292 + | let mut seen = ::std::collections::HashMap::new();
|
2293 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
2294 + | for (idx, item) in items.iter().enumerate() {
|
2295 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
2296 + | duplicate_indices.push(prev_idx);
|
2297 + | }
|
2298 + | }
|
2299 + |
|
2300 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2301 + | for idx in &duplicate_indices {
|
2302 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2303 + | last_duplicate_indices.push(prev_idx);
|
2304 + | }
|
2305 + | }
|
2306 + | duplicate_indices.extend(last_duplicate_indices);
|
2307 + |
|
2308 + | if !duplicate_indices.is_empty() {
|
2309 + | debug_assert!(duplicate_indices.len() >= 2);
|
2310 + | Err(
|
2311 + | crate::model::con_b_set_internal::ConstraintViolation::UniqueItems {
|
2312 + | duplicate_indices,
|
2313 + | original: items,
|
2314 + | },
|
2315 + | )
|
2316 + | } else {
|
2317 + | Ok(items)
|
2318 + | }
|
2319 + | }
|
2320 + | }
|
2321 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
2322 + | type Error = crate::model::con_b_set_internal::ConstraintViolation;
|
2323 + |
|
2324 + | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
2325 + | fn try_from(
|
2326 + | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2327 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2328 + | let value = Self::check_unique_items(value)?;
|
2329 + |
|
2330 + | Ok(Self(value))
|
2331 + | }
|
2332 + | }
|
2333 + |
|
2334 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
2335 + | fn from(value: ConBSet) -> Self {
|
2336 + | value.into_inner()
|
2337 + | }
|
2338 + | }
|
2339 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
2340 + | fn from(value: ConBSet) -> Self {
|
2341 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2342 + | }
|
2343 + | }
|
2344 + | impl crate::constrained::Constrained for ConBSet {
|
2345 + | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
2346 + | }
|
2347 + |
|
2348 + | #[allow(missing_docs)] // documentation missing in model
|
2349 + | ///
|
2350 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2351 + | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
2352 + | ///
|
2353 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2354 + | ///
|
2355 + | #[derive(
|
2356 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2357 + | )]
|
2358 + | pub(crate) struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2359 + | impl ConBSetInner {
|
2360 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2361 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2362 + | self.0
|
2363 + | }
|
2364 + |
|
2365 + | fn check_unique_items(
|
2366 + | items: ::std::vec::Vec<::std::string::String>,
|
2367 + | ) -> ::std::result::Result<
|
2368 + | ::std::vec::Vec<::std::string::String>,
|
2369 + | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
2370 + | > {
|
2371 + | let mut seen = ::std::collections::HashMap::new();
|
2372 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
2373 + | for (idx, item) in items.iter().enumerate() {
|
2374 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
2375 + | duplicate_indices.push(prev_idx);
|
2376 + | }
|
2377 + | }
|
2378 + |
|
2379 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2380 + | for idx in &duplicate_indices {
|
2381 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2382 + | last_duplicate_indices.push(prev_idx);
|
2383 + | }
|
2384 + | }
|
2385 + | duplicate_indices.extend(last_duplicate_indices);
|
2386 + |
|
2387 + | if !duplicate_indices.is_empty() {
|
2388 + | debug_assert!(duplicate_indices.len() >= 2);
|
2389 + | Err(
|
2390 + | crate::model::con_b_set_inner_internal::ConstraintViolation::UniqueItems {
|
2391 + | duplicate_indices,
|
2392 + | original: items,
|
2393 + | },
|
2394 + | )
|
2395 + | } else {
|
2396 + | Ok(items)
|
2397 + | }
|
2398 + | }
|
2399 + | }
|
2400 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
2401 + | type Error = crate::model::con_b_set_inner_internal::ConstraintViolation;
|
2402 + |
|
2403 + | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2404 + | fn try_from(
|
2405 + | value: ::std::vec::Vec<::std::string::String>,
|
2406 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2407 + | let value = Self::check_unique_items(value)?;
|
2408 + |
|
2409 + | Ok(Self(value))
|
2410 + | }
|
2411 + | }
|
2412 + |
|
2413 + | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
2414 + | fn from(value: ConBSetInner) -> Self {
|
2415 + | value.into_inner()
|
2416 + | }
|
2417 + | }
|
2418 + | impl crate::constrained::Constrained for ConBSetInner {
|
2419 + | type Unconstrained =
|
2420 + | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
2421 + | }
|
2422 + |
|
2423 + | #[allow(missing_docs)] // documentation missing in model
|
2424 + | #[derive(
|
2425 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2426 + | )]
|
2427 + | pub struct ConB {
|
2428 + | #[allow(missing_docs)] // documentation missing in model
|
2429 + | pub nice: ::std::string::String,
|
2430 + | #[allow(missing_docs)] // documentation missing in model
|
2431 + | pub int: i32,
|
2432 + | #[allow(missing_docs)] // documentation missing in model
|
2433 + | pub opt_nice: ::std::option::Option<::std::string::String>,
|
2434 + | #[allow(missing_docs)] // documentation missing in model
|
2435 + | pub opt_int: ::std::option::Option<i32>,
|
2436 + | }
|
2437 + | impl ConB {
|
2438 + | #[allow(missing_docs)] // documentation missing in model
|
2439 + | pub fn nice(&self) -> &str {
|
2440 + | use std::ops::Deref;
|
2441 + | self.nice.deref()
|
2442 + | }
|
2443 + | #[allow(missing_docs)] // documentation missing in model
|
2444 + | pub fn int(&self) -> i32 {
|
2445 + | self.int
|
2446 + | }
|
2447 + | #[allow(missing_docs)] // documentation missing in model
|
2448 + | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
2449 + | self.opt_nice.as_deref()
|
2450 + | }
|
2451 + | #[allow(missing_docs)] // documentation missing in model
|
2452 + | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
2453 + | self.opt_int
|
2454 + | }
|
2455 + | }
|
2456 + | impl crate::constrained::Constrained for crate::model::ConB {
|
2457 + | type Unconstrained = crate::model::con_b_internal::Builder;
|
2458 + | }
|
2459 + | impl ConB {
|
2460 + | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
2461 + | pub fn builder() -> crate::model::con_b::Builder {
|
2462 + | crate::model::con_b::Builder::default()
|
2463 + | }
|
2464 + | }
|
2465 + |
|
2466 + | #[allow(missing_docs)] // documentation missing in model
|
2467 + | ///
|
2468 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2469 + | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
2470 + | ///
|
2471 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2472 + | ///
|
2473 + | #[derive(
|
2474 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2475 + | )]
|
2476 + | pub(crate) struct SparseLengthList(
|
2477 + | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2478 + | );
|
2479 + | impl SparseLengthList {
|
2480 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
2481 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
2482 + | self.0
|
2483 + | }
|
2484 + |
|
2485 + | fn check_length(
|
2486 + | length: usize,
|
2487 + | ) -> ::std::result::Result<(), crate::model::sparse_length_list_internal::ConstraintViolation>
|
2488 + | {
|
2489 + | if 69 <= length {
|
2490 + | Ok(())
|
2491 + | } else {
|
2492 + | Err(crate::model::sparse_length_list_internal::ConstraintViolation::Length(length))
|
2493 + | }
|
2494 + | }
|
2495 + | }
|
2496 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
2497 + | for SparseLengthList
|
2498 + | {
|
2499 + | type Error = crate::model::sparse_length_list_internal::ConstraintViolation;
|
2500 + |
|
2501 + | /// Constructs a `SparseLengthList` from an [`::std::vec::Vec<::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
2502 + | fn try_from(
|
2503 + | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2504 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2505 + | Self::check_length(value.len())?;
|
2506 + |
|
2507 + | Ok(Self(value))
|
2508 + | }
|
2509 + | }
|
2510 + |
|
2511 + | impl ::std::convert::From<SparseLengthList>
|
2512 + | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
2513 + | {
|
2514 + | fn from(value: SparseLengthList) -> Self {
|
2515 + | value.into_inner()
|
2516 + | }
|
2517 + | }
|
2518 + | impl crate::constrained::Constrained for SparseLengthList {
|
2519 + | type Unconstrained =
|
2520 + | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
2521 + | }
|
2522 + |
|
2523 + | #[allow(missing_docs)] // documentation missing in model
|
2524 + | ///
|
2525 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2526 + | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
2527 + | ///
|
2528 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2529 + | ///
|
2530 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2531 + | pub(crate) struct SparseLengthMap(
|
2532 + | pub(crate) ::std::collections::HashMap<
|
2533 + | ::std::string::String,
|
2534 + | ::std::option::Option<::std::string::String>,
|
2535 + | >,
|
2536 + | );
|
2537 + | impl SparseLengthMap {
|
2538 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
2539 + | pub fn into_inner(
|
2540 + | self,
|
2541 + | ) -> ::std::collections::HashMap<
|
2542 + | ::std::string::String,
|
2543 + | ::std::option::Option<::std::string::String>,
|
2544 + | > {
|
2545 + | self.0
|
2546 + | }
|
2547 + | }
|
2548 + | impl
|
2549 + | ::std::convert::TryFrom<
|
2550 + | ::std::collections::HashMap<
|
2551 + | ::std::string::String,
|
2552 + | ::std::option::Option<::std::string::String>,
|
2553 + | >,
|
2554 + | > for SparseLengthMap
|
2555 + | {
|
2556 + | type Error = crate::model::sparse_length_map_internal::ConstraintViolation;
|
2557 + |
|
2558 + | /// Constructs a `SparseLengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
2559 + | fn try_from(
|
2560 + | value: ::std::collections::HashMap<
|
2561 + | ::std::string::String,
|
2562 + | ::std::option::Option<::std::string::String>,
|
2563 + | >,
|
2564 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2565 + | let length = value.len();
|
2566 + | if 69 <= length {
|
2567 + | Ok(Self(value))
|
2568 + | } else {
|
2569 + | Err(crate::model::sparse_length_map_internal::ConstraintViolation::Length(length))
|
2570 + | }
|
2571 + | }
|
2572 + | }
|
2573 + |
|
2574 + | impl ::std::convert::From<SparseLengthMap>
|
2575 + | for ::std::collections::HashMap<
|
2576 + | ::std::string::String,
|
2577 + | ::std::option::Option<::std::string::String>,
|
2578 + | >
|
2579 + | {
|
2580 + | fn from(value: SparseLengthMap) -> Self {
|
2581 + | value.into_inner()
|
2582 + | }
|
2583 + | }
|
2584 + | impl crate::constrained::Constrained for SparseLengthMap {
|
2585 + | type Unconstrained =
|
2586 + | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
2587 + | }
|
2588 + |
|
2589 + | #[allow(missing_docs)] // documentation missing in model
|
2590 + | ///
|
2591 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2592 + | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
2593 + | ///
|
2594 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2595 + | ///
|
2596 + | #[derive(
|
2597 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2598 + | )]
|
2599 + | pub(crate) struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2600 + | impl UniqueItemsList {
|
2601 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2602 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2603 + | self.0
|
2604 + | }
|
2605 + |
|
2606 + | fn check_unique_items(
|
2607 + | items: ::std::vec::Vec<::std::string::String>,
|
2608 + | ) -> ::std::result::Result<
|
2609 + | ::std::vec::Vec<::std::string::String>,
|
2610 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
2611 + | > {
|
2612 + | let mut seen = ::std::collections::HashMap::new();
|
2613 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
2614 + | for (idx, item) in items.iter().enumerate() {
|
2615 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
2616 + | duplicate_indices.push(prev_idx);
|
2617 + | }
|
2618 + | }
|
2619 + |
|
2620 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2621 + | for idx in &duplicate_indices {
|
2622 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2623 + | last_duplicate_indices.push(prev_idx);
|
2624 + | }
|
2625 + | }
|
2626 + | duplicate_indices.extend(last_duplicate_indices);
|
2627 + |
|
2628 + | if !duplicate_indices.is_empty() {
|
2629 + | debug_assert!(duplicate_indices.len() >= 2);
|
2630 + | Err(
|
2631 + | crate::model::unique_items_list_internal::ConstraintViolation::UniqueItems {
|
2632 + | duplicate_indices,
|
2633 + | original: items,
|
2634 + | },
|
2635 + | )
|
2636 + | } else {
|
2637 + | Ok(items)
|
2638 + | }
|
2639 + | }
|
2640 + | }
|
2641 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
2642 + | type Error = crate::model::unique_items_list_internal::ConstraintViolation;
|
2643 + |
|
2644 + | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2645 + | fn try_from(
|
2646 + | value: ::std::vec::Vec<::std::string::String>,
|
2647 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2648 + | let value = Self::check_unique_items(value)?;
|
2649 + |
|
2650 + | Ok(Self(value))
|
2651 + | }
|
2652 + | }
|
2653 + |
|
2654 + | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
2655 + | fn from(value: UniqueItemsList) -> Self {
|
2656 + | value.into_inner()
|
2657 + | }
|
2658 + | }
|
2659 + | impl crate::constrained::Constrained for UniqueItemsList {
|
2660 + | type Unconstrained =
|
2661 + | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
2662 + | }
|
2663 + |
|
2664 + | #[allow(missing_docs)] // documentation missing in model
|
2665 + | ///
|
2666 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2667 + | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
2668 + | ///
|
2669 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2670 + | ///
|
2671 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2672 + | pub(crate) struct LengthMap(
|
2673 + | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2674 + | );
|
2675 + | impl LengthMap {
|
2676 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
2677 + | pub fn into_inner(
|
2678 + | self,
|
2679 + | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
2680 + | self.0
|
2681 + | }
|
2682 + | }
|
2683 + | impl
|
2684 + | ::std::convert::TryFrom<
|
2685 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2686 + | > for LengthMap
|
2687 + | {
|
2688 + | type Error = crate::model::length_map_internal::ConstraintViolation;
|
2689 + |
|
2690 + | /// Constructs a `LengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2691 + | fn try_from(
|
2692 + | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2693 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2694 + | let length = value.len();
|
2695 + | if (1..=69).contains(&length) {
|
2696 + | Ok(Self(value))
|
2697 + | } else {
|
2698 + | Err(crate::model::length_map_internal::ConstraintViolation::Length(length))
|
2699 + | }
|
2700 + | }
|
2701 + | }
|
2702 + |
|
2703 + | impl ::std::convert::From<LengthMap>
|
2704 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
2705 + | {
|
2706 + | fn from(value: LengthMap) -> Self {
|
2707 + | value.into_inner()
|
2708 + | }
|
2709 + | }
|
2710 + | impl crate::constrained::Constrained for LengthMap {
|
2711 + | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
2712 + | }
|
2713 + |
|
2714 + | #[allow(missing_docs)] // documentation missing in model
|
2715 + | ///
|
2716 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2717 + | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
2718 + | ///
|
2719 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2720 + | ///
|
2721 + | #[derive(
|
2722 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2723 + | )]
|
2724 + | pub(crate) struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
2725 + | impl SensitiveLengthList {
|
2726 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
2727 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
2728 + | self.0
|
2729 + | }
|
2730 + |
|
2731 + | fn check_length(
|
2732 + | length: usize,
|
2733 + | ) -> ::std::result::Result<(), crate::model::sensitive_length_list_internal::ConstraintViolation>
|
2734 + | {
|
2735 + | if length <= 69 {
|
2736 + | Ok(())
|
2737 + | } else {
|
2738 + | Err(crate::model::sensitive_length_list_internal::ConstraintViolation::Length(length))
|
2739 + | }
|
2740 + | }
|
2741 + | }
|
2742 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
2743 + | for SensitiveLengthList
|
2744 + | {
|
2745 + | type Error = crate::model::sensitive_length_list_internal::ConstraintViolation;
|
2746 + |
|
2747 + | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
2748 + | fn try_from(
|
2749 + | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
2750 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2751 + | Self::check_length(value.len())?;
|
2752 + |
|
2753 + | Ok(Self(value))
|
2754 + | }
|
2755 + | }
|
2756 + |
|
2757 + | impl ::std::convert::From<SensitiveLengthList>
|
2758 + | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
2759 + | {
|
2760 + | fn from(value: SensitiveLengthList) -> Self {
|
2761 + | value.into_inner()
|
2762 + | }
|
2763 + | }
|
2764 + | impl crate::constrained::Constrained for SensitiveLengthList {
|
2765 + | type Unconstrained =
|
2766 + | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
2767 + | }
|
2768 + |
|
2769 + | #[allow(missing_docs)] // documentation missing in model
|
2770 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
2771 + | pub struct SensitiveStructure {}
|
2772 + | impl ::std::fmt::Debug for SensitiveStructure {
|
2773 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2774 + | let mut formatter = f.debug_struct("SensitiveStructure");
|
2775 + | formatter.finish()
|
2776 + | }
|
2777 + | }
|
2778 + | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
2779 + | type Unconstrained = crate::model::sensitive_structure_internal::Builder;
|
2780 + | }
|
2781 + | impl SensitiveStructure {
|
2782 + | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
2783 + | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
2784 + | crate::model::sensitive_structure::Builder::default()
|
2785 + | }
|
2786 + | }
|
2787 + |
|
2788 + | #[allow(missing_docs)] // documentation missing in model
|
2789 + | ///
|
2790 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2791 + | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
2792 + | ///
|
2793 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2794 + | ///
|
2795 + | #[derive(
|
2796 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2797 + | )]
|
2798 + | pub(crate) struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2799 + | impl LengthList {
|
2800 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2801 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2802 + | self.0
|
2803 + | }
|
2804 + |
|
2805 + | fn check_length(
|
2806 + | length: usize,
|
2807 + | ) -> ::std::result::Result<(), crate::model::length_list_internal::ConstraintViolation> {
|
2808 + | if length <= 69 {
|
2809 + | Ok(())
|
2810 + | } else {
|
2811 + | Err(crate::model::length_list_internal::ConstraintViolation::Length(length))
|
2812 + | }
|
2813 + | }
|
2814 + | }
|
2815 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
2816 + | type Error = crate::model::length_list_internal::ConstraintViolation;
|
2817 + |
|
2818 + | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2819 + | fn try_from(
|
2820 + | value: ::std::vec::Vec<::std::string::String>,
|
2821 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2822 + | Self::check_length(value.len())?;
|
2823 + |
|
2824 + | Ok(Self(value))
|
2825 + | }
|
2826 + | }
|
2827 + |
|
2828 + | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
2829 + | fn from(value: LengthList) -> Self {
|
2830 + | value.into_inner()
|
2831 + | }
|
2832 + | }
|
2833 + | impl crate::constrained::Constrained for LengthList {
|
2834 + | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
2835 + | }
|
2836 + |
|
2837 + | #[allow(missing_docs)] // documentation missing in model
|
2838 + | ///
|
2839 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2840 + | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
2841 + | ///
|
2842 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2843 + | ///
|
2844 + | #[derive(
|
2845 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2846 + | )]
|
2847 + | pub(crate) struct FixedValueByte(pub(crate) i8);
|
2848 + | #[allow(dead_code)]
|
2849 + | impl FixedValueByte {
|
2850 + | /// Returns an immutable reference to the underlying [`i8`].
|
2851 + | pub fn inner(&self) -> &i8 {
|
2852 + | &self.0
|
2853 + | }
|
2854 + |
|
2855 + | /// Consumes the value, returning the underlying [`i8`].
|
2856 + | pub fn into_inner(self) -> i8 {
|
2857 + | self.0
|
2858 + | }
|
2859 + | }
|
2860 + |
|
2861 + | impl crate::constrained::Constrained for FixedValueByte {
|
2862 + | type Unconstrained = i8;
|
2863 + | }
|
2864 + |
|
2865 + | impl ::std::convert::From<i8>
|
2866 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
2867 + | {
|
2868 + | fn from(value: i8) -> Self {
|
2869 + | Self::Unconstrained(value)
|
2870 + | }
|
2871 + | }
|
2872 + |
|
2873 + | impl ::std::fmt::Display for FixedValueByte {
|
2874 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2875 + | self.0.fmt(f)
|
2876 + | }
|
2877 + | }
|
2878 + |
|
2879 + | impl ::std::convert::From<FixedValueByte> for i8 {
|
2880 + | fn from(value: FixedValueByte) -> Self {
|
2881 + | value.into_inner()
|
2882 + | }
|
2883 + | }
|
2884 + | impl FixedValueByte {
|
2885 + | fn check_range(
|
2886 + | value: i8,
|
2887 + | ) -> ::std::result::Result<(), crate::model::fixed_value_byte_internal::ConstraintViolation>
|
2888 + | {
|
2889 + | if (10..=10).contains(&value) {
|
2890 + | Ok(())
|
2891 + | } else {
|
2892 + | Err(crate::model::fixed_value_byte_internal::ConstraintViolation::Range(value))
|
2893 + | }
|
2894 + | }
|
2895 + | }
|
2896 + | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
2897 + | type Error = crate::model::fixed_value_byte_internal::ConstraintViolation;
|
2898 + |
|
2899 + | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2900 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2901 + | Self::check_range(value)?;
|
2902 + |
|
2903 + | Ok(Self(value))
|
2904 + | }
|
2905 + | }
|
2906 + |
|
2907 + | #[allow(missing_docs)] // documentation missing in model
|
2908 + | ///
|
2909 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2910 + | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
2911 + | ///
|
2912 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2913 + | ///
|
2914 + | #[derive(
|
2915 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2916 + | )]
|
2917 + | pub(crate) struct MaxRangeByte(pub(crate) i8);
|
2918 + | #[allow(dead_code)]
|
2919 + | impl MaxRangeByte {
|
2920 + | /// Returns an immutable reference to the underlying [`i8`].
|
2921 + | pub fn inner(&self) -> &i8 {
|
2922 + | &self.0
|
2923 + | }
|
2924 + |
|
2925 + | /// Consumes the value, returning the underlying [`i8`].
|
2926 + | pub fn into_inner(self) -> i8 {
|
2927 + | self.0
|
2928 + | }
|
2929 + | }
|
2930 + |
|
2931 + | impl crate::constrained::Constrained for MaxRangeByte {
|
2932 + | type Unconstrained = i8;
|
2933 + | }
|
2934 + |
|
2935 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
2936 + | fn from(value: i8) -> Self {
|
2937 + | Self::Unconstrained(value)
|
2938 + | }
|
2939 + | }
|
2940 + |
|
2941 + | impl ::std::fmt::Display for MaxRangeByte {
|
2942 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2943 + | self.0.fmt(f)
|
2944 + | }
|
2945 + | }
|
2946 + |
|
2947 + | impl ::std::convert::From<MaxRangeByte> for i8 {
|
2948 + | fn from(value: MaxRangeByte) -> Self {
|
2949 + | value.into_inner()
|
2950 + | }
|
2951 + | }
|
2952 + | impl MaxRangeByte {
|
2953 + | fn check_range(
|
2954 + | value: i8,
|
2955 + | ) -> ::std::result::Result<(), crate::model::max_range_byte_internal::ConstraintViolation> {
|
2956 + | if value <= 11 {
|
2957 + | Ok(())
|
2958 + | } else {
|
2959 + | Err(crate::model::max_range_byte_internal::ConstraintViolation::Range(value))
|
2960 + | }
|
2961 + | }
|
2962 + | }
|
2963 + | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
2964 + | type Error = crate::model::max_range_byte_internal::ConstraintViolation;
|
2965 + |
|
2966 + | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2967 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2968 + | Self::check_range(value)?;
|
2969 + |
|
2970 + | Ok(Self(value))
|
2971 + | }
|
2972 + | }
|
2973 + |
|
2974 + | #[allow(missing_docs)] // documentation missing in model
|
2975 + | ///
|
2976 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2977 + | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
2978 + | ///
|
2979 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2980 + | ///
|
2981 + | #[derive(
|
2982 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2983 + | )]
|
2984 + | pub(crate) struct MinRangeByte(pub(crate) i8);
|
2985 + | #[allow(dead_code)]
|
2986 + | impl MinRangeByte {
|
2987 + | /// Returns an immutable reference to the underlying [`i8`].
|
2988 + | pub fn inner(&self) -> &i8 {
|
2989 + | &self.0
|
2990 + | }
|
2991 + |
|
2992 + | /// Consumes the value, returning the underlying [`i8`].
|
2993 + | pub fn into_inner(self) -> i8 {
|
2994 + | self.0
|
2995 + | }
|
2996 + | }
|
2997 + |
|
2998 + | impl crate::constrained::Constrained for MinRangeByte {
|
2999 + | type Unconstrained = i8;
|
3000 + | }
|
3001 + |
|
3002 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
3003 + | fn from(value: i8) -> Self {
|
3004 + | Self::Unconstrained(value)
|
3005 + | }
|
3006 + | }
|
3007 + |
|
3008 + | impl ::std::fmt::Display for MinRangeByte {
|
3009 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3010 + | self.0.fmt(f)
|
3011 + | }
|
3012 + | }
|
3013 + |
|
3014 + | impl ::std::convert::From<MinRangeByte> for i8 {
|
3015 + | fn from(value: MinRangeByte) -> Self {
|
3016 + | value.into_inner()
|
3017 + | }
|
3018 + | }
|
3019 + | impl MinRangeByte {
|
3020 + | fn check_range(
|
3021 + | value: i8,
|
3022 + | ) -> ::std::result::Result<(), crate::model::min_range_byte_internal::ConstraintViolation> {
|
3023 + | if -10 <= value {
|
3024 + | Ok(())
|
3025 + | } else {
|
3026 + | Err(crate::model::min_range_byte_internal::ConstraintViolation::Range(value))
|
3027 + | }
|
3028 + | }
|
3029 + | }
|
3030 + | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3031 + | type Error = crate::model::min_range_byte_internal::ConstraintViolation;
|
3032 + |
|
3033 + | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3034 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3035 + | Self::check_range(value)?;
|
3036 + |
|
3037 + | Ok(Self(value))
|
3038 + | }
|
3039 + | }
|
3040 + |
|
3041 + | #[allow(missing_docs)] // documentation missing in model
|
3042 + | ///
|
3043 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3044 + | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
3045 + | ///
|
3046 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3047 + | ///
|
3048 + | #[derive(
|
3049 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3050 + | )]
|
3051 + | pub(crate) struct FixedValueLong(pub(crate) i64);
|
3052 + | #[allow(dead_code)]
|
3053 + | impl FixedValueLong {
|
3054 + | /// Returns an immutable reference to the underlying [`i64`].
|
3055 + | pub fn inner(&self) -> &i64 {
|
3056 + | &self.0
|
3057 + | }
|
3058 + |
|
3059 + | /// Consumes the value, returning the underlying [`i64`].
|
3060 + | pub fn into_inner(self) -> i64 {
|
3061 + | self.0
|
3062 + | }
|
3063 + | }
|
3064 + |
|
3065 + | impl crate::constrained::Constrained for FixedValueLong {
|
3066 + | type Unconstrained = i64;
|
3067 + | }
|
3068 + |
|
3069 + | impl ::std::convert::From<i64>
|
3070 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
3071 + | {
|
3072 + | fn from(value: i64) -> Self {
|
3073 + | Self::Unconstrained(value)
|
3074 + | }
|
3075 + | }
|
3076 + |
|
3077 + | impl ::std::fmt::Display for FixedValueLong {
|
3078 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3079 + | self.0.fmt(f)
|
3080 + | }
|
3081 + | }
|
3082 + |
|
3083 + | impl ::std::convert::From<FixedValueLong> for i64 {
|
3084 + | fn from(value: FixedValueLong) -> Self {
|
3085 + | value.into_inner()
|
3086 + | }
|
3087 + | }
|
3088 + | impl FixedValueLong {
|
3089 + | fn check_range(
|
3090 + | value: i64,
|
3091 + | ) -> ::std::result::Result<(), crate::model::fixed_value_long_internal::ConstraintViolation>
|
3092 + | {
|
3093 + | if (10..=10).contains(&value) {
|
3094 + | Ok(())
|
3095 + | } else {
|
3096 + | Err(crate::model::fixed_value_long_internal::ConstraintViolation::Range(value))
|
3097 + | }
|
3098 + | }
|
3099 + | }
|
3100 + | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
3101 + | type Error = crate::model::fixed_value_long_internal::ConstraintViolation;
|
3102 + |
|
3103 + | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3104 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3105 + | Self::check_range(value)?;
|
3106 + |
|
3107 + | Ok(Self(value))
|
3108 + | }
|
3109 + | }
|
3110 + |
|
3111 + | #[allow(missing_docs)] // documentation missing in model
|
3112 + | ///
|
3113 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3114 + | /// [constraint traits]. Use [`MaxRangeLong::try_from`] to construct values of this type.
|
3115 + | ///
|
3116 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3117 + | ///
|
3118 + | #[derive(
|
3119 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3120 + | )]
|
3121 + | pub(crate) struct MaxRangeLong(pub(crate) i64);
|
3122 + | #[allow(dead_code)]
|
3123 + | impl MaxRangeLong {
|
3124 + | /// Returns an immutable reference to the underlying [`i64`].
|
3125 + | pub fn inner(&self) -> &i64 {
|
3126 + | &self.0
|
3127 + | }
|
3128 + |
|
3129 + | /// Consumes the value, returning the underlying [`i64`].
|
3130 + | pub fn into_inner(self) -> i64 {
|
3131 + | self.0
|
3132 + | }
|
3133 + | }
|
3134 + |
|
3135 + | impl crate::constrained::Constrained for MaxRangeLong {
|
3136 + | type Unconstrained = i64;
|
3137 + | }
|
3138 + |
|
3139 + | impl ::std::convert::From<i64>
|
3140 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>
|
3141 + | {
|
3142 + | fn from(value: i64) -> Self {
|
3143 + | Self::Unconstrained(value)
|
3144 + | }
|
3145 + | }
|
3146 + |
|
3147 + | impl ::std::fmt::Display for MaxRangeLong {
|
3148 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3149 + | self.0.fmt(f)
|
3150 + | }
|
3151 + | }
|
3152 + |
|
3153 + | impl ::std::convert::From<MaxRangeLong> for i64 {
|
3154 + | fn from(value: MaxRangeLong) -> Self {
|
3155 + | value.into_inner()
|
3156 + | }
|
3157 + | }
|
3158 + | impl MaxRangeLong {
|
3159 + | fn check_range(
|
3160 + | value: i64,
|
3161 + | ) -> ::std::result::Result<(), crate::model::max_range_long_internal::ConstraintViolation> {
|
3162 + | if value <= 11 {
|
3163 + | Ok(())
|
3164 + | } else {
|
3165 + | Err(crate::model::max_range_long_internal::ConstraintViolation::Range(value))
|
3166 + | }
|
3167 + | }
|
3168 + | }
|
3169 + | impl ::std::convert::TryFrom<i64> for MaxRangeLong {
|
3170 + | type Error = crate::model::max_range_long_internal::ConstraintViolation;
|
3171 + |
|
3172 + | /// Constructs a `MaxRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3173 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3174 + | Self::check_range(value)?;
|
3175 + |
|
3176 + | Ok(Self(value))
|
3177 + | }
|
3178 + | }
|
3179 + |
|
3180 + | #[allow(missing_docs)] // documentation missing in model
|
3181 + | ///
|
3182 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3183 + | /// [constraint traits]. Use [`MinRangeLong::try_from`] to construct values of this type.
|
3184 + | ///
|
3185 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3186 + | ///
|
3187 + | #[derive(
|
3188 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3189 + | )]
|
3190 + | pub(crate) struct MinRangeLong(pub(crate) i64);
|
3191 + | #[allow(dead_code)]
|
3192 + | impl MinRangeLong {
|
3193 + | /// Returns an immutable reference to the underlying [`i64`].
|
3194 + | pub fn inner(&self) -> &i64 {
|
3195 + | &self.0
|
3196 + | }
|
3197 + |
|
3198 + | /// Consumes the value, returning the underlying [`i64`].
|
3199 + | pub fn into_inner(self) -> i64 {
|
3200 + | self.0
|
3201 + | }
|
3202 + | }
|
3203 + |
|
3204 + | impl crate::constrained::Constrained for MinRangeLong {
|
3205 + | type Unconstrained = i64;
|
3206 + | }
|
3207 + |
|
3208 + | impl ::std::convert::From<i64>
|
3209 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeLong>
|
3210 + | {
|
3211 + | fn from(value: i64) -> Self {
|
3212 + | Self::Unconstrained(value)
|
3213 + | }
|
3214 + | }
|
3215 + |
|
3216 + | impl ::std::fmt::Display for MinRangeLong {
|
3217 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3218 + | self.0.fmt(f)
|
3219 + | }
|
3220 + | }
|
3221 + |
|
3222 + | impl ::std::convert::From<MinRangeLong> for i64 {
|
3223 + | fn from(value: MinRangeLong) -> Self {
|
3224 + | value.into_inner()
|
3225 + | }
|
3226 + | }
|
3227 + | impl MinRangeLong {
|
3228 + | fn check_range(
|
3229 + | value: i64,
|
3230 + | ) -> ::std::result::Result<(), crate::model::min_range_long_internal::ConstraintViolation> {
|
3231 + | if -10 <= value {
|
3232 + | Ok(())
|
3233 + | } else {
|
3234 + | Err(crate::model::min_range_long_internal::ConstraintViolation::Range(value))
|
3235 + | }
|
3236 + | }
|
3237 + | }
|
3238 + | impl ::std::convert::TryFrom<i64> for MinRangeLong {
|
3239 + | type Error = crate::model::min_range_long_internal::ConstraintViolation;
|
3240 + |
|
3241 + | /// Constructs a `MinRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3242 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3243 + | Self::check_range(value)?;
|
3244 + |
|
3245 + | Ok(Self(value))
|
3246 + | }
|
3247 + | }
|
3248 + |
|
3249 + | #[allow(missing_docs)] // documentation missing in model
|
3250 + | ///
|
3251 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3252 + | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
3253 + | ///
|
3254 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3255 + | ///
|
3256 + | #[derive(
|
3257 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3258 + | )]
|
3259 + | pub(crate) struct FixedValueShort(pub(crate) i16);
|
3260 + | #[allow(dead_code)]
|
3261 + | impl FixedValueShort {
|
3262 + | /// Returns an immutable reference to the underlying [`i16`].
|
3263 + | pub fn inner(&self) -> &i16 {
|
3264 + | &self.0
|
3265 + | }
|
3266 + |
|
3267 + | /// Consumes the value, returning the underlying [`i16`].
|
3268 + | pub fn into_inner(self) -> i16 {
|
3269 + | self.0
|
3270 + | }
|
3271 + | }
|
3272 + |
|
3273 + | impl crate::constrained::Constrained for FixedValueShort {
|
3274 + | type Unconstrained = i16;
|
3275 + | }
|
3276 + |
|
3277 + | impl ::std::convert::From<i16>
|
3278 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
3279 + | {
|
3280 + | fn from(value: i16) -> Self {
|
3281 + | Self::Unconstrained(value)
|
3282 + | }
|
3283 + | }
|
3284 + |
|
3285 + | impl ::std::fmt::Display for FixedValueShort {
|
3286 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3287 + | self.0.fmt(f)
|
3288 + | }
|
3289 + | }
|
3290 + |
|
3291 + | impl ::std::convert::From<FixedValueShort> for i16 {
|
3292 + | fn from(value: FixedValueShort) -> Self {
|
3293 + | value.into_inner()
|
3294 + | }
|
3295 + | }
|
3296 + | impl FixedValueShort {
|
3297 + | fn check_range(
|
3298 + | value: i16,
|
3299 + | ) -> ::std::result::Result<(), crate::model::fixed_value_short_internal::ConstraintViolation>
|
3300 + | {
|
3301 + | if (10..=10).contains(&value) {
|
3302 + | Ok(())
|
3303 + | } else {
|
3304 + | Err(crate::model::fixed_value_short_internal::ConstraintViolation::Range(value))
|
3305 + | }
|
3306 + | }
|
3307 + | }
|
3308 + | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
3309 + | type Error = crate::model::fixed_value_short_internal::ConstraintViolation;
|
3310 + |
|
3311 + | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3312 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3313 + | Self::check_range(value)?;
|
3314 + |
|
3315 + | Ok(Self(value))
|
3316 + | }
|
3317 + | }
|
3318 + |
|
3319 + | #[allow(missing_docs)] // documentation missing in model
|
3320 + | ///
|
3321 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3322 + | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
3323 + | ///
|
3324 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3325 + | ///
|
3326 + | #[derive(
|
3327 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3328 + | )]
|
3329 + | pub(crate) struct MaxRangeShort(pub(crate) i16);
|
3330 + | #[allow(dead_code)]
|
3331 + | impl MaxRangeShort {
|
3332 + | /// Returns an immutable reference to the underlying [`i16`].
|
3333 + | pub fn inner(&self) -> &i16 {
|
3334 + | &self.0
|
3335 + | }
|
3336 + |
|
3337 + | /// Consumes the value, returning the underlying [`i16`].
|
3338 + | pub fn into_inner(self) -> i16 {
|
3339 + | self.0
|
3340 + | }
|
3341 + | }
|
3342 + |
|
3343 + | impl crate::constrained::Constrained for MaxRangeShort {
|
3344 + | type Unconstrained = i16;
|
3345 + | }
|
3346 + |
|
3347 + | impl ::std::convert::From<i16>
|
3348 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
3349 + | {
|
3350 + | fn from(value: i16) -> Self {
|
3351 + | Self::Unconstrained(value)
|
3352 + | }
|
3353 + | }
|
3354 + |
|
3355 + | impl ::std::fmt::Display for MaxRangeShort {
|
3356 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3357 + | self.0.fmt(f)
|
3358 + | }
|
3359 + | }
|
3360 + |
|
3361 + | impl ::std::convert::From<MaxRangeShort> for i16 {
|
3362 + | fn from(value: MaxRangeShort) -> Self {
|
3363 + | value.into_inner()
|
3364 + | }
|
3365 + | }
|
3366 + | impl MaxRangeShort {
|
3367 + | fn check_range(
|
3368 + | value: i16,
|
3369 + | ) -> ::std::result::Result<(), crate::model::max_range_short_internal::ConstraintViolation>
|
3370 + | {
|
3371 + | if value <= 11 {
|
3372 + | Ok(())
|
3373 + | } else {
|
3374 + | Err(crate::model::max_range_short_internal::ConstraintViolation::Range(value))
|
3375 + | }
|
3376 + | }
|
3377 + | }
|
3378 + | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
3379 + | type Error = crate::model::max_range_short_internal::ConstraintViolation;
|
3380 + |
|
3381 + | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3382 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3383 + | Self::check_range(value)?;
|
3384 + |
|
3385 + | Ok(Self(value))
|
3386 + | }
|
3387 + | }
|
3388 + |
|
3389 + | #[allow(missing_docs)] // documentation missing in model
|
3390 + | ///
|
3391 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3392 + | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
3393 + | ///
|
3394 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3395 + | ///
|
3396 + | #[derive(
|
3397 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3398 + | )]
|
3399 + | pub(crate) struct MinRangeShort(pub(crate) i16);
|
3400 + | #[allow(dead_code)]
|
3401 + | impl MinRangeShort {
|
3402 + | /// Returns an immutable reference to the underlying [`i16`].
|
3403 + | pub fn inner(&self) -> &i16 {
|
3404 + | &self.0
|
3405 + | }
|
3406 + |
|
3407 + | /// Consumes the value, returning the underlying [`i16`].
|
3408 + | pub fn into_inner(self) -> i16 {
|
3409 + | self.0
|
3410 + | }
|
3411 + | }
|
3412 + |
|
3413 + | impl crate::constrained::Constrained for MinRangeShort {
|
3414 + | type Unconstrained = i16;
|
3415 + | }
|
3416 + |
|
3417 + | impl ::std::convert::From<i16>
|
3418 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
3419 + | {
|
3420 + | fn from(value: i16) -> Self {
|
3421 + | Self::Unconstrained(value)
|
3422 + | }
|
3423 + | }
|
3424 + |
|
3425 + | impl ::std::fmt::Display for MinRangeShort {
|
3426 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3427 + | self.0.fmt(f)
|
3428 + | }
|
3429 + | }
|
3430 + |
|
3431 + | impl ::std::convert::From<MinRangeShort> for i16 {
|
3432 + | fn from(value: MinRangeShort) -> Self {
|
3433 + | value.into_inner()
|
3434 + | }
|
3435 + | }
|
3436 + | impl MinRangeShort {
|
3437 + | fn check_range(
|
3438 + | value: i16,
|
3439 + | ) -> ::std::result::Result<(), crate::model::min_range_short_internal::ConstraintViolation>
|
3440 + | {
|
3441 + | if -10 <= value {
|
3442 + | Ok(())
|
3443 + | } else {
|
3444 + | Err(crate::model::min_range_short_internal::ConstraintViolation::Range(value))
|
3445 + | }
|
3446 + | }
|
3447 + | }
|
3448 + | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
3449 + | type Error = crate::model::min_range_short_internal::ConstraintViolation;
|
3450 + |
|
3451 + | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3452 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3453 + | Self::check_range(value)?;
|
3454 + |
|
3455 + | Ok(Self(value))
|
3456 + | }
|
3457 + | }
|
3458 + |
|
3459 + | #[allow(missing_docs)] // documentation missing in model
|
3460 + | ///
|
3461 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3462 + | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
3463 + | ///
|
3464 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3465 + | ///
|
3466 + | #[derive(
|
3467 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3468 + | )]
|
3469 + | pub(crate) struct FixedValueInteger(pub(crate) i32);
|
3470 + | #[allow(dead_code)]
|
3471 + | impl FixedValueInteger {
|
3472 + | /// Returns an immutable reference to the underlying [`i32`].
|
3473 + | pub fn inner(&self) -> &i32 {
|
3474 + | &self.0
|
3475 + | }
|
3476 + |
|
3477 + | /// Consumes the value, returning the underlying [`i32`].
|
3478 + | pub fn into_inner(self) -> i32 {
|
3479 + | self.0
|
3480 + | }
|
3481 + | }
|
3482 + |
|
3483 + | impl crate::constrained::Constrained for FixedValueInteger {
|
3484 + | type Unconstrained = i32;
|
3485 + | }
|
3486 + |
|
3487 + | impl ::std::convert::From<i32>
|
3488 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
3489 + | {
|
3490 + | fn from(value: i32) -> Self {
|
3491 + | Self::Unconstrained(value)
|
3492 + | }
|
3493 + | }
|
3494 + |
|
3495 + | impl ::std::fmt::Display for FixedValueInteger {
|
3496 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3497 + | self.0.fmt(f)
|
3498 + | }
|
3499 + | }
|
3500 + |
|
3501 + | impl ::std::convert::From<FixedValueInteger> for i32 {
|
3502 + | fn from(value: FixedValueInteger) -> Self {
|
3503 + | value.into_inner()
|
3504 + | }
|
3505 + | }
|
3506 + | impl FixedValueInteger {
|
3507 + | fn check_range(
|
3508 + | value: i32,
|
3509 + | ) -> ::std::result::Result<(), crate::model::fixed_value_integer_internal::ConstraintViolation>
|
3510 + | {
|
3511 + | if (69..=69).contains(&value) {
|
3512 + | Ok(())
|
3513 + | } else {
|
3514 + | Err(crate::model::fixed_value_integer_internal::ConstraintViolation::Range(value))
|
3515 + | }
|
3516 + | }
|
3517 + | }
|
3518 + | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
3519 + | type Error = crate::model::fixed_value_integer_internal::ConstraintViolation;
|
3520 + |
|
3521 + | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3522 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3523 + | Self::check_range(value)?;
|
3524 + |
|
3525 + | Ok(Self(value))
|
3526 + | }
|
3527 + | }
|
3528 + |
|
3529 + | #[allow(missing_docs)] // documentation missing in model
|
3530 + | ///
|
3531 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3532 + | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
3533 + | ///
|
3534 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3535 + | ///
|
3536 + | #[derive(
|
3537 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3538 + | )]
|
3539 + | pub(crate) struct MaxRangeInteger(pub(crate) i32);
|
3540 + | #[allow(dead_code)]
|
3541 + | impl MaxRangeInteger {
|
3542 + | /// Returns an immutable reference to the underlying [`i32`].
|
3543 + | pub fn inner(&self) -> &i32 {
|
3544 + | &self.0
|
3545 + | }
|
3546 + |
|
3547 + | /// Consumes the value, returning the underlying [`i32`].
|
3548 + | pub fn into_inner(self) -> i32 {
|
3549 + | self.0
|
3550 + | }
|
3551 + | }
|
3552 + |
|
3553 + | impl crate::constrained::Constrained for MaxRangeInteger {
|
3554 + | type Unconstrained = i32;
|
3555 + | }
|
3556 + |
|
3557 + | impl ::std::convert::From<i32>
|
3558 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
3559 + | {
|
3560 + | fn from(value: i32) -> Self {
|
3561 + | Self::Unconstrained(value)
|
3562 + | }
|
3563 + | }
|
3564 + |
|
3565 + | impl ::std::fmt::Display for MaxRangeInteger {
|
3566 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3567 + | self.0.fmt(f)
|
3568 + | }
|
3569 + | }
|
3570 + |
|
3571 + | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
3572 + | fn from(value: MaxRangeInteger) -> Self {
|
3573 + | value.into_inner()
|
3574 + | }
|
3575 + | }
|
3576 + | impl MaxRangeInteger {
|
3577 + | fn check_range(
|
3578 + | value: i32,
|
3579 + | ) -> ::std::result::Result<(), crate::model::max_range_integer_internal::ConstraintViolation>
|
3580 + | {
|
3581 + | if value <= 69 {
|
3582 + | Ok(())
|
3583 + | } else {
|
3584 + | Err(crate::model::max_range_integer_internal::ConstraintViolation::Range(value))
|
3585 + | }
|
3586 + | }
|
3587 + | }
|
3588 + | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
3589 + | type Error = crate::model::max_range_integer_internal::ConstraintViolation;
|
3590 + |
|
3591 + | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3592 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3593 + | Self::check_range(value)?;
|
3594 + |
|
3595 + | Ok(Self(value))
|
3596 + | }
|
3597 + | }
|
3598 + |
|
3599 + | #[allow(missing_docs)] // documentation missing in model
|
3600 + | ///
|
3601 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3602 + | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
3603 + | ///
|
3604 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3605 + | ///
|
3606 + | #[derive(
|
3607 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3608 + | )]
|
3609 + | pub(crate) struct MinRangeInteger(pub(crate) i32);
|
3610 + | #[allow(dead_code)]
|
3611 + | impl MinRangeInteger {
|
3612 + | /// Returns an immutable reference to the underlying [`i32`].
|
3613 + | pub fn inner(&self) -> &i32 {
|
3614 + | &self.0
|
3615 + | }
|
3616 + |
|
3617 + | /// Consumes the value, returning the underlying [`i32`].
|
3618 + | pub fn into_inner(self) -> i32 {
|
3619 + | self.0
|
3620 + | }
|
3621 + | }
|
3622 + |
|
3623 + | impl crate::constrained::Constrained for MinRangeInteger {
|
3624 + | type Unconstrained = i32;
|
3625 + | }
|
3626 + |
|
3627 + | impl ::std::convert::From<i32>
|
3628 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
3629 + | {
|
3630 + | fn from(value: i32) -> Self {
|
3631 + | Self::Unconstrained(value)
|
3632 + | }
|
3633 + | }
|
3634 + |
|
3635 + | impl ::std::fmt::Display for MinRangeInteger {
|
3636 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3637 + | self.0.fmt(f)
|
3638 + | }
|
3639 + | }
|
3640 + |
|
3641 + | impl ::std::convert::From<MinRangeInteger> for i32 {
|
3642 + | fn from(value: MinRangeInteger) -> Self {
|
3643 + | value.into_inner()
|
3644 + | }
|
3645 + | }
|
3646 + | impl MinRangeInteger {
|
3647 + | fn check_range(
|
3648 + | value: i32,
|
3649 + | ) -> ::std::result::Result<(), crate::model::min_range_integer_internal::ConstraintViolation>
|
3650 + | {
|
3651 + | if -10 <= value {
|
3652 + | Ok(())
|
3653 + | } else {
|
3654 + | Err(crate::model::min_range_integer_internal::ConstraintViolation::Range(value))
|
3655 + | }
|
3656 + | }
|
3657 + | }
|
3658 + | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
3659 + | type Error = crate::model::min_range_integer_internal::ConstraintViolation;
|
3660 + |
|
3661 + | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3662 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3663 + | Self::check_range(value)?;
|
3664 + |
|
3665 + | Ok(Self(value))
|
3666 + | }
|
3667 + | }
|
3668 + |
|
3669 + | #[allow(missing_docs)] // documentation missing in model
|
3670 + | ///
|
3671 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3672 + | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
3673 + | ///
|
3674 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3675 + | ///
|
3676 + | #[derive(
|
3677 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3678 + | )]
|
3679 + | pub(crate) struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3680 + | impl FixedLengthBlob {
|
3681 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3682 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3683 + | self.0
|
3684 + | }
|
3685 + | }
|
3686 + | impl FixedLengthBlob {
|
3687 + | fn check_length(
|
3688 + | blob: &::aws_smithy_types::Blob,
|
3689 + | ) -> ::std::result::Result<(), crate::model::fixed_length_blob_internal::ConstraintViolation>
|
3690 + | {
|
3691 + | let length = blob.as_ref().len();
|
3692 + |
|
3693 + | if (70..=70).contains(&length) {
|
3694 + | Ok(())
|
3695 + | } else {
|
3696 + | Err(crate::model::fixed_length_blob_internal::ConstraintViolation::Length(length))
|
3697 + | }
|
3698 + | }
|
3699 + | }
|
3700 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
3701 + | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
3702 + |
|
3703 + | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3704 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3705 + | Self::check_length(&value)?;
|
3706 + |
|
3707 + | Ok(Self(value))
|
3708 + | }
|
3709 + | }
|
3710 + | impl crate::constrained::Constrained for FixedLengthBlob {
|
3711 + | type Unconstrained = ::aws_smithy_types::Blob;
|
3712 + | }
|
3713 + |
|
3714 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3715 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
3716 + | {
|
3717 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3718 + | Self::Unconstrained(value)
|
3719 + | }
|
3720 + | }
|
3721 + |
|
3722 + | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
3723 + | fn from(value: FixedLengthBlob) -> Self {
|
3724 + | value.into_inner()
|
3725 + | }
|
3726 + | }
|
3727 + |
|
3728 + | #[allow(missing_docs)] // documentation missing in model
|
3729 + | ///
|
3730 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3731 + | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
3732 + | ///
|
3733 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3734 + | ///
|
3735 + | #[derive(
|
3736 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3737 + | )]
|
3738 + | pub(crate) struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3739 + | impl MaxLengthBlob {
|
3740 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3741 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3742 + | self.0
|
3743 + | }
|
3744 + | }
|
3745 + | impl MaxLengthBlob {
|
3746 + | fn check_length(
|
3747 + | blob: &::aws_smithy_types::Blob,
|
3748 + | ) -> ::std::result::Result<(), crate::model::max_length_blob_internal::ConstraintViolation>
|
3749 + | {
|
3750 + | let length = blob.as_ref().len();
|
3751 + |
|
3752 + | if length <= 70 {
|
3753 + | Ok(())
|
3754 + | } else {
|
3755 + | Err(crate::model::max_length_blob_internal::ConstraintViolation::Length(length))
|
3756 + | }
|
3757 + | }
|
3758 + | }
|
3759 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
3760 + | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
3761 + |
|
3762 + | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3763 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3764 + | Self::check_length(&value)?;
|
3765 + |
|
3766 + | Ok(Self(value))
|
3767 + | }
|
3768 + | }
|
3769 + | impl crate::constrained::Constrained for MaxLengthBlob {
|
3770 + | type Unconstrained = ::aws_smithy_types::Blob;
|
3771 + | }
|
3772 + |
|
3773 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3774 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
3775 + | {
|
3776 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3777 + | Self::Unconstrained(value)
|
3778 + | }
|
3779 + | }
|
3780 + |
|
3781 + | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
3782 + | fn from(value: MaxLengthBlob) -> Self {
|
3783 + | value.into_inner()
|
3784 + | }
|
3785 + | }
|
3786 + |
|
3787 + | #[allow(missing_docs)] // documentation missing in model
|
3788 + | ///
|
3789 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3790 + | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
3791 + | ///
|
3792 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3793 + | ///
|
3794 + | #[derive(
|
3795 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3796 + | )]
|
3797 + | pub(crate) struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3798 + | impl MinLengthBlob {
|
3799 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3800 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3801 + | self.0
|
3802 + | }
|
3803 + | }
|
3804 + | impl MinLengthBlob {
|
3805 + | fn check_length(
|
3806 + | blob: &::aws_smithy_types::Blob,
|
3807 + | ) -> ::std::result::Result<(), crate::model::min_length_blob_internal::ConstraintViolation>
|
3808 + | {
|
3809 + | let length = blob.as_ref().len();
|
3810 + |
|
3811 + | if 2 <= length {
|
3812 + | Ok(())
|
3813 + | } else {
|
3814 + | Err(crate::model::min_length_blob_internal::ConstraintViolation::Length(length))
|
3815 + | }
|
3816 + | }
|
3817 + | }
|
3818 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
3819 + | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
3820 + |
|
3821 + | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3822 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3823 + | Self::check_length(&value)?;
|
3824 + |
|
3825 + | Ok(Self(value))
|
3826 + | }
|
3827 + | }
|
3828 + | impl crate::constrained::Constrained for MinLengthBlob {
|
3829 + | type Unconstrained = ::aws_smithy_types::Blob;
|
3830 + | }
|
3831 + |
|
3832 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3833 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
3834 + | {
|
3835 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3836 + | Self::Unconstrained(value)
|
3837 + | }
|
3838 + | }
|
3839 + |
|
3840 + | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
3841 + | fn from(value: MinLengthBlob) -> Self {
|
3842 + | value.into_inner()
|
3843 + | }
|
3844 + | }
|
3845 + |
|
3846 + | #[allow(missing_docs)] // documentation missing in model
|
3847 + | ///
|
3848 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3849 + | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
3850 + | ///
|
3851 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3852 + | ///
|
3853 + | #[derive(
|
3854 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3855 + | )]
|
3856 + | pub(crate) struct FixedLengthString(pub(crate) ::std::string::String);
|
3857 + | #[allow(dead_code)]
|
3858 + | impl FixedLengthString {
|
3859 + | /// Extracts a string slice containing the entire underlying `String`.
|
3860 + | pub fn as_str(&self) -> &str {
|
3861 + | &self.0
|
3862 + | }
|
3863 + |
|
3864 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3865 + | pub fn inner(&self) -> &::std::string::String {
|
3866 + | &self.0
|
3867 + | }
|
3868 + |
|
3869 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3870 + | pub fn into_inner(self) -> ::std::string::String {
|
3871 + | self.0
|
3872 + | }
|
3873 + | }
|
3874 + | impl FixedLengthString {
|
3875 + | fn check_length(
|
3876 + | string: &str,
|
3877 + | ) -> ::std::result::Result<(), crate::model::fixed_length_string_internal::ConstraintViolation>
|
3878 + | {
|
3879 + | let length = string.chars().count();
|
3880 + |
|
3881 + | if (69..=69).contains(&length) {
|
3882 + | Ok(())
|
3883 + | } else {
|
3884 + | Err(crate::model::fixed_length_string_internal::ConstraintViolation::Length(length))
|
3885 + | }
|
3886 + | }
|
3887 + | }
|
3888 + | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
3889 + | type Error = crate::model::fixed_length_string_internal::ConstraintViolation;
|
3890 + |
|
3891 + | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3892 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3893 + | Self::check_length(&value)?;
|
3894 + |
|
3895 + | Ok(Self(value))
|
3896 + | }
|
3897 + | }
|
3898 + | impl crate::constrained::Constrained for FixedLengthString {
|
3899 + | type Unconstrained = ::std::string::String;
|
3900 + | }
|
3901 + |
|
3902 + | impl ::std::convert::From<::std::string::String>
|
3903 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
3904 + | {
|
3905 + | fn from(value: ::std::string::String) -> Self {
|
3906 + | Self::Unconstrained(value)
|
3907 + | }
|
3908 + | }
|
3909 + |
|
3910 + | impl ::std::fmt::Display for FixedLengthString {
|
3911 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3912 + | self.0.fmt(f)
|
3913 + | }
|
3914 + | }
|
3915 + |
|
3916 + | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
3917 + | fn from(value: FixedLengthString) -> Self {
|
3918 + | value.into_inner()
|
3919 + | }
|
3920 + | }
|
3921 + |
|
3922 + | #[allow(missing_docs)] // documentation missing in model
|
3923 + | ///
|
3924 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3925 + | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
3926 + | ///
|
3927 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3928 + | ///
|
3929 + | #[derive(
|
3930 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3931 + | )]
|
3932 + | pub(crate) struct MaxLengthString(pub(crate) ::std::string::String);
|
3933 + | #[allow(dead_code)]
|
3934 + | impl MaxLengthString {
|
3935 + | /// Extracts a string slice containing the entire underlying `String`.
|
3936 + | pub fn as_str(&self) -> &str {
|
3937 + | &self.0
|
3938 + | }
|
3939 + |
|
3940 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3941 + | pub fn inner(&self) -> &::std::string::String {
|
3942 + | &self.0
|
3943 + | }
|
3944 + |
|
3945 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3946 + | pub fn into_inner(self) -> ::std::string::String {
|
3947 + | self.0
|
3948 + | }
|
3949 + | }
|
3950 + | impl MaxLengthString {
|
3951 + | fn check_length(
|
3952 + | string: &str,
|
3953 + | ) -> ::std::result::Result<(), crate::model::max_length_string_internal::ConstraintViolation>
|
3954 + | {
|
3955 + | let length = string.chars().count();
|
3956 + |
|
3957 + | if length <= 69 {
|
3958 + | Ok(())
|
3959 + | } else {
|
3960 + | Err(crate::model::max_length_string_internal::ConstraintViolation::Length(length))
|
3961 + | }
|
3962 + | }
|
3963 + | }
|
3964 + | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
3965 + | type Error = crate::model::max_length_string_internal::ConstraintViolation;
|
3966 + |
|
3967 + | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3968 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3969 + | Self::check_length(&value)?;
|
3970 + |
|
3971 + | Ok(Self(value))
|
3972 + | }
|
3973 + | }
|
3974 + | impl crate::constrained::Constrained for MaxLengthString {
|
3975 + | type Unconstrained = ::std::string::String;
|
3976 + | }
|
3977 + |
|
3978 + | impl ::std::convert::From<::std::string::String>
|
3979 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
3980 + | {
|
3981 + | fn from(value: ::std::string::String) -> Self {
|
3982 + | Self::Unconstrained(value)
|
3983 + | }
|
3984 + | }
|
3985 + |
|
3986 + | impl ::std::fmt::Display for MaxLengthString {
|
3987 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3988 + | self.0.fmt(f)
|
3989 + | }
|
3990 + | }
|
3991 + |
|
3992 + | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
3993 + | fn from(value: MaxLengthString) -> Self {
|
3994 + | value.into_inner()
|
3995 + | }
|
3996 + | }
|
3997 + |
|
3998 + | #[allow(missing_docs)] // documentation missing in model
|
3999 + | ///
|
4000 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4001 + | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
4002 + | ///
|
4003 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4004 + | ///
|
4005 + | #[derive(
|
4006 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4007 + | )]
|
4008 + | pub(crate) struct MinLengthString(pub(crate) ::std::string::String);
|
4009 + | #[allow(dead_code)]
|
4010 + | impl MinLengthString {
|
4011 + | /// Extracts a string slice containing the entire underlying `String`.
|
4012 + | pub fn as_str(&self) -> &str {
|
4013 + | &self.0
|
4014 + | }
|
4015 + |
|
4016 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4017 + | pub fn inner(&self) -> &::std::string::String {
|
4018 + | &self.0
|
4019 + | }
|
4020 + |
|
4021 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4022 + | pub fn into_inner(self) -> ::std::string::String {
|
4023 + | self.0
|
4024 + | }
|
4025 + | }
|
4026 + | impl MinLengthString {
|
4027 + | fn check_length(
|
4028 + | string: &str,
|
4029 + | ) -> ::std::result::Result<(), crate::model::min_length_string_internal::ConstraintViolation>
|
4030 + | {
|
4031 + | let length = string.chars().count();
|
4032 + |
|
4033 + | if 2 <= length {
|
4034 + | Ok(())
|
4035 + | } else {
|
4036 + | Err(crate::model::min_length_string_internal::ConstraintViolation::Length(length))
|
4037 + | }
|
4038 + | }
|
4039 + | }
|
4040 + | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
4041 + | type Error = crate::model::min_length_string_internal::ConstraintViolation;
|
4042 + |
|
4043 + | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4044 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4045 + | Self::check_length(&value)?;
|
4046 + |
|
4047 + | Ok(Self(value))
|
4048 + | }
|
4049 + | }
|
4050 + | impl crate::constrained::Constrained for MinLengthString {
|
4051 + | type Unconstrained = ::std::string::String;
|
4052 + | }
|
4053 + |
|
4054 + | impl ::std::convert::From<::std::string::String>
|
4055 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
4056 + | {
|
4057 + | fn from(value: ::std::string::String) -> Self {
|
4058 + | Self::Unconstrained(value)
|
4059 + | }
|
4060 + | }
|
4061 + |
|
4062 + | impl ::std::fmt::Display for MinLengthString {
|
4063 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4064 + | self.0.fmt(f)
|
4065 + | }
|
4066 + | }
|
4067 + |
|
4068 + | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
4069 + | fn from(value: MinLengthString) -> Self {
|
4070 + | value.into_inner()
|
4071 + | }
|
4072 + | }
|
4073 + |
|
4074 + | #[allow(missing_docs)] // documentation missing in model
|
4075 + | #[derive(
|
4076 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4077 + | )]
|
4078 + | pub enum ConstrainedUnionInOutput {
|
4079 + | #[allow(missing_docs)] // documentation missing in model
|
4080 + | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
4081 + | }
|
4082 + | impl ConstrainedUnionInOutput {
|
4083 + | #[allow(irrefutable_let_patterns)]
|
4084 + | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4085 + | /// Returns `Err(&Self)` if it can't be converted.
|
4086 + | pub fn as_structure(
|
4087 + | &self,
|
4088 + | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
4089 + | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
4090 + | ::std::result::Result::Ok(val)
|
4091 + | } else {
|
4092 + | ::std::result::Result::Err(self)
|
4093 + | }
|
4094 + | }
|
4095 + | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
4096 + | pub fn is_structure(&self) -> bool {
|
4097 + | self.as_structure().is_ok()
|
4098 + | }
|
4099 + | }
|
4100 + |
|
4101 + | #[allow(missing_docs)] // documentation missing in model
|
4102 + | #[derive(
|
4103 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4104 + | )]
|
4105 + | pub struct TransitivelyConstrainedStructureInOutput {
|
4106 + | #[allow(missing_docs)] // documentation missing in model
|
4107 + | pub length_string: ::std::option::Option<::std::string::String>,
|
4108 + | }
|
4109 + | impl TransitivelyConstrainedStructureInOutput {
|
4110 + | #[allow(missing_docs)] // documentation missing in model
|
4111 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
4112 + | self.length_string.as_deref()
|
4113 + | }
|
4114 + | }
|
4115 + | impl TransitivelyConstrainedStructureInOutput {
|
4116 + | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4117 + | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4118 + | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
4119 + | }
|
4120 + | }
|
4121 + |
|
4122 + | #[allow(missing_docs)] // documentation missing in model
|
4123 + | ///
|
4124 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4125 + | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
4126 + | ///
|
4127 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4128 + | ///
|
4129 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4130 + | pub(crate) struct ConstrainedMapInOutput(
|
4131 + | pub(crate) ::std::collections::HashMap<
|
4132 + | ::std::string::String,
|
4133 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
4134 + | >,
|
4135 + | );
|
4136 + | impl ConstrainedMapInOutput {
|
4137 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
4138 + | pub fn into_inner(
|
4139 + | self,
|
4140 + | ) -> ::std::collections::HashMap<
|
4141 + | ::std::string::String,
|
4142 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
4143 + | > {
|
4144 + | self.0
|
4145 + | }
|
4146 + | }
|
4147 + | impl
|
4148 + | ::std::convert::TryFrom<
|
4149 + | ::std::collections::HashMap<
|
4150 + | ::std::string::String,
|
4151 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
4152 + | >,
|
4153 + | > for ConstrainedMapInOutput
|
4154 + | {
|
4155 + | type Error = crate::model::constrained_map_in_output_internal::ConstraintViolation;
|
4156 + |
|
4157 + | /// Constructs a `ConstrainedMapInOutput` from an [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
4158 + | fn try_from(
|
4159 + | value: ::std::collections::HashMap<
|
4160 + | ::std::string::String,
|
4161 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
4162 + | >,
|
4163 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4164 + | let length = value.len();
|
4165 + | if 69 <= length {
|
4166 + | Ok(Self(value))
|
4167 + | } else {
|
4168 + | Err(
|
4169 + | crate::model::constrained_map_in_output_internal::ConstraintViolation::Length(
|
4170 + | length,
|
4171 + | ),
|
4172 + | )
|
4173 + | }
|
4174 + | }
|
4175 + | }
|
4176 + |
|
4177 + | impl ::std::convert::From<ConstrainedMapInOutput>
|
4178 + | for ::std::collections::HashMap<
|
4179 + | ::std::string::String,
|
4180 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
4181 + | >
|
4182 + | {
|
4183 + | fn from(value: ConstrainedMapInOutput) -> Self {
|
4184 + | value.into_inner()
|
4185 + | }
|
4186 + | }
|
4187 + |
|
4188 + | #[allow(missing_docs)] // documentation missing in model
|
4189 + | ///
|
4190 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4191 + | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
4192 + | ///
|
4193 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4194 + | ///
|
4195 + | #[derive(
|
4196 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4197 + | )]
|
4198 + | pub(crate) struct ConstrainedListInOutput(
|
4199 + | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4200 + | );
|
4201 + | impl ConstrainedListInOutput {
|
4202 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
4203 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
4204 + | self.0
|
4205 + | }
|
4206 + |
|
4207 + | fn check_length(
|
4208 + | length: usize,
|
4209 + | ) -> ::std::result::Result<
|
4210 + | (),
|
4211 + | crate::model::constrained_list_in_output_internal::ConstraintViolation,
|
4212 + | > {
|
4213 + | if 69 <= length {
|
4214 + | Ok(())
|
4215 + | } else {
|
4216 + | Err(
|
4217 + | crate::model::constrained_list_in_output_internal::ConstraintViolation::Length(
|
4218 + | length,
|
4219 + | ),
|
4220 + | )
|
4221 + | }
|
4222 + | }
|
4223 + | }
|
4224 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
4225 + | for ConstrainedListInOutput
|
4226 + | {
|
4227 + | type Error = crate::model::constrained_list_in_output_internal::ConstraintViolation;
|
4228 + |
|
4229 + | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
4230 + | fn try_from(
|
4231 + | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4232 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4233 + | Self::check_length(value.len())?;
|
4234 + |
|
4235 + | Ok(Self(value))
|
4236 + | }
|
4237 + | }
|
4238 + |
|
4239 + | impl ::std::convert::From<ConstrainedListInOutput>
|
4240 + | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
4241 + | {
|
4242 + | fn from(value: ConstrainedListInOutput) -> Self {
|
4243 + | value.into_inner()
|
4244 + | }
|
4245 + | }
|
4246 + |
|
4247 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4248 + | pub mod validation_exception_field {
|
4249 + |
|
4250 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4251 + | /// Holds one variant for each of the ways the builder can fail.
|
4252 + | #[allow(clippy::enum_variant_names)]
|
4253 + | pub enum ConstraintViolation {
|
4254 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
4255 + | MissingPath,
|
4256 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
4257 + | MissingMessage,
|
4258 + | }
|
4259 + | impl ::std::fmt::Display for ConstraintViolation {
|
4260 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4261 + | match self {
|
4262 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
4263 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4264 + | }
|
4265 + | }
|
4266 + | }
|
4267 + | impl ::std::error::Error for ConstraintViolation {}
|
4268 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
4269 + | type Error = ConstraintViolation;
|
4270 + |
|
4271 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4272 + | builder.build()
|
4273 + | }
|
4274 + | }
|
4275 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4276 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4277 + | pub struct Builder {
|
4278 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
4279 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
4280 + | }
|
4281 + | impl Builder {
|
4282 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4283 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
4284 + | self.path = Some(input);
|
4285 + | self
|
4286 + | }
|
4287 + | /// A detailed description of the validation failure.
|
4288 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
4289 + | self.message = Some(input);
|
4290 + | self
|
4291 + | }
|
4292 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4293 + | ///
|
4294 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
4295 + | ///
|
4296 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4297 + | self.build_enforcing_required_and_enum_traits()
|
4298 + | }
|
4299 + | fn build_enforcing_required_and_enum_traits(
|
4300 + | self,
|
4301 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4302 + | Ok(crate::model::ValidationExceptionField {
|
4303 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
4304 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
4305 + | })
|
4306 + | }
|
4307 + | }
|
4308 + | }
|
4309 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4310 + | pub(crate) mod event_stream_regular_message_internal {
|
4311 + |
|
4312 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
4313 + | fn from(builder: Builder) -> Self {
|
4314 + | builder.build()
|
4315 + | }
|
4316 + | }
|
4317 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4318 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4319 + | pub(crate) struct Builder {
|
4320 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
4321 + | }
|
4322 + | impl Builder {
|
4323 + | #[allow(missing_docs)] // documentation missing in model
|
4324 + | pub(crate) fn set_message_content(
|
4325 + | mut self,
|
4326 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4327 + | ) -> Self {
|
4328 + | self.message_content = input.map(|v| v.into());
|
4329 + | self
|
4330 + | }
|
4331 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4332 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
4333 + | self.build_enforcing_all_constraints()
|
4334 + | }
|
4335 + | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
4336 + | crate::model::EventStreamRegularMessage {
|
4337 + | message_content: self.message_content,
|
4338 + | }
|
4339 + | }
|
4340 + | }
|
4341 + | }
|
4342 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4343 + | pub mod event_stream_regular_message {
|
4344 + |
|
4345 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
4346 + | fn from(builder: Builder) -> Self {
|
4347 + | builder.build()
|
4348 + | }
|
4349 + | }
|
4350 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4351 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4352 + | pub struct Builder {
|
4353 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
4354 + | }
|
4355 + | impl Builder {
|
4356 + | #[allow(missing_docs)] // documentation missing in model
|
4357 + | pub fn message_content(
|
4358 + | mut self,
|
4359 + | input: ::std::option::Option<::std::string::String>,
|
4360 + | ) -> Self {
|
4361 + | self.message_content = input;
|
4362 + | self
|
4363 + | }
|
4364 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4365 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
4366 + | self.build_enforcing_required_and_enum_traits()
|
4367 + | }
|
4368 + | fn build_enforcing_required_and_enum_traits(
|
4369 + | self,
|
4370 + | ) -> crate::model::EventStreamRegularMessage {
|
4371 + | crate::model::EventStreamRegularMessage {
|
4372 + | message_content: self.message_content,
|
4373 + | }
|
4374 + | }
|
4375 + | }
|
4376 + | }
|
4377 + | pub(crate) mod map_of_enum_string_internal {
|
4378 + |
|
4379 + | #[allow(clippy::enum_variant_names)]
|
4380 + | #[derive(Debug, PartialEq)]
|
4381 + | pub(crate) enum ConstraintViolation {
|
4382 + | #[doc(hidden)]
|
4383 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
4384 + | #[doc(hidden)]
|
4385 + | Value(
|
4386 + | crate::model::EnumString,
|
4387 + | crate::model::enum_string_internal::ConstraintViolation,
|
4388 + | ),
|
4389 + | }
|
4390 + |
|
4391 + | impl ::std::fmt::Display for ConstraintViolation {
|
4392 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4393 + | match self {
|
4394 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4395 + | Self::Value(_, value_constraint_violation) => {
|
4396 + | write!(f, "{}", value_constraint_violation)
|
4397 + | }
|
4398 + | }
|
4399 + | }
|
4400 + | }
|
4401 + |
|
4402 + | impl ::std::error::Error for ConstraintViolation {}
|
4403 + | impl ConstraintViolation {
|
4404 + | pub(crate) fn as_validation_exception_field(
|
4405 + | self,
|
4406 + | path: ::std::string::String,
|
4407 + | ) -> crate::model::ValidationExceptionField {
|
4408 + | match self {
|
4409 + | Self::Key(key_constraint_violation) => {
|
4410 + | key_constraint_violation.as_validation_exception_field(path)
|
4411 + | }
|
4412 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4413 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4414 + | }
|
4415 + | }
|
4416 + | }
|
4417 + | }
|
4418 + | pub(crate) mod con_b_map_internal {
|
4419 + |
|
4420 + | #[allow(clippy::enum_variant_names)]
|
4421 + | #[derive(Debug, PartialEq)]
|
4422 + | pub(crate) enum ConstraintViolation {
|
4423 + | Length(usize),
|
4424 + |
|
4425 + | #[doc(hidden)]
|
4426 + | Value(
|
4427 + | ::std::string::String,
|
4428 + | crate::model::length_string_internal::ConstraintViolation,
|
4429 + | ),
|
4430 + | }
|
4431 + |
|
4432 + | impl ::std::fmt::Display for ConstraintViolation {
|
4433 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4434 + | match self {
|
4435 + | Self::Length(length) => {
|
4436 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConBMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
4437 + | }
|
4438 + |
|
4439 + | Self::Value(_, value_constraint_violation) => {
|
4440 + | write!(f, "{}", value_constraint_violation)
|
4441 + | }
|
4442 + | }
|
4443 + | }
|
4444 + | }
|
4445 + |
|
4446 + | impl ::std::error::Error for ConstraintViolation {}
|
4447 + | impl ConstraintViolation {
|
4448 + | pub(crate) fn as_validation_exception_field(
|
4449 + | self,
|
4450 + | path: ::std::string::String,
|
4451 + | ) -> crate::model::ValidationExceptionField {
|
4452 + | match self {
|
4453 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
4454 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
4455 + | path,
|
4456 + | },
|
4457 + | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
4458 + | }
|
4459 + | }
|
4460 + | }
|
4461 + | }
|
4462 + | pub(crate) mod length_string_internal {
|
4463 + |
|
4464 + | #[derive(Debug, PartialEq)]
|
4465 + | pub enum ConstraintViolation {
|
4466 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
4467 + | Length(usize),
|
4468 + | }
|
4469 + |
|
4470 + | impl ::std::fmt::Display for ConstraintViolation {
|
4471 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4472 + | let message = match self {
|
4473 + | Self::Length(length) => {
|
4474 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
4475 + | }
|
4476 + | };
|
4477 + | write!(f, "{message}")
|
4478 + | }
|
4479 + | }
|
4480 + |
|
4481 + | impl ::std::error::Error for ConstraintViolation {}
|
4482 + | impl ConstraintViolation {
|
4483 + | pub(crate) fn as_validation_exception_field(
|
4484 + | self,
|
4485 + | path: ::std::string::String,
|
4486 + | ) -> crate::model::ValidationExceptionField {
|
4487 + | match self {
|
4488 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
4489 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
4490 + | path,
|
4491 + | },
|
4492 + | }
|
4493 + | }
|
4494 + | }
|
4495 + | }
|
4496 + | pub(crate) mod map_of_list_of_length_pattern_string_internal {
|
4497 + |
|
4498 + | #[allow(clippy::enum_variant_names)]
|
4499 + | #[derive(Debug, PartialEq)]
|
4500 + | pub(crate) enum ConstraintViolation {
|
4501 + | #[doc(hidden)]
|
4502 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
4503 + | #[doc(hidden)]
|
4504 + | Value(
|
4505 + | crate::model::LengthPatternString,
|
4506 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
4507 + | ),
|
4508 + | }
|
4509 + |
|
4510 + | impl ::std::fmt::Display for ConstraintViolation {
|
4511 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4512 + | match self {
|
4513 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4514 + | Self::Value(_, value_constraint_violation) => {
|
4515 + | write!(f, "{}", value_constraint_violation)
|
4516 + | }
|
4517 + | }
|
4518 + | }
|
4519 + | }
|
4520 + |
|
4521 + | impl ::std::error::Error for ConstraintViolation {}
|
4522 + | impl ConstraintViolation {
|
4523 + | pub(crate) fn as_validation_exception_field(
|
4524 + | self,
|
4525 + | path: ::std::string::String,
|
4526 + | ) -> crate::model::ValidationExceptionField {
|
4527 + | match self {
|
4528 + | Self::Key(key_constraint_violation) => {
|
4529 + | key_constraint_violation.as_validation_exception_field(path)
|
4530 + | }
|
4531 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4532 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4533 + | }
|
4534 + | }
|
4535 + | }
|
4536 + | }
|
4537 + | pub(crate) mod list_of_length_pattern_string_internal {
|
4538 + |
|
4539 + | #[allow(clippy::enum_variant_names)]
|
4540 + | #[derive(Debug, PartialEq)]
|
4541 + | pub(crate) enum ConstraintViolation {
|
4542 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4543 + | /// The first component of the tuple is the index in the collection where the
|
4544 + | /// first constraint violation was found.
|
4545 + | #[doc(hidden)]
|
4546 + | Member(
|
4547 + | usize,
|
4548 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4549 + | ),
|
4550 + | }
|
4551 + |
|
4552 + | impl ::std::fmt::Display for ConstraintViolation {
|
4553 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4554 + | let message = match self {
|
4555 + | Self::Member(index, failing_member) => format!(
|
4556 + | "Value at index {index} failed to satisfy constraint. {}",
|
4557 + | failing_member
|
4558 + | ),
|
4559 + | };
|
4560 + | write!(f, "{message}")
|
4561 + | }
|
4562 + | }
|
4563 + |
|
4564 + | impl ::std::error::Error for ConstraintViolation {}
|
4565 + | impl ConstraintViolation {
|
4566 + | pub(crate) fn as_validation_exception_field(
|
4567 + | self,
|
4568 + | path: ::std::string::String,
|
4569 + | ) -> crate::model::ValidationExceptionField {
|
4570 + | match self {
|
4571 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4572 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4573 + | }
|
4574 + | }
|
4575 + | }
|
4576 + | }
|
4577 + | pub(crate) mod length_pattern_string_internal {
|
4578 + |
|
4579 + | #[derive(Debug, PartialEq)]
|
4580 + | pub enum ConstraintViolation {
|
4581 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
4582 + | Length(usize),
|
4583 + | /// Error when a string doesn't satisfy its `@pattern`.
|
4584 + | /// Contains the String that failed the pattern.
|
4585 + | Pattern(String),
|
4586 + | }
|
4587 + |
|
4588 + | impl ::std::fmt::Display for ConstraintViolation {
|
4589 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4590 + | let message = match self {
|
4591 + | Self::Length(length) => {
|
4592 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
4593 + | }
|
4594 + | Self::Pattern(_) => {
|
4595 + | format!(
|
4596 + | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4597 + | r#"[a-f0-5]*"#
|
4598 + | )
|
4599 + | }
|
4600 + | };
|
4601 + | write!(f, "{message}")
|
4602 + | }
|
4603 + | }
|
4604 + |
|
4605 + | impl ::std::error::Error for ConstraintViolation {}
|
4606 + | impl ConstraintViolation {
|
4607 + | pub(crate) fn as_validation_exception_field(
|
4608 + | self,
|
4609 + | path: ::std::string::String,
|
4610 + | ) -> crate::model::ValidationExceptionField {
|
4611 + | match self {
|
4612 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
4613 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
4614 + | path,
|
4615 + | },
|
4616 + |
|
4617 + | #[allow(unused_variables)]
|
4618 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4619 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
4620 + | path
|
4621 + | },
|
4622 + | }
|
4623 + | }
|
4624 + | }
|
4625 + | }
|
4626 + | pub(crate) mod map_of_length_pattern_string_internal {
|
4627 + |
|
4628 + | #[allow(clippy::enum_variant_names)]
|
4629 + | #[derive(Debug, PartialEq)]
|
4630 + | pub(crate) enum ConstraintViolation {
|
4631 + | #[doc(hidden)]
|
4632 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
4633 + | #[doc(hidden)]
|
4634 + | Value(
|
4635 + | crate::model::LengthPatternString,
|
4636 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4637 + | ),
|
4638 + | }
|
4639 + |
|
4640 + | impl ::std::fmt::Display for ConstraintViolation {
|
4641 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4642 + | match self {
|
4643 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4644 + | Self::Value(_, value_constraint_violation) => {
|
4645 + | write!(f, "{}", value_constraint_violation)
|
4646 + | }
|
4647 + | }
|
4648 + | }
|
4649 + | }
|
4650 + |
|
4651 + | impl ::std::error::Error for ConstraintViolation {}
|
4652 + | impl ConstraintViolation {
|
4653 + | pub(crate) fn as_validation_exception_field(
|
4654 + | self,
|
4655 + | path: ::std::string::String,
|
4656 + | ) -> crate::model::ValidationExceptionField {
|
4657 + | match self {
|
4658 + | Self::Key(key_constraint_violation) => {
|
4659 + | key_constraint_violation.as_validation_exception_field(path)
|
4660 + | }
|
4661 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4662 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4663 + | }
|
4664 + | }
|
4665 + | }
|
4666 + | }
|
4667 + | pub(crate) mod map_of_list_of_pattern_string_internal {
|
4668 + |
|
4669 + | #[allow(clippy::enum_variant_names)]
|
4670 + | #[derive(Debug, PartialEq)]
|
4671 + | pub(crate) enum ConstraintViolation {
|
4672 + | #[doc(hidden)]
|
4673 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4674 + | #[doc(hidden)]
|
4675 + | Value(
|
4676 + | crate::model::PatternString,
|
4677 + | crate::model::list_of_pattern_string_internal::ConstraintViolation,
|
4678 + | ),
|
4679 + | }
|
4680 + |
|
4681 + | impl ::std::fmt::Display for ConstraintViolation {
|
4682 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4683 + | match self {
|
4684 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4685 + | Self::Value(_, value_constraint_violation) => {
|
4686 + | write!(f, "{}", value_constraint_violation)
|
4687 + | }
|
4688 + | }
|
4689 + | }
|
4690 + | }
|
4691 + |
|
4692 + | impl ::std::error::Error for ConstraintViolation {}
|
4693 + | impl ConstraintViolation {
|
4694 + | pub(crate) fn as_validation_exception_field(
|
4695 + | self,
|
4696 + | path: ::std::string::String,
|
4697 + | ) -> crate::model::ValidationExceptionField {
|
4698 + | match self {
|
4699 + | Self::Key(key_constraint_violation) => {
|
4700 + | key_constraint_violation.as_validation_exception_field(path)
|
4701 + | }
|
4702 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4703 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4704 + | }
|
4705 + | }
|
4706 + | }
|
4707 + | }
|
4708 + | pub(crate) mod list_of_pattern_string_internal {
|
4709 + |
|
4710 + | #[allow(clippy::enum_variant_names)]
|
4711 + | #[derive(Debug, PartialEq)]
|
4712 + | pub(crate) enum ConstraintViolation {
|
4713 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4714 + | /// The first component of the tuple is the index in the collection where the
|
4715 + | /// first constraint violation was found.
|
4716 + | #[doc(hidden)]
|
4717 + | Member(
|
4718 + | usize,
|
4719 + | crate::model::pattern_string_internal::ConstraintViolation,
|
4720 + | ),
|
4721 + | }
|
4722 + |
|
4723 + | impl ::std::fmt::Display for ConstraintViolation {
|
4724 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4725 + | let message = match self {
|
4726 + | Self::Member(index, failing_member) => format!(
|
4727 + | "Value at index {index} failed to satisfy constraint. {}",
|
4728 + | failing_member
|
4729 + | ),
|
4730 + | };
|
4731 + | write!(f, "{message}")
|
4732 + | }
|
4733 + | }
|
4734 + |
|
4735 + | impl ::std::error::Error for ConstraintViolation {}
|
4736 + | impl ConstraintViolation {
|
4737 + | pub(crate) fn as_validation_exception_field(
|
4738 + | self,
|
4739 + | path: ::std::string::String,
|
4740 + | ) -> crate::model::ValidationExceptionField {
|
4741 + | match self {
|
4742 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4743 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4744 + | }
|
4745 + | }
|
4746 + | }
|
4747 + | }
|
4748 + | pub(crate) mod pattern_string_internal {
|
4749 + |
|
4750 + | #[derive(Debug, PartialEq)]
|
4751 + | pub enum ConstraintViolation {
|
4752 + | /// Error when a string doesn't satisfy its `@pattern`.
|
4753 + | /// Contains the String that failed the pattern.
|
4754 + | Pattern(String),
|
4755 + | }
|
4756 + |
|
4757 + | impl ::std::fmt::Display for ConstraintViolation {
|
4758 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4759 + | let message = match self {
|
4760 + | Self::Pattern(_) => {
|
4761 + | format!(
|
4762 + | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4763 + | r#"[a-d]{5}"#
|
4764 + | )
|
4765 + | }
|
4766 + | };
|
4767 + | write!(f, "{message}")
|
4768 + | }
|
4769 + | }
|
4770 + |
|
4771 + | impl ::std::error::Error for ConstraintViolation {}
|
4772 + | impl ConstraintViolation {
|
4773 + | pub(crate) fn as_validation_exception_field(
|
4774 + | self,
|
4775 + | path: ::std::string::String,
|
4776 + | ) -> crate::model::ValidationExceptionField {
|
4777 + | match self {
|
4778 + | #[allow(unused_variables)]
|
4779 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4780 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
4781 + | path
|
4782 + | },
|
4783 + | }
|
4784 + | }
|
4785 + | }
|
4786 + | }
|
4787 + | pub(crate) mod map_of_pattern_string_internal {
|
4788 + |
|
4789 + | #[allow(clippy::enum_variant_names)]
|
4790 + | #[derive(Debug, PartialEq)]
|
4791 + | pub(crate) enum ConstraintViolation {
|
4792 + | #[doc(hidden)]
|
4793 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4794 + | #[doc(hidden)]
|
4795 + | Value(
|
4796 + | crate::model::PatternString,
|
4797 + | crate::model::pattern_string_internal::ConstraintViolation,
|
4798 + | ),
|
4799 + | }
|
4800 + |
|
4801 + | impl ::std::fmt::Display for ConstraintViolation {
|
4802 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4803 + | match self {
|
4804 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4805 + | Self::Value(_, value_constraint_violation) => {
|
4806 + | write!(f, "{}", value_constraint_violation)
|
4807 + | }
|
4808 + | }
|
4809 + | }
|
4810 + | }
|
4811 + |
|
4812 + | impl ::std::error::Error for ConstraintViolation {}
|
4813 + | impl ConstraintViolation {
|
4814 + | pub(crate) fn as_validation_exception_field(
|
4815 + | self,
|
4816 + | path: ::std::string::String,
|
4817 + | ) -> crate::model::ValidationExceptionField {
|
4818 + | match self {
|
4819 + | Self::Key(key_constraint_violation) => {
|
4820 + | key_constraint_violation.as_validation_exception_field(path)
|
4821 + | }
|
4822 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4823 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4824 + | }
|
4825 + | }
|
4826 + | }
|
4827 + | }
|
4828 + | pub(crate) mod map_of_list_of_enum_string_internal {
|
4829 + |
|
4830 + | #[allow(clippy::enum_variant_names)]
|
4831 + | #[derive(Debug, PartialEq)]
|
4832 + | pub(crate) enum ConstraintViolation {
|
4833 + | #[doc(hidden)]
|
4834 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
4835 + | #[doc(hidden)]
|
4836 + | Value(
|
4837 + | crate::model::EnumString,
|
4838 + | crate::model::list_of_enum_string_internal::ConstraintViolation,
|
4839 + | ),
|
4840 + | }
|
4841 + |
|
4842 + | impl ::std::fmt::Display for ConstraintViolation {
|
4843 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4844 + | match self {
|
4845 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4846 + | Self::Value(_, value_constraint_violation) => {
|
4847 + | write!(f, "{}", value_constraint_violation)
|
4848 + | }
|
4849 + | }
|
4850 + | }
|
4851 + | }
|
4852 + |
|
4853 + | impl ::std::error::Error for ConstraintViolation {}
|
4854 + | impl ConstraintViolation {
|
4855 + | pub(crate) fn as_validation_exception_field(
|
4856 + | self,
|
4857 + | path: ::std::string::String,
|
4858 + | ) -> crate::model::ValidationExceptionField {
|
4859 + | match self {
|
4860 + | Self::Key(key_constraint_violation) => {
|
4861 + | key_constraint_violation.as_validation_exception_field(path)
|
4862 + | }
|
4863 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4864 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4865 + | }
|
4866 + | }
|
4867 + | }
|
4868 + | }
|
4869 + | pub(crate) mod list_of_enum_string_internal {
|
4870 + |
|
4871 + | #[allow(clippy::enum_variant_names)]
|
4872 + | #[derive(Debug, PartialEq)]
|
4873 + | pub(crate) enum ConstraintViolation {
|
4874 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4875 + | /// The first component of the tuple is the index in the collection where the
|
4876 + | /// first constraint violation was found.
|
4877 + | #[doc(hidden)]
|
4878 + | Member(
|
4879 + | usize,
|
4880 + | crate::model::enum_string_internal::ConstraintViolation,
|
4881 + | ),
|
4882 + | }
|
4883 + |
|
4884 + | impl ::std::fmt::Display for ConstraintViolation {
|
4885 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4886 + | let message = match self {
|
4887 + | Self::Member(index, failing_member) => format!(
|
4888 + | "Value at index {index} failed to satisfy constraint. {}",
|
4889 + | failing_member
|
4890 + | ),
|
4891 + | };
|
4892 + | write!(f, "{message}")
|
4893 + | }
|
4894 + | }
|
4895 + |
|
4896 + | impl ::std::error::Error for ConstraintViolation {}
|
4897 + | impl ConstraintViolation {
|
4898 + | pub(crate) fn as_validation_exception_field(
|
4899 + | self,
|
4900 + | path: ::std::string::String,
|
4901 + | ) -> crate::model::ValidationExceptionField {
|
4902 + | match self {
|
4903 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4904 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4905 + | }
|
4906 + | }
|
4907 + | }
|
4908 + | }
|
4909 + | pub(crate) mod map_of_length_list_of_pattern_string_internal {
|
4910 + |
|
4911 + | #[allow(clippy::enum_variant_names)]
|
4912 + | #[derive(Debug, PartialEq)]
|
4913 + | pub(crate) enum ConstraintViolation {
|
4914 + | #[doc(hidden)]
|
4915 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4916 + | #[doc(hidden)]
|
4917 + | Value(
|
4918 + | crate::model::PatternString,
|
4919 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
4920 + | ),
|
4921 + | }
|
4922 + |
|
4923 + | impl ::std::fmt::Display for ConstraintViolation {
|
4924 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4925 + | match self {
|
4926 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4927 + | Self::Value(_, value_constraint_violation) => {
|
4928 + | write!(f, "{}", value_constraint_violation)
|
4929 + | }
|
4930 + | }
|
4931 + | }
|
4932 + | }
|
4933 + |
|
4934 + | impl ::std::error::Error for ConstraintViolation {}
|
4935 + | impl ConstraintViolation {
|
4936 + | pub(crate) fn as_validation_exception_field(
|
4937 + | self,
|
4938 + | path: ::std::string::String,
|
4939 + | ) -> crate::model::ValidationExceptionField {
|
4940 + | match self {
|
4941 + | Self::Key(key_constraint_violation) => {
|
4942 + | key_constraint_violation.as_validation_exception_field(path)
|
4943 + | }
|
4944 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4945 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4946 + | }
|
4947 + | }
|
4948 + | }
|
4949 + | }
|
4950 + | pub(crate) mod length_list_of_pattern_string_internal {
|
4951 + |
|
4952 + | #[allow(clippy::enum_variant_names)]
|
4953 + | #[derive(Debug, PartialEq)]
|
4954 + | pub(crate) enum ConstraintViolation {
|
4955 + | /// Constraint violation error when the list doesn't have the required length
|
4956 + | Length(usize),
|
4957 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4958 + | /// The first component of the tuple is the index in the collection where the
|
4959 + | /// first constraint violation was found.
|
4960 + | #[doc(hidden)]
|
4961 + | Member(
|
4962 + | usize,
|
4963 + | crate::model::pattern_string_internal::ConstraintViolation,
|
4964 + | ),
|
4965 + | }
|
4966 + |
|
4967 + | impl ::std::fmt::Display for ConstraintViolation {
|
4968 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4969 + | let message = match self {
|
4970 + | Self::Length(length) => {
|
4971 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
4972 + | }
|
4973 + | Self::Member(index, failing_member) => format!(
|
4974 + | "Value at index {index} failed to satisfy constraint. {}",
|
4975 + | failing_member
|
4976 + | ),
|
4977 + | };
|
4978 + | write!(f, "{message}")
|
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 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
4990 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
4991 + | path,
|
4992 + | },
|
4993 + | Self::Member(index, member_constraint_violation) =>
|
4994 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4995 + | }
|
4996 + | }
|
4997 + | }
|
4998 + | }
|
4999 + | pub(crate) mod map_of_set_of_length_string_internal {
|
5000 + |
|
5001 + | #[allow(clippy::enum_variant_names)]
|
5002 + | #[derive(Debug, PartialEq)]
|
5003 + | pub(crate) enum ConstraintViolation {
|
5004 + | #[doc(hidden)]
|
5005 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
5006 + | #[doc(hidden)]
|
5007 + | Value(
|
5008 + | crate::model::LengthString,
|
5009 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
5010 + | ),
|
5011 + | }
|
5012 + |
|
5013 + | impl ::std::fmt::Display for ConstraintViolation {
|
5014 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5015 + | match self {
|
5016 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5017 + | Self::Value(_, value_constraint_violation) => {
|
5018 + | write!(f, "{}", value_constraint_violation)
|
5019 + | }
|
5020 + | }
|
5021 + | }
|
5022 + | }
|
5023 + |
|
5024 + | impl ::std::error::Error for ConstraintViolation {}
|
5025 + | impl ConstraintViolation {
|
5026 + | pub(crate) fn as_validation_exception_field(
|
5027 + | self,
|
5028 + | path: ::std::string::String,
|
5029 + | ) -> crate::model::ValidationExceptionField {
|
5030 + | match self {
|
5031 + | Self::Key(key_constraint_violation) => {
|
5032 + | key_constraint_violation.as_validation_exception_field(path)
|
5033 + | }
|
5034 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5035 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
5036 + | }
|
5037 + | }
|
5038 + | }
|
5039 + | }
|
5040 + | pub(crate) mod set_of_length_string_internal {
|
5041 + |
|
5042 + | #[allow(clippy::enum_variant_names)]
|
5043 + | #[derive(Debug, PartialEq)]
|
5044 + | pub(crate) enum ConstraintViolation {
|
5045 + | /// Constraint violation error when the list does not contain unique items
|
5046 + | UniqueItems {
|
5047 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
5048 + | /// at least two elements.
|
5049 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
5050 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
5051 + | /// Nothing is guaranteed about the order of the indices.
|
5052 + | duplicate_indices: ::std::vec::Vec<usize>,
|
5053 + | /// The original vector, that contains duplicate items.
|
5054 + | original: ::std::vec::Vec<crate::model::LengthString>,
|
5055 + | },
|
5056 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5057 + | /// The first component of the tuple is the index in the collection where the
|
5058 + | /// first constraint violation was found.
|
5059 + | #[doc(hidden)]
|
5060 + | Member(
|
5061 + | usize,
|
5062 + | crate::model::length_string_internal::ConstraintViolation,
|
5063 + | ),
|
5064 + | }
|
5065 + |
|
5066 + | impl ::std::fmt::Display for ConstraintViolation {
|
5067 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5068 + | let message = match self {
|
5069 + | Self::UniqueItems { duplicate_indices, .. } =>
|
5070 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
5071 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
5072 + | failing_member)
|
5073 + | };
|
5074 + | write!(f, "{message}")
|
5075 + | }
|
5076 + | }
|
5077 + |
|
5078 + | impl ::std::error::Error for ConstraintViolation {}
|
5079 + | impl ConstraintViolation {
|
5080 + | pub(crate) fn as_validation_exception_field(
|
5081 + | self,
|
5082 + | path: ::std::string::String,
|
5083 + | ) -> crate::model::ValidationExceptionField {
|
5084 + | match self {
|
5085 + | Self::UniqueItems { duplicate_indices, .. } =>
|
5086 + | crate::model::ValidationExceptionField {
|
5087 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
5088 + | path,
|
5089 + | },
|
5090 + | Self::Member(index, member_constraint_violation) =>
|
5091 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
5092 + | }
|
5093 + | }
|
5094 + | }
|
5095 + | }
|
5096 + | pub(crate) mod map_of_list_of_length_string_internal {
|
5097 + |
|
5098 + | #[allow(clippy::enum_variant_names)]
|
5099 + | #[derive(Debug, PartialEq)]
|
5100 + | pub(crate) enum ConstraintViolation {
|
5101 + | #[doc(hidden)]
|
5102 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
5103 + | #[doc(hidden)]
|
5104 + | Value(
|
5105 + | crate::model::LengthString,
|
5106 + | crate::model::list_of_length_string_internal::ConstraintViolation,
|
5107 + | ),
|
5108 + | }
|
5109 + |
|
5110 + | impl ::std::fmt::Display for ConstraintViolation {
|
5111 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5112 + | match self {
|
5113 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5114 + | Self::Value(_, value_constraint_violation) => {
|
5115 + | write!(f, "{}", value_constraint_violation)
|
5116 + | }
|
5117 + | }
|
5118 + | }
|
5119 + | }
|
5120 + |
|
5121 + | impl ::std::error::Error for ConstraintViolation {}
|
5122 + | impl ConstraintViolation {
|
5123 + | pub(crate) fn as_validation_exception_field(
|
5124 + | self,
|
5125 + | path: ::std::string::String,
|
5126 + | ) -> crate::model::ValidationExceptionField {
|
5127 + | match self {
|
5128 + | Self::Key(key_constraint_violation) => {
|
5129 + | key_constraint_violation.as_validation_exception_field(path)
|
5130 + | }
|
5131 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5132 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
5133 + | }
|
5134 + | }
|
5135 + | }
|
5136 + | }
|
5137 + | pub(crate) mod list_of_length_string_internal {
|
5138 + |
|
5139 + | #[allow(clippy::enum_variant_names)]
|
5140 + | #[derive(Debug, PartialEq)]
|
5141 + | pub(crate) enum ConstraintViolation {
|
5142 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5143 + | /// The first component of the tuple is the index in the collection where the
|
5144 + | /// first constraint violation was found.
|
5145 + | #[doc(hidden)]
|
5146 + | Member(
|
5147 + | usize,
|
5148 + | crate::model::length_string_internal::ConstraintViolation,
|
5149 + | ),
|
5150 + | }
|
5151 + |
|
5152 + | impl ::std::fmt::Display for ConstraintViolation {
|
5153 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5154 + | let message = match self {
|
5155 + | Self::Member(index, failing_member) => format!(
|
5156 + | "Value at index {index} failed to satisfy constraint. {}",
|
5157 + | failing_member
|
5158 + | ),
|
5159 + | };
|
5160 + | write!(f, "{message}")
|
5161 + | }
|
5162 + | }
|
5163 + |
|
5164 + | impl ::std::error::Error for ConstraintViolation {}
|
5165 + | impl ConstraintViolation {
|
5166 + | pub(crate) fn as_validation_exception_field(
|
5167 + | self,
|
5168 + | path: ::std::string::String,
|
5169 + | ) -> crate::model::ValidationExceptionField {
|
5170 + | match self {
|
5171 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5172 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5173 + | }
|
5174 + | }
|
5175 + | }
|
5176 + | }
|
5177 + | pub(crate) mod map_of_length_string_internal {
|
5178 + |
|
5179 + | #[allow(clippy::enum_variant_names)]
|
5180 + | #[derive(Debug, PartialEq)]
|
5181 + | pub(crate) enum ConstraintViolation {
|
5182 + | #[doc(hidden)]
|
5183 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
5184 + | #[doc(hidden)]
|
5185 + | Value(
|
5186 + | crate::model::LengthString,
|
5187 + | crate::model::length_string_internal::ConstraintViolation,
|
5188 + | ),
|
5189 + | }
|
5190 + |
|
5191 + | impl ::std::fmt::Display for ConstraintViolation {
|
5192 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5193 + | match self {
|
5194 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5195 + | Self::Value(_, value_constraint_violation) => {
|
5196 + | write!(f, "{}", value_constraint_violation)
|
5197 + | }
|
5198 + | }
|
5199 + | }
|
5200 + | }
|
5201 + |
|
5202 + | impl ::std::error::Error for ConstraintViolation {}
|
5203 + | impl ConstraintViolation {
|
5204 + | pub(crate) fn as_validation_exception_field(
|
5205 + | self,
|
5206 + | path: ::std::string::String,
|
5207 + | ) -> crate::model::ValidationExceptionField {
|
5208 + | match self {
|
5209 + | Self::Key(key_constraint_violation) => {
|
5210 + | key_constraint_violation.as_validation_exception_field(path)
|
5211 + | }
|
5212 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5213 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
5214 + | }
|
5215 + | }
|
5216 + | }
|
5217 + | }
|
5218 + | pub(crate) mod recursive_list_internal {
|
5219 + |
|
5220 + | #[allow(clippy::enum_variant_names)]
|
5221 + | #[derive(Debug, PartialEq)]
|
5222 + | pub(crate) enum ConstraintViolation {
|
5223 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5224 + | /// The first component of the tuple is the index in the collection where the
|
5225 + | /// first constraint violation was found.
|
5226 + | #[doc(hidden)]
|
5227 + | Member(
|
5228 + | usize,
|
5229 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
5230 + | ),
|
5231 + | }
|
5232 + |
|
5233 + | impl ::std::fmt::Display for ConstraintViolation {
|
5234 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5235 + | let message = match self {
|
5236 + | Self::Member(index, failing_member) => format!(
|
5237 + | "Value at index {index} failed to satisfy constraint. {}",
|
5238 + | failing_member
|
5239 + | ),
|
5240 + | };
|
5241 + | write!(f, "{message}")
|
5242 + | }
|
5243 + | }
|
5244 + |
|
5245 + | impl ::std::error::Error for ConstraintViolation {}
|
5246 + | impl ConstraintViolation {
|
5247 + | pub(crate) fn as_validation_exception_field(
|
5248 + | self,
|
5249 + | path: ::std::string::String,
|
5250 + | ) -> crate::model::ValidationExceptionField {
|
5251 + | match self {
|
5252 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5253 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5254 + | }
|
5255 + | }
|
5256 + | }
|
5257 + | }
|
5258 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5259 + | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
5260 + |
|
5261 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5262 + | /// Holds one variant for each of the ways the builder can fail.
|
5263 + | #[non_exhaustive]
|
5264 + | #[allow(clippy::enum_variant_names)]
|
5265 + | pub(crate) enum ConstraintViolation {
|
5266 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
5267 + | MissingRecursiveMember,
|
5268 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
5269 + | #[doc(hidden)]
|
5270 + | RecursiveMember(
|
5271 + | ::std::boxed::Box<
|
5272 + | crate::model::recursive_shapes_input_output_nested2_internal::ConstraintViolation,
|
5273 + | >,
|
5274 + | ),
|
5275 + | }
|
5276 + | impl ::std::fmt::Display for ConstraintViolation {
|
5277 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5278 + | match self {
|
5279 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5280 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
5281 + | }
|
5282 + | }
|
5283 + | }
|
5284 + | impl ::std::error::Error for ConstraintViolation {}
|
5285 + | impl ConstraintViolation {
|
5286 + | pub(crate) fn as_validation_exception_field(
|
5287 + | self,
|
5288 + | path: ::std::string::String,
|
5289 + | ) -> crate::model::ValidationExceptionField {
|
5290 + | match self {
|
5291 + | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
5292 + | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
5293 + | path: path + "/recursiveMember",
|
5294 + | },
|
5295 + | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
5296 + | }
|
5297 + | }
|
5298 + | }
|
5299 + | impl ::std::convert::From<Builder>
|
5300 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
5301 + | {
|
5302 + | fn from(builder: Builder) -> Self {
|
5303 + | Self::Unconstrained(builder)
|
5304 + | }
|
5305 + | }
|
5306 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
5307 + | type Error = ConstraintViolation;
|
5308 + |
|
5309 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5310 + | builder.build()
|
5311 + | }
|
5312 + | }
|
5313 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5314 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5315 + | pub(crate) struct Builder {
|
5316 + | pub(crate) recursive_member: ::std::option::Option<
|
5317 + | ::std::boxed::Box<
|
5318 + | crate::constrained::MaybeConstrained<
|
5319 + | crate::model::RecursiveShapesInputOutputNested2,
|
5320 + | >,
|
5321 + | >,
|
5322 + | >,
|
5323 + | }
|
5324 + | impl Builder {
|
5325 + | #[allow(missing_docs)] // documentation missing in model
|
5326 + | pub(crate) fn set_recursive_member(
|
5327 + | mut self,
|
5328 + | input: impl ::std::convert::Into<
|
5329 + | ::std::boxed::Box<
|
5330 + | crate::constrained::MaybeConstrained<
|
5331 + | crate::model::RecursiveShapesInputOutputNested2,
|
5332 + | >,
|
5333 + | >,
|
5334 + | >,
|
5335 + | ) -> Self {
|
5336 + | self.recursive_member = Some(input.into());
|
5337 + | self
|
5338 + | }
|
5339 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5340 + | ///
|
5341 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
5342 + | ///
|
5343 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
5344 + | pub fn build(
|
5345 + | self,
|
5346 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5347 + | self.build_enforcing_all_constraints()
|
5348 + | }
|
5349 + | fn build_enforcing_all_constraints(
|
5350 + | self,
|
5351 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5352 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
5353 + | recursive_member: self
|
5354 + | .recursive_member
|
5355 + | .map(|v| match *v {
|
5356 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
5357 + | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
5358 + | Ok(Box::new(x.try_into()?))
|
5359 + | }
|
5360 + | })
|
5361 + | .map(|res| {
|
5362 + | res.map_err(Box::new)
|
5363 + | .map_err(ConstraintViolation::RecursiveMember)
|
5364 + | })
|
5365 + | .transpose()?
|
5366 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
5367 + | })
|
5368 + | }
|
5369 + | }
|
5370 + | }
|
5371 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5372 + | pub mod recursive_shapes_input_output_nested1 {
|
5373 + |
|
5374 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5375 + | /// Holds one variant for each of the ways the builder can fail.
|
5376 + | #[allow(clippy::enum_variant_names)]
|
5377 + | pub enum ConstraintViolation {
|
5378 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
5379 + | MissingRecursiveMember,
|
5380 + | }
|
5381 + | impl ::std::fmt::Display for ConstraintViolation {
|
5382 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5383 + | match self {
|
5384 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5385 + | }
|
5386 + | }
|
5387 + | }
|
5388 + | impl ::std::error::Error for ConstraintViolation {}
|
5389 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
5390 + | type Error = ConstraintViolation;
|
5391 + |
|
5392 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5393 + | builder.build()
|
5394 + | }
|
5395 + | }
|
5396 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5397 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5398 + | pub struct Builder {
|
5399 + | pub(crate) recursive_member: ::std::option::Option<
|
5400 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
5401 + | >,
|
5402 + | }
|
5403 + | impl Builder {
|
5404 + | #[allow(missing_docs)] // documentation missing in model
|
5405 + | pub fn recursive_member(
|
5406 + | mut self,
|
5407 + | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
5408 + | ) -> Self {
|
5409 + | self.recursive_member = Some(input);
|
5410 + | self
|
5411 + | }
|
5412 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5413 + | ///
|
5414 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if you do not provide a value for all non-`Option`al members.
|
5415 + | ///
|
5416 + | pub fn build(
|
5417 + | self,
|
5418 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5419 + | self.build_enforcing_required_and_enum_traits()
|
5420 + | }
|
5421 + | fn build_enforcing_required_and_enum_traits(
|
5422 + | self,
|
5423 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5424 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
5425 + | recursive_member: self
|
5426 + | .recursive_member
|
5427 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
5428 + | })
|
5429 + | }
|
5430 + | }
|
5431 + | }
|
5432 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5433 + | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
5434 + |
|
5435 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5436 + | /// Holds one variant for each of the ways the builder can fail.
|
5437 + | #[non_exhaustive]
|
5438 + | #[allow(clippy::enum_variant_names)]
|
5439 + | pub(crate) enum ConstraintViolation {
|
5440 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
5441 + | #[doc(hidden)]
|
5442 + | RecursiveMember(
|
5443 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
5444 + | ),
|
5445 + | }
|
5446 + | impl ::std::fmt::Display for ConstraintViolation {
|
5447 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5448 + | match self {
|
5449 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
5450 + | }
|
5451 + | }
|
5452 + | }
|
5453 + | impl ::std::error::Error for ConstraintViolation {}
|
5454 + | impl ConstraintViolation {
|
5455 + | pub(crate) fn as_validation_exception_field(
|
5456 + | self,
|
5457 + | path: ::std::string::String,
|
5458 + | ) -> crate::model::ValidationExceptionField {
|
5459 + | match self {
|
5460 + | ConstraintViolation::RecursiveMember(inner) => {
|
5461 + | inner.as_validation_exception_field(path + "/recursiveMember")
|
5462 + | }
|
5463 + | }
|
5464 + | }
|
5465 + | }
|
5466 + | impl ::std::convert::From<Builder>
|
5467 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
5468 + | {
|
5469 + | fn from(builder: Builder) -> Self {
|
5470 + | Self::Unconstrained(builder)
|
5471 + | }
|
5472 + | }
|
5473 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5474 + | type Error = ConstraintViolation;
|
5475 + |
|
5476 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5477 + | builder.build()
|
5478 + | }
|
5479 + | }
|
5480 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5481 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5482 + | pub(crate) struct Builder {
|
5483 + | pub(crate) recursive_member: ::std::option::Option<
|
5484 + | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
5485 + | >,
|
5486 + | }
|
5487 + | impl Builder {
|
5488 + | #[allow(missing_docs)] // documentation missing in model
|
5489 + | pub(crate) fn set_recursive_member(
|
5490 + | mut self,
|
5491 + | input: Option<
|
5492 + | impl ::std::convert::Into<
|
5493 + | crate::constrained::MaybeConstrained<
|
5494 + | crate::model::RecursiveShapesInputOutputNested1,
|
5495 + | >,
|
5496 + | >,
|
5497 + | >,
|
5498 + | ) -> Self {
|
5499 + | self.recursive_member = input.map(|v| v.into());
|
5500 + | self
|
5501 + | }
|
5502 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5503 + | ///
|
5504 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
5505 + | ///
|
5506 + | pub fn build(
|
5507 + | self,
|
5508 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5509 + | self.build_enforcing_all_constraints()
|
5510 + | }
|
5511 + | fn build_enforcing_all_constraints(
|
5512 + | self,
|
5513 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5514 + | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
5515 + | recursive_member: self
|
5516 + | .recursive_member
|
5517 + | .map(|v| match v {
|
5518 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5519 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5520 + | })
|
5521 + | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
5522 + | .transpose()?,
|
5523 + | })
|
5524 + | }
|
5525 + | }
|
5526 + | }
|
5527 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5528 + | pub mod recursive_shapes_input_output_nested2 {
|
5529 + |
|
5530 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5531 + | fn from(builder: Builder) -> Self {
|
5532 + | builder.build()
|
5533 + | }
|
5534 + | }
|
5535 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5536 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5537 + | pub struct Builder {
|
5538 + | pub(crate) recursive_member:
|
5539 + | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5540 + | }
|
5541 + | impl Builder {
|
5542 + | #[allow(missing_docs)] // documentation missing in model
|
5543 + | pub fn recursive_member(
|
5544 + | mut self,
|
5545 + | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5546 + | ) -> Self {
|
5547 + | self.recursive_member = input;
|
5548 + | self
|
5549 + | }
|
5550 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5551 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5552 + | self.build_enforcing_required_and_enum_traits()
|
5553 + | }
|
5554 + | fn build_enforcing_required_and_enum_traits(
|
5555 + | self,
|
5556 + | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5557 + | crate::model::RecursiveShapesInputOutputNested2 {
|
5558 + | recursive_member: self.recursive_member,
|
5559 + | }
|
5560 + | }
|
5561 + | }
|
5562 + | }
|
5563 + | /// See [`ConA`](crate::model::ConA).
|
5564 + | pub(crate) mod con_a_internal {
|
5565 + |
|
5566 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5567 + | /// Holds one variant for each of the ways the builder can fail.
|
5568 + | #[non_exhaustive]
|
5569 + | #[allow(clippy::enum_variant_names)]
|
5570 + | pub(crate) enum ConstraintViolation {
|
5571 + | /// `con_b` was not provided but it is required when building `ConA`.
|
5572 + | MissingConB,
|
5573 + | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
5574 + | #[doc(hidden)]
|
5575 + | ConB(crate::model::con_b_internal::ConstraintViolation),
|
5576 + | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
5577 + | #[doc(hidden)]
|
5578 + | OptConB(crate::model::con_b_internal::ConstraintViolation),
|
5579 + | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
5580 + | #[doc(hidden)]
|
5581 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
5582 + | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
5583 + | #[doc(hidden)]
|
5584 + | MinLengthString(crate::model::min_length_string_internal::ConstraintViolation),
|
5585 + | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
5586 + | #[doc(hidden)]
|
5587 + | MaxLengthString(crate::model::max_length_string_internal::ConstraintViolation),
|
5588 + | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
5589 + | #[doc(hidden)]
|
5590 + | FixedLengthString(crate::model::fixed_length_string_internal::ConstraintViolation),
|
5591 + | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
5592 + | #[doc(hidden)]
|
5593 + | LengthBlob(crate::model::length_blob_internal::ConstraintViolation),
|
5594 + | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
5595 + | #[doc(hidden)]
|
5596 + | MinLengthBlob(crate::model::min_length_blob_internal::ConstraintViolation),
|
5597 + | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
5598 + | #[doc(hidden)]
|
5599 + | MaxLengthBlob(crate::model::max_length_blob_internal::ConstraintViolation),
|
5600 + | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
5601 + | #[doc(hidden)]
|
5602 + | FixedLengthBlob(crate::model::fixed_length_blob_internal::ConstraintViolation),
|
5603 + | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
5604 + | #[doc(hidden)]
|
5605 + | RangeInteger(crate::model::range_integer_internal::ConstraintViolation),
|
5606 + | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
5607 + | #[doc(hidden)]
|
5608 + | MinRangeInteger(crate::model::min_range_integer_internal::ConstraintViolation),
|
5609 + | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
5610 + | #[doc(hidden)]
|
5611 + | MaxRangeInteger(crate::model::max_range_integer_internal::ConstraintViolation),
|
5612 + | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
5613 + | #[doc(hidden)]
|
5614 + | FixedValueInteger(crate::model::fixed_value_integer_internal::ConstraintViolation),
|
5615 + | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
5616 + | #[doc(hidden)]
|
5617 + | RangeShort(crate::model::range_short_internal::ConstraintViolation),
|
5618 + | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
5619 + | #[doc(hidden)]
|
5620 + | MinRangeShort(crate::model::min_range_short_internal::ConstraintViolation),
|
5621 + | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
5622 + | #[doc(hidden)]
|
5623 + | MaxRangeShort(crate::model::max_range_short_internal::ConstraintViolation),
|
5624 + | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
5625 + | #[doc(hidden)]
|
5626 + | FixedValueShort(crate::model::fixed_value_short_internal::ConstraintViolation),
|
5627 + | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
5628 + | #[doc(hidden)]
|
5629 + | RangeLong(crate::model::range_long_internal::ConstraintViolation),
|
5630 + | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
5631 + | #[doc(hidden)]
|
5632 + | MinRangeLong(crate::model::min_range_long_internal::ConstraintViolation),
|
5633 + | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
5634 + | #[doc(hidden)]
|
5635 + | MaxRangeLong(crate::model::max_range_long_internal::ConstraintViolation),
|
5636 + | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
5637 + | #[doc(hidden)]
|
5638 + | FixedValueLong(crate::model::fixed_value_long_internal::ConstraintViolation),
|
5639 + | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
5640 + | #[doc(hidden)]
|
5641 + | RangeByte(crate::model::range_byte_internal::ConstraintViolation),
|
5642 + | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
5643 + | #[doc(hidden)]
|
5644 + | MinRangeByte(crate::model::min_range_byte_internal::ConstraintViolation),
|
5645 + | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
5646 + | #[doc(hidden)]
|
5647 + | MaxRangeByte(crate::model::max_range_byte_internal::ConstraintViolation),
|
5648 + | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
5649 + | #[doc(hidden)]
|
5650 + | FixedValueByte(crate::model::fixed_value_byte_internal::ConstraintViolation),
|
5651 + | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
5652 + | #[doc(hidden)]
|
5653 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
5654 + | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
5655 + | #[doc(hidden)]
|
5656 + | LengthList(crate::model::length_list_internal::ConstraintViolation),
|
5657 + | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
5658 + | #[doc(hidden)]
|
5659 + | SensitiveLengthList(crate::model::sensitive_length_list_internal::ConstraintViolation),
|
5660 + | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
5661 + | #[doc(hidden)]
|
5662 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
5663 + | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
5664 + | #[doc(hidden)]
|
5665 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
5666 + | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
5667 + | #[doc(hidden)]
|
5668 + | LengthMap(crate::model::length_map_internal::ConstraintViolation),
|
5669 + | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
5670 + | #[doc(hidden)]
|
5671 + | MapOfMapOfListOfListOfConB(
|
5672 + | crate::model::map_of_map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
5673 + | ),
|
5674 + | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
5675 + | #[doc(hidden)]
|
5676 + | SparseMap(crate::model::sparse_map_internal::ConstraintViolation),
|
5677 + | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
5678 + | #[doc(hidden)]
|
5679 + | SparseList(crate::model::sparse_list_internal::ConstraintViolation),
|
5680 + | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
5681 + | #[doc(hidden)]
|
5682 + | SparseLengthMap(crate::model::sparse_length_map_internal::ConstraintViolation),
|
5683 + | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
5684 + | #[doc(hidden)]
|
5685 + | SparseLengthList(crate::model::sparse_length_list_internal::ConstraintViolation),
|
5686 + | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
5687 + | #[doc(hidden)]
|
5688 + | ConstrainedUnion(crate::model::constrained_union_internal::ConstraintViolation),
|
5689 + | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
5690 + | #[doc(hidden)]
|
5691 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
5692 + | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
5693 + | #[doc(hidden)]
|
5694 + | ListOfLengthString(crate::model::list_of_length_string_internal::ConstraintViolation),
|
5695 + | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
5696 + | #[doc(hidden)]
|
5697 + | SetOfLengthString(crate::model::set_of_length_string_internal::ConstraintViolation),
|
5698 + | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
5699 + | #[doc(hidden)]
|
5700 + | MapOfLengthString(crate::model::map_of_length_string_internal::ConstraintViolation),
|
5701 + | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
5702 + | #[doc(hidden)]
|
5703 + | ListOfLengthBlob(crate::model::list_of_length_blob_internal::ConstraintViolation),
|
5704 + | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
5705 + | #[doc(hidden)]
|
5706 + | MapOfLengthBlob(crate::model::map_of_length_blob_internal::ConstraintViolation),
|
5707 + | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
5708 + | #[doc(hidden)]
|
5709 + | ListOfRangeInteger(crate::model::list_of_range_integer_internal::ConstraintViolation),
|
5710 + | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
5711 + | #[doc(hidden)]
|
5712 + | SetOfRangeInteger(crate::model::set_of_range_integer_internal::ConstraintViolation),
|
5713 + | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
5714 + | #[doc(hidden)]
|
5715 + | MapOfRangeInteger(crate::model::map_of_range_integer_internal::ConstraintViolation),
|
5716 + | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
5717 + | #[doc(hidden)]
|
5718 + | ListOfRangeShort(crate::model::list_of_range_short_internal::ConstraintViolation),
|
5719 + | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
5720 + | #[doc(hidden)]
|
5721 + | SetOfRangeShort(crate::model::set_of_range_short_internal::ConstraintViolation),
|
5722 + | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
5723 + | #[doc(hidden)]
|
5724 + | MapOfRangeShort(crate::model::map_of_range_short_internal::ConstraintViolation),
|
5725 + | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
5726 + | #[doc(hidden)]
|
5727 + | ListOfRangeLong(crate::model::list_of_range_long_internal::ConstraintViolation),
|
5728 + | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
5729 + | #[doc(hidden)]
|
5730 + | SetOfRangeLong(crate::model::set_of_range_long_internal::ConstraintViolation),
|
5731 + | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
5732 + | #[doc(hidden)]
|
5733 + | MapOfRangeLong(crate::model::map_of_range_long_internal::ConstraintViolation),
|
5734 + | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
5735 + | #[doc(hidden)]
|
5736 + | ListOfRangeByte(crate::model::list_of_range_byte_internal::ConstraintViolation),
|
5737 + | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
5738 + | #[doc(hidden)]
|
5739 + | SetOfRangeByte(crate::model::set_of_range_byte_internal::ConstraintViolation),
|
5740 + | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
5741 + | #[doc(hidden)]
|
5742 + | MapOfRangeByte(crate::model::map_of_range_byte_internal::ConstraintViolation),
|
5743 + | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
5744 + | #[doc(hidden)]
|
5745 + | PatternString(crate::model::pattern_string_internal::ConstraintViolation),
|
5746 + | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
5747 + | #[doc(hidden)]
|
5748 + | MapOfPatternString(crate::model::map_of_pattern_string_internal::ConstraintViolation),
|
5749 + | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
5750 + | #[doc(hidden)]
|
5751 + | ListOfPatternString(crate::model::list_of_pattern_string_internal::ConstraintViolation),
|
5752 + | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
5753 + | #[doc(hidden)]
|
5754 + | SetOfPatternString(crate::model::set_of_pattern_string_internal::ConstraintViolation),
|
5755 + | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
5756 + | #[doc(hidden)]
|
5757 + | LengthLengthPatternString(
|
5758 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
5759 + | ),
|
5760 + | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
5761 + | #[doc(hidden)]
|
5762 + | MapOfLengthPatternString(
|
5763 + | crate::model::map_of_length_pattern_string_internal::ConstraintViolation,
|
5764 + | ),
|
5765 + | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
5766 + | #[doc(hidden)]
|
5767 + | ListOfLengthPatternString(
|
5768 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
5769 + | ),
|
5770 + | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
5771 + | #[doc(hidden)]
|
5772 + | SetOfLengthPatternString(
|
5773 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
5774 + | ),
|
5775 + | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
5776 + | #[doc(hidden)]
|
5777 + | LengthListOfPatternString(
|
5778 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
5779 + | ),
|
5780 + | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
5781 + | #[doc(hidden)]
|
5782 + | LengthSetOfPatternString(
|
5783 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
5784 + | ),
|
5785 + | }
|
5786 + | impl ::std::fmt::Display for ConstraintViolation {
|
5787 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5788 + | match self {
|
5789 + | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
5790 + | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
5791 + | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
5792 + | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
5793 + | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
5794 + | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
5795 + | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
5796 + | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
5797 + | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
5798 + | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
5799 + | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
5800 + | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
5801 + | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
5802 + | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
5803 + | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
5804 + | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
5805 + | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
5806 + | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
5807 + | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
5808 + | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
5809 + | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
5810 + | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
5811 + | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
5812 + | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
5813 + | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
5814 + | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
5815 + | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
5816 + | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
5817 + | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
5818 + | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
5819 + | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
5820 + | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
5821 + | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
5822 + | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
5823 + | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
5824 + | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
5825 + | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
5826 + | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
5827 + | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
5828 + | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
5829 + | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
5830 + | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
5831 + | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
5832 + | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
5833 + | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
5834 + | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
5835 + | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
5836 + | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
5837 + | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
5838 + | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
5839 + | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
5840 + | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
5841 + | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
5842 + | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
5843 + | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
5844 + | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
5845 + | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
5846 + | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
5847 + | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
5848 + | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
5849 + | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
5850 + | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
5851 + | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
5852 + | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
5853 + | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
5854 + | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
5855 + | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
5856 + | }
|
5857 + | }
|
5858 + | }
|
5859 + | impl ::std::error::Error for ConstraintViolation {}
|
5860 + | impl ConstraintViolation {
|
5861 + | pub(crate) fn as_validation_exception_field(
|
5862 + | self,
|
5863 + | path: ::std::string::String,
|
5864 + | ) -> crate::model::ValidationExceptionField {
|
5865 + | match self {
|
5866 + | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
5867 + | message: format!(
|
5868 + | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
5869 + | path
|
5870 + | ),
|
5871 + | path: path + "/conB",
|
5872 + | },
|
5873 + | ConstraintViolation::ConB(inner) => {
|
5874 + | inner.as_validation_exception_field(path + "/conB")
|
5875 + | }
|
5876 + | ConstraintViolation::OptConB(inner) => {
|
5877 + | inner.as_validation_exception_field(path + "/optConB")
|
5878 + | }
|
5879 + | ConstraintViolation::LengthString(inner) => {
|
5880 + | inner.as_validation_exception_field(path + "/lengthString")
|
5881 + | }
|
5882 + | ConstraintViolation::MinLengthString(inner) => {
|
5883 + | inner.as_validation_exception_field(path + "/minLengthString")
|
5884 + | }
|
5885 + | ConstraintViolation::MaxLengthString(inner) => {
|
5886 + | inner.as_validation_exception_field(path + "/maxLengthString")
|
5887 + | }
|
5888 + | ConstraintViolation::FixedLengthString(inner) => {
|
5889 + | inner.as_validation_exception_field(path + "/fixedLengthString")
|
5890 + | }
|
5891 + | ConstraintViolation::LengthBlob(inner) => {
|
5892 + | inner.as_validation_exception_field(path + "/lengthBlob")
|
5893 + | }
|
5894 + | ConstraintViolation::MinLengthBlob(inner) => {
|
5895 + | inner.as_validation_exception_field(path + "/minLengthBlob")
|
5896 + | }
|
5897 + | ConstraintViolation::MaxLengthBlob(inner) => {
|
5898 + | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
5899 + | }
|
5900 + | ConstraintViolation::FixedLengthBlob(inner) => {
|
5901 + | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
5902 + | }
|
5903 + | ConstraintViolation::RangeInteger(inner) => {
|
5904 + | inner.as_validation_exception_field(path + "/rangeInteger")
|
5905 + | }
|
5906 + | ConstraintViolation::MinRangeInteger(inner) => {
|
5907 + | inner.as_validation_exception_field(path + "/minRangeInteger")
|
5908 + | }
|
5909 + | ConstraintViolation::MaxRangeInteger(inner) => {
|
5910 + | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
5911 + | }
|
5912 + | ConstraintViolation::FixedValueInteger(inner) => {
|
5913 + | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
5914 + | }
|
5915 + | ConstraintViolation::RangeShort(inner) => {
|
5916 + | inner.as_validation_exception_field(path + "/rangeShort")
|
5917 + | }
|
5918 + | ConstraintViolation::MinRangeShort(inner) => {
|
5919 + | inner.as_validation_exception_field(path + "/minRangeShort")
|
5920 + | }
|
5921 + | ConstraintViolation::MaxRangeShort(inner) => {
|
5922 + | inner.as_validation_exception_field(path + "/maxRangeShort")
|
5923 + | }
|
5924 + | ConstraintViolation::FixedValueShort(inner) => {
|
5925 + | inner.as_validation_exception_field(path + "/fixedValueShort")
|
5926 + | }
|
5927 + | ConstraintViolation::RangeLong(inner) => {
|
5928 + | inner.as_validation_exception_field(path + "/rangeLong")
|
5929 + | }
|
5930 + | ConstraintViolation::MinRangeLong(inner) => {
|
5931 + | inner.as_validation_exception_field(path + "/minRangeLong")
|
5932 + | }
|
5933 + | ConstraintViolation::MaxRangeLong(inner) => {
|
5934 + | inner.as_validation_exception_field(path + "/maxRangeLong")
|
5935 + | }
|
5936 + | ConstraintViolation::FixedValueLong(inner) => {
|
5937 + | inner.as_validation_exception_field(path + "/fixedValueLong")
|
5938 + | }
|
5939 + | ConstraintViolation::RangeByte(inner) => {
|
5940 + | inner.as_validation_exception_field(path + "/rangeByte")
|
5941 + | }
|
5942 + | ConstraintViolation::MinRangeByte(inner) => {
|
5943 + | inner.as_validation_exception_field(path + "/minRangeByte")
|
5944 + | }
|
5945 + | ConstraintViolation::MaxRangeByte(inner) => {
|
5946 + | inner.as_validation_exception_field(path + "/maxRangeByte")
|
5947 + | }
|
5948 + | ConstraintViolation::FixedValueByte(inner) => {
|
5949 + | inner.as_validation_exception_field(path + "/fixedValueByte")
|
5950 + | }
|
5951 + | ConstraintViolation::ConBList(inner) => {
|
5952 + | inner.as_validation_exception_field(path + "/conBList")
|
5953 + | }
|
5954 + | ConstraintViolation::LengthList(inner) => {
|
5955 + | inner.as_validation_exception_field(path + "/lengthList")
|
5956 + | }
|
5957 + | ConstraintViolation::SensitiveLengthList(inner) => {
|
5958 + | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
5959 + | }
|
5960 + | ConstraintViolation::ConBSet(inner) => {
|
5961 + | inner.as_validation_exception_field(path + "/conBSet")
|
5962 + | }
|
5963 + | ConstraintViolation::ConBMap(inner) => {
|
5964 + | inner.as_validation_exception_field(path + "/conBMap")
|
5965 + | }
|
5966 + | ConstraintViolation::LengthMap(inner) => {
|
5967 + | inner.as_validation_exception_field(path + "/lengthMap")
|
5968 + | }
|
5969 + | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
5970 + | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
5971 + | }
|
5972 + | ConstraintViolation::SparseMap(inner) => {
|
5973 + | inner.as_validation_exception_field(path + "/sparseMap")
|
5974 + | }
|
5975 + | ConstraintViolation::SparseList(inner) => {
|
5976 + | inner.as_validation_exception_field(path + "/sparseList")
|
5977 + | }
|
5978 + | ConstraintViolation::SparseLengthMap(inner) => {
|
5979 + | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
5980 + | }
|
5981 + | ConstraintViolation::SparseLengthList(inner) => {
|
5982 + | inner.as_validation_exception_field(path + "/sparseLengthList")
|
5983 + | }
|
5984 + | ConstraintViolation::ConstrainedUnion(inner) => {
|
5985 + | inner.as_validation_exception_field(path + "/constrainedUnion")
|
5986 + | }
|
5987 + | ConstraintViolation::EnumString(inner) => {
|
5988 + | inner.as_validation_exception_field(path + "/enumString")
|
5989 + | }
|
5990 + | ConstraintViolation::ListOfLengthString(inner) => {
|
5991 + | inner.as_validation_exception_field(path + "/listOfLengthString")
|
5992 + | }
|
5993 + | ConstraintViolation::SetOfLengthString(inner) => {
|
5994 + | inner.as_validation_exception_field(path + "/setOfLengthString")
|
5995 + | }
|
5996 + | ConstraintViolation::MapOfLengthString(inner) => {
|
5997 + | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
5998 + | }
|
5999 + | ConstraintViolation::ListOfLengthBlob(inner) => {
|
6000 + | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
6001 + | }
|
6002 + | ConstraintViolation::MapOfLengthBlob(inner) => {
|
6003 + | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
6004 + | }
|
6005 + | ConstraintViolation::ListOfRangeInteger(inner) => {
|
6006 + | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
6007 + | }
|
6008 + | ConstraintViolation::SetOfRangeInteger(inner) => {
|
6009 + | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
6010 + | }
|
6011 + | ConstraintViolation::MapOfRangeInteger(inner) => {
|
6012 + | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
6013 + | }
|
6014 + | ConstraintViolation::ListOfRangeShort(inner) => {
|
6015 + | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
6016 + | }
|
6017 + | ConstraintViolation::SetOfRangeShort(inner) => {
|
6018 + | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
6019 + | }
|
6020 + | ConstraintViolation::MapOfRangeShort(inner) => {
|
6021 + | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
6022 + | }
|
6023 + | ConstraintViolation::ListOfRangeLong(inner) => {
|
6024 + | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
6025 + | }
|
6026 + | ConstraintViolation::SetOfRangeLong(inner) => {
|
6027 + | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
6028 + | }
|
6029 + | ConstraintViolation::MapOfRangeLong(inner) => {
|
6030 + | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
6031 + | }
|
6032 + | ConstraintViolation::ListOfRangeByte(inner) => {
|
6033 + | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
6034 + | }
|
6035 + | ConstraintViolation::SetOfRangeByte(inner) => {
|
6036 + | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
6037 + | }
|
6038 + | ConstraintViolation::MapOfRangeByte(inner) => {
|
6039 + | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
6040 + | }
|
6041 + | ConstraintViolation::PatternString(inner) => {
|
6042 + | inner.as_validation_exception_field(path + "/patternString")
|
6043 + | }
|
6044 + | ConstraintViolation::MapOfPatternString(inner) => {
|
6045 + | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
6046 + | }
|
6047 + | ConstraintViolation::ListOfPatternString(inner) => {
|
6048 + | inner.as_validation_exception_field(path + "/listOfPatternString")
|
6049 + | }
|
6050 + | ConstraintViolation::SetOfPatternString(inner) => {
|
6051 + | inner.as_validation_exception_field(path + "/setOfPatternString")
|
6052 + | }
|
6053 + | ConstraintViolation::LengthLengthPatternString(inner) => {
|
6054 + | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
6055 + | }
|
6056 + | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
6057 + | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
6058 + | }
|
6059 + | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
6060 + | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
6061 + | }
|
6062 + | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
6063 + | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
6064 + | }
|
6065 + | ConstraintViolation::LengthListOfPatternString(inner) => {
|
6066 + | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
6067 + | }
|
6068 + | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
6069 + | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
6070 + | }
|
6071 + | }
|
6072 + | }
|
6073 + | }
|
6074 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
6075 + | fn from(builder: Builder) -> Self {
|
6076 + | Self::Unconstrained(builder)
|
6077 + | }
|
6078 + | }
|
6079 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
6080 + | type Error = ConstraintViolation;
|
6081 + |
|
6082 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6083 + | builder.build()
|
6084 + | }
|
6085 + | }
|
6086 + | /// A builder for [`ConA`](crate::model::ConA).
|
6087 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6088 + | pub(crate) struct Builder {
|
6089 + | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6090 + | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6091 + | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
6092 + | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
6093 + | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
6094 + | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
6095 + | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
6096 + | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
6097 + | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
6098 + | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
6099 + | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
6100 + | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
6101 + | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
6102 + | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
6103 + | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
6104 + | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
6105 + | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
6106 + | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
6107 + | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
6108 + | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
6109 + | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
6110 + | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
6111 + | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
6112 + | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
6113 + | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
6114 + | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
6115 + | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
6116 + | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
6117 + | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
6118 + | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6119 + | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6120 + | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6121 + | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>,
|
6122 + | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
6123 + | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
6124 + | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
6125 + | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
6126 + | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
6127 + | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
6128 + | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
6129 + | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
6130 + | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
6131 + | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
6132 + | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
6133 + | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
6134 + | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
6135 + | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
6136 + | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
6137 + | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
6138 + | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
6139 + | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
6140 + | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
6141 + | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
6142 + | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
6143 + | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
6144 + | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
6145 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6146 + | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
6147 + | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
6148 + | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
6149 + | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
6150 + | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
6151 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
6152 + | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
6153 + | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
6154 + | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
6155 + | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
6156 + | }
|
6157 + | impl Builder {
|
6158 + | #[allow(missing_docs)] // documentation missing in model
|
6159 + | pub(crate) fn set_con_b(
|
6160 + | mut self,
|
6161 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6162 + | ) -> Self {
|
6163 + | self.con_b = Some(input.into());
|
6164 + | self
|
6165 + | }
|
6166 + | #[allow(missing_docs)] // documentation missing in model
|
6167 + | pub(crate) fn set_opt_con_b(
|
6168 + | mut self,
|
6169 + | input: Option<
|
6170 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6171 + | >,
|
6172 + | ) -> Self {
|
6173 + | self.opt_con_b = input.map(|v| v.into());
|
6174 + | self
|
6175 + | }
|
6176 + | #[allow(missing_docs)] // documentation missing in model
|
6177 + | pub(crate) fn set_length_string(
|
6178 + | mut self,
|
6179 + | input: Option<
|
6180 + | impl ::std::convert::Into<
|
6181 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
6182 + | >,
|
6183 + | >,
|
6184 + | ) -> Self {
|
6185 + | self.length_string = input.map(|v| v.into());
|
6186 + | self
|
6187 + | }
|
6188 + | #[allow(missing_docs)] // documentation missing in model
|
6189 + | pub(crate) fn set_min_length_string(
|
6190 + | mut self,
|
6191 + | input: Option<
|
6192 + | impl ::std::convert::Into<
|
6193 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
6194 + | >,
|
6195 + | >,
|
6196 + | ) -> Self {
|
6197 + | self.min_length_string = input.map(|v| v.into());
|
6198 + | self
|
6199 + | }
|
6200 + | #[allow(missing_docs)] // documentation missing in model
|
6201 + | pub(crate) fn set_max_length_string(
|
6202 + | mut self,
|
6203 + | input: Option<
|
6204 + | impl ::std::convert::Into<
|
6205 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
6206 + | >,
|
6207 + | >,
|
6208 + | ) -> Self {
|
6209 + | self.max_length_string = input.map(|v| v.into());
|
6210 + | self
|
6211 + | }
|
6212 + | #[allow(missing_docs)] // documentation missing in model
|
6213 + | pub(crate) fn set_fixed_length_string(
|
6214 + | mut self,
|
6215 + | input: Option<
|
6216 + | impl ::std::convert::Into<
|
6217 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
6218 + | >,
|
6219 + | >,
|
6220 + | ) -> Self {
|
6221 + | self.fixed_length_string = input.map(|v| v.into());
|
6222 + | self
|
6223 + | }
|
6224 + | #[allow(missing_docs)] // documentation missing in model
|
6225 + | pub(crate) fn set_length_blob(
|
6226 + | mut self,
|
6227 + | input: Option<
|
6228 + | impl ::std::convert::Into<
|
6229 + | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
6230 + | >,
|
6231 + | >,
|
6232 + | ) -> Self {
|
6233 + | self.length_blob = input.map(|v| v.into());
|
6234 + | self
|
6235 + | }
|
6236 + | #[allow(missing_docs)] // documentation missing in model
|
6237 + | pub(crate) fn set_min_length_blob(
|
6238 + | mut self,
|
6239 + | input: Option<
|
6240 + | impl ::std::convert::Into<
|
6241 + | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
6242 + | >,
|
6243 + | >,
|
6244 + | ) -> Self {
|
6245 + | self.min_length_blob = input.map(|v| v.into());
|
6246 + | self
|
6247 + | }
|
6248 + | #[allow(missing_docs)] // documentation missing in model
|
6249 + | pub(crate) fn set_max_length_blob(
|
6250 + | mut self,
|
6251 + | input: Option<
|
6252 + | impl ::std::convert::Into<
|
6253 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
6254 + | >,
|
6255 + | >,
|
6256 + | ) -> Self {
|
6257 + | self.max_length_blob = input.map(|v| v.into());
|
6258 + | self
|
6259 + | }
|
6260 + | #[allow(missing_docs)] // documentation missing in model
|
6261 + | pub(crate) fn set_fixed_length_blob(
|
6262 + | mut self,
|
6263 + | input: Option<
|
6264 + | impl ::std::convert::Into<
|
6265 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
6266 + | >,
|
6267 + | >,
|
6268 + | ) -> Self {
|
6269 + | self.fixed_length_blob = input.map(|v| v.into());
|
6270 + | self
|
6271 + | }
|
6272 + | #[allow(missing_docs)] // documentation missing in model
|
6273 + | pub(crate) fn set_range_integer(
|
6274 + | mut self,
|
6275 + | input: impl ::std::convert::Into<
|
6276 + | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
6277 + | >,
|
6278 + | ) -> Self {
|
6279 + | self.range_integer = Some(input.into());
|
6280 + | self
|
6281 + | }
|
6282 + | #[allow(missing_docs)] // documentation missing in model
|
6283 + | pub(crate) fn set_min_range_integer(
|
6284 + | mut self,
|
6285 + | input: impl ::std::convert::Into<
|
6286 + | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
6287 + | >,
|
6288 + | ) -> Self {
|
6289 + | self.min_range_integer = Some(input.into());
|
6290 + | self
|
6291 + | }
|
6292 + | #[allow(missing_docs)] // documentation missing in model
|
6293 + | pub(crate) fn set_max_range_integer(
|
6294 + | mut self,
|
6295 + | input: impl ::std::convert::Into<
|
6296 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
6297 + | >,
|
6298 + | ) -> Self {
|
6299 + | self.max_range_integer = Some(input.into());
|
6300 + | self
|
6301 + | }
|
6302 + | #[allow(missing_docs)] // documentation missing in model
|
6303 + | pub(crate) fn set_fixed_value_integer(
|
6304 + | mut self,
|
6305 + | input: impl ::std::convert::Into<
|
6306 + | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
6307 + | >,
|
6308 + | ) -> Self {
|
6309 + | self.fixed_value_integer = Some(input.into());
|
6310 + | self
|
6311 + | }
|
6312 + | #[allow(missing_docs)] // documentation missing in model
|
6313 + | pub(crate) fn set_range_short(
|
6314 + | mut self,
|
6315 + | input: impl ::std::convert::Into<
|
6316 + | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
6317 + | >,
|
6318 + | ) -> Self {
|
6319 + | self.range_short = Some(input.into());
|
6320 + | self
|
6321 + | }
|
6322 + | #[allow(missing_docs)] // documentation missing in model
|
6323 + | pub(crate) fn set_min_range_short(
|
6324 + | mut self,
|
6325 + | input: impl ::std::convert::Into<
|
6326 + | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
6327 + | >,
|
6328 + | ) -> Self {
|
6329 + | self.min_range_short = Some(input.into());
|
6330 + | self
|
6331 + | }
|
6332 + | #[allow(missing_docs)] // documentation missing in model
|
6333 + | pub(crate) fn set_max_range_short(
|
6334 + | mut self,
|
6335 + | input: impl ::std::convert::Into<
|
6336 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
6337 + | >,
|
6338 + | ) -> Self {
|
6339 + | self.max_range_short = Some(input.into());
|
6340 + | self
|
6341 + | }
|
6342 + | #[allow(missing_docs)] // documentation missing in model
|
6343 + | pub(crate) fn set_fixed_value_short(
|
6344 + | mut self,
|
6345 + | input: impl ::std::convert::Into<
|
6346 + | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
6347 + | >,
|
6348 + | ) -> Self {
|
6349 + | self.fixed_value_short = Some(input.into());
|
6350 + | self
|
6351 + | }
|
6352 + | #[allow(missing_docs)] // documentation missing in model
|
6353 + | pub(crate) fn set_range_long(
|
6354 + | mut self,
|
6355 + | input: impl ::std::convert::Into<
|
6356 + | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
6357 + | >,
|
6358 + | ) -> Self {
|
6359 + | self.range_long = Some(input.into());
|
6360 + | self
|
6361 + | }
|
6362 + | #[allow(missing_docs)] // documentation missing in model
|
6363 + | pub(crate) fn set_min_range_long(
|
6364 + | mut self,
|
6365 + | input: impl ::std::convert::Into<
|
6366 + | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
6367 + | >,
|
6368 + | ) -> Self {
|
6369 + | self.min_range_long = Some(input.into());
|
6370 + | self
|
6371 + | }
|
6372 + | #[allow(missing_docs)] // documentation missing in model
|
6373 + | pub(crate) fn set_max_range_long(
|
6374 + | mut self,
|
6375 + | input: impl ::std::convert::Into<
|
6376 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
6377 + | >,
|
6378 + | ) -> Self {
|
6379 + | self.max_range_long = Some(input.into());
|
6380 + | self
|
6381 + | }
|
6382 + | #[allow(missing_docs)] // documentation missing in model
|
6383 + | pub(crate) fn set_fixed_value_long(
|
6384 + | mut self,
|
6385 + | input: impl ::std::convert::Into<
|
6386 + | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
6387 + | >,
|
6388 + | ) -> Self {
|
6389 + | self.fixed_value_long = Some(input.into());
|
6390 + | self
|
6391 + | }
|
6392 + | #[allow(missing_docs)] // documentation missing in model
|
6393 + | pub(crate) fn set_range_byte(
|
6394 + | mut self,
|
6395 + | input: impl ::std::convert::Into<
|
6396 + | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
6397 + | >,
|
6398 + | ) -> Self {
|
6399 + | self.range_byte = Some(input.into());
|
6400 + | self
|
6401 + | }
|
6402 + | #[allow(missing_docs)] // documentation missing in model
|
6403 + | pub(crate) fn set_min_range_byte(
|
6404 + | mut self,
|
6405 + | input: impl ::std::convert::Into<
|
6406 + | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
6407 + | >,
|
6408 + | ) -> Self {
|
6409 + | self.min_range_byte = Some(input.into());
|
6410 + | self
|
6411 + | }
|
6412 + | #[allow(missing_docs)] // documentation missing in model
|
6413 + | pub(crate) fn set_max_range_byte(
|
6414 + | mut self,
|
6415 + | input: impl ::std::convert::Into<
|
6416 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
6417 + | >,
|
6418 + | ) -> Self {
|
6419 + | self.max_range_byte = Some(input.into());
|
6420 + | self
|
6421 + | }
|
6422 + | #[allow(missing_docs)] // documentation missing in model
|
6423 + | pub(crate) fn set_fixed_value_byte(
|
6424 + | mut self,
|
6425 + | input: impl ::std::convert::Into<
|
6426 + | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
6427 + | >,
|
6428 + | ) -> Self {
|
6429 + | self.fixed_value_byte = Some(input.into());
|
6430 + | self
|
6431 + | }
|
6432 + | #[allow(missing_docs)] // documentation missing in model
|
6433 + | pub(crate) fn set_con_b_list(
|
6434 + | mut self,
|
6435 + | input: Option<
|
6436 + | impl ::std::convert::Into<
|
6437 + | crate::constrained::MaybeConstrained<
|
6438 + | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
6439 + | >,
|
6440 + | >,
|
6441 + | >,
|
6442 + | ) -> Self {
|
6443 + | self.con_b_list = input.map(|v| v.into());
|
6444 + | self
|
6445 + | }
|
6446 + | #[allow(missing_docs)] // documentation missing in model
|
6447 + | pub(crate) fn set_length_list(
|
6448 + | mut self,
|
6449 + | input: Option<
|
6450 + | impl ::std::convert::Into<
|
6451 + | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
6452 + | >,
|
6453 + | >,
|
6454 + | ) -> Self {
|
6455 + | self.length_list = input.map(|v| v.into());
|
6456 + | self
|
6457 + | }
|
6458 + | #[allow(missing_docs)] // documentation missing in model
|
6459 + | pub(crate) fn set_sensitive_length_list(
|
6460 + | mut self,
|
6461 + | input: Option<
|
6462 + | impl ::std::convert::Into<
|
6463 + | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
6464 + | >,
|
6465 + | >,
|
6466 + | ) -> Self {
|
6467 + | self.sensitive_length_list = input.map(|v| v.into());
|
6468 + | self
|
6469 + | }
|
6470 + | #[allow(missing_docs)] // documentation missing in model
|
6471 + | pub(crate) fn set_con_b_set(
|
6472 + | mut self,
|
6473 + | input: Option<
|
6474 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6475 + | >,
|
6476 + | ) -> Self {
|
6477 + | self.con_b_set = input.map(|v| v.into());
|
6478 + | self
|
6479 + | }
|
6480 + | #[allow(missing_docs)] // documentation missing in model
|
6481 + | pub(crate) fn set_con_b_map(
|
6482 + | mut self,
|
6483 + | input: Option<
|
6484 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6485 + | >,
|
6486 + | ) -> Self {
|
6487 + | self.con_b_map = input.map(|v| v.into());
|
6488 + | self
|
6489 + | }
|
6490 + | #[allow(missing_docs)] // documentation missing in model
|
6491 + | pub(crate) fn set_length_map(
|
6492 + | mut self,
|
6493 + | input: Option<
|
6494 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6495 + | >,
|
6496 + | ) -> Self {
|
6497 + | self.length_map = input.map(|v| v.into());
|
6498 + | self
|
6499 + | }
|
6500 + | #[allow(missing_docs)] // documentation missing in model
|
6501 + | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
6502 + | mut self,
|
6503 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
6504 + | ) -> Self {
|
6505 + | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
6506 + | self
|
6507 + | }
|
6508 + | #[allow(missing_docs)] // documentation missing in model
|
6509 + | pub(crate) fn set_sparse_map(
|
6510 + | mut self,
|
6511 + | input: Option<
|
6512 + | impl ::std::convert::Into<
|
6513 + | crate::constrained::MaybeConstrained<
|
6514 + | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
6515 + | >,
|
6516 + | >,
|
6517 + | >,
|
6518 + | ) -> Self {
|
6519 + | self.sparse_map = input.map(|v| v.into());
|
6520 + | self
|
6521 + | }
|
6522 + | #[allow(missing_docs)] // documentation missing in model
|
6523 + | pub(crate) fn set_sparse_list(
|
6524 + | mut self,
|
6525 + | input: Option<
|
6526 + | impl ::std::convert::Into<
|
6527 + | crate::constrained::MaybeConstrained<
|
6528 + | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
6529 + | >,
|
6530 + | >,
|
6531 + | >,
|
6532 + | ) -> Self {
|
6533 + | self.sparse_list = input.map(|v| v.into());
|
6534 + | self
|
6535 + | }
|
6536 + | #[allow(missing_docs)] // documentation missing in model
|
6537 + | pub(crate) fn set_sparse_length_map(
|
6538 + | mut self,
|
6539 + | input: Option<
|
6540 + | impl ::std::convert::Into<
|
6541 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
6542 + | >,
|
6543 + | >,
|
6544 + | ) -> Self {
|
6545 + | self.sparse_length_map = input.map(|v| v.into());
|
6546 + | self
|
6547 + | }
|
6548 + | #[allow(missing_docs)] // documentation missing in model
|
6549 + | pub(crate) fn set_sparse_length_list(
|
6550 + | mut self,
|
6551 + | input: Option<
|
6552 + | impl ::std::convert::Into<
|
6553 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
6554 + | >,
|
6555 + | >,
|
6556 + | ) -> Self {
|
6557 + | self.sparse_length_list = input.map(|v| v.into());
|
6558 + | self
|
6559 + | }
|
6560 + | /// A union with constrained members.
|
6561 + | pub(crate) fn set_constrained_union(
|
6562 + | mut self,
|
6563 + | input: Option<
|
6564 + | impl ::std::convert::Into<
|
6565 + | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
6566 + | >,
|
6567 + | >,
|
6568 + | ) -> Self {
|
6569 + | self.constrained_union = input.map(|v| v.into());
|
6570 + | self
|
6571 + | }
|
6572 + | #[allow(missing_docs)] // documentation missing in model
|
6573 + | pub(crate) fn set_enum_string(
|
6574 + | mut self,
|
6575 + | input: Option<
|
6576 + | impl ::std::convert::Into<
|
6577 + | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6578 + | >,
|
6579 + | >,
|
6580 + | ) -> Self {
|
6581 + | self.enum_string = input.map(|v| v.into());
|
6582 + | self
|
6583 + | }
|
6584 + | #[allow(missing_docs)] // documentation missing in model
|
6585 + | pub(crate) fn set_list_of_length_string(
|
6586 + | mut self,
|
6587 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
6588 + | ) -> Self {
|
6589 + | self.list_of_length_string = input.map(|v| v.into());
|
6590 + | self
|
6591 + | }
|
6592 + | #[allow(missing_docs)] // documentation missing in model
|
6593 + | pub(crate) fn set_set_of_length_string(
|
6594 + | mut self,
|
6595 + | input: Option<
|
6596 + | impl ::std::convert::Into<
|
6597 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
6598 + | >,
|
6599 + | >,
|
6600 + | ) -> Self {
|
6601 + | self.set_of_length_string = input.map(|v| v.into());
|
6602 + | self
|
6603 + | }
|
6604 + | #[allow(missing_docs)] // documentation missing in model
|
6605 + | pub(crate) fn set_map_of_length_string(
|
6606 + | mut self,
|
6607 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
6608 + | ) -> Self {
|
6609 + | self.map_of_length_string = input.map(|v| v.into());
|
6610 + | self
|
6611 + | }
|
6612 + | #[allow(missing_docs)] // documentation missing in model
|
6613 + | pub(crate) fn set_list_of_length_blob(
|
6614 + | mut self,
|
6615 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
6616 + | ) -> Self {
|
6617 + | self.list_of_length_blob = input.map(|v| v.into());
|
6618 + | self
|
6619 + | }
|
6620 + | #[allow(missing_docs)] // documentation missing in model
|
6621 + | pub(crate) fn set_map_of_length_blob(
|
6622 + | mut self,
|
6623 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
6624 + | ) -> Self {
|
6625 + | self.map_of_length_blob = input.map(|v| v.into());
|
6626 + | self
|
6627 + | }
|
6628 + | #[allow(missing_docs)] // documentation missing in model
|
6629 + | pub(crate) fn set_list_of_range_integer(
|
6630 + | mut self,
|
6631 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
6632 + | ) -> Self {
|
6633 + | self.list_of_range_integer = input.map(|v| v.into());
|
6634 + | self
|
6635 + | }
|
6636 + | #[allow(missing_docs)] // documentation missing in model
|
6637 + | pub(crate) fn set_set_of_range_integer(
|
6638 + | mut self,
|
6639 + | input: Option<
|
6640 + | impl ::std::convert::Into<
|
6641 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
6642 + | >,
|
6643 + | >,
|
6644 + | ) -> Self {
|
6645 + | self.set_of_range_integer = input.map(|v| v.into());
|
6646 + | self
|
6647 + | }
|
6648 + | #[allow(missing_docs)] // documentation missing in model
|
6649 + | pub(crate) fn set_map_of_range_integer(
|
6650 + | mut self,
|
6651 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
6652 + | ) -> Self {
|
6653 + | self.map_of_range_integer = input.map(|v| v.into());
|
6654 + | self
|
6655 + | }
|
6656 + | #[allow(missing_docs)] // documentation missing in model
|
6657 + | pub(crate) fn set_list_of_range_short(
|
6658 + | mut self,
|
6659 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
6660 + | ) -> Self {
|
6661 + | self.list_of_range_short = input.map(|v| v.into());
|
6662 + | self
|
6663 + | }
|
6664 + | #[allow(missing_docs)] // documentation missing in model
|
6665 + | pub(crate) fn set_set_of_range_short(
|
6666 + | mut self,
|
6667 + | input: Option<
|
6668 + | impl ::std::convert::Into<
|
6669 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
6670 + | >,
|
6671 + | >,
|
6672 + | ) -> Self {
|
6673 + | self.set_of_range_short = input.map(|v| v.into());
|
6674 + | self
|
6675 + | }
|
6676 + | #[allow(missing_docs)] // documentation missing in model
|
6677 + | pub(crate) fn set_map_of_range_short(
|
6678 + | mut self,
|
6679 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
6680 + | ) -> Self {
|
6681 + | self.map_of_range_short = input.map(|v| v.into());
|
6682 + | self
|
6683 + | }
|
6684 + | #[allow(missing_docs)] // documentation missing in model
|
6685 + | pub(crate) fn set_list_of_range_long(
|
6686 + | mut self,
|
6687 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
6688 + | ) -> Self {
|
6689 + | self.list_of_range_long = input.map(|v| v.into());
|
6690 + | self
|
6691 + | }
|
6692 + | #[allow(missing_docs)] // documentation missing in model
|
6693 + | pub(crate) fn set_set_of_range_long(
|
6694 + | mut self,
|
6695 + | input: Option<
|
6696 + | impl ::std::convert::Into<
|
6697 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
6698 + | >,
|
6699 + | >,
|
6700 + | ) -> Self {
|
6701 + | self.set_of_range_long = input.map(|v| v.into());
|
6702 + | self
|
6703 + | }
|
6704 + | #[allow(missing_docs)] // documentation missing in model
|
6705 + | pub(crate) fn set_map_of_range_long(
|
6706 + | mut self,
|
6707 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
6708 + | ) -> Self {
|
6709 + | self.map_of_range_long = input.map(|v| v.into());
|
6710 + | self
|
6711 + | }
|
6712 + | #[allow(missing_docs)] // documentation missing in model
|
6713 + | pub(crate) fn set_list_of_range_byte(
|
6714 + | mut self,
|
6715 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
6716 + | ) -> Self {
|
6717 + | self.list_of_range_byte = input.map(|v| v.into());
|
6718 + | self
|
6719 + | }
|
6720 + | #[allow(missing_docs)] // documentation missing in model
|
6721 + | pub(crate) fn set_set_of_range_byte(
|
6722 + | mut self,
|
6723 + | input: Option<
|
6724 + | impl ::std::convert::Into<
|
6725 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
6726 + | >,
|
6727 + | >,
|
6728 + | ) -> Self {
|
6729 + | self.set_of_range_byte = input.map(|v| v.into());
|
6730 + | self
|
6731 + | }
|
6732 + | #[allow(missing_docs)] // documentation missing in model
|
6733 + | pub(crate) fn set_map_of_range_byte(
|
6734 + | mut self,
|
6735 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
6736 + | ) -> Self {
|
6737 + | self.map_of_range_byte = input.map(|v| v.into());
|
6738 + | self
|
6739 + | }
|
6740 + | #[allow(missing_docs)] // documentation missing in model
|
6741 + | pub(crate) fn set_non_streaming_blob(
|
6742 + | mut self,
|
6743 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
6744 + | ) -> Self {
|
6745 + | self.non_streaming_blob = input.map(|v| v.into());
|
6746 + | self
|
6747 + | }
|
6748 + | #[allow(missing_docs)] // documentation missing in model
|
6749 + | pub(crate) fn set_pattern_string(
|
6750 + | mut self,
|
6751 + | input: Option<
|
6752 + | impl ::std::convert::Into<
|
6753 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
6754 + | >,
|
6755 + | >,
|
6756 + | ) -> Self {
|
6757 + | self.pattern_string = input.map(|v| v.into());
|
6758 + | self
|
6759 + | }
|
6760 + | #[allow(missing_docs)] // documentation missing in model
|
6761 + | pub(crate) fn set_map_of_pattern_string(
|
6762 + | mut self,
|
6763 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
6764 + | ) -> Self {
|
6765 + | self.map_of_pattern_string = input.map(|v| v.into());
|
6766 + | self
|
6767 + | }
|
6768 + | #[allow(missing_docs)] // documentation missing in model
|
6769 + | pub(crate) fn set_list_of_pattern_string(
|
6770 + | mut self,
|
6771 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
6772 + | ) -> Self {
|
6773 + | self.list_of_pattern_string = input.map(|v| v.into());
|
6774 + | self
|
6775 + | }
|
6776 + | #[allow(missing_docs)] // documentation missing in model
|
6777 + | pub(crate) fn set_set_of_pattern_string(
|
6778 + | mut self,
|
6779 + | input: Option<
|
6780 + | impl ::std::convert::Into<
|
6781 + | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
6782 + | >,
|
6783 + | >,
|
6784 + | ) -> Self {
|
6785 + | self.set_of_pattern_string = input.map(|v| v.into());
|
6786 + | self
|
6787 + | }
|
6788 + | #[allow(missing_docs)] // documentation missing in model
|
6789 + | pub(crate) fn set_length_length_pattern_string(
|
6790 + | mut self,
|
6791 + | input: Option<
|
6792 + | impl ::std::convert::Into<
|
6793 + | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
6794 + | >,
|
6795 + | >,
|
6796 + | ) -> Self {
|
6797 + | self.length_length_pattern_string = input.map(|v| v.into());
|
6798 + | self
|
6799 + | }
|
6800 + | #[allow(missing_docs)] // documentation missing in model
|
6801 + | pub(crate) fn set_map_of_length_pattern_string(
|
6802 + | mut self,
|
6803 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
6804 + | ) -> Self {
|
6805 + | self.map_of_length_pattern_string = input.map(|v| v.into());
|
6806 + | self
|
6807 + | }
|
6808 + | #[allow(missing_docs)] // documentation missing in model
|
6809 + | pub(crate) fn set_list_of_length_pattern_string(
|
6810 + | mut self,
|
6811 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
6812 + | ) -> Self {
|
6813 + | self.list_of_length_pattern_string = input.map(|v| v.into());
|
6814 + | self
|
6815 + | }
|
6816 + | #[allow(missing_docs)] // documentation missing in model
|
6817 + | pub(crate) fn set_set_of_length_pattern_string(
|
6818 + | mut self,
|
6819 + | input: Option<
|
6820 + | impl ::std::convert::Into<
|
6821 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
6822 + | >,
|
6823 + | >,
|
6824 + | ) -> Self {
|
6825 + | self.set_of_length_pattern_string = input.map(|v| v.into());
|
6826 + | self
|
6827 + | }
|
6828 + | #[allow(missing_docs)] // documentation missing in model
|
6829 + | pub(crate) fn set_length_list_of_pattern_string(
|
6830 + | mut self,
|
6831 + | input: Option<
|
6832 + | impl ::std::convert::Into<
|
6833 + | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
6834 + | >,
|
6835 + | >,
|
6836 + | ) -> Self {
|
6837 + | self.length_list_of_pattern_string = input.map(|v| v.into());
|
6838 + | self
|
6839 + | }
|
6840 + | #[allow(missing_docs)] // documentation missing in model
|
6841 + | pub(crate) fn set_length_set_of_pattern_string(
|
6842 + | mut self,
|
6843 + | input: Option<
|
6844 + | impl ::std::convert::Into<
|
6845 + | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
6846 + | >,
|
6847 + | >,
|
6848 + | ) -> Self {
|
6849 + | self.length_set_of_pattern_string = input.map(|v| v.into());
|
6850 + | self
|
6851 + | }
|
6852 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
6853 + | ///
|
6854 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
6855 + | ///
|
6856 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6857 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
6858 + | self.build_enforcing_all_constraints()
|
6859 + | }
|
6860 + | fn build_enforcing_all_constraints(
|
6861 + | self,
|
6862 + | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
6863 + | Ok(crate::model::ConA {
|
6864 + | con_b: self
|
6865 + | .con_b
|
6866 + | .map(|v| match v {
|
6867 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6868 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6869 + | })
|
6870 + | .map(|res| res.map_err(ConstraintViolation::ConB))
|
6871 + | .transpose()?
|
6872 + | .ok_or(ConstraintViolation::MissingConB)?,
|
6873 + | opt_con_b: self
|
6874 + | .opt_con_b
|
6875 + | .map(|v| match v {
|
6876 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6877 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6878 + | })
|
6879 + | .map(|res| res.map_err(ConstraintViolation::OptConB))
|
6880 + | .transpose()?,
|
6881 + | length_string: self
|
6882 + | .length_string
|
6883 + | .map(|v| match v {
|
6884 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6885 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6886 + | })
|
6887 + | .map(|res| res.map_err(ConstraintViolation::LengthString))
|
6888 + | .transpose()?
|
6889 + | .map(|v: crate::model::LengthString| v.into()),
|
6890 + | min_length_string: self
|
6891 + | .min_length_string
|
6892 + | .map(|v| match v {
|
6893 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6894 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6895 + | })
|
6896 + | .map(|res| res.map_err(ConstraintViolation::MinLengthString))
|
6897 + | .transpose()?
|
6898 + | .map(|v: crate::model::MinLengthString| v.into()),
|
6899 + | max_length_string: self
|
6900 + | .max_length_string
|
6901 + | .map(|v| match v {
|
6902 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6903 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6904 + | })
|
6905 + | .map(|res| res.map_err(ConstraintViolation::MaxLengthString))
|
6906 + | .transpose()?
|
6907 + | .map(|v: crate::model::MaxLengthString| v.into()),
|
6908 + | fixed_length_string: self
|
6909 + | .fixed_length_string
|
6910 + | .map(|v| match v {
|
6911 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6912 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6913 + | })
|
6914 + | .map(|res| res.map_err(ConstraintViolation::FixedLengthString))
|
6915 + | .transpose()?
|
6916 + | .map(|v: crate::model::FixedLengthString| v.into()),
|
6917 + | length_blob: self
|
6918 + | .length_blob
|
6919 + | .map(|v| match v {
|
6920 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6921 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6922 + | })
|
6923 + | .map(|res| res.map_err(ConstraintViolation::LengthBlob))
|
6924 + | .transpose()?
|
6925 + | .map(|v: crate::model::LengthBlob| v.into()),
|
6926 + | min_length_blob: self
|
6927 + | .min_length_blob
|
6928 + | .map(|v| match v {
|
6929 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6930 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6931 + | })
|
6932 + | .map(|res| res.map_err(ConstraintViolation::MinLengthBlob))
|
6933 + | .transpose()?
|
6934 + | .map(|v: crate::model::MinLengthBlob| v.into()),
|
6935 + | max_length_blob: self
|
6936 + | .max_length_blob
|
6937 + | .map(|v| match v {
|
6938 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6939 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6940 + | })
|
6941 + | .map(|res| res.map_err(ConstraintViolation::MaxLengthBlob))
|
6942 + | .transpose()?
|
6943 + | .map(|v: crate::model::MaxLengthBlob| v.into()),
|
6944 + | fixed_length_blob: self
|
6945 + | .fixed_length_blob
|
6946 + | .map(|v| match v {
|
6947 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6948 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6949 + | })
|
6950 + | .map(|res| res.map_err(ConstraintViolation::FixedLengthBlob))
|
6951 + | .transpose()?
|
6952 + | .map(|v: crate::model::FixedLengthBlob| v.into()),
|
6953 + | range_integer: self
|
6954 + | .range_integer
|
6955 + | .map(|v| match v {
|
6956 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6957 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6958 + | })
|
6959 + | .map(|res| res.map_err(ConstraintViolation::RangeInteger))
|
6960 + | .transpose()?
|
6961 + | .map(|v: crate::model::RangeInteger| v.into())
|
6962 + | .unwrap_or(0i32),
|
6963 + | min_range_integer: self
|
6964 + | .min_range_integer
|
6965 + | .map(|v| match v {
|
6966 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6967 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6968 + | })
|
6969 + | .map(|res| res.map_err(ConstraintViolation::MinRangeInteger))
|
6970 + | .transpose()?
|
6971 + | .map(|v: crate::model::MinRangeInteger| v.into())
|
6972 + | .unwrap_or(0i32),
|
6973 + | max_range_integer: self
|
6974 + | .max_range_integer
|
6975 + | .map(|v| match v {
|
6976 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6977 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6978 + | })
|
6979 + | .map(|res| res.map_err(ConstraintViolation::MaxRangeInteger))
|
6980 + | .transpose()?
|
6981 + | .map(|v: crate::model::MaxRangeInteger| v.into())
|
6982 + | .unwrap_or(0i32),
|
6983 + | fixed_value_integer: self
|
6984 + | .fixed_value_integer
|
6985 + | .map(|v| match v {
|
6986 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6987 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6988 + | })
|
6989 + | .map(|res| res.map_err(ConstraintViolation::FixedValueInteger))
|
6990 + | .transpose()?
|
6991 + | .map(|v: crate::model::FixedValueInteger| v.into())
|
6992 + | .unwrap_or(0i32),
|
6993 + | range_short: self
|
6994 + | .range_short
|
6995 + | .map(|v| match v {
|
6996 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6997 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6998 + | })
|
6999 + | .map(|res| res.map_err(ConstraintViolation::RangeShort))
|
7000 + | .transpose()?
|
7001 + | .map(|v: crate::model::RangeShort| v.into())
|
7002 + | .unwrap_or(0i16),
|
7003 + | min_range_short: self
|
7004 + | .min_range_short
|
7005 + | .map(|v| match v {
|
7006 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7007 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7008 + | })
|
7009 + | .map(|res| res.map_err(ConstraintViolation::MinRangeShort))
|
7010 + | .transpose()?
|
7011 + | .map(|v: crate::model::MinRangeShort| v.into())
|
7012 + | .unwrap_or(0i16),
|
7013 + | max_range_short: self
|
7014 + | .max_range_short
|
7015 + | .map(|v| match v {
|
7016 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7017 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7018 + | })
|
7019 + | .map(|res| res.map_err(ConstraintViolation::MaxRangeShort))
|
7020 + | .transpose()?
|
7021 + | .map(|v: crate::model::MaxRangeShort| v.into())
|
7022 + | .unwrap_or(0i16),
|
7023 + | fixed_value_short: self
|
7024 + | .fixed_value_short
|
7025 + | .map(|v| match v {
|
7026 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7027 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7028 + | })
|
7029 + | .map(|res| res.map_err(ConstraintViolation::FixedValueShort))
|
7030 + | .transpose()?
|
7031 + | .map(|v: crate::model::FixedValueShort| v.into())
|
7032 + | .unwrap_or(0i16),
|
7033 + | range_long: self
|
7034 + | .range_long
|
7035 + | .map(|v| match v {
|
7036 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7037 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7038 + | })
|
7039 + | .map(|res| res.map_err(ConstraintViolation::RangeLong))
|
7040 + | .transpose()?
|
7041 + | .map(|v: crate::model::RangeLong| v.into())
|
7042 + | .unwrap_or(0i64),
|
7043 + | min_range_long: self
|
7044 + | .min_range_long
|
7045 + | .map(|v| match v {
|
7046 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7047 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7048 + | })
|
7049 + | .map(|res| res.map_err(ConstraintViolation::MinRangeLong))
|
7050 + | .transpose()?
|
7051 + | .map(|v: crate::model::MinRangeLong| v.into())
|
7052 + | .unwrap_or(0i64),
|
7053 + | max_range_long: self
|
7054 + | .max_range_long
|
7055 + | .map(|v| match v {
|
7056 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7057 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7058 + | })
|
7059 + | .map(|res| res.map_err(ConstraintViolation::MaxRangeLong))
|
7060 + | .transpose()?
|
7061 + | .map(|v: crate::model::MaxRangeLong| v.into())
|
7062 + | .unwrap_or(0i64),
|
7063 + | fixed_value_long: self
|
7064 + | .fixed_value_long
|
7065 + | .map(|v| match v {
|
7066 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7067 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7068 + | })
|
7069 + | .map(|res| res.map_err(ConstraintViolation::FixedValueLong))
|
7070 + | .transpose()?
|
7071 + | .map(|v: crate::model::FixedValueLong| v.into())
|
7072 + | .unwrap_or(0i64),
|
7073 + | range_byte: self
|
7074 + | .range_byte
|
7075 + | .map(|v| match v {
|
7076 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7077 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7078 + | })
|
7079 + | .map(|res| res.map_err(ConstraintViolation::RangeByte))
|
7080 + | .transpose()?
|
7081 + | .map(|v: crate::model::RangeByte| v.into())
|
7082 + | .unwrap_or(0i8),
|
7083 + | min_range_byte: self
|
7084 + | .min_range_byte
|
7085 + | .map(|v| match v {
|
7086 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7087 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7088 + | })
|
7089 + | .map(|res| res.map_err(ConstraintViolation::MinRangeByte))
|
7090 + | .transpose()?
|
7091 + | .map(|v: crate::model::MinRangeByte| v.into())
|
7092 + | .unwrap_or(0i8),
|
7093 + | max_range_byte: self
|
7094 + | .max_range_byte
|
7095 + | .map(|v| match v {
|
7096 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7097 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7098 + | })
|
7099 + | .map(|res| res.map_err(ConstraintViolation::MaxRangeByte))
|
7100 + | .transpose()?
|
7101 + | .map(|v: crate::model::MaxRangeByte| v.into())
|
7102 + | .unwrap_or(0i8),
|
7103 + | fixed_value_byte: self
|
7104 + | .fixed_value_byte
|
7105 + | .map(|v| match v {
|
7106 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7107 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7108 + | })
|
7109 + | .map(|res| res.map_err(ConstraintViolation::FixedValueByte))
|
7110 + | .transpose()?
|
7111 + | .map(|v: crate::model::FixedValueByte| v.into())
|
7112 + | .unwrap_or(0i8),
|
7113 + | con_b_list: self
|
7114 + | .con_b_list
|
7115 + | .map(|v| match v {
|
7116 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7117 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7118 + | })
|
7119 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::ConBList))
|
7120 + | .transpose()?,
|
7121 + | length_list: self
|
7122 + | .length_list
|
7123 + | .map(|v| match v {
|
7124 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7125 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7126 + | })
|
7127 + | .map(|res| res.map_err(ConstraintViolation::LengthList))
|
7128 + | .transpose()?
|
7129 + | .map(|v: crate::model::LengthList| v.into()),
|
7130 + | sensitive_length_list: self
|
7131 + | .sensitive_length_list
|
7132 + | .map(|v| match v {
|
7133 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7134 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7135 + | })
|
7136 + | .map(|res| res.map_err(ConstraintViolation::SensitiveLengthList))
|
7137 + | .transpose()?
|
7138 + | .map(|v: crate::model::SensitiveLengthList| v.into()),
|
7139 + | con_b_set: self
|
7140 + | .con_b_set
|
7141 + | .map(|v| match v {
|
7142 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7143 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7144 + | })
|
7145 + | .map(|res| res.map_err(ConstraintViolation::ConBSet))
|
7146 + | .transpose()?
|
7147 + | .map(|v: crate::model::ConBSet| v.into()),
|
7148 + | con_b_map: self
|
7149 + | .con_b_map
|
7150 + | .map(|v| match v {
|
7151 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7152 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7153 + | })
|
7154 + | .map(|res| res.map_err(ConstraintViolation::ConBMap))
|
7155 + | .transpose()?
|
7156 + | .map(|v: crate::model::ConBMap| v.into()),
|
7157 + | length_map: self
|
7158 + | .length_map
|
7159 + | .map(|v| match v {
|
7160 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7161 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7162 + | })
|
7163 + | .map(|res| res.map_err(ConstraintViolation::LengthMap))
|
7164 + | .transpose()?
|
7165 + | .map(|v: crate::model::LengthMap| v.into()),
|
7166 + | map_of_map_of_list_of_list_of_con_b: self
|
7167 + | .map_of_map_of_list_of_list_of_con_b
|
7168 + | .map(|v| match v {
|
7169 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7170 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7171 + | })
|
7172 + | .map(|res| {
|
7173 + | res.map(|v| v.into())
|
7174 + | .map_err(ConstraintViolation::MapOfMapOfListOfListOfConB)
|
7175 + | })
|
7176 + | .transpose()?,
|
7177 + | sparse_map: self
|
7178 + | .sparse_map
|
7179 + | .map(|v| match v {
|
7180 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7181 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7182 + | })
|
7183 + | .map(|res| {
|
7184 + | res.map(|v| v.into())
|
7185 + | .map_err(ConstraintViolation::SparseMap)
|
7186 + | })
|
7187 + | .transpose()?,
|
7188 + | sparse_list: self
|
7189 + | .sparse_list
|
7190 + | .map(|v| match v {
|
7191 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7192 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7193 + | })
|
7194 + | .map(|res| {
|
7195 + | res.map(|v| v.into())
|
7196 + | .map_err(ConstraintViolation::SparseList)
|
7197 + | })
|
7198 + | .transpose()?,
|
7199 + | sparse_length_map: self
|
7200 + | .sparse_length_map
|
7201 + | .map(|v| match v {
|
7202 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7203 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7204 + | })
|
7205 + | .map(|res| res.map_err(ConstraintViolation::SparseLengthMap))
|
7206 + | .transpose()?
|
7207 + | .map(|v: crate::model::SparseLengthMap| v.into()),
|
7208 + | sparse_length_list: self
|
7209 + | .sparse_length_list
|
7210 + | .map(|v| match v {
|
7211 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7212 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7213 + | })
|
7214 + | .map(|res| res.map_err(ConstraintViolation::SparseLengthList))
|
7215 + | .transpose()?
|
7216 + | .map(|v: crate::model::SparseLengthList| v.into()),
|
7217 + | constrained_union: self
|
7218 + | .constrained_union
|
7219 + | .map(|v| match v {
|
7220 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7221 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7222 + | })
|
7223 + | .map(|res| res.map_err(ConstraintViolation::ConstrainedUnion))
|
7224 + | .transpose()?,
|
7225 + | enum_string: self
|
7226 + | .enum_string
|
7227 + | .map(|v| match v {
|
7228 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7229 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7230 + | })
|
7231 + | .map(|res| res.map_err(ConstraintViolation::EnumString))
|
7232 + | .transpose()?,
|
7233 + | list_of_length_string: self
|
7234 + | .list_of_length_string
|
7235 + | .map(|v| match v {
|
7236 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7237 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7238 + | })
|
7239 + | .map(|res| {
|
7240 + | res.map(|v| v.into())
|
7241 + | .map_err(ConstraintViolation::ListOfLengthString)
|
7242 + | })
|
7243 + | .transpose()?,
|
7244 + | set_of_length_string: self
|
7245 + | .set_of_length_string
|
7246 + | .map(|v| match v {
|
7247 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7248 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7249 + | })
|
7250 + | .map(|res| res.map_err(ConstraintViolation::SetOfLengthString))
|
7251 + | .transpose()?
|
7252 + | .map(|v: crate::model::SetOfLengthString| v.into()),
|
7253 + | map_of_length_string: self
|
7254 + | .map_of_length_string
|
7255 + | .map(|v| match v {
|
7256 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7257 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7258 + | })
|
7259 + | .map(|res| {
|
7260 + | res.map(|v| v.into())
|
7261 + | .map_err(ConstraintViolation::MapOfLengthString)
|
7262 + | })
|
7263 + | .transpose()?,
|
7264 + | list_of_length_blob: self
|
7265 + | .list_of_length_blob
|
7266 + | .map(|v| match v {
|
7267 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7268 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7269 + | })
|
7270 + | .map(|res| {
|
7271 + | res.map(|v| v.into())
|
7272 + | .map_err(ConstraintViolation::ListOfLengthBlob)
|
7273 + | })
|
7274 + | .transpose()?,
|
7275 + | map_of_length_blob: self
|
7276 + | .map_of_length_blob
|
7277 + | .map(|v| match v {
|
7278 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7279 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7280 + | })
|
7281 + | .map(|res| {
|
7282 + | res.map(|v| v.into())
|
7283 + | .map_err(ConstraintViolation::MapOfLengthBlob)
|
7284 + | })
|
7285 + | .transpose()?,
|
7286 + | list_of_range_integer: self
|
7287 + | .list_of_range_integer
|
7288 + | .map(|v| match v {
|
7289 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7290 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7291 + | })
|
7292 + | .map(|res| {
|
7293 + | res.map(|v| v.into())
|
7294 + | .map_err(ConstraintViolation::ListOfRangeInteger)
|
7295 + | })
|
7296 + | .transpose()?,
|
7297 + | set_of_range_integer: self
|
7298 + | .set_of_range_integer
|
7299 + | .map(|v| match v {
|
7300 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7301 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7302 + | })
|
7303 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeInteger))
|
7304 + | .transpose()?
|
7305 + | .map(|v: crate::model::SetOfRangeInteger| v.into()),
|
7306 + | map_of_range_integer: self
|
7307 + | .map_of_range_integer
|
7308 + | .map(|v| match v {
|
7309 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7310 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7311 + | })
|
7312 + | .map(|res| {
|
7313 + | res.map(|v| v.into())
|
7314 + | .map_err(ConstraintViolation::MapOfRangeInteger)
|
7315 + | })
|
7316 + | .transpose()?,
|
7317 + | list_of_range_short: self
|
7318 + | .list_of_range_short
|
7319 + | .map(|v| match v {
|
7320 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7321 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7322 + | })
|
7323 + | .map(|res| {
|
7324 + | res.map(|v| v.into())
|
7325 + | .map_err(ConstraintViolation::ListOfRangeShort)
|
7326 + | })
|
7327 + | .transpose()?,
|
7328 + | set_of_range_short: self
|
7329 + | .set_of_range_short
|
7330 + | .map(|v| match v {
|
7331 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7332 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7333 + | })
|
7334 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeShort))
|
7335 + | .transpose()?
|
7336 + | .map(|v: crate::model::SetOfRangeShort| v.into()),
|
7337 + | map_of_range_short: self
|
7338 + | .map_of_range_short
|
7339 + | .map(|v| match v {
|
7340 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7341 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7342 + | })
|
7343 + | .map(|res| {
|
7344 + | res.map(|v| v.into())
|
7345 + | .map_err(ConstraintViolation::MapOfRangeShort)
|
7346 + | })
|
7347 + | .transpose()?,
|
7348 + | list_of_range_long: self
|
7349 + | .list_of_range_long
|
7350 + | .map(|v| match v {
|
7351 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7352 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7353 + | })
|
7354 + | .map(|res| {
|
7355 + | res.map(|v| v.into())
|
7356 + | .map_err(ConstraintViolation::ListOfRangeLong)
|
7357 + | })
|
7358 + | .transpose()?,
|
7359 + | set_of_range_long: self
|
7360 + | .set_of_range_long
|
7361 + | .map(|v| match v {
|
7362 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7363 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7364 + | })
|
7365 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeLong))
|
7366 + | .transpose()?
|
7367 + | .map(|v: crate::model::SetOfRangeLong| v.into()),
|
7368 + | map_of_range_long: self
|
7369 + | .map_of_range_long
|
7370 + | .map(|v| match v {
|
7371 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7372 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7373 + | })
|
7374 + | .map(|res| {
|
7375 + | res.map(|v| v.into())
|
7376 + | .map_err(ConstraintViolation::MapOfRangeLong)
|
7377 + | })
|
7378 + | .transpose()?,
|
7379 + | list_of_range_byte: self
|
7380 + | .list_of_range_byte
|
7381 + | .map(|v| match v {
|
7382 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7383 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7384 + | })
|
7385 + | .map(|res| {
|
7386 + | res.map(|v| v.into())
|
7387 + | .map_err(ConstraintViolation::ListOfRangeByte)
|
7388 + | })
|
7389 + | .transpose()?,
|
7390 + | set_of_range_byte: self
|
7391 + | .set_of_range_byte
|
7392 + | .map(|v| match v {
|
7393 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7394 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7395 + | })
|
7396 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeByte))
|
7397 + | .transpose()?
|
7398 + | .map(|v: crate::model::SetOfRangeByte| v.into()),
|
7399 + | map_of_range_byte: self
|
7400 + | .map_of_range_byte
|
7401 + | .map(|v| match v {
|
7402 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7403 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7404 + | })
|
7405 + | .map(|res| {
|
7406 + | res.map(|v| v.into())
|
7407 + | .map_err(ConstraintViolation::MapOfRangeByte)
|
7408 + | })
|
7409 + | .transpose()?,
|
7410 + | non_streaming_blob: self.non_streaming_blob,
|
7411 + | pattern_string: self
|
7412 + | .pattern_string
|
7413 + | .map(|v| match v {
|
7414 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7415 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7416 + | })
|
7417 + | .map(|res| res.map_err(ConstraintViolation::PatternString))
|
7418 + | .transpose()?
|
7419 + | .map(|v: crate::model::PatternString| v.into()),
|
7420 + | map_of_pattern_string: self
|
7421 + | .map_of_pattern_string
|
7422 + | .map(|v| match v {
|
7423 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7424 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7425 + | })
|
7426 + | .map(|res| {
|
7427 + | res.map(|v| v.into())
|
7428 + | .map_err(ConstraintViolation::MapOfPatternString)
|
7429 + | })
|
7430 + | .transpose()?,
|
7431 + | list_of_pattern_string: self
|
7432 + | .list_of_pattern_string
|
7433 + | .map(|v| match v {
|
7434 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7435 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7436 + | })
|
7437 + | .map(|res| {
|
7438 + | res.map(|v| v.into())
|
7439 + | .map_err(ConstraintViolation::ListOfPatternString)
|
7440 + | })
|
7441 + | .transpose()?,
|
7442 + | set_of_pattern_string: self
|
7443 + | .set_of_pattern_string
|
7444 + | .map(|v| match v {
|
7445 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7446 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7447 + | })
|
7448 + | .map(|res| res.map_err(ConstraintViolation::SetOfPatternString))
|
7449 + | .transpose()?
|
7450 + | .map(|v: crate::model::SetOfPatternString| v.into()),
|
7451 + | length_length_pattern_string: self
|
7452 + | .length_length_pattern_string
|
7453 + | .map(|v| match v {
|
7454 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7455 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7456 + | })
|
7457 + | .map(|res| res.map_err(ConstraintViolation::LengthLengthPatternString))
|
7458 + | .transpose()?
|
7459 + | .map(|v: crate::model::LengthPatternString| v.into()),
|
7460 + | map_of_length_pattern_string: self
|
7461 + | .map_of_length_pattern_string
|
7462 + | .map(|v| match v {
|
7463 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7464 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7465 + | })
|
7466 + | .map(|res| {
|
7467 + | res.map(|v| v.into())
|
7468 + | .map_err(ConstraintViolation::MapOfLengthPatternString)
|
7469 + | })
|
7470 + | .transpose()?,
|
7471 + | list_of_length_pattern_string: self
|
7472 + | .list_of_length_pattern_string
|
7473 + | .map(|v| match v {
|
7474 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7475 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7476 + | })
|
7477 + | .map(|res| {
|
7478 + | res.map(|v| v.into())
|
7479 + | .map_err(ConstraintViolation::ListOfLengthPatternString)
|
7480 + | })
|
7481 + | .transpose()?,
|
7482 + | set_of_length_pattern_string: self
|
7483 + | .set_of_length_pattern_string
|
7484 + | .map(|v| match v {
|
7485 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7486 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7487 + | })
|
7488 + | .map(|res| res.map_err(ConstraintViolation::SetOfLengthPatternString))
|
7489 + | .transpose()?
|
7490 + | .map(|v: crate::model::SetOfLengthPatternString| v.into()),
|
7491 + | length_list_of_pattern_string: self
|
7492 + | .length_list_of_pattern_string
|
7493 + | .map(|v| match v {
|
7494 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7495 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7496 + | })
|
7497 + | .map(|res| res.map_err(ConstraintViolation::LengthListOfPatternString))
|
7498 + | .transpose()?
|
7499 + | .map(|v: crate::model::LengthListOfPatternString| v.into()),
|
7500 + | length_set_of_pattern_string: self
|
7501 + | .length_set_of_pattern_string
|
7502 + | .map(|v| match v {
|
7503 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7504 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7505 + | })
|
7506 + | .map(|res| res.map_err(ConstraintViolation::LengthSetOfPatternString))
|
7507 + | .transpose()?
|
7508 + | .map(|v: crate::model::LengthSetOfPatternString| v.into()),
|
7509 + | })
|
7510 + | }
|
7511 + | }
|
7512 + | }
|
7513 + | /// See [`ConA`](crate::model::ConA).
|
7514 + | pub mod con_a {
|
7515 + |
|
7516 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7517 + | /// Holds one variant for each of the ways the builder can fail.
|
7518 + | #[allow(clippy::enum_variant_names)]
|
7519 + | pub enum ConstraintViolation {
|
7520 + | /// `con_b` was not provided but it is required when building `ConA`.
|
7521 + | MissingConB,
|
7522 + | }
|
7523 + | impl ::std::fmt::Display for ConstraintViolation {
|
7524 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7525 + | match self {
|
7526 + | ConstraintViolation::MissingConB => write!(
|
7527 + | f,
|
7528 + | "`con_b` was not provided but it is required when building `ConA`"
|
7529 + | ),
|
7530 + | }
|
7531 + | }
|
7532 + | }
|
7533 + | impl ::std::error::Error for ConstraintViolation {}
|
7534 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
7535 + | type Error = ConstraintViolation;
|
7536 + |
|
7537 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7538 + | builder.build()
|
7539 + | }
|
7540 + | }
|
7541 + | /// A builder for [`ConA`](crate::model::ConA).
|
7542 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7543 + | pub struct Builder {
|
7544 + | pub(crate) con_b: ::std::option::Option<crate::model::ConB>,
|
7545 + | pub(crate) opt_con_b: ::std::option::Option<crate::model::ConB>,
|
7546 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
7547 + | pub(crate) min_length_string: ::std::option::Option<::std::string::String>,
|
7548 + | pub(crate) max_length_string: ::std::option::Option<::std::string::String>,
|
7549 + | pub(crate) fixed_length_string: ::std::option::Option<::std::string::String>,
|
7550 + | pub(crate) length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7551 + | pub(crate) min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7552 + | pub(crate) max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7553 + | pub(crate) fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7554 + | pub(crate) range_integer: ::std::option::Option<i32>,
|
7555 + | pub(crate) min_range_integer: ::std::option::Option<i32>,
|
7556 + | pub(crate) max_range_integer: ::std::option::Option<i32>,
|
7557 + | pub(crate) fixed_value_integer: ::std::option::Option<i32>,
|
7558 + | pub(crate) range_short: ::std::option::Option<i16>,
|
7559 + | pub(crate) min_range_short: ::std::option::Option<i16>,
|
7560 + | pub(crate) max_range_short: ::std::option::Option<i16>,
|
7561 + | pub(crate) fixed_value_short: ::std::option::Option<i16>,
|
7562 + | pub(crate) range_long: ::std::option::Option<i64>,
|
7563 + | pub(crate) min_range_long: ::std::option::Option<i64>,
|
7564 + | pub(crate) max_range_long: ::std::option::Option<i64>,
|
7565 + | pub(crate) fixed_value_long: ::std::option::Option<i64>,
|
7566 + | pub(crate) range_byte: ::std::option::Option<i8>,
|
7567 + | pub(crate) min_range_byte: ::std::option::Option<i8>,
|
7568 + | pub(crate) max_range_byte: ::std::option::Option<i8>,
|
7569 + | pub(crate) fixed_value_byte: ::std::option::Option<i8>,
|
7570 + | pub(crate) con_b_list:
|
7571 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7572 + | pub(crate) length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7573 + | pub(crate) sensitive_length_list:
|
7574 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7575 + | pub(crate) con_b_set:
|
7576 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7577 + | pub(crate) con_b_map: ::std::option::Option<
|
7578 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7579 + | >,
|
7580 + | pub(crate) length_map: ::std::option::Option<
|
7581 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7582 + | >,
|
7583 + | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
7584 + | ::std::collections::HashMap<
|
7585 + | ::std::string::String,
|
7586 + | ::std::collections::HashMap<
|
7587 + | ::std::string::String,
|
7588 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7589 + | >,
|
7590 + | >,
|
7591 + | >,
|
7592 + | pub(crate) sparse_map: ::std::option::Option<
|
7593 + | ::std::collections::HashMap<
|
7594 + | ::std::string::String,
|
7595 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7596 + | >,
|
7597 + | >,
|
7598 + | pub(crate) sparse_list:
|
7599 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7600 + | pub(crate) sparse_length_map: ::std::option::Option<
|
7601 + | ::std::collections::HashMap<
|
7602 + | ::std::string::String,
|
7603 + | ::std::option::Option<::std::string::String>,
|
7604 + | >,
|
7605 + | >,
|
7606 + | pub(crate) sparse_length_list:
|
7607 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7608 + | pub(crate) constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7609 + | pub(crate) enum_string: ::std::option::Option<crate::model::EnumString>,
|
7610 + | pub(crate) list_of_length_string:
|
7611 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7612 + | pub(crate) set_of_length_string:
|
7613 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7614 + | pub(crate) map_of_length_string: ::std::option::Option<
|
7615 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7616 + | >,
|
7617 + | pub(crate) list_of_length_blob:
|
7618 + | ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
7619 + | pub(crate) map_of_length_blob: ::std::option::Option<
|
7620 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
7621 + | >,
|
7622 + | pub(crate) list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7623 + | pub(crate) set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7624 + | pub(crate) map_of_range_integer:
|
7625 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
7626 + | pub(crate) list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7627 + | pub(crate) set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7628 + | pub(crate) map_of_range_short:
|
7629 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
7630 + | pub(crate) list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7631 + | pub(crate) set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7632 + | pub(crate) map_of_range_long:
|
7633 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
7634 + | pub(crate) list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7635 + | pub(crate) set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7636 + | pub(crate) map_of_range_byte:
|
7637 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
7638 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7639 + | pub(crate) pattern_string: ::std::option::Option<::std::string::String>,
|
7640 + | pub(crate) map_of_pattern_string: ::std::option::Option<
|
7641 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7642 + | >,
|
7643 + | pub(crate) list_of_pattern_string:
|
7644 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7645 + | pub(crate) set_of_pattern_string:
|
7646 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7647 + | pub(crate) length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
7648 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<
|
7649 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7650 + | >,
|
7651 + | pub(crate) list_of_length_pattern_string:
|
7652 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7653 + | pub(crate) set_of_length_pattern_string:
|
7654 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7655 + | pub(crate) length_list_of_pattern_string:
|
7656 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7657 + | pub(crate) length_set_of_pattern_string:
|
7658 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7659 + | }
|
7660 + | impl Builder {
|
7661 + | #[allow(missing_docs)] // documentation missing in model
|
7662 + | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
7663 + | self.con_b = Some(input);
|
7664 + | self
|
7665 + | }
|
7666 + | #[allow(missing_docs)] // documentation missing in model
|
7667 + | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
7668 + | self.opt_con_b = input;
|
7669 + | self
|
7670 + | }
|
7671 + | #[allow(missing_docs)] // documentation missing in model
|
7672 + | pub fn length_string(
|
7673 + | mut self,
|
7674 + | input: ::std::option::Option<::std::string::String>,
|
7675 + | ) -> Self {
|
7676 + | self.length_string = input;
|
7677 + | self
|
7678 + | }
|
7679 + | #[allow(missing_docs)] // documentation missing in model
|
7680 + | pub fn min_length_string(
|
7681 + | mut self,
|
7682 + | input: ::std::option::Option<::std::string::String>,
|
7683 + | ) -> Self {
|
7684 + | self.min_length_string = input;
|
7685 + | self
|
7686 + | }
|
7687 + | #[allow(missing_docs)] // documentation missing in model
|
7688 + | pub fn max_length_string(
|
7689 + | mut self,
|
7690 + | input: ::std::option::Option<::std::string::String>,
|
7691 + | ) -> Self {
|
7692 + | self.max_length_string = input;
|
7693 + | self
|
7694 + | }
|
7695 + | #[allow(missing_docs)] // documentation missing in model
|
7696 + | pub fn fixed_length_string(
|
7697 + | mut self,
|
7698 + | input: ::std::option::Option<::std::string::String>,
|
7699 + | ) -> Self {
|
7700 + | self.fixed_length_string = input;
|
7701 + | self
|
7702 + | }
|
7703 + | #[allow(missing_docs)] // documentation missing in model
|
7704 + | pub fn length_blob(
|
7705 + | mut self,
|
7706 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7707 + | ) -> Self {
|
7708 + | self.length_blob = input;
|
7709 + | self
|
7710 + | }
|
7711 + | #[allow(missing_docs)] // documentation missing in model
|
7712 + | pub fn min_length_blob(
|
7713 + | mut self,
|
7714 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7715 + | ) -> Self {
|
7716 + | self.min_length_blob = input;
|
7717 + | self
|
7718 + | }
|
7719 + | #[allow(missing_docs)] // documentation missing in model
|
7720 + | pub fn max_length_blob(
|
7721 + | mut self,
|
7722 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7723 + | ) -> Self {
|
7724 + | self.max_length_blob = input;
|
7725 + | self
|
7726 + | }
|
7727 + | #[allow(missing_docs)] // documentation missing in model
|
7728 + | pub fn fixed_length_blob(
|
7729 + | mut self,
|
7730 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7731 + | ) -> Self {
|
7732 + | self.fixed_length_blob = input;
|
7733 + | self
|
7734 + | }
|
7735 + | #[allow(missing_docs)] // documentation missing in model
|
7736 + | pub fn range_integer(mut self, input: i32) -> Self {
|
7737 + | self.range_integer = Some(input);
|
7738 + | self
|
7739 + | }
|
7740 + | #[allow(missing_docs)] // documentation missing in model
|
7741 + | pub fn min_range_integer(mut self, input: i32) -> Self {
|
7742 + | self.min_range_integer = Some(input);
|
7743 + | self
|
7744 + | }
|
7745 + | #[allow(missing_docs)] // documentation missing in model
|
7746 + | pub fn max_range_integer(mut self, input: i32) -> Self {
|
7747 + | self.max_range_integer = Some(input);
|
7748 + | self
|
7749 + | }
|
7750 + | #[allow(missing_docs)] // documentation missing in model
|
7751 + | pub fn fixed_value_integer(mut self, input: i32) -> Self {
|
7752 + | self.fixed_value_integer = Some(input);
|
7753 + | self
|
7754 + | }
|
7755 + | #[allow(missing_docs)] // documentation missing in model
|
7756 + | pub fn range_short(mut self, input: i16) -> Self {
|
7757 + | self.range_short = Some(input);
|
7758 + | self
|
7759 + | }
|
7760 + | #[allow(missing_docs)] // documentation missing in model
|
7761 + | pub fn min_range_short(mut self, input: i16) -> Self {
|
7762 + | self.min_range_short = Some(input);
|
7763 + | self
|
7764 + | }
|
7765 + | #[allow(missing_docs)] // documentation missing in model
|
7766 + | pub fn max_range_short(mut self, input: i16) -> Self {
|
7767 + | self.max_range_short = Some(input);
|
7768 + | self
|
7769 + | }
|
7770 + | #[allow(missing_docs)] // documentation missing in model
|
7771 + | pub fn fixed_value_short(mut self, input: i16) -> Self {
|
7772 + | self.fixed_value_short = Some(input);
|
7773 + | self
|
7774 + | }
|
7775 + | #[allow(missing_docs)] // documentation missing in model
|
7776 + | pub fn range_long(mut self, input: i64) -> Self {
|
7777 + | self.range_long = Some(input);
|
7778 + | self
|
7779 + | }
|
7780 + | #[allow(missing_docs)] // documentation missing in model
|
7781 + | pub fn min_range_long(mut self, input: i64) -> Self {
|
7782 + | self.min_range_long = Some(input);
|
7783 + | self
|
7784 + | }
|
7785 + | #[allow(missing_docs)] // documentation missing in model
|
7786 + | pub fn max_range_long(mut self, input: i64) -> Self {
|
7787 + | self.max_range_long = Some(input);
|
7788 + | self
|
7789 + | }
|
7790 + | #[allow(missing_docs)] // documentation missing in model
|
7791 + | pub fn fixed_value_long(mut self, input: i64) -> Self {
|
7792 + | self.fixed_value_long = Some(input);
|
7793 + | self
|
7794 + | }
|
7795 + | #[allow(missing_docs)] // documentation missing in model
|
7796 + | pub fn range_byte(mut self, input: i8) -> Self {
|
7797 + | self.range_byte = Some(input);
|
7798 + | self
|
7799 + | }
|
7800 + | #[allow(missing_docs)] // documentation missing in model
|
7801 + | pub fn min_range_byte(mut self, input: i8) -> Self {
|
7802 + | self.min_range_byte = Some(input);
|
7803 + | self
|
7804 + | }
|
7805 + | #[allow(missing_docs)] // documentation missing in model
|
7806 + | pub fn max_range_byte(mut self, input: i8) -> Self {
|
7807 + | self.max_range_byte = Some(input);
|
7808 + | self
|
7809 + | }
|
7810 + | #[allow(missing_docs)] // documentation missing in model
|
7811 + | pub fn fixed_value_byte(mut self, input: i8) -> Self {
|
7812 + | self.fixed_value_byte = Some(input);
|
7813 + | self
|
7814 + | }
|
7815 + | #[allow(missing_docs)] // documentation missing in model
|
7816 + | pub fn con_b_list(
|
7817 + | mut self,
|
7818 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7819 + | ) -> Self {
|
7820 + | self.con_b_list = input;
|
7821 + | self
|
7822 + | }
|
7823 + | #[allow(missing_docs)] // documentation missing in model
|
7824 + | pub fn length_list(
|
7825 + | mut self,
|
7826 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7827 + | ) -> Self {
|
7828 + | self.length_list = input;
|
7829 + | self
|
7830 + | }
|
7831 + | #[allow(missing_docs)] // documentation missing in model
|
7832 + | pub fn sensitive_length_list(
|
7833 + | mut self,
|
7834 + | input: ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7835 + | ) -> Self {
|
7836 + | self.sensitive_length_list = input;
|
7837 + | self
|
7838 + | }
|
7839 + | #[allow(missing_docs)] // documentation missing in model
|
7840 + | pub fn con_b_set(
|
7841 + | mut self,
|
7842 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7843 + | ) -> Self {
|
7844 + | self.con_b_set = input;
|
7845 + | self
|
7846 + | }
|
7847 + | #[allow(missing_docs)] // documentation missing in model
|
7848 + | pub fn con_b_map(
|
7849 + | mut self,
|
7850 + | input: ::std::option::Option<
|
7851 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7852 + | >,
|
7853 + | ) -> Self {
|
7854 + | self.con_b_map = input;
|
7855 + | self
|
7856 + | }
|
7857 + | #[allow(missing_docs)] // documentation missing in model
|
7858 + | pub fn length_map(
|
7859 + | mut self,
|
7860 + | input: ::std::option::Option<
|
7861 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7862 + | >,
|
7863 + | ) -> Self {
|
7864 + | self.length_map = input;
|
7865 + | self
|
7866 + | }
|
7867 + | #[allow(missing_docs)] // documentation missing in model
|
7868 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
7869 + | mut self,
|
7870 + | input: ::std::option::Option<
|
7871 + | ::std::collections::HashMap<
|
7872 + | ::std::string::String,
|
7873 + | ::std::collections::HashMap<
|
7874 + | ::std::string::String,
|
7875 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7876 + | >,
|
7877 + | >,
|
7878 + | >,
|
7879 + | ) -> Self {
|
7880 + | self.map_of_map_of_list_of_list_of_con_b = input;
|
7881 + | self
|
7882 + | }
|
7883 + | #[allow(missing_docs)] // documentation missing in model
|
7884 + | pub fn sparse_map(
|
7885 + | mut self,
|
7886 + | input: ::std::option::Option<
|
7887 + | ::std::collections::HashMap<
|
7888 + | ::std::string::String,
|
7889 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7890 + | >,
|
7891 + | >,
|
7892 + | ) -> Self {
|
7893 + | self.sparse_map = input;
|
7894 + | self
|
7895 + | }
|
7896 + | #[allow(missing_docs)] // documentation missing in model
|
7897 + | pub fn sparse_list(
|
7898 + | mut self,
|
7899 + | input: ::std::option::Option<
|
7900 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7901 + | >,
|
7902 + | ) -> Self {
|
7903 + | self.sparse_list = input;
|
7904 + | self
|
7905 + | }
|
7906 + | #[allow(missing_docs)] // documentation missing in model
|
7907 + | pub fn sparse_length_map(
|
7908 + | mut self,
|
7909 + | input: ::std::option::Option<
|
7910 + | ::std::collections::HashMap<
|
7911 + | ::std::string::String,
|
7912 + | ::std::option::Option<::std::string::String>,
|
7913 + | >,
|
7914 + | >,
|
7915 + | ) -> Self {
|
7916 + | self.sparse_length_map = input;
|
7917 + | self
|
7918 + | }
|
7919 + | #[allow(missing_docs)] // documentation missing in model
|
7920 + | pub fn sparse_length_list(
|
7921 + | mut self,
|
7922 + | input: ::std::option::Option<
|
7923 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7924 + | >,
|
7925 + | ) -> Self {
|
7926 + | self.sparse_length_list = input;
|
7927 + | self
|
7928 + | }
|
7929 + | /// A union with constrained members.
|
7930 + | pub fn constrained_union(
|
7931 + | mut self,
|
7932 + | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7933 + | ) -> Self {
|
7934 + | self.constrained_union = input;
|
7935 + | self
|
7936 + | }
|
7937 + | #[allow(missing_docs)] // documentation missing in model
|
7938 + | pub fn enum_string(
|
7939 + | mut self,
|
7940 + | input: ::std::option::Option<crate::model::EnumString>,
|
7941 + | ) -> Self {
|
7942 + | self.enum_string = input;
|
7943 + | self
|
7944 + | }
|
7945 + | #[allow(missing_docs)] // documentation missing in model
|
7946 + | pub fn list_of_length_string(
|
7947 + | mut self,
|
7948 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7949 + | ) -> Self {
|
7950 + | self.list_of_length_string = input;
|
7951 + | self
|
7952 + | }
|
7953 + | #[allow(missing_docs)] // documentation missing in model
|
7954 + | pub fn set_of_length_string(
|
7955 + | mut self,
|
7956 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7957 + | ) -> Self {
|
7958 + | self.set_of_length_string = input;
|
7959 + | self
|
7960 + | }
|
7961 + | #[allow(missing_docs)] // documentation missing in model
|
7962 + | pub fn map_of_length_string(
|
7963 + | mut self,
|
7964 + | input: ::std::option::Option<
|
7965 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7966 + | >,
|
7967 + | ) -> Self {
|
7968 + | self.map_of_length_string = input;
|
7969 + | self
|
7970 + | }
|
7971 + | #[allow(missing_docs)] // documentation missing in model
|
7972 + | pub fn list_of_length_blob(
|
7973 + | mut self,
|
7974 + | input: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
7975 + | ) -> Self {
|
7976 + | self.list_of_length_blob = input;
|
7977 + | self
|
7978 + | }
|
7979 + | #[allow(missing_docs)] // documentation missing in model
|
7980 + | pub fn map_of_length_blob(
|
7981 + | mut self,
|
7982 + | input: ::std::option::Option<
|
7983 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
7984 + | >,
|
7985 + | ) -> Self {
|
7986 + | self.map_of_length_blob = input;
|
7987 + | self
|
7988 + | }
|
7989 + | #[allow(missing_docs)] // documentation missing in model
|
7990 + | pub fn list_of_range_integer(
|
7991 + | mut self,
|
7992 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
7993 + | ) -> Self {
|
7994 + | self.list_of_range_integer = input;
|
7995 + | self
|
7996 + | }
|
7997 + | #[allow(missing_docs)] // documentation missing in model
|
7998 + | pub fn set_of_range_integer(
|
7999 + | mut self,
|
8000 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
8001 + | ) -> Self {
|
8002 + | self.set_of_range_integer = input;
|
8003 + | self
|
8004 + | }
|
8005 + | #[allow(missing_docs)] // documentation missing in model
|
8006 + | pub fn map_of_range_integer(
|
8007 + | mut self,
|
8008 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
8009 + | ) -> Self {
|
8010 + | self.map_of_range_integer = input;
|
8011 + | self
|
8012 + | }
|
8013 + | #[allow(missing_docs)] // documentation missing in model
|
8014 + | pub fn list_of_range_short(
|
8015 + | mut self,
|
8016 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
8017 + | ) -> Self {
|
8018 + | self.list_of_range_short = input;
|
8019 + | self
|
8020 + | }
|
8021 + | #[allow(missing_docs)] // documentation missing in model
|
8022 + | pub fn set_of_range_short(
|
8023 + | mut self,
|
8024 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
8025 + | ) -> Self {
|
8026 + | self.set_of_range_short = input;
|
8027 + | self
|
8028 + | }
|
8029 + | #[allow(missing_docs)] // documentation missing in model
|
8030 + | pub fn map_of_range_short(
|
8031 + | mut self,
|
8032 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
8033 + | ) -> Self {
|
8034 + | self.map_of_range_short = input;
|
8035 + | self
|
8036 + | }
|
8037 + | #[allow(missing_docs)] // documentation missing in model
|
8038 + | pub fn list_of_range_long(
|
8039 + | mut self,
|
8040 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
8041 + | ) -> Self {
|
8042 + | self.list_of_range_long = input;
|
8043 + | self
|
8044 + | }
|
8045 + | #[allow(missing_docs)] // documentation missing in model
|
8046 + | pub fn set_of_range_long(
|
8047 + | mut self,
|
8048 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
8049 + | ) -> Self {
|
8050 + | self.set_of_range_long = input;
|
8051 + | self
|
8052 + | }
|
8053 + | #[allow(missing_docs)] // documentation missing in model
|
8054 + | pub fn map_of_range_long(
|
8055 + | mut self,
|
8056 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
8057 + | ) -> Self {
|
8058 + | self.map_of_range_long = input;
|
8059 + | self
|
8060 + | }
|
8061 + | #[allow(missing_docs)] // documentation missing in model
|
8062 + | pub fn list_of_range_byte(
|
8063 + | mut self,
|
8064 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
8065 + | ) -> Self {
|
8066 + | self.list_of_range_byte = input;
|
8067 + | self
|
8068 + | }
|
8069 + | #[allow(missing_docs)] // documentation missing in model
|
8070 + | pub fn set_of_range_byte(
|
8071 + | mut self,
|
8072 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
8073 + | ) -> Self {
|
8074 + | self.set_of_range_byte = input;
|
8075 + | self
|
8076 + | }
|
8077 + | #[allow(missing_docs)] // documentation missing in model
|
8078 + | pub fn map_of_range_byte(
|
8079 + | mut self,
|
8080 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
8081 + | ) -> Self {
|
8082 + | self.map_of_range_byte = input;
|
8083 + | self
|
8084 + | }
|
8085 + | #[allow(missing_docs)] // documentation missing in model
|
8086 + | pub fn non_streaming_blob(
|
8087 + | mut self,
|
8088 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
8089 + | ) -> Self {
|
8090 + | self.non_streaming_blob = input;
|
8091 + | self
|
8092 + | }
|
8093 + | #[allow(missing_docs)] // documentation missing in model
|
8094 + | pub fn pattern_string(
|
8095 + | mut self,
|
8096 + | input: ::std::option::Option<::std::string::String>,
|
8097 + | ) -> Self {
|
8098 + | self.pattern_string = input;
|
8099 + | self
|
8100 + | }
|
8101 + | #[allow(missing_docs)] // documentation missing in model
|
8102 + | pub fn map_of_pattern_string(
|
8103 + | mut self,
|
8104 + | input: ::std::option::Option<
|
8105 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8106 + | >,
|
8107 + | ) -> Self {
|
8108 + | self.map_of_pattern_string = input;
|
8109 + | self
|
8110 + | }
|
8111 + | #[allow(missing_docs)] // documentation missing in model
|
8112 + | pub fn list_of_pattern_string(
|
8113 + | mut self,
|
8114 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8115 + | ) -> Self {
|
8116 + | self.list_of_pattern_string = input;
|
8117 + | self
|
8118 + | }
|
8119 + | #[allow(missing_docs)] // documentation missing in model
|
8120 + | pub fn set_of_pattern_string(
|
8121 + | mut self,
|
8122 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8123 + | ) -> Self {
|
8124 + | self.set_of_pattern_string = input;
|
8125 + | self
|
8126 + | }
|
8127 + | #[allow(missing_docs)] // documentation missing in model
|
8128 + | pub fn length_length_pattern_string(
|
8129 + | mut self,
|
8130 + | input: ::std::option::Option<::std::string::String>,
|
8131 + | ) -> Self {
|
8132 + | self.length_length_pattern_string = input;
|
8133 + | self
|
8134 + | }
|
8135 + | #[allow(missing_docs)] // documentation missing in model
|
8136 + | pub fn map_of_length_pattern_string(
|
8137 + | mut self,
|
8138 + | input: ::std::option::Option<
|
8139 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8140 + | >,
|
8141 + | ) -> Self {
|
8142 + | self.map_of_length_pattern_string = input;
|
8143 + | self
|
8144 + | }
|
8145 + | #[allow(missing_docs)] // documentation missing in model
|
8146 + | pub fn list_of_length_pattern_string(
|
8147 + | mut self,
|
8148 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8149 + | ) -> Self {
|
8150 + | self.list_of_length_pattern_string = input;
|
8151 + | self
|
8152 + | }
|
8153 + | #[allow(missing_docs)] // documentation missing in model
|
8154 + | pub fn set_of_length_pattern_string(
|
8155 + | mut self,
|
8156 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8157 + | ) -> Self {
|
8158 + | self.set_of_length_pattern_string = input;
|
8159 + | self
|
8160 + | }
|
8161 + | #[allow(missing_docs)] // documentation missing in model
|
8162 + | pub fn length_list_of_pattern_string(
|
8163 + | mut self,
|
8164 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8165 + | ) -> Self {
|
8166 + | self.length_list_of_pattern_string = input;
|
8167 + | self
|
8168 + | }
|
8169 + | #[allow(missing_docs)] // documentation missing in model
|
8170 + | pub fn length_set_of_pattern_string(
|
8171 + | mut self,
|
8172 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8173 + | ) -> Self {
|
8174 + | self.length_set_of_pattern_string = input;
|
8175 + | self
|
8176 + | }
|
8177 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
8178 + | ///
|
8179 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if you do not provide a value for all non-`Option`al members.
|
8180 + | ///
|
8181 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
8182 + | self.build_enforcing_required_and_enum_traits()
|
8183 + | }
|
8184 + | fn build_enforcing_required_and_enum_traits(
|
8185 + | self,
|
8186 + | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
8187 + | Ok(crate::model::ConA {
|
8188 + | con_b: self.con_b.ok_or(ConstraintViolation::MissingConB)?,
|
8189 + | opt_con_b: self.opt_con_b,
|
8190 + | length_string: self.length_string,
|
8191 + | min_length_string: self.min_length_string,
|
8192 + | max_length_string: self.max_length_string,
|
8193 + | fixed_length_string: self.fixed_length_string,
|
8194 + | length_blob: self.length_blob,
|
8195 + | min_length_blob: self.min_length_blob,
|
8196 + | max_length_blob: self.max_length_blob,
|
8197 + | fixed_length_blob: self.fixed_length_blob,
|
8198 + | range_integer: self.range_integer.unwrap_or(0i32),
|
8199 + | min_range_integer: self.min_range_integer.unwrap_or(0i32),
|
8200 + | max_range_integer: self.max_range_integer.unwrap_or(0i32),
|
8201 + | fixed_value_integer: self.fixed_value_integer.unwrap_or(0i32),
|
8202 + | range_short: self.range_short.unwrap_or(0i16),
|
8203 + | min_range_short: self.min_range_short.unwrap_or(0i16),
|
8204 + | max_range_short: self.max_range_short.unwrap_or(0i16),
|
8205 + | fixed_value_short: self.fixed_value_short.unwrap_or(0i16),
|
8206 + | range_long: self.range_long.unwrap_or(0i64),
|
8207 + | min_range_long: self.min_range_long.unwrap_or(0i64),
|
8208 + | max_range_long: self.max_range_long.unwrap_or(0i64),
|
8209 + | fixed_value_long: self.fixed_value_long.unwrap_or(0i64),
|
8210 + | range_byte: self.range_byte.unwrap_or(0i8),
|
8211 + | min_range_byte: self.min_range_byte.unwrap_or(0i8),
|
8212 + | max_range_byte: self.max_range_byte.unwrap_or(0i8),
|
8213 + | fixed_value_byte: self.fixed_value_byte.unwrap_or(0i8),
|
8214 + | con_b_list: self.con_b_list,
|
8215 + | length_list: self.length_list,
|
8216 + | sensitive_length_list: self.sensitive_length_list,
|
8217 + | con_b_set: self.con_b_set,
|
8218 + | con_b_map: self.con_b_map,
|
8219 + | length_map: self.length_map,
|
8220 + | map_of_map_of_list_of_list_of_con_b: self.map_of_map_of_list_of_list_of_con_b,
|
8221 + | sparse_map: self.sparse_map,
|
8222 + | sparse_list: self.sparse_list,
|
8223 + | sparse_length_map: self.sparse_length_map,
|
8224 + | sparse_length_list: self.sparse_length_list,
|
8225 + | constrained_union: self.constrained_union,
|
8226 + | enum_string: self.enum_string,
|
8227 + | list_of_length_string: self.list_of_length_string,
|
8228 + | set_of_length_string: self.set_of_length_string,
|
8229 + | map_of_length_string: self.map_of_length_string,
|
8230 + | list_of_length_blob: self.list_of_length_blob,
|
8231 + | map_of_length_blob: self.map_of_length_blob,
|
8232 + | list_of_range_integer: self.list_of_range_integer,
|
8233 + | set_of_range_integer: self.set_of_range_integer,
|
8234 + | map_of_range_integer: self.map_of_range_integer,
|
8235 + | list_of_range_short: self.list_of_range_short,
|
8236 + | set_of_range_short: self.set_of_range_short,
|
8237 + | map_of_range_short: self.map_of_range_short,
|
8238 + | list_of_range_long: self.list_of_range_long,
|
8239 + | set_of_range_long: self.set_of_range_long,
|
8240 + | map_of_range_long: self.map_of_range_long,
|
8241 + | list_of_range_byte: self.list_of_range_byte,
|
8242 + | set_of_range_byte: self.set_of_range_byte,
|
8243 + | map_of_range_byte: self.map_of_range_byte,
|
8244 + | non_streaming_blob: self.non_streaming_blob,
|
8245 + | pattern_string: self.pattern_string,
|
8246 + | map_of_pattern_string: self.map_of_pattern_string,
|
8247 + | list_of_pattern_string: self.list_of_pattern_string,
|
8248 + | set_of_pattern_string: self.set_of_pattern_string,
|
8249 + | length_length_pattern_string: self.length_length_pattern_string,
|
8250 + | map_of_length_pattern_string: self.map_of_length_pattern_string,
|
8251 + | list_of_length_pattern_string: self.list_of_length_pattern_string,
|
8252 + | set_of_length_pattern_string: self.set_of_length_pattern_string,
|
8253 + | length_list_of_pattern_string: self.length_list_of_pattern_string,
|
8254 + | length_set_of_pattern_string: self.length_set_of_pattern_string,
|
8255 + | })
|
8256 + | }
|
8257 + | }
|
8258 + | }
|
8259 + | pub(crate) mod length_set_of_pattern_string_internal {
|
8260 + |
|
8261 + | #[allow(clippy::enum_variant_names)]
|
8262 + | #[derive(Debug, PartialEq)]
|
8263 + | pub(crate) enum ConstraintViolation {
|
8264 + | /// Constraint violation error when the list doesn't have the required length
|
8265 + | Length(usize),
|
8266 + | /// Constraint violation error when the list does not contain unique items
|
8267 + | UniqueItems {
|
8268 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8269 + | /// at least two elements.
|
8270 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8271 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8272 + | /// Nothing is guaranteed about the order of the indices.
|
8273 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8274 + | /// The original vector, that contains duplicate items.
|
8275 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
8276 + | },
|
8277 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8278 + | /// The first component of the tuple is the index in the collection where the
|
8279 + | /// first constraint violation was found.
|
8280 + | #[doc(hidden)]
|
8281 + | Member(
|
8282 + | usize,
|
8283 + | crate::model::pattern_string_internal::ConstraintViolation,
|
8284 + | ),
|
8285 + | }
|
8286 + |
|
8287 + | impl ::std::fmt::Display for ConstraintViolation {
|
8288 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8289 + | let message = match self {
|
8290 + | Self::Length(length) => {
|
8291 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
8292 + | },
|
8293 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8294 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8295 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8296 + | failing_member)
|
8297 + | };
|
8298 + | write!(f, "{message}")
|
8299 + | }
|
8300 + | }
|
8301 + |
|
8302 + | impl ::std::error::Error for ConstraintViolation {}
|
8303 + | impl ConstraintViolation {
|
8304 + | pub(crate) fn as_validation_exception_field(
|
8305 + | self,
|
8306 + | path: ::std::string::String,
|
8307 + | ) -> crate::model::ValidationExceptionField {
|
8308 + | match self {
|
8309 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8310 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
8311 + | path,
|
8312 + | },
|
8313 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8314 + | crate::model::ValidationExceptionField {
|
8315 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8316 + | path,
|
8317 + | },
|
8318 + | Self::Member(index, member_constraint_violation) =>
|
8319 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8320 + | }
|
8321 + | }
|
8322 + | }
|
8323 + | }
|
8324 + | pub(crate) mod set_of_length_pattern_string_internal {
|
8325 + |
|
8326 + | #[allow(clippy::enum_variant_names)]
|
8327 + | #[derive(Debug, PartialEq)]
|
8328 + | pub(crate) enum ConstraintViolation {
|
8329 + | /// Constraint violation error when the list does not contain unique items
|
8330 + | UniqueItems {
|
8331 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8332 + | /// at least two elements.
|
8333 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8334 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8335 + | /// Nothing is guaranteed about the order of the indices.
|
8336 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8337 + | /// The original vector, that contains duplicate items.
|
8338 + | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
8339 + | },
|
8340 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8341 + | /// The first component of the tuple is the index in the collection where the
|
8342 + | /// first constraint violation was found.
|
8343 + | #[doc(hidden)]
|
8344 + | Member(
|
8345 + | usize,
|
8346 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
8347 + | ),
|
8348 + | }
|
8349 + |
|
8350 + | impl ::std::fmt::Display for ConstraintViolation {
|
8351 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8352 + | let message = match self {
|
8353 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8354 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8355 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8356 + | failing_member)
|
8357 + | };
|
8358 + | write!(f, "{message}")
|
8359 + | }
|
8360 + | }
|
8361 + |
|
8362 + | impl ::std::error::Error for ConstraintViolation {}
|
8363 + | impl ConstraintViolation {
|
8364 + | pub(crate) fn as_validation_exception_field(
|
8365 + | self,
|
8366 + | path: ::std::string::String,
|
8367 + | ) -> crate::model::ValidationExceptionField {
|
8368 + | match self {
|
8369 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8370 + | crate::model::ValidationExceptionField {
|
8371 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8372 + | path,
|
8373 + | },
|
8374 + | Self::Member(index, member_constraint_violation) =>
|
8375 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8376 + | }
|
8377 + | }
|
8378 + | }
|
8379 + | }
|
8380 + | pub(crate) mod set_of_pattern_string_internal {
|
8381 + |
|
8382 + | #[allow(clippy::enum_variant_names)]
|
8383 + | #[derive(Debug, PartialEq)]
|
8384 + | pub(crate) enum ConstraintViolation {
|
8385 + | /// Constraint violation error when the list does not contain unique items
|
8386 + | UniqueItems {
|
8387 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8388 + | /// at least two elements.
|
8389 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8390 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8391 + | /// Nothing is guaranteed about the order of the indices.
|
8392 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8393 + | /// The original vector, that contains duplicate items.
|
8394 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
8395 + | },
|
8396 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8397 + | /// The first component of the tuple is the index in the collection where the
|
8398 + | /// first constraint violation was found.
|
8399 + | #[doc(hidden)]
|
8400 + | Member(
|
8401 + | usize,
|
8402 + | crate::model::pattern_string_internal::ConstraintViolation,
|
8403 + | ),
|
8404 + | }
|
8405 + |
|
8406 + | impl ::std::fmt::Display for ConstraintViolation {
|
8407 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8408 + | let message = match self {
|
8409 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8410 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8411 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8412 + | failing_member)
|
8413 + | };
|
8414 + | write!(f, "{message}")
|
8415 + | }
|
8416 + | }
|
8417 + |
|
8418 + | impl ::std::error::Error for ConstraintViolation {}
|
8419 + | impl ConstraintViolation {
|
8420 + | pub(crate) fn as_validation_exception_field(
|
8421 + | self,
|
8422 + | path: ::std::string::String,
|
8423 + | ) -> crate::model::ValidationExceptionField {
|
8424 + | match self {
|
8425 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8426 + | crate::model::ValidationExceptionField {
|
8427 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8428 + | path,
|
8429 + | },
|
8430 + | Self::Member(index, member_constraint_violation) =>
|
8431 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8432 + | }
|
8433 + | }
|
8434 + | }
|
8435 + | }
|
8436 + | pub(crate) mod map_of_range_byte_internal {
|
8437 + |
|
8438 + | #[allow(clippy::enum_variant_names)]
|
8439 + | #[derive(Debug, PartialEq)]
|
8440 + | pub(crate) enum ConstraintViolation {
|
8441 + | #[doc(hidden)]
|
8442 + | Value(
|
8443 + | ::std::string::String,
|
8444 + | crate::model::range_byte_internal::ConstraintViolation,
|
8445 + | ),
|
8446 + | }
|
8447 + |
|
8448 + | impl ::std::fmt::Display for ConstraintViolation {
|
8449 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8450 + | match self {
|
8451 + | Self::Value(_, value_constraint_violation) => {
|
8452 + | write!(f, "{}", value_constraint_violation)
|
8453 + | }
|
8454 + | }
|
8455 + | }
|
8456 + | }
|
8457 + |
|
8458 + | impl ::std::error::Error for ConstraintViolation {}
|
8459 + | impl ConstraintViolation {
|
8460 + | pub(crate) fn as_validation_exception_field(
|
8461 + | self,
|
8462 + | path: ::std::string::String,
|
8463 + | ) -> crate::model::ValidationExceptionField {
|
8464 + | match self {
|
8465 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8466 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8467 + | }
|
8468 + | }
|
8469 + | }
|
8470 + | }
|
8471 + | pub(crate) mod range_byte_internal {
|
8472 + |
|
8473 + | #[derive(Debug, PartialEq)]
|
8474 + | pub enum ConstraintViolation {
|
8475 + | Range(i8),
|
8476 + | }
|
8477 + |
|
8478 + | impl ::std::fmt::Display for ConstraintViolation {
|
8479 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8480 + | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8481 + | }
|
8482 + | }
|
8483 + |
|
8484 + | impl ::std::error::Error for ConstraintViolation {}
|
8485 + | impl ConstraintViolation {
|
8486 + | pub(crate) fn as_validation_exception_field(
|
8487 + | self,
|
8488 + | path: ::std::string::String,
|
8489 + | ) -> crate::model::ValidationExceptionField {
|
8490 + | match self {
|
8491 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8492 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8493 + | path,
|
8494 + | },
|
8495 + | }
|
8496 + | }
|
8497 + | }
|
8498 + | }
|
8499 + | pub(crate) mod set_of_range_byte_internal {
|
8500 + |
|
8501 + | #[allow(clippy::enum_variant_names)]
|
8502 + | #[derive(Debug, PartialEq)]
|
8503 + | pub(crate) enum ConstraintViolation {
|
8504 + | /// Constraint violation error when the list does not contain unique items
|
8505 + | UniqueItems {
|
8506 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8507 + | /// at least two elements.
|
8508 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8509 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8510 + | /// Nothing is guaranteed about the order of the indices.
|
8511 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8512 + | /// The original vector, that contains duplicate items.
|
8513 + | original: ::std::vec::Vec<crate::model::RangeByte>,
|
8514 + | },
|
8515 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8516 + | /// The first component of the tuple is the index in the collection where the
|
8517 + | /// first constraint violation was found.
|
8518 + | #[doc(hidden)]
|
8519 + | Member(
|
8520 + | usize,
|
8521 + | crate::model::range_byte_internal::ConstraintViolation,
|
8522 + | ),
|
8523 + | }
|
8524 + |
|
8525 + | impl ::std::fmt::Display for ConstraintViolation {
|
8526 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8527 + | let message = match self {
|
8528 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8529 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8530 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8531 + | failing_member)
|
8532 + | };
|
8533 + | write!(f, "{message}")
|
8534 + | }
|
8535 + | }
|
8536 + |
|
8537 + | impl ::std::error::Error for ConstraintViolation {}
|
8538 + | impl ConstraintViolation {
|
8539 + | pub(crate) fn as_validation_exception_field(
|
8540 + | self,
|
8541 + | path: ::std::string::String,
|
8542 + | ) -> crate::model::ValidationExceptionField {
|
8543 + | match self {
|
8544 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8545 + | crate::model::ValidationExceptionField {
|
8546 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8547 + | path,
|
8548 + | },
|
8549 + | Self::Member(index, member_constraint_violation) =>
|
8550 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8551 + | }
|
8552 + | }
|
8553 + | }
|
8554 + | }
|
8555 + | pub(crate) mod list_of_range_byte_internal {
|
8556 + |
|
8557 + | #[allow(clippy::enum_variant_names)]
|
8558 + | #[derive(Debug, PartialEq)]
|
8559 + | pub(crate) enum ConstraintViolation {
|
8560 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8561 + | /// The first component of the tuple is the index in the collection where the
|
8562 + | /// first constraint violation was found.
|
8563 + | #[doc(hidden)]
|
8564 + | Member(
|
8565 + | usize,
|
8566 + | crate::model::range_byte_internal::ConstraintViolation,
|
8567 + | ),
|
8568 + | }
|
8569 + |
|
8570 + | impl ::std::fmt::Display for ConstraintViolation {
|
8571 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8572 + | let message = match self {
|
8573 + | Self::Member(index, failing_member) => format!(
|
8574 + | "Value at index {index} failed to satisfy constraint. {}",
|
8575 + | failing_member
|
8576 + | ),
|
8577 + | };
|
8578 + | write!(f, "{message}")
|
8579 + | }
|
8580 + | }
|
8581 + |
|
8582 + | impl ::std::error::Error for ConstraintViolation {}
|
8583 + | impl ConstraintViolation {
|
8584 + | pub(crate) fn as_validation_exception_field(
|
8585 + | self,
|
8586 + | path: ::std::string::String,
|
8587 + | ) -> crate::model::ValidationExceptionField {
|
8588 + | match self {
|
8589 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8590 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8591 + | }
|
8592 + | }
|
8593 + | }
|
8594 + | }
|
8595 + | pub(crate) mod map_of_range_long_internal {
|
8596 + |
|
8597 + | #[allow(clippy::enum_variant_names)]
|
8598 + | #[derive(Debug, PartialEq)]
|
8599 + | pub(crate) enum ConstraintViolation {
|
8600 + | #[doc(hidden)]
|
8601 + | Value(
|
8602 + | ::std::string::String,
|
8603 + | crate::model::range_long_internal::ConstraintViolation,
|
8604 + | ),
|
8605 + | }
|
8606 + |
|
8607 + | impl ::std::fmt::Display for ConstraintViolation {
|
8608 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8609 + | match self {
|
8610 + | Self::Value(_, value_constraint_violation) => {
|
8611 + | write!(f, "{}", value_constraint_violation)
|
8612 + | }
|
8613 + | }
|
8614 + | }
|
8615 + | }
|
8616 + |
|
8617 + | impl ::std::error::Error for ConstraintViolation {}
|
8618 + | impl ConstraintViolation {
|
8619 + | pub(crate) fn as_validation_exception_field(
|
8620 + | self,
|
8621 + | path: ::std::string::String,
|
8622 + | ) -> crate::model::ValidationExceptionField {
|
8623 + | match self {
|
8624 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8625 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8626 + | }
|
8627 + | }
|
8628 + | }
|
8629 + | }
|
8630 + | pub(crate) mod range_long_internal {
|
8631 + |
|
8632 + | #[derive(Debug, PartialEq)]
|
8633 + | pub enum ConstraintViolation {
|
8634 + | Range(i64),
|
8635 + | }
|
8636 + |
|
8637 + | impl ::std::fmt::Display for ConstraintViolation {
|
8638 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8639 + | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8640 + | }
|
8641 + | }
|
8642 + |
|
8643 + | impl ::std::error::Error for ConstraintViolation {}
|
8644 + | impl ConstraintViolation {
|
8645 + | pub(crate) fn as_validation_exception_field(
|
8646 + | self,
|
8647 + | path: ::std::string::String,
|
8648 + | ) -> crate::model::ValidationExceptionField {
|
8649 + | match self {
|
8650 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8651 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8652 + | path,
|
8653 + | },
|
8654 + | }
|
8655 + | }
|
8656 + | }
|
8657 + | }
|
8658 + | pub(crate) mod set_of_range_long_internal {
|
8659 + |
|
8660 + | #[allow(clippy::enum_variant_names)]
|
8661 + | #[derive(Debug, PartialEq)]
|
8662 + | pub(crate) enum ConstraintViolation {
|
8663 + | /// Constraint violation error when the list does not contain unique items
|
8664 + | UniqueItems {
|
8665 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8666 + | /// at least two elements.
|
8667 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8668 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8669 + | /// Nothing is guaranteed about the order of the indices.
|
8670 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8671 + | /// The original vector, that contains duplicate items.
|
8672 + | original: ::std::vec::Vec<crate::model::RangeLong>,
|
8673 + | },
|
8674 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8675 + | /// The first component of the tuple is the index in the collection where the
|
8676 + | /// first constraint violation was found.
|
8677 + | #[doc(hidden)]
|
8678 + | Member(
|
8679 + | usize,
|
8680 + | crate::model::range_long_internal::ConstraintViolation,
|
8681 + | ),
|
8682 + | }
|
8683 + |
|
8684 + | impl ::std::fmt::Display for ConstraintViolation {
|
8685 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8686 + | let message = match self {
|
8687 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8688 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8689 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8690 + | failing_member)
|
8691 + | };
|
8692 + | write!(f, "{message}")
|
8693 + | }
|
8694 + | }
|
8695 + |
|
8696 + | impl ::std::error::Error for ConstraintViolation {}
|
8697 + | impl ConstraintViolation {
|
8698 + | pub(crate) fn as_validation_exception_field(
|
8699 + | self,
|
8700 + | path: ::std::string::String,
|
8701 + | ) -> crate::model::ValidationExceptionField {
|
8702 + | match self {
|
8703 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8704 + | crate::model::ValidationExceptionField {
|
8705 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8706 + | path,
|
8707 + | },
|
8708 + | Self::Member(index, member_constraint_violation) =>
|
8709 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8710 + | }
|
8711 + | }
|
8712 + | }
|
8713 + | }
|
8714 + | pub(crate) mod list_of_range_long_internal {
|
8715 + |
|
8716 + | #[allow(clippy::enum_variant_names)]
|
8717 + | #[derive(Debug, PartialEq)]
|
8718 + | pub(crate) enum ConstraintViolation {
|
8719 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8720 + | /// The first component of the tuple is the index in the collection where the
|
8721 + | /// first constraint violation was found.
|
8722 + | #[doc(hidden)]
|
8723 + | Member(
|
8724 + | usize,
|
8725 + | crate::model::range_long_internal::ConstraintViolation,
|
8726 + | ),
|
8727 + | }
|
8728 + |
|
8729 + | impl ::std::fmt::Display for ConstraintViolation {
|
8730 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8731 + | let message = match self {
|
8732 + | Self::Member(index, failing_member) => format!(
|
8733 + | "Value at index {index} failed to satisfy constraint. {}",
|
8734 + | failing_member
|
8735 + | ),
|
8736 + | };
|
8737 + | write!(f, "{message}")
|
8738 + | }
|
8739 + | }
|
8740 + |
|
8741 + | impl ::std::error::Error for ConstraintViolation {}
|
8742 + | impl ConstraintViolation {
|
8743 + | pub(crate) fn as_validation_exception_field(
|
8744 + | self,
|
8745 + | path: ::std::string::String,
|
8746 + | ) -> crate::model::ValidationExceptionField {
|
8747 + | match self {
|
8748 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8749 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8750 + | }
|
8751 + | }
|
8752 + | }
|
8753 + | }
|
8754 + | pub(crate) mod map_of_range_short_internal {
|
8755 + |
|
8756 + | #[allow(clippy::enum_variant_names)]
|
8757 + | #[derive(Debug, PartialEq)]
|
8758 + | pub(crate) enum ConstraintViolation {
|
8759 + | #[doc(hidden)]
|
8760 + | Value(
|
8761 + | ::std::string::String,
|
8762 + | crate::model::range_short_internal::ConstraintViolation,
|
8763 + | ),
|
8764 + | }
|
8765 + |
|
8766 + | impl ::std::fmt::Display for ConstraintViolation {
|
8767 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8768 + | match self {
|
8769 + | Self::Value(_, value_constraint_violation) => {
|
8770 + | write!(f, "{}", value_constraint_violation)
|
8771 + | }
|
8772 + | }
|
8773 + | }
|
8774 + | }
|
8775 + |
|
8776 + | impl ::std::error::Error for ConstraintViolation {}
|
8777 + | impl ConstraintViolation {
|
8778 + | pub(crate) fn as_validation_exception_field(
|
8779 + | self,
|
8780 + | path: ::std::string::String,
|
8781 + | ) -> crate::model::ValidationExceptionField {
|
8782 + | match self {
|
8783 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8784 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8785 + | }
|
8786 + | }
|
8787 + | }
|
8788 + | }
|
8789 + | pub(crate) mod range_short_internal {
|
8790 + |
|
8791 + | #[derive(Debug, PartialEq)]
|
8792 + | pub enum ConstraintViolation {
|
8793 + | Range(i16),
|
8794 + | }
|
8795 + |
|
8796 + | impl ::std::fmt::Display for ConstraintViolation {
|
8797 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8798 + | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8799 + | }
|
8800 + | }
|
8801 + |
|
8802 + | impl ::std::error::Error for ConstraintViolation {}
|
8803 + | impl ConstraintViolation {
|
8804 + | pub(crate) fn as_validation_exception_field(
|
8805 + | self,
|
8806 + | path: ::std::string::String,
|
8807 + | ) -> crate::model::ValidationExceptionField {
|
8808 + | match self {
|
8809 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8810 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8811 + | path,
|
8812 + | },
|
8813 + | }
|
8814 + | }
|
8815 + | }
|
8816 + | }
|
8817 + | pub(crate) mod set_of_range_short_internal {
|
8818 + |
|
8819 + | #[allow(clippy::enum_variant_names)]
|
8820 + | #[derive(Debug, PartialEq)]
|
8821 + | pub(crate) enum ConstraintViolation {
|
8822 + | /// Constraint violation error when the list does not contain unique items
|
8823 + | UniqueItems {
|
8824 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8825 + | /// at least two elements.
|
8826 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8827 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8828 + | /// Nothing is guaranteed about the order of the indices.
|
8829 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8830 + | /// The original vector, that contains duplicate items.
|
8831 + | original: ::std::vec::Vec<crate::model::RangeShort>,
|
8832 + | },
|
8833 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8834 + | /// The first component of the tuple is the index in the collection where the
|
8835 + | /// first constraint violation was found.
|
8836 + | #[doc(hidden)]
|
8837 + | Member(
|
8838 + | usize,
|
8839 + | crate::model::range_short_internal::ConstraintViolation,
|
8840 + | ),
|
8841 + | }
|
8842 + |
|
8843 + | impl ::std::fmt::Display for ConstraintViolation {
|
8844 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8845 + | let message = match self {
|
8846 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8847 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8848 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8849 + | failing_member)
|
8850 + | };
|
8851 + | write!(f, "{message}")
|
8852 + | }
|
8853 + | }
|
8854 + |
|
8855 + | impl ::std::error::Error for ConstraintViolation {}
|
8856 + | impl ConstraintViolation {
|
8857 + | pub(crate) fn as_validation_exception_field(
|
8858 + | self,
|
8859 + | path: ::std::string::String,
|
8860 + | ) -> crate::model::ValidationExceptionField {
|
8861 + | match self {
|
8862 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8863 + | crate::model::ValidationExceptionField {
|
8864 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8865 + | path,
|
8866 + | },
|
8867 + | Self::Member(index, member_constraint_violation) =>
|
8868 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8869 + | }
|
8870 + | }
|
8871 + | }
|
8872 + | }
|
8873 + | pub(crate) mod list_of_range_short_internal {
|
8874 + |
|
8875 + | #[allow(clippy::enum_variant_names)]
|
8876 + | #[derive(Debug, PartialEq)]
|
8877 + | pub(crate) enum ConstraintViolation {
|
8878 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8879 + | /// The first component of the tuple is the index in the collection where the
|
8880 + | /// first constraint violation was found.
|
8881 + | #[doc(hidden)]
|
8882 + | Member(
|
8883 + | usize,
|
8884 + | crate::model::range_short_internal::ConstraintViolation,
|
8885 + | ),
|
8886 + | }
|
8887 + |
|
8888 + | impl ::std::fmt::Display for ConstraintViolation {
|
8889 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8890 + | let message = match self {
|
8891 + | Self::Member(index, failing_member) => format!(
|
8892 + | "Value at index {index} failed to satisfy constraint. {}",
|
8893 + | failing_member
|
8894 + | ),
|
8895 + | };
|
8896 + | write!(f, "{message}")
|
8897 + | }
|
8898 + | }
|
8899 + |
|
8900 + | impl ::std::error::Error for ConstraintViolation {}
|
8901 + | impl ConstraintViolation {
|
8902 + | pub(crate) fn as_validation_exception_field(
|
8903 + | self,
|
8904 + | path: ::std::string::String,
|
8905 + | ) -> crate::model::ValidationExceptionField {
|
8906 + | match self {
|
8907 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8908 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8909 + | }
|
8910 + | }
|
8911 + | }
|
8912 + | }
|
8913 + | pub(crate) mod map_of_range_integer_internal {
|
8914 + |
|
8915 + | #[allow(clippy::enum_variant_names)]
|
8916 + | #[derive(Debug, PartialEq)]
|
8917 + | pub(crate) enum ConstraintViolation {
|
8918 + | #[doc(hidden)]
|
8919 + | Value(
|
8920 + | ::std::string::String,
|
8921 + | crate::model::range_integer_internal::ConstraintViolation,
|
8922 + | ),
|
8923 + | }
|
8924 + |
|
8925 + | impl ::std::fmt::Display for ConstraintViolation {
|
8926 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8927 + | match self {
|
8928 + | Self::Value(_, value_constraint_violation) => {
|
8929 + | write!(f, "{}", value_constraint_violation)
|
8930 + | }
|
8931 + | }
|
8932 + | }
|
8933 + | }
|
8934 + |
|
8935 + | impl ::std::error::Error for ConstraintViolation {}
|
8936 + | impl ConstraintViolation {
|
8937 + | pub(crate) fn as_validation_exception_field(
|
8938 + | self,
|
8939 + | path: ::std::string::String,
|
8940 + | ) -> crate::model::ValidationExceptionField {
|
8941 + | match self {
|
8942 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8943 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8944 + | }
|
8945 + | }
|
8946 + | }
|
8947 + | }
|
8948 + | pub(crate) mod range_integer_internal {
|
8949 + |
|
8950 + | #[derive(Debug, PartialEq)]
|
8951 + | pub enum ConstraintViolation {
|
8952 + | Range(i32),
|
8953 + | }
|
8954 + |
|
8955 + | impl ::std::fmt::Display for ConstraintViolation {
|
8956 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8957 + | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
8958 + | }
|
8959 + | }
|
8960 + |
|
8961 + | impl ::std::error::Error for ConstraintViolation {}
|
8962 + | impl ConstraintViolation {
|
8963 + | pub(crate) fn as_validation_exception_field(
|
8964 + | self,
|
8965 + | path: ::std::string::String,
|
8966 + | ) -> crate::model::ValidationExceptionField {
|
8967 + | match self {
|
8968 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8969 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
8970 + | path,
|
8971 + | },
|
8972 + | }
|
8973 + | }
|
8974 + | }
|
8975 + | }
|
8976 + | pub(crate) mod set_of_range_integer_internal {
|
8977 + |
|
8978 + | #[allow(clippy::enum_variant_names)]
|
8979 + | #[derive(Debug, PartialEq)]
|
8980 + | pub(crate) enum ConstraintViolation {
|
8981 + | /// Constraint violation error when the list does not contain unique items
|
8982 + | UniqueItems {
|
8983 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8984 + | /// at least two elements.
|
8985 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8986 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8987 + | /// Nothing is guaranteed about the order of the indices.
|
8988 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8989 + | /// The original vector, that contains duplicate items.
|
8990 + | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
8991 + | },
|
8992 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8993 + | /// The first component of the tuple is the index in the collection where the
|
8994 + | /// first constraint violation was found.
|
8995 + | #[doc(hidden)]
|
8996 + | Member(
|
8997 + | usize,
|
8998 + | crate::model::range_integer_internal::ConstraintViolation,
|
8999 + | ),
|
9000 + | }
|
9001 + |
|
9002 + | impl ::std::fmt::Display for ConstraintViolation {
|
9003 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9004 + | let message = match self {
|
9005 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9006 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9007 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9008 + | failing_member)
|
9009 + | };
|
9010 + | write!(f, "{message}")
|
9011 + | }
|
9012 + | }
|
9013 + |
|
9014 + | impl ::std::error::Error for ConstraintViolation {}
|
9015 + | impl ConstraintViolation {
|
9016 + | pub(crate) fn as_validation_exception_field(
|
9017 + | self,
|
9018 + | path: ::std::string::String,
|
9019 + | ) -> crate::model::ValidationExceptionField {
|
9020 + | match self {
|
9021 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9022 + | crate::model::ValidationExceptionField {
|
9023 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9024 + | path,
|
9025 + | },
|
9026 + | Self::Member(index, member_constraint_violation) =>
|
9027 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9028 + | }
|
9029 + | }
|
9030 + | }
|
9031 + | }
|
9032 + | pub(crate) mod list_of_range_integer_internal {
|
9033 + |
|
9034 + | #[allow(clippy::enum_variant_names)]
|
9035 + | #[derive(Debug, PartialEq)]
|
9036 + | pub(crate) enum ConstraintViolation {
|
9037 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9038 + | /// The first component of the tuple is the index in the collection where the
|
9039 + | /// first constraint violation was found.
|
9040 + | #[doc(hidden)]
|
9041 + | Member(
|
9042 + | usize,
|
9043 + | crate::model::range_integer_internal::ConstraintViolation,
|
9044 + | ),
|
9045 + | }
|
9046 + |
|
9047 + | impl ::std::fmt::Display for ConstraintViolation {
|
9048 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9049 + | let message = match self {
|
9050 + | Self::Member(index, failing_member) => format!(
|
9051 + | "Value at index {index} failed to satisfy constraint. {}",
|
9052 + | failing_member
|
9053 + | ),
|
9054 + | };
|
9055 + | write!(f, "{message}")
|
9056 + | }
|
9057 + | }
|
9058 + |
|
9059 + | impl ::std::error::Error for ConstraintViolation {}
|
9060 + | impl ConstraintViolation {
|
9061 + | pub(crate) fn as_validation_exception_field(
|
9062 + | self,
|
9063 + | path: ::std::string::String,
|
9064 + | ) -> crate::model::ValidationExceptionField {
|
9065 + | match self {
|
9066 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9067 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9068 + | }
|
9069 + | }
|
9070 + | }
|
9071 + | }
|
9072 + | pub(crate) mod map_of_length_blob_internal {
|
9073 + |
|
9074 + | #[allow(clippy::enum_variant_names)]
|
9075 + | #[derive(Debug, PartialEq)]
|
9076 + | pub(crate) enum ConstraintViolation {
|
9077 + | #[doc(hidden)]
|
9078 + | Value(
|
9079 + | ::std::string::String,
|
9080 + | crate::model::length_blob_internal::ConstraintViolation,
|
9081 + | ),
|
9082 + | }
|
9083 + |
|
9084 + | impl ::std::fmt::Display for ConstraintViolation {
|
9085 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9086 + | match self {
|
9087 + | Self::Value(_, value_constraint_violation) => {
|
9088 + | write!(f, "{}", value_constraint_violation)
|
9089 + | }
|
9090 + | }
|
9091 + | }
|
9092 + | }
|
9093 + |
|
9094 + | impl ::std::error::Error for ConstraintViolation {}
|
9095 + | impl ConstraintViolation {
|
9096 + | pub(crate) fn as_validation_exception_field(
|
9097 + | self,
|
9098 + | path: ::std::string::String,
|
9099 + | ) -> crate::model::ValidationExceptionField {
|
9100 + | match self {
|
9101 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9102 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9103 + | }
|
9104 + | }
|
9105 + | }
|
9106 + | }
|
9107 + | pub(crate) mod length_blob_internal {
|
9108 + |
|
9109 + | #[derive(Debug, PartialEq)]
|
9110 + | pub enum ConstraintViolation {
|
9111 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9112 + | Length(usize),
|
9113 + | }
|
9114 + |
|
9115 + | impl ::std::fmt::Display for ConstraintViolation {
|
9116 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9117 + | let message = match self {
|
9118 + | Self::Length(length) => {
|
9119 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
9120 + | }
|
9121 + | };
|
9122 + | write!(f, "{message}")
|
9123 + | }
|
9124 + | }
|
9125 + |
|
9126 + | impl ::std::error::Error for ConstraintViolation {}
|
9127 + | impl ConstraintViolation {
|
9128 + | pub(crate) fn as_validation_exception_field(
|
9129 + | self,
|
9130 + | path: ::std::string::String,
|
9131 + | ) -> crate::model::ValidationExceptionField {
|
9132 + | match self {
|
9133 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9134 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
9135 + | path,
|
9136 + | },
|
9137 + | }
|
9138 + | }
|
9139 + | }
|
9140 + | }
|
9141 + | pub(crate) mod list_of_length_blob_internal {
|
9142 + |
|
9143 + | #[allow(clippy::enum_variant_names)]
|
9144 + | #[derive(Debug, PartialEq)]
|
9145 + | pub(crate) enum ConstraintViolation {
|
9146 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9147 + | /// The first component of the tuple is the index in the collection where the
|
9148 + | /// first constraint violation was found.
|
9149 + | #[doc(hidden)]
|
9150 + | Member(
|
9151 + | usize,
|
9152 + | crate::model::length_blob_internal::ConstraintViolation,
|
9153 + | ),
|
9154 + | }
|
9155 + |
|
9156 + | impl ::std::fmt::Display for ConstraintViolation {
|
9157 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9158 + | let message = match self {
|
9159 + | Self::Member(index, failing_member) => format!(
|
9160 + | "Value at index {index} failed to satisfy constraint. {}",
|
9161 + | failing_member
|
9162 + | ),
|
9163 + | };
|
9164 + | write!(f, "{message}")
|
9165 + | }
|
9166 + | }
|
9167 + |
|
9168 + | impl ::std::error::Error for ConstraintViolation {}
|
9169 + | impl ConstraintViolation {
|
9170 + | pub(crate) fn as_validation_exception_field(
|
9171 + | self,
|
9172 + | path: ::std::string::String,
|
9173 + | ) -> crate::model::ValidationExceptionField {
|
9174 + | match self {
|
9175 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9176 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9177 + | }
|
9178 + | }
|
9179 + | }
|
9180 + | }
|
9181 + | pub(crate) mod constrained_union_internal {
|
9182 + |
|
9183 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9184 + | #[allow(clippy::enum_variant_names)]
|
9185 + | pub(crate) enum ConstraintViolation {
|
9186 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
9187 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
9188 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
9189 + | ConstrainedStructure(crate::model::con_b_internal::ConstraintViolation),
|
9190 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
9191 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
9192 + | }
|
9193 + | impl ::std::fmt::Display for ConstraintViolation {
|
9194 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9195 + | match self {
|
9196 + | Self::ConBList(inner) => write!(f, "{inner}"),
|
9197 + | Self::ConBMap(inner) => write!(f, "{inner}"),
|
9198 + | Self::ConBSet(inner) => write!(f, "{inner}"),
|
9199 + | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
9200 + | Self::EnumString(inner) => write!(f, "{inner}"),
|
9201 + | Self::LengthString(inner) => write!(f, "{inner}"),
|
9202 + | }
|
9203 + | }
|
9204 + | }
|
9205 + |
|
9206 + | impl ::std::error::Error for ConstraintViolation {}
|
9207 + | impl ConstraintViolation {
|
9208 + | pub(crate) fn as_validation_exception_field(
|
9209 + | self,
|
9210 + | path: ::std::string::String,
|
9211 + | ) -> crate::model::ValidationExceptionField {
|
9212 + | match self {
|
9213 + | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
9214 + | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
9215 + | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
9216 + | Self::ConstrainedStructure(inner) => {
|
9217 + | inner.as_validation_exception_field(path + "/constrainedStructure")
|
9218 + | }
|
9219 + | Self::EnumString(inner) => {
|
9220 + | inner.as_validation_exception_field(path + "/enumString")
|
9221 + | }
|
9222 + | Self::LengthString(inner) => {
|
9223 + | inner.as_validation_exception_field(path + "/lengthString")
|
9224 + | }
|
9225 + | }
|
9226 + | }
|
9227 + | }
|
9228 + | }
|
9229 + | pub(crate) mod con_b_set_internal {
|
9230 + |
|
9231 + | #[allow(clippy::enum_variant_names)]
|
9232 + | #[derive(Debug, PartialEq)]
|
9233 + | pub(crate) enum ConstraintViolation {
|
9234 + | /// Constraint violation error when the list does not contain unique items
|
9235 + | UniqueItems {
|
9236 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9237 + | /// at least two elements.
|
9238 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9239 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9240 + | /// Nothing is guaranteed about the order of the indices.
|
9241 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9242 + | /// The original vector, that contains duplicate items.
|
9243 + | original: ::std::vec::Vec<crate::model::ConBSetInner>,
|
9244 + | },
|
9245 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9246 + | /// The first component of the tuple is the index in the collection where the
|
9247 + | /// first constraint violation was found.
|
9248 + | #[doc(hidden)]
|
9249 + | Member(
|
9250 + | usize,
|
9251 + | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
9252 + | ),
|
9253 + | }
|
9254 + |
|
9255 + | impl ::std::fmt::Display for ConstraintViolation {
|
9256 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9257 + | let message = match self {
|
9258 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9259 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9260 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9261 + | failing_member)
|
9262 + | };
|
9263 + | write!(f, "{message}")
|
9264 + | }
|
9265 + | }
|
9266 + |
|
9267 + | impl ::std::error::Error for ConstraintViolation {}
|
9268 + | impl ConstraintViolation {
|
9269 + | pub(crate) fn as_validation_exception_field(
|
9270 + | self,
|
9271 + | path: ::std::string::String,
|
9272 + | ) -> crate::model::ValidationExceptionField {
|
9273 + | match self {
|
9274 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9275 + | crate::model::ValidationExceptionField {
|
9276 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9277 + | path,
|
9278 + | },
|
9279 + | Self::Member(index, member_constraint_violation) =>
|
9280 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9281 + | }
|
9282 + | }
|
9283 + | }
|
9284 + | }
|
9285 + | pub(crate) mod con_b_set_inner_internal {
|
9286 + |
|
9287 + | #[allow(clippy::enum_variant_names)]
|
9288 + | #[derive(Debug, PartialEq)]
|
9289 + | pub(crate) enum ConstraintViolation {
|
9290 + | /// Constraint violation error when the list does not contain unique items
|
9291 + | UniqueItems {
|
9292 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9293 + | /// at least two elements.
|
9294 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9295 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9296 + | /// Nothing is guaranteed about the order of the indices.
|
9297 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9298 + | /// The original vector, that contains duplicate items.
|
9299 + | original: ::std::vec::Vec<::std::string::String>,
|
9300 + | },
|
9301 + | }
|
9302 + |
|
9303 + | impl ::std::fmt::Display for ConstraintViolation {
|
9304 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9305 + | let message = match self {
|
9306 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9307 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9308 + | };
|
9309 + | write!(f, "{message}")
|
9310 + | }
|
9311 + | }
|
9312 + |
|
9313 + | impl ::std::error::Error for ConstraintViolation {}
|
9314 + | impl ConstraintViolation {
|
9315 + | pub(crate) fn as_validation_exception_field(
|
9316 + | self,
|
9317 + | path: ::std::string::String,
|
9318 + | ) -> crate::model::ValidationExceptionField {
|
9319 + | match self {
|
9320 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9321 + | crate::model::ValidationExceptionField {
|
9322 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9323 + | path,
|
9324 + | },
|
9325 + | }
|
9326 + | }
|
9327 + | }
|
9328 + | }
|
9329 + | pub(crate) mod con_b_list_internal {
|
9330 + |
|
9331 + | #[allow(clippy::enum_variant_names)]
|
9332 + | #[derive(Debug, PartialEq)]
|
9333 + | pub(crate) enum ConstraintViolation {
|
9334 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9335 + | /// The first component of the tuple is the index in the collection where the
|
9336 + | /// first constraint violation was found.
|
9337 + | #[doc(hidden)]
|
9338 + | Member(
|
9339 + | usize,
|
9340 + | crate::model::con_b_list_inner_internal::ConstraintViolation,
|
9341 + | ),
|
9342 + | }
|
9343 + |
|
9344 + | impl ::std::fmt::Display for ConstraintViolation {
|
9345 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9346 + | let message = match self {
|
9347 + | Self::Member(index, failing_member) => format!(
|
9348 + | "Value at index {index} failed to satisfy constraint. {}",
|
9349 + | failing_member
|
9350 + | ),
|
9351 + | };
|
9352 + | write!(f, "{message}")
|
9353 + | }
|
9354 + | }
|
9355 + |
|
9356 + | impl ::std::error::Error for ConstraintViolation {}
|
9357 + | impl ConstraintViolation {
|
9358 + | pub(crate) fn as_validation_exception_field(
|
9359 + | self,
|
9360 + | path: ::std::string::String,
|
9361 + | ) -> crate::model::ValidationExceptionField {
|
9362 + | match self {
|
9363 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9364 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9365 + | }
|
9366 + | }
|
9367 + | }
|
9368 + | }
|
9369 + | pub(crate) mod con_b_list_inner_internal {
|
9370 + |
|
9371 + | #[allow(clippy::enum_variant_names)]
|
9372 + | #[derive(Debug, PartialEq)]
|
9373 + | pub(crate) enum ConstraintViolation {
|
9374 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9375 + | /// The first component of the tuple is the index in the collection where the
|
9376 + | /// first constraint violation was found.
|
9377 + | #[doc(hidden)]
|
9378 + | Member(usize, crate::model::con_b_internal::ConstraintViolation),
|
9379 + | }
|
9380 + |
|
9381 + | impl ::std::fmt::Display for ConstraintViolation {
|
9382 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9383 + | let message = match self {
|
9384 + | Self::Member(index, failing_member) => format!(
|
9385 + | "Value at index {index} failed to satisfy constraint. {}",
|
9386 + | failing_member
|
9387 + | ),
|
9388 + | };
|
9389 + | write!(f, "{message}")
|
9390 + | }
|
9391 + | }
|
9392 + |
|
9393 + | impl ::std::error::Error for ConstraintViolation {}
|
9394 + | impl ConstraintViolation {
|
9395 + | pub(crate) fn as_validation_exception_field(
|
9396 + | self,
|
9397 + | path: ::std::string::String,
|
9398 + | ) -> crate::model::ValidationExceptionField {
|
9399 + | match self {
|
9400 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9401 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9402 + | }
|
9403 + | }
|
9404 + | }
|
9405 + | }
|
9406 + | /// See [`ConB`](crate::model::ConB).
|
9407 + | pub(crate) mod con_b_internal {
|
9408 + |
|
9409 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9410 + | /// Holds one variant for each of the ways the builder can fail.
|
9411 + | #[non_exhaustive]
|
9412 + | #[allow(clippy::enum_variant_names)]
|
9413 + | pub(crate) enum ConstraintViolation {
|
9414 + | /// `nice` was not provided but it is required when building `ConB`.
|
9415 + | MissingNice,
|
9416 + | /// `int` was not provided but it is required when building `ConB`.
|
9417 + | MissingInt,
|
9418 + | }
|
9419 + | impl ::std::fmt::Display for ConstraintViolation {
|
9420 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9421 + | match self {
|
9422 + | ConstraintViolation::MissingNice => write!(
|
9423 + | f,
|
9424 + | "`nice` was not provided but it is required when building `ConB`"
|
9425 + | ),
|
9426 + | ConstraintViolation::MissingInt => write!(
|
9427 + | f,
|
9428 + | "`int` was not provided but it is required when building `ConB`"
|
9429 + | ),
|
9430 + | }
|
9431 + | }
|
9432 + | }
|
9433 + | impl ::std::error::Error for ConstraintViolation {}
|
9434 + | impl ConstraintViolation {
|
9435 + | pub(crate) fn as_validation_exception_field(
|
9436 + | self,
|
9437 + | path: ::std::string::String,
|
9438 + | ) -> crate::model::ValidationExceptionField {
|
9439 + | match self {
|
9440 + | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
9441 + | message: format!(
|
9442 + | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
9443 + | path
|
9444 + | ),
|
9445 + | path: path + "/nice",
|
9446 + | },
|
9447 + | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
9448 + | message: format!(
|
9449 + | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
9450 + | path
|
9451 + | ),
|
9452 + | path: path + "/int",
|
9453 + | },
|
9454 + | }
|
9455 + | }
|
9456 + | }
|
9457 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
9458 + | fn from(builder: Builder) -> Self {
|
9459 + | Self::Unconstrained(builder)
|
9460 + | }
|
9461 + | }
|
9462 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9463 + | type Error = ConstraintViolation;
|
9464 + |
|
9465 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9466 + | builder.build()
|
9467 + | }
|
9468 + | }
|
9469 + | /// A builder for [`ConB`](crate::model::ConB).
|
9470 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9471 + | pub(crate) struct Builder {
|
9472 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9473 + | pub(crate) int: ::std::option::Option<i32>,
|
9474 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9475 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
9476 + | }
|
9477 + | impl Builder {
|
9478 + | #[allow(missing_docs)] // documentation missing in model
|
9479 + | pub(crate) fn set_nice(
|
9480 + | mut self,
|
9481 + | input: impl ::std::convert::Into<::std::string::String>,
|
9482 + | ) -> Self {
|
9483 + | self.nice = Some(input.into());
|
9484 + | self
|
9485 + | }
|
9486 + | #[allow(missing_docs)] // documentation missing in model
|
9487 + | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
9488 + | self.int = Some(input.into());
|
9489 + | self
|
9490 + | }
|
9491 + | #[allow(missing_docs)] // documentation missing in model
|
9492 + | pub(crate) fn set_opt_nice(
|
9493 + | mut self,
|
9494 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
9495 + | ) -> Self {
|
9496 + | self.opt_nice = input.map(|v| v.into());
|
9497 + | self
|
9498 + | }
|
9499 + | #[allow(missing_docs)] // documentation missing in model
|
9500 + | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
9501 + | self.opt_int = input.map(|v| v.into());
|
9502 + | self
|
9503 + | }
|
9504 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9505 + | ///
|
9506 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
9507 + | ///
|
9508 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
9509 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9510 + | self.build_enforcing_all_constraints()
|
9511 + | }
|
9512 + | fn build_enforcing_all_constraints(
|
9513 + | self,
|
9514 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9515 + | Ok(crate::model::ConB {
|
9516 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9517 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9518 + | opt_nice: self.opt_nice,
|
9519 + | opt_int: self.opt_int,
|
9520 + | })
|
9521 + | }
|
9522 + | }
|
9523 + | }
|
9524 + | /// See [`ConB`](crate::model::ConB).
|
9525 + | pub mod con_b {
|
9526 + |
|
9527 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9528 + | /// Holds one variant for each of the ways the builder can fail.
|
9529 + | #[allow(clippy::enum_variant_names)]
|
9530 + | pub enum ConstraintViolation {
|
9531 + | /// `nice` was not provided but it is required when building `ConB`.
|
9532 + | MissingNice,
|
9533 + | /// `int` was not provided but it is required when building `ConB`.
|
9534 + | MissingInt,
|
9535 + | }
|
9536 + | impl ::std::fmt::Display for ConstraintViolation {
|
9537 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9538 + | match self {
|
9539 + | ConstraintViolation::MissingNice => write!(
|
9540 + | f,
|
9541 + | "`nice` was not provided but it is required when building `ConB`"
|
9542 + | ),
|
9543 + | ConstraintViolation::MissingInt => write!(
|
9544 + | f,
|
9545 + | "`int` was not provided but it is required when building `ConB`"
|
9546 + | ),
|
9547 + | }
|
9548 + | }
|
9549 + | }
|
9550 + | impl ::std::error::Error for ConstraintViolation {}
|
9551 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9552 + | type Error = ConstraintViolation;
|
9553 + |
|
9554 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9555 + | builder.build()
|
9556 + | }
|
9557 + | }
|
9558 + | /// A builder for [`ConB`](crate::model::ConB).
|
9559 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9560 + | pub struct Builder {
|
9561 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9562 + | pub(crate) int: ::std::option::Option<i32>,
|
9563 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9564 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
9565 + | }
|
9566 + | impl Builder {
|
9567 + | #[allow(missing_docs)] // documentation missing in model
|
9568 + | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
9569 + | self.nice = Some(input);
|
9570 + | self
|
9571 + | }
|
9572 + | #[allow(missing_docs)] // documentation missing in model
|
9573 + | pub fn int(mut self, input: i32) -> Self {
|
9574 + | self.int = Some(input);
|
9575 + | self
|
9576 + | }
|
9577 + | #[allow(missing_docs)] // documentation missing in model
|
9578 + | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
9579 + | self.opt_nice = input;
|
9580 + | self
|
9581 + | }
|
9582 + | #[allow(missing_docs)] // documentation missing in model
|
9583 + | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
9584 + | self.opt_int = input;
|
9585 + | self
|
9586 + | }
|
9587 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9588 + | ///
|
9589 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if you do not provide a value for all non-`Option`al members.
|
9590 + | ///
|
9591 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9592 + | self.build_enforcing_required_and_enum_traits()
|
9593 + | }
|
9594 + | fn build_enforcing_required_and_enum_traits(
|
9595 + | self,
|
9596 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9597 + | Ok(crate::model::ConB {
|
9598 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9599 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9600 + | opt_nice: self.opt_nice,
|
9601 + | opt_int: self.opt_int,
|
9602 + | })
|
9603 + | }
|
9604 + | }
|
9605 + | }
|
9606 + | pub(crate) mod sparse_length_list_internal {
|
9607 + |
|
9608 + | #[allow(clippy::enum_variant_names)]
|
9609 + | #[derive(Debug, PartialEq)]
|
9610 + | pub(crate) enum ConstraintViolation {
|
9611 + | /// Constraint violation error when the list doesn't have the required length
|
9612 + | Length(usize),
|
9613 + | }
|
9614 + |
|
9615 + | impl ::std::fmt::Display for ConstraintViolation {
|
9616 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9617 + | let message = match self {
|
9618 + | Self::Length(length) => {
|
9619 + | format!("Value with length {} provided for 'com.amazonaws.constraints#SparseLengthList' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
9620 + | }
|
9621 + | };
|
9622 + | write!(f, "{message}")
|
9623 + | }
|
9624 + | }
|
9625 + |
|
9626 + | impl ::std::error::Error for ConstraintViolation {}
|
9627 + | impl ConstraintViolation {
|
9628 + | pub(crate) fn as_validation_exception_field(
|
9629 + | self,
|
9630 + | path: ::std::string::String,
|
9631 + | ) -> crate::model::ValidationExceptionField {
|
9632 + | match self {
|
9633 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9634 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9635 + | path,
|
9636 + | },
|
9637 + | }
|
9638 + | }
|
9639 + | }
|
9640 + | }
|
9641 + | pub(crate) mod sparse_length_map_internal {
|
9642 + |
|
9643 + | #[allow(clippy::enum_variant_names)]
|
9644 + | #[derive(Debug, PartialEq)]
|
9645 + | pub(crate) enum ConstraintViolation {
|
9646 + | Length(usize),
|
9647 + | }
|
9648 + |
|
9649 + | impl ::std::fmt::Display for ConstraintViolation {
|
9650 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9651 + | match self {
|
9652 + | Self::Length(length) => {
|
9653 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#SparseLengthMap' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
9654 + | }
|
9655 + | }
|
9656 + | }
|
9657 + | }
|
9658 + |
|
9659 + | impl ::std::error::Error for ConstraintViolation {}
|
9660 + | impl ConstraintViolation {
|
9661 + | pub(crate) fn as_validation_exception_field(
|
9662 + | self,
|
9663 + | path: ::std::string::String,
|
9664 + | ) -> crate::model::ValidationExceptionField {
|
9665 + | match self {
|
9666 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9667 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9668 + | path,
|
9669 + | },
|
9670 + | }
|
9671 + | }
|
9672 + | }
|
9673 + | }
|
9674 + | pub(crate) mod sparse_list_internal {
|
9675 + |
|
9676 + | #[allow(clippy::enum_variant_names)]
|
9677 + | #[derive(Debug, PartialEq)]
|
9678 + | pub(crate) enum ConstraintViolation {
|
9679 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9680 + | /// The first component of the tuple is the index in the collection where the
|
9681 + | /// first constraint violation was found.
|
9682 + | #[doc(hidden)]
|
9683 + | Member(
|
9684 + | usize,
|
9685 + | crate::model::length_string_internal::ConstraintViolation,
|
9686 + | ),
|
9687 + | }
|
9688 + |
|
9689 + | impl ::std::fmt::Display for ConstraintViolation {
|
9690 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9691 + | let message = match self {
|
9692 + | Self::Member(index, failing_member) => format!(
|
9693 + | "Value at index {index} failed to satisfy constraint. {}",
|
9694 + | failing_member
|
9695 + | ),
|
9696 + | };
|
9697 + | write!(f, "{message}")
|
9698 + | }
|
9699 + | }
|
9700 + |
|
9701 + | impl ::std::error::Error for ConstraintViolation {}
|
9702 + | impl ConstraintViolation {
|
9703 + | pub(crate) fn as_validation_exception_field(
|
9704 + | self,
|
9705 + | path: ::std::string::String,
|
9706 + | ) -> crate::model::ValidationExceptionField {
|
9707 + | match self {
|
9708 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9709 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9710 + | }
|
9711 + | }
|
9712 + | }
|
9713 + | }
|
9714 + | pub(crate) mod sparse_map_internal {
|
9715 + |
|
9716 + | #[allow(clippy::enum_variant_names)]
|
9717 + | #[derive(Debug, PartialEq)]
|
9718 + | pub(crate) enum ConstraintViolation {
|
9719 + | #[doc(hidden)]
|
9720 + | Value(
|
9721 + | ::std::string::String,
|
9722 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
9723 + | ),
|
9724 + | }
|
9725 + |
|
9726 + | impl ::std::fmt::Display for ConstraintViolation {
|
9727 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9728 + | match self {
|
9729 + | Self::Value(_, value_constraint_violation) => {
|
9730 + | write!(f, "{}", value_constraint_violation)
|
9731 + | }
|
9732 + | }
|
9733 + | }
|
9734 + | }
|
9735 + |
|
9736 + | impl ::std::error::Error for ConstraintViolation {}
|
9737 + | impl ConstraintViolation {
|
9738 + | pub(crate) fn as_validation_exception_field(
|
9739 + | self,
|
9740 + | path: ::std::string::String,
|
9741 + | ) -> crate::model::ValidationExceptionField {
|
9742 + | match self {
|
9743 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9744 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9745 + | }
|
9746 + | }
|
9747 + | }
|
9748 + | }
|
9749 + | pub(crate) mod unique_items_list_internal {
|
9750 + |
|
9751 + | #[allow(clippy::enum_variant_names)]
|
9752 + | #[derive(Debug, PartialEq)]
|
9753 + | pub(crate) enum ConstraintViolation {
|
9754 + | /// Constraint violation error when the list does not contain unique items
|
9755 + | UniqueItems {
|
9756 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9757 + | /// at least two elements.
|
9758 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9759 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9760 + | /// Nothing is guaranteed about the order of the indices.
|
9761 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9762 + | /// The original vector, that contains duplicate items.
|
9763 + | original: ::std::vec::Vec<::std::string::String>,
|
9764 + | },
|
9765 + | }
|
9766 + |
|
9767 + | impl ::std::fmt::Display for ConstraintViolation {
|
9768 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9769 + | let message = match self {
|
9770 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9771 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9772 + | };
|
9773 + | write!(f, "{message}")
|
9774 + | }
|
9775 + | }
|
9776 + |
|
9777 + | impl ::std::error::Error for ConstraintViolation {}
|
9778 + | impl ConstraintViolation {
|
9779 + | pub(crate) fn as_validation_exception_field(
|
9780 + | self,
|
9781 + | path: ::std::string::String,
|
9782 + | ) -> crate::model::ValidationExceptionField {
|
9783 + | match self {
|
9784 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9785 + | crate::model::ValidationExceptionField {
|
9786 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9787 + | path,
|
9788 + | },
|
9789 + | }
|
9790 + | }
|
9791 + | }
|
9792 + | }
|
9793 + | pub(crate) mod map_of_map_of_list_of_list_of_con_b_internal {
|
9794 + |
|
9795 + | #[allow(clippy::enum_variant_names)]
|
9796 + | #[derive(Debug, PartialEq)]
|
9797 + | pub(crate) enum ConstraintViolation {
|
9798 + | #[doc(hidden)]
|
9799 + | Value(
|
9800 + | ::std::string::String,
|
9801 + | crate::model::map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
9802 + | ),
|
9803 + | }
|
9804 + |
|
9805 + | impl ::std::fmt::Display for ConstraintViolation {
|
9806 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9807 + | match self {
|
9808 + | Self::Value(_, value_constraint_violation) => {
|
9809 + | write!(f, "{}", value_constraint_violation)
|
9810 + | }
|
9811 + | }
|
9812 + | }
|
9813 + | }
|
9814 + |
|
9815 + | impl ::std::error::Error for ConstraintViolation {}
|
9816 + | impl ConstraintViolation {
|
9817 + | pub(crate) fn as_validation_exception_field(
|
9818 + | self,
|
9819 + | path: ::std::string::String,
|
9820 + | ) -> crate::model::ValidationExceptionField {
|
9821 + | match self {
|
9822 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9823 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9824 + | }
|
9825 + | }
|
9826 + | }
|
9827 + | }
|
9828 + | pub(crate) mod map_of_list_of_list_of_con_b_internal {
|
9829 + |
|
9830 + | #[allow(clippy::enum_variant_names)]
|
9831 + | #[derive(Debug, PartialEq)]
|
9832 + | pub(crate) enum ConstraintViolation {
|
9833 + | #[doc(hidden)]
|
9834 + | Value(
|
9835 + | ::std::string::String,
|
9836 + | crate::model::con_b_list_internal::ConstraintViolation,
|
9837 + | ),
|
9838 + | }
|
9839 + |
|
9840 + | impl ::std::fmt::Display for ConstraintViolation {
|
9841 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9842 + | match self {
|
9843 + | Self::Value(_, value_constraint_violation) => {
|
9844 + | write!(f, "{}", value_constraint_violation)
|
9845 + | }
|
9846 + | }
|
9847 + | }
|
9848 + | }
|
9849 + |
|
9850 + | impl ::std::error::Error for ConstraintViolation {}
|
9851 + | impl ConstraintViolation {
|
9852 + | pub(crate) fn as_validation_exception_field(
|
9853 + | self,
|
9854 + | path: ::std::string::String,
|
9855 + | ) -> crate::model::ValidationExceptionField {
|
9856 + | match self {
|
9857 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9858 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9859 + | }
|
9860 + | }
|
9861 + | }
|
9862 + | }
|
9863 + | pub(crate) mod length_map_internal {
|
9864 + |
|
9865 + | #[allow(clippy::enum_variant_names)]
|
9866 + | #[derive(Debug, PartialEq)]
|
9867 + | pub(crate) enum ConstraintViolation {
|
9868 + | Length(usize),
|
9869 + | }
|
9870 + |
|
9871 + | impl ::std::fmt::Display for ConstraintViolation {
|
9872 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9873 + | match self {
|
9874 + | Self::Length(length) => {
|
9875 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#LengthMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
9876 + | }
|
9877 + | }
|
9878 + | }
|
9879 + | }
|
9880 + |
|
9881 + | impl ::std::error::Error for ConstraintViolation {}
|
9882 + | impl ConstraintViolation {
|
9883 + | pub(crate) fn as_validation_exception_field(
|
9884 + | self,
|
9885 + | path: ::std::string::String,
|
9886 + | ) -> crate::model::ValidationExceptionField {
|
9887 + | match self {
|
9888 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9889 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9890 + | path,
|
9891 + | },
|
9892 + | }
|
9893 + | }
|
9894 + | }
|
9895 + | }
|
9896 + | pub(crate) mod sensitive_length_list_internal {
|
9897 + |
|
9898 + | #[allow(clippy::enum_variant_names)]
|
9899 + | #[derive(Debug, PartialEq)]
|
9900 + | pub(crate) enum ConstraintViolation {
|
9901 + | /// Constraint violation error when the list doesn't have the required length
|
9902 + | Length(usize),
|
9903 + | }
|
9904 + |
|
9905 + | impl ::std::fmt::Display for ConstraintViolation {
|
9906 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9907 + | let message = match self {
|
9908 + | Self::Length(length) => {
|
9909 + | format!("Value with length {} provided for 'com.amazonaws.constraints#SensitiveLengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9910 + | }
|
9911 + | };
|
9912 + | write!(f, "{message}")
|
9913 + | }
|
9914 + | }
|
9915 + |
|
9916 + | impl ::std::error::Error for ConstraintViolation {}
|
9917 + | impl ConstraintViolation {
|
9918 + | pub(crate) fn as_validation_exception_field(
|
9919 + | self,
|
9920 + | path: ::std::string::String,
|
9921 + | ) -> crate::model::ValidationExceptionField {
|
9922 + | match self {
|
9923 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9924 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9925 + | path,
|
9926 + | },
|
9927 + | }
|
9928 + | }
|
9929 + | }
|
9930 + | }
|
9931 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9932 + | pub(crate) mod sensitive_structure_internal {
|
9933 + |
|
9934 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
9935 + | fn from(builder: Builder) -> Self {
|
9936 + | builder.build()
|
9937 + | }
|
9938 + | }
|
9939 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9940 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
9941 + | pub(crate) struct Builder {}
|
9942 + | impl Builder {
|
9943 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9944 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
9945 + | self.build_enforcing_all_constraints()
|
9946 + | }
|
9947 + | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
9948 + | crate::model::SensitiveStructure {}
|
9949 + | }
|
9950 + | }
|
9951 + | impl ::std::fmt::Debug for Builder {
|
9952 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
9953 + | let mut formatter = f.debug_struct("Builder");
|
9954 + | formatter.finish()
|
9955 + | }
|
9956 + | }
|
9957 + | }
|
9958 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9959 + | pub mod sensitive_structure {
|
9960 + |
|
9961 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
9962 + | fn from(builder: Builder) -> Self {
|
9963 + | builder.build()
|
9964 + | }
|
9965 + | }
|
9966 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9967 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
9968 + | pub struct Builder {}
|
9969 + | impl Builder {
|
9970 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9971 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
9972 + | self.build_enforcing_required_and_enum_traits()
|
9973 + | }
|
9974 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SensitiveStructure {
|
9975 + | crate::model::SensitiveStructure {}
|
9976 + | }
|
9977 + | }
|
9978 + | }
|
9979 + | pub(crate) mod length_list_internal {
|
9980 + |
|
9981 + | #[allow(clippy::enum_variant_names)]
|
9982 + | #[derive(Debug, PartialEq)]
|
9983 + | pub(crate) enum ConstraintViolation {
|
9984 + | /// Constraint violation error when the list doesn't have the required length
|
9985 + | Length(usize),
|
9986 + | }
|
9987 + |
|
9988 + | impl ::std::fmt::Display for ConstraintViolation {
|
9989 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9990 + | let message = match self {
|
9991 + | Self::Length(length) => {
|
9992 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9993 + | }
|
9994 + | };
|
9995 + | write!(f, "{message}")
|
9996 + | }
|
9997 + | }
|
9998 + |
|
9999 + | impl ::std::error::Error for ConstraintViolation {}
|
10000 + | impl ConstraintViolation {
|
10001 + | pub(crate) fn as_validation_exception_field(
|
10002 + | self,
|
10003 + | path: ::std::string::String,
|
10004 + | ) -> crate::model::ValidationExceptionField {
|
10005 + | match self {
|
10006 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10007 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10008 + | path,
|
10009 + | },
|
10010 + | }
|
10011 + | }
|
10012 + | }
|
10013 + | }
|
10014 + | pub(crate) mod fixed_value_byte_internal {
|
10015 + |
|
10016 + | #[derive(Debug, PartialEq)]
|
10017 + | pub enum ConstraintViolation {
|
10018 + | Range(i8),
|
10019 + | }
|
10020 + |
|
10021 + | impl ::std::fmt::Display for ConstraintViolation {
|
10022 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10023 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10024 + | }
|
10025 + | }
|
10026 + |
|
10027 + | impl ::std::error::Error for ConstraintViolation {}
|
10028 + | impl ConstraintViolation {
|
10029 + | pub(crate) fn as_validation_exception_field(
|
10030 + | self,
|
10031 + | path: ::std::string::String,
|
10032 + | ) -> crate::model::ValidationExceptionField {
|
10033 + | match self {
|
10034 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10035 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10036 + | path,
|
10037 + | },
|
10038 + | }
|
10039 + | }
|
10040 + | }
|
10041 + | }
|
10042 + | pub(crate) mod max_range_byte_internal {
|
10043 + |
|
10044 + | #[derive(Debug, PartialEq)]
|
10045 + | pub enum ConstraintViolation {
|
10046 + | Range(i8),
|
10047 + | }
|
10048 + |
|
10049 + | impl ::std::fmt::Display for ConstraintViolation {
|
10050 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10051 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
10052 + | }
|
10053 + | }
|
10054 + |
|
10055 + | impl ::std::error::Error for ConstraintViolation {}
|
10056 + | impl ConstraintViolation {
|
10057 + | pub(crate) fn as_validation_exception_field(
|
10058 + | self,
|
10059 + | path: ::std::string::String,
|
10060 + | ) -> crate::model::ValidationExceptionField {
|
10061 + | match self {
|
10062 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10063 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10064 + | path,
|
10065 + | },
|
10066 + | }
|
10067 + | }
|
10068 + | }
|
10069 + | }
|
10070 + | pub(crate) mod min_range_byte_internal {
|
10071 + |
|
10072 + | #[derive(Debug, PartialEq)]
|
10073 + | pub enum ConstraintViolation {
|
10074 + | Range(i8),
|
10075 + | }
|
10076 + |
|
10077 + | impl ::std::fmt::Display for ConstraintViolation {
|
10078 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10079 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10080 + | }
|
10081 + | }
|
10082 + |
|
10083 + | impl ::std::error::Error for ConstraintViolation {}
|
10084 + | impl ConstraintViolation {
|
10085 + | pub(crate) fn as_validation_exception_field(
|
10086 + | self,
|
10087 + | path: ::std::string::String,
|
10088 + | ) -> crate::model::ValidationExceptionField {
|
10089 + | match self {
|
10090 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10091 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10092 + | path,
|
10093 + | },
|
10094 + | }
|
10095 + | }
|
10096 + | }
|
10097 + | }
|
10098 + | pub(crate) mod fixed_value_long_internal {
|
10099 + |
|
10100 + | #[derive(Debug, PartialEq)]
|
10101 + | pub enum ConstraintViolation {
|
10102 + | Range(i64),
|
10103 + | }
|
10104 + |
|
10105 + | impl ::std::fmt::Display for ConstraintViolation {
|
10106 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10107 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10108 + | }
|
10109 + | }
|
10110 + |
|
10111 + | impl ::std::error::Error for ConstraintViolation {}
|
10112 + | impl ConstraintViolation {
|
10113 + | pub(crate) fn as_validation_exception_field(
|
10114 + | self,
|
10115 + | path: ::std::string::String,
|
10116 + | ) -> crate::model::ValidationExceptionField {
|
10117 + | match self {
|
10118 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10119 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10120 + | path,
|
10121 + | },
|
10122 + | }
|
10123 + | }
|
10124 + | }
|
10125 + | }
|
10126 + | pub(crate) mod max_range_long_internal {
|
10127 + |
|
10128 + | #[derive(Debug, PartialEq)]
|
10129 + | pub enum ConstraintViolation {
|
10130 + | Range(i64),
|
10131 + | }
|
10132 + |
|
10133 + | impl ::std::fmt::Display for ConstraintViolation {
|
10134 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10135 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
10136 + | }
|
10137 + | }
|
10138 + |
|
10139 + | impl ::std::error::Error for ConstraintViolation {}
|
10140 + | impl ConstraintViolation {
|
10141 + | pub(crate) fn as_validation_exception_field(
|
10142 + | self,
|
10143 + | path: ::std::string::String,
|
10144 + | ) -> crate::model::ValidationExceptionField {
|
10145 + | match self {
|
10146 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10147 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10148 + | path,
|
10149 + | },
|
10150 + | }
|
10151 + | }
|
10152 + | }
|
10153 + | }
|
10154 + | pub(crate) mod min_range_long_internal {
|
10155 + |
|
10156 + | #[derive(Debug, PartialEq)]
|
10157 + | pub enum ConstraintViolation {
|
10158 + | Range(i64),
|
10159 + | }
|
10160 + |
|
10161 + | impl ::std::fmt::Display for ConstraintViolation {
|
10162 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10163 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10164 + | }
|
10165 + | }
|
10166 + |
|
10167 + | impl ::std::error::Error for ConstraintViolation {}
|
10168 + | impl ConstraintViolation {
|
10169 + | pub(crate) fn as_validation_exception_field(
|
10170 + | self,
|
10171 + | path: ::std::string::String,
|
10172 + | ) -> crate::model::ValidationExceptionField {
|
10173 + | match self {
|
10174 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10175 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10176 + | path,
|
10177 + | },
|
10178 + | }
|
10179 + | }
|
10180 + | }
|
10181 + | }
|
10182 + | pub(crate) mod fixed_value_short_internal {
|
10183 + |
|
10184 + | #[derive(Debug, PartialEq)]
|
10185 + | pub enum ConstraintViolation {
|
10186 + | Range(i16),
|
10187 + | }
|
10188 + |
|
10189 + | impl ::std::fmt::Display for ConstraintViolation {
|
10190 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10191 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10192 + | }
|
10193 + | }
|
10194 + |
|
10195 + | impl ::std::error::Error for ConstraintViolation {}
|
10196 + | impl ConstraintViolation {
|
10197 + | pub(crate) fn as_validation_exception_field(
|
10198 + | self,
|
10199 + | path: ::std::string::String,
|
10200 + | ) -> crate::model::ValidationExceptionField {
|
10201 + | match self {
|
10202 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10203 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10204 + | path,
|
10205 + | },
|
10206 + | }
|
10207 + | }
|
10208 + | }
|
10209 + | }
|
10210 + | pub(crate) mod max_range_short_internal {
|
10211 + |
|
10212 + | #[derive(Debug, PartialEq)]
|
10213 + | pub enum ConstraintViolation {
|
10214 + | Range(i16),
|
10215 + | }
|
10216 + |
|
10217 + | impl ::std::fmt::Display for ConstraintViolation {
|
10218 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10219 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
10220 + | }
|
10221 + | }
|
10222 + |
|
10223 + | impl ::std::error::Error for ConstraintViolation {}
|
10224 + | impl ConstraintViolation {
|
10225 + | pub(crate) fn as_validation_exception_field(
|
10226 + | self,
|
10227 + | path: ::std::string::String,
|
10228 + | ) -> crate::model::ValidationExceptionField {
|
10229 + | match self {
|
10230 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10231 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10232 + | path,
|
10233 + | },
|
10234 + | }
|
10235 + | }
|
10236 + | }
|
10237 + | }
|
10238 + | pub(crate) mod min_range_short_internal {
|
10239 + |
|
10240 + | #[derive(Debug, PartialEq)]
|
10241 + | pub enum ConstraintViolation {
|
10242 + | Range(i16),
|
10243 + | }
|
10244 + |
|
10245 + | impl ::std::fmt::Display for ConstraintViolation {
|
10246 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10247 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10248 + | }
|
10249 + | }
|
10250 + |
|
10251 + | impl ::std::error::Error for ConstraintViolation {}
|
10252 + | impl ConstraintViolation {
|
10253 + | pub(crate) fn as_validation_exception_field(
|
10254 + | self,
|
10255 + | path: ::std::string::String,
|
10256 + | ) -> crate::model::ValidationExceptionField {
|
10257 + | match self {
|
10258 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10259 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10260 + | path,
|
10261 + | },
|
10262 + | }
|
10263 + | }
|
10264 + | }
|
10265 + | }
|
10266 + | pub(crate) mod fixed_value_integer_internal {
|
10267 + |
|
10268 + | #[derive(Debug, PartialEq)]
|
10269 + | pub enum ConstraintViolation {
|
10270 + | Range(i32),
|
10271 + | }
|
10272 + |
|
10273 + | impl ::std::fmt::Display for ConstraintViolation {
|
10274 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10275 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
10276 + | }
|
10277 + | }
|
10278 + |
|
10279 + | impl ::std::error::Error for ConstraintViolation {}
|
10280 + | impl ConstraintViolation {
|
10281 + | pub(crate) fn as_validation_exception_field(
|
10282 + | self,
|
10283 + | path: ::std::string::String,
|
10284 + | ) -> crate::model::ValidationExceptionField {
|
10285 + | match self {
|
10286 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10287 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
10288 + | path,
|
10289 + | },
|
10290 + | }
|
10291 + | }
|
10292 + | }
|
10293 + | }
|
10294 + | pub(crate) mod max_range_integer_internal {
|
10295 + |
|
10296 + | #[derive(Debug, PartialEq)]
|
10297 + | pub enum ConstraintViolation {
|
10298 + | Range(i32),
|
10299 + | }
|
10300 + |
|
10301 + | impl ::std::fmt::Display for ConstraintViolation {
|
10302 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10303 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
10304 + | }
|
10305 + | }
|
10306 + |
|
10307 + | impl ::std::error::Error for ConstraintViolation {}
|
10308 + | impl ConstraintViolation {
|
10309 + | pub(crate) fn as_validation_exception_field(
|
10310 + | self,
|
10311 + | path: ::std::string::String,
|
10312 + | ) -> crate::model::ValidationExceptionField {
|
10313 + | match self {
|
10314 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10315 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
10316 + | path,
|
10317 + | },
|
10318 + | }
|
10319 + | }
|
10320 + | }
|
10321 + | }
|
10322 + | pub(crate) mod min_range_integer_internal {
|
10323 + |
|
10324 + | #[derive(Debug, PartialEq)]
|
10325 + | pub enum ConstraintViolation {
|
10326 + | Range(i32),
|
10327 + | }
|
10328 + |
|
10329 + | impl ::std::fmt::Display for ConstraintViolation {
|
10330 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10331 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10332 + | }
|
10333 + | }
|
10334 + |
|
10335 + | impl ::std::error::Error for ConstraintViolation {}
|
10336 + | impl ConstraintViolation {
|
10337 + | pub(crate) fn as_validation_exception_field(
|
10338 + | self,
|
10339 + | path: ::std::string::String,
|
10340 + | ) -> crate::model::ValidationExceptionField {
|
10341 + | match self {
|
10342 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10343 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10344 + | path,
|
10345 + | },
|
10346 + | }
|
10347 + | }
|
10348 + | }
|
10349 + | }
|
10350 + | pub(crate) mod fixed_length_blob_internal {
|
10351 + |
|
10352 + | #[derive(Debug, PartialEq)]
|
10353 + | pub enum ConstraintViolation {
|
10354 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10355 + | Length(usize),
|
10356 + | }
|
10357 + |
|
10358 + | impl ::std::fmt::Display for ConstraintViolation {
|
10359 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10360 + | let message = match self {
|
10361 + | Self::Length(length) => {
|
10362 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
10363 + | }
|
10364 + | };
|
10365 + | write!(f, "{message}")
|
10366 + | }
|
10367 + | }
|
10368 + |
|
10369 + | impl ::std::error::Error for ConstraintViolation {}
|
10370 + | impl ConstraintViolation {
|
10371 + | pub(crate) fn as_validation_exception_field(
|
10372 + | self,
|
10373 + | path: ::std::string::String,
|
10374 + | ) -> crate::model::ValidationExceptionField {
|
10375 + | match self {
|
10376 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10377 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
10378 + | path,
|
10379 + | },
|
10380 + | }
|
10381 + | }
|
10382 + | }
|
10383 + | }
|
10384 + | pub(crate) mod max_length_blob_internal {
|
10385 + |
|
10386 + | #[derive(Debug, PartialEq)]
|
10387 + | pub enum ConstraintViolation {
|
10388 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10389 + | Length(usize),
|
10390 + | }
|
10391 + |
|
10392 + | impl ::std::fmt::Display for ConstraintViolation {
|
10393 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10394 + | let message = match self {
|
10395 + | Self::Length(length) => {
|
10396 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthBlob' failed to satisfy constraint: Member must have length less than or equal to 70", length)
|
10397 + | }
|
10398 + | };
|
10399 + | write!(f, "{message}")
|
10400 + | }
|
10401 + | }
|
10402 + |
|
10403 + | impl ::std::error::Error for ConstraintViolation {}
|
10404 + | impl ConstraintViolation {
|
10405 + | pub(crate) fn as_validation_exception_field(
|
10406 + | self,
|
10407 + | path: ::std::string::String,
|
10408 + | ) -> crate::model::ValidationExceptionField {
|
10409 + | match self {
|
10410 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10411 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
10412 + | path,
|
10413 + | },
|
10414 + | }
|
10415 + | }
|
10416 + | }
|
10417 + | }
|
10418 + | pub(crate) mod min_length_blob_internal {
|
10419 + |
|
10420 + | #[derive(Debug, PartialEq)]
|
10421 + | pub enum ConstraintViolation {
|
10422 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10423 + | Length(usize),
|
10424 + | }
|
10425 + |
|
10426 + | impl ::std::fmt::Display for ConstraintViolation {
|
10427 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10428 + | let message = match self {
|
10429 + | Self::Length(length) => {
|
10430 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthBlob' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
10431 + | }
|
10432 + | };
|
10433 + | write!(f, "{message}")
|
10434 + | }
|
10435 + | }
|
10436 + |
|
10437 + | impl ::std::error::Error for ConstraintViolation {}
|
10438 + | impl ConstraintViolation {
|
10439 + | pub(crate) fn as_validation_exception_field(
|
10440 + | self,
|
10441 + | path: ::std::string::String,
|
10442 + | ) -> crate::model::ValidationExceptionField {
|
10443 + | match self {
|
10444 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10445 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10446 + | path,
|
10447 + | },
|
10448 + | }
|
10449 + | }
|
10450 + | }
|
10451 + | }
|
10452 + | pub(crate) mod fixed_length_string_internal {
|
10453 + |
|
10454 + | #[derive(Debug, PartialEq)]
|
10455 + | pub enum ConstraintViolation {
|
10456 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
10457 + | Length(usize),
|
10458 + | }
|
10459 + |
|
10460 + | impl ::std::fmt::Display for ConstraintViolation {
|
10461 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10462 + | let message = match self {
|
10463 + | Self::Length(length) => {
|
10464 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
10465 + | }
|
10466 + | };
|
10467 + | write!(f, "{message}")
|
10468 + | }
|
10469 + | }
|
10470 + |
|
10471 + | impl ::std::error::Error for ConstraintViolation {}
|
10472 + | impl ConstraintViolation {
|
10473 + | pub(crate) fn as_validation_exception_field(
|
10474 + | self,
|
10475 + | path: ::std::string::String,
|
10476 + | ) -> crate::model::ValidationExceptionField {
|
10477 + | match self {
|
10478 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10479 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
10480 + | path,
|
10481 + | },
|
10482 + | }
|
10483 + | }
|
10484 + | }
|
10485 + | }
|
10486 + | pub(crate) mod max_length_string_internal {
|
10487 + |
|
10488 + | #[derive(Debug, PartialEq)]
|
10489 + | pub enum ConstraintViolation {
|
10490 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
10491 + | Length(usize),
|
10492 + | }
|
10493 + |
|
10494 + | impl ::std::fmt::Display for ConstraintViolation {
|
10495 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10496 + | let message = match self {
|
10497 + | Self::Length(length) => {
|
10498 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthString' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
10499 + | }
|
10500 + | };
|
10501 + | write!(f, "{message}")
|
10502 + | }
|
10503 + | }
|
10504 + |
|
10505 + | impl ::std::error::Error for ConstraintViolation {}
|
10506 + | impl ConstraintViolation {
|
10507 + | pub(crate) fn as_validation_exception_field(
|
10508 + | self,
|
10509 + | path: ::std::string::String,
|
10510 + | ) -> crate::model::ValidationExceptionField {
|
10511 + | match self {
|
10512 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10513 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10514 + | path,
|
10515 + | },
|
10516 + | }
|
10517 + | }
|
10518 + | }
|
10519 + | }
|
10520 + | pub(crate) mod min_length_string_internal {
|
10521 + |
|
10522 + | #[derive(Debug, PartialEq)]
|
10523 + | pub enum ConstraintViolation {
|
10524 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
10525 + | Length(usize),
|
10526 + | }
|
10527 + |
|
10528 + | impl ::std::fmt::Display for ConstraintViolation {
|
10529 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10530 + | let message = match self {
|
10531 + | Self::Length(length) => {
|
10532 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthString' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
10533 + | }
|
10534 + | };
|
10535 + | write!(f, "{message}")
|
10536 + | }
|
10537 + | }
|
10538 + |
|
10539 + | impl ::std::error::Error for ConstraintViolation {}
|
10540 + | impl ConstraintViolation {
|
10541 + | pub(crate) fn as_validation_exception_field(
|
10542 + | self,
|
10543 + | path: ::std::string::String,
|
10544 + | ) -> crate::model::ValidationExceptionField {
|
10545 + | match self {
|
10546 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10547 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10548 + | path,
|
10549 + | },
|
10550 + | }
|
10551 + | }
|
10552 + | }
|
10553 + | }
|
10554 + | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10555 + | pub mod transitively_constrained_structure_in_output {
|
10556 + |
|
10557 + | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
10558 + | fn from(builder: Builder) -> Self {
|
10559 + | builder.build()
|
10560 + | }
|
10561 + | }
|
10562 + | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10563 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10564 + | pub struct Builder {
|
10565 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
10566 + | }
|
10567 + | impl Builder {
|
10568 + | #[allow(missing_docs)] // documentation missing in model
|
10569 + | pub fn length_string(
|
10570 + | mut self,
|
10571 + | input: ::std::option::Option<::std::string::String>,
|
10572 + | ) -> Self {
|
10573 + | self.length_string = input;
|
10574 + | self
|
10575 + | }
|
10576 + | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10577 + | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10578 + | self.build_enforcing_required_and_enum_traits()
|
10579 + | }
|
10580 + | fn build_enforcing_required_and_enum_traits(
|
10581 + | self,
|
10582 + | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10583 + | crate::model::TransitivelyConstrainedStructureInOutput {
|
10584 + | length_string: self.length_string,
|
10585 + | }
|
10586 + | }
|
10587 + | }
|
10588 + | }
|
10589 + | pub(crate) mod constrained_map_in_output_internal {
|
10590 + |
|
10591 + | #[allow(clippy::enum_variant_names)]
|
10592 + | #[derive(Debug, PartialEq)]
|
10593 + | pub(crate) enum ConstraintViolation {
|
10594 + | Length(usize),
|
10595 + | }
|
10596 + |
|
10597 + | impl ::std::fmt::Display for ConstraintViolation {
|
10598 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10599 + | match self {
|
10600 + | Self::Length(length) => {
|
10601 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConstrainedMapInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
10602 + | }
|
10603 + | }
|
10604 + | }
|
10605 + | }
|
10606 + |
|
10607 + | impl ::std::error::Error for ConstraintViolation {}
|
10608 + | }
|
10609 + | pub(crate) mod constrained_list_in_output_internal {
|
10610 + |
|
10611 + | #[allow(clippy::enum_variant_names)]
|
10612 + | #[derive(Debug, PartialEq)]
|
10613 + | pub(crate) enum ConstraintViolation {
|
10614 + | /// Constraint violation error when the list doesn't have the required length
|
10615 + | Length(usize),
|
10616 + | }
|
10617 + |
|
10618 + | impl ::std::fmt::Display for ConstraintViolation {
|
10619 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10620 + | let message = match self {
|
10621 + | Self::Length(length) => {
|
10622 + | format!("Value with length {} provided for 'com.amazonaws.constraints#ConstrainedListInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
10623 + | }
|
10624 + | };
|
10625 + | write!(f, "{message}")
|
10626 + | }
|
10627 + | }
|
10628 + |
|
10629 + | impl ::std::error::Error for ConstraintViolation {}
|
10630 + | }
|