1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// Describes one specific validation failure for an input member.
|
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,
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4 + | pub struct ConA {
|
5 + | #[allow(missing_docs)] // documentation missing in model
|
6 + | pub con_b: crate::model::ConB,
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub length_string: ::std::option::Option<crate::model::LengthString>,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub min_length_string: ::std::option::Option<crate::model::MinLengthString>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub max_length_string: ::std::option::Option<crate::model::MaxLengthString>,
|
15 + | #[allow(missing_docs)] // documentation missing in model
|
16 + | pub fixed_length_string: ::std::option::Option<crate::model::FixedLengthString>,
|
17 + | #[allow(missing_docs)] // documentation missing in model
|
18 + | pub length_blob: ::std::option::Option<crate::model::LengthBlob>,
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | pub min_length_blob: ::std::option::Option<crate::model::MinLengthBlob>,
|
21 + | #[allow(missing_docs)] // documentation missing in model
|
22 + | pub max_length_blob: ::std::option::Option<crate::model::MaxLengthBlob>,
|
23 + | #[allow(missing_docs)] // documentation missing in model
|
24 + | pub fixed_length_blob: ::std::option::Option<crate::model::FixedLengthBlob>,
|
25 + | #[allow(missing_docs)] // documentation missing in model
|
26 + | pub range_integer: crate::model::RangeInteger,
|
27 + | #[allow(missing_docs)] // documentation missing in model
|
28 + | pub min_range_integer: crate::model::MinRangeInteger,
|
29 + | #[allow(missing_docs)] // documentation missing in model
|
30 + | pub max_range_integer: crate::model::MaxRangeInteger,
|
31 + | #[allow(missing_docs)] // documentation missing in model
|
32 + | pub fixed_value_integer: crate::model::FixedValueInteger,
|
33 + | #[allow(missing_docs)] // documentation missing in model
|
34 + | pub range_short: crate::model::RangeShort,
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | pub min_range_short: crate::model::MinRangeShort,
|
37 + | #[allow(missing_docs)] // documentation missing in model
|
38 + | pub max_range_short: crate::model::MaxRangeShort,
|
39 + | #[allow(missing_docs)] // documentation missing in model
|
40 + | pub fixed_value_short: crate::model::FixedValueShort,
|
41 + | #[allow(missing_docs)] // documentation missing in model
|
42 + | pub range_long: crate::model::RangeLong,
|
43 + | #[allow(missing_docs)] // documentation missing in model
|
44 + | pub min_range_long: crate::model::MinRangeLong,
|
45 + | #[allow(missing_docs)] // documentation missing in model
|
46 + | pub max_range_long: crate::model::MaxRangeLong,
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | pub fixed_value_long: crate::model::FixedValueLong,
|
49 + | #[allow(missing_docs)] // documentation missing in model
|
50 + | pub range_byte: crate::model::RangeByte,
|
51 + | #[allow(missing_docs)] // documentation missing in model
|
52 + | pub min_range_byte: crate::model::MinRangeByte,
|
53 + | #[allow(missing_docs)] // documentation missing in model
|
54 + | pub max_range_byte: crate::model::MaxRangeByte,
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | pub fixed_value_byte: crate::model::FixedValueByte,
|
57 + | #[allow(missing_docs)] // documentation missing in model
|
58 + | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
59 + | #[allow(missing_docs)] // documentation missing in model
|
60 + | pub length_list: ::std::option::Option<crate::model::LengthList>,
|
61 + | #[allow(missing_docs)] // documentation missing in model
|
62 + | pub sensitive_length_list: ::std::option::Option<crate::model::SensitiveLengthList>,
|
63 + | #[allow(missing_docs)] // documentation missing in model
|
64 + | pub con_b_set: ::std::option::Option<crate::model::ConBSet>,
|
65 + | #[allow(missing_docs)] // documentation missing in model
|
66 + | pub con_b_map: ::std::option::Option<crate::model::ConBMap>,
|
67 + | #[allow(missing_docs)] // documentation missing in model
|
68 + | pub length_map: ::std::option::Option<crate::model::LengthMap>,
|
69 + | #[allow(missing_docs)] // documentation missing in model
|
70 + | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
71 + | ::std::collections::HashMap<
|
72 + | ::std::string::String,
|
73 + | ::std::collections::HashMap<
|
74 + | ::std::string::String,
|
75 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
76 + | >,
|
77 + | >,
|
78 + | >,
|
79 + | #[allow(missing_docs)] // documentation missing in model
|
80 + | pub sparse_map: ::std::option::Option<
|
81 + | ::std::collections::HashMap<
|
82 + | ::std::string::String,
|
83 + | ::std::option::Option<crate::model::UniqueItemsList>,
|
84 + | >,
|
85 + | >,
|
86 + | #[allow(missing_docs)] // documentation missing in model
|
87 + | pub sparse_list:
|
88 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::model::LengthString>>>,
|
89 + | #[allow(missing_docs)] // documentation missing in model
|
90 + | pub sparse_length_map: ::std::option::Option<crate::model::SparseLengthMap>,
|
91 + | #[allow(missing_docs)] // documentation missing in model
|
92 + | pub sparse_length_list: ::std::option::Option<crate::model::SparseLengthList>,
|
93 + | /// A union with constrained members.
|
94 + | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
95 + | #[allow(missing_docs)] // documentation missing in model
|
96 + | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
97 + | #[allow(missing_docs)] // documentation missing in model
|
98 + | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<crate::model::LengthString>>,
|
99 + | #[allow(missing_docs)] // documentation missing in model
|
100 + | pub set_of_length_string: ::std::option::Option<crate::model::SetOfLengthString>,
|
101 + | #[allow(missing_docs)] // documentation missing in model
|
102 + | pub map_of_length_string: ::std::option::Option<
|
103 + | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
104 + | >,
|
105 + | #[allow(missing_docs)] // documentation missing in model
|
106 + | pub list_of_length_blob: ::std::option::Option<::std::vec::Vec<crate::model::LengthBlob>>,
|
107 + | #[allow(missing_docs)] // documentation missing in model
|
108 + | pub map_of_length_blob: ::std::option::Option<
|
109 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
110 + | >,
|
111 + | #[allow(missing_docs)] // documentation missing in model
|
112 + | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<crate::model::RangeInteger>>,
|
113 + | #[allow(missing_docs)] // documentation missing in model
|
114 + | pub set_of_range_integer: ::std::option::Option<crate::model::SetOfRangeInteger>,
|
115 + | #[allow(missing_docs)] // documentation missing in model
|
116 + | pub map_of_range_integer: ::std::option::Option<
|
117 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
118 + | >,
|
119 + | #[allow(missing_docs)] // documentation missing in model
|
120 + | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<crate::model::RangeShort>>,
|
121 + | #[allow(missing_docs)] // documentation missing in model
|
122 + | pub set_of_range_short: ::std::option::Option<crate::model::SetOfRangeShort>,
|
123 + | #[allow(missing_docs)] // documentation missing in model
|
124 + | pub map_of_range_short: ::std::option::Option<
|
125 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
126 + | >,
|
127 + | #[allow(missing_docs)] // documentation missing in model
|
128 + | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<crate::model::RangeLong>>,
|
129 + | #[allow(missing_docs)] // documentation missing in model
|
130 + | pub set_of_range_long: ::std::option::Option<crate::model::SetOfRangeLong>,
|
131 + | #[allow(missing_docs)] // documentation missing in model
|
132 + | pub map_of_range_long: ::std::option::Option<
|
133 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
134 + | >,
|
135 + | #[allow(missing_docs)] // documentation missing in model
|
136 + | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<crate::model::RangeByte>>,
|
137 + | #[allow(missing_docs)] // documentation missing in model
|
138 + | pub set_of_range_byte: ::std::option::Option<crate::model::SetOfRangeByte>,
|
139 + | #[allow(missing_docs)] // documentation missing in model
|
140 + | pub map_of_range_byte: ::std::option::Option<
|
141 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
142 + | >,
|
143 + | #[allow(missing_docs)] // documentation missing in model
|
144 + | pub non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
145 + | #[allow(missing_docs)] // documentation missing in model
|
146 + | pub pattern_string: ::std::option::Option<crate::model::PatternString>,
|
147 + | #[allow(missing_docs)] // documentation missing in model
|
148 + | pub map_of_pattern_string: ::std::option::Option<
|
149 + | ::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
150 + | >,
|
151 + | #[allow(missing_docs)] // documentation missing in model
|
152 + | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
153 + | #[allow(missing_docs)] // documentation missing in model
|
154 + | pub set_of_pattern_string: ::std::option::Option<crate::model::SetOfPatternString>,
|
155 + | #[allow(missing_docs)] // documentation missing in model
|
156 + | pub length_length_pattern_string: ::std::option::Option<crate::model::LengthPatternString>,
|
157 + | #[allow(missing_docs)] // documentation missing in model
|
158 + | pub map_of_length_pattern_string: ::std::option::Option<
|
159 + | ::std::collections::HashMap<
|
160 + | crate::model::LengthPatternString,
|
161 + | crate::model::LengthPatternString,
|
162 + | >,
|
163 + | >,
|
164 + | #[allow(missing_docs)] // documentation missing in model
|
165 + | pub list_of_length_pattern_string:
|
166 + | ::std::option::Option<::std::vec::Vec<crate::model::LengthPatternString>>,
|
167 + | #[allow(missing_docs)] // documentation missing in model
|
168 + | pub set_of_length_pattern_string: ::std::option::Option<crate::model::SetOfLengthPatternString>,
|
169 + | #[allow(missing_docs)] // documentation missing in model
|
170 + | pub length_list_of_pattern_string:
|
171 + | ::std::option::Option<crate::model::LengthListOfPatternString>,
|
172 + | #[allow(missing_docs)] // documentation missing in model
|
173 + | pub length_set_of_pattern_string: ::std::option::Option<crate::model::LengthSetOfPatternString>,
|
12 174 | }
|
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()
|
175 + | impl ConA {
|
176 + | #[allow(missing_docs)] // documentation missing in model
|
177 + | pub fn con_b(&self) -> &crate::model::ConB {
|
178 + | &self.con_b
|
18 179 | }
|
19 - | /// A detailed description of the validation failure.
|
20 - | pub fn message(&self) -> &str {
|
21 - | use std::ops::Deref;
|
22 - | self.message.deref()
|
180 + | #[allow(missing_docs)] // documentation missing in model
|
181 + | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
182 + | self.opt_con_b.as_ref()
|
23 183 | }
|
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()
|
184 + | #[allow(missing_docs)] // documentation missing in model
|
185 + | pub fn length_string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
186 + | self.length_string.as_ref()
|
29 187 | }
|
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 188 | #[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)
|
189 + | pub fn min_length_string(&self) -> ::std::option::Option<&crate::model::MinLengthString> {
|
190 + | self.min_length_string.as_ref()
|
49 191 | }
|
192 + | #[allow(missing_docs)] // documentation missing in model
|
193 + | pub fn max_length_string(&self) -> ::std::option::Option<&crate::model::MaxLengthString> {
|
194 + | self.max_length_string.as_ref()
|
50 195 | }
|
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()
|
196 + | #[allow(missing_docs)] // documentation missing in model
|
197 + | pub fn fixed_length_string(&self) -> ::std::option::Option<&crate::model::FixedLengthString> {
|
198 + | self.fixed_length_string.as_ref()
|
54 199 | }
|
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 200 | #[allow(missing_docs)] // documentation missing in model
|
63 - | pub message_content: ::std::option::Option<::std::string::String>,
|
64 - | }
|
65 - | impl EventStreamRegularMessage {
|
201 + | pub fn length_blob(&self) -> ::std::option::Option<&crate::model::LengthBlob> {
|
202 + | self.length_blob.as_ref()
|
203 + | }
|
66 204 | #[allow(missing_docs)] // documentation missing in model
|
67 - | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
68 - | self.message_content.as_deref()
|
205 + | pub fn min_length_blob(&self) -> ::std::option::Option<&crate::model::MinLengthBlob> {
|
206 + | self.min_length_blob.as_ref()
|
69 207 | }
|
70 - | }
|
71 - | impl EventStreamRegularMessage {
|
72 - | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
73 - | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
74 - | crate::model::event_stream_regular_message::Builder::default()
|
208 + | #[allow(missing_docs)] // documentation missing in model
|
209 + | pub fn max_length_blob(&self) -> ::std::option::Option<&crate::model::MaxLengthBlob> {
|
210 + | self.max_length_blob.as_ref()
|
75 211 | }
|
76 - | }
|
77 - | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
78 - | type Unconstrained = crate::model::event_stream_regular_message::Builder;
|
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 212 | #[allow(missing_docs)] // documentation missing in model
|
93 - | M256Mega,
|
213 + | pub fn fixed_length_blob(&self) -> ::std::option::Option<&crate::model::FixedLengthBlob> {
|
214 + | self.fixed_length_blob.as_ref()
|
215 + | }
|
94 216 | #[allow(missing_docs)] // documentation missing in model
|
95 - | T2Micro,
|
217 + | pub fn range_integer(&self) -> &crate::model::RangeInteger {
|
218 + | &self.range_integer
|
219 + | }
|
96 220 | #[allow(missing_docs)] // documentation missing in model
|
97 - | T2Nano,
|
98 - | }
|
99 - | /// See [`EnumString`](crate::model::EnumString).
|
100 - | pub mod enum_string {
|
101 - | #[derive(Debug, PartialEq)]
|
102 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
103 - |
|
104 - | impl ::std::fmt::Display for ConstraintViolation {
|
105 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
106 - | write!(
|
107 - | f,
|
108 - | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
109 - | )
|
221 + | pub fn min_range_integer(&self) -> &crate::model::MinRangeInteger {
|
222 + | &self.min_range_integer
|
110 223 | }
|
224 + | #[allow(missing_docs)] // documentation missing in model
|
225 + | pub fn max_range_integer(&self) -> &crate::model::MaxRangeInteger {
|
226 + | &self.max_range_integer
|
111 227 | }
|
112 - |
|
113 - | impl ::std::error::Error for ConstraintViolation {}
|
114 - | impl ConstraintViolation {
|
115 - | pub(crate) fn as_validation_exception_field(
|
116 - | self,
|
117 - | path: ::std::string::String,
|
118 - | ) -> crate::model::ValidationExceptionField {
|
119 - | crate::model::ValidationExceptionField {
|
120 - | message: format!(
|
121 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
122 - | &path
|
123 - | ),
|
124 - | path,
|
228 + | #[allow(missing_docs)] // documentation missing in model
|
229 + | pub fn fixed_value_integer(&self) -> &crate::model::FixedValueInteger {
|
230 + | &self.fixed_value_integer
|
125 231 | }
|
232 + | #[allow(missing_docs)] // documentation missing in model
|
233 + | pub fn range_short(&self) -> &crate::model::RangeShort {
|
234 + | &self.range_short
|
126 235 | }
|
236 + | #[allow(missing_docs)] // documentation missing in model
|
237 + | pub fn min_range_short(&self) -> &crate::model::MinRangeShort {
|
238 + | &self.min_range_short
|
127 239 | }
|
128 - | }
|
129 - | impl ::std::convert::TryFrom<&str> for EnumString {
|
130 - | type Error = crate::model::enum_string::ConstraintViolation;
|
131 - | fn try_from(
|
132 - | s: &str,
|
133 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
134 - | match s {
|
135 - | "m256.mega" => Ok(EnumString::M256Mega),
|
136 - | "t2.micro" => Ok(EnumString::T2Micro),
|
137 - | "t2.nano" => Ok(EnumString::T2Nano),
|
138 - | _ => Err(crate::model::enum_string::ConstraintViolation(s.to_owned())),
|
240 + | #[allow(missing_docs)] // documentation missing in model
|
241 + | pub fn max_range_short(&self) -> &crate::model::MaxRangeShort {
|
242 + | &self.max_range_short
|
139 243 | }
|
244 + | #[allow(missing_docs)] // documentation missing in model
|
245 + | pub fn fixed_value_short(&self) -> &crate::model::FixedValueShort {
|
246 + | &self.fixed_value_short
|
140 247 | }
|
141 - | }
|
142 - | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
143 - | type Error = crate::model::enum_string::ConstraintViolation;
|
144 - | fn try_from(
|
145 - | s: ::std::string::String,
|
146 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
147 - | {
|
148 - | s.as_str().try_into()
|
248 + | #[allow(missing_docs)] // documentation missing in model
|
249 + | pub fn range_long(&self) -> &crate::model::RangeLong {
|
250 + | &self.range_long
|
149 251 | }
|
150 - | }
|
151 - | impl std::str::FromStr for EnumString {
|
152 - | type Err = crate::model::enum_string::ConstraintViolation;
|
153 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
154 - | Self::try_from(s)
|
252 + | #[allow(missing_docs)] // documentation missing in model
|
253 + | pub fn min_range_long(&self) -> &crate::model::MinRangeLong {
|
254 + | &self.min_range_long
|
155 255 | }
|
156 - | }
|
157 - | impl EnumString {
|
158 - | /// Returns the `&str` value of the enum member.
|
159 - | pub fn as_str(&self) -> &str {
|
160 - | match self {
|
161 - | EnumString::M256Mega => "m256.mega",
|
162 - | EnumString::T2Micro => "t2.micro",
|
163 - | EnumString::T2Nano => "t2.nano",
|
256 + | #[allow(missing_docs)] // documentation missing in model
|
257 + | pub fn max_range_long(&self) -> &crate::model::MaxRangeLong {
|
258 + | &self.max_range_long
|
164 259 | }
|
260 + | #[allow(missing_docs)] // documentation missing in model
|
261 + | pub fn fixed_value_long(&self) -> &crate::model::FixedValueLong {
|
262 + | &self.fixed_value_long
|
165 263 | }
|
166 - | /// Returns all the `&str` representations of the enum members.
|
167 - | pub const fn values() -> &'static [&'static str] {
|
168 - | &["m256.mega", "t2.micro", "t2.nano"]
|
264 + | #[allow(missing_docs)] // documentation missing in model
|
265 + | pub fn range_byte(&self) -> &crate::model::RangeByte {
|
266 + | &self.range_byte
|
169 267 | }
|
170 - | }
|
171 - | impl ::std::convert::AsRef<str> for EnumString {
|
172 - | fn as_ref(&self) -> &str {
|
173 - | self.as_str()
|
268 + | #[allow(missing_docs)] // documentation missing in model
|
269 + | pub fn min_range_byte(&self) -> &crate::model::MinRangeByte {
|
270 + | &self.min_range_byte
|
174 271 | }
|
175 - | }
|
176 - | impl crate::constrained::Constrained for EnumString {
|
177 - | type Unconstrained = ::std::string::String;
|
178 - | }
|
179 - |
|
180 - | impl ::std::convert::From<::std::string::String>
|
181 - | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
182 - | {
|
183 - | fn from(value: ::std::string::String) -> Self {
|
184 - | Self::Unconstrained(value)
|
272 + | #[allow(missing_docs)] // documentation missing in model
|
273 + | pub fn max_range_byte(&self) -> &crate::model::MaxRangeByte {
|
274 + | &self.max_range_byte
|
185 275 | }
|
186 - | }
|
187 - |
|
188 - | #[allow(missing_docs)] // documentation missing in model
|
189 - | ///
|
190 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
191 - | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
192 - | ///
|
193 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
194 - | ///
|
195 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
196 - | pub struct ConBMap(
|
197 - | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
198 - | );
|
199 - | impl ConBMap {
|
200 - | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
201 - | pub fn inner(
|
202 - | &self,
|
203 - | ) -> &::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
204 - | &self.0
|
276 + | #[allow(missing_docs)] // documentation missing in model
|
277 + | pub fn fixed_value_byte(&self) -> &crate::model::FixedValueByte {
|
278 + | &self.fixed_value_byte
|
205 279 | }
|
206 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
207 - | pub fn into_inner(
|
208 - | self,
|
209 - | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
210 - | self.0
|
280 + | #[allow(missing_docs)] // documentation missing in model
|
281 + | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
282 + | self.con_b_list.as_deref()
|
211 283 | }
|
212 - | }
|
213 - | impl
|
214 - | ::std::convert::TryFrom<
|
215 - | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
216 - | > for ConBMap
|
217 - | {
|
218 - | type Error = crate::model::con_b_map::ConstraintViolation;
|
219 - |
|
220 - | /// 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.
|
221 - | fn try_from(
|
222 - | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
223 - | ) -> ::std::result::Result<Self, Self::Error> {
|
224 - | let length = value.len();
|
225 - | if (1..=69).contains(&length) {
|
226 - | Ok(Self(value))
|
227 - | } else {
|
228 - | Err(crate::model::con_b_map::ConstraintViolation::Length(length))
|
284 + | #[allow(missing_docs)] // documentation missing in model
|
285 + | pub fn length_list(&self) -> ::std::option::Option<&crate::model::LengthList> {
|
286 + | self.length_list.as_ref()
|
229 287 | }
|
288 + | #[allow(missing_docs)] // documentation missing in model
|
289 + | pub fn sensitive_length_list(
|
290 + | &self,
|
291 + | ) -> ::std::option::Option<&crate::model::SensitiveLengthList> {
|
292 + | self.sensitive_length_list.as_ref()
|
230 293 | }
|
231 - | }
|
232 - |
|
233 - | impl ::std::convert::From<ConBMap>
|
234 - | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
235 - | {
|
236 - | fn from(value: ConBMap) -> Self {
|
237 - | value.into_inner()
|
294 + | #[allow(missing_docs)] // documentation missing in model
|
295 + | pub fn con_b_set(&self) -> ::std::option::Option<&crate::model::ConBSet> {
|
296 + | self.con_b_set.as_ref()
|
238 297 | }
|
239 - | }
|
240 - | impl crate::constrained::Constrained for ConBMap {
|
241 - | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
242 - | }
|
243 - |
|
244 - | #[allow(missing_docs)] // documentation missing in model
|
245 - | ///
|
246 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
247 - | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
248 - | ///
|
249 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
250 - | ///
|
251 - | #[derive(
|
252 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
253 - | )]
|
254 - | pub struct LengthString(pub(crate) ::std::string::String);
|
255 - | impl LengthString {
|
256 - | /// Extracts a string slice containing the entire underlying `String`.
|
257 - | pub fn as_str(&self) -> &str {
|
258 - | &self.0
|
298 + | #[allow(missing_docs)] // documentation missing in model
|
299 + | pub fn con_b_map(&self) -> ::std::option::Option<&crate::model::ConBMap> {
|
300 + | self.con_b_map.as_ref()
|
259 301 | }
|
260 - |
|
261 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
262 - | pub fn inner(&self) -> &::std::string::String {
|
263 - | &self.0
|
302 + | #[allow(missing_docs)] // documentation missing in model
|
303 + | pub fn length_map(&self) -> ::std::option::Option<&crate::model::LengthMap> {
|
304 + | self.length_map.as_ref()
|
264 305 | }
|
265 - |
|
266 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
267 - | pub fn into_inner(self) -> ::std::string::String {
|
268 - | self.0
|
269 - | }
|
270 - | }
|
271 - | impl LengthString {
|
272 - | fn check_length(
|
273 - | string: &str,
|
274 - | ) -> ::std::result::Result<(), crate::model::length_string::ConstraintViolation> {
|
275 - | let length = string.chars().count();
|
276 - |
|
277 - | if (2..=69).contains(&length) {
|
278 - | Ok(())
|
279 - | } else {
|
280 - | Err(crate::model::length_string::ConstraintViolation::Length(
|
281 - | length,
|
282 - | ))
|
306 + | #[allow(missing_docs)] // documentation missing in model
|
307 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
308 + | &self,
|
309 + | ) -> ::std::option::Option<
|
310 + | &::std::collections::HashMap<
|
311 + | ::std::string::String,
|
312 + | ::std::collections::HashMap<
|
313 + | ::std::string::String,
|
314 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
315 + | >,
|
316 + | >,
|
317 + | > {
|
318 + | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
283 319 | }
|
320 + | #[allow(missing_docs)] // documentation missing in model
|
321 + | pub fn sparse_map(
|
322 + | &self,
|
323 + | ) -> ::std::option::Option<
|
324 + | &::std::collections::HashMap<
|
325 + | ::std::string::String,
|
326 + | ::std::option::Option<crate::model::UniqueItemsList>,
|
327 + | >,
|
328 + | > {
|
329 + | self.sparse_map.as_ref()
|
284 330 | }
|
285 - | }
|
286 - | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
287 - | type Error = crate::model::length_string::ConstraintViolation;
|
288 - |
|
289 - | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
290 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
291 - | Self::check_length(&value)?;
|
292 - |
|
293 - | Ok(Self(value))
|
331 + | #[allow(missing_docs)] // documentation missing in model
|
332 + | pub fn sparse_list(
|
333 + | &self,
|
334 + | ) -> ::std::option::Option<&[::std::option::Option<crate::model::LengthString>]> {
|
335 + | self.sparse_list.as_deref()
|
294 336 | }
|
295 - | }
|
296 - | impl crate::constrained::Constrained for LengthString {
|
297 - | type Unconstrained = ::std::string::String;
|
298 - | }
|
299 - |
|
300 - | impl ::std::convert::From<::std::string::String>
|
301 - | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
302 - | {
|
303 - | fn from(value: ::std::string::String) -> Self {
|
304 - | Self::Unconstrained(value)
|
337 + | #[allow(missing_docs)] // documentation missing in model
|
338 + | pub fn sparse_length_map(&self) -> ::std::option::Option<&crate::model::SparseLengthMap> {
|
339 + | self.sparse_length_map.as_ref()
|
305 340 | }
|
306 - | }
|
307 - |
|
308 - | impl ::std::fmt::Display for LengthString {
|
309 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
310 - | self.0.fmt(f)
|
341 + | #[allow(missing_docs)] // documentation missing in model
|
342 + | pub fn sparse_length_list(&self) -> ::std::option::Option<&crate::model::SparseLengthList> {
|
343 + | self.sparse_length_list.as_ref()
|
311 344 | }
|
312 - | }
|
313 - |
|
314 - | impl ::std::convert::From<LengthString> for ::std::string::String {
|
315 - | fn from(value: LengthString) -> Self {
|
316 - | value.into_inner()
|
345 + | /// A union with constrained members.
|
346 + | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
347 + | self.constrained_union.as_ref()
|
317 348 | }
|
318 - | }
|
319 - |
|
320 - | #[allow(missing_docs)] // documentation missing in model
|
321 - | ///
|
322 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
323 - | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
324 - | ///
|
325 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
326 - | ///
|
327 - | #[derive(
|
328 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
329 - | )]
|
330 - | pub struct LengthPatternString(pub(crate) ::std::string::String);
|
331 - | impl LengthPatternString {
|
332 - | /// Extracts a string slice containing the entire underlying `String`.
|
333 - | pub fn as_str(&self) -> &str {
|
334 - | &self.0
|
349 + | #[allow(missing_docs)] // documentation missing in model
|
350 + | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
351 + | self.enum_string.as_ref()
|
335 352 | }
|
336 - |
|
337 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
338 - | pub fn inner(&self) -> &::std::string::String {
|
339 - | &self.0
|
353 + | #[allow(missing_docs)] // documentation missing in model
|
354 + | pub fn list_of_length_string(&self) -> ::std::option::Option<&[crate::model::LengthString]> {
|
355 + | self.list_of_length_string.as_deref()
|
340 356 | }
|
341 - |
|
342 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
343 - | pub fn into_inner(self) -> ::std::string::String {
|
344 - | self.0
|
357 + | #[allow(missing_docs)] // documentation missing in model
|
358 + | pub fn set_of_length_string(&self) -> ::std::option::Option<&crate::model::SetOfLengthString> {
|
359 + | self.set_of_length_string.as_ref()
|
345 360 | }
|
346 - | }
|
347 - | impl LengthPatternString {
|
348 - | fn check_length(
|
349 - | string: &str,
|
350 - | ) -> ::std::result::Result<(), crate::model::length_pattern_string::ConstraintViolation> {
|
351 - | let length = string.chars().count();
|
352 - |
|
353 - | if (5..=10).contains(&length) {
|
354 - | Ok(())
|
355 - | } else {
|
356 - | Err(crate::model::length_pattern_string::ConstraintViolation::Length(length))
|
361 + | #[allow(missing_docs)] // documentation missing in model
|
362 + | pub fn map_of_length_string(
|
363 + | &self,
|
364 + | ) -> ::std::option::Option<
|
365 + | &::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
366 + | > {
|
367 + | self.map_of_length_string.as_ref()
|
357 368 | }
|
369 + | #[allow(missing_docs)] // documentation missing in model
|
370 + | pub fn list_of_length_blob(&self) -> ::std::option::Option<&[crate::model::LengthBlob]> {
|
371 + | self.list_of_length_blob.as_deref()
|
358 372 | }
|
359 - |
|
360 - | fn check_pattern(
|
361 - | string: ::std::string::String,
|
362 - | ) -> ::std::result::Result<
|
363 - | ::std::string::String,
|
364 - | crate::model::length_pattern_string::ConstraintViolation,
|
373 + | #[allow(missing_docs)] // documentation missing in model
|
374 + | pub fn map_of_length_blob(
|
375 + | &self,
|
376 + | ) -> ::std::option::Option<
|
377 + | &::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
365 378 | > {
|
366 - | let regex = Self::compile_regex();
|
367 - |
|
368 - | if regex.is_match(&string) {
|
369 - | Ok(string)
|
370 - | } else {
|
371 - | Err(crate::model::length_pattern_string::ConstraintViolation::Pattern(string))
|
379 + | self.map_of_length_blob.as_ref()
|
372 380 | }
|
381 + | #[allow(missing_docs)] // documentation missing in model
|
382 + | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[crate::model::RangeInteger]> {
|
383 + | self.list_of_range_integer.as_deref()
|
373 384 | }
|
374 - |
|
375 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
376 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
377 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
378 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
379 - | ::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"#)
|
380 - | });
|
381 - |
|
382 - | ®EX
|
385 + | #[allow(missing_docs)] // documentation missing in model
|
386 + | pub fn set_of_range_integer(&self) -> ::std::option::Option<&crate::model::SetOfRangeInteger> {
|
387 + | self.set_of_range_integer.as_ref()
|
383 388 | }
|
384 - | }
|
385 - | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
386 - | type Error = crate::model::length_pattern_string::ConstraintViolation;
|
387 - |
|
388 - | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
389 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
390 - | Self::check_length(&value)?;
|
391 - |
|
392 - | let value = Self::check_pattern(value)?;
|
393 - |
|
394 - | Ok(Self(value))
|
389 + | #[allow(missing_docs)] // documentation missing in model
|
390 + | pub fn map_of_range_integer(
|
391 + | &self,
|
392 + | ) -> ::std::option::Option<
|
393 + | &::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
394 + | > {
|
395 + | self.map_of_range_integer.as_ref()
|
395 396 | }
|
396 - | }
|
397 - | impl crate::constrained::Constrained for LengthPatternString {
|
398 - | type Unconstrained = ::std::string::String;
|
399 - | }
|
400 - |
|
401 - | impl ::std::convert::From<::std::string::String>
|
402 - | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
403 - | {
|
404 - | fn from(value: ::std::string::String) -> Self {
|
405 - | Self::Unconstrained(value)
|
397 + | #[allow(missing_docs)] // documentation missing in model
|
398 + | pub fn list_of_range_short(&self) -> ::std::option::Option<&[crate::model::RangeShort]> {
|
399 + | self.list_of_range_short.as_deref()
|
406 400 | }
|
407 - | }
|
408 - |
|
409 - | impl ::std::fmt::Display for LengthPatternString {
|
410 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
411 - | self.0.fmt(f)
|
401 + | #[allow(missing_docs)] // documentation missing in model
|
402 + | pub fn set_of_range_short(&self) -> ::std::option::Option<&crate::model::SetOfRangeShort> {
|
403 + | self.set_of_range_short.as_ref()
|
412 404 | }
|
413 - | }
|
414 - |
|
415 - | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
416 - | fn from(value: LengthPatternString) -> Self {
|
417 - | value.into_inner()
|
405 + | #[allow(missing_docs)] // documentation missing in model
|
406 + | pub fn map_of_range_short(
|
407 + | &self,
|
408 + | ) -> ::std::option::Option<
|
409 + | &::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
410 + | > {
|
411 + | self.map_of_range_short.as_ref()
|
418 412 | }
|
419 - | }
|
420 - |
|
421 - | #[cfg(test)]
|
422 - | mod test_length_pattern_string {
|
423 - | #[test]
|
424 - | fn regex_compiles() {
|
425 - | crate::model::LengthPatternString::compile_regex();
|
413 + | #[allow(missing_docs)] // documentation missing in model
|
414 + | pub fn list_of_range_long(&self) -> ::std::option::Option<&[crate::model::RangeLong]> {
|
415 + | self.list_of_range_long.as_deref()
|
426 416 | }
|
427 - | }
|
428 - |
|
429 - | #[allow(missing_docs)] // documentation missing in model
|
430 - | ///
|
431 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
432 - | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
433 - | ///
|
434 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
435 - | ///
|
436 - | #[derive(
|
437 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
438 - | )]
|
439 - | pub struct PatternString(pub(crate) ::std::string::String);
|
440 - | impl PatternString {
|
441 - | /// Extracts a string slice containing the entire underlying `String`.
|
442 - | pub fn as_str(&self) -> &str {
|
443 - | &self.0
|
417 + | #[allow(missing_docs)] // documentation missing in model
|
418 + | pub fn set_of_range_long(&self) -> ::std::option::Option<&crate::model::SetOfRangeLong> {
|
419 + | self.set_of_range_long.as_ref()
|
444 420 | }
|
445 - |
|
446 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
447 - | pub fn inner(&self) -> &::std::string::String {
|
448 - | &self.0
|
421 + | #[allow(missing_docs)] // documentation missing in model
|
422 + | pub fn map_of_range_long(
|
423 + | &self,
|
424 + | ) -> ::std::option::Option<
|
425 + | &::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
426 + | > {
|
427 + | self.map_of_range_long.as_ref()
|
449 428 | }
|
450 - |
|
451 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
452 - | pub fn into_inner(self) -> ::std::string::String {
|
453 - | self.0
|
429 + | #[allow(missing_docs)] // documentation missing in model
|
430 + | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[crate::model::RangeByte]> {
|
431 + | self.list_of_range_byte.as_deref()
|
454 432 | }
|
455 - | }
|
456 - | impl PatternString {
|
457 - | fn check_pattern(
|
458 - | string: ::std::string::String,
|
459 - | ) -> ::std::result::Result<
|
460 - | ::std::string::String,
|
461 - | crate::model::pattern_string::ConstraintViolation,
|
433 + | #[allow(missing_docs)] // documentation missing in model
|
434 + | pub fn set_of_range_byte(&self) -> ::std::option::Option<&crate::model::SetOfRangeByte> {
|
435 + | self.set_of_range_byte.as_ref()
|
436 + | }
|
437 + | #[allow(missing_docs)] // documentation missing in model
|
438 + | pub fn map_of_range_byte(
|
439 + | &self,
|
440 + | ) -> ::std::option::Option<
|
441 + | &::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
462 442 | > {
|
463 - | let regex = Self::compile_regex();
|
464 - |
|
465 - | if regex.is_match(&string) {
|
466 - | Ok(string)
|
467 - | } else {
|
468 - | Err(crate::model::pattern_string::ConstraintViolation::Pattern(
|
469 - | string,
|
470 - | ))
|
443 + | self.map_of_range_byte.as_ref()
|
471 444 | }
|
445 + | #[allow(missing_docs)] // documentation missing in model
|
446 + | pub fn non_streaming_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
447 + | self.non_streaming_blob.as_ref()
|
472 448 | }
|
473 - |
|
474 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
475 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
476 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
477 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
478 - | ::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"#)
|
479 - | });
|
480 - |
|
481 - | ®EX
|
449 + | #[allow(missing_docs)] // documentation missing in model
|
450 + | pub fn pattern_string(&self) -> ::std::option::Option<&crate::model::PatternString> {
|
451 + | self.pattern_string.as_ref()
|
482 452 | }
|
483 - | }
|
484 - | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
485 - | type Error = crate::model::pattern_string::ConstraintViolation;
|
486 - |
|
487 - | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
488 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
489 - | let value = Self::check_pattern(value)?;
|
490 - |
|
491 - | Ok(Self(value))
|
453 + | #[allow(missing_docs)] // documentation missing in model
|
454 + | pub fn map_of_pattern_string(
|
455 + | &self,
|
456 + | ) -> ::std::option::Option<
|
457 + | &::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
458 + | > {
|
459 + | self.map_of_pattern_string.as_ref()
|
492 460 | }
|
493 - | }
|
494 - | impl crate::constrained::Constrained for PatternString {
|
495 - | type Unconstrained = ::std::string::String;
|
496 - | }
|
497 - |
|
498 - | impl ::std::convert::From<::std::string::String>
|
499 - | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
500 - | {
|
501 - | fn from(value: ::std::string::String) -> Self {
|
502 - | Self::Unconstrained(value)
|
461 + | #[allow(missing_docs)] // documentation missing in model
|
462 + | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[crate::model::PatternString]> {
|
463 + | self.list_of_pattern_string.as_deref()
|
503 464 | }
|
504 - | }
|
505 - |
|
506 - | impl ::std::fmt::Display for PatternString {
|
507 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
508 - | self.0.fmt(f)
|
465 + | #[allow(missing_docs)] // documentation missing in model
|
466 + | pub fn set_of_pattern_string(
|
467 + | &self,
|
468 + | ) -> ::std::option::Option<&crate::model::SetOfPatternString> {
|
469 + | self.set_of_pattern_string.as_ref()
|
509 470 | }
|
510 - | }
|
511 - |
|
512 - | impl ::std::convert::From<PatternString> for ::std::string::String {
|
513 - | fn from(value: PatternString) -> Self {
|
514 - | value.into_inner()
|
471 + | #[allow(missing_docs)] // documentation missing in model
|
472 + | pub fn length_length_pattern_string(
|
473 + | &self,
|
474 + | ) -> ::std::option::Option<&crate::model::LengthPatternString> {
|
475 + | self.length_length_pattern_string.as_ref()
|
476 + | }
|
477 + | #[allow(missing_docs)] // documentation missing in model
|
478 + | pub fn map_of_length_pattern_string(
|
479 + | &self,
|
480 + | ) -> ::std::option::Option<
|
481 + | &::std::collections::HashMap<
|
482 + | crate::model::LengthPatternString,
|
483 + | crate::model::LengthPatternString,
|
484 + | >,
|
485 + | > {
|
486 + | self.map_of_length_pattern_string.as_ref()
|
487 + | }
|
488 + | #[allow(missing_docs)] // documentation missing in model
|
489 + | pub fn list_of_length_pattern_string(
|
490 + | &self,
|
491 + | ) -> ::std::option::Option<&[crate::model::LengthPatternString]> {
|
492 + | self.list_of_length_pattern_string.as_deref()
|
493 + | }
|
494 + | #[allow(missing_docs)] // documentation missing in model
|
495 + | pub fn set_of_length_pattern_string(
|
496 + | &self,
|
497 + | ) -> ::std::option::Option<&crate::model::SetOfLengthPatternString> {
|
498 + | self.set_of_length_pattern_string.as_ref()
|
499 + | }
|
500 + | #[allow(missing_docs)] // documentation missing in model
|
501 + | pub fn length_list_of_pattern_string(
|
502 + | &self,
|
503 + | ) -> ::std::option::Option<&crate::model::LengthListOfPatternString> {
|
504 + | self.length_list_of_pattern_string.as_ref()
|
505 + | }
|
506 + | #[allow(missing_docs)] // documentation missing in model
|
507 + | pub fn length_set_of_pattern_string(
|
508 + | &self,
|
509 + | ) -> ::std::option::Option<&crate::model::LengthSetOfPatternString> {
|
510 + | self.length_set_of_pattern_string.as_ref()
|
515 511 | }
|
516 512 | }
|
517 - |
|
518 - | #[cfg(test)]
|
519 - | mod test_pattern_string {
|
520 - | #[test]
|
521 - | fn regex_compiles() {
|
522 - | crate::model::PatternString::compile_regex();
|
513 + | impl ConA {
|
514 + | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
515 + | pub fn builder() -> crate::model::con_a::Builder {
|
516 + | crate::model::con_a::Builder::default()
|
523 517 | }
|
524 518 | }
|
519 + | impl crate::constrained::Constrained for crate::model::ConA {
|
520 + | type Unconstrained = crate::model::con_a::Builder;
|
521 + | }
|
525 522 |
|
526 523 | #[allow(missing_docs)] // documentation missing in model
|
527 524 | ///
|
528 525 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
529 - | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
526 + | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
530 527 | ///
|
531 528 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
532 529 | ///
|
533 530 | #[derive(
|
534 531 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
535 532 | )]
|
536 - | pub struct LengthListOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
537 - | impl LengthListOfPatternString {
|
538 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
539 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::PatternString> {
|
533 + | pub struct ConstrainedListInOutput(
|
534 + | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
535 + | );
|
536 + | impl ConstrainedListInOutput {
|
537 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
538 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
540 539 | &self.0
|
541 540 | }
|
542 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
543 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
541 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
542 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
544 543 | self.0
|
545 544 | }
|
546 545 |
|
547 546 | fn check_length(
|
548 547 | length: usize,
|
549 - | ) -> ::std::result::Result<(), crate::model::length_list_of_pattern_string::ConstraintViolation>
|
548 + | ) -> ::std::result::Result<(), crate::model::constrained_list_in_output::ConstraintViolation>
|
550 549 | {
|
551 - | if (12..=39).contains(&length) {
|
550 + | if 69 <= length {
|
552 551 | Ok(())
|
553 552 | } else {
|
554 - | Err(crate::model::length_list_of_pattern_string::ConstraintViolation::Length(length))
|
553 + | Err(crate::model::constrained_list_in_output::ConstraintViolation::Length(length))
|
555 554 | }
|
556 555 | }
|
557 556 | }
|
558 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
559 - | for LengthListOfPatternString
|
557 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
558 + | for ConstrainedListInOutput
|
560 559 | {
|
561 - | type Error = crate::model::length_list_of_pattern_string::ConstraintViolation;
|
560 + | type Error = crate::model::constrained_list_in_output::ConstraintViolation;
|
562 561 |
|
563 - | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
562 + | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
564 563 | fn try_from(
|
565 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
564 + | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
566 565 | ) -> ::std::result::Result<Self, Self::Error> {
|
567 566 | Self::check_length(value.len())?;
|
568 567 |
|
569 568 | Ok(Self(value))
|
570 569 | }
|
571 570 | }
|
572 571 |
|
573 - | impl ::std::convert::From<LengthListOfPatternString>
|
574 - | for ::std::vec::Vec<crate::model::PatternString>
|
572 + | impl ::std::convert::From<ConstrainedListInOutput>
|
573 + | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
575 574 | {
|
576 - | fn from(value: LengthListOfPatternString) -> Self {
|
575 + | fn from(value: ConstrainedListInOutput) -> Self {
|
577 576 | value.into_inner()
|
578 577 | }
|
579 578 | }
|
580 - | impl crate::constrained::Constrained for LengthListOfPatternString {
|
581 - | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
582 - | }
|
583 579 |
|
584 580 | #[allow(missing_docs)] // documentation missing in model
|
585 581 | ///
|
586 582 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
587 - | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
583 + | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
588 584 | ///
|
589 585 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
590 586 | ///
|
591 - | #[derive(
|
592 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
593 - | )]
|
594 - | pub struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
595 - | impl SetOfLengthString {
|
596 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
597 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthString> {
|
587 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
588 + | pub struct ConstrainedMapInOutput(
|
589 + | pub(crate) ::std::collections::HashMap<
|
590 + | ::std::string::String,
|
591 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
592 + | >,
|
593 + | );
|
594 + | impl ConstrainedMapInOutput {
|
595 + | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
596 + | pub fn inner(
|
597 + | &self,
|
598 + | ) -> &::std::collections::HashMap<
|
599 + | ::std::string::String,
|
600 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
601 + | > {
|
598 602 | &self.0
|
599 603 | }
|
600 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
601 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
604 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
605 + | pub fn into_inner(
|
606 + | self,
|
607 + | ) -> ::std::collections::HashMap<
|
608 + | ::std::string::String,
|
609 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
610 + | > {
|
602 611 | self.0
|
603 612 | }
|
613 + | }
|
614 + | impl
|
615 + | ::std::convert::TryFrom<
|
616 + | ::std::collections::HashMap<
|
617 + | ::std::string::String,
|
618 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
619 + | >,
|
620 + | > for ConstrainedMapInOutput
|
621 + | {
|
622 + | type Error = crate::model::constrained_map_in_output::ConstraintViolation;
|
604 623 |
|
605 - | fn check_unique_items(
|
606 - | items: ::std::vec::Vec<crate::model::LengthString>,
|
607 - | ) -> ::std::result::Result<
|
608 - | ::std::vec::Vec<crate::model::LengthString>,
|
609 - | crate::model::set_of_length_string::ConstraintViolation,
|
610 - | > {
|
611 - | let mut seen = ::std::collections::HashMap::new();
|
612 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
613 - | for (idx, item) in items.iter().enumerate() {
|
614 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
615 - | duplicate_indices.push(prev_idx);
|
624 + | /// 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.
|
625 + | fn try_from(
|
626 + | value: ::std::collections::HashMap<
|
627 + | ::std::string::String,
|
628 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
629 + | >,
|
630 + | ) -> ::std::result::Result<Self, Self::Error> {
|
631 + | let length = value.len();
|
632 + | if 69 <= length {
|
633 + | Ok(Self(value))
|
634 + | } else {
|
635 + | Err(crate::model::constrained_map_in_output::ConstraintViolation::Length(length))
|
616 636 | }
|
617 637 | }
|
638 + | }
|
618 639 |
|
619 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
620 - | for idx in &duplicate_indices {
|
621 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
622 - | last_duplicate_indices.push(prev_idx);
|
623 - | }
|
640 + | impl ::std::convert::From<ConstrainedMapInOutput>
|
641 + | for ::std::collections::HashMap<
|
642 + | ::std::string::String,
|
643 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
644 + | >
|
645 + | {
|
646 + | fn from(value: ConstrainedMapInOutput) -> Self {
|
647 + | value.into_inner()
|
624 648 | }
|
625 - | duplicate_indices.extend(last_duplicate_indices);
|
649 + | }
|
626 650 |
|
627 - | if !duplicate_indices.is_empty() {
|
628 - | debug_assert!(duplicate_indices.len() >= 2);
|
629 - | Err(
|
630 - | crate::model::set_of_length_string::ConstraintViolation::UniqueItems {
|
631 - | duplicate_indices,
|
632 - | original: items,
|
633 - | },
|
634 - | )
|
651 + | #[allow(missing_docs)] // documentation missing in model
|
652 + | #[derive(
|
653 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
654 + | )]
|
655 + | pub enum ConstrainedUnionInOutput {
|
656 + | #[allow(missing_docs)] // documentation missing in model
|
657 + | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
658 + | }
|
659 + | impl ConstrainedUnionInOutput {
|
660 + | #[allow(irrefutable_let_patterns)]
|
661 + | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
662 + | /// Returns `Err(&Self)` if it can't be converted.
|
663 + | pub fn as_structure(
|
664 + | &self,
|
665 + | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
666 + | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
667 + | ::std::result::Result::Ok(val)
|
635 668 | } else {
|
636 - | Ok(items)
|
669 + | ::std::result::Result::Err(self)
|
670 + | }
|
637 671 | }
|
672 + | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
673 + | pub fn is_structure(&self) -> bool {
|
674 + | self.as_structure().is_ok()
|
638 675 | }
|
639 676 | }
|
640 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
641 - | type Error = crate::model::set_of_length_string::ConstraintViolation;
|
642 677 |
|
643 - | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
644 - | fn try_from(
|
645 - | value: ::std::vec::Vec<crate::model::LengthString>,
|
646 - | ) -> ::std::result::Result<Self, Self::Error> {
|
647 - | let value = Self::check_unique_items(value)?;
|
678 + | #[allow(missing_docs)] // documentation missing in model
|
679 + | ///
|
680 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
681 + | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
682 + | ///
|
683 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
684 + | ///
|
685 + | #[derive(
|
686 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
687 + | )]
|
688 + | pub struct LengthString(pub(crate) ::std::string::String);
|
689 + | impl LengthString {
|
690 + | /// Extracts a string slice containing the entire underlying `String`.
|
691 + | pub fn as_str(&self) -> &str {
|
692 + | &self.0
|
693 + | }
|
694 + |
|
695 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
696 + | pub fn inner(&self) -> &::std::string::String {
|
697 + | &self.0
|
698 + | }
|
699 + |
|
700 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
701 + | pub fn into_inner(self) -> ::std::string::String {
|
702 + | self.0
|
703 + | }
|
704 + | }
|
705 + | impl LengthString {
|
706 + | fn check_length(
|
707 + | string: &str,
|
708 + | ) -> ::std::result::Result<(), crate::model::length_string::ConstraintViolation> {
|
709 + | let length = string.chars().count();
|
710 + |
|
711 + | if (2..=69).contains(&length) {
|
712 + | Ok(())
|
713 + | } else {
|
714 + | Err(crate::model::length_string::ConstraintViolation::Length(
|
715 + | length,
|
716 + | ))
|
717 + | }
|
718 + | }
|
719 + | }
|
720 + | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
721 + | type Error = crate::model::length_string::ConstraintViolation;
|
722 + |
|
723 + | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
724 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
725 + | Self::check_length(&value)?;
|
648 726 |
|
649 727 | Ok(Self(value))
|
650 728 | }
|
651 729 | }
|
730 + | impl crate::constrained::Constrained for LengthString {
|
731 + | type Unconstrained = ::std::string::String;
|
732 + | }
|
652 733 |
|
653 - | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
654 - | fn from(value: SetOfLengthString) -> Self {
|
655 - | value.into_inner()
|
734 + | impl ::std::convert::From<::std::string::String>
|
735 + | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
736 + | {
|
737 + | fn from(value: ::std::string::String) -> Self {
|
738 + | Self::Unconstrained(value)
|
656 739 | }
|
657 740 | }
|
658 - | impl crate::constrained::Constrained for SetOfLengthString {
|
659 - | type Unconstrained =
|
660 - | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
741 + |
|
742 + | impl ::std::fmt::Display for LengthString {
|
743 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
744 + | self.0.fmt(f)
|
745 + | }
|
746 + | }
|
747 + |
|
748 + | impl ::std::convert::From<LengthString> for ::std::string::String {
|
749 + | fn from(value: LengthString) -> Self {
|
750 + | value.into_inner()
|
751 + | }
|
661 752 | }
|
662 753 |
|
663 754 | #[allow(missing_docs)] // documentation missing in model
|
755 + | ///
|
756 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
757 + | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
758 + | ///
|
759 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
760 + | ///
|
664 761 | #[derive(
|
665 762 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
666 763 | )]
|
667 - | pub struct RecursiveShapesInputOutputNested1 {
|
668 - | #[allow(missing_docs)] // documentation missing in model
|
669 - | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
764 + | pub struct RangeInteger(pub(crate) i32);
|
765 + | impl RangeInteger {
|
766 + | /// Returns an immutable reference to the underlying [`i32`].
|
767 + | pub fn inner(&self) -> &i32 {
|
768 + | &self.0
|
769 + | }
|
770 + |
|
771 + | /// Consumes the value, returning the underlying [`i32`].
|
772 + | pub fn into_inner(self) -> i32 {
|
773 + | self.0
|
774 + | }
|
670 775 | }
|
671 - | impl RecursiveShapesInputOutputNested1 {
|
672 - | #[allow(missing_docs)] // documentation missing in model
|
673 - | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
674 - | use std::ops::Deref;
|
675 - | self.recursive_member.deref()
|
776 + |
|
777 + | impl crate::constrained::Constrained for RangeInteger {
|
778 + | type Unconstrained = i32;
|
779 + | }
|
780 + |
|
781 + | impl ::std::convert::From<i32>
|
782 + | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
783 + | {
|
784 + | fn from(value: i32) -> Self {
|
785 + | Self::Unconstrained(value)
|
676 786 | }
|
677 787 | }
|
678 - | impl RecursiveShapesInputOutputNested1 {
|
679 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
680 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
681 - | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
788 + |
|
789 + | impl ::std::fmt::Display for RangeInteger {
|
790 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
791 + | self.0.fmt(f)
|
682 792 | }
|
683 793 | }
|
684 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
685 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested1::Builder;
|
794 + |
|
795 + | impl ::std::convert::From<RangeInteger> for i32 {
|
796 + | fn from(value: RangeInteger) -> Self {
|
797 + | value.into_inner()
|
798 + | }
|
799 + | }
|
800 + | impl RangeInteger {
|
801 + | fn check_range(
|
802 + | value: i32,
|
803 + | ) -> ::std::result::Result<(), crate::model::range_integer::ConstraintViolation> {
|
804 + | if (0..=69).contains(&value) {
|
805 + | Ok(())
|
806 + | } else {
|
807 + | Err(crate::model::range_integer::ConstraintViolation::Range(
|
808 + | value,
|
809 + | ))
|
810 + | }
|
811 + | }
|
812 + | }
|
813 + | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
814 + | type Error = crate::model::range_integer::ConstraintViolation;
|
815 + |
|
816 + | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
817 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
818 + | Self::check_range(value)?;
|
819 + |
|
820 + | Ok(Self(value))
|
821 + | }
|
686 822 | }
|
687 823 |
|
688 824 | #[allow(missing_docs)] // documentation missing in model
|
825 + | ///
|
826 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
827 + | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
828 + | ///
|
829 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
830 + | ///
|
689 831 | #[derive(
|
690 832 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
691 833 | )]
|
692 - | pub struct RecursiveShapesInputOutputNested2 {
|
693 - | #[allow(missing_docs)] // documentation missing in model
|
694 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
834 + | pub struct RangeShort(pub(crate) i16);
|
835 + | impl RangeShort {
|
836 + | /// Returns an immutable reference to the underlying [`i16`].
|
837 + | pub fn inner(&self) -> &i16 {
|
838 + | &self.0
|
839 + | }
|
840 + |
|
841 + | /// Consumes the value, returning the underlying [`i16`].
|
842 + | pub fn into_inner(self) -> i16 {
|
843 + | self.0
|
844 + | }
|
695 845 | }
|
696 - | impl RecursiveShapesInputOutputNested2 {
|
697 - | #[allow(missing_docs)] // documentation missing in model
|
698 - | pub fn recursive_member(
|
699 - | &self,
|
700 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
701 - | self.recursive_member.as_ref()
|
846 + |
|
847 + | impl crate::constrained::Constrained for RangeShort {
|
848 + | type Unconstrained = i16;
|
849 + | }
|
850 + |
|
851 + | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
852 + | fn from(value: i16) -> Self {
|
853 + | Self::Unconstrained(value)
|
702 854 | }
|
703 855 | }
|
704 - | impl RecursiveShapesInputOutputNested2 {
|
705 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
706 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
707 - | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
856 + |
|
857 + | impl ::std::fmt::Display for RangeShort {
|
858 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
859 + | self.0.fmt(f)
|
708 860 | }
|
709 861 | }
|
710 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
711 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested2::Builder;
|
862 + |
|
863 + | impl ::std::convert::From<RangeShort> for i16 {
|
864 + | fn from(value: RangeShort) -> Self {
|
865 + | value.into_inner()
|
866 + | }
|
867 + | }
|
868 + | impl RangeShort {
|
869 + | fn check_range(
|
870 + | value: i16,
|
871 + | ) -> ::std::result::Result<(), crate::model::range_short::ConstraintViolation> {
|
872 + | if (0..=10).contains(&value) {
|
873 + | Ok(())
|
874 + | } else {
|
875 + | Err(crate::model::range_short::ConstraintViolation::Range(value))
|
876 + | }
|
877 + | }
|
878 + | }
|
879 + | impl ::std::convert::TryFrom<i16> for RangeShort {
|
880 + | type Error = crate::model::range_short::ConstraintViolation;
|
881 + |
|
882 + | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
883 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
884 + | Self::check_range(value)?;
|
885 + |
|
886 + | Ok(Self(value))
|
887 + | }
|
712 888 | }
|
713 889 |
|
714 890 | #[allow(missing_docs)] // documentation missing in model
|
715 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
716 - | pub struct ConA {
|
717 - | #[allow(missing_docs)] // documentation missing in model
|
718 - | pub con_b: crate::model::ConB,
|
719 - | #[allow(missing_docs)] // documentation missing in model
|
720 - | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
721 - | #[allow(missing_docs)] // documentation missing in model
|
722 - | pub length_string: ::std::option::Option<crate::model::LengthString>,
|
723 - | #[allow(missing_docs)] // documentation missing in model
|
724 - | pub min_length_string: ::std::option::Option<crate::model::MinLengthString>,
|
725 - | #[allow(missing_docs)] // documentation missing in model
|
726 - | pub max_length_string: ::std::option::Option<crate::model::MaxLengthString>,
|
727 - | #[allow(missing_docs)] // documentation missing in model
|
728 - | pub fixed_length_string: ::std::option::Option<crate::model::FixedLengthString>,
|
729 - | #[allow(missing_docs)] // documentation missing in model
|
730 - | pub length_blob: ::std::option::Option<crate::model::LengthBlob>,
|
731 - | #[allow(missing_docs)] // documentation missing in model
|
732 - | pub min_length_blob: ::std::option::Option<crate::model::MinLengthBlob>,
|
733 - | #[allow(missing_docs)] // documentation missing in model
|
734 - | pub max_length_blob: ::std::option::Option<crate::model::MaxLengthBlob>,
|
735 - | #[allow(missing_docs)] // documentation missing in model
|
736 - | pub fixed_length_blob: ::std::option::Option<crate::model::FixedLengthBlob>,
|
737 - | #[allow(missing_docs)] // documentation missing in model
|
738 - | pub range_integer: crate::model::RangeInteger,
|
739 - | #[allow(missing_docs)] // documentation missing in model
|
740 - | pub min_range_integer: crate::model::MinRangeInteger,
|
741 - | #[allow(missing_docs)] // documentation missing in model
|
742 - | pub max_range_integer: crate::model::MaxRangeInteger,
|
743 - | #[allow(missing_docs)] // documentation missing in model
|
744 - | pub fixed_value_integer: crate::model::FixedValueInteger,
|
745 - | #[allow(missing_docs)] // documentation missing in model
|
746 - | pub range_short: crate::model::RangeShort,
|
747 - | #[allow(missing_docs)] // documentation missing in model
|
748 - | pub min_range_short: crate::model::MinRangeShort,
|
749 - | #[allow(missing_docs)] // documentation missing in model
|
750 - | pub max_range_short: crate::model::MaxRangeShort,
|
751 - | #[allow(missing_docs)] // documentation missing in model
|
752 - | pub fixed_value_short: crate::model::FixedValueShort,
|
753 - | #[allow(missing_docs)] // documentation missing in model
|
754 - | pub range_long: crate::model::RangeLong,
|
755 - | #[allow(missing_docs)] // documentation missing in model
|
756 - | pub min_range_long: crate::model::MinRangeLong,
|
757 - | #[allow(missing_docs)] // documentation missing in model
|
758 - | pub max_range_long: crate::model::MaxRangeLong,
|
759 - | #[allow(missing_docs)] // documentation missing in model
|
760 - | pub fixed_value_long: crate::model::FixedValueLong,
|
761 - | #[allow(missing_docs)] // documentation missing in model
|
762 - | pub range_byte: crate::model::RangeByte,
|
763 - | #[allow(missing_docs)] // documentation missing in model
|
764 - | pub min_range_byte: crate::model::MinRangeByte,
|
765 - | #[allow(missing_docs)] // documentation missing in model
|
766 - | pub max_range_byte: crate::model::MaxRangeByte,
|
767 - | #[allow(missing_docs)] // documentation missing in model
|
768 - | pub fixed_value_byte: crate::model::FixedValueByte,
|
769 - | #[allow(missing_docs)] // documentation missing in model
|
770 - | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
771 - | #[allow(missing_docs)] // documentation missing in model
|
772 - | pub length_list: ::std::option::Option<crate::model::LengthList>,
|
773 - | #[allow(missing_docs)] // documentation missing in model
|
774 - | pub sensitive_length_list: ::std::option::Option<crate::model::SensitiveLengthList>,
|
775 - | #[allow(missing_docs)] // documentation missing in model
|
776 - | pub con_b_set: ::std::option::Option<crate::model::ConBSet>,
|
777 - | #[allow(missing_docs)] // documentation missing in model
|
778 - | pub con_b_map: ::std::option::Option<crate::model::ConBMap>,
|
779 - | #[allow(missing_docs)] // documentation missing in model
|
780 - | pub length_map: ::std::option::Option<crate::model::LengthMap>,
|
781 - | #[allow(missing_docs)] // documentation missing in model
|
782 - | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
783 - | ::std::collections::HashMap<
|
784 - | ::std::string::String,
|
785 - | ::std::collections::HashMap<
|
786 - | ::std::string::String,
|
787 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
788 - | >,
|
789 - | >,
|
790 - | >,
|
791 - | #[allow(missing_docs)] // documentation missing in model
|
792 - | pub sparse_map: ::std::option::Option<
|
793 - | ::std::collections::HashMap<
|
794 - | ::std::string::String,
|
795 - | ::std::option::Option<crate::model::UniqueItemsList>,
|
796 - | >,
|
797 - | >,
|
798 - | #[allow(missing_docs)] // documentation missing in model
|
799 - | pub sparse_list:
|
800 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::model::LengthString>>>,
|
801 - | #[allow(missing_docs)] // documentation missing in model
|
802 - | pub sparse_length_map: ::std::option::Option<crate::model::SparseLengthMap>,
|
803 - | #[allow(missing_docs)] // documentation missing in model
|
804 - | pub sparse_length_list: ::std::option::Option<crate::model::SparseLengthList>,
|
805 - | /// A union with constrained members.
|
806 - | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
807 - | #[allow(missing_docs)] // documentation missing in model
|
808 - | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
809 - | #[allow(missing_docs)] // documentation missing in model
|
810 - | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<crate::model::LengthString>>,
|
811 - | #[allow(missing_docs)] // documentation missing in model
|
812 - | pub set_of_length_string: ::std::option::Option<crate::model::SetOfLengthString>,
|
813 - | #[allow(missing_docs)] // documentation missing in model
|
814 - | pub map_of_length_string: ::std::option::Option<
|
815 - | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
816 - | >,
|
817 - | #[allow(missing_docs)] // documentation missing in model
|
818 - | pub list_of_length_blob: ::std::option::Option<::std::vec::Vec<crate::model::LengthBlob>>,
|
819 - | #[allow(missing_docs)] // documentation missing in model
|
820 - | pub map_of_length_blob: ::std::option::Option<
|
821 - | ::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
822 - | >,
|
823 - | #[allow(missing_docs)] // documentation missing in model
|
824 - | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<crate::model::RangeInteger>>,
|
825 - | #[allow(missing_docs)] // documentation missing in model
|
826 - | pub set_of_range_integer: ::std::option::Option<crate::model::SetOfRangeInteger>,
|
827 - | #[allow(missing_docs)] // documentation missing in model
|
828 - | pub map_of_range_integer: ::std::option::Option<
|
829 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
830 - | >,
|
831 - | #[allow(missing_docs)] // documentation missing in model
|
832 - | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<crate::model::RangeShort>>,
|
833 - | #[allow(missing_docs)] // documentation missing in model
|
834 - | pub set_of_range_short: ::std::option::Option<crate::model::SetOfRangeShort>,
|
835 - | #[allow(missing_docs)] // documentation missing in model
|
836 - | pub map_of_range_short: ::std::option::Option<
|
837 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
838 - | >,
|
839 - | #[allow(missing_docs)] // documentation missing in model
|
840 - | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<crate::model::RangeLong>>,
|
841 - | #[allow(missing_docs)] // documentation missing in model
|
842 - | pub set_of_range_long: ::std::option::Option<crate::model::SetOfRangeLong>,
|
843 - | #[allow(missing_docs)] // documentation missing in model
|
844 - | pub map_of_range_long: ::std::option::Option<
|
845 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
846 - | >,
|
847 - | #[allow(missing_docs)] // documentation missing in model
|
848 - | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<crate::model::RangeByte>>,
|
849 - | #[allow(missing_docs)] // documentation missing in model
|
850 - | pub set_of_range_byte: ::std::option::Option<crate::model::SetOfRangeByte>,
|
851 - | #[allow(missing_docs)] // documentation missing in model
|
852 - | pub map_of_range_byte: ::std::option::Option<
|
853 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
854 - | >,
|
855 - | #[allow(missing_docs)] // documentation missing in model
|
856 - | pub non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
857 - | #[allow(missing_docs)] // documentation missing in model
|
858 - | pub pattern_string: ::std::option::Option<crate::model::PatternString>,
|
859 - | #[allow(missing_docs)] // documentation missing in model
|
860 - | pub map_of_pattern_string: ::std::option::Option<
|
861 - | ::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
862 - | >,
|
863 - | #[allow(missing_docs)] // documentation missing in model
|
864 - | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
865 - | #[allow(missing_docs)] // documentation missing in model
|
866 - | pub set_of_pattern_string: ::std::option::Option<crate::model::SetOfPatternString>,
|
867 - | #[allow(missing_docs)] // documentation missing in model
|
868 - | pub length_length_pattern_string: ::std::option::Option<crate::model::LengthPatternString>,
|
869 - | #[allow(missing_docs)] // documentation missing in model
|
870 - | pub map_of_length_pattern_string: ::std::option::Option<
|
871 - | ::std::collections::HashMap<
|
872 - | crate::model::LengthPatternString,
|
873 - | crate::model::LengthPatternString,
|
874 - | >,
|
875 - | >,
|
876 - | #[allow(missing_docs)] // documentation missing in model
|
877 - | pub list_of_length_pattern_string:
|
878 - | ::std::option::Option<::std::vec::Vec<crate::model::LengthPatternString>>,
|
879 - | #[allow(missing_docs)] // documentation missing in model
|
880 - | pub set_of_length_pattern_string: ::std::option::Option<crate::model::SetOfLengthPatternString>,
|
881 - | #[allow(missing_docs)] // documentation missing in model
|
882 - | pub length_list_of_pattern_string:
|
883 - | ::std::option::Option<crate::model::LengthListOfPatternString>,
|
884 - | #[allow(missing_docs)] // documentation missing in model
|
885 - | pub length_set_of_pattern_string: ::std::option::Option<crate::model::LengthSetOfPatternString>,
|
886 - | }
|
887 - | impl ConA {
|
888 - | #[allow(missing_docs)] // documentation missing in model
|
889 - | pub fn con_b(&self) -> &crate::model::ConB {
|
890 - | &self.con_b
|
891 - | }
|
892 - | #[allow(missing_docs)] // documentation missing in model
|
893 - | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
894 - | self.opt_con_b.as_ref()
|
891 + | ///
|
892 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
893 + | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
894 + | ///
|
895 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
896 + | ///
|
897 + | #[derive(
|
898 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
899 + | )]
|
900 + | pub struct RangeLong(pub(crate) i64);
|
901 + | impl RangeLong {
|
902 + | /// Returns an immutable reference to the underlying [`i64`].
|
903 + | pub fn inner(&self) -> &i64 {
|
904 + | &self.0
|
895 905 | }
|
896 - | #[allow(missing_docs)] // documentation missing in model
|
897 - | pub fn length_string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
898 - | self.length_string.as_ref()
|
906 + |
|
907 + | /// Consumes the value, returning the underlying [`i64`].
|
908 + | pub fn into_inner(self) -> i64 {
|
909 + | self.0
|
899 910 | }
|
900 - | #[allow(missing_docs)] // documentation missing in model
|
901 - | pub fn min_length_string(&self) -> ::std::option::Option<&crate::model::MinLengthString> {
|
902 - | self.min_length_string.as_ref()
|
911 + | }
|
912 + |
|
913 + | impl crate::constrained::Constrained for RangeLong {
|
914 + | type Unconstrained = i64;
|
915 + | }
|
916 + |
|
917 + | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
918 + | fn from(value: i64) -> Self {
|
919 + | Self::Unconstrained(value)
|
903 920 | }
|
904 - | #[allow(missing_docs)] // documentation missing in model
|
905 - | pub fn max_length_string(&self) -> ::std::option::Option<&crate::model::MaxLengthString> {
|
906 - | self.max_length_string.as_ref()
|
921 + | }
|
922 + |
|
923 + | impl ::std::fmt::Display for RangeLong {
|
924 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
925 + | self.0.fmt(f)
|
907 926 | }
|
908 - | #[allow(missing_docs)] // documentation missing in model
|
909 - | pub fn fixed_length_string(&self) -> ::std::option::Option<&crate::model::FixedLengthString> {
|
910 - | self.fixed_length_string.as_ref()
|
927 + | }
|
928 + |
|
929 + | impl ::std::convert::From<RangeLong> for i64 {
|
930 + | fn from(value: RangeLong) -> Self {
|
931 + | value.into_inner()
|
911 932 | }
|
912 - | #[allow(missing_docs)] // documentation missing in model
|
913 - | pub fn length_blob(&self) -> ::std::option::Option<&crate::model::LengthBlob> {
|
914 - | self.length_blob.as_ref()
|
933 + | }
|
934 + | impl RangeLong {
|
935 + | fn check_range(
|
936 + | value: i64,
|
937 + | ) -> ::std::result::Result<(), crate::model::range_long::ConstraintViolation> {
|
938 + | if (0..=10).contains(&value) {
|
939 + | Ok(())
|
940 + | } else {
|
941 + | Err(crate::model::range_long::ConstraintViolation::Range(value))
|
915 942 | }
|
916 - | #[allow(missing_docs)] // documentation missing in model
|
917 - | pub fn min_length_blob(&self) -> ::std::option::Option<&crate::model::MinLengthBlob> {
|
918 - | self.min_length_blob.as_ref()
|
919 943 | }
|
920 - | #[allow(missing_docs)] // documentation missing in model
|
921 - | pub fn max_length_blob(&self) -> ::std::option::Option<&crate::model::MaxLengthBlob> {
|
922 - | self.max_length_blob.as_ref()
|
944 + | }
|
945 + | impl ::std::convert::TryFrom<i64> for RangeLong {
|
946 + | type Error = crate::model::range_long::ConstraintViolation;
|
947 + |
|
948 + | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
949 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
950 + | Self::check_range(value)?;
|
951 + |
|
952 + | Ok(Self(value))
|
923 953 | }
|
924 - | #[allow(missing_docs)] // documentation missing in model
|
925 - | pub fn fixed_length_blob(&self) -> ::std::option::Option<&crate::model::FixedLengthBlob> {
|
926 - | self.fixed_length_blob.as_ref()
|
927 - | }
|
928 - | #[allow(missing_docs)] // documentation missing in model
|
929 - | pub fn range_integer(&self) -> &crate::model::RangeInteger {
|
930 - | &self.range_integer
|
931 - | }
|
932 - | #[allow(missing_docs)] // documentation missing in model
|
933 - | pub fn min_range_integer(&self) -> &crate::model::MinRangeInteger {
|
934 - | &self.min_range_integer
|
935 - | }
|
936 - | #[allow(missing_docs)] // documentation missing in model
|
937 - | pub fn max_range_integer(&self) -> &crate::model::MaxRangeInteger {
|
938 - | &self.max_range_integer
|
939 - | }
|
940 - | #[allow(missing_docs)] // documentation missing in model
|
941 - | pub fn fixed_value_integer(&self) -> &crate::model::FixedValueInteger {
|
942 - | &self.fixed_value_integer
|
954 + | }
|
955 + |
|
956 + | #[allow(missing_docs)] // documentation missing in model
|
957 + | ///
|
958 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
959 + | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
960 + | ///
|
961 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
962 + | ///
|
963 + | #[derive(
|
964 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
965 + | )]
|
966 + | pub struct RangeByte(pub(crate) i8);
|
967 + | impl RangeByte {
|
968 + | /// Returns an immutable reference to the underlying [`i8`].
|
969 + | pub fn inner(&self) -> &i8 {
|
970 + | &self.0
|
943 971 | }
|
944 - | #[allow(missing_docs)] // documentation missing in model
|
945 - | pub fn range_short(&self) -> &crate::model::RangeShort {
|
946 - | &self.range_short
|
972 + |
|
973 + | /// Consumes the value, returning the underlying [`i8`].
|
974 + | pub fn into_inner(self) -> i8 {
|
975 + | self.0
|
947 976 | }
|
948 - | #[allow(missing_docs)] // documentation missing in model
|
949 - | pub fn min_range_short(&self) -> &crate::model::MinRangeShort {
|
950 - | &self.min_range_short
|
977 + | }
|
978 + |
|
979 + | impl crate::constrained::Constrained for RangeByte {
|
980 + | type Unconstrained = i8;
|
981 + | }
|
982 + |
|
983 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
984 + | fn from(value: i8) -> Self {
|
985 + | Self::Unconstrained(value)
|
951 986 | }
|
952 - | #[allow(missing_docs)] // documentation missing in model
|
953 - | pub fn max_range_short(&self) -> &crate::model::MaxRangeShort {
|
954 - | &self.max_range_short
|
987 + | }
|
988 + |
|
989 + | impl ::std::fmt::Display for RangeByte {
|
990 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
991 + | self.0.fmt(f)
|
955 992 | }
|
956 - | #[allow(missing_docs)] // documentation missing in model
|
957 - | pub fn fixed_value_short(&self) -> &crate::model::FixedValueShort {
|
958 - | &self.fixed_value_short
|
993 + | }
|
994 + |
|
995 + | impl ::std::convert::From<RangeByte> for i8 {
|
996 + | fn from(value: RangeByte) -> Self {
|
997 + | value.into_inner()
|
959 998 | }
|
960 - | #[allow(missing_docs)] // documentation missing in model
|
961 - | pub fn range_long(&self) -> &crate::model::RangeLong {
|
962 - | &self.range_long
|
999 + | }
|
1000 + | impl RangeByte {
|
1001 + | fn check_range(
|
1002 + | value: i8,
|
1003 + | ) -> ::std::result::Result<(), crate::model::range_byte::ConstraintViolation> {
|
1004 + | if (0..=10).contains(&value) {
|
1005 + | Ok(())
|
1006 + | } else {
|
1007 + | Err(crate::model::range_byte::ConstraintViolation::Range(value))
|
963 1008 | }
|
964 - | #[allow(missing_docs)] // documentation missing in model
|
965 - | pub fn min_range_long(&self) -> &crate::model::MinRangeLong {
|
966 - | &self.min_range_long
|
967 1009 | }
|
968 - | #[allow(missing_docs)] // documentation missing in model
|
969 - | pub fn max_range_long(&self) -> &crate::model::MaxRangeLong {
|
970 - | &self.max_range_long
|
1010 + | }
|
1011 + | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1012 + | type Error = crate::model::range_byte::ConstraintViolation;
|
1013 + |
|
1014 + | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1015 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1016 + | Self::check_range(value)?;
|
1017 + |
|
1018 + | Ok(Self(value))
|
971 1019 | }
|
1020 + | }
|
1021 + |
|
1022 + | #[allow(missing_docs)] // documentation missing in model
|
1023 + | #[derive(
|
1024 + | ::std::clone::Clone,
|
1025 + | ::std::cmp::Eq,
|
1026 + | ::std::cmp::Ord,
|
1027 + | ::std::cmp::PartialEq,
|
1028 + | ::std::cmp::PartialOrd,
|
1029 + | ::std::fmt::Debug,
|
1030 + | ::std::hash::Hash,
|
1031 + | )]
|
1032 + | pub enum EnumString {
|
972 1033 | #[allow(missing_docs)] // documentation missing in model
|
973 - | pub fn fixed_value_long(&self) -> &crate::model::FixedValueLong {
|
974 - | &self.fixed_value_long
|
975 - | }
|
1034 + | M256Mega,
|
976 1035 | #[allow(missing_docs)] // documentation missing in model
|
977 - | pub fn range_byte(&self) -> &crate::model::RangeByte {
|
978 - | &self.range_byte
|
979 - | }
|
1036 + | T2Micro,
|
980 1037 | #[allow(missing_docs)] // documentation missing in model
|
981 - | pub fn min_range_byte(&self) -> &crate::model::MinRangeByte {
|
982 - | &self.min_range_byte
|
1038 + | T2Nano,
|
1039 + | }
|
1040 + | /// See [`EnumString`](crate::model::EnumString).
|
1041 + | pub mod enum_string {
|
1042 + | #[derive(Debug, PartialEq)]
|
1043 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
1044 + |
|
1045 + | impl ::std::fmt::Display for ConstraintViolation {
|
1046 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1047 + | write!(
|
1048 + | f,
|
1049 + | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
1050 + | )
|
983 1051 | }
|
984 - | #[allow(missing_docs)] // documentation missing in model
|
985 - | pub fn max_range_byte(&self) -> &crate::model::MaxRangeByte {
|
986 - | &self.max_range_byte
|
987 1052 | }
|
988 - | #[allow(missing_docs)] // documentation missing in model
|
989 - | pub fn fixed_value_byte(&self) -> &crate::model::FixedValueByte {
|
990 - | &self.fixed_value_byte
|
1053 + |
|
1054 + | impl ::std::error::Error for ConstraintViolation {}
|
1055 + | impl ConstraintViolation {
|
1056 + | pub(crate) fn as_validation_exception_field(
|
1057 + | self,
|
1058 + | path: ::std::string::String,
|
1059 + | ) -> crate::model::ValidationExceptionField {
|
1060 + | crate::model::ValidationExceptionField {
|
1061 + | message: format!(
|
1062 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
1063 + | &path
|
1064 + | ),
|
1065 + | path,
|
991 1066 | }
|
992 - | #[allow(missing_docs)] // documentation missing in model
|
993 - | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
994 - | self.con_b_list.as_deref()
|
995 1067 | }
|
996 - | #[allow(missing_docs)] // documentation missing in model
|
997 - | pub fn length_list(&self) -> ::std::option::Option<&crate::model::LengthList> {
|
998 - | self.length_list.as_ref()
|
999 1068 | }
|
1000 - | #[allow(missing_docs)] // documentation missing in model
|
1001 - | pub fn sensitive_length_list(
|
1002 - | &self,
|
1003 - | ) -> ::std::option::Option<&crate::model::SensitiveLengthList> {
|
1004 - | self.sensitive_length_list.as_ref()
|
1069 + | }
|
1070 + | impl ::std::convert::TryFrom<&str> for EnumString {
|
1071 + | type Error = crate::model::enum_string::ConstraintViolation;
|
1072 + | fn try_from(
|
1073 + | s: &str,
|
1074 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1075 + | match s {
|
1076 + | "m256.mega" => Ok(EnumString::M256Mega),
|
1077 + | "t2.micro" => Ok(EnumString::T2Micro),
|
1078 + | "t2.nano" => Ok(EnumString::T2Nano),
|
1079 + | _ => Err(crate::model::enum_string::ConstraintViolation(s.to_owned())),
|
1005 1080 | }
|
1006 - | #[allow(missing_docs)] // documentation missing in model
|
1007 - | pub fn con_b_set(&self) -> ::std::option::Option<&crate::model::ConBSet> {
|
1008 - | self.con_b_set.as_ref()
|
1009 1081 | }
|
1010 - | #[allow(missing_docs)] // documentation missing in model
|
1011 - | pub fn con_b_map(&self) -> ::std::option::Option<&crate::model::ConBMap> {
|
1012 - | self.con_b_map.as_ref()
|
1082 + | }
|
1083 + | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
1084 + | type Error = crate::model::enum_string::ConstraintViolation;
|
1085 + | fn try_from(
|
1086 + | s: ::std::string::String,
|
1087 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1088 + | {
|
1089 + | s.as_str().try_into()
|
1013 1090 | }
|
1014 - | #[allow(missing_docs)] // documentation missing in model
|
1015 - | pub fn length_map(&self) -> ::std::option::Option<&crate::model::LengthMap> {
|
1016 - | self.length_map.as_ref()
|
1091 + | }
|
1092 + | impl std::str::FromStr for EnumString {
|
1093 + | type Err = crate::model::enum_string::ConstraintViolation;
|
1094 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1095 + | Self::try_from(s)
|
1017 1096 | }
|
1018 - | #[allow(missing_docs)] // documentation missing in model
|
1019 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
1020 - | &self,
|
1021 - | ) -> ::std::option::Option<
|
1022 - | &::std::collections::HashMap<
|
1023 - | ::std::string::String,
|
1024 - | ::std::collections::HashMap<
|
1025 - | ::std::string::String,
|
1026 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1027 - | >,
|
1028 - | >,
|
1029 - | > {
|
1030 - | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
1097 + | }
|
1098 + | impl EnumString {
|
1099 + | /// Returns the `&str` value of the enum member.
|
1100 + | pub fn as_str(&self) -> &str {
|
1101 + | match self {
|
1102 + | EnumString::M256Mega => "m256.mega",
|
1103 + | EnumString::T2Micro => "t2.micro",
|
1104 + | EnumString::T2Nano => "t2.nano",
|
1031 1105 | }
|
1032 - | #[allow(missing_docs)] // documentation missing in model
|
1033 - | pub fn sparse_map(
|
1034 - | &self,
|
1035 - | ) -> ::std::option::Option<
|
1036 - | &::std::collections::HashMap<
|
1037 - | ::std::string::String,
|
1038 - | ::std::option::Option<crate::model::UniqueItemsList>,
|
1039 - | >,
|
1040 - | > {
|
1041 - | self.sparse_map.as_ref()
|
1042 1106 | }
|
1043 - | #[allow(missing_docs)] // documentation missing in model
|
1044 - | pub fn sparse_list(
|
1045 - | &self,
|
1046 - | ) -> ::std::option::Option<&[::std::option::Option<crate::model::LengthString>]> {
|
1047 - | self.sparse_list.as_deref()
|
1107 + | /// Returns all the `&str` representations of the enum members.
|
1108 + | pub const fn values() -> &'static [&'static str] {
|
1109 + | &["m256.mega", "t2.micro", "t2.nano"]
|
1048 1110 | }
|
1049 - | #[allow(missing_docs)] // documentation missing in model
|
1050 - | pub fn sparse_length_map(&self) -> ::std::option::Option<&crate::model::SparseLengthMap> {
|
1051 - | self.sparse_length_map.as_ref()
|
1111 + | }
|
1112 + | impl ::std::convert::AsRef<str> for EnumString {
|
1113 + | fn as_ref(&self) -> &str {
|
1114 + | self.as_str()
|
1052 1115 | }
|
1053 - | #[allow(missing_docs)] // documentation missing in model
|
1054 - | pub fn sparse_length_list(&self) -> ::std::option::Option<&crate::model::SparseLengthList> {
|
1055 - | self.sparse_length_list.as_ref()
|
1116 + | }
|
1117 + | impl crate::constrained::Constrained for EnumString {
|
1118 + | type Unconstrained = ::std::string::String;
|
1119 + | }
|
1120 + |
|
1121 + | impl ::std::convert::From<::std::string::String>
|
1122 + | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
1123 + | {
|
1124 + | fn from(value: ::std::string::String) -> Self {
|
1125 + | Self::Unconstrained(value)
|
1056 1126 | }
|
1057 - | /// A union with constrained members.
|
1058 - | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
1059 - | self.constrained_union.as_ref()
|
1060 - | }
|
1061 - | #[allow(missing_docs)] // documentation missing in model
|
1062 - | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
1063 - | self.enum_string.as_ref()
|
1064 - | }
|
1065 - | #[allow(missing_docs)] // documentation missing in model
|
1066 - | pub fn list_of_length_string(&self) -> ::std::option::Option<&[crate::model::LengthString]> {
|
1067 - | self.list_of_length_string.as_deref()
|
1068 - | }
|
1069 - | #[allow(missing_docs)] // documentation missing in model
|
1070 - | pub fn set_of_length_string(&self) -> ::std::option::Option<&crate::model::SetOfLengthString> {
|
1071 - | self.set_of_length_string.as_ref()
|
1072 - | }
|
1073 - | #[allow(missing_docs)] // documentation missing in model
|
1074 - | pub fn map_of_length_string(
|
1075 - | &self,
|
1076 - | ) -> ::std::option::Option<
|
1077 - | &::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
1078 - | > {
|
1079 - | self.map_of_length_string.as_ref()
|
1080 - | }
|
1081 - | #[allow(missing_docs)] // documentation missing in model
|
1082 - | pub fn list_of_length_blob(&self) -> ::std::option::Option<&[crate::model::LengthBlob]> {
|
1083 - | self.list_of_length_blob.as_deref()
|
1084 - | }
|
1085 - | #[allow(missing_docs)] // documentation missing in model
|
1086 - | pub fn map_of_length_blob(
|
1087 - | &self,
|
1088 - | ) -> ::std::option::Option<
|
1089 - | &::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
1090 - | > {
|
1091 - | self.map_of_length_blob.as_ref()
|
1092 - | }
|
1093 - | #[allow(missing_docs)] // documentation missing in model
|
1094 - | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[crate::model::RangeInteger]> {
|
1095 - | self.list_of_range_integer.as_deref()
|
1096 - | }
|
1097 - | #[allow(missing_docs)] // documentation missing in model
|
1098 - | pub fn set_of_range_integer(&self) -> ::std::option::Option<&crate::model::SetOfRangeInteger> {
|
1099 - | self.set_of_range_integer.as_ref()
|
1100 - | }
|
1101 - | #[allow(missing_docs)] // documentation missing in model
|
1102 - | pub fn map_of_range_integer(
|
1103 - | &self,
|
1104 - | ) -> ::std::option::Option<
|
1105 - | &::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
1106 - | > {
|
1107 - | self.map_of_range_integer.as_ref()
|
1108 - | }
|
1109 - | #[allow(missing_docs)] // documentation missing in model
|
1110 - | pub fn list_of_range_short(&self) -> ::std::option::Option<&[crate::model::RangeShort]> {
|
1111 - | self.list_of_range_short.as_deref()
|
1112 - | }
|
1113 - | #[allow(missing_docs)] // documentation missing in model
|
1114 - | pub fn set_of_range_short(&self) -> ::std::option::Option<&crate::model::SetOfRangeShort> {
|
1115 - | self.set_of_range_short.as_ref()
|
1116 - | }
|
1117 - | #[allow(missing_docs)] // documentation missing in model
|
1118 - | pub fn map_of_range_short(
|
1119 - | &self,
|
1120 - | ) -> ::std::option::Option<
|
1121 - | &::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
1122 - | > {
|
1123 - | self.map_of_range_short.as_ref()
|
1124 - | }
|
1125 - | #[allow(missing_docs)] // documentation missing in model
|
1126 - | pub fn list_of_range_long(&self) -> ::std::option::Option<&[crate::model::RangeLong]> {
|
1127 - | self.list_of_range_long.as_deref()
|
1128 - | }
|
1129 - | #[allow(missing_docs)] // documentation missing in model
|
1130 - | pub fn set_of_range_long(&self) -> ::std::option::Option<&crate::model::SetOfRangeLong> {
|
1131 - | self.set_of_range_long.as_ref()
|
1132 - | }
|
1133 - | #[allow(missing_docs)] // documentation missing in model
|
1134 - | pub fn map_of_range_long(
|
1135 - | &self,
|
1136 - | ) -> ::std::option::Option<
|
1137 - | &::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
1138 - | > {
|
1139 - | self.map_of_range_long.as_ref()
|
1140 - | }
|
1141 - | #[allow(missing_docs)] // documentation missing in model
|
1142 - | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[crate::model::RangeByte]> {
|
1143 - | self.list_of_range_byte.as_deref()
|
1144 - | }
|
1145 - | #[allow(missing_docs)] // documentation missing in model
|
1146 - | pub fn set_of_range_byte(&self) -> ::std::option::Option<&crate::model::SetOfRangeByte> {
|
1147 - | self.set_of_range_byte.as_ref()
|
1148 - | }
|
1149 - | #[allow(missing_docs)] // documentation missing in model
|
1150 - | pub fn map_of_range_byte(
|
1151 - | &self,
|
1152 - | ) -> ::std::option::Option<
|
1153 - | &::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
1154 - | > {
|
1155 - | self.map_of_range_byte.as_ref()
|
1156 - | }
|
1157 - | #[allow(missing_docs)] // documentation missing in model
|
1158 - | pub fn non_streaming_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
1159 - | self.non_streaming_blob.as_ref()
|
1160 - | }
|
1161 - | #[allow(missing_docs)] // documentation missing in model
|
1162 - | pub fn pattern_string(&self) -> ::std::option::Option<&crate::model::PatternString> {
|
1163 - | self.pattern_string.as_ref()
|
1164 - | }
|
1165 - | #[allow(missing_docs)] // documentation missing in model
|
1166 - | pub fn map_of_pattern_string(
|
1167 - | &self,
|
1168 - | ) -> ::std::option::Option<
|
1169 - | &::std::collections::HashMap<crate::model::PatternString, crate::model::PatternString>,
|
1170 - | > {
|
1171 - | self.map_of_pattern_string.as_ref()
|
1172 - | }
|
1173 - | #[allow(missing_docs)] // documentation missing in model
|
1174 - | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[crate::model::PatternString]> {
|
1175 - | self.list_of_pattern_string.as_deref()
|
1176 - | }
|
1177 - | #[allow(missing_docs)] // documentation missing in model
|
1178 - | pub fn set_of_pattern_string(
|
1179 - | &self,
|
1180 - | ) -> ::std::option::Option<&crate::model::SetOfPatternString> {
|
1181 - | self.set_of_pattern_string.as_ref()
|
1182 - | }
|
1183 - | #[allow(missing_docs)] // documentation missing in model
|
1184 - | pub fn length_length_pattern_string(
|
1185 - | &self,
|
1186 - | ) -> ::std::option::Option<&crate::model::LengthPatternString> {
|
1187 - | self.length_length_pattern_string.as_ref()
|
1188 - | }
|
1189 - | #[allow(missing_docs)] // documentation missing in model
|
1190 - | pub fn map_of_length_pattern_string(
|
1191 - | &self,
|
1192 - | ) -> ::std::option::Option<
|
1193 - | &::std::collections::HashMap<
|
1194 - | crate::model::LengthPatternString,
|
1195 - | crate::model::LengthPatternString,
|
1196 - | >,
|
1197 - | > {
|
1198 - | self.map_of_length_pattern_string.as_ref()
|
1199 - | }
|
1200 - | #[allow(missing_docs)] // documentation missing in model
|
1201 - | pub fn list_of_length_pattern_string(
|
1202 - | &self,
|
1203 - | ) -> ::std::option::Option<&[crate::model::LengthPatternString]> {
|
1204 - | self.list_of_length_pattern_string.as_deref()
|
1205 - | }
|
1206 - | #[allow(missing_docs)] // documentation missing in model
|
1207 - | pub fn set_of_length_pattern_string(
|
1208 - | &self,
|
1209 - | ) -> ::std::option::Option<&crate::model::SetOfLengthPatternString> {
|
1210 - | self.set_of_length_pattern_string.as_ref()
|
1211 - | }
|
1212 - | #[allow(missing_docs)] // documentation missing in model
|
1213 - | pub fn length_list_of_pattern_string(
|
1214 - | &self,
|
1215 - | ) -> ::std::option::Option<&crate::model::LengthListOfPatternString> {
|
1216 - | self.length_list_of_pattern_string.as_ref()
|
1217 - | }
|
1218 - | #[allow(missing_docs)] // documentation missing in model
|
1219 - | pub fn length_set_of_pattern_string(
|
1220 - | &self,
|
1221 - | ) -> ::std::option::Option<&crate::model::LengthSetOfPatternString> {
|
1222 - | self.length_set_of_pattern_string.as_ref()
|
1223 - | }
|
1224 - | }
|
1225 - | impl ConA {
|
1226 - | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
1227 - | pub fn builder() -> crate::model::con_a::Builder {
|
1228 - | crate::model::con_a::Builder::default()
|
1229 - | }
|
1230 - | }
|
1231 - | impl crate::constrained::Constrained for crate::model::ConA {
|
1232 - | type Unconstrained = crate::model::con_a::Builder;
|
1233 1127 | }
|
1234 1128 |
|
1235 1129 | #[allow(missing_docs)] // documentation missing in model
|
1236 1130 | ///
|
1237 1131 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1238 - | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1132 + | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
1239 1133 | ///
|
1240 1134 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1241 1135 | ///
|
1242 1136 | #[derive(
|
1243 1137 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1244 1138 | )]
|
1245 - | pub struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1246 - | impl LengthSetOfPatternString {
|
1247 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1248 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::PatternString> {
|
1139 + | pub struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
1140 + | impl SetOfLengthString {
|
1141 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
1142 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthString> {
|
1249 1143 | &self.0
|
1250 1144 | }
|
1251 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1252 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1145 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
1146 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
1253 1147 | self.0
|
1254 1148 | }
|
1255 1149 |
|
1256 - | fn check_length(
|
1257 - | length: usize,
|
1258 - | ) -> ::std::result::Result<(), crate::model::length_set_of_pattern_string::ConstraintViolation>
|
1259 - | {
|
1260 - | if (5..=9).contains(&length) {
|
1261 - | Ok(())
|
1262 - | } else {
|
1263 - | Err(crate::model::length_set_of_pattern_string::ConstraintViolation::Length(length))
|
1264 - | }
|
1265 - | }
|
1266 - |
|
1267 1150 | fn check_unique_items(
|
1268 - | items: ::std::vec::Vec<crate::model::PatternString>,
|
1151 + | items: ::std::vec::Vec<crate::model::LengthString>,
|
1269 1152 | ) -> ::std::result::Result<
|
1270 - | ::std::vec::Vec<crate::model::PatternString>,
|
1271 - | crate::model::length_set_of_pattern_string::ConstraintViolation,
|
1153 + | ::std::vec::Vec<crate::model::LengthString>,
|
1154 + | crate::model::set_of_length_string::ConstraintViolation,
|
1272 1155 | > {
|
1273 1156 | let mut seen = ::std::collections::HashMap::new();
|
1274 1157 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1275 1158 | for (idx, item) in items.iter().enumerate() {
|
1276 1159 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1277 1160 | duplicate_indices.push(prev_idx);
|
1278 1161 | }
|
1279 1162 | }
|
1280 1163 |
|
1281 1164 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1282 1165 | for idx in &duplicate_indices {
|
1283 1166 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1284 1167 | last_duplicate_indices.push(prev_idx);
|
1285 1168 | }
|
1286 1169 | }
|
1287 1170 | duplicate_indices.extend(last_duplicate_indices);
|
1288 1171 |
|
1289 1172 | if !duplicate_indices.is_empty() {
|
1290 1173 | debug_assert!(duplicate_indices.len() >= 2);
|
1291 1174 | Err(
|
1292 - | crate::model::length_set_of_pattern_string::ConstraintViolation::UniqueItems {
|
1175 + | crate::model::set_of_length_string::ConstraintViolation::UniqueItems {
|
1293 1176 | duplicate_indices,
|
1294 1177 | original: items,
|
1295 1178 | },
|
1296 1179 | )
|
1297 1180 | } else {
|
1298 1181 | Ok(items)
|
1299 1182 | }
|
1300 1183 | }
|
1301 1184 | }
|
1302 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1303 - | for LengthSetOfPatternString
|
1304 - | {
|
1305 - | type Error = crate::model::length_set_of_pattern_string::ConstraintViolation;
|
1185 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
1186 + | type Error = crate::model::set_of_length_string::ConstraintViolation;
|
1306 1187 |
|
1307 - | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1188 + | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
1308 1189 | fn try_from(
|
1309 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
1190 + | value: ::std::vec::Vec<crate::model::LengthString>,
|
1310 1191 | ) -> ::std::result::Result<Self, Self::Error> {
|
1311 - | Self::check_length(value.len())?;
|
1312 - |
|
1313 1192 | let value = Self::check_unique_items(value)?;
|
1314 1193 |
|
1315 1194 | Ok(Self(value))
|
1316 1195 | }
|
1317 1196 | }
|
1318 1197 |
|
1319 - | impl ::std::convert::From<LengthSetOfPatternString>
|
1320 - | for ::std::vec::Vec<crate::model::PatternString>
|
1321 - | {
|
1322 - | fn from(value: LengthSetOfPatternString) -> Self {
|
1198 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
1199 + | fn from(value: SetOfLengthString) -> Self {
|
1323 1200 | value.into_inner()
|
1324 1201 | }
|
1325 1202 | }
|
1326 - | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1327 - | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1203 + | impl crate::constrained::Constrained for SetOfLengthString {
|
1204 + | type Unconstrained =
|
1205 + | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
1328 1206 | }
|
1329 1207 |
|
1330 1208 | #[allow(missing_docs)] // documentation missing in model
|
1331 1209 | ///
|
1332 1210 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1333 - | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
1211 + | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
1334 1212 | ///
|
1335 1213 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1336 1214 | ///
|
1337 1215 | #[derive(
|
1338 1216 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1339 1217 | )]
|
1340 - | pub struct SetOfLengthPatternString(pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>);
|
1341 - | impl SetOfLengthPatternString {
|
1342 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
1343 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthPatternString> {
|
1218 + | pub struct LengthListOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1219 + | impl LengthListOfPatternString {
|
1220 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1221 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::PatternString> {
|
1344 1222 | &self.0
|
1345 1223 | }
|
1346 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
1347 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
1224 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1225 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1348 1226 | self.0
|
1349 1227 | }
|
1350 1228 |
|
1351 - | fn check_unique_items(
|
1352 - | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1353 - | ) -> ::std::result::Result<
|
1354 - | ::std::vec::Vec<crate::model::LengthPatternString>,
|
1355 - | crate::model::set_of_length_pattern_string::ConstraintViolation,
|
1356 - | > {
|
1357 - | let mut seen = ::std::collections::HashMap::new();
|
1358 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
1359 - | for (idx, item) in items.iter().enumerate() {
|
1360 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
1361 - | duplicate_indices.push(prev_idx);
|
1362 - | }
|
1363 - | }
|
1364 - |
|
1365 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1366 - | for idx in &duplicate_indices {
|
1367 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1368 - | last_duplicate_indices.push(prev_idx);
|
1369 - | }
|
1370 - | }
|
1371 - | duplicate_indices.extend(last_duplicate_indices);
|
1372 - |
|
1373 - | if !duplicate_indices.is_empty() {
|
1374 - | debug_assert!(duplicate_indices.len() >= 2);
|
1375 - | Err(
|
1376 - | crate::model::set_of_length_pattern_string::ConstraintViolation::UniqueItems {
|
1377 - | duplicate_indices,
|
1378 - | original: items,
|
1379 - | },
|
1380 - | )
|
1229 + | fn check_length(
|
1230 + | length: usize,
|
1231 + | ) -> ::std::result::Result<(), crate::model::length_list_of_pattern_string::ConstraintViolation>
|
1232 + | {
|
1233 + | if (12..=39).contains(&length) {
|
1234 + | Ok(())
|
1381 1235 | } else {
|
1382 - | Ok(items)
|
1236 + | Err(crate::model::length_list_of_pattern_string::ConstraintViolation::Length(length))
|
1383 1237 | }
|
1384 1238 | }
|
1385 1239 | }
|
1386 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
1387 - | for SetOfLengthPatternString
|
1240 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1241 + | for LengthListOfPatternString
|
1388 1242 | {
|
1389 - | type Error = crate::model::set_of_length_pattern_string::ConstraintViolation;
|
1243 + | type Error = crate::model::length_list_of_pattern_string::ConstraintViolation;
|
1390 1244 |
|
1391 - | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1245 + | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1392 1246 | fn try_from(
|
1393 - | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1247 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
1394 1248 | ) -> ::std::result::Result<Self, Self::Error> {
|
1395 - | let value = Self::check_unique_items(value)?;
|
1249 + | Self::check_length(value.len())?;
|
1396 1250 |
|
1397 1251 | Ok(Self(value))
|
1398 1252 | }
|
1399 1253 | }
|
1400 1254 |
|
1401 - | impl ::std::convert::From<SetOfLengthPatternString>
|
1402 - | for ::std::vec::Vec<crate::model::LengthPatternString>
|
1255 + | impl ::std::convert::From<LengthListOfPatternString>
|
1256 + | for ::std::vec::Vec<crate::model::PatternString>
|
1403 1257 | {
|
1404 - | fn from(value: SetOfLengthPatternString) -> Self {
|
1258 + | fn from(value: LengthListOfPatternString) -> Self {
|
1405 1259 | value.into_inner()
|
1406 1260 | }
|
1407 1261 | }
|
1408 - | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
1409 - | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
1262 + | impl crate::constrained::Constrained for LengthListOfPatternString {
|
1263 + | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
1410 1264 | }
|
1411 1265 |
|
1412 1266 | #[allow(missing_docs)] // documentation missing in model
|
1413 1267 | ///
|
1414 1268 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1415 - | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
1269 + | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1416 1270 | ///
|
1417 1271 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1418 1272 | ///
|
1419 1273 | #[derive(
|
1420 1274 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1421 1275 | )]
|
1422 - | pub struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1423 - | impl SetOfPatternString {
|
1276 + | pub struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1277 + | impl LengthSetOfPatternString {
|
1424 1278 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1425 1279 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::PatternString> {
|
1426 1280 | &self.0
|
1427 1281 | }
|
1428 1282 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1429 1283 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1430 1284 | self.0
|
1431 1285 | }
|
1432 1286 |
|
1287 + | fn check_length(
|
1288 + | length: usize,
|
1289 + | ) -> ::std::result::Result<(), crate::model::length_set_of_pattern_string::ConstraintViolation>
|
1290 + | {
|
1291 + | if (5..=9).contains(&length) {
|
1292 + | Ok(())
|
1293 + | } else {
|
1294 + | Err(crate::model::length_set_of_pattern_string::ConstraintViolation::Length(length))
|
1295 + | }
|
1296 + | }
|
1297 + |
|
1433 1298 | fn check_unique_items(
|
1434 1299 | items: ::std::vec::Vec<crate::model::PatternString>,
|
1435 1300 | ) -> ::std::result::Result<
|
1436 1301 | ::std::vec::Vec<crate::model::PatternString>,
|
1437 - | crate::model::set_of_pattern_string::ConstraintViolation,
|
1302 + | crate::model::length_set_of_pattern_string::ConstraintViolation,
|
1438 1303 | > {
|
1439 1304 | let mut seen = ::std::collections::HashMap::new();
|
1440 1305 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1441 1306 | for (idx, item) in items.iter().enumerate() {
|
1442 1307 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1443 1308 | duplicate_indices.push(prev_idx);
|
1444 1309 | }
|
1445 1310 | }
|
1446 1311 |
|
1447 1312 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1448 1313 | for idx in &duplicate_indices {
|
1449 1314 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1450 1315 | last_duplicate_indices.push(prev_idx);
|
1451 1316 | }
|
1452 1317 | }
|
1453 1318 | duplicate_indices.extend(last_duplicate_indices);
|
1454 1319 |
|
1455 1320 | if !duplicate_indices.is_empty() {
|
1456 1321 | debug_assert!(duplicate_indices.len() >= 2);
|
1457 1322 | Err(
|
1458 - | crate::model::set_of_pattern_string::ConstraintViolation::UniqueItems {
|
1323 + | crate::model::length_set_of_pattern_string::ConstraintViolation::UniqueItems {
|
1459 1324 | duplicate_indices,
|
1460 1325 | original: items,
|
1461 1326 | },
|
1462 1327 | )
|
1463 1328 | } else {
|
1464 1329 | Ok(items)
|
1465 1330 | }
|
1466 1331 | }
|
1467 1332 | }
|
1468 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
1469 - | type Error = crate::model::set_of_pattern_string::ConstraintViolation;
|
1333 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1334 + | for LengthSetOfPatternString
|
1335 + | {
|
1336 + | type Error = crate::model::length_set_of_pattern_string::ConstraintViolation;
|
1470 1337 |
|
1471 - | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1338 + | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1472 1339 | fn try_from(
|
1473 1340 | value: ::std::vec::Vec<crate::model::PatternString>,
|
1474 1341 | ) -> ::std::result::Result<Self, Self::Error> {
|
1342 + | Self::check_length(value.len())?;
|
1343 + |
|
1475 1344 | let value = Self::check_unique_items(value)?;
|
1476 1345 |
|
1477 1346 | Ok(Self(value))
|
1478 1347 | }
|
1479 1348 | }
|
1480 1349 |
|
1481 - | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
1482 - | fn from(value: SetOfPatternString) -> Self {
|
1483 - | value.into_inner()
|
1484 - | }
|
1485 - | }
|
1486 - | impl crate::constrained::Constrained for SetOfPatternString {
|
1487 - | type Unconstrained =
|
1488 - | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
1489 - | }
|
1490 - |
|
1491 - | #[allow(missing_docs)] // documentation missing in model
|
1492 - | ///
|
1493 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1494 - | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
1495 - | ///
|
1496 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1497 - | ///
|
1498 - | #[derive(
|
1499 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1500 - | )]
|
1501 - | pub struct RangeByte(pub(crate) i8);
|
1502 - | impl RangeByte {
|
1503 - | /// Returns an immutable reference to the underlying [`i8`].
|
1504 - | pub fn inner(&self) -> &i8 {
|
1505 - | &self.0
|
1506 - | }
|
1507 - |
|
1508 - | /// Consumes the value, returning the underlying [`i8`].
|
1509 - | pub fn into_inner(self) -> i8 {
|
1510 - | self.0
|
1511 - | }
|
1512 - | }
|
1513 - |
|
1514 - | impl crate::constrained::Constrained for RangeByte {
|
1515 - | type Unconstrained = i8;
|
1516 - | }
|
1517 - |
|
1518 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
1519 - | fn from(value: i8) -> Self {
|
1520 - | Self::Unconstrained(value)
|
1521 - | }
|
1522 - | }
|
1523 - |
|
1524 - | impl ::std::fmt::Display for RangeByte {
|
1525 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1526 - | self.0.fmt(f)
|
1527 - | }
|
1528 - | }
|
1529 - |
|
1530 - | impl ::std::convert::From<RangeByte> for i8 {
|
1531 - | fn from(value: RangeByte) -> Self {
|
1350 + | impl ::std::convert::From<LengthSetOfPatternString>
|
1351 + | for ::std::vec::Vec<crate::model::PatternString>
|
1352 + | {
|
1353 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1532 1354 | value.into_inner()
|
1533 1355 | }
|
1534 1356 | }
|
1535 - | impl RangeByte {
|
1536 - | fn check_range(
|
1537 - | value: i8,
|
1538 - | ) -> ::std::result::Result<(), crate::model::range_byte::ConstraintViolation> {
|
1539 - | if (0..=10).contains(&value) {
|
1540 - | Ok(())
|
1541 - | } else {
|
1542 - | Err(crate::model::range_byte::ConstraintViolation::Range(value))
|
1543 - | }
|
1544 - | }
|
1545 - | }
|
1546 - | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1547 - | type Error = crate::model::range_byte::ConstraintViolation;
|
1548 - |
|
1549 - | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1550 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1551 - | Self::check_range(value)?;
|
1552 - |
|
1553 - | Ok(Self(value))
|
1554 - | }
|
1357 + | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1358 + | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1555 1359 | }
|
1556 1360 |
|
1557 1361 | #[allow(missing_docs)] // documentation missing in model
|
1558 1362 | ///
|
1559 1363 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1560 1364 | /// [constraint traits]. Use [`SetOfRangeByte::try_from`] to construct values of this type.
|
1561 1365 | ///
|
1562 1366 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1563 1367 | ///
|
1564 1368 | #[derive(
|
1629 1433 | }
|
1630 1434 | }
|
1631 1435 | impl crate::constrained::Constrained for SetOfRangeByte {
|
1632 1436 | type Unconstrained =
|
1633 1437 | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained;
|
1634 1438 | }
|
1635 1439 |
|
1636 1440 | #[allow(missing_docs)] // documentation missing in model
|
1637 1441 | ///
|
1638 1442 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1639 - | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1640 - | ///
|
1641 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1642 - | ///
|
1643 - | #[derive(
|
1644 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1645 - | )]
|
1646 - | pub struct RangeLong(pub(crate) i64);
|
1647 - | impl RangeLong {
|
1648 - | /// Returns an immutable reference to the underlying [`i64`].
|
1649 - | pub fn inner(&self) -> &i64 {
|
1650 - | &self.0
|
1651 - | }
|
1652 - |
|
1653 - | /// Consumes the value, returning the underlying [`i64`].
|
1654 - | pub fn into_inner(self) -> i64 {
|
1655 - | self.0
|
1656 - | }
|
1657 - | }
|
1658 - |
|
1659 - | impl crate::constrained::Constrained for RangeLong {
|
1660 - | type Unconstrained = i64;
|
1661 - | }
|
1662 - |
|
1663 - | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
1664 - | fn from(value: i64) -> Self {
|
1665 - | Self::Unconstrained(value)
|
1666 - | }
|
1667 - | }
|
1668 - |
|
1669 - | impl ::std::fmt::Display for RangeLong {
|
1670 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1671 - | self.0.fmt(f)
|
1672 - | }
|
1673 - | }
|
1674 - |
|
1675 - | impl ::std::convert::From<RangeLong> for i64 {
|
1676 - | fn from(value: RangeLong) -> Self {
|
1677 - | value.into_inner()
|
1678 - | }
|
1679 - | }
|
1680 - | impl RangeLong {
|
1681 - | fn check_range(
|
1682 - | value: i64,
|
1683 - | ) -> ::std::result::Result<(), crate::model::range_long::ConstraintViolation> {
|
1684 - | if (0..=10).contains(&value) {
|
1685 - | Ok(())
|
1686 - | } else {
|
1687 - | Err(crate::model::range_long::ConstraintViolation::Range(value))
|
1688 - | }
|
1689 - | }
|
1690 - | }
|
1691 - | impl ::std::convert::TryFrom<i64> for RangeLong {
|
1692 - | type Error = crate::model::range_long::ConstraintViolation;
|
1693 - |
|
1694 - | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1695 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1696 - | Self::check_range(value)?;
|
1697 - |
|
1698 - | Ok(Self(value))
|
1699 - | }
|
1700 - | }
|
1701 - |
|
1702 - | #[allow(missing_docs)] // documentation missing in model
|
1703 - | ///
|
1704 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1705 - | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
1443 + | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
1706 1444 | ///
|
1707 1445 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1708 1446 | ///
|
1709 1447 | #[derive(
|
1710 1448 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1711 1449 | )]
|
1712 - | pub struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
1713 - | impl SetOfRangeLong {
|
1714 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1715 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeLong> {
|
1450 + | pub struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1451 + | impl SetOfRangeShort {
|
1452 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1453 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeShort> {
|
1716 1454 | &self.0
|
1717 1455 | }
|
1718 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1719 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
1456 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1457 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1720 1458 | self.0
|
1721 1459 | }
|
1722 1460 |
|
1723 1461 | fn check_unique_items(
|
1724 - | items: ::std::vec::Vec<crate::model::RangeLong>,
|
1462 + | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1725 1463 | ) -> ::std::result::Result<
|
1726 - | ::std::vec::Vec<crate::model::RangeLong>,
|
1727 - | crate::model::set_of_range_long::ConstraintViolation,
|
1464 + | ::std::vec::Vec<crate::model::RangeShort>,
|
1465 + | crate::model::set_of_range_short::ConstraintViolation,
|
1728 1466 | > {
|
1729 1467 | let mut seen = ::std::collections::HashMap::new();
|
1730 1468 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1731 1469 | for (idx, item) in items.iter().enumerate() {
|
1732 1470 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1733 1471 | duplicate_indices.push(prev_idx);
|
1734 1472 | }
|
1735 1473 | }
|
1736 1474 |
|
1737 1475 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1738 1476 | for idx in &duplicate_indices {
|
1739 1477 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1740 1478 | last_duplicate_indices.push(prev_idx);
|
1741 1479 | }
|
1742 1480 | }
|
1743 1481 | duplicate_indices.extend(last_duplicate_indices);
|
1744 1482 |
|
1745 1483 | if !duplicate_indices.is_empty() {
|
1746 1484 | debug_assert!(duplicate_indices.len() >= 2);
|
1747 1485 | Err(
|
1748 - | crate::model::set_of_range_long::ConstraintViolation::UniqueItems {
|
1486 + | crate::model::set_of_range_short::ConstraintViolation::UniqueItems {
|
1749 1487 | duplicate_indices,
|
1750 1488 | original: items,
|
1751 1489 | },
|
1752 1490 | )
|
1753 1491 | } else {
|
1754 1492 | Ok(items)
|
1755 1493 | }
|
1756 1494 | }
|
1757 1495 | }
|
1758 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
1759 - | type Error = crate::model::set_of_range_long::ConstraintViolation;
|
1496 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
1497 + | type Error = crate::model::set_of_range_short::ConstraintViolation;
|
1760 1498 |
|
1761 - | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
1499 + | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
1762 1500 | fn try_from(
|
1763 - | value: ::std::vec::Vec<crate::model::RangeLong>,
|
1501 + | value: ::std::vec::Vec<crate::model::RangeShort>,
|
1764 1502 | ) -> ::std::result::Result<Self, Self::Error> {
|
1765 1503 | let value = Self::check_unique_items(value)?;
|
1766 1504 |
|
1767 1505 | Ok(Self(value))
|
1768 1506 | }
|
1769 1507 | }
|
1770 1508 |
|
1771 - | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
1772 - | fn from(value: SetOfRangeLong) -> Self {
|
1509 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
1510 + | fn from(value: SetOfRangeShort) -> Self {
|
1773 1511 | value.into_inner()
|
1774 1512 | }
|
1775 1513 | }
|
1776 - | impl crate::constrained::Constrained for SetOfRangeLong {
|
1514 + | impl crate::constrained::Constrained for SetOfRangeShort {
|
1777 1515 | type Unconstrained =
|
1778 - | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
1779 - | }
|
1780 - |
|
1781 - | #[allow(missing_docs)] // documentation missing in model
|
1782 - | ///
|
1783 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1784 - | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
1785 - | ///
|
1786 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1787 - | ///
|
1788 - | #[derive(
|
1789 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1790 - | )]
|
1791 - | pub struct RangeShort(pub(crate) i16);
|
1792 - | impl RangeShort {
|
1793 - | /// Returns an immutable reference to the underlying [`i16`].
|
1794 - | pub fn inner(&self) -> &i16 {
|
1795 - | &self.0
|
1796 - | }
|
1797 - |
|
1798 - | /// Consumes the value, returning the underlying [`i16`].
|
1799 - | pub fn into_inner(self) -> i16 {
|
1800 - | self.0
|
1801 - | }
|
1802 - | }
|
1803 - |
|
1804 - | impl crate::constrained::Constrained for RangeShort {
|
1805 - | type Unconstrained = i16;
|
1806 - | }
|
1807 - |
|
1808 - | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
1809 - | fn from(value: i16) -> Self {
|
1810 - | Self::Unconstrained(value)
|
1811 - | }
|
1812 - | }
|
1813 - |
|
1814 - | impl ::std::fmt::Display for RangeShort {
|
1815 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1816 - | self.0.fmt(f)
|
1817 - | }
|
1818 - | }
|
1819 - |
|
1820 - | impl ::std::convert::From<RangeShort> for i16 {
|
1821 - | fn from(value: RangeShort) -> Self {
|
1822 - | value.into_inner()
|
1823 - | }
|
1824 - | }
|
1825 - | impl RangeShort {
|
1826 - | fn check_range(
|
1827 - | value: i16,
|
1828 - | ) -> ::std::result::Result<(), crate::model::range_short::ConstraintViolation> {
|
1829 - | if (0..=10).contains(&value) {
|
1830 - | Ok(())
|
1831 - | } else {
|
1832 - | Err(crate::model::range_short::ConstraintViolation::Range(value))
|
1833 - | }
|
1834 - | }
|
1835 - | }
|
1836 - | impl ::std::convert::TryFrom<i16> for RangeShort {
|
1837 - | type Error = crate::model::range_short::ConstraintViolation;
|
1838 - |
|
1839 - | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
1840 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
1841 - | Self::check_range(value)?;
|
1842 - |
|
1843 - | Ok(Self(value))
|
1844 - | }
|
1516 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
1845 1517 | }
|
1846 1518 |
|
1847 1519 | #[allow(missing_docs)] // documentation missing in model
|
1848 1520 | ///
|
1849 1521 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1850 - | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
1522 + | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
1851 1523 | ///
|
1852 1524 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1853 1525 | ///
|
1854 1526 | #[derive(
|
1855 1527 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1856 1528 | )]
|
1857 - | pub struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1858 - | impl SetOfRangeShort {
|
1859 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1860 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeShort> {
|
1529 + | pub struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
1530 + | impl SetOfRangeInteger {
|
1531 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
1532 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeInteger> {
|
1861 1533 | &self.0
|
1862 1534 | }
|
1863 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1864 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1535 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
1536 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
1865 1537 | self.0
|
1866 1538 | }
|
1867 1539 |
|
1868 1540 | fn check_unique_items(
|
1869 - | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1541 + | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
1870 1542 | ) -> ::std::result::Result<
|
1871 - | ::std::vec::Vec<crate::model::RangeShort>,
|
1872 - | crate::model::set_of_range_short::ConstraintViolation,
|
1543 + | ::std::vec::Vec<crate::model::RangeInteger>,
|
1544 + | crate::model::set_of_range_integer::ConstraintViolation,
|
1873 1545 | > {
|
1874 1546 | let mut seen = ::std::collections::HashMap::new();
|
1875 1547 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1876 1548 | for (idx, item) in items.iter().enumerate() {
|
1877 1549 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1878 1550 | duplicate_indices.push(prev_idx);
|
1879 1551 | }
|
1880 1552 | }
|
1881 1553 |
|
1882 1554 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1883 1555 | for idx in &duplicate_indices {
|
1884 1556 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1885 1557 | last_duplicate_indices.push(prev_idx);
|
1886 1558 | }
|
1887 1559 | }
|
1888 1560 | duplicate_indices.extend(last_duplicate_indices);
|
1889 1561 |
|
1890 1562 | if !duplicate_indices.is_empty() {
|
1891 1563 | debug_assert!(duplicate_indices.len() >= 2);
|
1892 1564 | Err(
|
1893 - | crate::model::set_of_range_short::ConstraintViolation::UniqueItems {
|
1565 + | crate::model::set_of_range_integer::ConstraintViolation::UniqueItems {
|
1894 1566 | duplicate_indices,
|
1895 1567 | original: items,
|
1896 1568 | },
|
1897 1569 | )
|
1898 1570 | } else {
|
1899 1571 | Ok(items)
|
1900 1572 | }
|
1901 1573 | }
|
1902 1574 | }
|
1903 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
1904 - | type Error = crate::model::set_of_range_short::ConstraintViolation;
|
1575 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
1576 + | type Error = crate::model::set_of_range_integer::ConstraintViolation;
|
1905 1577 |
|
1906 - | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
1578 + | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
1907 1579 | fn try_from(
|
1908 - | value: ::std::vec::Vec<crate::model::RangeShort>,
|
1580 + | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
1909 1581 | ) -> ::std::result::Result<Self, Self::Error> {
|
1910 1582 | let value = Self::check_unique_items(value)?;
|
1911 1583 |
|
1912 1584 | Ok(Self(value))
|
1913 1585 | }
|
1914 1586 | }
|
1915 1587 |
|
1916 - | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
1917 - | fn from(value: SetOfRangeShort) -> Self {
|
1588 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
1589 + | fn from(value: SetOfRangeInteger) -> Self {
|
1918 1590 | value.into_inner()
|
1919 1591 | }
|
1920 1592 | }
|
1921 - | impl crate::constrained::Constrained for SetOfRangeShort {
|
1593 + | impl crate::constrained::Constrained for SetOfRangeInteger {
|
1922 1594 | type Unconstrained =
|
1923 - | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
1924 - | }
|
1925 - |
|
1926 - | #[allow(missing_docs)] // documentation missing in model
|
1927 - | ///
|
1928 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1929 - | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
1930 - | ///
|
1931 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1932 - | ///
|
1933 - | #[derive(
|
1934 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1935 - | )]
|
1936 - | pub struct RangeInteger(pub(crate) i32);
|
1937 - | impl RangeInteger {
|
1938 - | /// Returns an immutable reference to the underlying [`i32`].
|
1939 - | pub fn inner(&self) -> &i32 {
|
1940 - | &self.0
|
1941 - | }
|
1942 - |
|
1943 - | /// Consumes the value, returning the underlying [`i32`].
|
1944 - | pub fn into_inner(self) -> i32 {
|
1945 - | self.0
|
1946 - | }
|
1947 - | }
|
1948 - |
|
1949 - | impl crate::constrained::Constrained for RangeInteger {
|
1950 - | type Unconstrained = i32;
|
1951 - | }
|
1952 - |
|
1953 - | impl ::std::convert::From<i32>
|
1954 - | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
1955 - | {
|
1956 - | fn from(value: i32) -> Self {
|
1957 - | Self::Unconstrained(value)
|
1958 - | }
|
1959 - | }
|
1960 - |
|
1961 - | impl ::std::fmt::Display for RangeInteger {
|
1962 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1963 - | self.0.fmt(f)
|
1964 - | }
|
1965 - | }
|
1966 - |
|
1967 - | impl ::std::convert::From<RangeInteger> for i32 {
|
1968 - | fn from(value: RangeInteger) -> Self {
|
1969 - | value.into_inner()
|
1970 - | }
|
1971 - | }
|
1972 - | impl RangeInteger {
|
1973 - | fn check_range(
|
1974 - | value: i32,
|
1975 - | ) -> ::std::result::Result<(), crate::model::range_integer::ConstraintViolation> {
|
1976 - | if (0..=69).contains(&value) {
|
1977 - | Ok(())
|
1978 - | } else {
|
1979 - | Err(crate::model::range_integer::ConstraintViolation::Range(
|
1980 - | value,
|
1981 - | ))
|
1982 - | }
|
1983 - | }
|
1984 - | }
|
1985 - | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
1986 - | type Error = crate::model::range_integer::ConstraintViolation;
|
1987 - |
|
1988 - | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1989 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1990 - | Self::check_range(value)?;
|
1991 - |
|
1992 - | Ok(Self(value))
|
1993 - | }
|
1595 + | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
1994 1596 | }
|
1995 1597 |
|
1996 1598 | #[allow(missing_docs)] // documentation missing in model
|
1997 1599 | ///
|
1998 1600 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1999 - | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
1601 + | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
2000 1602 | ///
|
2001 1603 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2002 1604 | ///
|
2003 1605 | #[derive(
|
2004 1606 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2005 1607 | )]
|
2006 - | pub struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
2007 - | impl SetOfRangeInteger {
|
2008 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2009 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeInteger> {
|
1608 + | pub struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
1609 + | impl SetOfRangeLong {
|
1610 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1611 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::RangeLong> {
|
2010 1612 | &self.0
|
2011 1613 | }
|
2012 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2013 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
1614 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1615 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
2014 1616 | self.0
|
2015 1617 | }
|
2016 1618 |
|
2017 1619 | fn check_unique_items(
|
2018 - | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
1620 + | items: ::std::vec::Vec<crate::model::RangeLong>,
|
2019 1621 | ) -> ::std::result::Result<
|
2020 - | ::std::vec::Vec<crate::model::RangeInteger>,
|
2021 - | crate::model::set_of_range_integer::ConstraintViolation,
|
1622 + | ::std::vec::Vec<crate::model::RangeLong>,
|
1623 + | crate::model::set_of_range_long::ConstraintViolation,
|
2022 1624 | > {
|
2023 1625 | let mut seen = ::std::collections::HashMap::new();
|
2024 1626 | let mut duplicate_indices = ::std::vec::Vec::new();
|
2025 1627 | for (idx, item) in items.iter().enumerate() {
|
2026 1628 | if let Some(prev_idx) = seen.insert(item, idx) {
|
2027 1629 | duplicate_indices.push(prev_idx);
|
2028 1630 | }
|
2029 1631 | }
|
2030 1632 |
|
2031 1633 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2032 1634 | for idx in &duplicate_indices {
|
2033 1635 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2034 1636 | last_duplicate_indices.push(prev_idx);
|
2035 1637 | }
|
2036 1638 | }
|
2037 1639 | duplicate_indices.extend(last_duplicate_indices);
|
2038 1640 |
|
2039 1641 | if !duplicate_indices.is_empty() {
|
2040 1642 | debug_assert!(duplicate_indices.len() >= 2);
|
2041 1643 | Err(
|
2042 - | crate::model::set_of_range_integer::ConstraintViolation::UniqueItems {
|
1644 + | crate::model::set_of_range_long::ConstraintViolation::UniqueItems {
|
2043 1645 | duplicate_indices,
|
2044 1646 | original: items,
|
2045 1647 | },
|
2046 1648 | )
|
2047 1649 | } else {
|
2048 1650 | Ok(items)
|
2049 1651 | }
|
2050 1652 | }
|
2051 1653 | }
|
2052 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
2053 - | type Error = crate::model::set_of_range_integer::ConstraintViolation;
|
1654 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
1655 + | type Error = crate::model::set_of_range_long::ConstraintViolation;
|
2054 1656 |
|
2055 - | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
1657 + | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
2056 1658 | fn try_from(
|
2057 - | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
1659 + | value: ::std::vec::Vec<crate::model::RangeLong>,
|
2058 1660 | ) -> ::std::result::Result<Self, Self::Error> {
|
2059 1661 | let value = Self::check_unique_items(value)?;
|
2060 1662 |
|
2061 1663 | Ok(Self(value))
|
2062 1664 | }
|
2063 1665 | }
|
2064 1666 |
|
2065 - | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
2066 - | fn from(value: SetOfRangeInteger) -> Self {
|
1667 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
1668 + | fn from(value: SetOfRangeLong) -> Self {
|
2067 1669 | value.into_inner()
|
2068 1670 | }
|
2069 1671 | }
|
2070 - | impl crate::constrained::Constrained for SetOfRangeInteger {
|
1672 + | impl crate::constrained::Constrained for SetOfRangeLong {
|
2071 1673 | type Unconstrained =
|
2072 - | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
1674 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
2073 1675 | }
|
2074 1676 |
|
2075 1677 | #[allow(missing_docs)] // documentation missing in model
|
2076 - | ///
|
2077 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2078 - | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2079 - | ///
|
2080 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2081 - | ///
|
2082 1678 | #[derive(
|
2083 1679 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2084 1680 | )]
|
2085 - | pub struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2086 - | impl LengthBlob {
|
2087 - | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
2088 - | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
2089 - | &self.0
|
1681 + | pub struct RecursiveShapesInputOutputNested1 {
|
1682 + | #[allow(missing_docs)] // documentation missing in model
|
1683 + | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
1684 + | }
|
1685 + | impl RecursiveShapesInputOutputNested1 {
|
1686 + | #[allow(missing_docs)] // documentation missing in model
|
1687 + | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
1688 + | use std::ops::Deref;
|
1689 + | self.recursive_member.deref()
|
2090 1690 | }
|
2091 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2092 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2093 - | self.0
|
1691 + | }
|
1692 + | impl RecursiveShapesInputOutputNested1 {
|
1693 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
1694 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
1695 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
2094 1696 | }
|
2095 1697 | }
|
2096 - | impl LengthBlob {
|
2097 - | fn check_length(
|
2098 - | blob: &::aws_smithy_types::Blob,
|
2099 - | ) -> ::std::result::Result<(), crate::model::length_blob::ConstraintViolation> {
|
2100 - | let length = blob.as_ref().len();
|
1698 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
1699 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1::Builder;
|
1700 + | }
|
2101 1701 |
|
2102 - | if (2..=70).contains(&length) {
|
2103 - | Ok(())
|
2104 - | } else {
|
2105 - | Err(crate::model::length_blob::ConstraintViolation::Length(
|
2106 - | length,
|
2107 - | ))
|
1702 + | #[allow(missing_docs)] // documentation missing in model
|
1703 + | ///
|
1704 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1705 + | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
1706 + | ///
|
1707 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1708 + | ///
|
1709 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1710 + | pub struct ConBMap(
|
1711 + | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1712 + | );
|
1713 + | impl ConBMap {
|
1714 + | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
1715 + | pub fn inner(
|
1716 + | &self,
|
1717 + | ) -> &::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
1718 + | &self.0
|
2108 1719 | }
|
1720 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
1721 + | pub fn into_inner(
|
1722 + | self,
|
1723 + | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
1724 + | self.0
|
2109 1725 | }
|
2110 1726 | }
|
2111 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2112 - | type Error = crate::model::length_blob::ConstraintViolation;
|
2113 - |
|
2114 - | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2115 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2116 - | Self::check_length(&value)?;
|
1727 + | impl
|
1728 + | ::std::convert::TryFrom<
|
1729 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1730 + | > for ConBMap
|
1731 + | {
|
1732 + | type Error = crate::model::con_b_map::ConstraintViolation;
|
2117 1733 |
|
1734 + | /// 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.
|
1735 + | fn try_from(
|
1736 + | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1737 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1738 + | let length = value.len();
|
1739 + | if (1..=69).contains(&length) {
|
2118 1740 | Ok(Self(value))
|
1741 + | } else {
|
1742 + | Err(crate::model::con_b_map::ConstraintViolation::Length(length))
|
2119 1743 | }
|
2120 - | }
|
2121 - | impl crate::constrained::Constrained for LengthBlob {
|
2122 - | type Unconstrained = ::aws_smithy_types::Blob;
|
2123 - | }
|
2124 - |
|
2125 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2126 - | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2127 - | {
|
2128 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2129 - | Self::Unconstrained(value)
|
2130 1744 | }
|
2131 1745 | }
|
2132 1746 |
|
2133 - | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2134 - | fn from(value: LengthBlob) -> Self {
|
1747 + | impl ::std::convert::From<ConBMap>
|
1748 + | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
1749 + | {
|
1750 + | fn from(value: ConBMap) -> Self {
|
2135 1751 | value.into_inner()
|
2136 1752 | }
|
2137 1753 | }
|
1754 + | impl crate::constrained::Constrained for ConBMap {
|
1755 + | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
1756 + | }
|
2138 1757 |
|
2139 - | /// A union with constrained members.
|
2140 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2141 - | pub enum ConstrainedUnion {
|
2142 - | #[allow(missing_docs)] // documentation missing in model
|
2143 - | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
2144 - | #[allow(missing_docs)] // documentation missing in model
|
2145 - | ConBMap(crate::model::ConBMap),
|
2146 - | #[allow(missing_docs)] // documentation missing in model
|
2147 - | ConBSet(crate::model::ConBSet),
|
2148 - | #[allow(missing_docs)] // documentation missing in model
|
2149 - | ConstrainedStructure(crate::model::ConB),
|
2150 - | #[allow(missing_docs)] // documentation missing in model
|
2151 - | EnumString(crate::model::EnumString),
|
1758 + | #[allow(missing_docs)] // documentation missing in model
|
1759 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1760 + | pub enum Event {
|
2152 1761 | #[allow(missing_docs)] // documentation missing in model
|
2153 - | LengthString(crate::model::LengthString),
|
1762 + | RegularMessage(crate::model::EventStreamRegularMessage),
|
2154 1763 | }
|
2155 - | impl ConstrainedUnion {
|
2156 - | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
1764 + | impl Event {
|
1765 + | #[allow(irrefutable_let_patterns)]
|
1766 + | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
2157 1767 | /// Returns `Err(&Self)` if it can't be converted.
|
2158 - | pub fn as_con_b_list(
|
1768 + | pub fn as_regular_message(
|
2159 1769 | &self,
|
2160 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
2161 - | if let ConstrainedUnion::ConBList(val) = &self {
|
2162 - | ::std::result::Result::Ok(val)
|
2163 - | } else {
|
2164 - | ::std::result::Result::Err(self)
|
2165 - | }
|
2166 - | }
|
2167 - | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
2168 - | pub fn is_con_b_list(&self) -> bool {
|
2169 - | self.as_con_b_list().is_ok()
|
2170 - | }
|
2171 - | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`ConBMap`](crate::model::ConBMap).
|
2172 - | /// Returns `Err(&Self)` if it can't be converted.
|
2173 - | pub fn as_con_b_map(&self) -> ::std::result::Result<&crate::model::ConBMap, &Self> {
|
2174 - | if let ConstrainedUnion::ConBMap(val) = &self {
|
2175 - | ::std::result::Result::Ok(val)
|
2176 - | } else {
|
2177 - | ::std::result::Result::Err(self)
|
2178 - | }
|
2179 - | }
|
2180 - | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
2181 - | pub fn is_con_b_map(&self) -> bool {
|
2182 - | self.as_con_b_map().is_ok()
|
2183 - | }
|
2184 - | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`ConBSet`](crate::model::ConBSet).
|
2185 - | /// Returns `Err(&Self)` if it can't be converted.
|
2186 - | pub fn as_con_b_set(&self) -> ::std::result::Result<&crate::model::ConBSet, &Self> {
|
2187 - | if let ConstrainedUnion::ConBSet(val) = &self {
|
2188 - | ::std::result::Result::Ok(val)
|
2189 - | } else {
|
2190 - | ::std::result::Result::Err(self)
|
2191 - | }
|
2192 - | }
|
2193 - | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
2194 - | pub fn is_con_b_set(&self) -> bool {
|
2195 - | self.as_con_b_set().is_ok()
|
2196 - | }
|
2197 - | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
2198 - | /// Returns `Err(&Self)` if it can't be converted.
|
2199 - | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
2200 - | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
1770 + | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
1771 + | if let Event::RegularMessage(val) = &self {
|
2201 1772 | ::std::result::Result::Ok(val)
|
2202 1773 | } else {
|
2203 1774 | ::std::result::Result::Err(self)
|
2204 1775 | }
|
2205 1776 | }
|
2206 - | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
2207 - | pub fn is_constrained_structure(&self) -> bool {
|
2208 - | self.as_constrained_structure().is_ok()
|
2209 - | }
|
2210 - | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
2211 - | /// Returns `Err(&Self)` if it can't be converted.
|
2212 - | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
2213 - | if let ConstrainedUnion::EnumString(val) = &self {
|
2214 - | ::std::result::Result::Ok(val)
|
2215 - | } else {
|
2216 - | ::std::result::Result::Err(self)
|
1777 + | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
1778 + | pub fn is_regular_message(&self) -> bool {
|
1779 + | self.as_regular_message().is_ok()
|
2217 1780 | }
|
1781 + | }
|
1782 + |
|
1783 + | #[allow(missing_docs)] // documentation missing in model
|
1784 + | #[derive(
|
1785 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1786 + | )]
|
1787 + | pub struct ConB {
|
1788 + | #[allow(missing_docs)] // documentation missing in model
|
1789 + | pub nice: ::std::string::String,
|
1790 + | #[allow(missing_docs)] // documentation missing in model
|
1791 + | pub int: i32,
|
1792 + | #[allow(missing_docs)] // documentation missing in model
|
1793 + | pub opt_nice: ::std::option::Option<::std::string::String>,
|
1794 + | #[allow(missing_docs)] // documentation missing in model
|
1795 + | pub opt_int: ::std::option::Option<i32>,
|
1796 + | }
|
1797 + | impl ConB {
|
1798 + | #[allow(missing_docs)] // documentation missing in model
|
1799 + | pub fn nice(&self) -> &str {
|
1800 + | use std::ops::Deref;
|
1801 + | self.nice.deref()
|
2218 1802 | }
|
2219 - | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
2220 - | pub fn is_enum_string(&self) -> bool {
|
2221 - | self.as_enum_string().is_ok()
|
1803 + | #[allow(missing_docs)] // documentation missing in model
|
1804 + | pub fn int(&self) -> i32 {
|
1805 + | self.int
|
2222 1806 | }
|
2223 - | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`LengthString`](crate::model::LengthString).
|
2224 - | /// Returns `Err(&Self)` if it can't be converted.
|
2225 - | pub fn as_length_string(&self) -> ::std::result::Result<&crate::model::LengthString, &Self> {
|
2226 - | if let ConstrainedUnion::LengthString(val) = &self {
|
2227 - | ::std::result::Result::Ok(val)
|
2228 - | } else {
|
2229 - | ::std::result::Result::Err(self)
|
1807 + | #[allow(missing_docs)] // documentation missing in model
|
1808 + | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
1809 + | self.opt_nice.as_deref()
|
2230 1810 | }
|
1811 + | #[allow(missing_docs)] // documentation missing in model
|
1812 + | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
1813 + | self.opt_int
|
2231 1814 | }
|
2232 - | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
2233 - | pub fn is_length_string(&self) -> bool {
|
2234 - | self.as_length_string().is_ok()
|
1815 + | }
|
1816 + | impl ConB {
|
1817 + | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
1818 + | pub fn builder() -> crate::model::con_b::Builder {
|
1819 + | crate::model::con_b::Builder::default()
|
2235 1820 | }
|
2236 1821 | }
|
1822 + | impl crate::constrained::Constrained for crate::model::ConB {
|
1823 + | type Unconstrained = crate::model::con_b::Builder;
|
1824 + | }
|
2237 1825 |
|
2238 1826 | #[allow(missing_docs)] // documentation missing in model
|
2239 1827 | ///
|
2240 1828 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2241 - | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
1829 + | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
2242 1830 | ///
|
2243 1831 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2244 1832 | ///
|
2245 1833 | #[derive(
|
2246 1834 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2247 1835 | )]
|
2248 - | pub struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
2249 - | impl ConBSet {
|
2250 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
2251 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::ConBSetInner> {
|
1836 + | pub struct MinLengthString(pub(crate) ::std::string::String);
|
1837 + | impl MinLengthString {
|
1838 + | /// Extracts a string slice containing the entire underlying `String`.
|
1839 + | pub fn as_str(&self) -> &str {
|
2252 1840 | &self.0
|
2253 1841 | }
|
2254 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
2255 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
2256 - | self.0
|
2257 - | }
|
2258 1842 |
|
2259 - | fn check_unique_items(
|
2260 - | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2261 - | ) -> ::std::result::Result<
|
2262 - | ::std::vec::Vec<crate::model::ConBSetInner>,
|
2263 - | crate::model::con_b_set::ConstraintViolation,
|
2264 - | > {
|
2265 - | let mut seen = ::std::collections::HashMap::new();
|
2266 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2267 - | for (idx, item) in items.iter().enumerate() {
|
2268 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2269 - | duplicate_indices.push(prev_idx);
|
2270 - | }
|
1843 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1844 + | pub fn inner(&self) -> &::std::string::String {
|
1845 + | &self.0
|
2271 1846 | }
|
2272 1847 |
|
2273 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2274 - | for idx in &duplicate_indices {
|
2275 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2276 - | last_duplicate_indices.push(prev_idx);
|
2277 - | }
|
1848 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1849 + | pub fn into_inner(self) -> ::std::string::String {
|
1850 + | self.0
|
2278 1851 | }
|
2279 - | duplicate_indices.extend(last_duplicate_indices);
|
1852 + | }
|
1853 + | impl MinLengthString {
|
1854 + | fn check_length(
|
1855 + | string: &str,
|
1856 + | ) -> ::std::result::Result<(), crate::model::min_length_string::ConstraintViolation> {
|
1857 + | let length = string.chars().count();
|
2280 1858 |
|
2281 - | if !duplicate_indices.is_empty() {
|
2282 - | debug_assert!(duplicate_indices.len() >= 2);
|
2283 - | Err(crate::model::con_b_set::ConstraintViolation::UniqueItems {
|
2284 - | duplicate_indices,
|
2285 - | original: items,
|
2286 - | })
|
1859 + | if 2 <= length {
|
1860 + | Ok(())
|
2287 1861 | } else {
|
2288 - | Ok(items)
|
1862 + | Err(crate::model::min_length_string::ConstraintViolation::Length(length))
|
2289 1863 | }
|
2290 1864 | }
|
2291 1865 | }
|
2292 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
2293 - | type Error = crate::model::con_b_set::ConstraintViolation;
|
1866 + | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
1867 + | type Error = crate::model::min_length_string::ConstraintViolation;
|
2294 1868 |
|
2295 - | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
2296 - | fn try_from(
|
2297 - | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2298 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2299 - | let value = Self::check_unique_items(value)?;
|
1869 + | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1870 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1871 + | Self::check_length(&value)?;
|
2300 1872 |
|
2301 1873 | Ok(Self(value))
|
2302 1874 | }
|
2303 1875 | }
|
1876 + | impl crate::constrained::Constrained for MinLengthString {
|
1877 + | type Unconstrained = ::std::string::String;
|
1878 + | }
|
2304 1879 |
|
2305 - | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
2306 - | fn from(value: ConBSet) -> Self {
|
2307 - | value.into_inner()
|
1880 + | impl ::std::convert::From<::std::string::String>
|
1881 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
1882 + | {
|
1883 + | fn from(value: ::std::string::String) -> Self {
|
1884 + | Self::Unconstrained(value)
|
2308 1885 | }
|
2309 1886 | }
|
2310 - | impl crate::constrained::Constrained for ConBSet {
|
2311 - | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
1887 + |
|
1888 + | impl ::std::fmt::Display for MinLengthString {
|
1889 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1890 + | self.0.fmt(f)
|
1891 + | }
|
1892 + | }
|
1893 + |
|
1894 + | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
1895 + | fn from(value: MinLengthString) -> Self {
|
1896 + | value.into_inner()
|
1897 + | }
|
2312 1898 | }
|
2313 1899 |
|
2314 1900 | #[allow(missing_docs)] // documentation missing in model
|
2315 1901 | ///
|
2316 1902 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2317 - | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
1903 + | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
2318 1904 | ///
|
2319 1905 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2320 1906 | ///
|
2321 1907 | #[derive(
|
2322 1908 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2323 1909 | )]
|
2324 - | pub struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2325 - | impl ConBSetInner {
|
2326 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
2327 - | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
1910 + | pub struct MaxLengthString(pub(crate) ::std::string::String);
|
1911 + | impl MaxLengthString {
|
1912 + | /// Extracts a string slice containing the entire underlying `String`.
|
1913 + | pub fn as_str(&self) -> &str {
|
2328 1914 | &self.0
|
2329 1915 | }
|
2330 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2331 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2332 - | self.0
|
2333 - | }
|
2334 1916 |
|
2335 - | fn check_unique_items(
|
2336 - | items: ::std::vec::Vec<::std::string::String>,
|
2337 - | ) -> ::std::result::Result<
|
2338 - | ::std::vec::Vec<::std::string::String>,
|
2339 - | crate::model::con_b_set_inner::ConstraintViolation,
|
2340 - | > {
|
2341 - | let mut seen = ::std::collections::HashMap::new();
|
2342 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2343 - | for (idx, item) in items.iter().enumerate() {
|
2344 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2345 - | duplicate_indices.push(prev_idx);
|
2346 - | }
|
1917 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1918 + | pub fn inner(&self) -> &::std::string::String {
|
1919 + | &self.0
|
2347 1920 | }
|
2348 1921 |
|
2349 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2350 - | for idx in &duplicate_indices {
|
2351 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2352 - | last_duplicate_indices.push(prev_idx);
|
2353 - | }
|
1922 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1923 + | pub fn into_inner(self) -> ::std::string::String {
|
1924 + | self.0
|
2354 1925 | }
|
2355 - | duplicate_indices.extend(last_duplicate_indices);
|
1926 + | }
|
1927 + | impl MaxLengthString {
|
1928 + | fn check_length(
|
1929 + | string: &str,
|
1930 + | ) -> ::std::result::Result<(), crate::model::max_length_string::ConstraintViolation> {
|
1931 + | let length = string.chars().count();
|
2356 1932 |
|
2357 - | if !duplicate_indices.is_empty() {
|
2358 - | debug_assert!(duplicate_indices.len() >= 2);
|
2359 - | Err(
|
2360 - | crate::model::con_b_set_inner::ConstraintViolation::UniqueItems {
|
2361 - | duplicate_indices,
|
2362 - | original: items,
|
2363 - | },
|
2364 - | )
|
1933 + | if length <= 69 {
|
1934 + | Ok(())
|
2365 1935 | } else {
|
2366 - | Ok(items)
|
1936 + | Err(crate::model::max_length_string::ConstraintViolation::Length(length))
|
2367 1937 | }
|
2368 1938 | }
|
2369 1939 | }
|
2370 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
2371 - | type Error = crate::model::con_b_set_inner::ConstraintViolation;
|
1940 + | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
1941 + | type Error = crate::model::max_length_string::ConstraintViolation;
|
2372 1942 |
|
2373 - | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2374 - | fn try_from(
|
2375 - | value: ::std::vec::Vec<::std::string::String>,
|
2376 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2377 - | let value = Self::check_unique_items(value)?;
|
1943 + | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1944 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1945 + | Self::check_length(&value)?;
|
2378 1946 |
|
2379 1947 | Ok(Self(value))
|
2380 1948 | }
|
2381 1949 | }
|
1950 + | impl crate::constrained::Constrained for MaxLengthString {
|
1951 + | type Unconstrained = ::std::string::String;
|
1952 + | }
|
2382 1953 |
|
2383 - | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
2384 - | fn from(value: ConBSetInner) -> Self {
|
2385 - | value.into_inner()
|
1954 + | impl ::std::convert::From<::std::string::String>
|
1955 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
1956 + | {
|
1957 + | fn from(value: ::std::string::String) -> Self {
|
1958 + | Self::Unconstrained(value)
|
2386 1959 | }
|
2387 1960 | }
|
2388 - | impl crate::constrained::Constrained for ConBSetInner {
|
2389 - | type Unconstrained =
|
2390 - | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
2391 - | }
|
2392 1961 |
|
2393 - | #[allow(missing_docs)] // documentation missing in model
|
2394 - | #[derive(
|
2395 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2396 - | )]
|
2397 - | pub struct ConB {
|
2398 - | #[allow(missing_docs)] // documentation missing in model
|
2399 - | pub nice: ::std::string::String,
|
2400 - | #[allow(missing_docs)] // documentation missing in model
|
2401 - | pub int: i32,
|
2402 - | #[allow(missing_docs)] // documentation missing in model
|
2403 - | pub opt_nice: ::std::option::Option<::std::string::String>,
|
2404 - | #[allow(missing_docs)] // documentation missing in model
|
2405 - | pub opt_int: ::std::option::Option<i32>,
|
2406 - | }
|
2407 - | impl ConB {
|
2408 - | #[allow(missing_docs)] // documentation missing in model
|
2409 - | pub fn nice(&self) -> &str {
|
2410 - | use std::ops::Deref;
|
2411 - | self.nice.deref()
|
2412 - | }
|
2413 - | #[allow(missing_docs)] // documentation missing in model
|
2414 - | pub fn int(&self) -> i32 {
|
2415 - | self.int
|
2416 - | }
|
2417 - | #[allow(missing_docs)] // documentation missing in model
|
2418 - | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
2419 - | self.opt_nice.as_deref()
|
2420 - | }
|
2421 - | #[allow(missing_docs)] // documentation missing in model
|
2422 - | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
2423 - | self.opt_int
|
1962 + | impl ::std::fmt::Display for MaxLengthString {
|
1963 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1964 + | self.0.fmt(f)
|
2424 1965 | }
|
2425 1966 | }
|
2426 - | impl ConB {
|
2427 - | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
2428 - | pub fn builder() -> crate::model::con_b::Builder {
|
2429 - | crate::model::con_b::Builder::default()
|
1967 + |
|
1968 + | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
1969 + | fn from(value: MaxLengthString) -> Self {
|
1970 + | value.into_inner()
|
2430 1971 | }
|
2431 1972 | }
|
2432 - | impl crate::constrained::Constrained for crate::model::ConB {
|
2433 - | type Unconstrained = crate::model::con_b::Builder;
|
2434 - | }
|
2435 1973 |
|
2436 1974 | #[allow(missing_docs)] // documentation missing in model
|
2437 1975 | ///
|
2438 1976 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2439 - | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
1977 + | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
2440 1978 | ///
|
2441 1979 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2442 1980 | ///
|
2443 1981 | #[derive(
|
2444 1982 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2445 1983 | )]
|
2446 - | pub struct SparseLengthList(
|
2447 - | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2448 - | );
|
2449 - | impl SparseLengthList {
|
2450 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
2451 - | pub fn inner(&self) -> &::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
1984 + | pub struct FixedLengthString(pub(crate) ::std::string::String);
|
1985 + | impl FixedLengthString {
|
1986 + | /// Extracts a string slice containing the entire underlying `String`.
|
1987 + | pub fn as_str(&self) -> &str {
|
2452 1988 | &self.0
|
2453 1989 | }
|
2454 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
2455 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
2456 - | self.0
|
1990 + |
|
1991 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1992 + | pub fn inner(&self) -> &::std::string::String {
|
1993 + | &self.0
|
2457 1994 | }
|
2458 1995 |
|
1996 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1997 + | pub fn into_inner(self) -> ::std::string::String {
|
1998 + | self.0
|
1999 + | }
|
2000 + | }
|
2001 + | impl FixedLengthString {
|
2459 2002 | fn check_length(
|
2460 - | length: usize,
|
2461 - | ) -> ::std::result::Result<(), crate::model::sparse_length_list::ConstraintViolation> {
|
2462 - | if 69 <= length {
|
2003 + | string: &str,
|
2004 + | ) -> ::std::result::Result<(), crate::model::fixed_length_string::ConstraintViolation> {
|
2005 + | let length = string.chars().count();
|
2006 + |
|
2007 + | if (69..=69).contains(&length) {
|
2463 2008 | Ok(())
|
2464 2009 | } else {
|
2465 - | Err(crate::model::sparse_length_list::ConstraintViolation::Length(length))
|
2010 + | Err(crate::model::fixed_length_string::ConstraintViolation::Length(length))
|
2466 2011 | }
|
2467 2012 | }
|
2468 2013 | }
|
2469 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
2470 - | for SparseLengthList
|
2471 - | {
|
2472 - | type Error = crate::model::sparse_length_list::ConstraintViolation;
|
2014 + | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
2015 + | type Error = crate::model::fixed_length_string::ConstraintViolation;
|
2473 2016 |
|
2474 - | /// 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.
|
2475 - | fn try_from(
|
2476 - | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2477 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2478 - | Self::check_length(value.len())?;
|
2017 + | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2018 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2019 + | Self::check_length(&value)?;
|
2479 2020 |
|
2480 2021 | Ok(Self(value))
|
2481 2022 | }
|
2482 2023 | }
|
2024 + | impl crate::constrained::Constrained for FixedLengthString {
|
2025 + | type Unconstrained = ::std::string::String;
|
2026 + | }
|
2483 2027 |
|
2484 - | impl ::std::convert::From<SparseLengthList>
|
2485 - | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
2028 + | impl ::std::convert::From<::std::string::String>
|
2029 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
2486 2030 | {
|
2487 - | fn from(value: SparseLengthList) -> Self {
|
2488 - | value.into_inner()
|
2031 + | fn from(value: ::std::string::String) -> Self {
|
2032 + | Self::Unconstrained(value)
|
2489 2033 | }
|
2490 2034 | }
|
2491 - | impl crate::constrained::Constrained for SparseLengthList {
|
2492 - | type Unconstrained =
|
2493 - | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
2035 + |
|
2036 + | impl ::std::fmt::Display for FixedLengthString {
|
2037 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2038 + | self.0.fmt(f)
|
2039 + | }
|
2040 + | }
|
2041 + |
|
2042 + | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
2043 + | fn from(value: FixedLengthString) -> Self {
|
2044 + | value.into_inner()
|
2045 + | }
|
2494 2046 | }
|
2495 2047 |
|
2496 2048 | #[allow(missing_docs)] // documentation missing in model
|
2497 2049 | ///
|
2498 2050 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2499 - | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
2051 + | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2500 2052 | ///
|
2501 2053 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2502 2054 | ///
|
2503 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2504 - | pub struct SparseLengthMap(
|
2505 - | pub(crate) ::std::collections::HashMap<
|
2506 - | ::std::string::String,
|
2507 - | ::std::option::Option<::std::string::String>,
|
2508 - | >,
|
2509 - | );
|
2510 - | impl SparseLengthMap {
|
2511 - | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
2512 - | pub fn inner(
|
2513 - | &self,
|
2514 - | ) -> &::std::collections::HashMap<
|
2515 - | ::std::string::String,
|
2516 - | ::std::option::Option<::std::string::String>,
|
2517 - | > {
|
2518 - | &self.0
|
2519 - | }
|
2520 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
2521 - | pub fn into_inner(
|
2522 - | self,
|
2523 - | ) -> ::std::collections::HashMap<
|
2524 - | ::std::string::String,
|
2525 - | ::std::option::Option<::std::string::String>,
|
2526 - | > {
|
2055 + | #[derive(
|
2056 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2057 + | )]
|
2058 + | pub struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2059 + | impl LengthBlob {
|
2060 + | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
2061 + | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
2062 + | &self.0
|
2063 + | }
|
2064 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2065 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2527 2066 | self.0
|
2528 2067 | }
|
2529 2068 | }
|
2530 - | impl
|
2531 - | ::std::convert::TryFrom<
|
2532 - | ::std::collections::HashMap<
|
2533 - | ::std::string::String,
|
2534 - | ::std::option::Option<::std::string::String>,
|
2535 - | >,
|
2536 - | > for SparseLengthMap
|
2537 - | {
|
2538 - | type Error = crate::model::sparse_length_map::ConstraintViolation;
|
2069 + | impl LengthBlob {
|
2070 + | fn check_length(
|
2071 + | blob: &::aws_smithy_types::Blob,
|
2072 + | ) -> ::std::result::Result<(), crate::model::length_blob::ConstraintViolation> {
|
2073 + | let length = blob.as_ref().len();
|
2539 2074 |
|
2540 - | /// 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.
|
2541 - | fn try_from(
|
2542 - | value: ::std::collections::HashMap<
|
2543 - | ::std::string::String,
|
2544 - | ::std::option::Option<::std::string::String>,
|
2545 - | >,
|
2546 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2547 - | let length = value.len();
|
2548 - | if 69 <= length {
|
2549 - | Ok(Self(value))
|
2075 + | if (2..=70).contains(&length) {
|
2076 + | Ok(())
|
2550 2077 | } else {
|
2551 - | Err(crate::model::sparse_length_map::ConstraintViolation::Length(length))
|
2078 + | Err(crate::model::length_blob::ConstraintViolation::Length(
|
2079 + | length,
|
2080 + | ))
|
2552 2081 | }
|
2553 2082 | }
|
2554 2083 | }
|
2084 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2085 + | type Error = crate::model::length_blob::ConstraintViolation;
|
2555 2086 |
|
2556 - | impl ::std::convert::From<SparseLengthMap>
|
2557 - | for ::std::collections::HashMap<
|
2558 - | ::std::string::String,
|
2559 - | ::std::option::Option<::std::string::String>,
|
2560 - | >
|
2087 + | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2088 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2089 + | Self::check_length(&value)?;
|
2090 + |
|
2091 + | Ok(Self(value))
|
2092 + | }
|
2093 + | }
|
2094 + | impl crate::constrained::Constrained for LengthBlob {
|
2095 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2096 + | }
|
2097 + |
|
2098 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2099 + | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2561 2100 | {
|
2562 - | fn from(value: SparseLengthMap) -> Self {
|
2563 - | value.into_inner()
|
2101 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2102 + | Self::Unconstrained(value)
|
2564 2103 | }
|
2565 2104 | }
|
2566 - | impl crate::constrained::Constrained for SparseLengthMap {
|
2567 - | type Unconstrained =
|
2568 - | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
2105 + |
|
2106 + | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2107 + | fn from(value: LengthBlob) -> Self {
|
2108 + | value.into_inner()
|
2109 + | }
|
2569 2110 | }
|
2570 2111 |
|
2571 2112 | #[allow(missing_docs)] // documentation missing in model
|
2572 2113 | ///
|
2573 2114 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2574 - | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
2115 + | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
2575 2116 | ///
|
2576 2117 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2577 2118 | ///
|
2578 2119 | #[derive(
|
2579 2120 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2580 2121 | )]
|
2581 - | pub struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2582 - | impl UniqueItemsList {
|
2583 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
2584 - | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
2122 + | pub struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2123 + | impl MinLengthBlob {
|
2124 + | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
2125 + | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
2585 2126 | &self.0
|
2586 2127 | }
|
2587 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2588 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2128 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2129 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2589 2130 | self.0
|
2590 2131 | }
|
2132 + | }
|
2133 + | impl MinLengthBlob {
|
2134 + | fn check_length(
|
2135 + | blob: &::aws_smithy_types::Blob,
|
2136 + | ) -> ::std::result::Result<(), crate::model::min_length_blob::ConstraintViolation> {
|
2137 + | let length = blob.as_ref().len();
|
2591 2138 |
|
2592 - | fn check_unique_items(
|
2593 - | items: ::std::vec::Vec<::std::string::String>,
|
2594 - | ) -> ::std::result::Result<
|
2595 - | ::std::vec::Vec<::std::string::String>,
|
2596 - | crate::model::unique_items_list::ConstraintViolation,
|
2597 - | > {
|
2598 - | let mut seen = ::std::collections::HashMap::new();
|
2599 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2600 - | for (idx, item) in items.iter().enumerate() {
|
2601 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2602 - | duplicate_indices.push(prev_idx);
|
2603 - | }
|
2604 - | }
|
2605 - |
|
2606 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2607 - | for idx in &duplicate_indices {
|
2608 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2609 - | last_duplicate_indices.push(prev_idx);
|
2610 - | }
|
2611 - | }
|
2612 - | duplicate_indices.extend(last_duplicate_indices);
|
2613 - |
|
2614 - | if !duplicate_indices.is_empty() {
|
2615 - | debug_assert!(duplicate_indices.len() >= 2);
|
2616 - | Err(
|
2617 - | crate::model::unique_items_list::ConstraintViolation::UniqueItems {
|
2618 - | duplicate_indices,
|
2619 - | original: items,
|
2620 - | },
|
2621 - | )
|
2139 + | if 2 <= length {
|
2140 + | Ok(())
|
2622 2141 | } else {
|
2623 - | Ok(items)
|
2142 + | Err(crate::model::min_length_blob::ConstraintViolation::Length(
|
2143 + | length,
|
2144 + | ))
|
2624 2145 | }
|
2625 2146 | }
|
2626 2147 | }
|
2627 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
2628 - | type Error = crate::model::unique_items_list::ConstraintViolation;
|
2148 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
2149 + | type Error = crate::model::min_length_blob::ConstraintViolation;
|
2629 2150 |
|
2630 - | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2631 - | fn try_from(
|
2632 - | value: ::std::vec::Vec<::std::string::String>,
|
2633 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2634 - | let value = Self::check_unique_items(value)?;
|
2151 + | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2152 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2153 + | Self::check_length(&value)?;
|
2635 2154 |
|
2636 2155 | Ok(Self(value))
|
2637 2156 | }
|
2638 2157 | }
|
2158 + | impl crate::constrained::Constrained for MinLengthBlob {
|
2159 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2160 + | }
|
2639 2161 |
|
2640 - | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
2641 - | fn from(value: UniqueItemsList) -> Self {
|
2642 - | value.into_inner()
|
2162 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2163 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
2164 + | {
|
2165 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2166 + | Self::Unconstrained(value)
|
2643 2167 | }
|
2644 2168 | }
|
2645 - | impl crate::constrained::Constrained for UniqueItemsList {
|
2646 - | type Unconstrained =
|
2647 - | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
2169 + |
|
2170 + | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
2171 + | fn from(value: MinLengthBlob) -> Self {
|
2172 + | value.into_inner()
|
2173 + | }
|
2648 2174 | }
|
2649 2175 |
|
2650 2176 | #[allow(missing_docs)] // documentation missing in model
|
2651 2177 | ///
|
2652 2178 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2653 - | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
2179 + | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
2654 2180 | ///
|
2655 2181 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2656 2182 | ///
|
2657 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2658 - | pub struct LengthMap(
|
2659 - | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2660 - | );
|
2661 - | impl LengthMap {
|
2662 - | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
2663 - | pub fn inner(
|
2664 - | &self,
|
2665 - | ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
2183 + | #[derive(
|
2184 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2185 + | )]
|
2186 + | pub struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2187 + | impl MaxLengthBlob {
|
2188 + | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
2189 + | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
2666 2190 | &self.0
|
2667 2191 | }
|
2668 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
2669 - | pub fn into_inner(
|
2670 - | self,
|
2671 - | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
2192 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2193 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2672 2194 | self.0
|
2673 2195 | }
|
2674 2196 | }
|
2675 - | impl
|
2676 - | ::std::convert::TryFrom<
|
2677 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2678 - | > for LengthMap
|
2679 - | {
|
2680 - | type Error = crate::model::length_map::ConstraintViolation;
|
2197 + | impl MaxLengthBlob {
|
2198 + | fn check_length(
|
2199 + | blob: &::aws_smithy_types::Blob,
|
2200 + | ) -> ::std::result::Result<(), crate::model::max_length_blob::ConstraintViolation> {
|
2201 + | let length = blob.as_ref().len();
|
2681 2202 |
|
2682 - | /// 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.
|
2683 - | fn try_from(
|
2684 - | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2685 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2686 - | let length = value.len();
|
2687 - | if (1..=69).contains(&length) {
|
2688 - | Ok(Self(value))
|
2203 + | if length <= 70 {
|
2204 + | Ok(())
|
2689 2205 | } else {
|
2690 - | Err(crate::model::length_map::ConstraintViolation::Length(
|
2206 + | Err(crate::model::max_length_blob::ConstraintViolation::Length(
|
2691 2207 | length,
|
2692 2208 | ))
|
2693 2209 | }
|
2694 2210 | }
|
2695 2211 | }
|
2212 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
2213 + | type Error = crate::model::max_length_blob::ConstraintViolation;
|
2696 2214 |
|
2697 - | impl ::std::convert::From<LengthMap>
|
2698 - | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
2215 + | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2216 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2217 + | Self::check_length(&value)?;
|
2218 + |
|
2219 + | Ok(Self(value))
|
2220 + | }
|
2221 + | }
|
2222 + | impl crate::constrained::Constrained for MaxLengthBlob {
|
2223 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2224 + | }
|
2225 + |
|
2226 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2227 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
2699 2228 | {
|
2700 - | fn from(value: LengthMap) -> Self {
|
2701 - | value.into_inner()
|
2229 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2230 + | Self::Unconstrained(value)
|
2702 2231 | }
|
2703 2232 | }
|
2704 - | impl crate::constrained::Constrained for LengthMap {
|
2705 - | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
2233 + |
|
2234 + | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
2235 + | fn from(value: MaxLengthBlob) -> Self {
|
2236 + | value.into_inner()
|
2237 + | }
|
2706 2238 | }
|
2707 2239 |
|
2708 2240 | #[allow(missing_docs)] // documentation missing in model
|
2709 2241 | ///
|
2710 2242 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2711 - | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
2243 + | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
2712 2244 | ///
|
2713 2245 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2714 2246 | ///
|
2715 2247 | #[derive(
|
2716 2248 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2717 2249 | )]
|
2718 - | pub struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
2719 - | impl SensitiveLengthList {
|
2720 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
2721 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::SensitiveStructure> {
|
2250 + | pub struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2251 + | impl FixedLengthBlob {
|
2252 + | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
2253 + | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
2722 2254 | &self.0
|
2723 2255 | }
|
2724 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
2725 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
2256 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2257 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2726 2258 | self.0
|
2727 2259 | }
|
2728 - |
|
2260 + | }
|
2261 + | impl FixedLengthBlob {
|
2729 2262 | fn check_length(
|
2730 - | length: usize,
|
2731 - | ) -> ::std::result::Result<(), crate::model::sensitive_length_list::ConstraintViolation> {
|
2732 - | if length <= 69 {
|
2263 + | blob: &::aws_smithy_types::Blob,
|
2264 + | ) -> ::std::result::Result<(), crate::model::fixed_length_blob::ConstraintViolation> {
|
2265 + | let length = blob.as_ref().len();
|
2266 + |
|
2267 + | if (70..=70).contains(&length) {
|
2733 2268 | Ok(())
|
2734 2269 | } else {
|
2735 - | Err(crate::model::sensitive_length_list::ConstraintViolation::Length(length))
|
2270 + | Err(crate::model::fixed_length_blob::ConstraintViolation::Length(length))
|
2736 2271 | }
|
2737 2272 | }
|
2738 2273 | }
|
2739 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
2740 - | for SensitiveLengthList
|
2741 - | {
|
2742 - | type Error = crate::model::sensitive_length_list::ConstraintViolation;
|
2274 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
2275 + | type Error = crate::model::fixed_length_blob::ConstraintViolation;
|
2743 2276 |
|
2744 - | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
2745 - | fn try_from(
|
2746 - | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
2747 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2748 - | Self::check_length(value.len())?;
|
2277 + | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2278 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2279 + | Self::check_length(&value)?;
|
2749 2280 |
|
2750 2281 | Ok(Self(value))
|
2751 2282 | }
|
2752 2283 | }
|
2284 + | impl crate::constrained::Constrained for FixedLengthBlob {
|
2285 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2286 + | }
|
2753 2287 |
|
2754 - | impl ::std::convert::From<SensitiveLengthList>
|
2755 - | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
2288 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2289 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
2756 2290 | {
|
2757 - | fn from(value: SensitiveLengthList) -> Self {
|
2758 - | value.into_inner()
|
2291 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2292 + | Self::Unconstrained(value)
|
2759 2293 | }
|
2760 2294 | }
|
2761 - | impl crate::constrained::Constrained for SensitiveLengthList {
|
2762 - | type Unconstrained =
|
2763 - | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
2764 - | }
|
2765 2295 |
|
2766 - | #[allow(missing_docs)] // documentation missing in model
|
2767 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
2768 - | pub struct SensitiveStructure {}
|
2769 - | impl ::std::fmt::Debug for SensitiveStructure {
|
2770 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2771 - | let mut formatter = f.debug_struct("SensitiveStructure");
|
2772 - | formatter.finish()
|
2773 - | }
|
2774 - | }
|
2775 - | impl SensitiveStructure {
|
2776 - | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
2777 - | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
2778 - | crate::model::sensitive_structure::Builder::default()
|
2296 + | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
2297 + | fn from(value: FixedLengthBlob) -> Self {
|
2298 + | value.into_inner()
|
2779 2299 | }
|
2780 2300 | }
|
2781 - | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
2782 - | type Unconstrained = crate::model::sensitive_structure::Builder;
|
2783 - | }
|
2784 2301 |
|
2785 2302 | #[allow(missing_docs)] // documentation missing in model
|
2786 2303 | ///
|
2787 2304 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2788 - | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
2305 + | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
2789 2306 | ///
|
2790 2307 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2791 2308 | ///
|
2792 2309 | #[derive(
|
2793 2310 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2794 2311 | )]
|
2795 - | pub struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2796 - | impl LengthList {
|
2797 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
2798 - | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
2312 + | pub struct MinRangeInteger(pub(crate) i32);
|
2313 + | impl MinRangeInteger {
|
2314 + | /// Returns an immutable reference to the underlying [`i32`].
|
2315 + | pub fn inner(&self) -> &i32 {
|
2799 2316 | &self.0
|
2800 2317 | }
|
2801 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2802 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2318 + |
|
2319 + | /// Consumes the value, returning the underlying [`i32`].
|
2320 + | pub fn into_inner(self) -> i32 {
|
2803 2321 | self.0
|
2804 2322 | }
|
2323 + | }
|
2805 2324 |
|
2806 - | fn check_length(
|
2807 - | length: usize,
|
2808 - | ) -> ::std::result::Result<(), crate::model::length_list::ConstraintViolation> {
|
2809 - | if length <= 69 {
|
2325 + | impl crate::constrained::Constrained for MinRangeInteger {
|
2326 + | type Unconstrained = i32;
|
2327 + | }
|
2328 + |
|
2329 + | impl ::std::convert::From<i32>
|
2330 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
2331 + | {
|
2332 + | fn from(value: i32) -> Self {
|
2333 + | Self::Unconstrained(value)
|
2334 + | }
|
2335 + | }
|
2336 + |
|
2337 + | impl ::std::fmt::Display for MinRangeInteger {
|
2338 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2339 + | self.0.fmt(f)
|
2340 + | }
|
2341 + | }
|
2342 + |
|
2343 + | impl ::std::convert::From<MinRangeInteger> for i32 {
|
2344 + | fn from(value: MinRangeInteger) -> Self {
|
2345 + | value.into_inner()
|
2346 + | }
|
2347 + | }
|
2348 + | impl MinRangeInteger {
|
2349 + | fn check_range(
|
2350 + | value: i32,
|
2351 + | ) -> ::std::result::Result<(), crate::model::min_range_integer::ConstraintViolation> {
|
2352 + | if -10 <= value {
|
2810 2353 | Ok(())
|
2811 2354 | } else {
|
2812 - | Err(crate::model::length_list::ConstraintViolation::Length(
|
2813 - | length,
|
2355 + | Err(crate::model::min_range_integer::ConstraintViolation::Range(
|
2356 + | value,
|
2814 2357 | ))
|
2815 2358 | }
|
2816 2359 | }
|
2817 2360 | }
|
2818 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
2819 - | type Error = crate::model::length_list::ConstraintViolation;
|
2361 + | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
2362 + | type Error = crate::model::min_range_integer::ConstraintViolation;
|
2820 2363 |
|
2821 - | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2822 - | fn try_from(
|
2823 - | value: ::std::vec::Vec<::std::string::String>,
|
2824 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2825 - | Self::check_length(value.len())?;
|
2364 + | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2365 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2366 + | Self::check_range(value)?;
|
2826 2367 |
|
2827 2368 | Ok(Self(value))
|
2828 2369 | }
|
2829 2370 | }
|
2830 2371 |
|
2831 - | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
2832 - | fn from(value: LengthList) -> Self {
|
2833 - | value.into_inner()
|
2834 - | }
|
2835 - | }
|
2836 - | impl crate::constrained::Constrained for LengthList {
|
2837 - | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
2838 - | }
|
2839 - |
|
2840 2372 | #[allow(missing_docs)] // documentation missing in model
|
2841 2373 | ///
|
2842 2374 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2843 - | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
2375 + | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
2844 2376 | ///
|
2845 2377 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2846 2378 | ///
|
2847 2379 | #[derive(
|
2848 2380 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2849 2381 | )]
|
2850 - | pub struct FixedValueByte(pub(crate) i8);
|
2851 - | impl FixedValueByte {
|
2852 - | /// Returns an immutable reference to the underlying [`i8`].
|
2853 - | pub fn inner(&self) -> &i8 {
|
2382 + | pub struct MaxRangeInteger(pub(crate) i32);
|
2383 + | impl MaxRangeInteger {
|
2384 + | /// Returns an immutable reference to the underlying [`i32`].
|
2385 + | pub fn inner(&self) -> &i32 {
|
2854 2386 | &self.0
|
2855 2387 | }
|
2856 2388 |
|
2857 - | /// Consumes the value, returning the underlying [`i8`].
|
2858 - | pub fn into_inner(self) -> i8 {
|
2389 + | /// Consumes the value, returning the underlying [`i32`].
|
2390 + | pub fn into_inner(self) -> i32 {
|
2859 2391 | self.0
|
2860 2392 | }
|
2861 2393 | }
|
2862 2394 |
|
2863 - | impl crate::constrained::Constrained for FixedValueByte {
|
2864 - | type Unconstrained = i8;
|
2395 + | impl crate::constrained::Constrained for MaxRangeInteger {
|
2396 + | type Unconstrained = i32;
|
2865 2397 | }
|
2866 2398 |
|
2867 - | impl ::std::convert::From<i8>
|
2868 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
2399 + | impl ::std::convert::From<i32>
|
2400 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
2869 2401 | {
|
2870 - | fn from(value: i8) -> Self {
|
2402 + | fn from(value: i32) -> Self {
|
2871 2403 | Self::Unconstrained(value)
|
2872 2404 | }
|
2873 2405 | }
|
2874 2406 |
|
2875 - | impl ::std::fmt::Display for FixedValueByte {
|
2407 + | impl ::std::fmt::Display for MaxRangeInteger {
|
2876 2408 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2877 2409 | self.0.fmt(f)
|
2878 2410 | }
|
2879 2411 | }
|
2880 2412 |
|
2881 - | impl ::std::convert::From<FixedValueByte> for i8 {
|
2882 - | fn from(value: FixedValueByte) -> Self {
|
2413 + | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
2414 + | fn from(value: MaxRangeInteger) -> Self {
|
2883 2415 | value.into_inner()
|
2884 2416 | }
|
2885 2417 | }
|
2886 - | impl FixedValueByte {
|
2418 + | impl MaxRangeInteger {
|
2887 2419 | fn check_range(
|
2888 - | value: i8,
|
2889 - | ) -> ::std::result::Result<(), crate::model::fixed_value_byte::ConstraintViolation> {
|
2890 - | if (10..=10).contains(&value) {
|
2420 + | value: i32,
|
2421 + | ) -> ::std::result::Result<(), crate::model::max_range_integer::ConstraintViolation> {
|
2422 + | if value <= 69 {
|
2891 2423 | Ok(())
|
2892 2424 | } else {
|
2893 - | Err(crate::model::fixed_value_byte::ConstraintViolation::Range(
|
2425 + | Err(crate::model::max_range_integer::ConstraintViolation::Range(
|
2894 2426 | value,
|
2895 2427 | ))
|
2896 2428 | }
|
2897 2429 | }
|
2898 2430 | }
|
2899 - | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
2900 - | type Error = crate::model::fixed_value_byte::ConstraintViolation;
|
2431 + | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
2432 + | type Error = crate::model::max_range_integer::ConstraintViolation;
|
2901 2433 |
|
2902 - | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2903 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2434 + | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2435 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2904 2436 | Self::check_range(value)?;
|
2905 2437 |
|
2906 2438 | Ok(Self(value))
|
2907 2439 | }
|
2908 2440 | }
|
2909 2441 |
|
2910 2442 | #[allow(missing_docs)] // documentation missing in model
|
2911 2443 | ///
|
2912 2444 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2913 - | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
2445 + | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
2914 2446 | ///
|
2915 2447 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2916 2448 | ///
|
2917 2449 | #[derive(
|
2918 2450 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2919 2451 | )]
|
2920 - | pub struct MaxRangeByte(pub(crate) i8);
|
2921 - | impl MaxRangeByte {
|
2922 - | /// Returns an immutable reference to the underlying [`i8`].
|
2923 - | pub fn inner(&self) -> &i8 {
|
2452 + | pub struct FixedValueInteger(pub(crate) i32);
|
2453 + | impl FixedValueInteger {
|
2454 + | /// Returns an immutable reference to the underlying [`i32`].
|
2455 + | pub fn inner(&self) -> &i32 {
|
2924 2456 | &self.0
|
2925 2457 | }
|
2926 2458 |
|
2927 - | /// Consumes the value, returning the underlying [`i8`].
|
2928 - | pub fn into_inner(self) -> i8 {
|
2459 + | /// Consumes the value, returning the underlying [`i32`].
|
2460 + | pub fn into_inner(self) -> i32 {
|
2929 2461 | self.0
|
2930 2462 | }
|
2931 2463 | }
|
2932 2464 |
|
2933 - | impl crate::constrained::Constrained for MaxRangeByte {
|
2934 - | type Unconstrained = i8;
|
2465 + | impl crate::constrained::Constrained for FixedValueInteger {
|
2466 + | type Unconstrained = i32;
|
2935 2467 | }
|
2936 2468 |
|
2937 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
2938 - | fn from(value: i8) -> Self {
|
2469 + | impl ::std::convert::From<i32>
|
2470 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
2471 + | {
|
2472 + | fn from(value: i32) -> Self {
|
2939 2473 | Self::Unconstrained(value)
|
2940 2474 | }
|
2941 2475 | }
|
2942 2476 |
|
2943 - | impl ::std::fmt::Display for MaxRangeByte {
|
2477 + | impl ::std::fmt::Display for FixedValueInteger {
|
2944 2478 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2945 2479 | self.0.fmt(f)
|
2946 2480 | }
|
2947 2481 | }
|
2948 2482 |
|
2949 - | impl ::std::convert::From<MaxRangeByte> for i8 {
|
2950 - | fn from(value: MaxRangeByte) -> Self {
|
2483 + | impl ::std::convert::From<FixedValueInteger> for i32 {
|
2484 + | fn from(value: FixedValueInteger) -> Self {
|
2951 2485 | value.into_inner()
|
2952 2486 | }
|
2953 2487 | }
|
2954 - | impl MaxRangeByte {
|
2488 + | impl FixedValueInteger {
|
2955 2489 | fn check_range(
|
2956 - | value: i8,
|
2957 - | ) -> ::std::result::Result<(), crate::model::max_range_byte::ConstraintViolation> {
|
2958 - | if value <= 11 {
|
2490 + | value: i32,
|
2491 + | ) -> ::std::result::Result<(), crate::model::fixed_value_integer::ConstraintViolation> {
|
2492 + | if (69..=69).contains(&value) {
|
2959 2493 | Ok(())
|
2960 2494 | } else {
|
2961 - | Err(crate::model::max_range_byte::ConstraintViolation::Range(
|
2962 - | value,
|
2963 - | ))
|
2495 + | Err(crate::model::fixed_value_integer::ConstraintViolation::Range(value))
|
2964 2496 | }
|
2965 2497 | }
|
2966 2498 | }
|
2967 - | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
2968 - | type Error = crate::model::max_range_byte::ConstraintViolation;
|
2499 + | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
2500 + | type Error = crate::model::fixed_value_integer::ConstraintViolation;
|
2969 2501 |
|
2970 - | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2971 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2502 + | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2503 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2972 2504 | Self::check_range(value)?;
|
2973 2505 |
|
2974 2506 | Ok(Self(value))
|
2975 2507 | }
|
2976 2508 | }
|
2977 2509 |
|
2978 2510 | #[allow(missing_docs)] // documentation missing in model
|
2979 2511 | ///
|
2980 2512 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2981 - | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
2513 + | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
2982 2514 | ///
|
2983 2515 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2984 2516 | ///
|
2985 2517 | #[derive(
|
2986 2518 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2987 2519 | )]
|
2988 - | pub struct MinRangeByte(pub(crate) i8);
|
2989 - | impl MinRangeByte {
|
2990 - | /// Returns an immutable reference to the underlying [`i8`].
|
2991 - | pub fn inner(&self) -> &i8 {
|
2520 + | pub struct MinRangeShort(pub(crate) i16);
|
2521 + | impl MinRangeShort {
|
2522 + | /// Returns an immutable reference to the underlying [`i16`].
|
2523 + | pub fn inner(&self) -> &i16 {
|
2992 2524 | &self.0
|
2993 2525 | }
|
2994 2526 |
|
2995 - | /// Consumes the value, returning the underlying [`i8`].
|
2996 - | pub fn into_inner(self) -> i8 {
|
2527 + | /// Consumes the value, returning the underlying [`i16`].
|
2528 + | pub fn into_inner(self) -> i16 {
|
2997 2529 | self.0
|
2998 2530 | }
|
2999 2531 | }
|
3000 2532 |
|
3001 - | impl crate::constrained::Constrained for MinRangeByte {
|
3002 - | type Unconstrained = i8;
|
2533 + | impl crate::constrained::Constrained for MinRangeShort {
|
2534 + | type Unconstrained = i16;
|
3003 2535 | }
|
3004 2536 |
|
3005 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
3006 - | fn from(value: i8) -> Self {
|
2537 + | impl ::std::convert::From<i16>
|
2538 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
2539 + | {
|
2540 + | fn from(value: i16) -> Self {
|
3007 2541 | Self::Unconstrained(value)
|
3008 2542 | }
|
3009 2543 | }
|
3010 2544 |
|
3011 - | impl ::std::fmt::Display for MinRangeByte {
|
2545 + | impl ::std::fmt::Display for MinRangeShort {
|
3012 2546 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3013 2547 | self.0.fmt(f)
|
3014 2548 | }
|
3015 2549 | }
|
3016 2550 |
|
3017 - | impl ::std::convert::From<MinRangeByte> for i8 {
|
3018 - | fn from(value: MinRangeByte) -> Self {
|
2551 + | impl ::std::convert::From<MinRangeShort> for i16 {
|
2552 + | fn from(value: MinRangeShort) -> Self {
|
3019 2553 | value.into_inner()
|
3020 2554 | }
|
3021 2555 | }
|
3022 - | impl MinRangeByte {
|
2556 + | impl MinRangeShort {
|
3023 2557 | fn check_range(
|
3024 - | value: i8,
|
3025 - | ) -> ::std::result::Result<(), crate::model::min_range_byte::ConstraintViolation> {
|
2558 + | value: i16,
|
2559 + | ) -> ::std::result::Result<(), crate::model::min_range_short::ConstraintViolation> {
|
3026 2560 | if -10 <= value {
|
3027 2561 | Ok(())
|
3028 2562 | } else {
|
3029 - | Err(crate::model::min_range_byte::ConstraintViolation::Range(
|
2563 + | Err(crate::model::min_range_short::ConstraintViolation::Range(
|
3030 2564 | value,
|
3031 2565 | ))
|
3032 2566 | }
|
3033 2567 | }
|
3034 2568 | }
|
3035 - | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3036 - | type Error = crate::model::min_range_byte::ConstraintViolation;
|
2569 + | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
2570 + | type Error = crate::model::min_range_short::ConstraintViolation;
|
3037 2571 |
|
3038 - | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3039 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2572 + | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2573 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3040 2574 | Self::check_range(value)?;
|
3041 2575 |
|
3042 2576 | Ok(Self(value))
|
3043 2577 | }
|
3044 2578 | }
|
3045 2579 |
|
3046 2580 | #[allow(missing_docs)] // documentation missing in model
|
3047 2581 | ///
|
3048 2582 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3049 - | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
2583 + | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
3050 2584 | ///
|
3051 2585 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3052 2586 | ///
|
3053 2587 | #[derive(
|
3054 2588 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3055 2589 | )]
|
3056 - | pub struct FixedValueLong(pub(crate) i64);
|
3057 - | impl FixedValueLong {
|
3058 - | /// Returns an immutable reference to the underlying [`i64`].
|
3059 - | pub fn inner(&self) -> &i64 {
|
2590 + | pub struct MaxRangeShort(pub(crate) i16);
|
2591 + | impl MaxRangeShort {
|
2592 + | /// Returns an immutable reference to the underlying [`i16`].
|
2593 + | pub fn inner(&self) -> &i16 {
|
3060 2594 | &self.0
|
3061 2595 | }
|
3062 2596 |
|
3063 - | /// Consumes the value, returning the underlying [`i64`].
|
3064 - | pub fn into_inner(self) -> i64 {
|
2597 + | /// Consumes the value, returning the underlying [`i16`].
|
2598 + | pub fn into_inner(self) -> i16 {
|
3065 2599 | self.0
|
3066 2600 | }
|
3067 2601 | }
|
3068 2602 |
|
3069 - | impl crate::constrained::Constrained for FixedValueLong {
|
3070 - | type Unconstrained = i64;
|
2603 + | impl crate::constrained::Constrained for MaxRangeShort {
|
2604 + | type Unconstrained = i16;
|
3071 2605 | }
|
3072 2606 |
|
3073 - | impl ::std::convert::From<i64>
|
3074 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
2607 + | impl ::std::convert::From<i16>
|
2608 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
3075 2609 | {
|
3076 - | fn from(value: i64) -> Self {
|
2610 + | fn from(value: i16) -> Self {
|
3077 2611 | Self::Unconstrained(value)
|
3078 2612 | }
|
3079 2613 | }
|
3080 2614 |
|
3081 - | impl ::std::fmt::Display for FixedValueLong {
|
2615 + | impl ::std::fmt::Display for MaxRangeShort {
|
3082 2616 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3083 2617 | self.0.fmt(f)
|
3084 2618 | }
|
3085 2619 | }
|
3086 2620 |
|
3087 - | impl ::std::convert::From<FixedValueLong> for i64 {
|
3088 - | fn from(value: FixedValueLong) -> Self {
|
2621 + | impl ::std::convert::From<MaxRangeShort> for i16 {
|
2622 + | fn from(value: MaxRangeShort) -> Self {
|
3089 2623 | value.into_inner()
|
3090 2624 | }
|
3091 2625 | }
|
3092 - | impl FixedValueLong {
|
2626 + | impl MaxRangeShort {
|
3093 2627 | fn check_range(
|
3094 - | value: i64,
|
3095 - | ) -> ::std::result::Result<(), crate::model::fixed_value_long::ConstraintViolation> {
|
3096 - | if (10..=10).contains(&value) {
|
2628 + | value: i16,
|
2629 + | ) -> ::std::result::Result<(), crate::model::max_range_short::ConstraintViolation> {
|
2630 + | if value <= 11 {
|
3097 2631 | Ok(())
|
3098 2632 | } else {
|
3099 - | Err(crate::model::fixed_value_long::ConstraintViolation::Range(
|
2633 + | Err(crate::model::max_range_short::ConstraintViolation::Range(
|
3100 2634 | value,
|
3101 2635 | ))
|
3102 2636 | }
|
3103 2637 | }
|
3104 2638 | }
|
3105 - | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
3106 - | type Error = crate::model::fixed_value_long::ConstraintViolation;
|
2639 + | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
2640 + | type Error = crate::model::max_range_short::ConstraintViolation;
|
3107 2641 |
|
3108 - | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3109 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2642 + | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2643 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3110 2644 | Self::check_range(value)?;
|
3111 2645 |
|
3112 2646 | Ok(Self(value))
|
3113 2647 | }
|
3114 2648 | }
|
3115 2649 |
|
3116 2650 | #[allow(missing_docs)] // documentation missing in model
|
3117 2651 | ///
|
3118 2652 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3119 - | /// [constraint traits]. Use [`MaxRangeLong::try_from`] to construct values of this type.
|
2653 + | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
3120 2654 | ///
|
3121 2655 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3122 2656 | ///
|
3123 2657 | #[derive(
|
3124 2658 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3125 2659 | )]
|
3126 - | pub struct MaxRangeLong(pub(crate) i64);
|
3127 - | impl MaxRangeLong {
|
3128 - | /// Returns an immutable reference to the underlying [`i64`].
|
3129 - | pub fn inner(&self) -> &i64 {
|
2660 + | pub struct FixedValueShort(pub(crate) i16);
|
2661 + | impl FixedValueShort {
|
2662 + | /// Returns an immutable reference to the underlying [`i16`].
|
2663 + | pub fn inner(&self) -> &i16 {
|
3130 2664 | &self.0
|
3131 2665 | }
|
3132 2666 |
|
3133 - | /// Consumes the value, returning the underlying [`i64`].
|
3134 - | pub fn into_inner(self) -> i64 {
|
2667 + | /// Consumes the value, returning the underlying [`i16`].
|
2668 + | pub fn into_inner(self) -> i16 {
|
3135 2669 | self.0
|
3136 2670 | }
|
3137 2671 | }
|
3138 2672 |
|
3139 - | impl crate::constrained::Constrained for MaxRangeLong {
|
3140 - | type Unconstrained = i64;
|
2673 + | impl crate::constrained::Constrained for FixedValueShort {
|
2674 + | type Unconstrained = i16;
|
3141 2675 | }
|
3142 2676 |
|
3143 - | impl ::std::convert::From<i64>
|
3144 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>
|
2677 + | impl ::std::convert::From<i16>
|
2678 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
3145 2679 | {
|
3146 - | fn from(value: i64) -> Self {
|
2680 + | fn from(value: i16) -> Self {
|
3147 2681 | Self::Unconstrained(value)
|
3148 2682 | }
|
3149 2683 | }
|
3150 2684 |
|
3151 - | impl ::std::fmt::Display for MaxRangeLong {
|
2685 + | impl ::std::fmt::Display for FixedValueShort {
|
3152 2686 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3153 2687 | self.0.fmt(f)
|
3154 2688 | }
|
3155 2689 | }
|
3156 2690 |
|
3157 - | impl ::std::convert::From<MaxRangeLong> for i64 {
|
3158 - | fn from(value: MaxRangeLong) -> Self {
|
2691 + | impl ::std::convert::From<FixedValueShort> for i16 {
|
2692 + | fn from(value: FixedValueShort) -> Self {
|
3159 2693 | value.into_inner()
|
3160 2694 | }
|
3161 2695 | }
|
3162 - | impl MaxRangeLong {
|
2696 + | impl FixedValueShort {
|
3163 2697 | fn check_range(
|
3164 - | value: i64,
|
3165 - | ) -> ::std::result::Result<(), crate::model::max_range_long::ConstraintViolation> {
|
3166 - | if value <= 11 {
|
2698 + | value: i16,
|
2699 + | ) -> ::std::result::Result<(), crate::model::fixed_value_short::ConstraintViolation> {
|
2700 + | if (10..=10).contains(&value) {
|
3167 2701 | Ok(())
|
3168 2702 | } else {
|
3169 - | Err(crate::model::max_range_long::ConstraintViolation::Range(
|
2703 + | Err(crate::model::fixed_value_short::ConstraintViolation::Range(
|
3170 2704 | value,
|
3171 2705 | ))
|
3172 2706 | }
|
3173 2707 | }
|
3174 2708 | }
|
3175 - | impl ::std::convert::TryFrom<i64> for MaxRangeLong {
|
3176 - | type Error = crate::model::max_range_long::ConstraintViolation;
|
2709 + | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
2710 + | type Error = crate::model::fixed_value_short::ConstraintViolation;
|
3177 2711 |
|
3178 - | /// Constructs a `MaxRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3179 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2712 + | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2713 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3180 2714 | Self::check_range(value)?;
|
3181 2715 |
|
3182 2716 | Ok(Self(value))
|
3183 2717 | }
|
3184 2718 | }
|
3185 2719 |
|
3186 2720 | #[allow(missing_docs)] // documentation missing in model
|
3187 2721 | ///
|
3188 2722 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3189 2723 | /// [constraint traits]. Use [`MinRangeLong::try_from`] to construct values of this type.
|
3249 2783 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3250 2784 | Self::check_range(value)?;
|
3251 2785 |
|
3252 2786 | Ok(Self(value))
|
3253 2787 | }
|
3254 2788 | }
|
3255 2789 |
|
3256 2790 | #[allow(missing_docs)] // documentation missing in model
|
3257 2791 | ///
|
3258 2792 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3259 - | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
2793 + | /// [constraint traits]. Use [`MaxRangeLong::try_from`] to construct values of this type.
|
3260 2794 | ///
|
3261 2795 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3262 2796 | ///
|
3263 2797 | #[derive(
|
3264 2798 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3265 2799 | )]
|
3266 - | pub struct FixedValueShort(pub(crate) i16);
|
3267 - | impl FixedValueShort {
|
3268 - | /// Returns an immutable reference to the underlying [`i16`].
|
3269 - | pub fn inner(&self) -> &i16 {
|
2800 + | pub struct MaxRangeLong(pub(crate) i64);
|
2801 + | impl MaxRangeLong {
|
2802 + | /// Returns an immutable reference to the underlying [`i64`].
|
2803 + | pub fn inner(&self) -> &i64 {
|
3270 2804 | &self.0
|
3271 2805 | }
|
3272 2806 |
|
3273 - | /// Consumes the value, returning the underlying [`i16`].
|
3274 - | pub fn into_inner(self) -> i16 {
|
2807 + | /// Consumes the value, returning the underlying [`i64`].
|
2808 + | pub fn into_inner(self) -> i64 {
|
3275 2809 | self.0
|
3276 2810 | }
|
3277 2811 | }
|
3278 2812 |
|
3279 - | impl crate::constrained::Constrained for FixedValueShort {
|
3280 - | type Unconstrained = i16;
|
2813 + | impl crate::constrained::Constrained for MaxRangeLong {
|
2814 + | type Unconstrained = i64;
|
3281 2815 | }
|
3282 2816 |
|
3283 - | impl ::std::convert::From<i16>
|
3284 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
2817 + | impl ::std::convert::From<i64>
|
2818 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>
|
3285 2819 | {
|
3286 - | fn from(value: i16) -> Self {
|
2820 + | fn from(value: i64) -> Self {
|
3287 2821 | Self::Unconstrained(value)
|
3288 2822 | }
|
3289 2823 | }
|
3290 2824 |
|
3291 - | impl ::std::fmt::Display for FixedValueShort {
|
2825 + | impl ::std::fmt::Display for MaxRangeLong {
|
3292 2826 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3293 2827 | self.0.fmt(f)
|
3294 2828 | }
|
3295 2829 | }
|
3296 2830 |
|
3297 - | impl ::std::convert::From<FixedValueShort> for i16 {
|
3298 - | fn from(value: FixedValueShort) -> Self {
|
2831 + | impl ::std::convert::From<MaxRangeLong> for i64 {
|
2832 + | fn from(value: MaxRangeLong) -> Self {
|
3299 2833 | value.into_inner()
|
3300 2834 | }
|
3301 2835 | }
|
3302 - | impl FixedValueShort {
|
2836 + | impl MaxRangeLong {
|
3303 2837 | fn check_range(
|
3304 - | value: i16,
|
3305 - | ) -> ::std::result::Result<(), crate::model::fixed_value_short::ConstraintViolation> {
|
3306 - | if (10..=10).contains(&value) {
|
2838 + | value: i64,
|
2839 + | ) -> ::std::result::Result<(), crate::model::max_range_long::ConstraintViolation> {
|
2840 + | if value <= 11 {
|
3307 2841 | Ok(())
|
3308 2842 | } else {
|
3309 - | Err(crate::model::fixed_value_short::ConstraintViolation::Range(
|
2843 + | Err(crate::model::max_range_long::ConstraintViolation::Range(
|
3310 2844 | value,
|
3311 2845 | ))
|
3312 2846 | }
|
3313 2847 | }
|
3314 2848 | }
|
3315 - | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
3316 - | type Error = crate::model::fixed_value_short::ConstraintViolation;
|
2849 + | impl ::std::convert::TryFrom<i64> for MaxRangeLong {
|
2850 + | type Error = crate::model::max_range_long::ConstraintViolation;
|
3317 2851 |
|
3318 - | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3319 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2852 + | /// Constructs a `MaxRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2853 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3320 2854 | Self::check_range(value)?;
|
3321 2855 |
|
3322 2856 | Ok(Self(value))
|
3323 2857 | }
|
3324 2858 | }
|
3325 2859 |
|
3326 2860 | #[allow(missing_docs)] // documentation missing in model
|
3327 2861 | ///
|
3328 2862 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3329 - | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
2863 + | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
3330 2864 | ///
|
3331 2865 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3332 2866 | ///
|
3333 2867 | #[derive(
|
3334 2868 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3335 2869 | )]
|
3336 - | pub struct MaxRangeShort(pub(crate) i16);
|
3337 - | impl MaxRangeShort {
|
3338 - | /// Returns an immutable reference to the underlying [`i16`].
|
3339 - | pub fn inner(&self) -> &i16 {
|
2870 + | pub struct FixedValueLong(pub(crate) i64);
|
2871 + | impl FixedValueLong {
|
2872 + | /// Returns an immutable reference to the underlying [`i64`].
|
2873 + | pub fn inner(&self) -> &i64 {
|
3340 2874 | &self.0
|
3341 2875 | }
|
3342 2876 |
|
3343 - | /// Consumes the value, returning the underlying [`i16`].
|
3344 - | pub fn into_inner(self) -> i16 {
|
2877 + | /// Consumes the value, returning the underlying [`i64`].
|
2878 + | pub fn into_inner(self) -> i64 {
|
3345 2879 | self.0
|
3346 2880 | }
|
3347 2881 | }
|
3348 2882 |
|
3349 - | impl crate::constrained::Constrained for MaxRangeShort {
|
3350 - | type Unconstrained = i16;
|
2883 + | impl crate::constrained::Constrained for FixedValueLong {
|
2884 + | type Unconstrained = i64;
|
3351 2885 | }
|
3352 2886 |
|
3353 - | impl ::std::convert::From<i16>
|
3354 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
2887 + | impl ::std::convert::From<i64>
|
2888 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
3355 2889 | {
|
3356 - | fn from(value: i16) -> Self {
|
2890 + | fn from(value: i64) -> Self {
|
3357 2891 | Self::Unconstrained(value)
|
3358 2892 | }
|
3359 2893 | }
|
3360 2894 |
|
3361 - | impl ::std::fmt::Display for MaxRangeShort {
|
2895 + | impl ::std::fmt::Display for FixedValueLong {
|
3362 2896 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3363 2897 | self.0.fmt(f)
|
3364 2898 | }
|
3365 2899 | }
|
3366 2900 |
|
3367 - | impl ::std::convert::From<MaxRangeShort> for i16 {
|
3368 - | fn from(value: MaxRangeShort) -> Self {
|
2901 + | impl ::std::convert::From<FixedValueLong> for i64 {
|
2902 + | fn from(value: FixedValueLong) -> Self {
|
3369 2903 | value.into_inner()
|
3370 2904 | }
|
3371 2905 | }
|
3372 - | impl MaxRangeShort {
|
2906 + | impl FixedValueLong {
|
3373 2907 | fn check_range(
|
3374 - | value: i16,
|
3375 - | ) -> ::std::result::Result<(), crate::model::max_range_short::ConstraintViolation> {
|
3376 - | if value <= 11 {
|
2908 + | value: i64,
|
2909 + | ) -> ::std::result::Result<(), crate::model::fixed_value_long::ConstraintViolation> {
|
2910 + | if (10..=10).contains(&value) {
|
3377 2911 | Ok(())
|
3378 2912 | } else {
|
3379 - | Err(crate::model::max_range_short::ConstraintViolation::Range(
|
2913 + | Err(crate::model::fixed_value_long::ConstraintViolation::Range(
|
3380 2914 | value,
|
3381 2915 | ))
|
3382 2916 | }
|
3383 2917 | }
|
3384 2918 | }
|
3385 - | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
3386 - | type Error = crate::model::max_range_short::ConstraintViolation;
|
2919 + | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
2920 + | type Error = crate::model::fixed_value_long::ConstraintViolation;
|
3387 2921 |
|
3388 - | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3389 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2922 + | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2923 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3390 2924 | Self::check_range(value)?;
|
3391 2925 |
|
3392 2926 | Ok(Self(value))
|
3393 2927 | }
|
3394 2928 | }
|
3395 2929 |
|
3396 2930 | #[allow(missing_docs)] // documentation missing in model
|
3397 2931 | ///
|
3398 2932 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3399 - | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
2933 + | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
3400 2934 | ///
|
3401 2935 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3402 2936 | ///
|
3403 2937 | #[derive(
|
3404 2938 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3405 2939 | )]
|
3406 - | pub struct MinRangeShort(pub(crate) i16);
|
3407 - | impl MinRangeShort {
|
3408 - | /// Returns an immutable reference to the underlying [`i16`].
|
3409 - | pub fn inner(&self) -> &i16 {
|
2940 + | pub struct MinRangeByte(pub(crate) i8);
|
2941 + | impl MinRangeByte {
|
2942 + | /// Returns an immutable reference to the underlying [`i8`].
|
2943 + | pub fn inner(&self) -> &i8 {
|
3410 2944 | &self.0
|
3411 2945 | }
|
3412 2946 |
|
3413 - | /// Consumes the value, returning the underlying [`i16`].
|
3414 - | pub fn into_inner(self) -> i16 {
|
2947 + | /// Consumes the value, returning the underlying [`i8`].
|
2948 + | pub fn into_inner(self) -> i8 {
|
3415 2949 | self.0
|
3416 2950 | }
|
3417 2951 | }
|
3418 2952 |
|
3419 - | impl crate::constrained::Constrained for MinRangeShort {
|
3420 - | type Unconstrained = i16;
|
2953 + | impl crate::constrained::Constrained for MinRangeByte {
|
2954 + | type Unconstrained = i8;
|
3421 2955 | }
|
3422 2956 |
|
3423 - | impl ::std::convert::From<i16>
|
3424 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
3425 - | {
|
3426 - | fn from(value: i16) -> Self {
|
2957 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
2958 + | fn from(value: i8) -> Self {
|
3427 2959 | Self::Unconstrained(value)
|
3428 2960 | }
|
3429 2961 | }
|
3430 2962 |
|
3431 - | impl ::std::fmt::Display for MinRangeShort {
|
2963 + | impl ::std::fmt::Display for MinRangeByte {
|
3432 2964 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3433 2965 | self.0.fmt(f)
|
3434 2966 | }
|
3435 2967 | }
|
3436 2968 |
|
3437 - | impl ::std::convert::From<MinRangeShort> for i16 {
|
3438 - | fn from(value: MinRangeShort) -> Self {
|
2969 + | impl ::std::convert::From<MinRangeByte> for i8 {
|
2970 + | fn from(value: MinRangeByte) -> Self {
|
3439 2971 | value.into_inner()
|
3440 2972 | }
|
3441 2973 | }
|
3442 - | impl MinRangeShort {
|
2974 + | impl MinRangeByte {
|
3443 2975 | fn check_range(
|
3444 - | value: i16,
|
3445 - | ) -> ::std::result::Result<(), crate::model::min_range_short::ConstraintViolation> {
|
2976 + | value: i8,
|
2977 + | ) -> ::std::result::Result<(), crate::model::min_range_byte::ConstraintViolation> {
|
3446 2978 | if -10 <= value {
|
3447 2979 | Ok(())
|
3448 2980 | } else {
|
3449 - | Err(crate::model::min_range_short::ConstraintViolation::Range(
|
2981 + | Err(crate::model::min_range_byte::ConstraintViolation::Range(
|
3450 2982 | value,
|
3451 2983 | ))
|
3452 2984 | }
|
3453 2985 | }
|
3454 2986 | }
|
3455 - | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
3456 - | type Error = crate::model::min_range_short::ConstraintViolation;
|
2987 + | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
2988 + | type Error = crate::model::min_range_byte::ConstraintViolation;
|
3457 2989 |
|
3458 - | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3459 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2990 + | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2991 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3460 2992 | Self::check_range(value)?;
|
3461 2993 |
|
3462 2994 | Ok(Self(value))
|
3463 2995 | }
|
3464 2996 | }
|
3465 2997 |
|
3466 2998 | #[allow(missing_docs)] // documentation missing in model
|
3467 2999 | ///
|
3468 3000 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3469 - | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
3001 + | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
3470 3002 | ///
|
3471 3003 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3472 3004 | ///
|
3473 3005 | #[derive(
|
3474 3006 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3475 3007 | )]
|
3476 - | pub struct FixedValueInteger(pub(crate) i32);
|
3477 - | impl FixedValueInteger {
|
3478 - | /// Returns an immutable reference to the underlying [`i32`].
|
3479 - | pub fn inner(&self) -> &i32 {
|
3008 + | pub struct MaxRangeByte(pub(crate) i8);
|
3009 + | impl MaxRangeByte {
|
3010 + | /// Returns an immutable reference to the underlying [`i8`].
|
3011 + | pub fn inner(&self) -> &i8 {
|
3480 3012 | &self.0
|
3481 3013 | }
|
3482 3014 |
|
3483 - | /// Consumes the value, returning the underlying [`i32`].
|
3484 - | pub fn into_inner(self) -> i32 {
|
3015 + | /// Consumes the value, returning the underlying [`i8`].
|
3016 + | pub fn into_inner(self) -> i8 {
|
3485 3017 | self.0
|
3486 3018 | }
|
3487 3019 | }
|
3488 3020 |
|
3489 - | impl crate::constrained::Constrained for FixedValueInteger {
|
3490 - | type Unconstrained = i32;
|
3021 + | impl crate::constrained::Constrained for MaxRangeByte {
|
3022 + | type Unconstrained = i8;
|
3491 3023 | }
|
3492 3024 |
|
3493 - | impl ::std::convert::From<i32>
|
3494 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
3495 - | {
|
3496 - | fn from(value: i32) -> Self {
|
3025 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
3026 + | fn from(value: i8) -> Self {
|
3497 3027 | Self::Unconstrained(value)
|
3498 3028 | }
|
3499 3029 | }
|
3500 3030 |
|
3501 - | impl ::std::fmt::Display for FixedValueInteger {
|
3031 + | impl ::std::fmt::Display for MaxRangeByte {
|
3502 3032 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3503 3033 | self.0.fmt(f)
|
3504 3034 | }
|
3505 3035 | }
|
3506 3036 |
|
3507 - | impl ::std::convert::From<FixedValueInteger> for i32 {
|
3508 - | fn from(value: FixedValueInteger) -> Self {
|
3037 + | impl ::std::convert::From<MaxRangeByte> for i8 {
|
3038 + | fn from(value: MaxRangeByte) -> Self {
|
3509 3039 | value.into_inner()
|
3510 3040 | }
|
3511 3041 | }
|
3512 - | impl FixedValueInteger {
|
3042 + | impl MaxRangeByte {
|
3513 3043 | fn check_range(
|
3514 - | value: i32,
|
3515 - | ) -> ::std::result::Result<(), crate::model::fixed_value_integer::ConstraintViolation> {
|
3516 - | if (69..=69).contains(&value) {
|
3044 + | value: i8,
|
3045 + | ) -> ::std::result::Result<(), crate::model::max_range_byte::ConstraintViolation> {
|
3046 + | if value <= 11 {
|
3517 3047 | Ok(())
|
3518 3048 | } else {
|
3519 - | Err(crate::model::fixed_value_integer::ConstraintViolation::Range(value))
|
3049 + | Err(crate::model::max_range_byte::ConstraintViolation::Range(
|
3050 + | value,
|
3051 + | ))
|
3520 3052 | }
|
3521 3053 | }
|
3522 3054 | }
|
3523 - | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
3524 - | type Error = crate::model::fixed_value_integer::ConstraintViolation;
|
3055 + | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
3056 + | type Error = crate::model::max_range_byte::ConstraintViolation;
|
3525 3057 |
|
3526 - | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3527 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3058 + | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3059 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3528 3060 | Self::check_range(value)?;
|
3529 3061 |
|
3530 3062 | Ok(Self(value))
|
3531 3063 | }
|
3532 3064 | }
|
3533 3065 |
|
3534 3066 | #[allow(missing_docs)] // documentation missing in model
|
3535 3067 | ///
|
3536 3068 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3537 - | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
3069 + | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
3538 3070 | ///
|
3539 3071 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3540 3072 | ///
|
3541 3073 | #[derive(
|
3542 3074 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3543 3075 | )]
|
3544 - | pub struct MaxRangeInteger(pub(crate) i32);
|
3545 - | impl MaxRangeInteger {
|
3546 - | /// Returns an immutable reference to the underlying [`i32`].
|
3547 - | pub fn inner(&self) -> &i32 {
|
3076 + | pub struct FixedValueByte(pub(crate) i8);
|
3077 + | impl FixedValueByte {
|
3078 + | /// Returns an immutable reference to the underlying [`i8`].
|
3079 + | pub fn inner(&self) -> &i8 {
|
3548 3080 | &self.0
|
3549 3081 | }
|
3550 3082 |
|
3551 - | /// Consumes the value, returning the underlying [`i32`].
|
3552 - | pub fn into_inner(self) -> i32 {
|
3083 + | /// Consumes the value, returning the underlying [`i8`].
|
3084 + | pub fn into_inner(self) -> i8 {
|
3553 3085 | self.0
|
3554 3086 | }
|
3555 3087 | }
|
3556 3088 |
|
3557 - | impl crate::constrained::Constrained for MaxRangeInteger {
|
3558 - | type Unconstrained = i32;
|
3089 + | impl crate::constrained::Constrained for FixedValueByte {
|
3090 + | type Unconstrained = i8;
|
3559 3091 | }
|
3560 3092 |
|
3561 - | impl ::std::convert::From<i32>
|
3562 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
3093 + | impl ::std::convert::From<i8>
|
3094 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
3563 3095 | {
|
3564 - | fn from(value: i32) -> Self {
|
3096 + | fn from(value: i8) -> Self {
|
3565 3097 | Self::Unconstrained(value)
|
3566 3098 | }
|
3567 3099 | }
|
3568 3100 |
|
3569 - | impl ::std::fmt::Display for MaxRangeInteger {
|
3101 + | impl ::std::fmt::Display for FixedValueByte {
|
3570 3102 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3571 3103 | self.0.fmt(f)
|
3572 3104 | }
|
3573 3105 | }
|
3574 3106 |
|
3575 - | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
3576 - | fn from(value: MaxRangeInteger) -> Self {
|
3107 + | impl ::std::convert::From<FixedValueByte> for i8 {
|
3108 + | fn from(value: FixedValueByte) -> Self {
|
3577 3109 | value.into_inner()
|
3578 3110 | }
|
3579 3111 | }
|
3580 - | impl MaxRangeInteger {
|
3112 + | impl FixedValueByte {
|
3581 3113 | fn check_range(
|
3582 - | value: i32,
|
3583 - | ) -> ::std::result::Result<(), crate::model::max_range_integer::ConstraintViolation> {
|
3584 - | if value <= 69 {
|
3114 + | value: i8,
|
3115 + | ) -> ::std::result::Result<(), crate::model::fixed_value_byte::ConstraintViolation> {
|
3116 + | if (10..=10).contains(&value) {
|
3585 3117 | Ok(())
|
3586 3118 | } else {
|
3587 - | Err(crate::model::max_range_integer::ConstraintViolation::Range(
|
3119 + | Err(crate::model::fixed_value_byte::ConstraintViolation::Range(
|
3588 3120 | value,
|
3589 3121 | ))
|
3590 3122 | }
|
3591 3123 | }
|
3592 3124 | }
|
3593 - | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
3594 - | type Error = crate::model::max_range_integer::ConstraintViolation;
|
3125 + | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
3126 + | type Error = crate::model::fixed_value_byte::ConstraintViolation;
|
3595 3127 |
|
3596 - | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3597 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3128 + | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3129 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3598 3130 | Self::check_range(value)?;
|
3599 3131 |
|
3600 3132 | Ok(Self(value))
|
3601 3133 | }
|
3602 3134 | }
|
3603 3135 |
|
3604 3136 | #[allow(missing_docs)] // documentation missing in model
|
3605 3137 | ///
|
3606 3138 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3607 - | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
3139 + | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
3608 3140 | ///
|
3609 3141 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3610 3142 | ///
|
3611 3143 | #[derive(
|
3612 3144 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3613 3145 | )]
|
3614 - | pub struct MinRangeInteger(pub(crate) i32);
|
3615 - | impl MinRangeInteger {
|
3616 - | /// Returns an immutable reference to the underlying [`i32`].
|
3617 - | pub fn inner(&self) -> &i32 {
|
3146 + | pub struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3147 + | impl LengthList {
|
3148 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
3149 + | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
3618 3150 | &self.0
|
3619 3151 | }
|
3620 - |
|
3621 - | /// Consumes the value, returning the underlying [`i32`].
|
3622 - | pub fn into_inner(self) -> i32 {
|
3152 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3153 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
3623 3154 | self.0
|
3624 3155 | }
|
3625 - | }
|
3626 - |
|
3627 - | impl crate::constrained::Constrained for MinRangeInteger {
|
3628 - | type Unconstrained = i32;
|
3629 - | }
|
3630 - |
|
3631 - | impl ::std::convert::From<i32>
|
3632 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
3633 - | {
|
3634 - | fn from(value: i32) -> Self {
|
3635 - | Self::Unconstrained(value)
|
3636 - | }
|
3637 - | }
|
3638 - |
|
3639 - | impl ::std::fmt::Display for MinRangeInteger {
|
3640 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3641 - | self.0.fmt(f)
|
3642 - | }
|
3643 - | }
|
3644 3156 |
|
3645 - | impl ::std::convert::From<MinRangeInteger> for i32 {
|
3646 - | fn from(value: MinRangeInteger) -> Self {
|
3647 - | value.into_inner()
|
3648 - | }
|
3649 - | }
|
3650 - | impl MinRangeInteger {
|
3651 - | fn check_range(
|
3652 - | value: i32,
|
3653 - | ) -> ::std::result::Result<(), crate::model::min_range_integer::ConstraintViolation> {
|
3654 - | if -10 <= value {
|
3157 + | fn check_length(
|
3158 + | length: usize,
|
3159 + | ) -> ::std::result::Result<(), crate::model::length_list::ConstraintViolation> {
|
3160 + | if length <= 69 {
|
3655 3161 | Ok(())
|
3656 3162 | } else {
|
3657 - | Err(crate::model::min_range_integer::ConstraintViolation::Range(
|
3658 - | value,
|
3163 + | Err(crate::model::length_list::ConstraintViolation::Length(
|
3164 + | length,
|
3659 3165 | ))
|
3660 3166 | }
|
3661 3167 | }
|
3662 3168 | }
|
3663 - | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
3664 - | type Error = crate::model::min_range_integer::ConstraintViolation;
|
3169 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
3170 + | type Error = crate::model::length_list::ConstraintViolation;
|
3665 3171 |
|
3666 - | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3667 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3668 - | Self::check_range(value)?;
|
3172 + | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3173 + | fn try_from(
|
3174 + | value: ::std::vec::Vec<::std::string::String>,
|
3175 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3176 + | Self::check_length(value.len())?;
|
3669 3177 |
|
3670 3178 | Ok(Self(value))
|
3671 3179 | }
|
3672 3180 | }
|
3673 3181 |
|
3182 + | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
3183 + | fn from(value: LengthList) -> Self {
|
3184 + | value.into_inner()
|
3185 + | }
|
3186 + | }
|
3187 + | impl crate::constrained::Constrained for LengthList {
|
3188 + | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
3189 + | }
|
3190 + |
|
3674 3191 | #[allow(missing_docs)] // documentation missing in model
|
3675 3192 | ///
|
3676 3193 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3677 - | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
3194 + | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
3678 3195 | ///
|
3679 3196 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3680 3197 | ///
|
3681 3198 | #[derive(
|
3682 3199 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3683 3200 | )]
|
3684 - | pub struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3685 - | impl FixedLengthBlob {
|
3686 - | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
3687 - | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
3201 + | pub struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
3202 + | impl SensitiveLengthList {
|
3203 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
3204 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::SensitiveStructure> {
|
3688 3205 | &self.0
|
3689 3206 | }
|
3690 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3691 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3207 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
3208 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
3692 3209 | self.0
|
3693 3210 | }
|
3694 - | }
|
3695 - | impl FixedLengthBlob {
|
3696 - | fn check_length(
|
3697 - | blob: &::aws_smithy_types::Blob,
|
3698 - | ) -> ::std::result::Result<(), crate::model::fixed_length_blob::ConstraintViolation> {
|
3699 - | let length = blob.as_ref().len();
|
3700 3211 |
|
3701 - | if (70..=70).contains(&length) {
|
3212 + | fn check_length(
|
3213 + | length: usize,
|
3214 + | ) -> ::std::result::Result<(), crate::model::sensitive_length_list::ConstraintViolation> {
|
3215 + | if length <= 69 {
|
3702 3216 | Ok(())
|
3703 3217 | } else {
|
3704 - | Err(crate::model::fixed_length_blob::ConstraintViolation::Length(length))
|
3218 + | Err(crate::model::sensitive_length_list::ConstraintViolation::Length(length))
|
3705 3219 | }
|
3706 3220 | }
|
3707 3221 | }
|
3708 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
3709 - | type Error = crate::model::fixed_length_blob::ConstraintViolation;
|
3222 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
3223 + | for SensitiveLengthList
|
3224 + | {
|
3225 + | type Error = crate::model::sensitive_length_list::ConstraintViolation;
|
3710 3226 |
|
3711 - | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3712 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3713 - | Self::check_length(&value)?;
|
3227 + | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
3228 + | fn try_from(
|
3229 + | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
3230 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3231 + | Self::check_length(value.len())?;
|
3714 3232 |
|
3715 3233 | Ok(Self(value))
|
3716 3234 | }
|
3717 3235 | }
|
3718 - | impl crate::constrained::Constrained for FixedLengthBlob {
|
3719 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3720 - | }
|
3721 3236 |
|
3722 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3723 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
3237 + | impl ::std::convert::From<SensitiveLengthList>
|
3238 + | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
3724 3239 | {
|
3725 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3726 - | Self::Unconstrained(value)
|
3727 - | }
|
3728 - | }
|
3729 - |
|
3730 - | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
3731 - | fn from(value: FixedLengthBlob) -> Self {
|
3240 + | fn from(value: SensitiveLengthList) -> Self {
|
3732 3241 | value.into_inner()
|
3733 3242 | }
|
3734 3243 | }
|
3244 + | impl crate::constrained::Constrained for SensitiveLengthList {
|
3245 + | type Unconstrained =
|
3246 + | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
3247 + | }
|
3735 3248 |
|
3736 3249 | #[allow(missing_docs)] // documentation missing in model
|
3737 3250 | ///
|
3738 3251 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3739 - | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
3252 + | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
3740 3253 | ///
|
3741 3254 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3742 3255 | ///
|
3743 3256 | #[derive(
|
3744 3257 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3745 3258 | )]
|
3746 - | pub struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3747 - | impl MaxLengthBlob {
|
3748 - | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
3749 - | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
3259 + | pub struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
3260 + | impl ConBSet {
|
3261 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
3262 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::ConBSetInner> {
|
3750 3263 | &self.0
|
3751 3264 | }
|
3752 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3753 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3265 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
3266 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
3754 3267 | self.0
|
3755 3268 | }
|
3756 - | }
|
3757 - | impl MaxLengthBlob {
|
3758 - | fn check_length(
|
3759 - | blob: &::aws_smithy_types::Blob,
|
3760 - | ) -> ::std::result::Result<(), crate::model::max_length_blob::ConstraintViolation> {
|
3761 - | let length = blob.as_ref().len();
|
3762 3269 |
|
3763 - | if length <= 70 {
|
3764 - | Ok(())
|
3765 - | } else {
|
3766 - | Err(crate::model::max_length_blob::ConstraintViolation::Length(
|
3767 - | length,
|
3768 - | ))
|
3270 + | fn check_unique_items(
|
3271 + | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3272 + | ) -> ::std::result::Result<
|
3273 + | ::std::vec::Vec<crate::model::ConBSetInner>,
|
3274 + | crate::model::con_b_set::ConstraintViolation,
|
3275 + | > {
|
3276 + | let mut seen = ::std::collections::HashMap::new();
|
3277 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3278 + | for (idx, item) in items.iter().enumerate() {
|
3279 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3280 + | duplicate_indices.push(prev_idx);
|
3769 3281 | }
|
3770 3282 | }
|
3771 - | }
|
3772 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
3773 - | type Error = crate::model::max_length_blob::ConstraintViolation;
|
3774 3283 |
|
3775 - | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3776 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3777 - | Self::check_length(&value)?;
|
3284 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3285 + | for idx in &duplicate_indices {
|
3286 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3287 + | last_duplicate_indices.push(prev_idx);
|
3288 + | }
|
3289 + | }
|
3290 + | duplicate_indices.extend(last_duplicate_indices);
|
3778 3291 |
|
3779 - | Ok(Self(value))
|
3292 + | if !duplicate_indices.is_empty() {
|
3293 + | debug_assert!(duplicate_indices.len() >= 2);
|
3294 + | Err(crate::model::con_b_set::ConstraintViolation::UniqueItems {
|
3295 + | duplicate_indices,
|
3296 + | original: items,
|
3297 + | })
|
3298 + | } else {
|
3299 + | Ok(items)
|
3300 + | }
|
3780 3301 | }
|
3781 3302 | }
|
3782 - | impl crate::constrained::Constrained for MaxLengthBlob {
|
3783 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3784 - | }
|
3303 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
3304 + | type Error = crate::model::con_b_set::ConstraintViolation;
|
3785 3305 |
|
3786 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3787 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
3788 - | {
|
3789 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3790 - | Self::Unconstrained(value)
|
3306 + | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
3307 + | fn try_from(
|
3308 + | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3309 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3310 + | let value = Self::check_unique_items(value)?;
|
3311 + |
|
3312 + | Ok(Self(value))
|
3791 3313 | }
|
3792 3314 | }
|
3793 3315 |
|
3794 - | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
3795 - | fn from(value: MaxLengthBlob) -> Self {
|
3316 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
3317 + | fn from(value: ConBSet) -> Self {
|
3796 3318 | value.into_inner()
|
3797 3319 | }
|
3798 3320 | }
|
3321 + | impl crate::constrained::Constrained for ConBSet {
|
3322 + | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
3323 + | }
|
3799 3324 |
|
3800 3325 | #[allow(missing_docs)] // documentation missing in model
|
3801 3326 | ///
|
3802 3327 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3803 - | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
3328 + | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
3804 3329 | ///
|
3805 3330 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3806 3331 | ///
|
3807 - | #[derive(
|
3808 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3809 - | )]
|
3810 - | pub struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3811 - | impl MinLengthBlob {
|
3812 - | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
3813 - | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
3332 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3333 + | pub struct LengthMap(
|
3334 + | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3335 + | );
|
3336 + | impl LengthMap {
|
3337 + | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
3338 + | pub fn inner(
|
3339 + | &self,
|
3340 + | ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
3814 3341 | &self.0
|
3815 3342 | }
|
3816 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3817 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3343 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
3344 + | pub fn into_inner(
|
3345 + | self,
|
3346 + | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
3818 3347 | self.0
|
3819 3348 | }
|
3820 3349 | }
|
3821 - | impl MinLengthBlob {
|
3822 - | fn check_length(
|
3823 - | blob: &::aws_smithy_types::Blob,
|
3824 - | ) -> ::std::result::Result<(), crate::model::min_length_blob::ConstraintViolation> {
|
3825 - | let length = blob.as_ref().len();
|
3350 + | impl
|
3351 + | ::std::convert::TryFrom<
|
3352 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3353 + | > for LengthMap
|
3354 + | {
|
3355 + | type Error = crate::model::length_map::ConstraintViolation;
|
3826 3356 |
|
3827 - | if 2 <= length {
|
3828 - | Ok(())
|
3357 + | /// 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.
|
3358 + | fn try_from(
|
3359 + | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3360 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3361 + | let length = value.len();
|
3362 + | if (1..=69).contains(&length) {
|
3363 + | Ok(Self(value))
|
3829 3364 | } else {
|
3830 - | Err(crate::model::min_length_blob::ConstraintViolation::Length(
|
3365 + | Err(crate::model::length_map::ConstraintViolation::Length(
|
3831 3366 | length,
|
3832 3367 | ))
|
3833 3368 | }
|
3834 3369 | }
|
3835 3370 | }
|
3836 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
3837 - | type Error = crate::model::min_length_blob::ConstraintViolation;
|
3838 - |
|
3839 - | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3840 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3841 - | Self::check_length(&value)?;
|
3842 3371 |
|
3843 - | Ok(Self(value))
|
3372 + | impl ::std::convert::From<LengthMap>
|
3373 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
3374 + | {
|
3375 + | fn from(value: LengthMap) -> Self {
|
3376 + | value.into_inner()
|
3844 3377 | }
|
3845 3378 | }
|
3846 - | impl crate::constrained::Constrained for MinLengthBlob {
|
3847 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3379 + | impl crate::constrained::Constrained for LengthMap {
|
3380 + | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
3848 3381 | }
|
3849 3382 |
|
3850 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3851 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
3383 + | #[allow(missing_docs)] // documentation missing in model
|
3384 + | ///
|
3385 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3386 + | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
3387 + | ///
|
3388 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3389 + | ///
|
3390 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3391 + | pub struct SparseLengthMap(
|
3392 + | pub(crate) ::std::collections::HashMap<
|
3393 + | ::std::string::String,
|
3394 + | ::std::option::Option<::std::string::String>,
|
3395 + | >,
|
3396 + | );
|
3397 + | impl SparseLengthMap {
|
3398 + | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
3399 + | pub fn inner(
|
3400 + | &self,
|
3401 + | ) -> &::std::collections::HashMap<
|
3402 + | ::std::string::String,
|
3403 + | ::std::option::Option<::std::string::String>,
|
3404 + | > {
|
3405 + | &self.0
|
3406 + | }
|
3407 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
3408 + | pub fn into_inner(
|
3409 + | self,
|
3410 + | ) -> ::std::collections::HashMap<
|
3411 + | ::std::string::String,
|
3412 + | ::std::option::Option<::std::string::String>,
|
3413 + | > {
|
3414 + | self.0
|
3415 + | }
|
3416 + | }
|
3417 + | impl
|
3418 + | ::std::convert::TryFrom<
|
3419 + | ::std::collections::HashMap<
|
3420 + | ::std::string::String,
|
3421 + | ::std::option::Option<::std::string::String>,
|
3422 + | >,
|
3423 + | > for SparseLengthMap
|
3852 3424 | {
|
3853 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3854 - | Self::Unconstrained(value)
|
3425 + | type Error = crate::model::sparse_length_map::ConstraintViolation;
|
3426 + |
|
3427 + | /// 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.
|
3428 + | fn try_from(
|
3429 + | value: ::std::collections::HashMap<
|
3430 + | ::std::string::String,
|
3431 + | ::std::option::Option<::std::string::String>,
|
3432 + | >,
|
3433 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3434 + | let length = value.len();
|
3435 + | if 69 <= length {
|
3436 + | Ok(Self(value))
|
3437 + | } else {
|
3438 + | Err(crate::model::sparse_length_map::ConstraintViolation::Length(length))
|
3439 + | }
|
3855 3440 | }
|
3856 3441 | }
|
3857 3442 |
|
3858 - | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
3859 - | fn from(value: MinLengthBlob) -> Self {
|
3443 + | impl ::std::convert::From<SparseLengthMap>
|
3444 + | for ::std::collections::HashMap<
|
3445 + | ::std::string::String,
|
3446 + | ::std::option::Option<::std::string::String>,
|
3447 + | >
|
3448 + | {
|
3449 + | fn from(value: SparseLengthMap) -> Self {
|
3860 3450 | value.into_inner()
|
3861 3451 | }
|
3862 3452 | }
|
3453 + | impl crate::constrained::Constrained for SparseLengthMap {
|
3454 + | type Unconstrained =
|
3455 + | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
3456 + | }
|
3863 3457 |
|
3864 3458 | #[allow(missing_docs)] // documentation missing in model
|
3865 3459 | ///
|
3866 3460 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3867 - | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
3461 + | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
3868 3462 | ///
|
3869 3463 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3870 3464 | ///
|
3871 3465 | #[derive(
|
3872 3466 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3873 3467 | )]
|
3874 - | pub struct FixedLengthString(pub(crate) ::std::string::String);
|
3875 - | impl FixedLengthString {
|
3876 - | /// Extracts a string slice containing the entire underlying `String`.
|
3877 - | pub fn as_str(&self) -> &str {
|
3878 - | &self.0
|
3879 - | }
|
3880 - |
|
3881 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3882 - | pub fn inner(&self) -> &::std::string::String {
|
3468 + | pub struct SparseLengthList(
|
3469 + | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3470 + | );
|
3471 + | impl SparseLengthList {
|
3472 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
3473 + | pub fn inner(&self) -> &::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
3883 3474 | &self.0
|
3884 3475 | }
|
3885 - |
|
3886 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3887 - | pub fn into_inner(self) -> ::std::string::String {
|
3476 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
3477 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
3888 3478 | self.0
|
3889 3479 | }
|
3890 - | }
|
3891 - | impl FixedLengthString {
|
3892 - | fn check_length(
|
3893 - | string: &str,
|
3894 - | ) -> ::std::result::Result<(), crate::model::fixed_length_string::ConstraintViolation> {
|
3895 - | let length = string.chars().count();
|
3896 3480 |
|
3897 - | if (69..=69).contains(&length) {
|
3481 + | fn check_length(
|
3482 + | length: usize,
|
3483 + | ) -> ::std::result::Result<(), crate::model::sparse_length_list::ConstraintViolation> {
|
3484 + | if 69 <= length {
|
3898 3485 | Ok(())
|
3899 3486 | } else {
|
3900 - | Err(crate::model::fixed_length_string::ConstraintViolation::Length(length))
|
3487 + | Err(crate::model::sparse_length_list::ConstraintViolation::Length(length))
|
3901 3488 | }
|
3902 3489 | }
|
3903 3490 | }
|
3904 - | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
3905 - | type Error = crate::model::fixed_length_string::ConstraintViolation;
|
3491 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
3492 + | for SparseLengthList
|
3493 + | {
|
3494 + | type Error = crate::model::sparse_length_list::ConstraintViolation;
|
3906 3495 |
|
3907 - | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3908 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3909 - | Self::check_length(&value)?;
|
3496 + | /// 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.
|
3497 + | fn try_from(
|
3498 + | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3499 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3500 + | Self::check_length(value.len())?;
|
3910 3501 |
|
3911 3502 | Ok(Self(value))
|
3912 3503 | }
|
3913 3504 | }
|
3914 - | impl crate::constrained::Constrained for FixedLengthString {
|
3915 - | type Unconstrained = ::std::string::String;
|
3916 - | }
|
3917 3505 |
|
3918 - | impl ::std::convert::From<::std::string::String>
|
3919 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
3506 + | impl ::std::convert::From<SparseLengthList>
|
3507 + | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
3920 3508 | {
|
3921 - | fn from(value: ::std::string::String) -> Self {
|
3922 - | Self::Unconstrained(value)
|
3509 + | fn from(value: SparseLengthList) -> Self {
|
3510 + | value.into_inner()
|
3923 3511 | }
|
3924 3512 | }
|
3925 - |
|
3926 - | impl ::std::fmt::Display for FixedLengthString {
|
3927 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3928 - | self.0.fmt(f)
|
3929 - | }
|
3513 + | impl crate::constrained::Constrained for SparseLengthList {
|
3514 + | type Unconstrained =
|
3515 + | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
3930 3516 | }
|
3931 3517 |
|
3932 - | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
3933 - | fn from(value: FixedLengthString) -> Self {
|
3934 - | value.into_inner()
|
3518 + | /// A union with constrained members.
|
3519 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3520 + | pub enum ConstrainedUnion {
|
3521 + | #[allow(missing_docs)] // documentation missing in model
|
3522 + | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
3523 + | #[allow(missing_docs)] // documentation missing in model
|
3524 + | ConBMap(crate::model::ConBMap),
|
3525 + | #[allow(missing_docs)] // documentation missing in model
|
3526 + | ConBSet(crate::model::ConBSet),
|
3527 + | #[allow(missing_docs)] // documentation missing in model
|
3528 + | ConstrainedStructure(crate::model::ConB),
|
3529 + | #[allow(missing_docs)] // documentation missing in model
|
3530 + | EnumString(crate::model::EnumString),
|
3531 + | #[allow(missing_docs)] // documentation missing in model
|
3532 + | LengthString(crate::model::LengthString),
|
3533 + | }
|
3534 + | impl ConstrainedUnion {
|
3535 + | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
3536 + | /// Returns `Err(&Self)` if it can't be converted.
|
3537 + | pub fn as_con_b_list(
|
3538 + | &self,
|
3539 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
3540 + | if let ConstrainedUnion::ConBList(val) = &self {
|
3541 + | ::std::result::Result::Ok(val)
|
3542 + | } else {
|
3543 + | ::std::result::Result::Err(self)
|
3544 + | }
|
3545 + | }
|
3546 + | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
3547 + | pub fn is_con_b_list(&self) -> bool {
|
3548 + | self.as_con_b_list().is_ok()
|
3549 + | }
|
3550 + | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`ConBMap`](crate::model::ConBMap).
|
3551 + | /// Returns `Err(&Self)` if it can't be converted.
|
3552 + | pub fn as_con_b_map(&self) -> ::std::result::Result<&crate::model::ConBMap, &Self> {
|
3553 + | if let ConstrainedUnion::ConBMap(val) = &self {
|
3554 + | ::std::result::Result::Ok(val)
|
3555 + | } else {
|
3556 + | ::std::result::Result::Err(self)
|
3557 + | }
|
3558 + | }
|
3559 + | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
3560 + | pub fn is_con_b_map(&self) -> bool {
|
3561 + | self.as_con_b_map().is_ok()
|
3562 + | }
|
3563 + | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`ConBSet`](crate::model::ConBSet).
|
3564 + | /// Returns `Err(&Self)` if it can't be converted.
|
3565 + | pub fn as_con_b_set(&self) -> ::std::result::Result<&crate::model::ConBSet, &Self> {
|
3566 + | if let ConstrainedUnion::ConBSet(val) = &self {
|
3567 + | ::std::result::Result::Ok(val)
|
3568 + | } else {
|
3569 + | ::std::result::Result::Err(self)
|
3570 + | }
|
3571 + | }
|
3572 + | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
3573 + | pub fn is_con_b_set(&self) -> bool {
|
3574 + | self.as_con_b_set().is_ok()
|
3575 + | }
|
3576 + | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
3577 + | /// Returns `Err(&Self)` if it can't be converted.
|
3578 + | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
3579 + | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
3580 + | ::std::result::Result::Ok(val)
|
3581 + | } else {
|
3582 + | ::std::result::Result::Err(self)
|
3583 + | }
|
3584 + | }
|
3585 + | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
3586 + | pub fn is_constrained_structure(&self) -> bool {
|
3587 + | self.as_constrained_structure().is_ok()
|
3588 + | }
|
3589 + | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
3590 + | /// Returns `Err(&Self)` if it can't be converted.
|
3591 + | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
3592 + | if let ConstrainedUnion::EnumString(val) = &self {
|
3593 + | ::std::result::Result::Ok(val)
|
3594 + | } else {
|
3595 + | ::std::result::Result::Err(self)
|
3596 + | }
|
3597 + | }
|
3598 + | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
3599 + | pub fn is_enum_string(&self) -> bool {
|
3600 + | self.as_enum_string().is_ok()
|
3601 + | }
|
3602 + | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`LengthString`](crate::model::LengthString).
|
3603 + | /// Returns `Err(&Self)` if it can't be converted.
|
3604 + | pub fn as_length_string(&self) -> ::std::result::Result<&crate::model::LengthString, &Self> {
|
3605 + | if let ConstrainedUnion::LengthString(val) = &self {
|
3606 + | ::std::result::Result::Ok(val)
|
3607 + | } else {
|
3608 + | ::std::result::Result::Err(self)
|
3609 + | }
|
3610 + | }
|
3611 + | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
3612 + | pub fn is_length_string(&self) -> bool {
|
3613 + | self.as_length_string().is_ok()
|
3935 3614 | }
|
3936 3615 | }
|
3937 3616 |
|
3938 3617 | #[allow(missing_docs)] // documentation missing in model
|
3939 3618 | ///
|
3940 3619 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3941 - | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
3620 + | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
3942 3621 | ///
|
3943 3622 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3944 3623 | ///
|
3945 3624 | #[derive(
|
3946 3625 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3947 3626 | )]
|
3948 - | pub struct MaxLengthString(pub(crate) ::std::string::String);
|
3949 - | impl MaxLengthString {
|
3627 + | pub struct PatternString(pub(crate) ::std::string::String);
|
3628 + | impl PatternString {
|
3950 3629 | /// Extracts a string slice containing the entire underlying `String`.
|
3951 3630 | pub fn as_str(&self) -> &str {
|
3952 3631 | &self.0
|
3953 3632 | }
|
3954 3633 |
|
3955 3634 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3956 3635 | pub fn inner(&self) -> &::std::string::String {
|
3957 3636 | &self.0
|
3958 3637 | }
|
3959 3638 |
|
3960 3639 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3961 3640 | pub fn into_inner(self) -> ::std::string::String {
|
3962 3641 | self.0
|
3963 3642 | }
|
3964 3643 | }
|
3965 - | impl MaxLengthString {
|
3966 - | fn check_length(
|
3967 - | string: &str,
|
3968 - | ) -> ::std::result::Result<(), crate::model::max_length_string::ConstraintViolation> {
|
3969 - | let length = string.chars().count();
|
3644 + | impl PatternString {
|
3645 + | fn check_pattern(
|
3646 + | string: ::std::string::String,
|
3647 + | ) -> ::std::result::Result<
|
3648 + | ::std::string::String,
|
3649 + | crate::model::pattern_string::ConstraintViolation,
|
3650 + | > {
|
3651 + | let regex = Self::compile_regex();
|
3970 3652 |
|
3971 - | if length <= 69 {
|
3972 - | Ok(())
|
3653 + | if regex.is_match(&string) {
|
3654 + | Ok(string)
|
3973 3655 | } else {
|
3974 - | Err(crate::model::max_length_string::ConstraintViolation::Length(length))
|
3656 + | Err(crate::model::pattern_string::ConstraintViolation::Pattern(
|
3657 + | string,
|
3658 + | ))
|
3975 3659 | }
|
3976 3660 | }
|
3661 + |
|
3662 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
3663 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
3664 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
3665 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
3666 + | ::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"#)
|
3667 + | });
|
3668 + |
|
3669 + | ®EX
|
3670 + | }
|
3977 3671 | }
|
3978 - | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
3979 - | type Error = crate::model::max_length_string::ConstraintViolation;
|
3672 + | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
3673 + | type Error = crate::model::pattern_string::ConstraintViolation;
|
3980 3674 |
|
3981 - | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3675 + | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3982 3676 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3983 - | Self::check_length(&value)?;
|
3677 + | let value = Self::check_pattern(value)?;
|
3984 3678 |
|
3985 3679 | Ok(Self(value))
|
3986 3680 | }
|
3987 3681 | }
|
3988 - | impl crate::constrained::Constrained for MaxLengthString {
|
3682 + | impl crate::constrained::Constrained for PatternString {
|
3989 3683 | type Unconstrained = ::std::string::String;
|
3990 3684 | }
|
3991 3685 |
|
3992 3686 | impl ::std::convert::From<::std::string::String>
|
3993 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
3687 + | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
3994 3688 | {
|
3995 3689 | fn from(value: ::std::string::String) -> Self {
|
3996 3690 | Self::Unconstrained(value)
|
3997 3691 | }
|
3998 3692 | }
|
3999 3693 |
|
4000 - | impl ::std::fmt::Display for MaxLengthString {
|
3694 + | impl ::std::fmt::Display for PatternString {
|
4001 3695 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4002 3696 | self.0.fmt(f)
|
4003 3697 | }
|
4004 3698 | }
|
4005 3699 |
|
4006 - | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
4007 - | fn from(value: MaxLengthString) -> Self {
|
3700 + | impl ::std::convert::From<PatternString> for ::std::string::String {
|
3701 + | fn from(value: PatternString) -> Self {
|
4008 3702 | value.into_inner()
|
4009 3703 | }
|
4010 3704 | }
|
4011 3705 |
|
3706 + | #[cfg(test)]
|
3707 + | mod test_pattern_string {
|
3708 + | #[test]
|
3709 + | fn regex_compiles() {
|
3710 + | crate::model::PatternString::compile_regex();
|
3711 + | }
|
3712 + | }
|
3713 + |
|
4012 3714 | #[allow(missing_docs)] // documentation missing in model
|
4013 3715 | ///
|
4014 3716 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4015 - | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
3717 + | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
4016 3718 | ///
|
4017 3719 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4018 3720 | ///
|
4019 3721 | #[derive(
|
4020 3722 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4021 3723 | )]
|
4022 - | pub struct MinLengthString(pub(crate) ::std::string::String);
|
4023 - | impl MinLengthString {
|
4024 - | /// Extracts a string slice containing the entire underlying `String`.
|
4025 - | pub fn as_str(&self) -> &str {
|
3724 + | pub struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
3725 + | impl SetOfPatternString {
|
3726 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
3727 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::PatternString> {
|
4026 3728 | &self.0
|
4027 3729 | }
|
3730 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
3731 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
3732 + | self.0
|
3733 + | }
|
4028 3734 |
|
4029 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4030 - | pub fn inner(&self) -> &::std::string::String {
|
4031 - | &self.0
|
3735 + | fn check_unique_items(
|
3736 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
3737 + | ) -> ::std::result::Result<
|
3738 + | ::std::vec::Vec<crate::model::PatternString>,
|
3739 + | crate::model::set_of_pattern_string::ConstraintViolation,
|
3740 + | > {
|
3741 + | let mut seen = ::std::collections::HashMap::new();
|
3742 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3743 + | for (idx, item) in items.iter().enumerate() {
|
3744 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3745 + | duplicate_indices.push(prev_idx);
|
3746 + | }
|
4032 3747 | }
|
4033 3748 |
|
4034 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4035 - | pub fn into_inner(self) -> ::std::string::String {
|
4036 - | self.0
|
3749 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3750 + | for idx in &duplicate_indices {
|
3751 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3752 + | last_duplicate_indices.push(prev_idx);
|
4037 3753 | }
|
4038 - | }
|
4039 - | impl MinLengthString {
|
4040 - | fn check_length(
|
4041 - | string: &str,
|
4042 - | ) -> ::std::result::Result<(), crate::model::min_length_string::ConstraintViolation> {
|
4043 - | let length = string.chars().count();
|
3754 + | }
|
3755 + | duplicate_indices.extend(last_duplicate_indices);
|
4044 3756 |
|
4045 - | if 2 <= length {
|
4046 - | Ok(())
|
3757 + | if !duplicate_indices.is_empty() {
|
3758 + | debug_assert!(duplicate_indices.len() >= 2);
|
3759 + | Err(
|
3760 + | crate::model::set_of_pattern_string::ConstraintViolation::UniqueItems {
|
3761 + | duplicate_indices,
|
3762 + | original: items,
|
3763 + | },
|
3764 + | )
|
4047 3765 | } else {
|
4048 - | Err(crate::model::min_length_string::ConstraintViolation::Length(length))
|
3766 + | Ok(items)
|
4049 3767 | }
|
4050 3768 | }
|
4051 3769 | }
|
4052 - | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
4053 - | type Error = crate::model::min_length_string::ConstraintViolation;
|
3770 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
3771 + | type Error = crate::model::set_of_pattern_string::ConstraintViolation;
|
4054 3772 |
|
4055 - | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4056 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4057 - | Self::check_length(&value)?;
|
3773 + | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
3774 + | fn try_from(
|
3775 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
3776 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3777 + | let value = Self::check_unique_items(value)?;
|
4058 3778 |
|
4059 3779 | Ok(Self(value))
|
4060 3780 | }
|
4061 3781 | }
|
4062 - | impl crate::constrained::Constrained for MinLengthString {
|
4063 - | type Unconstrained = ::std::string::String;
|
4064 - | }
|
4065 3782 |
|
4066 - | impl ::std::convert::From<::std::string::String>
|
4067 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
4068 - | {
|
4069 - | fn from(value: ::std::string::String) -> Self {
|
4070 - | Self::Unconstrained(value)
|
3783 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
3784 + | fn from(value: SetOfPatternString) -> Self {
|
3785 + | value.into_inner()
|
4071 3786 | }
|
4072 3787 | }
|
4073 - |
|
4074 - | impl ::std::fmt::Display for MinLengthString {
|
4075 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4076 - | self.0.fmt(f)
|
4077 - | }
|
4078 - | }
|
4079 - |
|
4080 - | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
4081 - | fn from(value: MinLengthString) -> Self {
|
4082 - | value.into_inner()
|
4083 - | }
|
3788 + | impl crate::constrained::Constrained for SetOfPatternString {
|
3789 + | type Unconstrained =
|
3790 + | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
4084 3791 | }
|
4085 3792 |
|
4086 3793 | #[allow(missing_docs)] // documentation missing in model
|
3794 + | ///
|
3795 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3796 + | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
3797 + | ///
|
3798 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3799 + | ///
|
4087 3800 | #[derive(
|
4088 3801 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4089 3802 | )]
|
4090 - | pub enum ConstrainedUnionInOutput {
|
4091 - | #[allow(missing_docs)] // documentation missing in model
|
4092 - | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
4093 - | }
|
4094 - | impl ConstrainedUnionInOutput {
|
4095 - | #[allow(irrefutable_let_patterns)]
|
4096 - | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4097 - | /// Returns `Err(&Self)` if it can't be converted.
|
4098 - | pub fn as_structure(
|
4099 - | &self,
|
4100 - | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
4101 - | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
4102 - | ::std::result::Result::Ok(val)
|
4103 - | } else {
|
4104 - | ::std::result::Result::Err(self)
|
3803 + | pub struct LengthPatternString(pub(crate) ::std::string::String);
|
3804 + | impl LengthPatternString {
|
3805 + | /// Extracts a string slice containing the entire underlying `String`.
|
3806 + | pub fn as_str(&self) -> &str {
|
3807 + | &self.0
|
4105 3808 | }
|
3809 + |
|
3810 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3811 + | pub fn inner(&self) -> &::std::string::String {
|
3812 + | &self.0
|
4106 3813 | }
|
4107 - | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
4108 - | pub fn is_structure(&self) -> bool {
|
4109 - | self.as_structure().is_ok()
|
3814 + |
|
3815 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3816 + | pub fn into_inner(self) -> ::std::string::String {
|
3817 + | self.0
|
4110 3818 | }
|
4111 3819 | }
|
3820 + | impl LengthPatternString {
|
3821 + | fn check_length(
|
3822 + | string: &str,
|
3823 + | ) -> ::std::result::Result<(), crate::model::length_pattern_string::ConstraintViolation> {
|
3824 + | let length = string.chars().count();
|
4112 3825 |
|
4113 - | #[allow(missing_docs)] // documentation missing in model
|
4114 - | #[derive(
|
4115 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4116 - | )]
|
4117 - | pub struct TransitivelyConstrainedStructureInOutput {
|
4118 - | #[allow(missing_docs)] // documentation missing in model
|
4119 - | pub length_string: ::std::option::Option<crate::model::LengthString>,
|
4120 - | }
|
4121 - | impl TransitivelyConstrainedStructureInOutput {
|
4122 - | #[allow(missing_docs)] // documentation missing in model
|
4123 - | pub fn length_string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
4124 - | self.length_string.as_ref()
|
3826 + | if (5..=10).contains(&length) {
|
3827 + | Ok(())
|
3828 + | } else {
|
3829 + | Err(crate::model::length_pattern_string::ConstraintViolation::Length(length))
|
4125 3830 | }
|
4126 - | }
|
4127 - | impl TransitivelyConstrainedStructureInOutput {
|
4128 - | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4129 - | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4130 - | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
4131 3831 | }
|
4132 - | }
|
4133 3832 |
|
4134 - | #[allow(missing_docs)] // documentation missing in model
|
4135 - | ///
|
4136 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4137 - | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
4138 - | ///
|
4139 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4140 - | ///
|
4141 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4142 - | pub struct ConstrainedMapInOutput(
|
4143 - | pub(crate) ::std::collections::HashMap<
|
4144 - | ::std::string::String,
|
4145 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4146 - | >,
|
4147 - | );
|
4148 - | impl ConstrainedMapInOutput {
|
4149 - | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
4150 - | pub fn inner(
|
4151 - | &self,
|
4152 - | ) -> &::std::collections::HashMap<
|
3833 + | fn check_pattern(
|
3834 + | string: ::std::string::String,
|
3835 + | ) -> ::std::result::Result<
|
4153 3836 | ::std::string::String,
|
4154 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
3837 + | crate::model::length_pattern_string::ConstraintViolation,
|
4155 3838 | > {
|
4156 - | &self.0
|
3839 + | let regex = Self::compile_regex();
|
3840 + |
|
3841 + | if regex.is_match(&string) {
|
3842 + | Ok(string)
|
3843 + | } else {
|
3844 + | Err(crate::model::length_pattern_string::ConstraintViolation::Pattern(string))
|
4157 3845 | }
|
4158 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
4159 - | pub fn into_inner(
|
4160 - | self,
|
4161 - | ) -> ::std::collections::HashMap<
|
4162 - | ::std::string::String,
|
4163 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4164 - | > {
|
4165 - | self.0
|
3846 + | }
|
3847 + |
|
3848 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
3849 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
3850 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
3851 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
3852 + | ::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"#)
|
3853 + | });
|
3854 + |
|
3855 + | ®EX
|
4166 3856 | }
|
4167 3857 | }
|
4168 - | impl
|
4169 - | ::std::convert::TryFrom<
|
4170 - | ::std::collections::HashMap<
|
4171 - | ::std::string::String,
|
4172 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4173 - | >,
|
4174 - | > for ConstrainedMapInOutput
|
4175 - | {
|
4176 - | type Error = crate::model::constrained_map_in_output::ConstraintViolation;
|
3858 + | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
3859 + | type Error = crate::model::length_pattern_string::ConstraintViolation;
|
3860 + |
|
3861 + | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3862 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3863 + | Self::check_length(&value)?;
|
3864 + |
|
3865 + | let value = Self::check_pattern(value)?;
|
4177 3866 |
|
4178 - | /// 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.
|
4179 - | fn try_from(
|
4180 - | value: ::std::collections::HashMap<
|
4181 - | ::std::string::String,
|
4182 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4183 - | >,
|
4184 - | ) -> ::std::result::Result<Self, Self::Error> {
|
4185 - | let length = value.len();
|
4186 - | if 69 <= length {
|
4187 3867 | Ok(Self(value))
|
4188 - | } else {
|
4189 - | Err(crate::model::constrained_map_in_output::ConstraintViolation::Length(length))
|
4190 - | }
|
4191 3868 | }
|
4192 3869 | }
|
3870 + | impl crate::constrained::Constrained for LengthPatternString {
|
3871 + | type Unconstrained = ::std::string::String;
|
3872 + | }
|
4193 3873 |
|
4194 - | impl ::std::convert::From<ConstrainedMapInOutput>
|
4195 - | for ::std::collections::HashMap<
|
4196 - | ::std::string::String,
|
4197 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4198 - | >
|
3874 + | impl ::std::convert::From<::std::string::String>
|
3875 + | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
4199 3876 | {
|
4200 - | fn from(value: ConstrainedMapInOutput) -> Self {
|
3877 + | fn from(value: ::std::string::String) -> Self {
|
3878 + | Self::Unconstrained(value)
|
3879 + | }
|
3880 + | }
|
3881 + |
|
3882 + | impl ::std::fmt::Display for LengthPatternString {
|
3883 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3884 + | self.0.fmt(f)
|
3885 + | }
|
3886 + | }
|
3887 + |
|
3888 + | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
3889 + | fn from(value: LengthPatternString) -> Self {
|
4201 3890 | value.into_inner()
|
4202 3891 | }
|
4203 3892 | }
|
4204 3893 |
|
3894 + | #[cfg(test)]
|
3895 + | mod test_length_pattern_string {
|
3896 + | #[test]
|
3897 + | fn regex_compiles() {
|
3898 + | crate::model::LengthPatternString::compile_regex();
|
3899 + | }
|
3900 + | }
|
3901 + |
|
4205 3902 | #[allow(missing_docs)] // documentation missing in model
|
4206 3903 | ///
|
4207 3904 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4208 - | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
3905 + | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
4209 3906 | ///
|
4210 3907 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4211 3908 | ///
|
4212 3909 | #[derive(
|
4213 3910 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4214 3911 | )]
|
4215 - | pub struct ConstrainedListInOutput(
|
4216 - | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4217 - | );
|
4218 - | impl ConstrainedListInOutput {
|
4219 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
4220 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
3912 + | pub struct SetOfLengthPatternString(pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>);
|
3913 + | impl SetOfLengthPatternString {
|
3914 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
3915 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthPatternString> {
|
4221 3916 | &self.0
|
4222 3917 | }
|
4223 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
4224 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
3918 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
3919 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
4225 3920 | self.0
|
4226 3921 | }
|
4227 3922 |
|
4228 - | fn check_length(
|
4229 - | length: usize,
|
4230 - | ) -> ::std::result::Result<(), crate::model::constrained_list_in_output::ConstraintViolation>
|
4231 - | {
|
4232 - | if 69 <= length {
|
4233 - | Ok(())
|
3923 + | fn check_unique_items(
|
3924 + | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
3925 + | ) -> ::std::result::Result<
|
3926 + | ::std::vec::Vec<crate::model::LengthPatternString>,
|
3927 + | crate::model::set_of_length_pattern_string::ConstraintViolation,
|
3928 + | > {
|
3929 + | let mut seen = ::std::collections::HashMap::new();
|
3930 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3931 + | for (idx, item) in items.iter().enumerate() {
|
3932 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3933 + | duplicate_indices.push(prev_idx);
|
3934 + | }
|
3935 + | }
|
3936 + |
|
3937 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3938 + | for idx in &duplicate_indices {
|
3939 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3940 + | last_duplicate_indices.push(prev_idx);
|
3941 + | }
|
3942 + | }
|
3943 + | duplicate_indices.extend(last_duplicate_indices);
|
3944 + |
|
3945 + | if !duplicate_indices.is_empty() {
|
3946 + | debug_assert!(duplicate_indices.len() >= 2);
|
3947 + | Err(
|
3948 + | crate::model::set_of_length_pattern_string::ConstraintViolation::UniqueItems {
|
3949 + | duplicate_indices,
|
3950 + | original: items,
|
3951 + | },
|
3952 + | )
|
4234 3953 | } else {
|
4235 - | Err(crate::model::constrained_list_in_output::ConstraintViolation::Length(length))
|
3954 + | Ok(items)
|
4236 3955 | }
|
4237 3956 | }
|
4238 3957 | }
|
4239 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
4240 - | for ConstrainedListInOutput
|
3958 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
3959 + | for SetOfLengthPatternString
|
4241 3960 | {
|
4242 - | type Error = crate::model::constrained_list_in_output::ConstraintViolation;
|
3961 + | type Error = crate::model::set_of_length_pattern_string::ConstraintViolation;
|
4243 3962 |
|
4244 - | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
3963 + | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
4245 3964 | fn try_from(
|
4246 - | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
3965 + | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
4247 3966 | ) -> ::std::result::Result<Self, Self::Error> {
|
4248 - | Self::check_length(value.len())?;
|
3967 + | let value = Self::check_unique_items(value)?;
|
4249 3968 |
|
4250 3969 | Ok(Self(value))
|
4251 3970 | }
|
4252 3971 | }
|
4253 3972 |
|
4254 - | impl ::std::convert::From<ConstrainedListInOutput>
|
4255 - | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
3973 + | impl ::std::convert::From<SetOfLengthPatternString>
|
3974 + | for ::std::vec::Vec<crate::model::LengthPatternString>
|
4256 3975 | {
|
4257 - | fn from(value: ConstrainedListInOutput) -> Self {
|
3976 + | fn from(value: SetOfLengthPatternString) -> Self {
|
4258 3977 | value.into_inner()
|
4259 3978 | }
|
4260 3979 | }
|
3980 + | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
3981 + | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
3982 + | }
|
4261 3983 |
|
4262 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4263 - | pub mod validation_exception_field {
|
4264 - |
|
4265 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4266 - | /// Holds one variant for each of the ways the builder can fail.
|
4267 - | #[non_exhaustive]
|
4268 - | #[allow(clippy::enum_variant_names)]
|
4269 - | pub enum ConstraintViolation {
|
4270 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
4271 - | MissingPath,
|
4272 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
4273 - | MissingMessage,
|
4274 - | }
|
4275 - | impl ::std::fmt::Display for ConstraintViolation {
|
4276 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4277 - | match self {
|
4278 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
4279 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4280 - | }
|
4281 - | }
|
4282 - | }
|
4283 - | impl ::std::error::Error for ConstraintViolation {}
|
4284 - | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
4285 - | type Error = ConstraintViolation;
|
4286 - |
|
4287 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4288 - | builder.build()
|
4289 - | }
|
4290 - | }
|
4291 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4292 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4293 - | pub struct Builder {
|
4294 - | pub(crate) path: ::std::option::Option<::std::string::String>,
|
4295 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
4296 - | }
|
4297 - | impl Builder {
|
3984 + | /// Describes one specific validation failure for an input member.
|
3985 + | #[derive(
|
3986 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3987 + | )]
|
3988 + | pub struct ValidationExceptionField {
|
4298 3989 | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4299 - | pub fn path(mut self, input: ::std::string::String) -> Self {
|
4300 - | self.path = Some(input);
|
4301 - | self
|
4302 - | }
|
3990 + | pub path: ::std::string::String,
|
4303 3991 | /// A detailed description of the validation failure.
|
4304 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
4305 - | self.message = Some(input);
|
4306 - | self
|
4307 - | }
|
4308 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4309 - | ///
|
4310 - | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
4311 - | ///
|
4312 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4313 - | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4314 - | self.build_enforcing_all_constraints()
|
3992 + | pub message: ::std::string::String,
|
3993 + | }
|
3994 + | impl ValidationExceptionField {
|
3995 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
3996 + | pub fn path(&self) -> &str {
|
3997 + | use std::ops::Deref;
|
3998 + | self.path.deref()
|
4315 3999 | }
|
4316 - | fn build_enforcing_all_constraints(
|
4317 - | self,
|
4318 - | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4319 - | Ok(crate::model::ValidationExceptionField {
|
4320 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
4321 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
4322 - | })
|
4000 + | /// A detailed description of the validation failure.
|
4001 + | pub fn message(&self) -> &str {
|
4002 + | use std::ops::Deref;
|
4003 + | self.message.deref()
|
4323 4004 | }
|
4005 + | }
|
4006 + | impl ValidationExceptionField {
|
4007 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4008 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
4009 + | crate::model::validation_exception_field::Builder::default()
|
4324 4010 | }
|
4325 4011 | }
|
4326 - | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4327 - | pub mod event_stream_regular_message {
|
4328 4012 |
|
4329 - | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
4330 - | fn from(builder: Builder) -> Self {
|
4331 - | builder.build()
|
4332 - | }
|
4333 - | }
|
4334 - | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4335 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4336 - | pub struct Builder {
|
4337 - | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
4338 - | }
|
4339 - | impl Builder {
|
4013 + | #[allow(missing_docs)] // documentation missing in model
|
4014 + | #[derive(
|
4015 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4016 + | )]
|
4017 + | pub struct TransitivelyConstrainedStructureInOutput {
|
4340 4018 | #[allow(missing_docs)] // documentation missing in model
|
4341 - | pub fn message_content(
|
4342 - | mut self,
|
4343 - | input: ::std::option::Option<::std::string::String>,
|
4344 - | ) -> Self {
|
4345 - | self.message_content = input;
|
4346 - | self
|
4347 - | }
|
4019 + | pub length_string: ::std::option::Option<crate::model::LengthString>,
|
4020 + | }
|
4021 + | impl TransitivelyConstrainedStructureInOutput {
|
4348 4022 | #[allow(missing_docs)] // documentation missing in model
|
4349 - | pub(crate) fn set_message_content(
|
4350 - | mut self,
|
4351 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4352 - | ) -> Self {
|
4353 - | self.message_content = input.map(|v| v.into());
|
4354 - | self
|
4355 - | }
|
4356 - | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4357 - | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
4358 - | self.build_enforcing_all_constraints()
|
4023 + | pub fn length_string(&self) -> ::std::option::Option<&crate::model::LengthString> {
|
4024 + | self.length_string.as_ref()
|
4359 4025 | }
|
4360 - | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
4361 - | crate::model::EventStreamRegularMessage {
|
4362 - | message_content: self.message_content,
|
4026 + | }
|
4027 + | impl TransitivelyConstrainedStructureInOutput {
|
4028 + | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4029 + | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4030 + | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
4363 4031 | }
|
4032 + | }
|
4033 + |
|
4034 + | #[allow(missing_docs)] // documentation missing in model
|
4035 + | #[derive(
|
4036 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4037 + | )]
|
4038 + | pub struct RecursiveShapesInputOutputNested2 {
|
4039 + | #[allow(missing_docs)] // documentation missing in model
|
4040 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4041 + | }
|
4042 + | impl RecursiveShapesInputOutputNested2 {
|
4043 + | #[allow(missing_docs)] // documentation missing in model
|
4044 + | pub fn recursive_member(
|
4045 + | &self,
|
4046 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
4047 + | self.recursive_member.as_ref()
|
4364 4048 | }
|
4049 + | }
|
4050 + | impl RecursiveShapesInputOutputNested2 {
|
4051 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4052 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
4053 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
4365 4054 | }
|
4366 4055 | }
|
4367 - | pub mod map_of_enum_string {
|
4056 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
4057 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2::Builder;
|
4058 + | }
|
4368 4059 |
|
4369 - | #[allow(clippy::enum_variant_names)]
|
4370 - | #[derive(Debug, PartialEq)]
|
4371 - | pub enum ConstraintViolation {
|
4372 - | #[doc(hidden)]
|
4373 - | Key(crate::model::enum_string::ConstraintViolation),
|
4374 - | #[doc(hidden)]
|
4375 - | Value(
|
4376 - | crate::model::EnumString,
|
4377 - | crate::model::enum_string::ConstraintViolation,
|
4378 - | ),
|
4060 + | #[allow(missing_docs)] // documentation missing in model
|
4061 + | #[derive(
|
4062 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4063 + | )]
|
4064 + | pub struct EventStreamRegularMessage {
|
4065 + | #[allow(missing_docs)] // documentation missing in model
|
4066 + | pub message_content: ::std::option::Option<::std::string::String>,
|
4067 + | }
|
4068 + | impl EventStreamRegularMessage {
|
4069 + | #[allow(missing_docs)] // documentation missing in model
|
4070 + | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
4071 + | self.message_content.as_deref()
|
4072 + | }
|
4073 + | }
|
4074 + | impl EventStreamRegularMessage {
|
4075 + | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4076 + | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
4077 + | crate::model::event_stream_regular_message::Builder::default()
|
4379 4078 | }
|
4079 + | }
|
4080 + | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
4081 + | type Unconstrained = crate::model::event_stream_regular_message::Builder;
|
4082 + | }
|
4380 4083 |
|
4381 - | impl ::std::fmt::Display for ConstraintViolation {
|
4382 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4383 - | match self {
|
4384 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4385 - | Self::Value(_, value_constraint_violation) => {
|
4386 - | write!(f, "{}", value_constraint_violation)
|
4084 + | #[allow(missing_docs)] // documentation missing in model
|
4085 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
4086 + | pub struct SensitiveStructure {}
|
4087 + | impl ::std::fmt::Debug for SensitiveStructure {
|
4088 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
4089 + | let mut formatter = f.debug_struct("SensitiveStructure");
|
4090 + | formatter.finish()
|
4387 4091 | }
|
4092 + | }
|
4093 + | impl SensitiveStructure {
|
4094 + | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
4095 + | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
4096 + | crate::model::sensitive_structure::Builder::default()
|
4388 4097 | }
|
4098 + | }
|
4099 + | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
4100 + | type Unconstrained = crate::model::sensitive_structure::Builder;
|
4101 + | }
|
4102 + |
|
4103 + | #[allow(missing_docs)] // documentation missing in model
|
4104 + | ///
|
4105 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4106 + | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
4107 + | ///
|
4108 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4109 + | ///
|
4110 + | #[derive(
|
4111 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4112 + | )]
|
4113 + | pub struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
4114 + | impl ConBSetInner {
|
4115 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
4116 + | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
4117 + | &self.0
|
4389 4118 | }
|
4119 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
4120 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
4121 + | self.0
|
4390 4122 | }
|
4391 4123 |
|
4392 - | impl ::std::error::Error for ConstraintViolation {}
|
4393 - | impl ConstraintViolation {
|
4394 - | pub(crate) fn as_validation_exception_field(
|
4395 - | self,
|
4396 - | path: ::std::string::String,
|
4397 - | ) -> crate::model::ValidationExceptionField {
|
4398 - | match self {
|
4399 - | Self::Key(key_constraint_violation) => {
|
4400 - | key_constraint_violation.as_validation_exception_field(path)
|
4124 + | fn check_unique_items(
|
4125 + | items: ::std::vec::Vec<::std::string::String>,
|
4126 + | ) -> ::std::result::Result<
|
4127 + | ::std::vec::Vec<::std::string::String>,
|
4128 + | crate::model::con_b_set_inner::ConstraintViolation,
|
4129 + | > {
|
4130 + | let mut seen = ::std::collections::HashMap::new();
|
4131 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4132 + | for (idx, item) in items.iter().enumerate() {
|
4133 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4134 + | duplicate_indices.push(prev_idx);
|
4401 4135 | }
|
4402 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4403 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4404 4136 | }
|
4137 + |
|
4138 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4139 + | for idx in &duplicate_indices {
|
4140 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4141 + | last_duplicate_indices.push(prev_idx);
|
4405 4142 | }
|
4406 4143 | }
|
4407 - | }
|
4408 - | /// See [`ConBMap`](crate::model::ConBMap).
|
4409 - | pub mod con_b_map {
|
4144 + | duplicate_indices.extend(last_duplicate_indices);
|
4410 4145 |
|
4411 - | #[allow(clippy::enum_variant_names)]
|
4412 - | #[derive(Debug, PartialEq)]
|
4413 - | pub enum ConstraintViolation {
|
4414 - | Length(usize),
|
4415 - |
|
4416 - | #[doc(hidden)]
|
4417 - | Value(
|
4418 - | ::std::string::String,
|
4419 - | crate::model::length_string::ConstraintViolation,
|
4420 - | ),
|
4421 - | }
|
4422 - |
|
4423 - | impl ::std::fmt::Display for ConstraintViolation {
|
4424 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4425 - | match self {
|
4426 - | Self::Length(length) => {
|
4427 - | 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)
|
4428 - | }
|
4429 - |
|
4430 - | Self::Value(_, value_constraint_violation) => {
|
4431 - | write!(f, "{}", value_constraint_violation)
|
4432 - | }
|
4433 - | }
|
4434 - | }
|
4435 - | }
|
4436 - |
|
4437 - | impl ::std::error::Error for ConstraintViolation {}
|
4438 - | impl ConstraintViolation {
|
4439 - | pub(crate) fn as_validation_exception_field(
|
4440 - | self,
|
4441 - | path: ::std::string::String,
|
4442 - | ) -> crate::model::ValidationExceptionField {
|
4443 - | match self {
|
4444 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4445 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
4446 - | path,
|
4146 + | if !duplicate_indices.is_empty() {
|
4147 + | debug_assert!(duplicate_indices.len() >= 2);
|
4148 + | Err(
|
4149 + | crate::model::con_b_set_inner::ConstraintViolation::UniqueItems {
|
4150 + | duplicate_indices,
|
4151 + | original: items,
|
4447 4152 | },
|
4448 - | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
4449 - | }
|
4153 + | )
|
4154 + | } else {
|
4155 + | Ok(items)
|
4450 4156 | }
|
4451 4157 | }
|
4452 4158 | }
|
4453 - | /// See [`LengthString`](crate::model::LengthString).
|
4454 - | pub mod length_string {
|
4455 - |
|
4456 - | #[derive(Debug, PartialEq)]
|
4457 - | pub enum ConstraintViolation {
|
4458 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
4459 - | Length(usize),
|
4460 - | }
|
4159 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
4160 + | type Error = crate::model::con_b_set_inner::ConstraintViolation;
|
4461 4161 |
|
4462 - | impl ::std::fmt::Display for ConstraintViolation {
|
4463 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4464 - | let message = match self {
|
4465 - | Self::Length(length) => {
|
4466 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
4467 - | }
|
4468 - | };
|
4469 - | write!(f, "{message}")
|
4470 - | }
|
4471 - | }
|
4162 + | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
4163 + | fn try_from(
|
4164 + | value: ::std::vec::Vec<::std::string::String>,
|
4165 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4166 + | let value = Self::check_unique_items(value)?;
|
4472 4167 |
|
4473 - | impl ::std::error::Error for ConstraintViolation {}
|
4474 - | impl ConstraintViolation {
|
4475 - | pub(crate) fn as_validation_exception_field(
|
4476 - | self,
|
4477 - | path: ::std::string::String,
|
4478 - | ) -> crate::model::ValidationExceptionField {
|
4479 - | match self {
|
4480 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4481 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
4482 - | path,
|
4483 - | },
|
4484 - | }
|
4485 - | }
|
4168 + | Ok(Self(value))
|
4486 4169 | }
|
4487 4170 | }
|
4488 - | pub mod map_of_list_of_length_pattern_string {
|
4489 4171 |
|
4490 - | #[allow(clippy::enum_variant_names)]
|
4491 - | #[derive(Debug, PartialEq)]
|
4492 - | pub enum ConstraintViolation {
|
4493 - | #[doc(hidden)]
|
4494 - | Key(crate::model::length_pattern_string::ConstraintViolation),
|
4495 - | #[doc(hidden)]
|
4496 - | Value(
|
4497 - | crate::model::LengthPatternString,
|
4498 - | crate::model::list_of_length_pattern_string::ConstraintViolation,
|
4499 - | ),
|
4172 + | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
4173 + | fn from(value: ConBSetInner) -> Self {
|
4174 + | value.into_inner()
|
4500 4175 | }
|
4176 + | }
|
4177 + | impl crate::constrained::Constrained for ConBSetInner {
|
4178 + | type Unconstrained =
|
4179 + | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
4180 + | }
|
4501 4181 |
|
4502 - | impl ::std::fmt::Display for ConstraintViolation {
|
4503 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4504 - | match self {
|
4505 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4506 - | Self::Value(_, value_constraint_violation) => {
|
4507 - | write!(f, "{}", value_constraint_violation)
|
4182 + | #[allow(missing_docs)] // documentation missing in model
|
4183 + | ///
|
4184 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4185 + | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
4186 + | ///
|
4187 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4188 + | ///
|
4189 + | #[derive(
|
4190 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4191 + | )]
|
4192 + | pub struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
4193 + | impl UniqueItemsList {
|
4194 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
4195 + | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
4196 + | &self.0
|
4508 4197 | }
|
4198 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
4199 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
4200 + | self.0
|
4509 4201 | }
|
4202 + |
|
4203 + | fn check_unique_items(
|
4204 + | items: ::std::vec::Vec<::std::string::String>,
|
4205 + | ) -> ::std::result::Result<
|
4206 + | ::std::vec::Vec<::std::string::String>,
|
4207 + | crate::model::unique_items_list::ConstraintViolation,
|
4208 + | > {
|
4209 + | let mut seen = ::std::collections::HashMap::new();
|
4210 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4211 + | for (idx, item) in items.iter().enumerate() {
|
4212 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4213 + | duplicate_indices.push(prev_idx);
|
4510 4214 | }
|
4511 4215 | }
|
4512 4216 |
|
4513 - | impl ::std::error::Error for ConstraintViolation {}
|
4514 - | impl ConstraintViolation {
|
4515 - | pub(crate) fn as_validation_exception_field(
|
4516 - | self,
|
4517 - | path: ::std::string::String,
|
4518 - | ) -> crate::model::ValidationExceptionField {
|
4519 - | match self {
|
4520 - | Self::Key(key_constraint_violation) => {
|
4521 - | key_constraint_violation.as_validation_exception_field(path)
|
4217 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4218 + | for idx in &duplicate_indices {
|
4219 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4220 + | last_duplicate_indices.push(prev_idx);
|
4522 4221 | }
|
4523 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4524 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4525 4222 | }
|
4223 + | duplicate_indices.extend(last_duplicate_indices);
|
4224 + |
|
4225 + | if !duplicate_indices.is_empty() {
|
4226 + | debug_assert!(duplicate_indices.len() >= 2);
|
4227 + | Err(
|
4228 + | crate::model::unique_items_list::ConstraintViolation::UniqueItems {
|
4229 + | duplicate_indices,
|
4230 + | original: items,
|
4231 + | },
|
4232 + | )
|
4233 + | } else {
|
4234 + | Ok(items)
|
4526 4235 | }
|
4527 4236 | }
|
4528 4237 | }
|
4529 - | pub mod list_of_length_pattern_string {
|
4530 - |
|
4531 - | #[allow(clippy::enum_variant_names)]
|
4532 - | #[derive(Debug, PartialEq)]
|
4533 - | pub enum ConstraintViolation {
|
4534 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4535 - | /// The first component of the tuple is the index in the collection where the
|
4536 - | /// first constraint violation was found.
|
4537 - | #[doc(hidden)]
|
4538 - | Member(
|
4539 - | usize,
|
4540 - | crate::model::length_pattern_string::ConstraintViolation,
|
4541 - | ),
|
4542 - | }
|
4238 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
4239 + | type Error = crate::model::unique_items_list::ConstraintViolation;
|
4543 4240 |
|
4544 - | impl ::std::fmt::Display for ConstraintViolation {
|
4545 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4546 - | let message = match self {
|
4547 - | Self::Member(index, failing_member) => format!(
|
4548 - | "Value at index {index} failed to satisfy constraint. {}",
|
4549 - | failing_member
|
4550 - | ),
|
4551 - | };
|
4552 - | write!(f, "{message}")
|
4553 - | }
|
4554 - | }
|
4241 + | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
4242 + | fn try_from(
|
4243 + | value: ::std::vec::Vec<::std::string::String>,
|
4244 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4245 + | let value = Self::check_unique_items(value)?;
|
4555 4246 |
|
4556 - | impl ::std::error::Error for ConstraintViolation {}
|
4557 - | impl ConstraintViolation {
|
4558 - | pub(crate) fn as_validation_exception_field(
|
4559 - | self,
|
4560 - | path: ::std::string::String,
|
4561 - | ) -> crate::model::ValidationExceptionField {
|
4562 - | match self {
|
4563 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4564 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4565 - | }
|
4566 - | }
|
4247 + | Ok(Self(value))
|
4567 4248 | }
|
4568 4249 | }
|
4569 - | /// See [`LengthPatternString`](crate::model::LengthPatternString).
|
4570 - | pub mod length_pattern_string {
|
4571 4250 |
|
4572 - | #[derive(Debug, PartialEq)]
|
4573 - | pub enum ConstraintViolation {
|
4574 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
4575 - | Length(usize),
|
4576 - | /// Error when a string doesn't satisfy its `@pattern`.
|
4577 - | /// Contains the String that failed the pattern.
|
4578 - | Pattern(String),
|
4251 + | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
4252 + | fn from(value: UniqueItemsList) -> Self {
|
4253 + | value.into_inner()
|
4579 4254 | }
|
4255 + | }
|
4256 + | impl crate::constrained::Constrained for UniqueItemsList {
|
4257 + | type Unconstrained =
|
4258 + | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
4259 + | }
|
4580 4260 |
|
4581 - | impl ::std::fmt::Display for ConstraintViolation {
|
4582 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4583 - | let message = match self {
|
4584 - | Self::Length(length) => {
|
4585 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
4586 - | }
|
4587 - | Self::Pattern(_) => {
|
4588 - | format!(
|
4589 - | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4590 - | r#"[a-f0-5]*"#
|
4591 - | )
|
4592 - | }
|
4593 - | };
|
4594 - | write!(f, "{message}")
|
4595 - | }
|
4596 - | }
|
4597 - |
|
4598 - | impl ::std::error::Error for ConstraintViolation {}
|
4599 - | impl ConstraintViolation {
|
4600 - | pub(crate) fn as_validation_exception_field(
|
4601 - | self,
|
4602 - | path: ::std::string::String,
|
4603 - | ) -> crate::model::ValidationExceptionField {
|
4604 - | match self {
|
4605 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4606 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
4607 - | path,
|
4608 - | },
|
4609 - |
|
4610 - | #[allow(unused_variables)]
|
4611 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4612 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
4613 - | path
|
4614 - | },
|
4615 - | }
|
4616 - | }
|
4617 - | }
|
4618 - | }
|
4619 - | pub mod map_of_length_pattern_string {
|
4261 + | /// See [`ConA`](crate::model::ConA).
|
4262 + | pub mod con_a {
|
4620 4263 |
|
4264 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4265 + | /// Holds one variant for each of the ways the builder can fail.
|
4266 + | #[non_exhaustive]
|
4621 4267 | #[allow(clippy::enum_variant_names)]
|
4622 - | #[derive(Debug, PartialEq)]
|
4623 4268 | pub enum ConstraintViolation {
|
4269 + | /// `con_b` was not provided but it is required when building `ConA`.
|
4270 + | MissingConB,
|
4271 + | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
4624 4272 | #[doc(hidden)]
|
4625 - | Key(crate::model::length_pattern_string::ConstraintViolation),
|
4273 + | ConB(crate::model::con_b::ConstraintViolation),
|
4274 + | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
4626 4275 | #[doc(hidden)]
|
4627 - | Value(
|
4628 - | crate::model::LengthPatternString,
|
4629 - | crate::model::length_pattern_string::ConstraintViolation,
|
4630 - | ),
|
4631 - | }
|
4632 - |
|
4633 - | impl ::std::fmt::Display for ConstraintViolation {
|
4634 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4635 - | match self {
|
4636 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4637 - | Self::Value(_, value_constraint_violation) => {
|
4638 - | write!(f, "{}", value_constraint_violation)
|
4639 - | }
|
4640 - | }
|
4641 - | }
|
4642 - | }
|
4643 - |
|
4644 - | impl ::std::error::Error for ConstraintViolation {}
|
4645 - | impl ConstraintViolation {
|
4646 - | pub(crate) fn as_validation_exception_field(
|
4647 - | self,
|
4648 - | path: ::std::string::String,
|
4649 - | ) -> crate::model::ValidationExceptionField {
|
4650 - | match self {
|
4651 - | Self::Key(key_constraint_violation) => {
|
4652 - | key_constraint_violation.as_validation_exception_field(path)
|
4653 - | }
|
4654 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4655 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4656 - | }
|
4657 - | }
|
4658 - | }
|
4659 - | }
|
4660 - | pub mod map_of_list_of_pattern_string {
|
4661 - |
|
4662 - | #[allow(clippy::enum_variant_names)]
|
4663 - | #[derive(Debug, PartialEq)]
|
4664 - | pub enum ConstraintViolation {
|
4276 + | OptConB(crate::model::con_b::ConstraintViolation),
|
4277 + | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
4665 4278 | #[doc(hidden)]
|
4666 - | Key(crate::model::pattern_string::ConstraintViolation),
|
4279 + | LengthString(crate::model::length_string::ConstraintViolation),
|
4280 + | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
4667 4281 | #[doc(hidden)]
|
4668 - | Value(
|
4669 - | crate::model::PatternString,
|
4670 - | crate::model::list_of_pattern_string::ConstraintViolation,
|
4671 - | ),
|
4672 - | }
|
4673 - |
|
4674 - | impl ::std::fmt::Display for ConstraintViolation {
|
4675 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4676 - | match self {
|
4677 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4678 - | Self::Value(_, value_constraint_violation) => {
|
4679 - | write!(f, "{}", value_constraint_violation)
|
4680 - | }
|
4681 - | }
|
4682 - | }
|
4683 - | }
|
4684 - |
|
4685 - | impl ::std::error::Error for ConstraintViolation {}
|
4686 - | impl ConstraintViolation {
|
4687 - | pub(crate) fn as_validation_exception_field(
|
4688 - | self,
|
4689 - | path: ::std::string::String,
|
4690 - | ) -> crate::model::ValidationExceptionField {
|
4691 - | match self {
|
4692 - | Self::Key(key_constraint_violation) => {
|
4693 - | key_constraint_violation.as_validation_exception_field(path)
|
4694 - | }
|
4695 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4696 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4697 - | }
|
4698 - | }
|
4699 - | }
|
4700 - | }
|
4701 - | pub mod list_of_pattern_string {
|
4702 - |
|
4703 - | #[allow(clippy::enum_variant_names)]
|
4704 - | #[derive(Debug, PartialEq)]
|
4705 - | pub enum ConstraintViolation {
|
4706 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4707 - | /// The first component of the tuple is the index in the collection where the
|
4708 - | /// first constraint violation was found.
|
4282 + | MinLengthString(crate::model::min_length_string::ConstraintViolation),
|
4283 + | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
4709 4284 | #[doc(hidden)]
|
4710 - | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
4711 - | }
|
4712 - |
|
4713 - | impl ::std::fmt::Display for ConstraintViolation {
|
4714 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4715 - | let message = match self {
|
4716 - | Self::Member(index, failing_member) => format!(
|
4717 - | "Value at index {index} failed to satisfy constraint. {}",
|
4718 - | failing_member
|
4719 - | ),
|
4720 - | };
|
4721 - | write!(f, "{message}")
|
4722 - | }
|
4723 - | }
|
4724 - |
|
4725 - | impl ::std::error::Error for ConstraintViolation {}
|
4726 - | impl ConstraintViolation {
|
4727 - | pub(crate) fn as_validation_exception_field(
|
4728 - | self,
|
4729 - | path: ::std::string::String,
|
4730 - | ) -> crate::model::ValidationExceptionField {
|
4731 - | match self {
|
4732 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4733 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4734 - | }
|
4735 - | }
|
4736 - | }
|
4737 - | }
|
4738 - | /// See [`PatternString`](crate::model::PatternString).
|
4739 - | pub mod pattern_string {
|
4740 - |
|
4741 - | #[derive(Debug, PartialEq)]
|
4742 - | pub enum ConstraintViolation {
|
4743 - | /// Error when a string doesn't satisfy its `@pattern`.
|
4744 - | /// Contains the String that failed the pattern.
|
4745 - | Pattern(String),
|
4746 - | }
|
4747 - |
|
4748 - | impl ::std::fmt::Display for ConstraintViolation {
|
4749 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4750 - | let message = match self {
|
4751 - | Self::Pattern(_) => {
|
4752 - | format!(
|
4753 - | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4754 - | r#"[a-d]{5}"#
|
4755 - | )
|
4756 - | }
|
4757 - | };
|
4758 - | write!(f, "{message}")
|
4759 - | }
|
4760 - | }
|
4761 - |
|
4762 - | impl ::std::error::Error for ConstraintViolation {}
|
4763 - | impl ConstraintViolation {
|
4764 - | pub(crate) fn as_validation_exception_field(
|
4765 - | self,
|
4766 - | path: ::std::string::String,
|
4767 - | ) -> crate::model::ValidationExceptionField {
|
4768 - | match self {
|
4769 - | #[allow(unused_variables)]
|
4770 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4771 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
4772 - | path
|
4773 - | },
|
4774 - | }
|
4775 - | }
|
4776 - | }
|
4777 - | }
|
4778 - | pub mod map_of_pattern_string {
|
4779 - |
|
4780 - | #[allow(clippy::enum_variant_names)]
|
4781 - | #[derive(Debug, PartialEq)]
|
4782 - | pub enum ConstraintViolation {
|
4285 + | MaxLengthString(crate::model::max_length_string::ConstraintViolation),
|
4286 + | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
4783 4287 | #[doc(hidden)]
|
4784 - | Key(crate::model::pattern_string::ConstraintViolation),
|
4288 + | FixedLengthString(crate::model::fixed_length_string::ConstraintViolation),
|
4289 + | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
4785 4290 | #[doc(hidden)]
|
4786 - | Value(
|
4787 - | crate::model::PatternString,
|
4788 - | crate::model::pattern_string::ConstraintViolation,
|
4789 - | ),
|
4790 - | }
|
4791 - |
|
4792 - | impl ::std::fmt::Display for ConstraintViolation {
|
4793 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4794 - | match self {
|
4795 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4796 - | Self::Value(_, value_constraint_violation) => {
|
4797 - | write!(f, "{}", value_constraint_violation)
|
4798 - | }
|
4799 - | }
|
4800 - | }
|
4801 - | }
|
4802 - |
|
4803 - | impl ::std::error::Error for ConstraintViolation {}
|
4804 - | impl ConstraintViolation {
|
4805 - | pub(crate) fn as_validation_exception_field(
|
4806 - | self,
|
4807 - | path: ::std::string::String,
|
4808 - | ) -> crate::model::ValidationExceptionField {
|
4809 - | match self {
|
4810 - | Self::Key(key_constraint_violation) => {
|
4811 - | key_constraint_violation.as_validation_exception_field(path)
|
4812 - | }
|
4813 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4814 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4815 - | }
|
4816 - | }
|
4817 - | }
|
4818 - | }
|
4819 - | pub mod map_of_list_of_enum_string {
|
4820 - |
|
4821 - | #[allow(clippy::enum_variant_names)]
|
4822 - | #[derive(Debug, PartialEq)]
|
4823 - | pub enum ConstraintViolation {
|
4291 + | LengthBlob(crate::model::length_blob::ConstraintViolation),
|
4292 + | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
4824 4293 | #[doc(hidden)]
|
4825 - | Key(crate::model::enum_string::ConstraintViolation),
|
4294 + | MinLengthBlob(crate::model::min_length_blob::ConstraintViolation),
|
4295 + | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
4826 4296 | #[doc(hidden)]
|
4827 - | Value(
|
4828 - | crate::model::EnumString,
|
4829 - | crate::model::list_of_enum_string::ConstraintViolation,
|
4830 - | ),
|
4831 - | }
|
4832 - |
|
4833 - | impl ::std::fmt::Display for ConstraintViolation {
|
4834 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4835 - | match self {
|
4836 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4837 - | Self::Value(_, value_constraint_violation) => {
|
4838 - | write!(f, "{}", value_constraint_violation)
|
4839 - | }
|
4840 - | }
|
4841 - | }
|
4842 - | }
|
4843 - |
|
4844 - | impl ::std::error::Error for ConstraintViolation {}
|
4845 - | impl ConstraintViolation {
|
4846 - | pub(crate) fn as_validation_exception_field(
|
4847 - | self,
|
4848 - | path: ::std::string::String,
|
4849 - | ) -> crate::model::ValidationExceptionField {
|
4850 - | match self {
|
4851 - | Self::Key(key_constraint_violation) => {
|
4852 - | key_constraint_violation.as_validation_exception_field(path)
|
4853 - | }
|
4854 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4855 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4856 - | }
|
4857 - | }
|
4858 - | }
|
4859 - | }
|
4860 - | pub mod list_of_enum_string {
|
4861 - |
|
4862 - | #[allow(clippy::enum_variant_names)]
|
4863 - | #[derive(Debug, PartialEq)]
|
4864 - | pub enum ConstraintViolation {
|
4865 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4866 - | /// The first component of the tuple is the index in the collection where the
|
4867 - | /// first constraint violation was found.
|
4297 + | MaxLengthBlob(crate::model::max_length_blob::ConstraintViolation),
|
4298 + | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
4868 4299 | #[doc(hidden)]
|
4869 - | Member(usize, crate::model::enum_string::ConstraintViolation),
|
4870 - | }
|
4871 - |
|
4872 - | impl ::std::fmt::Display for ConstraintViolation {
|
4873 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4874 - | let message = match self {
|
4875 - | Self::Member(index, failing_member) => format!(
|
4876 - | "Value at index {index} failed to satisfy constraint. {}",
|
4877 - | failing_member
|
4878 - | ),
|
4879 - | };
|
4880 - | write!(f, "{message}")
|
4881 - | }
|
4882 - | }
|
4883 - |
|
4884 - | impl ::std::error::Error for ConstraintViolation {}
|
4885 - | impl ConstraintViolation {
|
4886 - | pub(crate) fn as_validation_exception_field(
|
4887 - | self,
|
4888 - | path: ::std::string::String,
|
4889 - | ) -> crate::model::ValidationExceptionField {
|
4890 - | match self {
|
4891 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4892 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4893 - | }
|
4894 - | }
|
4895 - | }
|
4896 - | }
|
4897 - | pub mod map_of_length_list_of_pattern_string {
|
4898 - |
|
4899 - | #[allow(clippy::enum_variant_names)]
|
4900 - | #[derive(Debug, PartialEq)]
|
4901 - | pub enum ConstraintViolation {
|
4300 + | FixedLengthBlob(crate::model::fixed_length_blob::ConstraintViolation),
|
4301 + | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
4902 4302 | #[doc(hidden)]
|
4903 - | Key(crate::model::pattern_string::ConstraintViolation),
|
4303 + | RangeInteger(crate::model::range_integer::ConstraintViolation),
|
4304 + | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
4904 4305 | #[doc(hidden)]
|
4905 - | Value(
|
4906 - | crate::model::PatternString,
|
4907 - | crate::model::length_list_of_pattern_string::ConstraintViolation,
|
4908 - | ),
|
4909 - | }
|
4910 - |
|
4911 - | impl ::std::fmt::Display for ConstraintViolation {
|
4912 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4913 - | match self {
|
4914 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4915 - | Self::Value(_, value_constraint_violation) => {
|
4916 - | write!(f, "{}", value_constraint_violation)
|
4917 - | }
|
4918 - | }
|
4919 - | }
|
4920 - | }
|
4921 - |
|
4922 - | impl ::std::error::Error for ConstraintViolation {}
|
4923 - | impl ConstraintViolation {
|
4924 - | pub(crate) fn as_validation_exception_field(
|
4925 - | self,
|
4926 - | path: ::std::string::String,
|
4927 - | ) -> crate::model::ValidationExceptionField {
|
4928 - | match self {
|
4929 - | Self::Key(key_constraint_violation) => {
|
4930 - | key_constraint_violation.as_validation_exception_field(path)
|
4931 - | }
|
4932 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4933 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4934 - | }
|
4935 - | }
|
4936 - | }
|
4937 - | }
|
4938 - | /// See [`LengthListOfPatternString`](crate::model::LengthListOfPatternString).
|
4939 - | pub mod length_list_of_pattern_string {
|
4940 - |
|
4941 - | #[allow(clippy::enum_variant_names)]
|
4942 - | #[derive(Debug, PartialEq)]
|
4943 - | pub enum ConstraintViolation {
|
4944 - | /// Constraint violation error when the list doesn't have the required length
|
4945 - | Length(usize),
|
4946 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4947 - | /// The first component of the tuple is the index in the collection where the
|
4948 - | /// first constraint violation was found.
|
4306 + | MinRangeInteger(crate::model::min_range_integer::ConstraintViolation),
|
4307 + | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
4949 4308 | #[doc(hidden)]
|
4950 - | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
4951 - | }
|
4952 - |
|
4953 - | impl ::std::fmt::Display for ConstraintViolation {
|
4954 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4955 - | let message = match self {
|
4956 - | Self::Length(length) => {
|
4957 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
4958 - | }
|
4959 - | Self::Member(index, failing_member) => format!(
|
4960 - | "Value at index {index} failed to satisfy constraint. {}",
|
4961 - | failing_member
|
4962 - | ),
|
4963 - | };
|
4964 - | write!(f, "{message}")
|
4965 - | }
|
4966 - | }
|
4967 - |
|
4968 - | impl ::std::error::Error for ConstraintViolation {}
|
4969 - | impl ConstraintViolation {
|
4970 - | pub(crate) fn as_validation_exception_field(
|
4971 - | self,
|
4972 - | path: ::std::string::String,
|
4973 - | ) -> crate::model::ValidationExceptionField {
|
4974 - | match self {
|
4975 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4976 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
4977 - | path,
|
4978 - | },
|
4979 - | Self::Member(index, member_constraint_violation) =>
|
4980 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4981 - | }
|
4982 - | }
|
4983 - | }
|
4984 - | }
|
4985 - | pub mod map_of_set_of_length_string {
|
4986 - |
|
4987 - | #[allow(clippy::enum_variant_names)]
|
4988 - | #[derive(Debug, PartialEq)]
|
4989 - | pub enum ConstraintViolation {
|
4309 + | MaxRangeInteger(crate::model::max_range_integer::ConstraintViolation),
|
4310 + | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
4990 4311 | #[doc(hidden)]
|
4991 - | Key(crate::model::length_string::ConstraintViolation),
|
4312 + | FixedValueInteger(crate::model::fixed_value_integer::ConstraintViolation),
|
4313 + | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
4992 4314 | #[doc(hidden)]
|
4993 - | Value(
|
4994 - | crate::model::LengthString,
|
4995 - | crate::model::set_of_length_string::ConstraintViolation,
|
4996 - | ),
|
4997 - | }
|
4998 - |
|
4999 - | impl ::std::fmt::Display for ConstraintViolation {
|
5000 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5001 - | match self {
|
5002 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5003 - | Self::Value(_, value_constraint_violation) => {
|
5004 - | write!(f, "{}", value_constraint_violation)
|
5005 - | }
|
5006 - | }
|
5007 - | }
|
5008 - | }
|
5009 - |
|
5010 - | impl ::std::error::Error for ConstraintViolation {}
|
5011 - | impl ConstraintViolation {
|
5012 - | pub(crate) fn as_validation_exception_field(
|
5013 - | self,
|
5014 - | path: ::std::string::String,
|
5015 - | ) -> crate::model::ValidationExceptionField {
|
5016 - | match self {
|
5017 - | Self::Key(key_constraint_violation) => {
|
5018 - | key_constraint_violation.as_validation_exception_field(path)
|
5019 - | }
|
5020 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5021 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5022 - | }
|
5023 - | }
|
5024 - | }
|
5025 - | }
|
5026 - | /// See [`SetOfLengthString`](crate::model::SetOfLengthString).
|
5027 - | pub mod set_of_length_string {
|
5028 - |
|
5029 - | #[allow(clippy::enum_variant_names)]
|
5030 - | #[derive(Debug, PartialEq)]
|
5031 - | pub enum ConstraintViolation {
|
5032 - | /// Constraint violation error when the list does not contain unique items
|
5033 - | UniqueItems {
|
5034 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
5035 - | /// at least two elements.
|
5036 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
5037 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
5038 - | /// Nothing is guaranteed about the order of the indices.
|
5039 - | duplicate_indices: ::std::vec::Vec<usize>,
|
5040 - | /// The original vector, that contains duplicate items.
|
5041 - | original: ::std::vec::Vec<crate::model::LengthString>,
|
5042 - | },
|
5043 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5044 - | /// The first component of the tuple is the index in the collection where the
|
5045 - | /// first constraint violation was found.
|
4315 + | RangeShort(crate::model::range_short::ConstraintViolation),
|
4316 + | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
5046 4317 | #[doc(hidden)]
|
5047 - | Member(usize, crate::model::length_string::ConstraintViolation),
|
5048 - | }
|
5049 - |
|
5050 - | impl ::std::fmt::Display for ConstraintViolation {
|
5051 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5052 - | let message = match self {
|
5053 - | Self::UniqueItems { duplicate_indices, .. } =>
|
5054 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
5055 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
5056 - | failing_member)
|
5057 - | };
|
5058 - | write!(f, "{message}")
|
5059 - | }
|
5060 - | }
|
5061 - |
|
5062 - | impl ::std::error::Error for ConstraintViolation {}
|
5063 - | impl ConstraintViolation {
|
5064 - | pub(crate) fn as_validation_exception_field(
|
5065 - | self,
|
5066 - | path: ::std::string::String,
|
5067 - | ) -> crate::model::ValidationExceptionField {
|
5068 - | match self {
|
5069 - | Self::UniqueItems { duplicate_indices, .. } =>
|
5070 - | crate::model::ValidationExceptionField {
|
5071 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
5072 - | path,
|
5073 - | },
|
5074 - | Self::Member(index, member_constraint_violation) =>
|
5075 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
5076 - | }
|
5077 - | }
|
5078 - | }
|
5079 - | }
|
5080 - | pub mod map_of_list_of_length_string {
|
5081 - |
|
5082 - | #[allow(clippy::enum_variant_names)]
|
5083 - | #[derive(Debug, PartialEq)]
|
5084 - | pub enum ConstraintViolation {
|
4318 + | MinRangeShort(crate::model::min_range_short::ConstraintViolation),
|
4319 + | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
5085 4320 | #[doc(hidden)]
|
5086 - | Key(crate::model::length_string::ConstraintViolation),
|
4321 + | MaxRangeShort(crate::model::max_range_short::ConstraintViolation),
|
4322 + | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
5087 4323 | #[doc(hidden)]
|
5088 - | Value(
|
5089 - | crate::model::LengthString,
|
5090 - | crate::model::list_of_length_string::ConstraintViolation,
|
5091 - | ),
|
5092 - | }
|
5093 - |
|
5094 - | impl ::std::fmt::Display for ConstraintViolation {
|
5095 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5096 - | match self {
|
5097 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5098 - | Self::Value(_, value_constraint_violation) => {
|
5099 - | write!(f, "{}", value_constraint_violation)
|
4324 + | FixedValueShort(crate::model::fixed_value_short::ConstraintViolation),
|
4325 + | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
4326 + | #[doc(hidden)]
|
4327 + | RangeLong(crate::model::range_long::ConstraintViolation),
|
4328 + | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
4329 + | #[doc(hidden)]
|
4330 + | MinRangeLong(crate::model::min_range_long::ConstraintViolation),
|
4331 + | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
4332 + | #[doc(hidden)]
|
4333 + | MaxRangeLong(crate::model::max_range_long::ConstraintViolation),
|
4334 + | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
4335 + | #[doc(hidden)]
|
4336 + | FixedValueLong(crate::model::fixed_value_long::ConstraintViolation),
|
4337 + | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
4338 + | #[doc(hidden)]
|
4339 + | RangeByte(crate::model::range_byte::ConstraintViolation),
|
4340 + | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
4341 + | #[doc(hidden)]
|
4342 + | MinRangeByte(crate::model::min_range_byte::ConstraintViolation),
|
4343 + | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
4344 + | #[doc(hidden)]
|
4345 + | MaxRangeByte(crate::model::max_range_byte::ConstraintViolation),
|
4346 + | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
4347 + | #[doc(hidden)]
|
4348 + | FixedValueByte(crate::model::fixed_value_byte::ConstraintViolation),
|
4349 + | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
4350 + | #[doc(hidden)]
|
4351 + | ConBList(crate::model::con_b_list::ConstraintViolation),
|
4352 + | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
4353 + | #[doc(hidden)]
|
4354 + | LengthList(crate::model::length_list::ConstraintViolation),
|
4355 + | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
4356 + | #[doc(hidden)]
|
4357 + | SensitiveLengthList(crate::model::sensitive_length_list::ConstraintViolation),
|
4358 + | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
4359 + | #[doc(hidden)]
|
4360 + | ConBSet(crate::model::con_b_set::ConstraintViolation),
|
4361 + | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
4362 + | #[doc(hidden)]
|
4363 + | ConBMap(crate::model::con_b_map::ConstraintViolation),
|
4364 + | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
4365 + | #[doc(hidden)]
|
4366 + | LengthMap(crate::model::length_map::ConstraintViolation),
|
4367 + | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
4368 + | #[doc(hidden)]
|
4369 + | MapOfMapOfListOfListOfConB(
|
4370 + | crate::model::map_of_map_of_list_of_list_of_con_b::ConstraintViolation,
|
4371 + | ),
|
4372 + | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
4373 + | #[doc(hidden)]
|
4374 + | SparseMap(crate::model::sparse_map::ConstraintViolation),
|
4375 + | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
4376 + | #[doc(hidden)]
|
4377 + | SparseList(crate::model::sparse_list::ConstraintViolation),
|
4378 + | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
4379 + | #[doc(hidden)]
|
4380 + | SparseLengthMap(crate::model::sparse_length_map::ConstraintViolation),
|
4381 + | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
4382 + | #[doc(hidden)]
|
4383 + | SparseLengthList(crate::model::sparse_length_list::ConstraintViolation),
|
4384 + | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
4385 + | #[doc(hidden)]
|
4386 + | ConstrainedUnion(crate::model::constrained_union::ConstraintViolation),
|
4387 + | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
4388 + | #[doc(hidden)]
|
4389 + | EnumString(crate::model::enum_string::ConstraintViolation),
|
4390 + | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
4391 + | #[doc(hidden)]
|
4392 + | ListOfLengthString(crate::model::list_of_length_string::ConstraintViolation),
|
4393 + | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
4394 + | #[doc(hidden)]
|
4395 + | SetOfLengthString(crate::model::set_of_length_string::ConstraintViolation),
|
4396 + | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
4397 + | #[doc(hidden)]
|
4398 + | MapOfLengthString(crate::model::map_of_length_string::ConstraintViolation),
|
4399 + | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
4400 + | #[doc(hidden)]
|
4401 + | ListOfLengthBlob(crate::model::list_of_length_blob::ConstraintViolation),
|
4402 + | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
4403 + | #[doc(hidden)]
|
4404 + | MapOfLengthBlob(crate::model::map_of_length_blob::ConstraintViolation),
|
4405 + | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
4406 + | #[doc(hidden)]
|
4407 + | ListOfRangeInteger(crate::model::list_of_range_integer::ConstraintViolation),
|
4408 + | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
4409 + | #[doc(hidden)]
|
4410 + | SetOfRangeInteger(crate::model::set_of_range_integer::ConstraintViolation),
|
4411 + | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
4412 + | #[doc(hidden)]
|
4413 + | MapOfRangeInteger(crate::model::map_of_range_integer::ConstraintViolation),
|
4414 + | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
4415 + | #[doc(hidden)]
|
4416 + | ListOfRangeShort(crate::model::list_of_range_short::ConstraintViolation),
|
4417 + | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
4418 + | #[doc(hidden)]
|
4419 + | SetOfRangeShort(crate::model::set_of_range_short::ConstraintViolation),
|
4420 + | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
4421 + | #[doc(hidden)]
|
4422 + | MapOfRangeShort(crate::model::map_of_range_short::ConstraintViolation),
|
4423 + | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
4424 + | #[doc(hidden)]
|
4425 + | ListOfRangeLong(crate::model::list_of_range_long::ConstraintViolation),
|
4426 + | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
4427 + | #[doc(hidden)]
|
4428 + | SetOfRangeLong(crate::model::set_of_range_long::ConstraintViolation),
|
4429 + | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
4430 + | #[doc(hidden)]
|
4431 + | MapOfRangeLong(crate::model::map_of_range_long::ConstraintViolation),
|
4432 + | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
4433 + | #[doc(hidden)]
|
4434 + | ListOfRangeByte(crate::model::list_of_range_byte::ConstraintViolation),
|
4435 + | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
4436 + | #[doc(hidden)]
|
4437 + | SetOfRangeByte(crate::model::set_of_range_byte::ConstraintViolation),
|
4438 + | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
4439 + | #[doc(hidden)]
|
4440 + | MapOfRangeByte(crate::model::map_of_range_byte::ConstraintViolation),
|
4441 + | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
4442 + | #[doc(hidden)]
|
4443 + | PatternString(crate::model::pattern_string::ConstraintViolation),
|
4444 + | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
4445 + | #[doc(hidden)]
|
4446 + | MapOfPatternString(crate::model::map_of_pattern_string::ConstraintViolation),
|
4447 + | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
4448 + | #[doc(hidden)]
|
4449 + | ListOfPatternString(crate::model::list_of_pattern_string::ConstraintViolation),
|
4450 + | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
4451 + | #[doc(hidden)]
|
4452 + | SetOfPatternString(crate::model::set_of_pattern_string::ConstraintViolation),
|
4453 + | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
4454 + | #[doc(hidden)]
|
4455 + | LengthLengthPatternString(crate::model::length_pattern_string::ConstraintViolation),
|
4456 + | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
4457 + | #[doc(hidden)]
|
4458 + | MapOfLengthPatternString(crate::model::map_of_length_pattern_string::ConstraintViolation),
|
4459 + | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
4460 + | #[doc(hidden)]
|
4461 + | ListOfLengthPatternString(crate::model::list_of_length_pattern_string::ConstraintViolation),
|
4462 + | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
4463 + | #[doc(hidden)]
|
4464 + | SetOfLengthPatternString(crate::model::set_of_length_pattern_string::ConstraintViolation),
|
4465 + | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
4466 + | #[doc(hidden)]
|
4467 + | LengthListOfPatternString(crate::model::length_list_of_pattern_string::ConstraintViolation),
|
4468 + | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
4469 + | #[doc(hidden)]
|
4470 + | LengthSetOfPatternString(crate::model::length_set_of_pattern_string::ConstraintViolation),
|
5100 4471 | }
|
4472 + | impl ::std::fmt::Display for ConstraintViolation {
|
4473 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4474 + | match self {
|
4475 + | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
4476 + | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
4477 + | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
4478 + | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
4479 + | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
4480 + | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
4481 + | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
4482 + | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
4483 + | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
4484 + | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
4485 + | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
4486 + | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
4487 + | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
4488 + | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
4489 + | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
4490 + | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
4491 + | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
4492 + | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
4493 + | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
4494 + | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
4495 + | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
4496 + | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
4497 + | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
4498 + | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
4499 + | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
4500 + | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
4501 + | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
4502 + | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
4503 + | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
4504 + | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
4505 + | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
4506 + | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
4507 + | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
4508 + | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
4509 + | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
4510 + | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
4511 + | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
4512 + | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
4513 + | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
4514 + | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
4515 + | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
4516 + | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
4517 + | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
4518 + | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
4519 + | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
4520 + | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
4521 + | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
4522 + | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
4523 + | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
4524 + | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
4525 + | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
4526 + | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
4527 + | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
4528 + | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
4529 + | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
4530 + | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
4531 + | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
4532 + | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
4533 + | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
4534 + | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
4535 + | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
4536 + | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
4537 + | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
4538 + | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
4539 + | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
4540 + | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
4541 + | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
5101 4542 | }
|
5102 4543 | }
|
5103 4544 | }
|
5104 - |
|
5105 4545 | impl ::std::error::Error for ConstraintViolation {}
|
5106 4546 | impl ConstraintViolation {
|
5107 4547 | pub(crate) fn as_validation_exception_field(
|
5108 4548 | self,
|
5109 4549 | path: ::std::string::String,
|
5110 4550 | ) -> crate::model::ValidationExceptionField {
|
5111 4551 | match self {
|
5112 - | Self::Key(key_constraint_violation) => {
|
5113 - | key_constraint_violation.as_validation_exception_field(path)
|
4552 + | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
4553 + | message: format!(
|
4554 + | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
4555 + | path
|
4556 + | ),
|
4557 + | path: path + "/conB",
|
4558 + | },
|
4559 + | ConstraintViolation::ConB(inner) => {
|
4560 + | inner.as_validation_exception_field(path + "/conB")
|
5114 4561 | }
|
5115 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5116 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4562 + | ConstraintViolation::OptConB(inner) => {
|
4563 + | inner.as_validation_exception_field(path + "/optConB")
|
5117 4564 | }
|
4565 + | ConstraintViolation::LengthString(inner) => {
|
4566 + | inner.as_validation_exception_field(path + "/lengthString")
|
5118 4567 | }
|
4568 + | ConstraintViolation::MinLengthString(inner) => {
|
4569 + | inner.as_validation_exception_field(path + "/minLengthString")
|
5119 4570 | }
|
5120 - | }
|
5121 - | pub mod list_of_length_string {
|
5122 - |
|
5123 - | #[allow(clippy::enum_variant_names)]
|
5124 - | #[derive(Debug, PartialEq)]
|
5125 - | pub enum ConstraintViolation {
|
5126 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5127 - | /// The first component of the tuple is the index in the collection where the
|
5128 - | /// first constraint violation was found.
|
5129 - | #[doc(hidden)]
|
5130 - | Member(usize, crate::model::length_string::ConstraintViolation),
|
4571 + | ConstraintViolation::MaxLengthString(inner) => {
|
4572 + | inner.as_validation_exception_field(path + "/maxLengthString")
|
5131 4573 | }
|
5132 - |
|
5133 - | impl ::std::fmt::Display for ConstraintViolation {
|
5134 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5135 - | let message = match self {
|
5136 - | Self::Member(index, failing_member) => format!(
|
5137 - | "Value at index {index} failed to satisfy constraint. {}",
|
5138 - | failing_member
|
5139 - | ),
|
5140 - | };
|
5141 - | write!(f, "{message}")
|
4574 + | ConstraintViolation::FixedLengthString(inner) => {
|
4575 + | inner.as_validation_exception_field(path + "/fixedLengthString")
|
5142 4576 | }
|
4577 + | ConstraintViolation::LengthBlob(inner) => {
|
4578 + | inner.as_validation_exception_field(path + "/lengthBlob")
|
5143 4579 | }
|
5144 - |
|
5145 - | impl ::std::error::Error for ConstraintViolation {}
|
5146 - | impl ConstraintViolation {
|
5147 - | pub(crate) fn as_validation_exception_field(
|
5148 - | self,
|
5149 - | path: ::std::string::String,
|
5150 - | ) -> crate::model::ValidationExceptionField {
|
5151 - | match self {
|
5152 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5153 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4580 + | ConstraintViolation::MinLengthBlob(inner) => {
|
4581 + | inner.as_validation_exception_field(path + "/minLengthBlob")
|
5154 4582 | }
|
4583 + | ConstraintViolation::MaxLengthBlob(inner) => {
|
4584 + | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
5155 4585 | }
|
4586 + | ConstraintViolation::FixedLengthBlob(inner) => {
|
4587 + | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
5156 4588 | }
|
5157 - | }
|
5158 - | pub mod map_of_length_string {
|
5159 - |
|
5160 - | #[allow(clippy::enum_variant_names)]
|
5161 - | #[derive(Debug, PartialEq)]
|
5162 - | pub enum ConstraintViolation {
|
5163 - | #[doc(hidden)]
|
5164 - | Key(crate::model::length_string::ConstraintViolation),
|
5165 - | #[doc(hidden)]
|
5166 - | Value(
|
5167 - | crate::model::LengthString,
|
5168 - | crate::model::length_string::ConstraintViolation,
|
5169 - | ),
|
4589 + | ConstraintViolation::RangeInteger(inner) => {
|
4590 + | inner.as_validation_exception_field(path + "/rangeInteger")
|
5170 4591 | }
|
5171 - |
|
5172 - | impl ::std::fmt::Display for ConstraintViolation {
|
5173 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5174 - | match self {
|
5175 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5176 - | Self::Value(_, value_constraint_violation) => {
|
5177 - | write!(f, "{}", value_constraint_violation)
|
4592 + | ConstraintViolation::MinRangeInteger(inner) => {
|
4593 + | inner.as_validation_exception_field(path + "/minRangeInteger")
|
5178 4594 | }
|
4595 + | ConstraintViolation::MaxRangeInteger(inner) => {
|
4596 + | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
5179 4597 | }
|
4598 + | ConstraintViolation::FixedValueInteger(inner) => {
|
4599 + | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
5180 4600 | }
|
4601 + | ConstraintViolation::RangeShort(inner) => {
|
4602 + | inner.as_validation_exception_field(path + "/rangeShort")
|
5181 4603 | }
|
5182 - |
|
5183 - | impl ::std::error::Error for ConstraintViolation {}
|
5184 - | impl ConstraintViolation {
|
5185 - | pub(crate) fn as_validation_exception_field(
|
5186 - | self,
|
5187 - | path: ::std::string::String,
|
5188 - | ) -> crate::model::ValidationExceptionField {
|
5189 - | match self {
|
5190 - | Self::Key(key_constraint_violation) => {
|
5191 - | key_constraint_violation.as_validation_exception_field(path)
|
4604 + | ConstraintViolation::MinRangeShort(inner) => {
|
4605 + | inner.as_validation_exception_field(path + "/minRangeShort")
|
5192 4606 | }
|
5193 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5194 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4607 + | ConstraintViolation::MaxRangeShort(inner) => {
|
4608 + | inner.as_validation_exception_field(path + "/maxRangeShort")
|
5195 4609 | }
|
4610 + | ConstraintViolation::FixedValueShort(inner) => {
|
4611 + | inner.as_validation_exception_field(path + "/fixedValueShort")
|
5196 4612 | }
|
4613 + | ConstraintViolation::RangeLong(inner) => {
|
4614 + | inner.as_validation_exception_field(path + "/rangeLong")
|
5197 4615 | }
|
5198 - | }
|
5199 - | pub mod recursive_list {
|
5200 - |
|
5201 - | #[allow(clippy::enum_variant_names)]
|
5202 - | #[derive(Debug, PartialEq)]
|
5203 - | pub enum ConstraintViolation {
|
5204 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5205 - | /// The first component of the tuple is the index in the collection where the
|
5206 - | /// first constraint violation was found.
|
5207 - | #[doc(hidden)]
|
5208 - | Member(
|
5209 - | usize,
|
5210 - | crate::model::recursive_shapes_input_output_nested1::ConstraintViolation,
|
5211 - | ),
|
4616 + | ConstraintViolation::MinRangeLong(inner) => {
|
4617 + | inner.as_validation_exception_field(path + "/minRangeLong")
|
5212 4618 | }
|
5213 - |
|
5214 - | impl ::std::fmt::Display for ConstraintViolation {
|
5215 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5216 - | let message = match self {
|
5217 - | Self::Member(index, failing_member) => format!(
|
5218 - | "Value at index {index} failed to satisfy constraint. {}",
|
5219 - | failing_member
|
5220 - | ),
|
5221 - | };
|
5222 - | write!(f, "{message}")
|
4619 + | ConstraintViolation::MaxRangeLong(inner) => {
|
4620 + | inner.as_validation_exception_field(path + "/maxRangeLong")
|
5223 4621 | }
|
4622 + | ConstraintViolation::FixedValueLong(inner) => {
|
4623 + | inner.as_validation_exception_field(path + "/fixedValueLong")
|
5224 4624 | }
|
5225 - |
|
5226 - | impl ::std::error::Error for ConstraintViolation {}
|
5227 - | impl ConstraintViolation {
|
5228 - | pub(crate) fn as_validation_exception_field(
|
5229 - | self,
|
5230 - | path: ::std::string::String,
|
5231 - | ) -> crate::model::ValidationExceptionField {
|
5232 - | match self {
|
5233 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5234 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4625 + | ConstraintViolation::RangeByte(inner) => {
|
4626 + | inner.as_validation_exception_field(path + "/rangeByte")
|
5235 4627 | }
|
4628 + | ConstraintViolation::MinRangeByte(inner) => {
|
4629 + | inner.as_validation_exception_field(path + "/minRangeByte")
|
5236 4630 | }
|
4631 + | ConstraintViolation::MaxRangeByte(inner) => {
|
4632 + | inner.as_validation_exception_field(path + "/maxRangeByte")
|
5237 4633 | }
|
5238 - | }
|
5239 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5240 - | pub mod recursive_shapes_input_output_nested1 {
|
5241 - |
|
5242 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5243 - | /// Holds one variant for each of the ways the builder can fail.
|
5244 - | #[non_exhaustive]
|
5245 - | #[allow(clippy::enum_variant_names)]
|
5246 - | pub enum ConstraintViolation {
|
5247 - | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
5248 - | MissingRecursiveMember,
|
5249 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
5250 - | #[doc(hidden)]
|
5251 - | RecursiveMember(
|
5252 - | ::std::boxed::Box<
|
5253 - | crate::model::recursive_shapes_input_output_nested2::ConstraintViolation,
|
5254 - | >,
|
5255 - | ),
|
4634 + | ConstraintViolation::FixedValueByte(inner) => {
|
4635 + | inner.as_validation_exception_field(path + "/fixedValueByte")
|
5256 4636 | }
|
5257 - | impl ::std::fmt::Display for ConstraintViolation {
|
5258 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5259 - | match self {
|
5260 - | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5261 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
4637 + | ConstraintViolation::ConBList(inner) => {
|
4638 + | inner.as_validation_exception_field(path + "/conBList")
|
5262 4639 | }
|
4640 + | ConstraintViolation::LengthList(inner) => {
|
4641 + | inner.as_validation_exception_field(path + "/lengthList")
|
5263 4642 | }
|
4643 + | ConstraintViolation::SensitiveLengthList(inner) => {
|
4644 + | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
5264 4645 | }
|
5265 - | impl ::std::error::Error for ConstraintViolation {}
|
5266 - | impl ConstraintViolation {
|
5267 - | pub(crate) fn as_validation_exception_field(
|
5268 - | self,
|
5269 - | path: ::std::string::String,
|
5270 - | ) -> crate::model::ValidationExceptionField {
|
5271 - | match self {
|
5272 - | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
5273 - | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
5274 - | path: path + "/recursiveMember",
|
5275 - | },
|
5276 - | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
4646 + | ConstraintViolation::ConBSet(inner) => {
|
4647 + | inner.as_validation_exception_field(path + "/conBSet")
|
5277 4648 | }
|
4649 + | ConstraintViolation::ConBMap(inner) => {
|
4650 + | inner.as_validation_exception_field(path + "/conBMap")
|
5278 4651 | }
|
4652 + | ConstraintViolation::LengthMap(inner) => {
|
4653 + | inner.as_validation_exception_field(path + "/lengthMap")
|
5279 4654 | }
|
5280 - | impl ::std::convert::From<Builder>
|
5281 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
5282 - | {
|
5283 - | fn from(builder: Builder) -> Self {
|
5284 - | Self::Unconstrained(builder)
|
4655 + | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
4656 + | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
5285 4657 | }
|
4658 + | ConstraintViolation::SparseMap(inner) => {
|
4659 + | inner.as_validation_exception_field(path + "/sparseMap")
|
5286 4660 | }
|
5287 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
5288 - | type Error = ConstraintViolation;
|
5289 - |
|
5290 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5291 - | builder.build()
|
4661 + | ConstraintViolation::SparseList(inner) => {
|
4662 + | inner.as_validation_exception_field(path + "/sparseList")
|
5292 4663 | }
|
4664 + | ConstraintViolation::SparseLengthMap(inner) => {
|
4665 + | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
5293 4666 | }
|
5294 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5295 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5296 - | pub struct Builder {
|
5297 - | pub(crate) recursive_member: ::std::option::Option<
|
5298 - | ::std::boxed::Box<
|
5299 - | crate::constrained::MaybeConstrained<
|
5300 - | crate::model::RecursiveShapesInputOutputNested2,
|
5301 - | >,
|
5302 - | >,
|
5303 - | >,
|
4667 + | ConstraintViolation::SparseLengthList(inner) => {
|
4668 + | inner.as_validation_exception_field(path + "/sparseLengthList")
|
5304 4669 | }
|
5305 - | impl Builder {
|
5306 - | #[allow(missing_docs)] // documentation missing in model
|
5307 - | #[allow(clippy::boxed_local)]
|
5308 - | pub fn recursive_member(
|
5309 - | mut self,
|
5310 - | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
5311 - | ) -> Self {
|
5312 - | self.recursive_member = Some(Box::new(
|
5313 - | crate::constrained::MaybeConstrained::Constrained(*input),
|
5314 - | ));
|
5315 - | self
|
4670 + | ConstraintViolation::ConstrainedUnion(inner) => {
|
4671 + | inner.as_validation_exception_field(path + "/constrainedUnion")
|
5316 4672 | }
|
5317 - | #[allow(missing_docs)] // documentation missing in model
|
5318 - | pub(crate) fn set_recursive_member(
|
5319 - | mut self,
|
5320 - | input: impl ::std::convert::Into<
|
5321 - | ::std::boxed::Box<
|
5322 - | crate::constrained::MaybeConstrained<
|
5323 - | crate::model::RecursiveShapesInputOutputNested2,
|
5324 - | >,
|
5325 - | >,
|
5326 - | >,
|
5327 - | ) -> Self {
|
5328 - | self.recursive_member = Some(input.into());
|
5329 - | self
|
4673 + | ConstraintViolation::EnumString(inner) => {
|
4674 + | inner.as_validation_exception_field(path + "/enumString")
|
5330 4675 | }
|
5331 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5332 - | ///
|
5333 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
5334 - | ///
|
5335 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
5336 - | pub fn build(
|
5337 - | self,
|
5338 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5339 - | self.build_enforcing_all_constraints()
|
4676 + | ConstraintViolation::ListOfLengthString(inner) => {
|
4677 + | inner.as_validation_exception_field(path + "/listOfLengthString")
|
5340 4678 | }
|
5341 - | fn build_enforcing_all_constraints(
|
5342 - | self,
|
5343 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5344 - | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
5345 - | recursive_member: self
|
5346 - | .recursive_member
|
5347 - | .map(|v| match *v {
|
5348 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
5349 - | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
5350 - | Ok(Box::new(x.try_into()?))
|
4679 + | ConstraintViolation::SetOfLengthString(inner) => {
|
4680 + | inner.as_validation_exception_field(path + "/setOfLengthString")
|
5351 4681 | }
|
5352 - | })
|
5353 - | .map(|res| {
|
5354 - | res.map_err(Box::new)
|
5355 - | .map_err(ConstraintViolation::RecursiveMember)
|
5356 - | })
|
5357 - | .transpose()?
|
5358 - | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
5359 - | })
|
4682 + | ConstraintViolation::MapOfLengthString(inner) => {
|
4683 + | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
5360 4684 | }
|
4685 + | ConstraintViolation::ListOfLengthBlob(inner) => {
|
4686 + | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
5361 4687 | }
|
5362 - | }
|
5363 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5364 - | pub mod recursive_shapes_input_output_nested2 {
|
5365 - |
|
5366 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5367 - | /// Holds one variant for each of the ways the builder can fail.
|
5368 - | #[non_exhaustive]
|
5369 - | #[allow(clippy::enum_variant_names)]
|
5370 - | pub enum ConstraintViolation {
|
5371 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
5372 - | #[doc(hidden)]
|
5373 - | RecursiveMember(crate::model::recursive_shapes_input_output_nested1::ConstraintViolation),
|
4688 + | ConstraintViolation::MapOfLengthBlob(inner) => {
|
4689 + | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
5374 4690 | }
|
5375 - | impl ::std::fmt::Display for ConstraintViolation {
|
5376 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5377 - | match self {
|
5378 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
4691 + | ConstraintViolation::ListOfRangeInteger(inner) => {
|
4692 + | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
5379 4693 | }
|
4694 + | ConstraintViolation::SetOfRangeInteger(inner) => {
|
4695 + | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
5380 4696 | }
|
4697 + | ConstraintViolation::MapOfRangeInteger(inner) => {
|
4698 + | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
5381 4699 | }
|
5382 - | impl ::std::error::Error for ConstraintViolation {}
|
5383 - | impl ConstraintViolation {
|
5384 - | pub(crate) fn as_validation_exception_field(
|
5385 - | self,
|
5386 - | path: ::std::string::String,
|
5387 - | ) -> crate::model::ValidationExceptionField {
|
5388 - | match self {
|
5389 - | ConstraintViolation::RecursiveMember(inner) => {
|
5390 - | inner.as_validation_exception_field(path + "/recursiveMember")
|
4700 + | ConstraintViolation::ListOfRangeShort(inner) => {
|
4701 + | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
5391 4702 | }
|
4703 + | ConstraintViolation::SetOfRangeShort(inner) => {
|
4704 + | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
5392 4705 | }
|
4706 + | ConstraintViolation::MapOfRangeShort(inner) => {
|
4707 + | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
5393 4708 | }
|
4709 + | ConstraintViolation::ListOfRangeLong(inner) => {
|
4710 + | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
5394 4711 | }
|
5395 - | impl ::std::convert::From<Builder>
|
5396 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
5397 - | {
|
4712 + | ConstraintViolation::SetOfRangeLong(inner) => {
|
4713 + | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
4714 + | }
|
4715 + | ConstraintViolation::MapOfRangeLong(inner) => {
|
4716 + | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
4717 + | }
|
4718 + | ConstraintViolation::ListOfRangeByte(inner) => {
|
4719 + | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
4720 + | }
|
4721 + | ConstraintViolation::SetOfRangeByte(inner) => {
|
4722 + | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
4723 + | }
|
4724 + | ConstraintViolation::MapOfRangeByte(inner) => {
|
4725 + | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
4726 + | }
|
4727 + | ConstraintViolation::PatternString(inner) => {
|
4728 + | inner.as_validation_exception_field(path + "/patternString")
|
4729 + | }
|
4730 + | ConstraintViolation::MapOfPatternString(inner) => {
|
4731 + | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
4732 + | }
|
4733 + | ConstraintViolation::ListOfPatternString(inner) => {
|
4734 + | inner.as_validation_exception_field(path + "/listOfPatternString")
|
4735 + | }
|
4736 + | ConstraintViolation::SetOfPatternString(inner) => {
|
4737 + | inner.as_validation_exception_field(path + "/setOfPatternString")
|
4738 + | }
|
4739 + | ConstraintViolation::LengthLengthPatternString(inner) => {
|
4740 + | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
4741 + | }
|
4742 + | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
4743 + | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
4744 + | }
|
4745 + | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
4746 + | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
4747 + | }
|
4748 + | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
4749 + | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
4750 + | }
|
4751 + | ConstraintViolation::LengthListOfPatternString(inner) => {
|
4752 + | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
4753 + | }
|
4754 + | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
4755 + | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
4756 + | }
|
4757 + | }
|
4758 + | }
|
4759 + | }
|
4760 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
5398 4761 | fn from(builder: Builder) -> Self {
|
5399 4762 | Self::Unconstrained(builder)
|
5400 4763 | }
|
5401 4764 | }
|
5402 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
4765 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
5403 4766 | type Error = ConstraintViolation;
|
5404 4767 |
|
5405 4768 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5406 4769 | builder.build()
|
5407 4770 | }
|
5408 4771 | }
|
5409 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4772 + | /// A builder for [`ConA`](crate::model::ConA).
|
5410 4773 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5411 4774 | pub struct Builder {
|
5412 - | pub(crate) recursive_member: ::std::option::Option<
|
5413 - | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
5414 - | >,
|
4775 + | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
4776 + | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
4777 + | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
4778 + | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
4779 + | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
4780 + | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
4781 + | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
4782 + | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
4783 + | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
4784 + | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
4785 + | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
4786 + | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
4787 + | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
4788 + | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
4789 + | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
4790 + | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
4791 + | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
4792 + | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
4793 + | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
4794 + | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
4795 + | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
4796 + | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
4797 + | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
4798 + | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
4799 + | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
4800 + | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
4801 + | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
4802 + | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
4803 + | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
4804 + | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
4805 + | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
4806 + | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
4807 + | 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>>,
|
4808 + | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
4809 + | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
4810 + | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
4811 + | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
4812 + | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
4813 + | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
4814 + | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
4815 + | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
4816 + | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
4817 + | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
4818 + | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
4819 + | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
4820 + | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
4821 + | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
4822 + | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
4823 + | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
4824 + | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
4825 + | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
4826 + | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
4827 + | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
4828 + | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
4829 + | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
4830 + | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
4831 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
4832 + | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
4833 + | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
4834 + | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
4835 + | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
4836 + | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
4837 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
4838 + | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
4839 + | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
4840 + | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
4841 + | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
5415 4842 | }
|
5416 4843 | impl Builder {
|
5417 4844 | #[allow(missing_docs)] // documentation missing in model
|
5418 - | pub fn recursive_member(
|
4845 + | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
4846 + | self.con_b = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
4847 + | self
|
4848 + | }
|
4849 + | #[allow(missing_docs)] // documentation missing in model
|
4850 + | pub(crate) fn set_con_b(
|
5419 4851 | mut self,
|
5420 - | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4852 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5421 4853 | ) -> Self {
|
5422 - | self.recursive_member = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4854 + | self.con_b = Some(input.into());
|
5423 4855 | self
|
5424 4856 | }
|
5425 4857 | #[allow(missing_docs)] // documentation missing in model
|
5426 - | pub(crate) fn set_recursive_member(
|
4858 + | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
4859 + | self.opt_con_b = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4860 + | self
|
4861 + | }
|
4862 + | #[allow(missing_docs)] // documentation missing in model
|
4863 + | pub(crate) fn set_opt_con_b(
|
5427 4864 | mut self,
|
5428 4865 | input: Option<
|
5429 - | impl ::std::convert::Into<
|
5430 - | crate::constrained::MaybeConstrained<
|
5431 - | crate::model::RecursiveShapesInputOutputNested1,
|
4866 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5432 4867 | >,
|
4868 + | ) -> Self {
|
4869 + | self.opt_con_b = input.map(|v| v.into());
|
4870 + | self
|
4871 + | }
|
4872 + | #[allow(missing_docs)] // documentation missing in model
|
4873 + | pub fn length_string(
|
4874 + | mut self,
|
4875 + | input: ::std::option::Option<crate::model::LengthString>,
|
4876 + | ) -> Self {
|
4877 + | self.length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4878 + | self
|
4879 + | }
|
4880 + | #[allow(missing_docs)] // documentation missing in model
|
4881 + | pub(crate) fn set_length_string(
|
4882 + | mut self,
|
4883 + | input: Option<
|
4884 + | impl ::std::convert::Into<
|
4885 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
5433 4886 | >,
|
5434 4887 | >,
|
5435 4888 | ) -> Self {
|
5436 - | self.recursive_member = input.map(|v| v.into());
|
4889 + | self.length_string = input.map(|v| v.into());
|
5437 4890 | self
|
5438 4891 | }
|
5439 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5440 - | ///
|
5441 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
5442 - | ///
|
5443 - | pub fn build(
|
5444 - | self,
|
5445 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5446 - | self.build_enforcing_all_constraints()
|
5447 - | }
|
5448 - | fn build_enforcing_all_constraints(
|
5449 - | self,
|
5450 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5451 - | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
5452 - | recursive_member: self
|
5453 - | .recursive_member
|
5454 - | .map(|v| match v {
|
5455 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5456 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5457 - | })
|
5458 - | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
5459 - | .transpose()?,
|
5460 - | })
|
4892 + | #[allow(missing_docs)] // documentation missing in model
|
4893 + | pub fn min_length_string(
|
4894 + | mut self,
|
4895 + | input: ::std::option::Option<crate::model::MinLengthString>,
|
4896 + | ) -> Self {
|
4897 + | self.min_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4898 + | self
|
5461 4899 | }
|
4900 + | #[allow(missing_docs)] // documentation missing in model
|
4901 + | pub(crate) fn set_min_length_string(
|
4902 + | mut self,
|
4903 + | input: Option<
|
4904 + | impl ::std::convert::Into<
|
4905 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
4906 + | >,
|
4907 + | >,
|
4908 + | ) -> Self {
|
4909 + | self.min_length_string = input.map(|v| v.into());
|
4910 + | self
|
5462 4911 | }
|
5463 - | }
|
5464 - | /// See [`ConA`](crate::model::ConA).
|
5465 - | pub mod con_a {
|
5466 - |
|
5467 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5468 - | /// Holds one variant for each of the ways the builder can fail.
|
5469 - | #[non_exhaustive]
|
5470 - | #[allow(clippy::enum_variant_names)]
|
5471 - | pub enum ConstraintViolation {
|
5472 - | /// `con_b` was not provided but it is required when building `ConA`.
|
5473 - | MissingConB,
|
5474 - | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
5475 - | #[doc(hidden)]
|
5476 - | ConB(crate::model::con_b::ConstraintViolation),
|
5477 - | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
5478 - | #[doc(hidden)]
|
5479 - | OptConB(crate::model::con_b::ConstraintViolation),
|
5480 - | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
5481 - | #[doc(hidden)]
|
5482 - | LengthString(crate::model::length_string::ConstraintViolation),
|
5483 - | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
5484 - | #[doc(hidden)]
|
5485 - | MinLengthString(crate::model::min_length_string::ConstraintViolation),
|
5486 - | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
5487 - | #[doc(hidden)]
|
5488 - | MaxLengthString(crate::model::max_length_string::ConstraintViolation),
|
5489 - | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
5490 - | #[doc(hidden)]
|
5491 - | FixedLengthString(crate::model::fixed_length_string::ConstraintViolation),
|
5492 - | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
5493 - | #[doc(hidden)]
|
5494 - | LengthBlob(crate::model::length_blob::ConstraintViolation),
|
5495 - | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
5496 - | #[doc(hidden)]
|
5497 - | MinLengthBlob(crate::model::min_length_blob::ConstraintViolation),
|
5498 - | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
5499 - | #[doc(hidden)]
|
5500 - | MaxLengthBlob(crate::model::max_length_blob::ConstraintViolation),
|
5501 - | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
5502 - | #[doc(hidden)]
|
5503 - | FixedLengthBlob(crate::model::fixed_length_blob::ConstraintViolation),
|
5504 - | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
5505 - | #[doc(hidden)]
|
5506 - | RangeInteger(crate::model::range_integer::ConstraintViolation),
|
5507 - | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
5508 - | #[doc(hidden)]
|
5509 - | MinRangeInteger(crate::model::min_range_integer::ConstraintViolation),
|
5510 - | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
5511 - | #[doc(hidden)]
|
5512 - | MaxRangeInteger(crate::model::max_range_integer::ConstraintViolation),
|
5513 - | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
5514 - | #[doc(hidden)]
|
5515 - | FixedValueInteger(crate::model::fixed_value_integer::ConstraintViolation),
|
5516 - | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
5517 - | #[doc(hidden)]
|
5518 - | RangeShort(crate::model::range_short::ConstraintViolation),
|
5519 - | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
5520 - | #[doc(hidden)]
|
5521 - | MinRangeShort(crate::model::min_range_short::ConstraintViolation),
|
5522 - | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
5523 - | #[doc(hidden)]
|
5524 - | MaxRangeShort(crate::model::max_range_short::ConstraintViolation),
|
5525 - | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
5526 - | #[doc(hidden)]
|
5527 - | FixedValueShort(crate::model::fixed_value_short::ConstraintViolation),
|
5528 - | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
5529 - | #[doc(hidden)]
|
5530 - | RangeLong(crate::model::range_long::ConstraintViolation),
|
5531 - | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
5532 - | #[doc(hidden)]
|
5533 - | MinRangeLong(crate::model::min_range_long::ConstraintViolation),
|
5534 - | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
5535 - | #[doc(hidden)]
|
5536 - | MaxRangeLong(crate::model::max_range_long::ConstraintViolation),
|
5537 - | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
5538 - | #[doc(hidden)]
|
5539 - | FixedValueLong(crate::model::fixed_value_long::ConstraintViolation),
|
5540 - | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
5541 - | #[doc(hidden)]
|
5542 - | RangeByte(crate::model::range_byte::ConstraintViolation),
|
5543 - | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
5544 - | #[doc(hidden)]
|
5545 - | MinRangeByte(crate::model::min_range_byte::ConstraintViolation),
|
5546 - | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
5547 - | #[doc(hidden)]
|
5548 - | MaxRangeByte(crate::model::max_range_byte::ConstraintViolation),
|
5549 - | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
5550 - | #[doc(hidden)]
|
5551 - | FixedValueByte(crate::model::fixed_value_byte::ConstraintViolation),
|
5552 - | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
5553 - | #[doc(hidden)]
|
5554 - | ConBList(crate::model::con_b_list::ConstraintViolation),
|
5555 - | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
5556 - | #[doc(hidden)]
|
5557 - | LengthList(crate::model::length_list::ConstraintViolation),
|
5558 - | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
5559 - | #[doc(hidden)]
|
5560 - | SensitiveLengthList(crate::model::sensitive_length_list::ConstraintViolation),
|
5561 - | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
5562 - | #[doc(hidden)]
|
5563 - | ConBSet(crate::model::con_b_set::ConstraintViolation),
|
5564 - | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
5565 - | #[doc(hidden)]
|
5566 - | ConBMap(crate::model::con_b_map::ConstraintViolation),
|
5567 - | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
5568 - | #[doc(hidden)]
|
5569 - | LengthMap(crate::model::length_map::ConstraintViolation),
|
5570 - | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
5571 - | #[doc(hidden)]
|
5572 - | MapOfMapOfListOfListOfConB(
|
5573 - | crate::model::map_of_map_of_list_of_list_of_con_b::ConstraintViolation,
|
5574 - | ),
|
5575 - | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
5576 - | #[doc(hidden)]
|
5577 - | SparseMap(crate::model::sparse_map::ConstraintViolation),
|
5578 - | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
5579 - | #[doc(hidden)]
|
5580 - | SparseList(crate::model::sparse_list::ConstraintViolation),
|
5581 - | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
5582 - | #[doc(hidden)]
|
5583 - | SparseLengthMap(crate::model::sparse_length_map::ConstraintViolation),
|
5584 - | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
5585 - | #[doc(hidden)]
|
5586 - | SparseLengthList(crate::model::sparse_length_list::ConstraintViolation),
|
5587 - | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
5588 - | #[doc(hidden)]
|
5589 - | ConstrainedUnion(crate::model::constrained_union::ConstraintViolation),
|
5590 - | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
5591 - | #[doc(hidden)]
|
5592 - | EnumString(crate::model::enum_string::ConstraintViolation),
|
5593 - | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
5594 - | #[doc(hidden)]
|
5595 - | ListOfLengthString(crate::model::list_of_length_string::ConstraintViolation),
|
5596 - | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
5597 - | #[doc(hidden)]
|
5598 - | SetOfLengthString(crate::model::set_of_length_string::ConstraintViolation),
|
5599 - | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
5600 - | #[doc(hidden)]
|
5601 - | MapOfLengthString(crate::model::map_of_length_string::ConstraintViolation),
|
5602 - | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
5603 - | #[doc(hidden)]
|
5604 - | ListOfLengthBlob(crate::model::list_of_length_blob::ConstraintViolation),
|
5605 - | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
5606 - | #[doc(hidden)]
|
5607 - | MapOfLengthBlob(crate::model::map_of_length_blob::ConstraintViolation),
|
5608 - | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
5609 - | #[doc(hidden)]
|
5610 - | ListOfRangeInteger(crate::model::list_of_range_integer::ConstraintViolation),
|
5611 - | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
5612 - | #[doc(hidden)]
|
5613 - | SetOfRangeInteger(crate::model::set_of_range_integer::ConstraintViolation),
|
5614 - | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
5615 - | #[doc(hidden)]
|
5616 - | MapOfRangeInteger(crate::model::map_of_range_integer::ConstraintViolation),
|
5617 - | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
5618 - | #[doc(hidden)]
|
5619 - | ListOfRangeShort(crate::model::list_of_range_short::ConstraintViolation),
|
5620 - | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
5621 - | #[doc(hidden)]
|
5622 - | SetOfRangeShort(crate::model::set_of_range_short::ConstraintViolation),
|
5623 - | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
5624 - | #[doc(hidden)]
|
5625 - | MapOfRangeShort(crate::model::map_of_range_short::ConstraintViolation),
|
5626 - | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
5627 - | #[doc(hidden)]
|
5628 - | ListOfRangeLong(crate::model::list_of_range_long::ConstraintViolation),
|
5629 - | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
5630 - | #[doc(hidden)]
|
5631 - | SetOfRangeLong(crate::model::set_of_range_long::ConstraintViolation),
|
5632 - | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
5633 - | #[doc(hidden)]
|
5634 - | MapOfRangeLong(crate::model::map_of_range_long::ConstraintViolation),
|
5635 - | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
5636 - | #[doc(hidden)]
|
5637 - | ListOfRangeByte(crate::model::list_of_range_byte::ConstraintViolation),
|
5638 - | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
5639 - | #[doc(hidden)]
|
5640 - | SetOfRangeByte(crate::model::set_of_range_byte::ConstraintViolation),
|
5641 - | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
5642 - | #[doc(hidden)]
|
5643 - | MapOfRangeByte(crate::model::map_of_range_byte::ConstraintViolation),
|
5644 - | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
5645 - | #[doc(hidden)]
|
5646 - | PatternString(crate::model::pattern_string::ConstraintViolation),
|
5647 - | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
5648 - | #[doc(hidden)]
|
5649 - | MapOfPatternString(crate::model::map_of_pattern_string::ConstraintViolation),
|
5650 - | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
5651 - | #[doc(hidden)]
|
5652 - | ListOfPatternString(crate::model::list_of_pattern_string::ConstraintViolation),
|
5653 - | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
5654 - | #[doc(hidden)]
|
5655 - | SetOfPatternString(crate::model::set_of_pattern_string::ConstraintViolation),
|
5656 - | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
5657 - | #[doc(hidden)]
|
5658 - | LengthLengthPatternString(crate::model::length_pattern_string::ConstraintViolation),
|
5659 - | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
5660 - | #[doc(hidden)]
|
5661 - | MapOfLengthPatternString(crate::model::map_of_length_pattern_string::ConstraintViolation),
|
5662 - | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
5663 - | #[doc(hidden)]
|
5664 - | ListOfLengthPatternString(crate::model::list_of_length_pattern_string::ConstraintViolation),
|
5665 - | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
5666 - | #[doc(hidden)]
|
5667 - | SetOfLengthPatternString(crate::model::set_of_length_pattern_string::ConstraintViolation),
|
5668 - | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
5669 - | #[doc(hidden)]
|
5670 - | LengthListOfPatternString(crate::model::length_list_of_pattern_string::ConstraintViolation),
|
5671 - | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
5672 - | #[doc(hidden)]
|
5673 - | LengthSetOfPatternString(crate::model::length_set_of_pattern_string::ConstraintViolation),
|
4912 + | #[allow(missing_docs)] // documentation missing in model
|
4913 + | pub fn max_length_string(
|
4914 + | mut self,
|
4915 + | input: ::std::option::Option<crate::model::MaxLengthString>,
|
4916 + | ) -> Self {
|
4917 + | self.max_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4918 + | self
|
5674 4919 | }
|
5675 - | impl ::std::fmt::Display for ConstraintViolation {
|
5676 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5677 - | match self {
|
5678 - | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
5679 - | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
5680 - | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
5681 - | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
5682 - | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
5683 - | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
5684 - | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
5685 - | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
5686 - | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
5687 - | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
5688 - | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
5689 - | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
5690 - | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
5691 - | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
5692 - | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
5693 - | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
5694 - | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
5695 - | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
5696 - | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
5697 - | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
5698 - | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
5699 - | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
5700 - | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
5701 - | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
5702 - | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
5703 - | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
5704 - | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
5705 - | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
5706 - | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
5707 - | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
5708 - | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
5709 - | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
5710 - | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
5711 - | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
5712 - | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
5713 - | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
5714 - | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
5715 - | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
5716 - | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
5717 - | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
5718 - | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
5719 - | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
5720 - | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
5721 - | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
5722 - | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
5723 - | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
5724 - | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
5725 - | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
5726 - | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
5727 - | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
5728 - | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
5729 - | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
5730 - | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
5731 - | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
5732 - | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
5733 - | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
5734 - | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
5735 - | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
5736 - | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
5737 - | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
5738 - | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
5739 - | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
5740 - | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
5741 - | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
5742 - | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
5743 - | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
5744 - | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
4920 + | #[allow(missing_docs)] // documentation missing in model
|
4921 + | pub(crate) fn set_max_length_string(
|
4922 + | mut self,
|
4923 + | input: Option<
|
4924 + | impl ::std::convert::Into<
|
4925 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
4926 + | >,
|
4927 + | >,
|
4928 + | ) -> Self {
|
4929 + | self.max_length_string = input.map(|v| v.into());
|
4930 + | self
|
5745 4931 | }
|
4932 + | #[allow(missing_docs)] // documentation missing in model
|
4933 + | pub fn fixed_length_string(
|
4934 + | mut self,
|
4935 + | input: ::std::option::Option<crate::model::FixedLengthString>,
|
4936 + | ) -> Self {
|
4937 + | self.fixed_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4938 + | self
|
5746 4939 | }
|
4940 + | #[allow(missing_docs)] // documentation missing in model
|
4941 + | pub(crate) fn set_fixed_length_string(
|
4942 + | mut self,
|
4943 + | input: Option<
|
4944 + | impl ::std::convert::Into<
|
4945 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
4946 + | >,
|
4947 + | >,
|
4948 + | ) -> Self {
|
4949 + | self.fixed_length_string = input.map(|v| v.into());
|
4950 + | self
|
5747 4951 | }
|
5748 - | impl ::std::error::Error for ConstraintViolation {}
|
5749 - | impl ConstraintViolation {
|
5750 - | pub(crate) fn as_validation_exception_field(
|
5751 - | self,
|
5752 - | path: ::std::string::String,
|
5753 - | ) -> crate::model::ValidationExceptionField {
|
5754 - | match self {
|
5755 - | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
5756 - | message: format!(
|
5757 - | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
5758 - | path
|
5759 - | ),
|
5760 - | path: path + "/conB",
|
5761 - | },
|
5762 - | ConstraintViolation::ConB(inner) => {
|
5763 - | inner.as_validation_exception_field(path + "/conB")
|
4952 + | #[allow(missing_docs)] // documentation missing in model
|
4953 + | pub fn length_blob(
|
4954 + | mut self,
|
4955 + | input: ::std::option::Option<crate::model::LengthBlob>,
|
4956 + | ) -> Self {
|
4957 + | self.length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4958 + | self
|
5764 4959 | }
|
5765 - | ConstraintViolation::OptConB(inner) => {
|
5766 - | inner.as_validation_exception_field(path + "/optConB")
|
4960 + | #[allow(missing_docs)] // documentation missing in model
|
4961 + | pub(crate) fn set_length_blob(
|
4962 + | mut self,
|
4963 + | input: Option<
|
4964 + | impl ::std::convert::Into<
|
4965 + | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
4966 + | >,
|
4967 + | >,
|
4968 + | ) -> Self {
|
4969 + | self.length_blob = input.map(|v| v.into());
|
4970 + | self
|
5767 4971 | }
|
5768 - | ConstraintViolation::LengthString(inner) => {
|
5769 - | inner.as_validation_exception_field(path + "/lengthString")
|
4972 + | #[allow(missing_docs)] // documentation missing in model
|
4973 + | pub fn min_length_blob(
|
4974 + | mut self,
|
4975 + | input: ::std::option::Option<crate::model::MinLengthBlob>,
|
4976 + | ) -> Self {
|
4977 + | self.min_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4978 + | self
|
5770 4979 | }
|
5771 - | ConstraintViolation::MinLengthString(inner) => {
|
5772 - | inner.as_validation_exception_field(path + "/minLengthString")
|
4980 + | #[allow(missing_docs)] // documentation missing in model
|
4981 + | pub(crate) fn set_min_length_blob(
|
4982 + | mut self,
|
4983 + | input: Option<
|
4984 + | impl ::std::convert::Into<
|
4985 + | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
4986 + | >,
|
4987 + | >,
|
4988 + | ) -> Self {
|
4989 + | self.min_length_blob = input.map(|v| v.into());
|
4990 + | self
|
5773 4991 | }
|
5774 - | ConstraintViolation::MaxLengthString(inner) => {
|
5775 - | inner.as_validation_exception_field(path + "/maxLengthString")
|
4992 + | #[allow(missing_docs)] // documentation missing in model
|
4993 + | pub fn max_length_blob(
|
4994 + | mut self,
|
4995 + | input: ::std::option::Option<crate::model::MaxLengthBlob>,
|
4996 + | ) -> Self {
|
4997 + | self.max_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
4998 + | self
|
5776 4999 | }
|
5777 - | ConstraintViolation::FixedLengthString(inner) => {
|
5778 - | inner.as_validation_exception_field(path + "/fixedLengthString")
|
5000 + | #[allow(missing_docs)] // documentation missing in model
|
5001 + | pub(crate) fn set_max_length_blob(
|
5002 + | mut self,
|
5003 + | input: Option<
|
5004 + | impl ::std::convert::Into<
|
5005 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
5006 + | >,
|
5007 + | >,
|
5008 + | ) -> Self {
|
5009 + | self.max_length_blob = input.map(|v| v.into());
|
5010 + | self
|
5779 5011 | }
|
5780 - | ConstraintViolation::LengthBlob(inner) => {
|
5781 - | inner.as_validation_exception_field(path + "/lengthBlob")
|
5012 + | #[allow(missing_docs)] // documentation missing in model
|
5013 + | pub fn fixed_length_blob(
|
5014 + | mut self,
|
5015 + | input: ::std::option::Option<crate::model::FixedLengthBlob>,
|
5016 + | ) -> Self {
|
5017 + | self.fixed_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5018 + | self
|
5782 5019 | }
|
5783 - | ConstraintViolation::MinLengthBlob(inner) => {
|
5784 - | inner.as_validation_exception_field(path + "/minLengthBlob")
|
5020 + | #[allow(missing_docs)] // documentation missing in model
|
5021 + | pub(crate) fn set_fixed_length_blob(
|
5022 + | mut self,
|
5023 + | input: Option<
|
5024 + | impl ::std::convert::Into<
|
5025 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
5026 + | >,
|
5027 + | >,
|
5028 + | ) -> Self {
|
5029 + | self.fixed_length_blob = input.map(|v| v.into());
|
5030 + | self
|
5785 5031 | }
|
5786 - | ConstraintViolation::MaxLengthBlob(inner) => {
|
5787 - | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
5032 + | #[allow(missing_docs)] // documentation missing in model
|
5033 + | pub fn range_integer(mut self, input: crate::model::RangeInteger) -> Self {
|
5034 + | self.range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5035 + | self
|
5788 5036 | }
|
5789 - | ConstraintViolation::FixedLengthBlob(inner) => {
|
5790 - | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
5037 + | #[allow(missing_docs)] // documentation missing in model
|
5038 + | pub(crate) fn set_range_integer(
|
5039 + | mut self,
|
5040 + | input: impl ::std::convert::Into<
|
5041 + | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
5042 + | >,
|
5043 + | ) -> Self {
|
5044 + | self.range_integer = Some(input.into());
|
5045 + | self
|
5791 5046 | }
|
5792 - | ConstraintViolation::RangeInteger(inner) => {
|
5793 - | inner.as_validation_exception_field(path + "/rangeInteger")
|
5047 + | #[allow(missing_docs)] // documentation missing in model
|
5048 + | pub fn min_range_integer(mut self, input: crate::model::MinRangeInteger) -> Self {
|
5049 + | self.min_range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5050 + | self
|
5794 5051 | }
|
5795 - | ConstraintViolation::MinRangeInteger(inner) => {
|
5796 - | inner.as_validation_exception_field(path + "/minRangeInteger")
|
5052 + | #[allow(missing_docs)] // documentation missing in model
|
5053 + | pub(crate) fn set_min_range_integer(
|
5054 + | mut self,
|
5055 + | input: impl ::std::convert::Into<
|
5056 + | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
5057 + | >,
|
5058 + | ) -> Self {
|
5059 + | self.min_range_integer = Some(input.into());
|
5060 + | self
|
5797 5061 | }
|
5798 - | ConstraintViolation::MaxRangeInteger(inner) => {
|
5799 - | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
5062 + | #[allow(missing_docs)] // documentation missing in model
|
5063 + | pub fn max_range_integer(mut self, input: crate::model::MaxRangeInteger) -> Self {
|
5064 + | self.max_range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5065 + | self
|
5800 5066 | }
|
5801 - | ConstraintViolation::FixedValueInteger(inner) => {
|
5802 - | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
5067 + | #[allow(missing_docs)] // documentation missing in model
|
5068 + | pub(crate) fn set_max_range_integer(
|
5069 + | mut self,
|
5070 + | input: impl ::std::convert::Into<
|
5071 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
5072 + | >,
|
5073 + | ) -> Self {
|
5074 + | self.max_range_integer = Some(input.into());
|
5075 + | self
|
5803 5076 | }
|
5804 - | ConstraintViolation::RangeShort(inner) => {
|
5805 - | inner.as_validation_exception_field(path + "/rangeShort")
|
5077 + | #[allow(missing_docs)] // documentation missing in model
|
5078 + | pub fn fixed_value_integer(mut self, input: crate::model::FixedValueInteger) -> Self {
|
5079 + | self.fixed_value_integer =
|
5080 + | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5081 + | self
|
5806 5082 | }
|
5807 - | ConstraintViolation::MinRangeShort(inner) => {
|
5808 - | inner.as_validation_exception_field(path + "/minRangeShort")
|
5083 + | #[allow(missing_docs)] // documentation missing in model
|
5084 + | pub(crate) fn set_fixed_value_integer(
|
5085 + | mut self,
|
5086 + | input: impl ::std::convert::Into<
|
5087 + | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
5088 + | >,
|
5089 + | ) -> Self {
|
5090 + | self.fixed_value_integer = Some(input.into());
|
5091 + | self
|
5809 5092 | }
|
5810 - | ConstraintViolation::MaxRangeShort(inner) => {
|
5811 - | inner.as_validation_exception_field(path + "/maxRangeShort")
|
5093 + | #[allow(missing_docs)] // documentation missing in model
|
5094 + | pub fn range_short(mut self, input: crate::model::RangeShort) -> Self {
|
5095 + | self.range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5096 + | self
|
5812 5097 | }
|
5813 - | ConstraintViolation::FixedValueShort(inner) => {
|
5814 - | inner.as_validation_exception_field(path + "/fixedValueShort")
|
5098 + | #[allow(missing_docs)] // documentation missing in model
|
5099 + | pub(crate) fn set_range_short(
|
5100 + | mut self,
|
5101 + | input: impl ::std::convert::Into<
|
5102 + | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
5103 + | >,
|
5104 + | ) -> Self {
|
5105 + | self.range_short = Some(input.into());
|
5106 + | self
|
5815 5107 | }
|
5816 - | ConstraintViolation::RangeLong(inner) => {
|
5817 - | inner.as_validation_exception_field(path + "/rangeLong")
|
5108 + | #[allow(missing_docs)] // documentation missing in model
|
5109 + | pub fn min_range_short(mut self, input: crate::model::MinRangeShort) -> Self {
|
5110 + | self.min_range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5111 + | self
|
5818 5112 | }
|
5819 - | ConstraintViolation::MinRangeLong(inner) => {
|
5820 - | inner.as_validation_exception_field(path + "/minRangeLong")
|
5113 + | #[allow(missing_docs)] // documentation missing in model
|
5114 + | pub(crate) fn set_min_range_short(
|
5115 + | mut self,
|
5116 + | input: impl ::std::convert::Into<
|
5117 + | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
5118 + | >,
|
5119 + | ) -> Self {
|
5120 + | self.min_range_short = Some(input.into());
|
5121 + | self
|
5821 5122 | }
|
5822 - | ConstraintViolation::MaxRangeLong(inner) => {
|
5823 - | inner.as_validation_exception_field(path + "/maxRangeLong")
|
5123 + | #[allow(missing_docs)] // documentation missing in model
|
5124 + | pub fn max_range_short(mut self, input: crate::model::MaxRangeShort) -> Self {
|
5125 + | self.max_range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5126 + | self
|
5824 5127 | }
|
5825 - | ConstraintViolation::FixedValueLong(inner) => {
|
5826 - | inner.as_validation_exception_field(path + "/fixedValueLong")
|
5128 + | #[allow(missing_docs)] // documentation missing in model
|
5129 + | pub(crate) fn set_max_range_short(
|
5130 + | mut self,
|
5131 + | input: impl ::std::convert::Into<
|
5132 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
5133 + | >,
|
5134 + | ) -> Self {
|
5135 + | self.max_range_short = Some(input.into());
|
5136 + | self
|
5827 5137 | }
|
5828 - | ConstraintViolation::RangeByte(inner) => {
|
5829 - | inner.as_validation_exception_field(path + "/rangeByte")
|
5138 + | #[allow(missing_docs)] // documentation missing in model
|
5139 + | pub fn fixed_value_short(mut self, input: crate::model::FixedValueShort) -> Self {
|
5140 + | self.fixed_value_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5141 + | self
|
5830 5142 | }
|
5831 - | ConstraintViolation::MinRangeByte(inner) => {
|
5832 - | inner.as_validation_exception_field(path + "/minRangeByte")
|
5143 + | #[allow(missing_docs)] // documentation missing in model
|
5144 + | pub(crate) fn set_fixed_value_short(
|
5145 + | mut self,
|
5146 + | input: impl ::std::convert::Into<
|
5147 + | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
5148 + | >,
|
5149 + | ) -> Self {
|
5150 + | self.fixed_value_short = Some(input.into());
|
5151 + | self
|
5833 5152 | }
|
5834 - | ConstraintViolation::MaxRangeByte(inner) => {
|
5835 - | inner.as_validation_exception_field(path + "/maxRangeByte")
|
5153 + | #[allow(missing_docs)] // documentation missing in model
|
5154 + | pub fn range_long(mut self, input: crate::model::RangeLong) -> Self {
|
5155 + | self.range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5156 + | self
|
5836 5157 | }
|
5837 - | ConstraintViolation::FixedValueByte(inner) => {
|
5838 - | inner.as_validation_exception_field(path + "/fixedValueByte")
|
5158 + | #[allow(missing_docs)] // documentation missing in model
|
5159 + | pub(crate) fn set_range_long(
|
5160 + | mut self,
|
5161 + | input: impl ::std::convert::Into<
|
5162 + | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
5163 + | >,
|
5164 + | ) -> Self {
|
5165 + | self.range_long = Some(input.into());
|
5166 + | self
|
5839 5167 | }
|
5840 - | ConstraintViolation::ConBList(inner) => {
|
5841 - | inner.as_validation_exception_field(path + "/conBList")
|
5168 + | #[allow(missing_docs)] // documentation missing in model
|
5169 + | pub fn min_range_long(mut self, input: crate::model::MinRangeLong) -> Self {
|
5170 + | self.min_range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5171 + | self
|
5842 5172 | }
|
5843 - | ConstraintViolation::LengthList(inner) => {
|
5844 - | inner.as_validation_exception_field(path + "/lengthList")
|
5173 + | #[allow(missing_docs)] // documentation missing in model
|
5174 + | pub(crate) fn set_min_range_long(
|
5175 + | mut self,
|
5176 + | input: impl ::std::convert::Into<
|
5177 + | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
5178 + | >,
|
5179 + | ) -> Self {
|
5180 + | self.min_range_long = Some(input.into());
|
5181 + | self
|
5845 5182 | }
|
5846 - | ConstraintViolation::SensitiveLengthList(inner) => {
|
5847 - | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
5183 + | #[allow(missing_docs)] // documentation missing in model
|
5184 + | pub fn max_range_long(mut self, input: crate::model::MaxRangeLong) -> Self {
|
5185 + | self.max_range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5186 + | self
|
5848 5187 | }
|
5849 - | ConstraintViolation::ConBSet(inner) => {
|
5850 - | inner.as_validation_exception_field(path + "/conBSet")
|
5188 + | #[allow(missing_docs)] // documentation missing in model
|
5189 + | pub(crate) fn set_max_range_long(
|
5190 + | mut self,
|
5191 + | input: impl ::std::convert::Into<
|
5192 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
5193 + | >,
|
5194 + | ) -> Self {
|
5195 + | self.max_range_long = Some(input.into());
|
5196 + | self
|
5851 5197 | }
|
5852 - | ConstraintViolation::ConBMap(inner) => {
|
5853 - | inner.as_validation_exception_field(path + "/conBMap")
|
5198 + | #[allow(missing_docs)] // documentation missing in model
|
5199 + | pub fn fixed_value_long(mut self, input: crate::model::FixedValueLong) -> Self {
|
5200 + | self.fixed_value_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5201 + | self
|
5854 5202 | }
|
5855 - | ConstraintViolation::LengthMap(inner) => {
|
5856 - | inner.as_validation_exception_field(path + "/lengthMap")
|
5203 + | #[allow(missing_docs)] // documentation missing in model
|
5204 + | pub(crate) fn set_fixed_value_long(
|
5205 + | mut self,
|
5206 + | input: impl ::std::convert::Into<
|
5207 + | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
5208 + | >,
|
5209 + | ) -> Self {
|
5210 + | self.fixed_value_long = Some(input.into());
|
5211 + | self
|
5857 5212 | }
|
5858 - | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
5859 - | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
5213 + | #[allow(missing_docs)] // documentation missing in model
|
5214 + | pub fn range_byte(mut self, input: crate::model::RangeByte) -> Self {
|
5215 + | self.range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5216 + | self
|
5860 5217 | }
|
5861 - | ConstraintViolation::SparseMap(inner) => {
|
5862 - | inner.as_validation_exception_field(path + "/sparseMap")
|
5218 + | #[allow(missing_docs)] // documentation missing in model
|
5219 + | pub(crate) fn set_range_byte(
|
5220 + | mut self,
|
5221 + | input: impl ::std::convert::Into<
|
5222 + | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
5223 + | >,
|
5224 + | ) -> Self {
|
5225 + | self.range_byte = Some(input.into());
|
5226 + | self
|
5863 5227 | }
|
5864 - | ConstraintViolation::SparseList(inner) => {
|
5865 - | inner.as_validation_exception_field(path + "/sparseList")
|
5228 + | #[allow(missing_docs)] // documentation missing in model
|
5229 + | pub fn min_range_byte(mut self, input: crate::model::MinRangeByte) -> Self {
|
5230 + | self.min_range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5231 + | self
|
5866 5232 | }
|
5867 - | ConstraintViolation::SparseLengthMap(inner) => {
|
5868 - | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
5233 + | #[allow(missing_docs)] // documentation missing in model
|
5234 + | pub(crate) fn set_min_range_byte(
|
5235 + | mut self,
|
5236 + | input: impl ::std::convert::Into<
|
5237 + | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
5238 + | >,
|
5239 + | ) -> Self {
|
5240 + | self.min_range_byte = Some(input.into());
|
5241 + | self
|
5869 5242 | }
|
5870 - | ConstraintViolation::SparseLengthList(inner) => {
|
5871 - | inner.as_validation_exception_field(path + "/sparseLengthList")
|
5243 + | #[allow(missing_docs)] // documentation missing in model
|
5244 + | pub fn max_range_byte(mut self, input: crate::model::MaxRangeByte) -> Self {
|
5245 + | self.max_range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5246 + | self
|
5872 5247 | }
|
5873 - | ConstraintViolation::ConstrainedUnion(inner) => {
|
5874 - | inner.as_validation_exception_field(path + "/constrainedUnion")
|
5248 + | #[allow(missing_docs)] // documentation missing in model
|
5249 + | pub(crate) fn set_max_range_byte(
|
5250 + | mut self,
|
5251 + | input: impl ::std::convert::Into<
|
5252 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
5253 + | >,
|
5254 + | ) -> Self {
|
5255 + | self.max_range_byte = Some(input.into());
|
5256 + | self
|
5875 5257 | }
|
5876 - | ConstraintViolation::EnumString(inner) => {
|
5877 - | inner.as_validation_exception_field(path + "/enumString")
|
5258 + | #[allow(missing_docs)] // documentation missing in model
|
5259 + | pub fn fixed_value_byte(mut self, input: crate::model::FixedValueByte) -> Self {
|
5260 + | self.fixed_value_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5261 + | self
|
5878 5262 | }
|
5879 - | ConstraintViolation::ListOfLengthString(inner) => {
|
5880 - | inner.as_validation_exception_field(path + "/listOfLengthString")
|
5263 + | #[allow(missing_docs)] // documentation missing in model
|
5264 + | pub(crate) fn set_fixed_value_byte(
|
5265 + | mut self,
|
5266 + | input: impl ::std::convert::Into<
|
5267 + | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
5268 + | >,
|
5269 + | ) -> Self {
|
5270 + | self.fixed_value_byte = Some(input.into());
|
5271 + | self
|
5881 5272 | }
|
5882 - | ConstraintViolation::SetOfLengthString(inner) => {
|
5883 - | inner.as_validation_exception_field(path + "/setOfLengthString")
|
5273 + | #[allow(missing_docs)] // documentation missing in model
|
5274 + | pub fn con_b_list(
|
5275 + | mut self,
|
5276 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
5277 + | ) -> Self {
|
5278 + | self.con_b_list =
|
5279 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
5280 + | self
|
5884 5281 | }
|
5885 - | ConstraintViolation::MapOfLengthString(inner) => {
|
5886 - | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
5282 + | #[allow(missing_docs)] // documentation missing in model
|
5283 + | pub(crate) fn set_con_b_list(
|
5284 + | mut self,
|
5285 + | input: Option<
|
5286 + | impl ::std::convert::Into<
|
5287 + | crate::constrained::MaybeConstrained<
|
5288 + | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
5289 + | >,
|
5290 + | >,
|
5291 + | >,
|
5292 + | ) -> Self {
|
5293 + | self.con_b_list = input.map(|v| v.into());
|
5294 + | self
|
5887 5295 | }
|
5888 - | ConstraintViolation::ListOfLengthBlob(inner) => {
|
5889 - | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
5296 + | #[allow(missing_docs)] // documentation missing in model
|
5297 + | pub fn length_list(
|
5298 + | mut self,
|
5299 + | input: ::std::option::Option<crate::model::LengthList>,
|
5300 + | ) -> Self {
|
5301 + | self.length_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5302 + | self
|
5890 5303 | }
|
5891 - | ConstraintViolation::MapOfLengthBlob(inner) => {
|
5892 - | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
5304 + | #[allow(missing_docs)] // documentation missing in model
|
5305 + | pub(crate) fn set_length_list(
|
5306 + | mut self,
|
5307 + | input: Option<
|
5308 + | impl ::std::convert::Into<
|
5309 + | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
5310 + | >,
|
5311 + | >,
|
5312 + | ) -> Self {
|
5313 + | self.length_list = input.map(|v| v.into());
|
5314 + | self
|
5893 5315 | }
|
5894 - | ConstraintViolation::ListOfRangeInteger(inner) => {
|
5895 - | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
5316 + | #[allow(missing_docs)] // documentation missing in model
|
5317 + | pub fn sensitive_length_list(
|
5318 + | mut self,
|
5319 + | input: ::std::option::Option<crate::model::SensitiveLengthList>,
|
5320 + | ) -> Self {
|
5321 + | self.sensitive_length_list =
|
5322 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
5323 + | self
|
5896 5324 | }
|
5897 - | ConstraintViolation::SetOfRangeInteger(inner) => {
|
5898 - | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
5325 + | #[allow(missing_docs)] // documentation missing in model
|
5326 + | pub(crate) fn set_sensitive_length_list(
|
5327 + | mut self,
|
5328 + | input: Option<
|
5329 + | impl ::std::convert::Into<
|
5330 + | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
5331 + | >,
|
5332 + | >,
|
5333 + | ) -> Self {
|
5334 + | self.sensitive_length_list = input.map(|v| v.into());
|
5335 + | self
|
5899 5336 | }
|
5900 - | ConstraintViolation::MapOfRangeInteger(inner) => {
|
5901 - | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
5337 + | #[allow(missing_docs)] // documentation missing in model
|
5338 + | pub fn con_b_set(mut self, input: ::std::option::Option<crate::model::ConBSet>) -> Self {
|
5339 + | self.con_b_set = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5340 + | self
|
5902 5341 | }
|
5903 - | ConstraintViolation::ListOfRangeShort(inner) => {
|
5904 - | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
5905 - | }
|
5906 - | ConstraintViolation::SetOfRangeShort(inner) => {
|
5907 - | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
5908 - | }
|
5909 - | ConstraintViolation::MapOfRangeShort(inner) => {
|
5910 - | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
5911 - | }
|
5912 - | ConstraintViolation::ListOfRangeLong(inner) => {
|
5913 - | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
5914 - | }
|
5915 - | ConstraintViolation::SetOfRangeLong(inner) => {
|
5916 - | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
5917 - | }
|
5918 - | ConstraintViolation::MapOfRangeLong(inner) => {
|
5919 - | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
5920 - | }
|
5921 - | ConstraintViolation::ListOfRangeByte(inner) => {
|
5922 - | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
5923 - | }
|
5924 - | ConstraintViolation::SetOfRangeByte(inner) => {
|
5925 - | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
5926 - | }
|
5927 - | ConstraintViolation::MapOfRangeByte(inner) => {
|
5928 - | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
5929 - | }
|
5930 - | ConstraintViolation::PatternString(inner) => {
|
5931 - | inner.as_validation_exception_field(path + "/patternString")
|
5932 - | }
|
5933 - | ConstraintViolation::MapOfPatternString(inner) => {
|
5934 - | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
5935 - | }
|
5936 - | ConstraintViolation::ListOfPatternString(inner) => {
|
5937 - | inner.as_validation_exception_field(path + "/listOfPatternString")
|
5938 - | }
|
5939 - | ConstraintViolation::SetOfPatternString(inner) => {
|
5940 - | inner.as_validation_exception_field(path + "/setOfPatternString")
|
5941 - | }
|
5942 - | ConstraintViolation::LengthLengthPatternString(inner) => {
|
5943 - | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
5944 - | }
|
5945 - | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
5946 - | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
5947 - | }
|
5948 - | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
5949 - | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
5950 - | }
|
5951 - | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
5952 - | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
5953 - | }
|
5954 - | ConstraintViolation::LengthListOfPatternString(inner) => {
|
5955 - | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
5956 - | }
|
5957 - | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
5958 - | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
5959 - | }
|
5960 - | }
|
5961 - | }
|
5962 - | }
|
5963 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
5964 - | fn from(builder: Builder) -> Self {
|
5965 - | Self::Unconstrained(builder)
|
5966 - | }
|
5967 - | }
|
5968 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
5969 - | type Error = ConstraintViolation;
|
5970 - |
|
5971 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5972 - | builder.build()
|
5973 - | }
|
5974 - | }
|
5975 - | /// A builder for [`ConA`](crate::model::ConA).
|
5976 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5977 - | pub struct Builder {
|
5978 - | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5979 - | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5980 - | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
5981 - | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
5982 - | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
5983 - | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
5984 - | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
5985 - | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
5986 - | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
5987 - | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
5988 - | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
5989 - | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
5990 - | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
5991 - | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
5992 - | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
5993 - | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
5994 - | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
5995 - | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
5996 - | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
5997 - | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
5998 - | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
5999 - | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
6000 - | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
6001 - | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
6002 - | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
6003 - | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
6004 - | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
6005 - | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
6006 - | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
6007 - | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6008 - | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6009 - | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6010 - | 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>>,
|
6011 - | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
6012 - | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
6013 - | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
6014 - | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
6015 - | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
6016 - | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
6017 - | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
6018 - | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
6019 - | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
6020 - | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
6021 - | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
6022 - | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
6023 - | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
6024 - | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
6025 - | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
6026 - | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
6027 - | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
6028 - | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
6029 - | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
6030 - | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
6031 - | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
6032 - | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
6033 - | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
6034 - | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6035 - | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
6036 - | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
6037 - | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
6038 - | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
6039 - | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
6040 - | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
6041 - | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
6042 - | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
6043 - | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
6044 - | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
5342 + | #[allow(missing_docs)] // documentation missing in model
|
5343 + | pub(crate) fn set_con_b_set(
|
5344 + | mut self,
|
5345 + | input: Option<
|
5346 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
5347 + | >,
|
5348 + | ) -> Self {
|
5349 + | self.con_b_set = input.map(|v| v.into());
|
5350 + | self
|
6045 5351 | }
|
6046 - | impl Builder {
|
6047 5352 | #[allow(missing_docs)] // documentation missing in model
|
6048 - | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
6049 - | self.con_b = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5353 + | pub fn con_b_map(mut self, input: ::std::option::Option<crate::model::ConBMap>) -> Self {
|
5354 + | self.con_b_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6050 5355 | self
|
6051 5356 | }
|
6052 5357 | #[allow(missing_docs)] // documentation missing in model
|
6053 - | pub(crate) fn set_con_b(
|
5358 + | pub(crate) fn set_con_b_map(
|
6054 5359 | mut self,
|
6055 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5360 + | input: Option<
|
5361 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
5362 + | >,
|
6056 5363 | ) -> Self {
|
6057 - | self.con_b = Some(input.into());
|
5364 + | self.con_b_map = input.map(|v| v.into());
|
6058 5365 | self
|
6059 5366 | }
|
6060 5367 | #[allow(missing_docs)] // documentation missing in model
|
6061 - | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
6062 - | self.opt_con_b = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5368 + | pub fn length_map(mut self, input: ::std::option::Option<crate::model::LengthMap>) -> Self {
|
5369 + | self.length_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6063 5370 | self
|
6064 5371 | }
|
6065 5372 | #[allow(missing_docs)] // documentation missing in model
|
6066 - | pub(crate) fn set_opt_con_b(
|
5373 + | pub(crate) fn set_length_map(
|
6067 5374 | mut self,
|
6068 5375 | input: Option<
|
6069 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5376 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6070 5377 | >,
|
6071 5378 | ) -> Self {
|
6072 - | self.opt_con_b = input.map(|v| v.into());
|
5379 + | self.length_map = input.map(|v| v.into());
|
6073 5380 | self
|
6074 5381 | }
|
6075 5382 | #[allow(missing_docs)] // documentation missing in model
|
6076 - | pub fn length_string(
|
5383 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
6077 5384 | mut self,
|
6078 - | input: ::std::option::Option<crate::model::LengthString>,
|
5385 + | input: ::std::option::Option<
|
5386 + | ::std::collections::HashMap<
|
5387 + | ::std::string::String,
|
5388 + | ::std::collections::HashMap<
|
5389 + | ::std::string::String,
|
5390 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
5391 + | >,
|
5392 + | >,
|
5393 + | >,
|
6079 5394 | ) -> Self {
|
6080 - | self.length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5395 + | self.map_of_map_of_list_of_list_of_con_b =
|
5396 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6081 5397 | self
|
6082 5398 | }
|
6083 5399 | #[allow(missing_docs)] // documentation missing in model
|
6084 - | pub(crate) fn set_length_string(
|
5400 + | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
6085 5401 | mut self,
|
6086 - | input: Option<
|
6087 - | impl ::std::convert::Into<
|
6088 - | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
6089 - | >,
|
6090 - | >,
|
5402 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
6091 5403 | ) -> Self {
|
6092 - | self.length_string = input.map(|v| v.into());
|
5404 + | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
6093 5405 | self
|
6094 5406 | }
|
6095 5407 | #[allow(missing_docs)] // documentation missing in model
|
6096 - | pub fn min_length_string(
|
5408 + | pub fn sparse_map(
|
6097 5409 | mut self,
|
6098 - | input: ::std::option::Option<crate::model::MinLengthString>,
|
5410 + | input: ::std::option::Option<
|
5411 + | ::std::collections::HashMap<
|
5412 + | ::std::string::String,
|
5413 + | ::std::option::Option<crate::model::UniqueItemsList>,
|
5414 + | >,
|
5415 + | >,
|
6099 5416 | ) -> Self {
|
6100 - | self.min_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5417 + | self.sparse_map =
|
5418 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6101 5419 | self
|
6102 5420 | }
|
6103 5421 | #[allow(missing_docs)] // documentation missing in model
|
6104 - | pub(crate) fn set_min_length_string(
|
5422 + | pub(crate) fn set_sparse_map(
|
6105 5423 | mut self,
|
6106 5424 | input: Option<
|
6107 5425 | impl ::std::convert::Into<
|
6108 - | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
5426 + | crate::constrained::MaybeConstrained<
|
5427 + | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
5428 + | >,
|
6109 5429 | >,
|
6110 5430 | >,
|
6111 5431 | ) -> Self {
|
6112 - | self.min_length_string = input.map(|v| v.into());
|
5432 + | self.sparse_map = input.map(|v| v.into());
|
6113 5433 | self
|
6114 5434 | }
|
6115 5435 | #[allow(missing_docs)] // documentation missing in model
|
6116 - | pub fn max_length_string(
|
5436 + | pub fn sparse_list(
|
6117 5437 | mut self,
|
6118 - | input: ::std::option::Option<crate::model::MaxLengthString>,
|
5438 + | input: ::std::option::Option<
|
5439 + | ::std::vec::Vec<::std::option::Option<crate::model::LengthString>>,
|
5440 + | >,
|
6119 5441 | ) -> Self {
|
6120 - | self.max_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5442 + | self.sparse_list =
|
5443 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6121 5444 | self
|
6122 5445 | }
|
6123 5446 | #[allow(missing_docs)] // documentation missing in model
|
6124 - | pub(crate) fn set_max_length_string(
|
5447 + | pub(crate) fn set_sparse_list(
|
6125 5448 | mut self,
|
6126 5449 | input: Option<
|
6127 5450 | impl ::std::convert::Into<
|
6128 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
5451 + | crate::constrained::MaybeConstrained<
|
5452 + | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
5453 + | >,
|
6129 5454 | >,
|
6130 5455 | >,
|
6131 5456 | ) -> Self {
|
6132 - | self.max_length_string = input.map(|v| v.into());
|
5457 + | self.sparse_list = input.map(|v| v.into());
|
6133 5458 | self
|
6134 5459 | }
|
6135 5460 | #[allow(missing_docs)] // documentation missing in model
|
6136 - | pub fn fixed_length_string(
|
5461 + | pub fn sparse_length_map(
|
6137 5462 | mut self,
|
6138 - | input: ::std::option::Option<crate::model::FixedLengthString>,
|
5463 + | input: ::std::option::Option<crate::model::SparseLengthMap>,
|
6139 5464 | ) -> Self {
|
6140 - | self.fixed_length_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5465 + | self.sparse_length_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6141 5466 | self
|
6142 5467 | }
|
6143 5468 | #[allow(missing_docs)] // documentation missing in model
|
6144 - | pub(crate) fn set_fixed_length_string(
|
5469 + | pub(crate) fn set_sparse_length_map(
|
6145 5470 | mut self,
|
6146 5471 | input: Option<
|
6147 5472 | impl ::std::convert::Into<
|
6148 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
5473 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
6149 5474 | >,
|
6150 5475 | >,
|
6151 5476 | ) -> Self {
|
6152 - | self.fixed_length_string = input.map(|v| v.into());
|
5477 + | self.sparse_length_map = input.map(|v| v.into());
|
6153 5478 | self
|
6154 5479 | }
|
6155 5480 | #[allow(missing_docs)] // documentation missing in model
|
6156 - | pub fn length_blob(
|
5481 + | pub fn sparse_length_list(
|
6157 5482 | mut self,
|
6158 - | input: ::std::option::Option<crate::model::LengthBlob>,
|
5483 + | input: ::std::option::Option<crate::model::SparseLengthList>,
|
6159 5484 | ) -> Self {
|
6160 - | self.length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5485 + | self.sparse_length_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6161 5486 | self
|
6162 5487 | }
|
6163 5488 | #[allow(missing_docs)] // documentation missing in model
|
6164 - | pub(crate) fn set_length_blob(
|
5489 + | pub(crate) fn set_sparse_length_list(
|
6165 5490 | mut self,
|
6166 5491 | input: Option<
|
6167 5492 | impl ::std::convert::Into<
|
6168 - | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
5493 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
6169 5494 | >,
|
6170 5495 | >,
|
6171 5496 | ) -> Self {
|
6172 - | self.length_blob = input.map(|v| v.into());
|
5497 + | self.sparse_length_list = input.map(|v| v.into());
|
6173 5498 | self
|
6174 5499 | }
|
6175 - | #[allow(missing_docs)] // documentation missing in model
|
6176 - | pub fn min_length_blob(
|
5500 + | /// A union with constrained members.
|
5501 + | pub fn constrained_union(
|
6177 5502 | mut self,
|
6178 - | input: ::std::option::Option<crate::model::MinLengthBlob>,
|
5503 + | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
6179 5504 | ) -> Self {
|
6180 - | self.min_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5505 + | self.constrained_union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6181 5506 | self
|
6182 5507 | }
|
6183 - | #[allow(missing_docs)] // documentation missing in model
|
6184 - | pub(crate) fn set_min_length_blob(
|
5508 + | /// A union with constrained members.
|
5509 + | pub(crate) fn set_constrained_union(
|
6185 5510 | mut self,
|
6186 5511 | input: Option<
|
6187 5512 | impl ::std::convert::Into<
|
6188 - | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
5513 + | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
6189 5514 | >,
|
6190 5515 | >,
|
6191 5516 | ) -> Self {
|
6192 - | self.min_length_blob = input.map(|v| v.into());
|
5517 + | self.constrained_union = input.map(|v| v.into());
|
6193 5518 | self
|
6194 5519 | }
|
6195 5520 | #[allow(missing_docs)] // documentation missing in model
|
6196 - | pub fn max_length_blob(
|
5521 + | pub fn enum_string(
|
6197 5522 | mut self,
|
6198 - | input: ::std::option::Option<crate::model::MaxLengthBlob>,
|
5523 + | input: ::std::option::Option<crate::model::EnumString>,
|
6199 5524 | ) -> Self {
|
6200 - | self.max_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5525 + | self.enum_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6201 5526 | self
|
6202 5527 | }
|
6203 5528 | #[allow(missing_docs)] // documentation missing in model
|
6204 - | pub(crate) fn set_max_length_blob(
|
5529 + | pub(crate) fn set_enum_string(
|
6205 5530 | mut self,
|
6206 5531 | input: Option<
|
6207 5532 | impl ::std::convert::Into<
|
6208 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
5533 + | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6209 5534 | >,
|
6210 5535 | >,
|
6211 5536 | ) -> Self {
|
6212 - | self.max_length_blob = input.map(|v| v.into());
|
5537 + | self.enum_string = input.map(|v| v.into());
|
6213 5538 | self
|
6214 5539 | }
|
6215 5540 | #[allow(missing_docs)] // documentation missing in model
|
6216 - | pub fn fixed_length_blob(
|
5541 + | pub fn list_of_length_string(
|
6217 5542 | mut self,
|
6218 - | input: ::std::option::Option<crate::model::FixedLengthBlob>,
|
5543 + | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthString>>,
|
6219 5544 | ) -> Self {
|
6220 - | self.fixed_length_blob = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5545 + | self.list_of_length_string =
|
5546 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6221 5547 | self
|
6222 5548 | }
|
6223 5549 | #[allow(missing_docs)] // documentation missing in model
|
6224 - | pub(crate) fn set_fixed_length_blob(
|
5550 + | pub(crate) fn set_list_of_length_string(
|
6225 5551 | mut self,
|
6226 - | input: Option<
|
6227 - | impl ::std::convert::Into<
|
6228 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
6229 - | >,
|
6230 - | >,
|
5552 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
6231 5553 | ) -> Self {
|
6232 - | self.fixed_length_blob = input.map(|v| v.into());
|
5554 + | self.list_of_length_string = input.map(|v| v.into());
|
6233 5555 | self
|
6234 5556 | }
|
6235 5557 | #[allow(missing_docs)] // documentation missing in model
|
6236 - | pub fn range_integer(mut self, input: crate::model::RangeInteger) -> Self {
|
6237 - | self.range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5558 + | pub fn set_of_length_string(
|
5559 + | mut self,
|
5560 + | input: ::std::option::Option<crate::model::SetOfLengthString>,
|
5561 + | ) -> Self {
|
5562 + | self.set_of_length_string =
|
5563 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6238 5564 | self
|
6239 5565 | }
|
6240 5566 | #[allow(missing_docs)] // documentation missing in model
|
6241 - | pub(crate) fn set_range_integer(
|
5567 + | pub(crate) fn set_set_of_length_string(
|
6242 5568 | mut self,
|
6243 - | input: impl ::std::convert::Into<
|
6244 - | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
5569 + | input: Option<
|
5570 + | impl ::std::convert::Into<
|
5571 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
5572 + | >,
|
6245 5573 | >,
|
6246 5574 | ) -> Self {
|
6247 - | self.range_integer = Some(input.into());
|
6248 - | self
|
6249 - | }
|
6250 - | #[allow(missing_docs)] // documentation missing in model
|
6251 - | pub fn min_range_integer(mut self, input: crate::model::MinRangeInteger) -> Self {
|
6252 - | self.min_range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5575 + | self.set_of_length_string = input.map(|v| v.into());
|
6253 5576 | self
|
6254 5577 | }
|
6255 5578 | #[allow(missing_docs)] // documentation missing in model
|
6256 - | pub(crate) fn set_min_range_integer(
|
5579 + | pub fn map_of_length_string(
|
6257 5580 | mut self,
|
6258 - | input: impl ::std::convert::Into<
|
6259 - | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
5581 + | input: ::std::option::Option<
|
5582 + | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
6260 5583 | >,
|
6261 5584 | ) -> Self {
|
6262 - | self.min_range_integer = Some(input.into());
|
5585 + | self.map_of_length_string =
|
5586 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6263 5587 | self
|
6264 5588 | }
|
6265 5589 | #[allow(missing_docs)] // documentation missing in model
|
6266 - | pub fn max_range_integer(mut self, input: crate::model::MaxRangeInteger) -> Self {
|
6267 - | self.max_range_integer = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5590 + | pub(crate) fn set_map_of_length_string(
|
5591 + | mut self,
|
5592 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
5593 + | ) -> Self {
|
5594 + | self.map_of_length_string = input.map(|v| v.into());
|
6268 5595 | self
|
6269 5596 | }
|
6270 5597 | #[allow(missing_docs)] // documentation missing in model
|
6271 - | pub(crate) fn set_max_range_integer(
|
5598 + | pub fn list_of_length_blob(
|
6272 5599 | mut self,
|
6273 - | input: impl ::std::convert::Into<
|
6274 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
6275 - | >,
|
5600 + | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthBlob>>,
|
6276 5601 | ) -> Self {
|
6277 - | self.max_range_integer = Some(input.into());
|
5602 + | self.list_of_length_blob =
|
5603 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6278 5604 | self
|
6279 5605 | }
|
6280 5606 | #[allow(missing_docs)] // documentation missing in model
|
6281 - | pub fn fixed_value_integer(mut self, input: crate::model::FixedValueInteger) -> Self {
|
6282 - | self.fixed_value_integer =
|
6283 - | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5607 + | pub(crate) fn set_list_of_length_blob(
|
5608 + | mut self,
|
5609 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
5610 + | ) -> Self {
|
5611 + | self.list_of_length_blob = input.map(|v| v.into());
|
6284 5612 | self
|
6285 5613 | }
|
6286 5614 | #[allow(missing_docs)] // documentation missing in model
|
6287 - | pub(crate) fn set_fixed_value_integer(
|
5615 + | pub fn map_of_length_blob(
|
6288 5616 | mut self,
|
6289 - | input: impl ::std::convert::Into<
|
6290 - | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
5617 + | input: ::std::option::Option<
|
5618 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
6291 5619 | >,
|
6292 5620 | ) -> Self {
|
6293 - | self.fixed_value_integer = Some(input.into());
|
6294 - | self
|
6295 - | }
|
6296 - | #[allow(missing_docs)] // documentation missing in model
|
6297 - | pub fn range_short(mut self, input: crate::model::RangeShort) -> Self {
|
6298 - | self.range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5621 + | self.map_of_length_blob =
|
5622 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6299 5623 | self
|
6300 5624 | }
|
6301 5625 | #[allow(missing_docs)] // documentation missing in model
|
6302 - | pub(crate) fn set_range_short(
|
5626 + | pub(crate) fn set_map_of_length_blob(
|
6303 5627 | mut self,
|
6304 - | input: impl ::std::convert::Into<
|
6305 - | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
6306 - | >,
|
5628 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
6307 5629 | ) -> Self {
|
6308 - | self.range_short = Some(input.into());
|
5630 + | self.map_of_length_blob = input.map(|v| v.into());
|
6309 5631 | self
|
6310 5632 | }
|
6311 5633 | #[allow(missing_docs)] // documentation missing in model
|
6312 - | pub fn min_range_short(mut self, input: crate::model::MinRangeShort) -> Self {
|
6313 - | self.min_range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5634 + | pub fn list_of_range_integer(
|
5635 + | mut self,
|
5636 + | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeInteger>>,
|
5637 + | ) -> Self {
|
5638 + | self.list_of_range_integer =
|
5639 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6314 5640 | self
|
6315 5641 | }
|
6316 5642 | #[allow(missing_docs)] // documentation missing in model
|
6317 - | pub(crate) fn set_min_range_short(
|
5643 + | pub(crate) fn set_list_of_range_integer(
|
6318 5644 | mut self,
|
6319 - | input: impl ::std::convert::Into<
|
6320 - | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
6321 - | >,
|
5645 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
6322 5646 | ) -> Self {
|
6323 - | self.min_range_short = Some(input.into());
|
5647 + | self.list_of_range_integer = input.map(|v| v.into());
|
6324 5648 | self
|
6325 5649 | }
|
6326 5650 | #[allow(missing_docs)] // documentation missing in model
|
6327 - | pub fn max_range_short(mut self, input: crate::model::MaxRangeShort) -> Self {
|
6328 - | self.max_range_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5651 + | pub fn set_of_range_integer(
|
5652 + | mut self,
|
5653 + | input: ::std::option::Option<crate::model::SetOfRangeInteger>,
|
5654 + | ) -> Self {
|
5655 + | self.set_of_range_integer =
|
5656 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6329 5657 | self
|
6330 5658 | }
|
6331 5659 | #[allow(missing_docs)] // documentation missing in model
|
6332 - | pub(crate) fn set_max_range_short(
|
5660 + | pub(crate) fn set_set_of_range_integer(
|
6333 5661 | mut self,
|
6334 - | input: impl ::std::convert::Into<
|
6335 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
5662 + | input: Option<
|
5663 + | impl ::std::convert::Into<
|
5664 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
5665 + | >,
|
6336 5666 | >,
|
6337 5667 | ) -> Self {
|
6338 - | self.max_range_short = Some(input.into());
|
6339 - | self
|
6340 - | }
|
6341 - | #[allow(missing_docs)] // documentation missing in model
|
6342 - | pub fn fixed_value_short(mut self, input: crate::model::FixedValueShort) -> Self {
|
6343 - | self.fixed_value_short = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5668 + | self.set_of_range_integer = input.map(|v| v.into());
|
6344 5669 | self
|
6345 5670 | }
|
6346 5671 | #[allow(missing_docs)] // documentation missing in model
|
6347 - | pub(crate) fn set_fixed_value_short(
|
5672 + | pub fn map_of_range_integer(
|
6348 5673 | mut self,
|
6349 - | input: impl ::std::convert::Into<
|
6350 - | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
5674 + | input: ::std::option::Option<
|
5675 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
6351 5676 | >,
|
6352 5677 | ) -> Self {
|
6353 - | self.fixed_value_short = Some(input.into());
|
5678 + | self.map_of_range_integer =
|
5679 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6354 5680 | self
|
6355 5681 | }
|
6356 5682 | #[allow(missing_docs)] // documentation missing in model
|
6357 - | pub fn range_long(mut self, input: crate::model::RangeLong) -> Self {
|
6358 - | self.range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5683 + | pub(crate) fn set_map_of_range_integer(
|
5684 + | mut self,
|
5685 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
5686 + | ) -> Self {
|
5687 + | self.map_of_range_integer = input.map(|v| v.into());
|
6359 5688 | self
|
6360 5689 | }
|
6361 5690 | #[allow(missing_docs)] // documentation missing in model
|
6362 - | pub(crate) fn set_range_long(
|
5691 + | pub fn list_of_range_short(
|
6363 5692 | mut self,
|
6364 - | input: impl ::std::convert::Into<
|
6365 - | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
6366 - | >,
|
5693 + | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeShort>>,
|
6367 5694 | ) -> Self {
|
6368 - | self.range_long = Some(input.into());
|
5695 + | self.list_of_range_short =
|
5696 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6369 5697 | self
|
6370 5698 | }
|
6371 5699 | #[allow(missing_docs)] // documentation missing in model
|
6372 - | pub fn min_range_long(mut self, input: crate::model::MinRangeLong) -> Self {
|
6373 - | self.min_range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5700 + | pub(crate) fn set_list_of_range_short(
|
5701 + | mut self,
|
5702 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
5703 + | ) -> Self {
|
5704 + | self.list_of_range_short = input.map(|v| v.into());
|
6374 5705 | self
|
6375 5706 | }
|
6376 5707 | #[allow(missing_docs)] // documentation missing in model
|
6377 - | pub(crate) fn set_min_range_long(
|
5708 + | pub fn set_of_range_short(
|
6378 5709 | mut self,
|
6379 - | input: impl ::std::convert::Into<
|
6380 - | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
6381 - | >,
|
5710 + | input: ::std::option::Option<crate::model::SetOfRangeShort>,
|
6382 5711 | ) -> Self {
|
6383 - | self.min_range_long = Some(input.into());
|
5712 + | self.set_of_range_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6384 5713 | self
|
6385 5714 | }
|
6386 5715 | #[allow(missing_docs)] // documentation missing in model
|
6387 - | pub fn max_range_long(mut self, input: crate::model::MaxRangeLong) -> Self {
|
6388 - | self.max_range_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5716 + | pub(crate) fn set_set_of_range_short(
|
5717 + | mut self,
|
5718 + | input: Option<
|
5719 + | impl ::std::convert::Into<
|
5720 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
5721 + | >,
|
5722 + | >,
|
5723 + | ) -> Self {
|
5724 + | self.set_of_range_short = input.map(|v| v.into());
|
6389 5725 | self
|
6390 5726 | }
|
6391 5727 | #[allow(missing_docs)] // documentation missing in model
|
6392 - | pub(crate) fn set_max_range_long(
|
5728 + | pub fn map_of_range_short(
|
6393 5729 | mut self,
|
6394 - | input: impl ::std::convert::Into<
|
6395 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
5730 + | input: ::std::option::Option<
|
5731 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
6396 5732 | >,
|
6397 5733 | ) -> Self {
|
6398 - | self.max_range_long = Some(input.into());
|
5734 + | self.map_of_range_short =
|
5735 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6399 5736 | self
|
6400 5737 | }
|
6401 5738 | #[allow(missing_docs)] // documentation missing in model
|
6402 - | pub fn fixed_value_long(mut self, input: crate::model::FixedValueLong) -> Self {
|
6403 - | self.fixed_value_long = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5739 + | pub(crate) fn set_map_of_range_short(
|
5740 + | mut self,
|
5741 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
5742 + | ) -> Self {
|
5743 + | self.map_of_range_short = input.map(|v| v.into());
|
6404 5744 | self
|
6405 5745 | }
|
6406 5746 | #[allow(missing_docs)] // documentation missing in model
|
6407 - | pub(crate) fn set_fixed_value_long(
|
5747 + | pub fn list_of_range_long(
|
6408 5748 | mut self,
|
6409 - | input: impl ::std::convert::Into<
|
6410 - | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
6411 - | >,
|
5749 + | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeLong>>,
|
6412 5750 | ) -> Self {
|
6413 - | self.fixed_value_long = Some(input.into());
|
5751 + | self.list_of_range_long =
|
5752 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6414 5753 | self
|
6415 5754 | }
|
6416 5755 | #[allow(missing_docs)] // documentation missing in model
|
6417 - | pub fn range_byte(mut self, input: crate::model::RangeByte) -> Self {
|
6418 - | self.range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5756 + | pub(crate) fn set_list_of_range_long(
|
5757 + | mut self,
|
5758 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
5759 + | ) -> Self {
|
5760 + | self.list_of_range_long = input.map(|v| v.into());
|
6419 5761 | self
|
6420 5762 | }
|
6421 5763 | #[allow(missing_docs)] // documentation missing in model
|
6422 - | pub(crate) fn set_range_byte(
|
5764 + | pub fn set_of_range_long(
|
6423 5765 | mut self,
|
6424 - | input: impl ::std::convert::Into<
|
6425 - | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
6426 - | >,
|
5766 + | input: ::std::option::Option<crate::model::SetOfRangeLong>,
|
6427 5767 | ) -> Self {
|
6428 - | self.range_byte = Some(input.into());
|
5768 + | self.set_of_range_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6429 5769 | self
|
6430 5770 | }
|
6431 5771 | #[allow(missing_docs)] // documentation missing in model
|
6432 - | pub fn min_range_byte(mut self, input: crate::model::MinRangeByte) -> Self {
|
6433 - | self.min_range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
6434 - | self
|
6435 - | }
|
6436 - | #[allow(missing_docs)] // documentation missing in model
|
6437 - | pub(crate) fn set_min_range_byte(
|
5772 + | pub(crate) fn set_set_of_range_long(
|
6438 5773 | mut self,
|
6439 - | input: impl ::std::convert::Into<
|
6440 - | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
5774 + | input: Option<
|
5775 + | impl ::std::convert::Into<
|
5776 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
5777 + | >,
|
6441 5778 | >,
|
6442 5779 | ) -> Self {
|
6443 - | self.min_range_byte = Some(input.into());
|
6444 - | self
|
6445 - | }
|
6446 - | #[allow(missing_docs)] // documentation missing in model
|
6447 - | pub fn max_range_byte(mut self, input: crate::model::MaxRangeByte) -> Self {
|
6448 - | self.max_range_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5780 + | self.set_of_range_long = input.map(|v| v.into());
|
6449 5781 | self
|
6450 5782 | }
|
6451 5783 | #[allow(missing_docs)] // documentation missing in model
|
6452 - | pub(crate) fn set_max_range_byte(
|
5784 + | pub fn map_of_range_long(
|
6453 5785 | mut self,
|
6454 - | input: impl ::std::convert::Into<
|
6455 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
5786 + | input: ::std::option::Option<
|
5787 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
6456 5788 | >,
|
6457 5789 | ) -> Self {
|
6458 - | self.max_range_byte = Some(input.into());
|
6459 - | self
|
6460 - | }
|
6461 - | #[allow(missing_docs)] // documentation missing in model
|
6462 - | pub fn fixed_value_byte(mut self, input: crate::model::FixedValueByte) -> Self {
|
6463 - | self.fixed_value_byte = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
5790 + | self.map_of_range_long =
|
5791 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6464 5792 | self
|
6465 5793 | }
|
6466 5794 | #[allow(missing_docs)] // documentation missing in model
|
6467 - | pub(crate) fn set_fixed_value_byte(
|
5795 + | pub(crate) fn set_map_of_range_long(
|
6468 5796 | mut self,
|
6469 - | input: impl ::std::convert::Into<
|
6470 - | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
6471 - | >,
|
5797 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
6472 5798 | ) -> Self {
|
6473 - | self.fixed_value_byte = Some(input.into());
|
5799 + | self.map_of_range_long = input.map(|v| v.into());
|
6474 5800 | self
|
6475 5801 | }
|
6476 5802 | #[allow(missing_docs)] // documentation missing in model
|
6477 - | pub fn con_b_list(
|
5803 + | pub fn list_of_range_byte(
|
6478 5804 | mut self,
|
6479 - | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
5805 + | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeByte>>,
|
6480 5806 | ) -> Self {
|
6481 - | self.con_b_list =
|
5807 + | self.list_of_range_byte =
|
6482 5808 | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6483 5809 | self
|
6484 5810 | }
|
6485 5811 | #[allow(missing_docs)] // documentation missing in model
|
6486 - | pub(crate) fn set_con_b_list(
|
5812 + | pub(crate) fn set_list_of_range_byte(
|
6487 5813 | mut self,
|
6488 - | input: Option<
|
6489 - | impl ::std::convert::Into<
|
6490 - | crate::constrained::MaybeConstrained<
|
6491 - | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
6492 - | >,
|
6493 - | >,
|
6494 - | >,
|
5814 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
6495 5815 | ) -> Self {
|
6496 - | self.con_b_list = input.map(|v| v.into());
|
5816 + | self.list_of_range_byte = input.map(|v| v.into());
|
6497 5817 | self
|
6498 5818 | }
|
6499 5819 | #[allow(missing_docs)] // documentation missing in model
|
6500 - | pub fn length_list(
|
5820 + | pub fn set_of_range_byte(
|
6501 5821 | mut self,
|
6502 - | input: ::std::option::Option<crate::model::LengthList>,
|
5822 + | input: ::std::option::Option<crate::model::SetOfRangeByte>,
|
6503 5823 | ) -> Self {
|
6504 - | self.length_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5824 + | self.set_of_range_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6505 5825 | self
|
6506 5826 | }
|
6507 5827 | #[allow(missing_docs)] // documentation missing in model
|
6508 - | pub(crate) fn set_length_list(
|
5828 + | pub(crate) fn set_set_of_range_byte(
|
6509 5829 | mut self,
|
6510 5830 | input: Option<
|
6511 5831 | impl ::std::convert::Into<
|
6512 - | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
5832 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
6513 5833 | >,
|
6514 5834 | >,
|
6515 5835 | ) -> Self {
|
6516 - | self.length_list = input.map(|v| v.into());
|
5836 + | self.set_of_range_byte = input.map(|v| v.into());
|
6517 5837 | self
|
6518 5838 | }
|
6519 5839 | #[allow(missing_docs)] // documentation missing in model
|
6520 - | pub fn sensitive_length_list(
|
5840 + | pub fn map_of_range_byte(
|
6521 5841 | mut self,
|
6522 - | input: ::std::option::Option<crate::model::SensitiveLengthList>,
|
5842 + | input: ::std::option::Option<
|
5843 + | ::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
5844 + | >,
|
6523 5845 | ) -> Self {
|
6524 - | self.sensitive_length_list =
|
6525 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
5846 + | self.map_of_range_byte =
|
5847 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6526 5848 | self
|
6527 5849 | }
|
6528 5850 | #[allow(missing_docs)] // documentation missing in model
|
6529 - | pub(crate) fn set_sensitive_length_list(
|
5851 + | pub(crate) fn set_map_of_range_byte(
|
6530 5852 | mut self,
|
6531 - | input: Option<
|
6532 - | impl ::std::convert::Into<
|
6533 - | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
6534 - | >,
|
6535 - | >,
|
5853 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
6536 5854 | ) -> Self {
|
6537 - | self.sensitive_length_list = input.map(|v| v.into());
|
6538 - | self
|
6539 - | }
|
6540 - | #[allow(missing_docs)] // documentation missing in model
|
6541 - | pub fn con_b_set(mut self, input: ::std::option::Option<crate::model::ConBSet>) -> Self {
|
6542 - | self.con_b_set = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5855 + | self.map_of_range_byte = input.map(|v| v.into());
|
6543 5856 | self
|
6544 5857 | }
|
6545 5858 | #[allow(missing_docs)] // documentation missing in model
|
6546 - | pub(crate) fn set_con_b_set(
|
5859 + | pub fn non_streaming_blob(
|
6547 5860 | mut self,
|
6548 - | input: Option<
|
6549 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6550 - | >,
|
5861 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6551 5862 | ) -> Self {
|
6552 - | self.con_b_set = input.map(|v| v.into());
|
6553 - | self
|
6554 - | }
|
6555 - | #[allow(missing_docs)] // documentation missing in model
|
6556 - | pub fn con_b_map(mut self, input: ::std::option::Option<crate::model::ConBMap>) -> Self {
|
6557 - | self.con_b_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5863 + | self.non_streaming_blob = input;
|
6558 5864 | self
|
6559 5865 | }
|
6560 5866 | #[allow(missing_docs)] // documentation missing in model
|
6561 - | pub(crate) fn set_con_b_map(
|
5867 + | pub(crate) fn set_non_streaming_blob(
|
6562 5868 | mut self,
|
6563 - | input: Option<
|
6564 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6565 - | >,
|
5869 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
6566 5870 | ) -> Self {
|
6567 - | self.con_b_map = input.map(|v| v.into());
|
5871 + | self.non_streaming_blob = input.map(|v| v.into());
|
6568 5872 | self
|
6569 5873 | }
|
6570 5874 | #[allow(missing_docs)] // documentation missing in model
|
6571 - | pub fn length_map(mut self, input: ::std::option::Option<crate::model::LengthMap>) -> Self {
|
6572 - | self.length_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5875 + | pub fn pattern_string(
|
5876 + | mut self,
|
5877 + | input: ::std::option::Option<crate::model::PatternString>,
|
5878 + | ) -> Self {
|
5879 + | self.pattern_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6573 5880 | self
|
6574 5881 | }
|
6575 5882 | #[allow(missing_docs)] // documentation missing in model
|
6576 - | pub(crate) fn set_length_map(
|
5883 + | pub(crate) fn set_pattern_string(
|
6577 5884 | mut self,
|
6578 5885 | input: Option<
|
6579 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
5886 + | impl ::std::convert::Into<
|
5887 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
5888 + | >,
|
6580 5889 | >,
|
6581 5890 | ) -> Self {
|
6582 - | self.length_map = input.map(|v| v.into());
|
5891 + | self.pattern_string = input.map(|v| v.into());
|
6583 5892 | self
|
6584 5893 | }
|
6585 5894 | #[allow(missing_docs)] // documentation missing in model
|
6586 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
5895 + | pub fn map_of_pattern_string(
|
6587 5896 | mut self,
|
6588 5897 | input: ::std::option::Option<
|
6589 5898 | ::std::collections::HashMap<
|
6590 - | ::std::string::String,
|
6591 - | ::std::collections::HashMap<
|
6592 - | ::std::string::String,
|
6593 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
6594 - | >,
|
5899 + | crate::model::PatternString,
|
5900 + | crate::model::PatternString,
|
6595 5901 | >,
|
6596 5902 | >,
|
6597 5903 | ) -> Self {
|
6598 - | self.map_of_map_of_list_of_list_of_con_b =
|
5904 + | self.map_of_pattern_string =
|
6599 5905 | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6600 5906 | self
|
6601 5907 | }
|
6602 5908 | #[allow(missing_docs)] // documentation missing in model
|
6603 - | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
5909 + | pub(crate) fn set_map_of_pattern_string(
|
6604 5910 | mut self,
|
6605 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
5911 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
6606 5912 | ) -> Self {
|
6607 - | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
5913 + | self.map_of_pattern_string = input.map(|v| v.into());
|
6608 5914 | self
|
6609 5915 | }
|
6610 5916 | #[allow(missing_docs)] // documentation missing in model
|
6611 - | pub fn sparse_map(
|
5917 + | pub fn list_of_pattern_string(
|
6612 5918 | mut self,
|
6613 - | input: ::std::option::Option<
|
6614 - | ::std::collections::HashMap<
|
6615 - | ::std::string::String,
|
6616 - | ::std::option::Option<crate::model::UniqueItemsList>,
|
6617 - | >,
|
6618 - | >,
|
5919 + | input: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
6619 5920 | ) -> Self {
|
6620 - | self.sparse_map =
|
5921 + | self.list_of_pattern_string =
|
6621 5922 | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6622 5923 | self
|
6623 5924 | }
|
6624 5925 | #[allow(missing_docs)] // documentation missing in model
|
6625 - | pub(crate) fn set_sparse_map(
|
5926 + | pub(crate) fn set_list_of_pattern_string(
|
6626 5927 | mut self,
|
6627 - | input: Option<
|
6628 - | impl ::std::convert::Into<
|
6629 - | crate::constrained::MaybeConstrained<
|
6630 - | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
6631 - | >,
|
6632 - | >,
|
6633 - | >,
|
5928 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
6634 5929 | ) -> Self {
|
6635 - | self.sparse_map = input.map(|v| v.into());
|
5930 + | self.list_of_pattern_string = input.map(|v| v.into());
|
6636 5931 | self
|
6637 5932 | }
|
6638 5933 | #[allow(missing_docs)] // documentation missing in model
|
6639 - | pub fn sparse_list(
|
5934 + | pub fn set_of_pattern_string(
|
6640 5935 | mut self,
|
6641 - | input: ::std::option::Option<
|
6642 - | ::std::vec::Vec<::std::option::Option<crate::model::LengthString>>,
|
6643 - | >,
|
5936 + | input: ::std::option::Option<crate::model::SetOfPatternString>,
|
6644 5937 | ) -> Self {
|
6645 - | self.sparse_list =
|
6646 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
5938 + | self.set_of_pattern_string =
|
5939 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6647 5940 | self
|
6648 5941 | }
|
6649 5942 | #[allow(missing_docs)] // documentation missing in model
|
6650 - | pub(crate) fn set_sparse_list(
|
5943 + | pub(crate) fn set_set_of_pattern_string(
|
6651 5944 | mut self,
|
6652 5945 | input: Option<
|
6653 5946 | impl ::std::convert::Into<
|
6654 - | crate::constrained::MaybeConstrained<
|
6655 - | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
6656 - | >,
|
5947 + | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
6657 5948 | >,
|
6658 5949 | >,
|
6659 5950 | ) -> Self {
|
6660 - | self.sparse_list = input.map(|v| v.into());
|
5951 + | self.set_of_pattern_string = input.map(|v| v.into());
|
6661 5952 | self
|
6662 5953 | }
|
6663 5954 | #[allow(missing_docs)] // documentation missing in model
|
6664 - | pub fn sparse_length_map(
|
5955 + | pub fn length_length_pattern_string(
|
6665 5956 | mut self,
|
6666 - | input: ::std::option::Option<crate::model::SparseLengthMap>,
|
5957 + | input: ::std::option::Option<crate::model::LengthPatternString>,
|
6667 5958 | ) -> Self {
|
6668 - | self.sparse_length_map = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5959 + | self.length_length_pattern_string =
|
5960 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6669 5961 | self
|
6670 5962 | }
|
6671 5963 | #[allow(missing_docs)] // documentation missing in model
|
6672 - | pub(crate) fn set_sparse_length_map(
|
5964 + | pub(crate) fn set_length_length_pattern_string(
|
6673 5965 | mut self,
|
6674 5966 | input: Option<
|
6675 5967 | impl ::std::convert::Into<
|
6676 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
5968 + | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
6677 5969 | >,
|
6678 5970 | >,
|
6679 5971 | ) -> Self {
|
6680 - | self.sparse_length_map = input.map(|v| v.into());
|
5972 + | self.length_length_pattern_string = input.map(|v| v.into());
|
6681 5973 | self
|
6682 5974 | }
|
6683 5975 | #[allow(missing_docs)] // documentation missing in model
|
6684 - | pub fn sparse_length_list(
|
5976 + | pub fn map_of_length_pattern_string(
|
6685 5977 | mut self,
|
6686 - | input: ::std::option::Option<crate::model::SparseLengthList>,
|
5978 + | input: ::std::option::Option<
|
5979 + | ::std::collections::HashMap<
|
5980 + | crate::model::LengthPatternString,
|
5981 + | crate::model::LengthPatternString,
|
5982 + | >,
|
5983 + | >,
|
6687 5984 | ) -> Self {
|
6688 - | self.sparse_length_list = input.map(crate::constrained::MaybeConstrained::Constrained);
|
5985 + | self.map_of_length_pattern_string =
|
5986 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6689 5987 | self
|
6690 5988 | }
|
6691 5989 | #[allow(missing_docs)] // documentation missing in model
|
6692 - | pub(crate) fn set_sparse_length_list(
|
5990 + | pub(crate) fn set_map_of_length_pattern_string(
|
6693 5991 | mut self,
|
6694 - | input: Option<
|
6695 - | impl ::std::convert::Into<
|
6696 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
6697 - | >,
|
6698 - | >,
|
5992 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
6699 5993 | ) -> Self {
|
6700 - | self.sparse_length_list = input.map(|v| v.into());
|
5994 + | self.map_of_length_pattern_string = input.map(|v| v.into());
|
6701 5995 | self
|
6702 5996 | }
|
6703 - | /// A union with constrained members.
|
6704 - | pub fn constrained_union(
|
5997 + | #[allow(missing_docs)] // documentation missing in model
|
5998 + | pub fn list_of_length_pattern_string(
|
6705 5999 | mut self,
|
6706 - | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
6000 + | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthPatternString>>,
|
6707 6001 | ) -> Self {
|
6708 - | self.constrained_union = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6002 + | self.list_of_length_pattern_string =
|
6003 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6709 6004 | self
|
6710 6005 | }
|
6711 - | /// A union with constrained members.
|
6712 - | pub(crate) fn set_constrained_union(
|
6006 + | #[allow(missing_docs)] // documentation missing in model
|
6007 + | pub(crate) fn set_list_of_length_pattern_string(
|
6713 6008 | mut self,
|
6714 - | input: Option<
|
6715 - | impl ::std::convert::Into<
|
6716 - | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
6717 - | >,
|
6718 - | >,
|
6009 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
6719 6010 | ) -> Self {
|
6720 - | self.constrained_union = input.map(|v| v.into());
|
6011 + | self.list_of_length_pattern_string = input.map(|v| v.into());
|
6721 6012 | self
|
6722 6013 | }
|
6723 6014 | #[allow(missing_docs)] // documentation missing in model
|
6724 - | pub fn enum_string(
|
6015 + | pub fn set_of_length_pattern_string(
|
6725 6016 | mut self,
|
6726 - | input: ::std::option::Option<crate::model::EnumString>,
|
6017 + | input: ::std::option::Option<crate::model::SetOfLengthPatternString>,
|
6727 6018 | ) -> Self {
|
6728 - | self.enum_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6019 + | self.set_of_length_pattern_string =
|
6020 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6729 6021 | self
|
6730 6022 | }
|
6731 6023 | #[allow(missing_docs)] // documentation missing in model
|
6732 - | pub(crate) fn set_enum_string(
|
6024 + | pub(crate) fn set_set_of_length_pattern_string(
|
6733 6025 | mut self,
|
6734 6026 | input: Option<
|
6735 6027 | impl ::std::convert::Into<
|
6736 - | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6028 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
6737 6029 | >,
|
6738 6030 | >,
|
6739 6031 | ) -> Self {
|
6740 - | self.enum_string = input.map(|v| v.into());
|
6741 - | self
|
6742 - | }
|
6743 - | #[allow(missing_docs)] // documentation missing in model
|
6744 - | pub fn list_of_length_string(
|
6745 - | mut self,
|
6746 - | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthString>>,
|
6747 - | ) -> Self {
|
6748 - | self.list_of_length_string =
|
6749 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6750 - | self
|
6751 - | }
|
6752 - | #[allow(missing_docs)] // documentation missing in model
|
6753 - | pub(crate) fn set_list_of_length_string(
|
6754 - | mut self,
|
6755 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
6756 - | ) -> Self {
|
6757 - | self.list_of_length_string = input.map(|v| v.into());
|
6032 + | self.set_of_length_pattern_string = input.map(|v| v.into());
|
6758 6033 | self
|
6759 6034 | }
|
6760 6035 | #[allow(missing_docs)] // documentation missing in model
|
6761 - | pub fn set_of_length_string(
|
6036 + | pub fn length_list_of_pattern_string(
|
6762 6037 | mut self,
|
6763 - | input: ::std::option::Option<crate::model::SetOfLengthString>,
|
6038 + | input: ::std::option::Option<crate::model::LengthListOfPatternString>,
|
6764 6039 | ) -> Self {
|
6765 - | self.set_of_length_string =
|
6040 + | self.length_list_of_pattern_string =
|
6766 6041 | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6767 6042 | self
|
6768 6043 | }
|
6769 6044 | #[allow(missing_docs)] // documentation missing in model
|
6770 - | pub(crate) fn set_set_of_length_string(
|
6045 + | pub(crate) fn set_length_list_of_pattern_string(
|
6771 6046 | mut self,
|
6772 6047 | input: Option<
|
6773 6048 | impl ::std::convert::Into<
|
6774 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
6775 - | >,
|
6776 - | >,
|
6777 - | ) -> Self {
|
6778 - | self.set_of_length_string = input.map(|v| v.into());
|
6779 - | self
|
6780 - | }
|
6781 - | #[allow(missing_docs)] // documentation missing in model
|
6782 - | pub fn map_of_length_string(
|
6783 - | mut self,
|
6784 - | input: ::std::option::Option<
|
6785 - | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
|
6049 + | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
6786 6050 | >,
|
6787 - | ) -> Self {
|
6788 - | self.map_of_length_string =
|
6789 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6790 - | self
|
6791 - | }
|
6792 - | #[allow(missing_docs)] // documentation missing in model
|
6793 - | pub(crate) fn set_map_of_length_string(
|
6794 - | mut self,
|
6795 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
6796 - | ) -> Self {
|
6797 - | self.map_of_length_string = input.map(|v| v.into());
|
6798 - | self
|
6799 - | }
|
6800 - | #[allow(missing_docs)] // documentation missing in model
|
6801 - | pub fn list_of_length_blob(
|
6802 - | mut self,
|
6803 - | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthBlob>>,
|
6804 - | ) -> Self {
|
6805 - | self.list_of_length_blob =
|
6806 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6807 - | self
|
6808 - | }
|
6809 - | #[allow(missing_docs)] // documentation missing in model
|
6810 - | pub(crate) fn set_list_of_length_blob(
|
6811 - | mut self,
|
6812 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
6813 - | ) -> Self {
|
6814 - | self.list_of_length_blob = input.map(|v| v.into());
|
6815 - | self
|
6816 - | }
|
6817 - | #[allow(missing_docs)] // documentation missing in model
|
6818 - | pub fn map_of_length_blob(
|
6819 - | mut self,
|
6820 - | input: ::std::option::Option<
|
6821 - | ::std::collections::HashMap<::std::string::String, crate::model::LengthBlob>,
|
6822 6051 | >,
|
6823 6052 | ) -> Self {
|
6824 - | self.map_of_length_blob =
|
6825 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6826 - | self
|
6827 - | }
|
6828 - | #[allow(missing_docs)] // documentation missing in model
|
6829 - | pub(crate) fn set_map_of_length_blob(
|
6830 - | mut self,
|
6831 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
6832 - | ) -> Self {
|
6833 - | self.map_of_length_blob = input.map(|v| v.into());
|
6834 - | self
|
6835 - | }
|
6836 - | #[allow(missing_docs)] // documentation missing in model
|
6837 - | pub fn list_of_range_integer(
|
6838 - | mut self,
|
6839 - | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeInteger>>,
|
6840 - | ) -> Self {
|
6841 - | self.list_of_range_integer =
|
6842 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6843 - | self
|
6844 - | }
|
6845 - | #[allow(missing_docs)] // documentation missing in model
|
6846 - | pub(crate) fn set_list_of_range_integer(
|
6847 - | mut self,
|
6848 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
6849 - | ) -> Self {
|
6850 - | self.list_of_range_integer = input.map(|v| v.into());
|
6053 + | self.length_list_of_pattern_string = input.map(|v| v.into());
|
6851 6054 | self
|
6852 6055 | }
|
6853 6056 | #[allow(missing_docs)] // documentation missing in model
|
6854 - | pub fn set_of_range_integer(
|
6057 + | pub fn length_set_of_pattern_string(
|
6855 6058 | mut self,
|
6856 - | input: ::std::option::Option<crate::model::SetOfRangeInteger>,
|
6059 + | input: ::std::option::Option<crate::model::LengthSetOfPatternString>,
|
6857 6060 | ) -> Self {
|
6858 - | self.set_of_range_integer =
|
6061 + | self.length_set_of_pattern_string =
|
6859 6062 | input.map(crate::constrained::MaybeConstrained::Constrained);
|
6860 6063 | self
|
6861 6064 | }
|
6862 6065 | #[allow(missing_docs)] // documentation missing in model
|
6863 - | pub(crate) fn set_set_of_range_integer(
|
6864 - | mut self,
|
6865 - | input: Option<
|
6866 - | impl ::std::convert::Into<
|
6867 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
6868 - | >,
|
6869 - | >,
|
6870 - | ) -> Self {
|
6871 - | self.set_of_range_integer = input.map(|v| v.into());
|
6872 - | self
|
6873 - | }
|
6874 - | #[allow(missing_docs)] // documentation missing in model
|
6875 - | pub fn map_of_range_integer(
|
6876 - | mut self,
|
6877 - | input: ::std::option::Option<
|
6878 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeInteger>,
|
6879 - | >,
|
6880 - | ) -> Self {
|
6881 - | self.map_of_range_integer =
|
6882 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6883 - | self
|
6884 - | }
|
6885 - | #[allow(missing_docs)] // documentation missing in model
|
6886 - | pub(crate) fn set_map_of_range_integer(
|
6887 - | mut self,
|
6888 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
6889 - | ) -> Self {
|
6890 - | self.map_of_range_integer = input.map(|v| v.into());
|
6891 - | self
|
6892 - | }
|
6893 - | #[allow(missing_docs)] // documentation missing in model
|
6894 - | pub fn list_of_range_short(
|
6895 - | mut self,
|
6896 - | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeShort>>,
|
6897 - | ) -> Self {
|
6898 - | self.list_of_range_short =
|
6899 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6900 - | self
|
6901 - | }
|
6902 - | #[allow(missing_docs)] // documentation missing in model
|
6903 - | pub(crate) fn set_list_of_range_short(
|
6904 - | mut self,
|
6905 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
6906 - | ) -> Self {
|
6907 - | self.list_of_range_short = input.map(|v| v.into());
|
6908 - | self
|
6909 - | }
|
6910 - | #[allow(missing_docs)] // documentation missing in model
|
6911 - | pub fn set_of_range_short(
|
6912 - | mut self,
|
6913 - | input: ::std::option::Option<crate::model::SetOfRangeShort>,
|
6914 - | ) -> Self {
|
6915 - | self.set_of_range_short = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6916 - | self
|
6917 - | }
|
6918 - | #[allow(missing_docs)] // documentation missing in model
|
6919 - | pub(crate) fn set_set_of_range_short(
|
6920 - | mut self,
|
6921 - | input: Option<
|
6922 - | impl ::std::convert::Into<
|
6923 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
6924 - | >,
|
6925 - | >,
|
6926 - | ) -> Self {
|
6927 - | self.set_of_range_short = input.map(|v| v.into());
|
6928 - | self
|
6929 - | }
|
6930 - | #[allow(missing_docs)] // documentation missing in model
|
6931 - | pub fn map_of_range_short(
|
6932 - | mut self,
|
6933 - | input: ::std::option::Option<
|
6934 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeShort>,
|
6935 - | >,
|
6936 - | ) -> Self {
|
6937 - | self.map_of_range_short =
|
6938 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6939 - | self
|
6940 - | }
|
6941 - | #[allow(missing_docs)] // documentation missing in model
|
6942 - | pub(crate) fn set_map_of_range_short(
|
6943 - | mut self,
|
6944 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
6945 - | ) -> Self {
|
6946 - | self.map_of_range_short = input.map(|v| v.into());
|
6947 - | self
|
6948 - | }
|
6949 - | #[allow(missing_docs)] // documentation missing in model
|
6950 - | pub fn list_of_range_long(
|
6951 - | mut self,
|
6952 - | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeLong>>,
|
6953 - | ) -> Self {
|
6954 - | self.list_of_range_long =
|
6955 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6956 - | self
|
6957 - | }
|
6958 - | #[allow(missing_docs)] // documentation missing in model
|
6959 - | pub(crate) fn set_list_of_range_long(
|
6960 - | mut self,
|
6961 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
6962 - | ) -> Self {
|
6963 - | self.list_of_range_long = input.map(|v| v.into());
|
6964 - | self
|
6965 - | }
|
6966 - | #[allow(missing_docs)] // documentation missing in model
|
6967 - | pub fn set_of_range_long(
|
6968 - | mut self,
|
6969 - | input: ::std::option::Option<crate::model::SetOfRangeLong>,
|
6970 - | ) -> Self {
|
6971 - | self.set_of_range_long = input.map(crate::constrained::MaybeConstrained::Constrained);
|
6972 - | self
|
6973 - | }
|
6974 - | #[allow(missing_docs)] // documentation missing in model
|
6975 - | pub(crate) fn set_set_of_range_long(
|
6066 + | pub(crate) fn set_length_set_of_pattern_string(
|
6976 6067 | mut self,
|
6977 6068 | input: Option<
|
6978 6069 | impl ::std::convert::Into<
|
6979 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
6980 - | >,
|
6070 + | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
6981 6071 | >,
|
6982 - | ) -> Self {
|
6983 - | self.set_of_range_long = input.map(|v| v.into());
|
6984 - | self
|
6985 - | }
|
6986 - | #[allow(missing_docs)] // documentation missing in model
|
6987 - | pub fn map_of_range_long(
|
6988 - | mut self,
|
6989 - | input: ::std::option::Option<
|
6990 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeLong>,
|
6991 6072 | >,
|
6992 6073 | ) -> Self {
|
6993 - | self.map_of_range_long =
|
6994 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
6074 + | self.length_set_of_pattern_string = input.map(|v| v.into());
|
6995 6075 | self
|
6996 6076 | }
|
6997 - | #[allow(missing_docs)] // documentation missing in model
|
6998 - | pub(crate) fn set_map_of_range_long(
|
6999 - | mut self,
|
7000 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
7001 - | ) -> Self {
|
7002 - | self.map_of_range_long = input.map(|v| v.into());
|
7003 - | self
|
7004 - | }
|
7005 - | #[allow(missing_docs)] // documentation missing in model
|
7006 - | pub fn list_of_range_byte(
|
7007 - | mut self,
|
7008 - | input: ::std::option::Option<::std::vec::Vec<crate::model::RangeByte>>,
|
7009 - | ) -> Self {
|
7010 - | self.list_of_range_byte =
|
7011 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7012 - | self
|
7013 - | }
|
7014 - | #[allow(missing_docs)] // documentation missing in model
|
7015 - | pub(crate) fn set_list_of_range_byte(
|
7016 - | mut self,
|
7017 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
7018 - | ) -> Self {
|
7019 - | self.list_of_range_byte = input.map(|v| v.into());
|
7020 - | self
|
7021 - | }
|
7022 - | #[allow(missing_docs)] // documentation missing in model
|
7023 - | pub fn set_of_range_byte(
|
7024 - | mut self,
|
7025 - | input: ::std::option::Option<crate::model::SetOfRangeByte>,
|
7026 - | ) -> Self {
|
7027 - | self.set_of_range_byte = input.map(crate::constrained::MaybeConstrained::Constrained);
|
7028 - | self
|
7029 - | }
|
7030 - | #[allow(missing_docs)] // documentation missing in model
|
7031 - | pub(crate) fn set_set_of_range_byte(
|
7032 - | mut self,
|
7033 - | input: Option<
|
7034 - | impl ::std::convert::Into<
|
7035 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
7036 - | >,
|
7037 - | >,
|
7038 - | ) -> Self {
|
7039 - | self.set_of_range_byte = input.map(|v| v.into());
|
7040 - | self
|
7041 - | }
|
7042 - | #[allow(missing_docs)] // documentation missing in model
|
7043 - | pub fn map_of_range_byte(
|
7044 - | mut self,
|
7045 - | input: ::std::option::Option<
|
7046 - | ::std::collections::HashMap<::std::string::String, crate::model::RangeByte>,
|
7047 - | >,
|
7048 - | ) -> Self {
|
7049 - | self.map_of_range_byte =
|
7050 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7051 - | self
|
7052 - | }
|
7053 - | #[allow(missing_docs)] // documentation missing in model
|
7054 - | pub(crate) fn set_map_of_range_byte(
|
7055 - | mut self,
|
7056 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
7057 - | ) -> Self {
|
7058 - | self.map_of_range_byte = input.map(|v| v.into());
|
7059 - | self
|
7060 - | }
|
7061 - | #[allow(missing_docs)] // documentation missing in model
|
7062 - | pub fn non_streaming_blob(
|
7063 - | mut self,
|
7064 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7065 - | ) -> Self {
|
7066 - | self.non_streaming_blob = input;
|
7067 - | self
|
7068 - | }
|
7069 - | #[allow(missing_docs)] // documentation missing in model
|
7070 - | pub(crate) fn set_non_streaming_blob(
|
7071 - | mut self,
|
7072 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
7073 - | ) -> Self {
|
7074 - | self.non_streaming_blob = input.map(|v| v.into());
|
7075 - | self
|
7076 - | }
|
7077 - | #[allow(missing_docs)] // documentation missing in model
|
7078 - | pub fn pattern_string(
|
7079 - | mut self,
|
7080 - | input: ::std::option::Option<crate::model::PatternString>,
|
7081 - | ) -> Self {
|
7082 - | self.pattern_string = input.map(crate::constrained::MaybeConstrained::Constrained);
|
7083 - | self
|
7084 - | }
|
7085 - | #[allow(missing_docs)] // documentation missing in model
|
7086 - | pub(crate) fn set_pattern_string(
|
7087 - | mut self,
|
7088 - | input: Option<
|
7089 - | impl ::std::convert::Into<
|
7090 - | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
7091 - | >,
|
7092 - | >,
|
7093 - | ) -> Self {
|
7094 - | self.pattern_string = input.map(|v| v.into());
|
7095 - | self
|
7096 - | }
|
7097 - | #[allow(missing_docs)] // documentation missing in model
|
7098 - | pub fn map_of_pattern_string(
|
7099 - | mut self,
|
7100 - | input: ::std::option::Option<
|
7101 - | ::std::collections::HashMap<
|
7102 - | crate::model::PatternString,
|
7103 - | crate::model::PatternString,
|
7104 - | >,
|
7105 - | >,
|
7106 - | ) -> Self {
|
7107 - | self.map_of_pattern_string =
|
7108 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7109 - | self
|
7110 - | }
|
7111 - | #[allow(missing_docs)] // documentation missing in model
|
7112 - | pub(crate) fn set_map_of_pattern_string(
|
7113 - | mut self,
|
7114 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
7115 - | ) -> Self {
|
7116 - | self.map_of_pattern_string = input.map(|v| v.into());
|
7117 - | self
|
7118 - | }
|
7119 - | #[allow(missing_docs)] // documentation missing in model
|
7120 - | pub fn list_of_pattern_string(
|
7121 - | mut self,
|
7122 - | input: ::std::option::Option<::std::vec::Vec<crate::model::PatternString>>,
|
7123 - | ) -> Self {
|
7124 - | self.list_of_pattern_string =
|
7125 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7126 - | self
|
7127 - | }
|
7128 - | #[allow(missing_docs)] // documentation missing in model
|
7129 - | pub(crate) fn set_list_of_pattern_string(
|
7130 - | mut self,
|
7131 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
7132 - | ) -> Self {
|
7133 - | self.list_of_pattern_string = input.map(|v| v.into());
|
7134 - | self
|
7135 - | }
|
7136 - | #[allow(missing_docs)] // documentation missing in model
|
7137 - | pub fn set_of_pattern_string(
|
7138 - | mut self,
|
7139 - | input: ::std::option::Option<crate::model::SetOfPatternString>,
|
7140 - | ) -> Self {
|
7141 - | self.set_of_pattern_string =
|
7142 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
7143 - | self
|
7144 - | }
|
7145 - | #[allow(missing_docs)] // documentation missing in model
|
7146 - | pub(crate) fn set_set_of_pattern_string(
|
7147 - | mut self,
|
7148 - | input: Option<
|
7149 - | impl ::std::convert::Into<
|
7150 - | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
7151 - | >,
|
7152 - | >,
|
7153 - | ) -> Self {
|
7154 - | self.set_of_pattern_string = input.map(|v| v.into());
|
7155 - | self
|
7156 - | }
|
7157 - | #[allow(missing_docs)] // documentation missing in model
|
7158 - | pub fn length_length_pattern_string(
|
7159 - | mut self,
|
7160 - | input: ::std::option::Option<crate::model::LengthPatternString>,
|
7161 - | ) -> Self {
|
7162 - | self.length_length_pattern_string =
|
7163 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
7164 - | self
|
7165 - | }
|
7166 - | #[allow(missing_docs)] // documentation missing in model
|
7167 - | pub(crate) fn set_length_length_pattern_string(
|
7168 - | mut self,
|
7169 - | input: Option<
|
7170 - | impl ::std::convert::Into<
|
7171 - | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
7172 - | >,
|
7173 - | >,
|
7174 - | ) -> Self {
|
7175 - | self.length_length_pattern_string = input.map(|v| v.into());
|
7176 - | self
|
7177 - | }
|
7178 - | #[allow(missing_docs)] // documentation missing in model
|
7179 - | pub fn map_of_length_pattern_string(
|
7180 - | mut self,
|
7181 - | input: ::std::option::Option<
|
7182 - | ::std::collections::HashMap<
|
7183 - | crate::model::LengthPatternString,
|
7184 - | crate::model::LengthPatternString,
|
7185 - | >,
|
7186 - | >,
|
7187 - | ) -> Self {
|
7188 - | self.map_of_length_pattern_string =
|
7189 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7190 - | self
|
7191 - | }
|
7192 - | #[allow(missing_docs)] // documentation missing in model
|
7193 - | pub(crate) fn set_map_of_length_pattern_string(
|
7194 - | mut self,
|
7195 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
7196 - | ) -> Self {
|
7197 - | self.map_of_length_pattern_string = input.map(|v| v.into());
|
7198 - | self
|
7199 - | }
|
7200 - | #[allow(missing_docs)] // documentation missing in model
|
7201 - | pub fn list_of_length_pattern_string(
|
7202 - | mut self,
|
7203 - | input: ::std::option::Option<::std::vec::Vec<crate::model::LengthPatternString>>,
|
7204 - | ) -> Self {
|
7205 - | self.list_of_length_pattern_string =
|
7206 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
7207 - | self
|
7208 - | }
|
7209 - | #[allow(missing_docs)] // documentation missing in model
|
7210 - | pub(crate) fn set_list_of_length_pattern_string(
|
7211 - | mut self,
|
7212 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
7213 - | ) -> Self {
|
7214 - | self.list_of_length_pattern_string = input.map(|v| v.into());
|
7215 - | self
|
7216 - | }
|
7217 - | #[allow(missing_docs)] // documentation missing in model
|
7218 - | pub fn set_of_length_pattern_string(
|
7219 - | mut self,
|
7220 - | input: ::std::option::Option<crate::model::SetOfLengthPatternString>,
|
7221 - | ) -> Self {
|
7222 - | self.set_of_length_pattern_string =
|
7223 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
7224 - | self
|
7225 - | }
|
7226 - | #[allow(missing_docs)] // documentation missing in model
|
7227 - | pub(crate) fn set_set_of_length_pattern_string(
|
7228 - | mut self,
|
7229 - | input: Option<
|
7230 - | impl ::std::convert::Into<
|
7231 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
7232 - | >,
|
7233 - | >,
|
7234 - | ) -> Self {
|
7235 - | self.set_of_length_pattern_string = input.map(|v| v.into());
|
7236 - | self
|
7237 - | }
|
7238 - | #[allow(missing_docs)] // documentation missing in model
|
7239 - | pub fn length_list_of_pattern_string(
|
7240 - | mut self,
|
7241 - | input: ::std::option::Option<crate::model::LengthListOfPatternString>,
|
7242 - | ) -> Self {
|
7243 - | self.length_list_of_pattern_string =
|
7244 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
7245 - | self
|
7246 - | }
|
7247 - | #[allow(missing_docs)] // documentation missing in model
|
7248 - | pub(crate) fn set_length_list_of_pattern_string(
|
7249 - | mut self,
|
7250 - | input: Option<
|
7251 - | impl ::std::convert::Into<
|
7252 - | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
7253 - | >,
|
7254 - | >,
|
7255 - | ) -> Self {
|
7256 - | self.length_list_of_pattern_string = input.map(|v| v.into());
|
7257 - | self
|
7258 - | }
|
7259 - | #[allow(missing_docs)] // documentation missing in model
|
7260 - | pub fn length_set_of_pattern_string(
|
7261 - | mut self,
|
7262 - | input: ::std::option::Option<crate::model::LengthSetOfPatternString>,
|
7263 - | ) -> Self {
|
7264 - | self.length_set_of_pattern_string =
|
7265 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
7266 - | self
|
7267 - | }
|
7268 - | #[allow(missing_docs)] // documentation missing in model
|
7269 - | pub(crate) fn set_length_set_of_pattern_string(
|
7270 - | mut self,
|
7271 - | input: Option<
|
7272 - | impl ::std::convert::Into<
|
7273 - | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
7274 - | >,
|
7275 - | >,
|
7276 - | ) -> Self {
|
7277 - | self.length_set_of_pattern_string = input.map(|v| v.into());
|
7278 - | self
|
7279 - | }
|
7280 - | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
7281 - | ///
|
7282 - | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
7283 - | ///
|
7284 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
7285 - | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
7286 - | self.build_enforcing_all_constraints()
|
6077 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
6078 + | ///
|
6079 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
6080 + | ///
|
6081 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6082 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
6083 + | self.build_enforcing_all_constraints()
|
7287 6084 | }
|
7288 6085 | fn build_enforcing_all_constraints(
|
7289 6086 | self,
|
7290 6087 | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
7291 6088 | Ok(
|
7292 6089 | crate::model::ConA {
|
7293 6090 | con_b: self.con_b
|
7294 6091 | .map(|v| match v {
|
7295 6092 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7296 6093 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8001 6798 | .map(|res|
|
8002 6799 | res.map(|v| v.into()).map_err(ConstraintViolation::ListOfLengthPatternString)
|
8003 6800 | )
|
8004 6801 | .transpose()?
|
8005 6802 | ,
|
8006 6803 | set_of_length_pattern_string: self.set_of_length_pattern_string
|
8007 6804 | .map(|v| match v {
|
8008 6805 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8009 6806 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8010 6807 | })
|
8011 - | .map(|res|
|
8012 - | res.map_err(ConstraintViolation::SetOfLengthPatternString)
|
8013 - | )
|
8014 - | .transpose()?
|
8015 - | ,
|
8016 - | length_list_of_pattern_string: self.length_list_of_pattern_string
|
8017 - | .map(|v| match v {
|
8018 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8019 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6808 + | .map(|res|
|
6809 + | res.map_err(ConstraintViolation::SetOfLengthPatternString)
|
6810 + | )
|
6811 + | .transpose()?
|
6812 + | ,
|
6813 + | length_list_of_pattern_string: self.length_list_of_pattern_string
|
6814 + | .map(|v| match v {
|
6815 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6816 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6817 + | })
|
6818 + | .map(|res|
|
6819 + | res.map_err(ConstraintViolation::LengthListOfPatternString)
|
6820 + | )
|
6821 + | .transpose()?
|
6822 + | ,
|
6823 + | length_set_of_pattern_string: self.length_set_of_pattern_string
|
6824 + | .map(|v| match v {
|
6825 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6826 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6827 + | })
|
6828 + | .map(|res|
|
6829 + | res.map_err(ConstraintViolation::LengthSetOfPatternString)
|
6830 + | )
|
6831 + | .transpose()?
|
6832 + | ,
|
6833 + | }
|
6834 + | )
|
6835 + | }
|
6836 + | }
|
6837 + | }
|
6838 + | /// See [`ConstrainedListInOutput`](crate::model::ConstrainedListInOutput).
|
6839 + | pub mod constrained_list_in_output {
|
6840 + |
|
6841 + | #[allow(clippy::enum_variant_names)]
|
6842 + | #[derive(Debug, PartialEq)]
|
6843 + | pub enum ConstraintViolation {
|
6844 + | /// Constraint violation error when the list doesn't have the required length
|
6845 + | Length(usize),
|
6846 + | }
|
6847 + |
|
6848 + | impl ::std::fmt::Display for ConstraintViolation {
|
6849 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6850 + | let message = match self {
|
6851 + | Self::Length(length) => {
|
6852 + | 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)
|
6853 + | }
|
6854 + | };
|
6855 + | write!(f, "{message}")
|
6856 + | }
|
6857 + | }
|
6858 + |
|
6859 + | impl ::std::error::Error for ConstraintViolation {}
|
6860 + | }
|
6861 + | /// See [`ConstrainedMapInOutput`](crate::model::ConstrainedMapInOutput).
|
6862 + | pub mod constrained_map_in_output {
|
6863 + |
|
6864 + | #[allow(clippy::enum_variant_names)]
|
6865 + | #[derive(Debug, PartialEq)]
|
6866 + | pub enum ConstraintViolation {
|
6867 + | Length(usize),
|
6868 + | }
|
6869 + |
|
6870 + | impl ::std::fmt::Display for ConstraintViolation {
|
6871 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6872 + | match self {
|
6873 + | Self::Length(length) => {
|
6874 + | 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)
|
6875 + | }
|
6876 + | }
|
6877 + | }
|
6878 + | }
|
6879 + |
|
6880 + | impl ::std::error::Error for ConstraintViolation {}
|
6881 + | }
|
6882 + | /// See [`LengthString`](crate::model::LengthString).
|
6883 + | pub mod length_string {
|
6884 + |
|
6885 + | #[derive(Debug, PartialEq)]
|
6886 + | pub enum ConstraintViolation {
|
6887 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
6888 + | Length(usize),
|
6889 + | }
|
6890 + |
|
6891 + | impl ::std::fmt::Display for ConstraintViolation {
|
6892 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6893 + | let message = match self {
|
6894 + | Self::Length(length) => {
|
6895 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
6896 + | }
|
6897 + | };
|
6898 + | write!(f, "{message}")
|
6899 + | }
|
6900 + | }
|
6901 + |
|
6902 + | impl ::std::error::Error for ConstraintViolation {}
|
6903 + | impl ConstraintViolation {
|
6904 + | pub(crate) fn as_validation_exception_field(
|
6905 + | self,
|
6906 + | path: ::std::string::String,
|
6907 + | ) -> crate::model::ValidationExceptionField {
|
6908 + | match self {
|
6909 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
6910 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
6911 + | path,
|
6912 + | },
|
6913 + | }
|
6914 + | }
|
6915 + | }
|
6916 + | }
|
6917 + | /// See [`RangeInteger`](crate::model::RangeInteger).
|
6918 + | pub mod range_integer {
|
6919 + |
|
6920 + | #[derive(Debug, PartialEq)]
|
6921 + | pub enum ConstraintViolation {
|
6922 + | Range(i32),
|
6923 + | }
|
6924 + |
|
6925 + | impl ::std::fmt::Display for ConstraintViolation {
|
6926 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6927 + | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
6928 + | }
|
6929 + | }
|
6930 + |
|
6931 + | impl ::std::error::Error for ConstraintViolation {}
|
6932 + | impl ConstraintViolation {
|
6933 + | pub(crate) fn as_validation_exception_field(
|
6934 + | self,
|
6935 + | path: ::std::string::String,
|
6936 + | ) -> crate::model::ValidationExceptionField {
|
6937 + | match self {
|
6938 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
6939 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
6940 + | path,
|
6941 + | },
|
6942 + | }
|
6943 + | }
|
6944 + | }
|
6945 + | }
|
6946 + | /// See [`RangeShort`](crate::model::RangeShort).
|
6947 + | pub mod range_short {
|
6948 + |
|
6949 + | #[derive(Debug, PartialEq)]
|
6950 + | pub enum ConstraintViolation {
|
6951 + | Range(i16),
|
6952 + | }
|
6953 + |
|
6954 + | impl ::std::fmt::Display for ConstraintViolation {
|
6955 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6956 + | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
6957 + | }
|
6958 + | }
|
6959 + |
|
6960 + | impl ::std::error::Error for ConstraintViolation {}
|
6961 + | impl ConstraintViolation {
|
6962 + | pub(crate) fn as_validation_exception_field(
|
6963 + | self,
|
6964 + | path: ::std::string::String,
|
6965 + | ) -> crate::model::ValidationExceptionField {
|
6966 + | match self {
|
6967 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
6968 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
6969 + | path,
|
6970 + | },
|
6971 + | }
|
6972 + | }
|
6973 + | }
|
6974 + | }
|
6975 + | /// See [`RangeLong`](crate::model::RangeLong).
|
6976 + | pub mod range_long {
|
6977 + |
|
6978 + | #[derive(Debug, PartialEq)]
|
6979 + | pub enum ConstraintViolation {
|
6980 + | Range(i64),
|
6981 + | }
|
6982 + |
|
6983 + | impl ::std::fmt::Display for ConstraintViolation {
|
6984 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6985 + | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
6986 + | }
|
6987 + | }
|
6988 + |
|
6989 + | impl ::std::error::Error for ConstraintViolation {}
|
6990 + | impl ConstraintViolation {
|
6991 + | pub(crate) fn as_validation_exception_field(
|
6992 + | self,
|
6993 + | path: ::std::string::String,
|
6994 + | ) -> crate::model::ValidationExceptionField {
|
6995 + | match self {
|
6996 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
6997 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
6998 + | path,
|
6999 + | },
|
7000 + | }
|
7001 + | }
|
7002 + | }
|
7003 + | }
|
7004 + | /// See [`RangeByte`](crate::model::RangeByte).
|
7005 + | pub mod range_byte {
|
7006 + |
|
7007 + | #[derive(Debug, PartialEq)]
|
7008 + | pub enum ConstraintViolation {
|
7009 + | Range(i8),
|
7010 + | }
|
7011 + |
|
7012 + | impl ::std::fmt::Display for ConstraintViolation {
|
7013 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7014 + | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
7015 + | }
|
7016 + | }
|
7017 + |
|
7018 + | impl ::std::error::Error for ConstraintViolation {}
|
7019 + | impl ConstraintViolation {
|
7020 + | pub(crate) fn as_validation_exception_field(
|
7021 + | self,
|
7022 + | path: ::std::string::String,
|
7023 + | ) -> crate::model::ValidationExceptionField {
|
7024 + | match self {
|
7025 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
7026 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
7027 + | path,
|
7028 + | },
|
7029 + | }
|
7030 + | }
|
7031 + | }
|
7032 + | }
|
7033 + | pub mod map_of_length_string {
|
7034 + |
|
7035 + | #[allow(clippy::enum_variant_names)]
|
7036 + | #[derive(Debug, PartialEq)]
|
7037 + | pub enum ConstraintViolation {
|
7038 + | #[doc(hidden)]
|
7039 + | Key(crate::model::length_string::ConstraintViolation),
|
7040 + | #[doc(hidden)]
|
7041 + | Value(
|
7042 + | crate::model::LengthString,
|
7043 + | crate::model::length_string::ConstraintViolation,
|
7044 + | ),
|
7045 + | }
|
7046 + |
|
7047 + | impl ::std::fmt::Display for ConstraintViolation {
|
7048 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7049 + | match self {
|
7050 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
7051 + | Self::Value(_, value_constraint_violation) => {
|
7052 + | write!(f, "{}", value_constraint_violation)
|
7053 + | }
|
7054 + | }
|
7055 + | }
|
7056 + | }
|
7057 + |
|
7058 + | impl ::std::error::Error for ConstraintViolation {}
|
7059 + | impl ConstraintViolation {
|
7060 + | pub(crate) fn as_validation_exception_field(
|
7061 + | self,
|
7062 + | path: ::std::string::String,
|
7063 + | ) -> crate::model::ValidationExceptionField {
|
7064 + | match self {
|
7065 + | Self::Key(key_constraint_violation) => {
|
7066 + | key_constraint_violation.as_validation_exception_field(path)
|
7067 + | }
|
7068 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
7069 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7070 + | }
|
7071 + | }
|
7072 + | }
|
7073 + | }
|
7074 + | /// See [`SetOfLengthString`](crate::model::SetOfLengthString).
|
7075 + | pub mod set_of_length_string {
|
7076 + |
|
7077 + | #[allow(clippy::enum_variant_names)]
|
7078 + | #[derive(Debug, PartialEq)]
|
7079 + | pub enum ConstraintViolation {
|
7080 + | /// Constraint violation error when the list does not contain unique items
|
7081 + | UniqueItems {
|
7082 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7083 + | /// at least two elements.
|
7084 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7085 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7086 + | /// Nothing is guaranteed about the order of the indices.
|
7087 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7088 + | /// The original vector, that contains duplicate items.
|
7089 + | original: ::std::vec::Vec<crate::model::LengthString>,
|
7090 + | },
|
7091 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7092 + | /// The first component of the tuple is the index in the collection where the
|
7093 + | /// first constraint violation was found.
|
7094 + | #[doc(hidden)]
|
7095 + | Member(usize, crate::model::length_string::ConstraintViolation),
|
7096 + | }
|
7097 + |
|
7098 + | impl ::std::fmt::Display for ConstraintViolation {
|
7099 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7100 + | let message = match self {
|
7101 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7102 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7103 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7104 + | failing_member)
|
7105 + | };
|
7106 + | write!(f, "{message}")
|
7107 + | }
|
7108 + | }
|
7109 + |
|
7110 + | impl ::std::error::Error for ConstraintViolation {}
|
7111 + | impl ConstraintViolation {
|
7112 + | pub(crate) fn as_validation_exception_field(
|
7113 + | self,
|
7114 + | path: ::std::string::String,
|
7115 + | ) -> crate::model::ValidationExceptionField {
|
7116 + | match self {
|
7117 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7118 + | crate::model::ValidationExceptionField {
|
7119 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7120 + | path,
|
7121 + | },
|
7122 + | Self::Member(index, member_constraint_violation) =>
|
7123 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7124 + | }
|
7125 + | }
|
7126 + | }
|
7127 + | }
|
7128 + | pub mod list_of_length_string {
|
7129 + |
|
7130 + | #[allow(clippy::enum_variant_names)]
|
7131 + | #[derive(Debug, PartialEq)]
|
7132 + | pub enum ConstraintViolation {
|
7133 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7134 + | /// The first component of the tuple is the index in the collection where the
|
7135 + | /// first constraint violation was found.
|
7136 + | #[doc(hidden)]
|
7137 + | Member(usize, crate::model::length_string::ConstraintViolation),
|
7138 + | }
|
7139 + |
|
7140 + | impl ::std::fmt::Display for ConstraintViolation {
|
7141 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7142 + | let message = match self {
|
7143 + | Self::Member(index, failing_member) => format!(
|
7144 + | "Value at index {index} failed to satisfy constraint. {}",
|
7145 + | failing_member
|
7146 + | ),
|
7147 + | };
|
7148 + | write!(f, "{message}")
|
7149 + | }
|
7150 + | }
|
7151 + |
|
7152 + | impl ::std::error::Error for ConstraintViolation {}
|
7153 + | impl ConstraintViolation {
|
7154 + | pub(crate) fn as_validation_exception_field(
|
7155 + | self,
|
7156 + | path: ::std::string::String,
|
7157 + | ) -> crate::model::ValidationExceptionField {
|
7158 + | match self {
|
7159 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7160 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7161 + | }
|
7162 + | }
|
7163 + | }
|
7164 + | }
|
7165 + | /// See [`LengthListOfPatternString`](crate::model::LengthListOfPatternString).
|
7166 + | pub mod length_list_of_pattern_string {
|
7167 + |
|
7168 + | #[allow(clippy::enum_variant_names)]
|
7169 + | #[derive(Debug, PartialEq)]
|
7170 + | pub enum ConstraintViolation {
|
7171 + | /// Constraint violation error when the list doesn't have the required length
|
7172 + | Length(usize),
|
7173 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7174 + | /// The first component of the tuple is the index in the collection where the
|
7175 + | /// first constraint violation was found.
|
7176 + | #[doc(hidden)]
|
7177 + | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
7178 + | }
|
7179 + |
|
7180 + | impl ::std::fmt::Display for ConstraintViolation {
|
7181 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7182 + | let message = match self {
|
7183 + | Self::Length(length) => {
|
7184 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
7185 + | }
|
7186 + | Self::Member(index, failing_member) => format!(
|
7187 + | "Value at index {index} failed to satisfy constraint. {}",
|
7188 + | failing_member
|
7189 + | ),
|
7190 + | };
|
7191 + | write!(f, "{message}")
|
7192 + | }
|
7193 + | }
|
7194 + |
|
7195 + | impl ::std::error::Error for ConstraintViolation {}
|
7196 + | impl ConstraintViolation {
|
7197 + | pub(crate) fn as_validation_exception_field(
|
7198 + | self,
|
7199 + | path: ::std::string::String,
|
7200 + | ) -> crate::model::ValidationExceptionField {
|
7201 + | match self {
|
7202 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7203 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
7204 + | path,
|
7205 + | },
|
7206 + | Self::Member(index, member_constraint_violation) =>
|
7207 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7208 + | }
|
7209 + | }
|
7210 + | }
|
7211 + | }
|
7212 + | /// See [`LengthSetOfPatternString`](crate::model::LengthSetOfPatternString).
|
7213 + | pub mod length_set_of_pattern_string {
|
7214 + |
|
7215 + | #[allow(clippy::enum_variant_names)]
|
7216 + | #[derive(Debug, PartialEq)]
|
7217 + | pub enum ConstraintViolation {
|
7218 + | /// Constraint violation error when the list doesn't have the required length
|
7219 + | Length(usize),
|
7220 + | /// Constraint violation error when the list does not contain unique items
|
7221 + | UniqueItems {
|
7222 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7223 + | /// at least two elements.
|
7224 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7225 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7226 + | /// Nothing is guaranteed about the order of the indices.
|
7227 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7228 + | /// The original vector, that contains duplicate items.
|
7229 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
7230 + | },
|
7231 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7232 + | /// The first component of the tuple is the index in the collection where the
|
7233 + | /// first constraint violation was found.
|
7234 + | #[doc(hidden)]
|
7235 + | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
7236 + | }
|
7237 + |
|
7238 + | impl ::std::fmt::Display for ConstraintViolation {
|
7239 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7240 + | let message = match self {
|
7241 + | Self::Length(length) => {
|
7242 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
7243 + | },
|
7244 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7245 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7246 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7247 + | failing_member)
|
7248 + | };
|
7249 + | write!(f, "{message}")
|
7250 + | }
|
7251 + | }
|
7252 + |
|
7253 + | impl ::std::error::Error for ConstraintViolation {}
|
7254 + | impl ConstraintViolation {
|
7255 + | pub(crate) fn as_validation_exception_field(
|
7256 + | self,
|
7257 + | path: ::std::string::String,
|
7258 + | ) -> crate::model::ValidationExceptionField {
|
7259 + | match self {
|
7260 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7261 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
7262 + | path,
|
7263 + | },
|
7264 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7265 + | crate::model::ValidationExceptionField {
|
7266 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7267 + | path,
|
7268 + | },
|
7269 + | Self::Member(index, member_constraint_violation) =>
|
7270 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7271 + | }
|
7272 + | }
|
7273 + | }
|
7274 + | }
|
7275 + | /// See [`SetOfRangeByte`](crate::model::SetOfRangeByte).
|
7276 + | pub mod set_of_range_byte {
|
7277 + |
|
7278 + | #[allow(clippy::enum_variant_names)]
|
7279 + | #[derive(Debug, PartialEq)]
|
7280 + | pub enum ConstraintViolation {
|
7281 + | /// Constraint violation error when the list does not contain unique items
|
7282 + | UniqueItems {
|
7283 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7284 + | /// at least two elements.
|
7285 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7286 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7287 + | /// Nothing is guaranteed about the order of the indices.
|
7288 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7289 + | /// The original vector, that contains duplicate items.
|
7290 + | original: ::std::vec::Vec<crate::model::RangeByte>,
|
7291 + | },
|
7292 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7293 + | /// The first component of the tuple is the index in the collection where the
|
7294 + | /// first constraint violation was found.
|
7295 + | #[doc(hidden)]
|
7296 + | Member(usize, crate::model::range_byte::ConstraintViolation),
|
7297 + | }
|
7298 + |
|
7299 + | impl ::std::fmt::Display for ConstraintViolation {
|
7300 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7301 + | let message = match self {
|
7302 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7303 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7304 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7305 + | failing_member)
|
7306 + | };
|
7307 + | write!(f, "{message}")
|
7308 + | }
|
7309 + | }
|
7310 + |
|
7311 + | impl ::std::error::Error for ConstraintViolation {}
|
7312 + | impl ConstraintViolation {
|
7313 + | pub(crate) fn as_validation_exception_field(
|
7314 + | self,
|
7315 + | path: ::std::string::String,
|
7316 + | ) -> crate::model::ValidationExceptionField {
|
7317 + | match self {
|
7318 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7319 + | crate::model::ValidationExceptionField {
|
7320 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7321 + | path,
|
7322 + | },
|
7323 + | Self::Member(index, member_constraint_violation) =>
|
7324 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7325 + | }
|
7326 + | }
|
7327 + | }
|
7328 + | }
|
7329 + | /// See [`SetOfRangeShort`](crate::model::SetOfRangeShort).
|
7330 + | pub mod set_of_range_short {
|
7331 + |
|
7332 + | #[allow(clippy::enum_variant_names)]
|
7333 + | #[derive(Debug, PartialEq)]
|
7334 + | pub enum ConstraintViolation {
|
7335 + | /// Constraint violation error when the list does not contain unique items
|
7336 + | UniqueItems {
|
7337 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7338 + | /// at least two elements.
|
7339 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7340 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7341 + | /// Nothing is guaranteed about the order of the indices.
|
7342 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7343 + | /// The original vector, that contains duplicate items.
|
7344 + | original: ::std::vec::Vec<crate::model::RangeShort>,
|
7345 + | },
|
7346 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7347 + | /// The first component of the tuple is the index in the collection where the
|
7348 + | /// first constraint violation was found.
|
7349 + | #[doc(hidden)]
|
7350 + | Member(usize, crate::model::range_short::ConstraintViolation),
|
7351 + | }
|
7352 + |
|
7353 + | impl ::std::fmt::Display for ConstraintViolation {
|
7354 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7355 + | let message = match self {
|
7356 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7357 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7358 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7359 + | failing_member)
|
7360 + | };
|
7361 + | write!(f, "{message}")
|
7362 + | }
|
7363 + | }
|
7364 + |
|
7365 + | impl ::std::error::Error for ConstraintViolation {}
|
7366 + | impl ConstraintViolation {
|
7367 + | pub(crate) fn as_validation_exception_field(
|
7368 + | self,
|
7369 + | path: ::std::string::String,
|
7370 + | ) -> crate::model::ValidationExceptionField {
|
7371 + | match self {
|
7372 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7373 + | crate::model::ValidationExceptionField {
|
7374 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7375 + | path,
|
7376 + | },
|
7377 + | Self::Member(index, member_constraint_violation) =>
|
7378 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7379 + | }
|
7380 + | }
|
7381 + | }
|
7382 + | }
|
7383 + | /// See [`SetOfRangeInteger`](crate::model::SetOfRangeInteger).
|
7384 + | pub mod set_of_range_integer {
|
7385 + |
|
7386 + | #[allow(clippy::enum_variant_names)]
|
7387 + | #[derive(Debug, PartialEq)]
|
7388 + | pub enum ConstraintViolation {
|
7389 + | /// Constraint violation error when the list does not contain unique items
|
7390 + | UniqueItems {
|
7391 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7392 + | /// at least two elements.
|
7393 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7394 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7395 + | /// Nothing is guaranteed about the order of the indices.
|
7396 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7397 + | /// The original vector, that contains duplicate items.
|
7398 + | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
7399 + | },
|
7400 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7401 + | /// The first component of the tuple is the index in the collection where the
|
7402 + | /// first constraint violation was found.
|
7403 + | #[doc(hidden)]
|
7404 + | Member(usize, crate::model::range_integer::ConstraintViolation),
|
7405 + | }
|
7406 + |
|
7407 + | impl ::std::fmt::Display for ConstraintViolation {
|
7408 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7409 + | let message = match self {
|
7410 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7411 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7412 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7413 + | failing_member)
|
7414 + | };
|
7415 + | write!(f, "{message}")
|
7416 + | }
|
7417 + | }
|
7418 + |
|
7419 + | impl ::std::error::Error for ConstraintViolation {}
|
7420 + | impl ConstraintViolation {
|
7421 + | pub(crate) fn as_validation_exception_field(
|
7422 + | self,
|
7423 + | path: ::std::string::String,
|
7424 + | ) -> crate::model::ValidationExceptionField {
|
7425 + | match self {
|
7426 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7427 + | crate::model::ValidationExceptionField {
|
7428 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7429 + | path,
|
7430 + | },
|
7431 + | Self::Member(index, member_constraint_violation) =>
|
7432 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7433 + | }
|
7434 + | }
|
7435 + | }
|
7436 + | }
|
7437 + | /// See [`SetOfRangeLong`](crate::model::SetOfRangeLong).
|
7438 + | pub mod set_of_range_long {
|
7439 + |
|
7440 + | #[allow(clippy::enum_variant_names)]
|
7441 + | #[derive(Debug, PartialEq)]
|
7442 + | pub enum ConstraintViolation {
|
7443 + | /// Constraint violation error when the list does not contain unique items
|
7444 + | UniqueItems {
|
7445 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7446 + | /// at least two elements.
|
7447 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7448 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7449 + | /// Nothing is guaranteed about the order of the indices.
|
7450 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7451 + | /// The original vector, that contains duplicate items.
|
7452 + | original: ::std::vec::Vec<crate::model::RangeLong>,
|
7453 + | },
|
7454 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7455 + | /// The first component of the tuple is the index in the collection where the
|
7456 + | /// first constraint violation was found.
|
7457 + | #[doc(hidden)]
|
7458 + | Member(usize, crate::model::range_long::ConstraintViolation),
|
7459 + | }
|
7460 + |
|
7461 + | impl ::std::fmt::Display for ConstraintViolation {
|
7462 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7463 + | let message = match self {
|
7464 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7465 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7466 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7467 + | failing_member)
|
7468 + | };
|
7469 + | write!(f, "{message}")
|
7470 + | }
|
7471 + | }
|
7472 + |
|
7473 + | impl ::std::error::Error for ConstraintViolation {}
|
7474 + | impl ConstraintViolation {
|
7475 + | pub(crate) fn as_validation_exception_field(
|
7476 + | self,
|
7477 + | path: ::std::string::String,
|
7478 + | ) -> crate::model::ValidationExceptionField {
|
7479 + | match self {
|
7480 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7481 + | crate::model::ValidationExceptionField {
|
7482 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7483 + | path,
|
7484 + | },
|
7485 + | Self::Member(index, member_constraint_violation) =>
|
7486 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7487 + | }
|
7488 + | }
|
7489 + | }
|
7490 + | }
|
7491 + | pub mod list_of_range_byte {
|
7492 + |
|
7493 + | #[allow(clippy::enum_variant_names)]
|
7494 + | #[derive(Debug, PartialEq)]
|
7495 + | pub enum ConstraintViolation {
|
7496 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7497 + | /// The first component of the tuple is the index in the collection where the
|
7498 + | /// first constraint violation was found.
|
7499 + | #[doc(hidden)]
|
7500 + | Member(usize, crate::model::range_byte::ConstraintViolation),
|
7501 + | }
|
7502 + |
|
7503 + | impl ::std::fmt::Display for ConstraintViolation {
|
7504 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7505 + | let message = match self {
|
7506 + | Self::Member(index, failing_member) => format!(
|
7507 + | "Value at index {index} failed to satisfy constraint. {}",
|
7508 + | failing_member
|
7509 + | ),
|
7510 + | };
|
7511 + | write!(f, "{message}")
|
7512 + | }
|
7513 + | }
|
7514 + |
|
7515 + | impl ::std::error::Error for ConstraintViolation {}
|
7516 + | impl ConstraintViolation {
|
7517 + | pub(crate) fn as_validation_exception_field(
|
7518 + | self,
|
7519 + | path: ::std::string::String,
|
7520 + | ) -> crate::model::ValidationExceptionField {
|
7521 + | match self {
|
7522 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7523 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7524 + | }
|
7525 + | }
|
7526 + | }
|
7527 + | }
|
7528 + | pub mod list_of_range_short {
|
7529 + |
|
7530 + | #[allow(clippy::enum_variant_names)]
|
7531 + | #[derive(Debug, PartialEq)]
|
7532 + | pub enum ConstraintViolation {
|
7533 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7534 + | /// The first component of the tuple is the index in the collection where the
|
7535 + | /// first constraint violation was found.
|
7536 + | #[doc(hidden)]
|
7537 + | Member(usize, crate::model::range_short::ConstraintViolation),
|
7538 + | }
|
7539 + |
|
7540 + | impl ::std::fmt::Display for ConstraintViolation {
|
7541 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7542 + | let message = match self {
|
7543 + | Self::Member(index, failing_member) => format!(
|
7544 + | "Value at index {index} failed to satisfy constraint. {}",
|
7545 + | failing_member
|
7546 + | ),
|
7547 + | };
|
7548 + | write!(f, "{message}")
|
7549 + | }
|
7550 + | }
|
7551 + |
|
7552 + | impl ::std::error::Error for ConstraintViolation {}
|
7553 + | impl ConstraintViolation {
|
7554 + | pub(crate) fn as_validation_exception_field(
|
7555 + | self,
|
7556 + | path: ::std::string::String,
|
7557 + | ) -> crate::model::ValidationExceptionField {
|
7558 + | match self {
|
7559 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7560 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7561 + | }
|
7562 + | }
|
7563 + | }
|
7564 + | }
|
7565 + | pub mod list_of_range_integer {
|
7566 + |
|
7567 + | #[allow(clippy::enum_variant_names)]
|
7568 + | #[derive(Debug, PartialEq)]
|
7569 + | pub enum ConstraintViolation {
|
7570 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7571 + | /// The first component of the tuple is the index in the collection where the
|
7572 + | /// first constraint violation was found.
|
7573 + | #[doc(hidden)]
|
7574 + | Member(usize, crate::model::range_integer::ConstraintViolation),
|
7575 + | }
|
7576 + |
|
7577 + | impl ::std::fmt::Display for ConstraintViolation {
|
7578 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7579 + | let message = match self {
|
7580 + | Self::Member(index, failing_member) => format!(
|
7581 + | "Value at index {index} failed to satisfy constraint. {}",
|
7582 + | failing_member
|
7583 + | ),
|
7584 + | };
|
7585 + | write!(f, "{message}")
|
7586 + | }
|
7587 + | }
|
7588 + |
|
7589 + | impl ::std::error::Error for ConstraintViolation {}
|
7590 + | impl ConstraintViolation {
|
7591 + | pub(crate) fn as_validation_exception_field(
|
7592 + | self,
|
7593 + | path: ::std::string::String,
|
7594 + | ) -> crate::model::ValidationExceptionField {
|
7595 + | match self {
|
7596 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7597 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7598 + | }
|
7599 + | }
|
7600 + | }
|
7601 + | }
|
7602 + | pub mod list_of_range_long {
|
7603 + |
|
7604 + | #[allow(clippy::enum_variant_names)]
|
7605 + | #[derive(Debug, PartialEq)]
|
7606 + | pub enum ConstraintViolation {
|
7607 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7608 + | /// The first component of the tuple is the index in the collection where the
|
7609 + | /// first constraint violation was found.
|
7610 + | #[doc(hidden)]
|
7611 + | Member(usize, crate::model::range_long::ConstraintViolation),
|
7612 + | }
|
7613 + |
|
7614 + | impl ::std::fmt::Display for ConstraintViolation {
|
7615 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7616 + | let message = match self {
|
7617 + | Self::Member(index, failing_member) => format!(
|
7618 + | "Value at index {index} failed to satisfy constraint. {}",
|
7619 + | failing_member
|
7620 + | ),
|
7621 + | };
|
7622 + | write!(f, "{message}")
|
7623 + | }
|
7624 + | }
|
7625 + |
|
7626 + | impl ::std::error::Error for ConstraintViolation {}
|
7627 + | impl ConstraintViolation {
|
7628 + | pub(crate) fn as_validation_exception_field(
|
7629 + | self,
|
7630 + | path: ::std::string::String,
|
7631 + | ) -> crate::model::ValidationExceptionField {
|
7632 + | match self {
|
7633 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7634 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7635 + | }
|
7636 + | }
|
7637 + | }
|
7638 + | }
|
7639 + | pub mod list_of_enum_string {
|
7640 + |
|
7641 + | #[allow(clippy::enum_variant_names)]
|
7642 + | #[derive(Debug, PartialEq)]
|
7643 + | pub enum ConstraintViolation {
|
7644 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7645 + | /// The first component of the tuple is the index in the collection where the
|
7646 + | /// first constraint violation was found.
|
7647 + | #[doc(hidden)]
|
7648 + | Member(usize, crate::model::enum_string::ConstraintViolation),
|
7649 + | }
|
7650 + |
|
7651 + | impl ::std::fmt::Display for ConstraintViolation {
|
7652 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7653 + | let message = match self {
|
7654 + | Self::Member(index, failing_member) => format!(
|
7655 + | "Value at index {index} failed to satisfy constraint. {}",
|
7656 + | failing_member
|
7657 + | ),
|
7658 + | };
|
7659 + | write!(f, "{message}")
|
7660 + | }
|
7661 + | }
|
7662 + |
|
7663 + | impl ::std::error::Error for ConstraintViolation {}
|
7664 + | impl ConstraintViolation {
|
7665 + | pub(crate) fn as_validation_exception_field(
|
7666 + | self,
|
7667 + | path: ::std::string::String,
|
7668 + | ) -> crate::model::ValidationExceptionField {
|
7669 + | match self {
|
7670 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7671 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7672 + | }
|
7673 + | }
|
7674 + | }
|
7675 + | }
|
7676 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7677 + | pub mod recursive_shapes_input_output_nested1 {
|
7678 + |
|
7679 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7680 + | /// Holds one variant for each of the ways the builder can fail.
|
7681 + | #[non_exhaustive]
|
7682 + | #[allow(clippy::enum_variant_names)]
|
7683 + | pub enum ConstraintViolation {
|
7684 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
7685 + | MissingRecursiveMember,
|
7686 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
7687 + | #[doc(hidden)]
|
7688 + | RecursiveMember(
|
7689 + | ::std::boxed::Box<
|
7690 + | crate::model::recursive_shapes_input_output_nested2::ConstraintViolation,
|
7691 + | >,
|
7692 + | ),
|
7693 + | }
|
7694 + | impl ::std::fmt::Display for ConstraintViolation {
|
7695 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7696 + | match self {
|
7697 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
7698 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
7699 + | }
|
7700 + | }
|
7701 + | }
|
7702 + | impl ::std::error::Error for ConstraintViolation {}
|
7703 + | impl ConstraintViolation {
|
7704 + | pub(crate) fn as_validation_exception_field(
|
7705 + | self,
|
7706 + | path: ::std::string::String,
|
7707 + | ) -> crate::model::ValidationExceptionField {
|
7708 + | match self {
|
7709 + | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
7710 + | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
7711 + | path: path + "/recursiveMember",
|
7712 + | },
|
7713 + | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
7714 + | }
|
7715 + | }
|
7716 + | }
|
7717 + | impl ::std::convert::From<Builder>
|
7718 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
7719 + | {
|
7720 + | fn from(builder: Builder) -> Self {
|
7721 + | Self::Unconstrained(builder)
|
7722 + | }
|
7723 + | }
|
7724 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
7725 + | type Error = ConstraintViolation;
|
7726 + |
|
7727 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7728 + | builder.build()
|
7729 + | }
|
7730 + | }
|
7731 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7732 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7733 + | pub struct Builder {
|
7734 + | pub(crate) recursive_member: ::std::option::Option<
|
7735 + | ::std::boxed::Box<
|
7736 + | crate::constrained::MaybeConstrained<
|
7737 + | crate::model::RecursiveShapesInputOutputNested2,
|
7738 + | >,
|
7739 + | >,
|
7740 + | >,
|
7741 + | }
|
7742 + | impl Builder {
|
7743 + | #[allow(missing_docs)] // documentation missing in model
|
7744 + | #[allow(clippy::boxed_local)]
|
7745 + | pub fn recursive_member(
|
7746 + | mut self,
|
7747 + | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
7748 + | ) -> Self {
|
7749 + | self.recursive_member = Some(Box::new(
|
7750 + | crate::constrained::MaybeConstrained::Constrained(*input),
|
7751 + | ));
|
7752 + | self
|
7753 + | }
|
7754 + | #[allow(missing_docs)] // documentation missing in model
|
7755 + | pub(crate) fn set_recursive_member(
|
7756 + | mut self,
|
7757 + | input: impl ::std::convert::Into<
|
7758 + | ::std::boxed::Box<
|
7759 + | crate::constrained::MaybeConstrained<
|
7760 + | crate::model::RecursiveShapesInputOutputNested2,
|
7761 + | >,
|
7762 + | >,
|
7763 + | >,
|
7764 + | ) -> Self {
|
7765 + | self.recursive_member = Some(input.into());
|
7766 + | self
|
7767 + | }
|
7768 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7769 + | ///
|
7770 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
7771 + | ///
|
7772 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
7773 + | pub fn build(
|
7774 + | self,
|
7775 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7776 + | self.build_enforcing_all_constraints()
|
7777 + | }
|
7778 + | fn build_enforcing_all_constraints(
|
7779 + | self,
|
7780 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7781 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
7782 + | recursive_member: self
|
7783 + | .recursive_member
|
7784 + | .map(|v| match *v {
|
7785 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
7786 + | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
7787 + | Ok(Box::new(x.try_into()?))
|
7788 + | }
|
7789 + | })
|
7790 + | .map(|res| {
|
7791 + | res.map_err(Box::new)
|
7792 + | .map_err(ConstraintViolation::RecursiveMember)
|
8020 7793 | })
|
8021 - | .map(|res|
|
8022 - | res.map_err(ConstraintViolation::LengthListOfPatternString)
|
8023 - | )
|
8024 7794 | .transpose()?
|
8025 - | ,
|
8026 - | length_set_of_pattern_string: self.length_set_of_pattern_string
|
8027 - | .map(|v| match v {
|
8028 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8029 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7795 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
8030 7796 | })
|
8031 - | .map(|res|
|
8032 - | res.map_err(ConstraintViolation::LengthSetOfPatternString)
|
8033 - | )
|
8034 - | .transpose()?
|
8035 - | ,
|
8036 7797 | }
|
8037 - | )
|
7798 + | }
|
7799 + | }
|
7800 + | pub mod recursive_list {
|
7801 + |
|
7802 + | #[allow(clippy::enum_variant_names)]
|
7803 + | #[derive(Debug, PartialEq)]
|
7804 + | pub enum ConstraintViolation {
|
7805 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7806 + | /// The first component of the tuple is the index in the collection where the
|
7807 + | /// first constraint violation was found.
|
7808 + | #[doc(hidden)]
|
7809 + | Member(
|
7810 + | usize,
|
7811 + | crate::model::recursive_shapes_input_output_nested1::ConstraintViolation,
|
7812 + | ),
|
7813 + | }
|
7814 + |
|
7815 + | impl ::std::fmt::Display for ConstraintViolation {
|
7816 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7817 + | let message = match self {
|
7818 + | Self::Member(index, failing_member) => format!(
|
7819 + | "Value at index {index} failed to satisfy constraint. {}",
|
7820 + | failing_member
|
7821 + | ),
|
7822 + | };
|
7823 + | write!(f, "{message}")
|
7824 + | }
|
7825 + | }
|
7826 + |
|
7827 + | impl ::std::error::Error for ConstraintViolation {}
|
7828 + | impl ConstraintViolation {
|
7829 + | pub(crate) fn as_validation_exception_field(
|
7830 + | self,
|
7831 + | path: ::std::string::String,
|
7832 + | ) -> crate::model::ValidationExceptionField {
|
7833 + | match self {
|
7834 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7835 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7836 + | }
|
7837 + | }
|
7838 + | }
|
7839 + | }
|
7840 + | /// See [`ConBMap`](crate::model::ConBMap).
|
7841 + | pub mod con_b_map {
|
7842 + |
|
7843 + | #[allow(clippy::enum_variant_names)]
|
7844 + | #[derive(Debug, PartialEq)]
|
7845 + | pub enum ConstraintViolation {
|
7846 + | Length(usize),
|
7847 + |
|
7848 + | #[doc(hidden)]
|
7849 + | Value(
|
7850 + | ::std::string::String,
|
7851 + | crate::model::length_string::ConstraintViolation,
|
7852 + | ),
|
7853 + | }
|
7854 + |
|
7855 + | impl ::std::fmt::Display for ConstraintViolation {
|
7856 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7857 + | match self {
|
7858 + | Self::Length(length) => {
|
7859 + | 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)
|
7860 + | }
|
7861 + |
|
7862 + | Self::Value(_, value_constraint_violation) => {
|
7863 + | write!(f, "{}", value_constraint_violation)
|
7864 + | }
|
7865 + | }
|
7866 + | }
|
7867 + | }
|
7868 + |
|
7869 + | impl ::std::error::Error for ConstraintViolation {}
|
7870 + | impl ConstraintViolation {
|
7871 + | pub(crate) fn as_validation_exception_field(
|
7872 + | self,
|
7873 + | path: ::std::string::String,
|
7874 + | ) -> crate::model::ValidationExceptionField {
|
7875 + | match self {
|
7876 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7877 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
7878 + | path,
|
7879 + | },
|
7880 + | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
7881 + | }
|
8038 7882 | }
|
8039 7883 | }
|
8040 7884 | }
|
8041 - | /// See [`LengthSetOfPatternString`](crate::model::LengthSetOfPatternString).
|
8042 - | pub mod length_set_of_pattern_string {
|
7885 + | pub mod map_of_list_of_length_string {
|
7886 + |
|
7887 + | #[allow(clippy::enum_variant_names)]
|
7888 + | #[derive(Debug, PartialEq)]
|
7889 + | pub enum ConstraintViolation {
|
7890 + | #[doc(hidden)]
|
7891 + | Key(crate::model::length_string::ConstraintViolation),
|
7892 + | #[doc(hidden)]
|
7893 + | Value(
|
7894 + | crate::model::LengthString,
|
7895 + | crate::model::list_of_length_string::ConstraintViolation,
|
7896 + | ),
|
7897 + | }
|
7898 + |
|
7899 + | impl ::std::fmt::Display for ConstraintViolation {
|
7900 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7901 + | match self {
|
7902 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
7903 + | Self::Value(_, value_constraint_violation) => {
|
7904 + | write!(f, "{}", value_constraint_violation)
|
7905 + | }
|
7906 + | }
|
7907 + | }
|
7908 + | }
|
7909 + |
|
7910 + | impl ::std::error::Error for ConstraintViolation {}
|
7911 + | impl ConstraintViolation {
|
7912 + | pub(crate) fn as_validation_exception_field(
|
7913 + | self,
|
7914 + | path: ::std::string::String,
|
7915 + | ) -> crate::model::ValidationExceptionField {
|
7916 + | match self {
|
7917 + | Self::Key(key_constraint_violation) => {
|
7918 + | key_constraint_violation.as_validation_exception_field(path)
|
7919 + | }
|
7920 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
7921 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7922 + | }
|
7923 + | }
|
7924 + | }
|
7925 + | }
|
7926 + | pub mod map_of_set_of_length_string {
|
7927 + |
|
7928 + | #[allow(clippy::enum_variant_names)]
|
7929 + | #[derive(Debug, PartialEq)]
|
7930 + | pub enum ConstraintViolation {
|
7931 + | #[doc(hidden)]
|
7932 + | Key(crate::model::length_string::ConstraintViolation),
|
7933 + | #[doc(hidden)]
|
7934 + | Value(
|
7935 + | crate::model::LengthString,
|
7936 + | crate::model::set_of_length_string::ConstraintViolation,
|
7937 + | ),
|
7938 + | }
|
7939 + |
|
7940 + | impl ::std::fmt::Display for ConstraintViolation {
|
7941 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7942 + | match self {
|
7943 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
7944 + | Self::Value(_, value_constraint_violation) => {
|
7945 + | write!(f, "{}", value_constraint_violation)
|
7946 + | }
|
7947 + | }
|
7948 + | }
|
7949 + | }
|
7950 + |
|
7951 + | impl ::std::error::Error for ConstraintViolation {}
|
7952 + | impl ConstraintViolation {
|
7953 + | pub(crate) fn as_validation_exception_field(
|
7954 + | self,
|
7955 + | path: ::std::string::String,
|
7956 + | ) -> crate::model::ValidationExceptionField {
|
7957 + | match self {
|
7958 + | Self::Key(key_constraint_violation) => {
|
7959 + | key_constraint_violation.as_validation_exception_field(path)
|
7960 + | }
|
7961 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
7962 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7963 + | }
|
7964 + | }
|
7965 + | }
|
7966 + | }
|
7967 + | pub mod map_of_length_list_of_pattern_string {
|
7968 + |
|
7969 + | #[allow(clippy::enum_variant_names)]
|
7970 + | #[derive(Debug, PartialEq)]
|
7971 + | pub enum ConstraintViolation {
|
7972 + | #[doc(hidden)]
|
7973 + | Key(crate::model::pattern_string::ConstraintViolation),
|
7974 + | #[doc(hidden)]
|
7975 + | Value(
|
7976 + | crate::model::PatternString,
|
7977 + | crate::model::length_list_of_pattern_string::ConstraintViolation,
|
7978 + | ),
|
7979 + | }
|
7980 + |
|
7981 + | impl ::std::fmt::Display for ConstraintViolation {
|
7982 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7983 + | match self {
|
7984 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
7985 + | Self::Value(_, value_constraint_violation) => {
|
7986 + | write!(f, "{}", value_constraint_violation)
|
7987 + | }
|
7988 + | }
|
7989 + | }
|
7990 + | }
|
7991 + |
|
7992 + | impl ::std::error::Error for ConstraintViolation {}
|
7993 + | impl ConstraintViolation {
|
7994 + | pub(crate) fn as_validation_exception_field(
|
7995 + | self,
|
7996 + | path: ::std::string::String,
|
7997 + | ) -> crate::model::ValidationExceptionField {
|
7998 + | match self {
|
7999 + | Self::Key(key_constraint_violation) => {
|
8000 + | key_constraint_violation.as_validation_exception_field(path)
|
8001 + | }
|
8002 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8003 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8004 + | }
|
8005 + | }
|
8006 + | }
|
8007 + | }
|
8008 + | pub mod map_of_list_of_enum_string {
|
8009 + |
|
8010 + | #[allow(clippy::enum_variant_names)]
|
8011 + | #[derive(Debug, PartialEq)]
|
8012 + | pub enum ConstraintViolation {
|
8013 + | #[doc(hidden)]
|
8014 + | Key(crate::model::enum_string::ConstraintViolation),
|
8015 + | #[doc(hidden)]
|
8016 + | Value(
|
8017 + | crate::model::EnumString,
|
8018 + | crate::model::list_of_enum_string::ConstraintViolation,
|
8019 + | ),
|
8020 + | }
|
8021 + |
|
8022 + | impl ::std::fmt::Display for ConstraintViolation {
|
8023 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8024 + | match self {
|
8025 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8026 + | Self::Value(_, value_constraint_violation) => {
|
8027 + | write!(f, "{}", value_constraint_violation)
|
8028 + | }
|
8029 + | }
|
8030 + | }
|
8031 + | }
|
8032 + |
|
8033 + | impl ::std::error::Error for ConstraintViolation {}
|
8034 + | impl ConstraintViolation {
|
8035 + | pub(crate) fn as_validation_exception_field(
|
8036 + | self,
|
8037 + | path: ::std::string::String,
|
8038 + | ) -> crate::model::ValidationExceptionField {
|
8039 + | match self {
|
8040 + | Self::Key(key_constraint_violation) => {
|
8041 + | key_constraint_violation.as_validation_exception_field(path)
|
8042 + | }
|
8043 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8044 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8045 + | }
|
8046 + | }
|
8047 + | }
|
8048 + | }
|
8049 + | pub mod map_of_pattern_string {
|
8050 + |
|
8051 + | #[allow(clippy::enum_variant_names)]
|
8052 + | #[derive(Debug, PartialEq)]
|
8053 + | pub enum ConstraintViolation {
|
8054 + | #[doc(hidden)]
|
8055 + | Key(crate::model::pattern_string::ConstraintViolation),
|
8056 + | #[doc(hidden)]
|
8057 + | Value(
|
8058 + | crate::model::PatternString,
|
8059 + | crate::model::pattern_string::ConstraintViolation,
|
8060 + | ),
|
8061 + | }
|
8062 + |
|
8063 + | impl ::std::fmt::Display for ConstraintViolation {
|
8064 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8065 + | match self {
|
8066 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8067 + | Self::Value(_, value_constraint_violation) => {
|
8068 + | write!(f, "{}", value_constraint_violation)
|
8069 + | }
|
8070 + | }
|
8071 + | }
|
8072 + | }
|
8073 + |
|
8074 + | impl ::std::error::Error for ConstraintViolation {}
|
8075 + | impl ConstraintViolation {
|
8076 + | pub(crate) fn as_validation_exception_field(
|
8077 + | self,
|
8078 + | path: ::std::string::String,
|
8079 + | ) -> crate::model::ValidationExceptionField {
|
8080 + | match self {
|
8081 + | Self::Key(key_constraint_violation) => {
|
8082 + | key_constraint_violation.as_validation_exception_field(path)
|
8083 + | }
|
8084 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8085 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8086 + | }
|
8087 + | }
|
8088 + | }
|
8089 + | }
|
8090 + | pub mod map_of_list_of_pattern_string {
|
8043 8091 |
|
8044 8092 | #[allow(clippy::enum_variant_names)]
|
8045 8093 | #[derive(Debug, PartialEq)]
|
8046 8094 | pub enum ConstraintViolation {
|
8047 - | /// Constraint violation error when the list doesn't have the required length
|
8048 - | Length(usize),
|
8049 - | /// Constraint violation error when the list does not contain unique items
|
8050 - | UniqueItems {
|
8051 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8052 - | /// at least two elements.
|
8053 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8054 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8055 - | /// Nothing is guaranteed about the order of the indices.
|
8056 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8057 - | /// The original vector, that contains duplicate items.
|
8058 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
8059 - | },
|
8060 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8061 - | /// The first component of the tuple is the index in the collection where the
|
8062 - | /// first constraint violation was found.
|
8063 8095 | #[doc(hidden)]
|
8064 - | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
8096 + | Key(crate::model::pattern_string::ConstraintViolation),
|
8097 + | #[doc(hidden)]
|
8098 + | Value(
|
8099 + | crate::model::PatternString,
|
8100 + | crate::model::list_of_pattern_string::ConstraintViolation,
|
8101 + | ),
|
8065 8102 | }
|
8066 8103 |
|
8067 8104 | impl ::std::fmt::Display for ConstraintViolation {
|
8068 8105 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8069 - | let message = match self {
|
8070 - | Self::Length(length) => {
|
8071 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
8072 - | },
|
8073 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8074 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8075 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8076 - | failing_member)
|
8077 - | };
|
8078 - | write!(f, "{message}")
|
8106 + | match self {
|
8107 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8108 + | Self::Value(_, value_constraint_violation) => {
|
8109 + | write!(f, "{}", value_constraint_violation)
|
8110 + | }
|
8111 + | }
|
8079 8112 | }
|
8080 8113 | }
|
8081 8114 |
|
8082 8115 | impl ::std::error::Error for ConstraintViolation {}
|
8083 8116 | impl ConstraintViolation {
|
8084 8117 | pub(crate) fn as_validation_exception_field(
|
8085 8118 | self,
|
8086 8119 | path: ::std::string::String,
|
8087 8120 | ) -> crate::model::ValidationExceptionField {
|
8088 8121 | match self {
|
8089 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
8090 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
8091 - | path,
|
8092 - | },
|
8093 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8094 - | crate::model::ValidationExceptionField {
|
8095 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8096 - | path,
|
8097 - | },
|
8098 - | Self::Member(index, member_constraint_violation) =>
|
8099 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8122 + | Self::Key(key_constraint_violation) => {
|
8123 + | key_constraint_violation.as_validation_exception_field(path)
|
8124 + | }
|
8125 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8126 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8100 8127 | }
|
8101 8128 | }
|
8102 8129 | }
|
8103 8130 | }
|
8104 - | /// See [`SetOfLengthPatternString`](crate::model::SetOfLengthPatternString).
|
8105 - | pub mod set_of_length_pattern_string {
|
8131 + | pub mod map_of_length_pattern_string {
|
8106 8132 |
|
8107 8133 | #[allow(clippy::enum_variant_names)]
|
8108 8134 | #[derive(Debug, PartialEq)]
|
8109 8135 | pub enum ConstraintViolation {
|
8110 - | /// Constraint violation error when the list does not contain unique items
|
8111 - | UniqueItems {
|
8112 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8113 - | /// at least two elements.
|
8114 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8115 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8116 - | /// Nothing is guaranteed about the order of the indices.
|
8117 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8118 - | /// The original vector, that contains duplicate items.
|
8119 - | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
8120 - | },
|
8121 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8122 - | /// The first component of the tuple is the index in the collection where the
|
8123 - | /// first constraint violation was found.
|
8124 8136 | #[doc(hidden)]
|
8125 - | Member(
|
8126 - | usize,
|
8137 + | Key(crate::model::length_pattern_string::ConstraintViolation),
|
8138 + | #[doc(hidden)]
|
8139 + | Value(
|
8140 + | crate::model::LengthPatternString,
|
8127 8141 | crate::model::length_pattern_string::ConstraintViolation,
|
8128 8142 | ),
|
8129 8143 | }
|
8130 8144 |
|
8131 8145 | impl ::std::fmt::Display for ConstraintViolation {
|
8132 8146 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8133 - | let message = match self {
|
8134 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8135 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8136 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8137 - | failing_member)
|
8138 - | };
|
8139 - | write!(f, "{message}")
|
8147 + | match self {
|
8148 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8149 + | Self::Value(_, value_constraint_violation) => {
|
8150 + | write!(f, "{}", value_constraint_violation)
|
8151 + | }
|
8152 + | }
|
8140 8153 | }
|
8141 8154 | }
|
8142 8155 |
|
8143 8156 | impl ::std::error::Error for ConstraintViolation {}
|
8144 8157 | impl ConstraintViolation {
|
8145 8158 | pub(crate) fn as_validation_exception_field(
|
8146 8159 | self,
|
8147 8160 | path: ::std::string::String,
|
8148 8161 | ) -> crate::model::ValidationExceptionField {
|
8149 8162 | match self {
|
8150 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8151 - | crate::model::ValidationExceptionField {
|
8152 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8153 - | path,
|
8154 - | },
|
8155 - | Self::Member(index, member_constraint_violation) =>
|
8156 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8163 + | Self::Key(key_constraint_violation) => {
|
8164 + | key_constraint_violation.as_validation_exception_field(path)
|
8165 + | }
|
8166 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8167 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8157 8168 | }
|
8158 8169 | }
|
8159 8170 | }
|
8160 8171 | }
|
8161 - | /// See [`SetOfPatternString`](crate::model::SetOfPatternString).
|
8162 - | pub mod set_of_pattern_string {
|
8172 + | pub mod map_of_list_of_length_pattern_string {
|
8163 8173 |
|
8164 8174 | #[allow(clippy::enum_variant_names)]
|
8165 8175 | #[derive(Debug, PartialEq)]
|
8166 8176 | pub enum ConstraintViolation {
|
8167 - | /// Constraint violation error when the list does not contain unique items
|
8168 - | UniqueItems {
|
8169 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8170 - | /// at least two elements.
|
8171 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8172 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8173 - | /// Nothing is guaranteed about the order of the indices.
|
8174 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8175 - | /// The original vector, that contains duplicate items.
|
8176 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
8177 - | },
|
8178 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8179 - | /// The first component of the tuple is the index in the collection where the
|
8180 - | /// first constraint violation was found.
|
8181 8177 | #[doc(hidden)]
|
8182 - | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
8178 + | Key(crate::model::length_pattern_string::ConstraintViolation),
|
8179 + | #[doc(hidden)]
|
8180 + | Value(
|
8181 + | crate::model::LengthPatternString,
|
8182 + | crate::model::list_of_length_pattern_string::ConstraintViolation,
|
8183 + | ),
|
8183 8184 | }
|
8184 8185 |
|
8185 8186 | impl ::std::fmt::Display for ConstraintViolation {
|
8186 8187 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8187 - | let message = match self {
|
8188 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8189 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8190 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8191 - | failing_member)
|
8192 - | };
|
8193 - | write!(f, "{message}")
|
8188 + | match self {
|
8189 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8190 + | Self::Value(_, value_constraint_violation) => {
|
8191 + | write!(f, "{}", value_constraint_violation)
|
8192 + | }
|
8193 + | }
|
8194 8194 | }
|
8195 8195 | }
|
8196 8196 |
|
8197 8197 | impl ::std::error::Error for ConstraintViolation {}
|
8198 8198 | impl ConstraintViolation {
|
8199 8199 | pub(crate) fn as_validation_exception_field(
|
8200 8200 | self,
|
8201 8201 | path: ::std::string::String,
|
8202 8202 | ) -> crate::model::ValidationExceptionField {
|
8203 8203 | match self {
|
8204 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8205 - | crate::model::ValidationExceptionField {
|
8206 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8207 - | path,
|
8208 - | },
|
8209 - | Self::Member(index, member_constraint_violation) =>
|
8210 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8204 + | Self::Key(key_constraint_violation) => {
|
8205 + | key_constraint_violation.as_validation_exception_field(path)
|
8206 + | }
|
8207 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8208 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8211 8209 | }
|
8212 8210 | }
|
8213 8211 | }
|
8214 8212 | }
|
8215 - | pub mod map_of_range_byte {
|
8213 + | pub mod map_of_enum_string {
|
8216 8214 |
|
8217 8215 | #[allow(clippy::enum_variant_names)]
|
8218 8216 | #[derive(Debug, PartialEq)]
|
8219 8217 | pub enum ConstraintViolation {
|
8218 + | #[doc(hidden)]
|
8219 + | Key(crate::model::enum_string::ConstraintViolation),
|
8220 8220 | #[doc(hidden)]
|
8221 8221 | Value(
|
8222 - | ::std::string::String,
|
8223 - | crate::model::range_byte::ConstraintViolation,
|
8222 + | crate::model::EnumString,
|
8223 + | crate::model::enum_string::ConstraintViolation,
|
8224 8224 | ),
|
8225 8225 | }
|
8226 8226 |
|
8227 8227 | impl ::std::fmt::Display for ConstraintViolation {
|
8228 8228 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8229 8229 | match self {
|
8230 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8230 8231 | Self::Value(_, value_constraint_violation) => {
|
8231 8232 | write!(f, "{}", value_constraint_violation)
|
8232 8233 | }
|
8233 8234 | }
|
8234 8235 | }
|
8235 8236 | }
|
8236 - |
|
8237 - | impl ::std::error::Error for ConstraintViolation {}
|
8238 - | impl ConstraintViolation {
|
8239 - | pub(crate) fn as_validation_exception_field(
|
8240 - | self,
|
8241 - | path: ::std::string::String,
|
8242 - | ) -> crate::model::ValidationExceptionField {
|
8243 - | match self {
|
8244 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8245 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8237 + |
|
8238 + | impl ::std::error::Error for ConstraintViolation {}
|
8239 + | impl ConstraintViolation {
|
8240 + | pub(crate) fn as_validation_exception_field(
|
8241 + | self,
|
8242 + | path: ::std::string::String,
|
8243 + | ) -> crate::model::ValidationExceptionField {
|
8244 + | match self {
|
8245 + | Self::Key(key_constraint_violation) => {
|
8246 + | key_constraint_violation.as_validation_exception_field(path)
|
8247 + | }
|
8248 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8249 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8250 + | }
|
8251 + | }
|
8252 + | }
|
8253 + | }
|
8254 + | /// See [`ConB`](crate::model::ConB).
|
8255 + | pub mod con_b {
|
8256 + |
|
8257 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8258 + | /// Holds one variant for each of the ways the builder can fail.
|
8259 + | #[non_exhaustive]
|
8260 + | #[allow(clippy::enum_variant_names)]
|
8261 + | pub enum ConstraintViolation {
|
8262 + | /// `nice` was not provided but it is required when building `ConB`.
|
8263 + | MissingNice,
|
8264 + | /// `int` was not provided but it is required when building `ConB`.
|
8265 + | MissingInt,
|
8266 + | }
|
8267 + | impl ::std::fmt::Display for ConstraintViolation {
|
8268 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8269 + | match self {
|
8270 + | ConstraintViolation::MissingNice => write!(
|
8271 + | f,
|
8272 + | "`nice` was not provided but it is required when building `ConB`"
|
8273 + | ),
|
8274 + | ConstraintViolation::MissingInt => write!(
|
8275 + | f,
|
8276 + | "`int` was not provided but it is required when building `ConB`"
|
8277 + | ),
|
8278 + | }
|
8279 + | }
|
8280 + | }
|
8281 + | impl ::std::error::Error for ConstraintViolation {}
|
8282 + | impl ConstraintViolation {
|
8283 + | pub(crate) fn as_validation_exception_field(
|
8284 + | self,
|
8285 + | path: ::std::string::String,
|
8286 + | ) -> crate::model::ValidationExceptionField {
|
8287 + | match self {
|
8288 + | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
8289 + | message: format!(
|
8290 + | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
8291 + | path
|
8292 + | ),
|
8293 + | path: path + "/nice",
|
8294 + | },
|
8295 + | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
8296 + | message: format!(
|
8297 + | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
8298 + | path
|
8299 + | ),
|
8300 + | path: path + "/int",
|
8301 + | },
|
8302 + | }
|
8303 + | }
|
8304 + | }
|
8305 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
8306 + | fn from(builder: Builder) -> Self {
|
8307 + | Self::Unconstrained(builder)
|
8308 + | }
|
8309 + | }
|
8310 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
8311 + | type Error = ConstraintViolation;
|
8312 + |
|
8313 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8314 + | builder.build()
|
8315 + | }
|
8316 + | }
|
8317 + | /// A builder for [`ConB`](crate::model::ConB).
|
8318 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8319 + | pub struct Builder {
|
8320 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
8321 + | pub(crate) int: ::std::option::Option<i32>,
|
8322 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
8323 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
8324 + | }
|
8325 + | impl Builder {
|
8326 + | #[allow(missing_docs)] // documentation missing in model
|
8327 + | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
8328 + | self.nice = Some(input);
|
8329 + | self
|
8330 + | }
|
8331 + | #[allow(missing_docs)] // documentation missing in model
|
8332 + | pub(crate) fn set_nice(
|
8333 + | mut self,
|
8334 + | input: impl ::std::convert::Into<::std::string::String>,
|
8335 + | ) -> Self {
|
8336 + | self.nice = Some(input.into());
|
8337 + | self
|
8338 + | }
|
8339 + | #[allow(missing_docs)] // documentation missing in model
|
8340 + | pub fn int(mut self, input: i32) -> Self {
|
8341 + | self.int = Some(input);
|
8342 + | self
|
8343 + | }
|
8344 + | #[allow(missing_docs)] // documentation missing in model
|
8345 + | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
8346 + | self.int = Some(input.into());
|
8347 + | self
|
8246 8348 | }
|
8349 + | #[allow(missing_docs)] // documentation missing in model
|
8350 + | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
8351 + | self.opt_nice = input;
|
8352 + | self
|
8247 8353 | }
|
8354 + | #[allow(missing_docs)] // documentation missing in model
|
8355 + | pub(crate) fn set_opt_nice(
|
8356 + | mut self,
|
8357 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
8358 + | ) -> Self {
|
8359 + | self.opt_nice = input.map(|v| v.into());
|
8360 + | self
|
8248 8361 | }
|
8249 - | }
|
8250 - | /// See [`RangeByte`](crate::model::RangeByte).
|
8251 - | pub mod range_byte {
|
8252 - |
|
8253 - | #[derive(Debug, PartialEq)]
|
8254 - | pub enum ConstraintViolation {
|
8255 - | Range(i8),
|
8362 + | #[allow(missing_docs)] // documentation missing in model
|
8363 + | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
8364 + | self.opt_int = input;
|
8365 + | self
|
8256 8366 | }
|
8257 - |
|
8258 - | impl ::std::fmt::Display for ConstraintViolation {
|
8259 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8260 - | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8367 + | #[allow(missing_docs)] // documentation missing in model
|
8368 + | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
8369 + | self.opt_int = input.map(|v| v.into());
|
8370 + | self
|
8261 8371 | }
|
8372 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
8373 + | ///
|
8374 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
8375 + | ///
|
8376 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
8377 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
8378 + | self.build_enforcing_all_constraints()
|
8262 8379 | }
|
8263 - |
|
8264 - | impl ::std::error::Error for ConstraintViolation {}
|
8265 - | impl ConstraintViolation {
|
8266 - | pub(crate) fn as_validation_exception_field(
|
8380 + | fn build_enforcing_all_constraints(
|
8267 8381 | self,
|
8268 - | path: ::std::string::String,
|
8269 - | ) -> crate::model::ValidationExceptionField {
|
8270 - | match self {
|
8271 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
8272 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8273 - | path,
|
8274 - | },
|
8275 - | }
|
8382 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
8383 + | Ok(crate::model::ConB {
|
8384 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
8385 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
8386 + | opt_nice: self.opt_nice,
|
8387 + | opt_int: self.opt_int,
|
8388 + | })
|
8276 8389 | }
|
8277 8390 | }
|
8278 8391 | }
|
8279 - | /// See [`SetOfRangeByte`](crate::model::SetOfRangeByte).
|
8280 - | pub mod set_of_range_byte {
|
8392 + | /// See [`MinLengthString`](crate::model::MinLengthString).
|
8393 + | pub mod min_length_string {
|
8281 8394 |
|
8282 - | #[allow(clippy::enum_variant_names)]
|
8283 8395 | #[derive(Debug, PartialEq)]
|
8284 8396 | pub enum ConstraintViolation {
|
8285 - | /// Constraint violation error when the list does not contain unique items
|
8286 - | UniqueItems {
|
8287 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8288 - | /// at least two elements.
|
8289 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8290 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8291 - | /// Nothing is guaranteed about the order of the indices.
|
8292 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8293 - | /// The original vector, that contains duplicate items.
|
8294 - | original: ::std::vec::Vec<crate::model::RangeByte>,
|
8295 - | },
|
8296 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8297 - | /// The first component of the tuple is the index in the collection where the
|
8298 - | /// first constraint violation was found.
|
8299 - | #[doc(hidden)]
|
8300 - | Member(usize, crate::model::range_byte::ConstraintViolation),
|
8397 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8398 + | Length(usize),
|
8301 8399 | }
|
8302 8400 |
|
8303 8401 | impl ::std::fmt::Display for ConstraintViolation {
|
8304 8402 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8305 8403 | let message = match self {
|
8306 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8307 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8308 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8309 - | failing_member)
|
8404 + | Self::Length(length) => {
|
8405 + | 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)
|
8406 + | }
|
8310 8407 | };
|
8311 8408 | write!(f, "{message}")
|
8312 8409 | }
|
8313 8410 | }
|
8314 8411 |
|
8315 8412 | impl ::std::error::Error for ConstraintViolation {}
|
8316 8413 | impl ConstraintViolation {
|
8317 8414 | pub(crate) fn as_validation_exception_field(
|
8318 8415 | self,
|
8319 8416 | path: ::std::string::String,
|
8320 8417 | ) -> crate::model::ValidationExceptionField {
|
8321 8418 | match self {
|
8322 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8323 - | crate::model::ValidationExceptionField {
|
8324 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8419 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8420 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
8325 8421 | path,
|
8326 8422 | },
|
8327 - | Self::Member(index, member_constraint_violation) =>
|
8328 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8329 8423 | }
|
8330 8424 | }
|
8331 8425 | }
|
8332 8426 | }
|
8333 - | pub mod list_of_range_byte {
|
8427 + | /// See [`MaxLengthString`](crate::model::MaxLengthString).
|
8428 + | pub mod max_length_string {
|
8334 8429 |
|
8335 - | #[allow(clippy::enum_variant_names)]
|
8336 8430 | #[derive(Debug, PartialEq)]
|
8337 8431 | pub enum ConstraintViolation {
|
8338 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8339 - | /// The first component of the tuple is the index in the collection where the
|
8340 - | /// first constraint violation was found.
|
8341 - | #[doc(hidden)]
|
8342 - | Member(usize, crate::model::range_byte::ConstraintViolation),
|
8432 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8433 + | Length(usize),
|
8343 8434 | }
|
8344 8435 |
|
8345 8436 | impl ::std::fmt::Display for ConstraintViolation {
|
8346 8437 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8347 8438 | let message = match self {
|
8348 - | Self::Member(index, failing_member) => format!(
|
8349 - | "Value at index {index} failed to satisfy constraint. {}",
|
8350 - | failing_member
|
8351 - | ),
|
8439 + | Self::Length(length) => {
|
8440 + | 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)
|
8441 + | }
|
8352 8442 | };
|
8353 8443 | write!(f, "{message}")
|
8354 8444 | }
|
8355 8445 | }
|
8356 8446 |
|
8357 8447 | impl ::std::error::Error for ConstraintViolation {}
|
8358 8448 | impl ConstraintViolation {
|
8359 8449 | pub(crate) fn as_validation_exception_field(
|
8360 8450 | self,
|
8361 8451 | path: ::std::string::String,
|
8362 8452 | ) -> crate::model::ValidationExceptionField {
|
8363 8453 | match self {
|
8364 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8365 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8454 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8455 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
8456 + | path,
|
8457 + | },
|
8366 8458 | }
|
8367 8459 | }
|
8368 8460 | }
|
8369 8461 | }
|
8370 - | pub mod map_of_range_long {
|
8462 + | /// See [`FixedLengthString`](crate::model::FixedLengthString).
|
8463 + | pub mod fixed_length_string {
|
8371 8464 |
|
8372 - | #[allow(clippy::enum_variant_names)]
|
8373 8465 | #[derive(Debug, PartialEq)]
|
8374 8466 | pub enum ConstraintViolation {
|
8375 - | #[doc(hidden)]
|
8376 - | Value(
|
8377 - | ::std::string::String,
|
8378 - | crate::model::range_long::ConstraintViolation,
|
8379 - | ),
|
8467 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8468 + | Length(usize),
|
8380 8469 | }
|
8381 8470 |
|
8382 8471 | impl ::std::fmt::Display for ConstraintViolation {
|
8383 8472 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8384 - | match self {
|
8385 - | Self::Value(_, value_constraint_violation) => {
|
8386 - | write!(f, "{}", value_constraint_violation)
|
8387 - | }
|
8388 - | }
|
8389 - | }
|
8390 - | }
|
8391 - |
|
8392 - | impl ::std::error::Error for ConstraintViolation {}
|
8393 - | impl ConstraintViolation {
|
8394 - | pub(crate) fn as_validation_exception_field(
|
8395 - | self,
|
8396 - | path: ::std::string::String,
|
8397 - | ) -> crate::model::ValidationExceptionField {
|
8398 - | match self {
|
8399 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8400 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8401 - | }
|
8402 - | }
|
8403 - | }
|
8404 - | }
|
8405 - | /// See [`RangeLong`](crate::model::RangeLong).
|
8406 - | pub mod range_long {
|
8407 - |
|
8408 - | #[derive(Debug, PartialEq)]
|
8409 - | pub enum ConstraintViolation {
|
8410 - | Range(i64),
|
8473 + | let message = match self {
|
8474 + | Self::Length(length) => {
|
8475 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
8411 8476 | }
|
8412 - |
|
8413 - | impl ::std::fmt::Display for ConstraintViolation {
|
8414 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8415 - | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8477 + | };
|
8478 + | write!(f, "{message}")
|
8416 8479 | }
|
8417 8480 | }
|
8418 8481 |
|
8419 8482 | impl ::std::error::Error for ConstraintViolation {}
|
8420 8483 | impl ConstraintViolation {
|
8421 8484 | pub(crate) fn as_validation_exception_field(
|
8422 8485 | self,
|
8423 8486 | path: ::std::string::String,
|
8424 8487 | ) -> crate::model::ValidationExceptionField {
|
8425 8488 | match self {
|
8426 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
8427 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8489 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8490 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
8428 8491 | path,
|
8429 8492 | },
|
8430 8493 | }
|
8431 8494 | }
|
8432 8495 | }
|
8433 8496 | }
|
8434 - | /// See [`SetOfRangeLong`](crate::model::SetOfRangeLong).
|
8435 - | pub mod set_of_range_long {
|
8497 + | /// See [`LengthBlob`](crate::model::LengthBlob).
|
8498 + | pub mod length_blob {
|
8436 8499 |
|
8437 - | #[allow(clippy::enum_variant_names)]
|
8438 8500 | #[derive(Debug, PartialEq)]
|
8439 8501 | pub enum ConstraintViolation {
|
8440 - | /// Constraint violation error when the list does not contain unique items
|
8441 - | UniqueItems {
|
8442 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8443 - | /// at least two elements.
|
8444 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8445 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8446 - | /// Nothing is guaranteed about the order of the indices.
|
8447 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8448 - | /// The original vector, that contains duplicate items.
|
8449 - | original: ::std::vec::Vec<crate::model::RangeLong>,
|
8450 - | },
|
8451 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8452 - | /// The first component of the tuple is the index in the collection where the
|
8453 - | /// first constraint violation was found.
|
8454 - | #[doc(hidden)]
|
8455 - | Member(usize, crate::model::range_long::ConstraintViolation),
|
8502 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8503 + | Length(usize),
|
8456 8504 | }
|
8457 8505 |
|
8458 8506 | impl ::std::fmt::Display for ConstraintViolation {
|
8459 8507 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8460 8508 | let message = match self {
|
8461 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8462 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8463 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8464 - | failing_member)
|
8509 + | Self::Length(length) => {
|
8510 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
8511 + | }
|
8465 8512 | };
|
8466 8513 | write!(f, "{message}")
|
8467 8514 | }
|
8468 8515 | }
|
8469 8516 |
|
8470 8517 | impl ::std::error::Error for ConstraintViolation {}
|
8471 8518 | impl ConstraintViolation {
|
8472 8519 | pub(crate) fn as_validation_exception_field(
|
8473 8520 | self,
|
8474 8521 | path: ::std::string::String,
|
8475 8522 | ) -> crate::model::ValidationExceptionField {
|
8476 8523 | match self {
|
8477 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8478 - | crate::model::ValidationExceptionField {
|
8479 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8524 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8525 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
8480 8526 | path,
|
8481 8527 | },
|
8482 - | Self::Member(index, member_constraint_violation) =>
|
8483 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8484 8528 | }
|
8485 8529 | }
|
8486 8530 | }
|
8487 8531 | }
|
8488 - | pub mod list_of_range_long {
|
8532 + | /// See [`MinLengthBlob`](crate::model::MinLengthBlob).
|
8533 + | pub mod min_length_blob {
|
8489 8534 |
|
8490 - | #[allow(clippy::enum_variant_names)]
|
8491 8535 | #[derive(Debug, PartialEq)]
|
8492 8536 | pub enum ConstraintViolation {
|
8493 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8494 - | /// The first component of the tuple is the index in the collection where the
|
8495 - | /// first constraint violation was found.
|
8496 - | #[doc(hidden)]
|
8497 - | Member(usize, crate::model::range_long::ConstraintViolation),
|
8537 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8538 + | Length(usize),
|
8498 8539 | }
|
8499 8540 |
|
8500 8541 | impl ::std::fmt::Display for ConstraintViolation {
|
8501 8542 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8502 8543 | let message = match self {
|
8503 - | Self::Member(index, failing_member) => format!(
|
8504 - | "Value at index {index} failed to satisfy constraint. {}",
|
8505 - | failing_member
|
8506 - | ),
|
8544 + | Self::Length(length) => {
|
8545 + | 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)
|
8546 + | }
|
8507 8547 | };
|
8508 8548 | write!(f, "{message}")
|
8509 8549 | }
|
8510 8550 | }
|
8511 8551 |
|
8512 8552 | impl ::std::error::Error for ConstraintViolation {}
|
8513 8553 | impl ConstraintViolation {
|
8514 8554 | pub(crate) fn as_validation_exception_field(
|
8515 8555 | self,
|
8516 8556 | path: ::std::string::String,
|
8517 8557 | ) -> crate::model::ValidationExceptionField {
|
8518 8558 | match self {
|
8519 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8520 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8559 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8560 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
8561 + | path,
|
8562 + | },
|
8521 8563 | }
|
8522 8564 | }
|
8523 8565 | }
|
8524 8566 | }
|
8525 - | pub mod map_of_range_short {
|
8567 + | /// See [`MaxLengthBlob`](crate::model::MaxLengthBlob).
|
8568 + | pub mod max_length_blob {
|
8526 8569 |
|
8527 - | #[allow(clippy::enum_variant_names)]
|
8528 8570 | #[derive(Debug, PartialEq)]
|
8529 8571 | pub enum ConstraintViolation {
|
8530 - | #[doc(hidden)]
|
8531 - | Value(
|
8532 - | ::std::string::String,
|
8533 - | crate::model::range_short::ConstraintViolation,
|
8534 - | ),
|
8572 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8573 + | Length(usize),
|
8535 8574 | }
|
8536 8575 |
|
8537 8576 | impl ::std::fmt::Display for ConstraintViolation {
|
8538 8577 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8539 - | match self {
|
8540 - | Self::Value(_, value_constraint_violation) => {
|
8541 - | write!(f, "{}", value_constraint_violation)
|
8542 - | }
|
8578 + | let message = match self {
|
8579 + | Self::Length(length) => {
|
8580 + | 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)
|
8543 8581 | }
|
8582 + | };
|
8583 + | write!(f, "{message}")
|
8544 8584 | }
|
8545 8585 | }
|
8546 8586 |
|
8547 8587 | impl ::std::error::Error for ConstraintViolation {}
|
8548 8588 | impl ConstraintViolation {
|
8549 8589 | pub(crate) fn as_validation_exception_field(
|
8550 8590 | self,
|
8551 8591 | path: ::std::string::String,
|
8552 8592 | ) -> crate::model::ValidationExceptionField {
|
8553 8593 | match self {
|
8554 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8555 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8594 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8595 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
8596 + | path,
|
8597 + | },
|
8556 8598 | }
|
8557 8599 | }
|
8558 8600 | }
|
8559 8601 | }
|
8560 - | /// See [`RangeShort`](crate::model::RangeShort).
|
8561 - | pub mod range_short {
|
8602 + | /// See [`FixedLengthBlob`](crate::model::FixedLengthBlob).
|
8603 + | pub mod fixed_length_blob {
|
8562 8604 |
|
8563 8605 | #[derive(Debug, PartialEq)]
|
8564 8606 | pub enum ConstraintViolation {
|
8565 - | Range(i16),
|
8607 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8608 + | Length(usize),
|
8566 8609 | }
|
8567 8610 |
|
8568 8611 | impl ::std::fmt::Display for ConstraintViolation {
|
8569 8612 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8570 - | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8613 + | let message = match self {
|
8614 + | Self::Length(length) => {
|
8615 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
8616 + | }
|
8617 + | };
|
8618 + | write!(f, "{message}")
|
8571 8619 | }
|
8572 8620 | }
|
8573 8621 |
|
8574 8622 | impl ::std::error::Error for ConstraintViolation {}
|
8575 8623 | impl ConstraintViolation {
|
8576 8624 | pub(crate) fn as_validation_exception_field(
|
8577 8625 | self,
|
8578 8626 | path: ::std::string::String,
|
8579 8627 | ) -> crate::model::ValidationExceptionField {
|
8580 8628 | match self {
|
8581 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
8582 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8629 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8630 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
8583 8631 | path,
|
8584 8632 | },
|
8585 8633 | }
|
8586 8634 | }
|
8587 8635 | }
|
8588 8636 | }
|
8589 - | /// See [`SetOfRangeShort`](crate::model::SetOfRangeShort).
|
8590 - | pub mod set_of_range_short {
|
8637 + | /// See [`MinRangeInteger`](crate::model::MinRangeInteger).
|
8638 + | pub mod min_range_integer {
|
8591 8639 |
|
8592 - | #[allow(clippy::enum_variant_names)]
|
8593 8640 | #[derive(Debug, PartialEq)]
|
8594 8641 | pub enum ConstraintViolation {
|
8595 - | /// Constraint violation error when the list does not contain unique items
|
8596 - | UniqueItems {
|
8597 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8598 - | /// at least two elements.
|
8599 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8600 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8601 - | /// Nothing is guaranteed about the order of the indices.
|
8602 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8603 - | /// The original vector, that contains duplicate items.
|
8604 - | original: ::std::vec::Vec<crate::model::RangeShort>,
|
8605 - | },
|
8606 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8607 - | /// The first component of the tuple is the index in the collection where the
|
8608 - | /// first constraint violation was found.
|
8609 - | #[doc(hidden)]
|
8610 - | Member(usize, crate::model::range_short::ConstraintViolation),
|
8642 + | Range(i32),
|
8611 8643 | }
|
8612 8644 |
|
8613 8645 | impl ::std::fmt::Display for ConstraintViolation {
|
8614 8646 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8615 - | let message = match self {
|
8616 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8617 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8618 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8619 - | failing_member)
|
8620 - | };
|
8621 - | write!(f, "{message}")
|
8647 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8622 8648 | }
|
8623 8649 | }
|
8624 8650 |
|
8625 8651 | impl ::std::error::Error for ConstraintViolation {}
|
8626 8652 | impl ConstraintViolation {
|
8627 8653 | pub(crate) fn as_validation_exception_field(
|
8628 8654 | self,
|
8629 8655 | path: ::std::string::String,
|
8630 8656 | ) -> crate::model::ValidationExceptionField {
|
8631 8657 | match self {
|
8632 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8633 - | crate::model::ValidationExceptionField {
|
8634 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8658 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8659 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8635 8660 | path,
|
8636 8661 | },
|
8637 - | Self::Member(index, member_constraint_violation) =>
|
8638 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8639 8662 | }
|
8640 8663 | }
|
8641 8664 | }
|
8642 8665 | }
|
8643 - | pub mod list_of_range_short {
|
8666 + | /// See [`MaxRangeInteger`](crate::model::MaxRangeInteger).
|
8667 + | pub mod max_range_integer {
|
8644 8668 |
|
8645 - | #[allow(clippy::enum_variant_names)]
|
8646 8669 | #[derive(Debug, PartialEq)]
|
8647 8670 | pub enum ConstraintViolation {
|
8648 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8649 - | /// The first component of the tuple is the index in the collection where the
|
8650 - | /// first constraint violation was found.
|
8651 - | #[doc(hidden)]
|
8652 - | Member(usize, crate::model::range_short::ConstraintViolation),
|
8671 + | Range(i32),
|
8653 8672 | }
|
8654 8673 |
|
8655 8674 | impl ::std::fmt::Display for ConstraintViolation {
|
8656 8675 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8657 - | let message = match self {
|
8658 - | Self::Member(index, failing_member) => format!(
|
8659 - | "Value at index {index} failed to satisfy constraint. {}",
|
8660 - | failing_member
|
8661 - | ),
|
8662 - | };
|
8663 - | write!(f, "{message}")
|
8676 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
8664 8677 | }
|
8665 8678 | }
|
8666 8679 |
|
8667 8680 | impl ::std::error::Error for ConstraintViolation {}
|
8668 8681 | impl ConstraintViolation {
|
8669 8682 | pub(crate) fn as_validation_exception_field(
|
8670 8683 | self,
|
8671 8684 | path: ::std::string::String,
|
8672 8685 | ) -> crate::model::ValidationExceptionField {
|
8673 8686 | match self {
|
8674 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8675 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8687 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8688 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
8689 + | path,
|
8690 + | },
|
8676 8691 | }
|
8677 8692 | }
|
8678 8693 | }
|
8679 8694 | }
|
8680 - | pub mod map_of_range_integer {
|
8695 + | /// See [`FixedValueInteger`](crate::model::FixedValueInteger).
|
8696 + | pub mod fixed_value_integer {
|
8681 8697 |
|
8682 - | #[allow(clippy::enum_variant_names)]
|
8683 8698 | #[derive(Debug, PartialEq)]
|
8684 8699 | pub enum ConstraintViolation {
|
8685 - | #[doc(hidden)]
|
8686 - | Value(
|
8687 - | ::std::string::String,
|
8688 - | crate::model::range_integer::ConstraintViolation,
|
8689 - | ),
|
8700 + | Range(i32),
|
8690 8701 | }
|
8691 8702 |
|
8692 8703 | impl ::std::fmt::Display for ConstraintViolation {
|
8693 8704 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8694 - | match self {
|
8695 - | Self::Value(_, value_constraint_violation) => {
|
8696 - | write!(f, "{}", value_constraint_violation)
|
8697 - | }
|
8698 - | }
|
8705 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
8699 8706 | }
|
8700 8707 | }
|
8701 8708 |
|
8702 8709 | impl ::std::error::Error for ConstraintViolation {}
|
8703 8710 | impl ConstraintViolation {
|
8704 8711 | pub(crate) fn as_validation_exception_field(
|
8705 8712 | self,
|
8706 8713 | path: ::std::string::String,
|
8707 8714 | ) -> crate::model::ValidationExceptionField {
|
8708 8715 | match self {
|
8709 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8710 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8716 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8717 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
8718 + | path,
|
8719 + | },
|
8711 8720 | }
|
8712 8721 | }
|
8713 8722 | }
|
8714 8723 | }
|
8715 - | /// See [`RangeInteger`](crate::model::RangeInteger).
|
8716 - | pub mod range_integer {
|
8724 + | /// See [`MinRangeShort`](crate::model::MinRangeShort).
|
8725 + | pub mod min_range_short {
|
8717 8726 |
|
8718 8727 | #[derive(Debug, PartialEq)]
|
8719 8728 | pub enum ConstraintViolation {
|
8720 - | Range(i32),
|
8729 + | Range(i16),
|
8721 8730 | }
|
8722 8731 |
|
8723 8732 | impl ::std::fmt::Display for ConstraintViolation {
|
8724 8733 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8725 - | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
8734 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8726 8735 | }
|
8727 8736 | }
|
8728 8737 |
|
8729 8738 | impl ::std::error::Error for ConstraintViolation {}
|
8730 8739 | impl ConstraintViolation {
|
8731 8740 | pub(crate) fn as_validation_exception_field(
|
8732 8741 | self,
|
8733 8742 | path: ::std::string::String,
|
8734 8743 | ) -> crate::model::ValidationExceptionField {
|
8735 8744 | match self {
|
8736 8745 | Self::Range(_) => crate::model::ValidationExceptionField {
|
8737 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
8746 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8738 8747 | path,
|
8739 8748 | },
|
8740 8749 | }
|
8741 8750 | }
|
8742 8751 | }
|
8743 8752 | }
|
8744 - | /// See [`SetOfRangeInteger`](crate::model::SetOfRangeInteger).
|
8745 - | pub mod set_of_range_integer {
|
8753 + | /// See [`MaxRangeShort`](crate::model::MaxRangeShort).
|
8754 + | pub mod max_range_short {
|
8746 8755 |
|
8747 - | #[allow(clippy::enum_variant_names)]
|
8748 8756 | #[derive(Debug, PartialEq)]
|
8749 8757 | pub enum ConstraintViolation {
|
8750 - | /// Constraint violation error when the list does not contain unique items
|
8751 - | UniqueItems {
|
8752 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8753 - | /// at least two elements.
|
8754 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8755 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8756 - | /// Nothing is guaranteed about the order of the indices.
|
8757 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8758 - | /// The original vector, that contains duplicate items.
|
8759 - | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
8760 - | },
|
8761 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8762 - | /// The first component of the tuple is the index in the collection where the
|
8763 - | /// first constraint violation was found.
|
8764 - | #[doc(hidden)]
|
8765 - | Member(usize, crate::model::range_integer::ConstraintViolation),
|
8758 + | Range(i16),
|
8766 8759 | }
|
8767 8760 |
|
8768 8761 | impl ::std::fmt::Display for ConstraintViolation {
|
8769 8762 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8770 - | let message = match self {
|
8771 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8772 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8773 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8774 - | failing_member)
|
8775 - | };
|
8776 - | write!(f, "{message}")
|
8763 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
8777 8764 | }
|
8778 8765 | }
|
8779 8766 |
|
8780 8767 | impl ::std::error::Error for ConstraintViolation {}
|
8781 8768 | impl ConstraintViolation {
|
8782 8769 | pub(crate) fn as_validation_exception_field(
|
8783 8770 | self,
|
8784 8771 | path: ::std::string::String,
|
8785 8772 | ) -> crate::model::ValidationExceptionField {
|
8786 8773 | match self {
|
8787 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8788 - | crate::model::ValidationExceptionField {
|
8789 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8774 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8775 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
8790 8776 | path,
|
8791 8777 | },
|
8792 - | Self::Member(index, member_constraint_violation) =>
|
8793 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8794 8778 | }
|
8795 8779 | }
|
8796 8780 | }
|
8797 8781 | }
|
8798 - | pub mod list_of_range_integer {
|
8782 + | /// See [`FixedValueShort`](crate::model::FixedValueShort).
|
8783 + | pub mod fixed_value_short {
|
8799 8784 |
|
8800 - | #[allow(clippy::enum_variant_names)]
|
8801 8785 | #[derive(Debug, PartialEq)]
|
8802 8786 | pub enum ConstraintViolation {
|
8803 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8804 - | /// The first component of the tuple is the index in the collection where the
|
8805 - | /// first constraint violation was found.
|
8806 - | #[doc(hidden)]
|
8807 - | Member(usize, crate::model::range_integer::ConstraintViolation),
|
8787 + | Range(i16),
|
8808 8788 | }
|
8809 8789 |
|
8810 8790 | impl ::std::fmt::Display for ConstraintViolation {
|
8811 8791 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8812 - | let message = match self {
|
8813 - | Self::Member(index, failing_member) => format!(
|
8814 - | "Value at index {index} failed to satisfy constraint. {}",
|
8815 - | failing_member
|
8816 - | ),
|
8817 - | };
|
8818 - | write!(f, "{message}")
|
8792 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
8819 8793 | }
|
8820 8794 | }
|
8821 8795 |
|
8822 8796 | impl ::std::error::Error for ConstraintViolation {}
|
8823 8797 | impl ConstraintViolation {
|
8824 8798 | pub(crate) fn as_validation_exception_field(
|
8825 8799 | self,
|
8826 8800 | path: ::std::string::String,
|
8827 8801 | ) -> crate::model::ValidationExceptionField {
|
8828 8802 | match self {
|
8829 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8830 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8803 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8804 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
8805 + | path,
|
8806 + | },
|
8831 8807 | }
|
8832 8808 | }
|
8833 8809 | }
|
8834 8810 | }
|
8835 - | pub mod map_of_length_blob {
|
8811 + | /// See [`MinRangeLong`](crate::model::MinRangeLong).
|
8812 + | pub mod min_range_long {
|
8836 8813 |
|
8837 - | #[allow(clippy::enum_variant_names)]
|
8838 8814 | #[derive(Debug, PartialEq)]
|
8839 8815 | pub enum ConstraintViolation {
|
8840 - | #[doc(hidden)]
|
8841 - | Value(
|
8842 - | ::std::string::String,
|
8843 - | crate::model::length_blob::ConstraintViolation,
|
8844 - | ),
|
8816 + | Range(i64),
|
8845 8817 | }
|
8846 8818 |
|
8847 8819 | impl ::std::fmt::Display for ConstraintViolation {
|
8848 8820 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8849 - | match self {
|
8850 - | Self::Value(_, value_constraint_violation) => {
|
8851 - | write!(f, "{}", value_constraint_violation)
|
8852 - | }
|
8853 - | }
|
8821 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8854 8822 | }
|
8855 8823 | }
|
8856 8824 |
|
8857 8825 | impl ::std::error::Error for ConstraintViolation {}
|
8858 8826 | impl ConstraintViolation {
|
8859 8827 | pub(crate) fn as_validation_exception_field(
|
8860 8828 | self,
|
8861 8829 | path: ::std::string::String,
|
8862 8830 | ) -> crate::model::ValidationExceptionField {
|
8863 8831 | match self {
|
8864 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8865 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8832 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8833 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8834 + | path,
|
8835 + | },
|
8866 8836 | }
|
8867 8837 | }
|
8868 8838 | }
|
8869 8839 | }
|
8870 - | /// See [`LengthBlob`](crate::model::LengthBlob).
|
8871 - | pub mod length_blob {
|
8840 + | /// See [`MaxRangeLong`](crate::model::MaxRangeLong).
|
8841 + | pub mod max_range_long {
|
8872 8842 |
|
8873 8843 | #[derive(Debug, PartialEq)]
|
8874 8844 | pub enum ConstraintViolation {
|
8875 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8876 - | Length(usize),
|
8845 + | Range(i64),
|
8877 8846 | }
|
8878 8847 |
|
8879 8848 | impl ::std::fmt::Display for ConstraintViolation {
|
8880 8849 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8881 - | let message = match self {
|
8882 - | Self::Length(length) => {
|
8883 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
8884 - | }
|
8885 - | };
|
8886 - | write!(f, "{message}")
|
8850 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
8887 8851 | }
|
8888 8852 | }
|
8889 8853 |
|
8890 8854 | impl ::std::error::Error for ConstraintViolation {}
|
8891 8855 | impl ConstraintViolation {
|
8892 8856 | pub(crate) fn as_validation_exception_field(
|
8893 8857 | self,
|
8894 8858 | path: ::std::string::String,
|
8895 8859 | ) -> crate::model::ValidationExceptionField {
|
8896 8860 | match self {
|
8897 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
8898 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
8861 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8862 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
8899 8863 | path,
|
8900 8864 | },
|
8901 8865 | }
|
8902 8866 | }
|
8903 8867 | }
|
8904 8868 | }
|
8905 - | pub mod list_of_length_blob {
|
8869 + | /// See [`FixedValueLong`](crate::model::FixedValueLong).
|
8870 + | pub mod fixed_value_long {
|
8906 8871 |
|
8907 - | #[allow(clippy::enum_variant_names)]
|
8908 8872 | #[derive(Debug, PartialEq)]
|
8909 8873 | pub enum ConstraintViolation {
|
8910 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8911 - | /// The first component of the tuple is the index in the collection where the
|
8912 - | /// first constraint violation was found.
|
8913 - | #[doc(hidden)]
|
8914 - | Member(usize, crate::model::length_blob::ConstraintViolation),
|
8874 + | Range(i64),
|
8915 8875 | }
|
8916 8876 |
|
8917 8877 | impl ::std::fmt::Display for ConstraintViolation {
|
8918 8878 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8919 - | let message = match self {
|
8920 - | Self::Member(index, failing_member) => format!(
|
8921 - | "Value at index {index} failed to satisfy constraint. {}",
|
8922 - | failing_member
|
8923 - | ),
|
8924 - | };
|
8925 - | write!(f, "{message}")
|
8879 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
8926 8880 | }
|
8927 8881 | }
|
8928 8882 |
|
8929 8883 | impl ::std::error::Error for ConstraintViolation {}
|
8930 8884 | impl ConstraintViolation {
|
8931 8885 | pub(crate) fn as_validation_exception_field(
|
8932 8886 | self,
|
8933 8887 | path: ::std::string::String,
|
8934 8888 | ) -> crate::model::ValidationExceptionField {
|
8935 8889 | match self {
|
8936 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8937 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8890 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8891 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
8892 + | path,
|
8893 + | },
|
8938 8894 | }
|
8939 8895 | }
|
8940 8896 | }
|
8941 8897 | }
|
8942 - | pub mod constrained_union {
|
8898 + | /// See [`MinRangeByte`](crate::model::MinRangeByte).
|
8899 + | pub mod min_range_byte {
|
8943 8900 |
|
8944 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8945 - | #[allow(clippy::enum_variant_names)]
|
8901 + | #[derive(Debug, PartialEq)]
|
8946 8902 | pub enum ConstraintViolation {
|
8947 - | ConBList(crate::model::con_b_list::ConstraintViolation),
|
8948 - | ConBMap(crate::model::con_b_map::ConstraintViolation),
|
8949 - | ConBSet(crate::model::con_b_set::ConstraintViolation),
|
8950 - | ConstrainedStructure(crate::model::con_b::ConstraintViolation),
|
8951 - | EnumString(crate::model::enum_string::ConstraintViolation),
|
8952 - | LengthString(crate::model::length_string::ConstraintViolation),
|
8903 + | Range(i8),
|
8953 8904 | }
|
8905 + |
|
8954 8906 | impl ::std::fmt::Display for ConstraintViolation {
|
8955 8907 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8956 - | match self {
|
8957 - | Self::ConBList(inner) => write!(f, "{inner}"),
|
8958 - | Self::ConBMap(inner) => write!(f, "{inner}"),
|
8959 - | Self::ConBSet(inner) => write!(f, "{inner}"),
|
8960 - | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
8961 - | Self::EnumString(inner) => write!(f, "{inner}"),
|
8962 - | Self::LengthString(inner) => write!(f, "{inner}"),
|
8963 - | }
|
8908 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8964 8909 | }
|
8965 8910 | }
|
8966 8911 |
|
8967 8912 | impl ::std::error::Error for ConstraintViolation {}
|
8968 8913 | impl ConstraintViolation {
|
8969 8914 | pub(crate) fn as_validation_exception_field(
|
8970 8915 | self,
|
8971 8916 | path: ::std::string::String,
|
8972 8917 | ) -> crate::model::ValidationExceptionField {
|
8973 8918 | match self {
|
8974 - | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
8975 - | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
8976 - | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
8977 - | Self::ConstrainedStructure(inner) => {
|
8978 - | inner.as_validation_exception_field(path + "/constrainedStructure")
|
8979 - | }
|
8980 - | Self::EnumString(inner) => {
|
8981 - | inner.as_validation_exception_field(path + "/enumString")
|
8982 - | }
|
8983 - | Self::LengthString(inner) => {
|
8984 - | inner.as_validation_exception_field(path + "/lengthString")
|
8985 - | }
|
8919 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8920 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8921 + | path,
|
8922 + | },
|
8986 8923 | }
|
8987 8924 | }
|
8988 8925 | }
|
8989 8926 | }
|
8990 - | /// See [`ConBSet`](crate::model::ConBSet).
|
8991 - | pub mod con_b_set {
|
8927 + | /// See [`MaxRangeByte`](crate::model::MaxRangeByte).
|
8928 + | pub mod max_range_byte {
|
8992 8929 |
|
8993 - | #[allow(clippy::enum_variant_names)]
|
8994 8930 | #[derive(Debug, PartialEq)]
|
8995 8931 | pub enum ConstraintViolation {
|
8996 - | /// Constraint violation error when the list does not contain unique items
|
8997 - | UniqueItems {
|
8998 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8999 - | /// at least two elements.
|
9000 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9001 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9002 - | /// Nothing is guaranteed about the order of the indices.
|
9003 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9004 - | /// The original vector, that contains duplicate items.
|
9005 - | original: ::std::vec::Vec<crate::model::ConBSetInner>,
|
9006 - | },
|
9007 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9008 - | /// The first component of the tuple is the index in the collection where the
|
9009 - | /// first constraint violation was found.
|
9010 - | #[doc(hidden)]
|
9011 - | Member(usize, crate::model::con_b_set_inner::ConstraintViolation),
|
8932 + | Range(i8),
|
9012 8933 | }
|
9013 8934 |
|
9014 8935 | impl ::std::fmt::Display for ConstraintViolation {
|
9015 8936 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9016 - | let message = match self {
|
9017 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9018 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9019 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9020 - | failing_member)
|
9021 - | };
|
9022 - | write!(f, "{message}")
|
8937 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
9023 8938 | }
|
9024 8939 | }
|
9025 8940 |
|
9026 8941 | impl ::std::error::Error for ConstraintViolation {}
|
9027 8942 | impl ConstraintViolation {
|
9028 8943 | pub(crate) fn as_validation_exception_field(
|
9029 8944 | self,
|
9030 8945 | path: ::std::string::String,
|
9031 8946 | ) -> crate::model::ValidationExceptionField {
|
9032 8947 | match self {
|
9033 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9034 - | crate::model::ValidationExceptionField {
|
9035 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8948 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8949 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9036 8950 | path,
|
9037 8951 | },
|
9038 - | Self::Member(index, member_constraint_violation) =>
|
9039 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9040 8952 | }
|
9041 8953 | }
|
9042 8954 | }
|
9043 8955 | }
|
9044 - | /// See [`ConBSetInner`](crate::model::ConBSetInner).
|
9045 - | pub mod con_b_set_inner {
|
8956 + | /// See [`FixedValueByte`](crate::model::FixedValueByte).
|
8957 + | pub mod fixed_value_byte {
|
9046 8958 |
|
9047 - | #[allow(clippy::enum_variant_names)]
|
9048 8959 | #[derive(Debug, PartialEq)]
|
9049 8960 | pub enum ConstraintViolation {
|
9050 - | /// Constraint violation error when the list does not contain unique items
|
9051 - | UniqueItems {
|
9052 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9053 - | /// at least two elements.
|
9054 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9055 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9056 - | /// Nothing is guaranteed about the order of the indices.
|
9057 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9058 - | /// The original vector, that contains duplicate items.
|
9059 - | original: ::std::vec::Vec<::std::string::String>,
|
9060 - | },
|
8961 + | Range(i8),
|
9061 8962 | }
|
9062 8963 |
|
9063 8964 | impl ::std::fmt::Display for ConstraintViolation {
|
9064 8965 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9065 - | let message = match self {
|
9066 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9067 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9068 - | };
|
9069 - | write!(f, "{message}")
|
8966 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9070 8967 | }
|
9071 8968 | }
|
9072 8969 |
|
9073 8970 | impl ::std::error::Error for ConstraintViolation {}
|
9074 8971 | impl ConstraintViolation {
|
9075 8972 | pub(crate) fn as_validation_exception_field(
|
9076 8973 | self,
|
9077 8974 | path: ::std::string::String,
|
9078 8975 | ) -> crate::model::ValidationExceptionField {
|
9079 8976 | match self {
|
9080 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9081 - | crate::model::ValidationExceptionField {
|
9082 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8977 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8978 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9083 8979 | path,
|
9084 8980 | },
|
9085 8981 | }
|
9086 8982 | }
|
9087 8983 | }
|
9088 8984 | }
|
9089 8985 | pub mod con_b_list {
|
9090 8986 |
|
9091 8987 | #[allow(clippy::enum_variant_names)]
|
9092 8988 | #[derive(Debug, PartialEq)]
|
9093 8989 | pub enum ConstraintViolation {
|
9094 8990 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9095 8991 | /// The first component of the tuple is the index in the collection where the
|
9096 8992 | /// first constraint violation was found.
|
9097 8993 | #[doc(hidden)]
|
9098 8994 | Member(usize, crate::model::con_b_list_inner::ConstraintViolation),
|
9099 8995 | }
|
9100 8996 |
|
9101 8997 | impl ::std::fmt::Display for ConstraintViolation {
|
9102 8998 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9103 8999 | let message = match self {
|
9104 9000 | Self::Member(index, failing_member) => format!(
|
9105 9001 | "Value at index {index} failed to satisfy constraint. {}",
|
9106 9002 | failing_member
|
9107 9003 | ),
|
9108 9004 | };
|
9109 9005 | write!(f, "{message}")
|
9110 9006 | }
|
9111 9007 | }
|
9112 9008 |
|
9113 9009 | impl ::std::error::Error for ConstraintViolation {}
|
9114 9010 | impl ConstraintViolation {
|
9115 9011 | pub(crate) fn as_validation_exception_field(
|
9116 9012 | self,
|
9117 9013 | path: ::std::string::String,
|
9118 9014 | ) -> crate::model::ValidationExceptionField {
|
9119 9015 | match self {
|
9120 9016 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9121 9017 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9122 9018 | }
|
9123 9019 | }
|
9124 9020 | }
|
9125 9021 | }
|
9126 - | pub mod con_b_list_inner {
|
9022 + | /// See [`LengthList`](crate::model::LengthList).
|
9023 + | pub mod length_list {
|
9127 9024 |
|
9128 9025 | #[allow(clippy::enum_variant_names)]
|
9129 9026 | #[derive(Debug, PartialEq)]
|
9130 9027 | pub enum ConstraintViolation {
|
9131 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9132 - | /// The first component of the tuple is the index in the collection where the
|
9133 - | /// first constraint violation was found.
|
9134 - | #[doc(hidden)]
|
9135 - | Member(usize, crate::model::con_b::ConstraintViolation),
|
9028 + | /// Constraint violation error when the list doesn't have the required length
|
9029 + | Length(usize),
|
9136 9030 | }
|
9137 9031 |
|
9138 9032 | impl ::std::fmt::Display for ConstraintViolation {
|
9139 9033 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9140 9034 | let message = match self {
|
9141 - | Self::Member(index, failing_member) => format!(
|
9142 - | "Value at index {index} failed to satisfy constraint. {}",
|
9143 - | failing_member
|
9144 - | ),
|
9035 + | Self::Length(length) => {
|
9036 + | 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)
|
9037 + | }
|
9145 9038 | };
|
9146 9039 | write!(f, "{message}")
|
9147 9040 | }
|
9148 9041 | }
|
9149 9042 |
|
9150 9043 | impl ::std::error::Error for ConstraintViolation {}
|
9151 9044 | impl ConstraintViolation {
|
9152 9045 | pub(crate) fn as_validation_exception_field(
|
9153 9046 | self,
|
9154 9047 | path: ::std::string::String,
|
9155 9048 | ) -> crate::model::ValidationExceptionField {
|
9156 9049 | match self {
|
9157 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9158 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9050 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9051 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9052 + | path,
|
9053 + | },
|
9159 9054 | }
|
9160 9055 | }
|
9161 9056 | }
|
9162 9057 | }
|
9163 - | /// See [`ConB`](crate::model::ConB).
|
9164 - | pub mod con_b {
|
9058 + | /// See [`SensitiveLengthList`](crate::model::SensitiveLengthList).
|
9059 + | pub mod sensitive_length_list {
|
9165 9060 |
|
9166 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9167 - | /// Holds one variant for each of the ways the builder can fail.
|
9168 - | #[non_exhaustive]
|
9169 9061 | #[allow(clippy::enum_variant_names)]
|
9062 + | #[derive(Debug, PartialEq)]
|
9170 9063 | pub enum ConstraintViolation {
|
9171 - | /// `nice` was not provided but it is required when building `ConB`.
|
9172 - | MissingNice,
|
9173 - | /// `int` was not provided but it is required when building `ConB`.
|
9174 - | MissingInt,
|
9064 + | /// Constraint violation error when the list doesn't have the required length
|
9065 + | Length(usize),
|
9175 9066 | }
|
9067 + |
|
9176 9068 | impl ::std::fmt::Display for ConstraintViolation {
|
9177 9069 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9178 - | match self {
|
9179 - | ConstraintViolation::MissingNice => write!(
|
9180 - | f,
|
9181 - | "`nice` was not provided but it is required when building `ConB`"
|
9182 - | ),
|
9183 - | ConstraintViolation::MissingInt => write!(
|
9184 - | f,
|
9185 - | "`int` was not provided but it is required when building `ConB`"
|
9186 - | ),
|
9070 + | let message = match self {
|
9071 + | Self::Length(length) => {
|
9072 + | 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)
|
9187 9073 | }
|
9074 + | };
|
9075 + | write!(f, "{message}")
|
9188 9076 | }
|
9189 9077 | }
|
9078 + |
|
9190 9079 | impl ::std::error::Error for ConstraintViolation {}
|
9191 9080 | impl ConstraintViolation {
|
9192 9081 | pub(crate) fn as_validation_exception_field(
|
9193 9082 | self,
|
9194 9083 | path: ::std::string::String,
|
9195 9084 | ) -> crate::model::ValidationExceptionField {
|
9196 9085 | match self {
|
9197 - | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
9198 - | message: format!(
|
9199 - | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
9200 - | path
|
9201 - | ),
|
9202 - | path: path + "/nice",
|
9203 - | },
|
9204 - | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
9205 - | message: format!(
|
9206 - | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
9207 - | path
|
9208 - | ),
|
9209 - | path: path + "/int",
|
9086 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9087 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9088 + | path,
|
9210 9089 | },
|
9211 9090 | }
|
9212 9091 | }
|
9213 9092 | }
|
9214 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
9215 - | fn from(builder: Builder) -> Self {
|
9216 - | Self::Unconstrained(builder)
|
9217 - | }
|
9218 - | }
|
9219 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9220 - | type Error = ConstraintViolation;
|
9221 - |
|
9222 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9223 - | builder.build()
|
9224 - | }
|
9225 - | }
|
9226 - | /// A builder for [`ConB`](crate::model::ConB).
|
9227 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9228 - | pub struct Builder {
|
9229 - | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9230 - | pub(crate) int: ::std::option::Option<i32>,
|
9231 - | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9232 - | pub(crate) opt_int: ::std::option::Option<i32>,
|
9233 - | }
|
9234 - | impl Builder {
|
9235 - | #[allow(missing_docs)] // documentation missing in model
|
9236 - | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
9237 - | self.nice = Some(input);
|
9238 - | self
|
9239 - | }
|
9240 - | #[allow(missing_docs)] // documentation missing in model
|
9241 - | pub(crate) fn set_nice(
|
9242 - | mut self,
|
9243 - | input: impl ::std::convert::Into<::std::string::String>,
|
9244 - | ) -> Self {
|
9245 - | self.nice = Some(input.into());
|
9246 - | self
|
9247 - | }
|
9248 - | #[allow(missing_docs)] // documentation missing in model
|
9249 - | pub fn int(mut self, input: i32) -> Self {
|
9250 - | self.int = Some(input);
|
9251 - | self
|
9252 - | }
|
9253 - | #[allow(missing_docs)] // documentation missing in model
|
9254 - | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
9255 - | self.int = Some(input.into());
|
9256 - | self
|
9257 - | }
|
9258 - | #[allow(missing_docs)] // documentation missing in model
|
9259 - | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
9260 - | self.opt_nice = input;
|
9261 - | self
|
9262 - | }
|
9263 - | #[allow(missing_docs)] // documentation missing in model
|
9264 - | pub(crate) fn set_opt_nice(
|
9265 - | mut self,
|
9266 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
9267 - | ) -> Self {
|
9268 - | self.opt_nice = input.map(|v| v.into());
|
9269 - | self
|
9270 - | }
|
9271 - | #[allow(missing_docs)] // documentation missing in model
|
9272 - | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
9273 - | self.opt_int = input;
|
9274 - | self
|
9275 - | }
|
9276 - | #[allow(missing_docs)] // documentation missing in model
|
9277 - | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
9278 - | self.opt_int = input.map(|v| v.into());
|
9279 - | self
|
9280 - | }
|
9281 - | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9282 - | ///
|
9283 - | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
9284 - | ///
|
9285 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
9286 - | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9287 - | self.build_enforcing_all_constraints()
|
9288 - | }
|
9289 - | fn build_enforcing_all_constraints(
|
9290 - | self,
|
9291 - | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9292 - | Ok(crate::model::ConB {
|
9293 - | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9294 - | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9295 - | opt_nice: self.opt_nice,
|
9296 - | opt_int: self.opt_int,
|
9297 - | })
|
9298 - | }
|
9299 - | }
|
9300 9093 | }
|
9301 - | /// See [`SparseLengthList`](crate::model::SparseLengthList).
|
9302 - | pub mod sparse_length_list {
|
9094 + | /// See [`ConBSet`](crate::model::ConBSet).
|
9095 + | pub mod con_b_set {
|
9303 9096 |
|
9304 9097 | #[allow(clippy::enum_variant_names)]
|
9305 9098 | #[derive(Debug, PartialEq)]
|
9306 9099 | pub enum ConstraintViolation {
|
9307 - | /// Constraint violation error when the list doesn't have the required length
|
9308 - | Length(usize),
|
9100 + | /// Constraint violation error when the list does not contain unique items
|
9101 + | UniqueItems {
|
9102 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9103 + | /// at least two elements.
|
9104 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9105 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9106 + | /// Nothing is guaranteed about the order of the indices.
|
9107 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9108 + | /// The original vector, that contains duplicate items.
|
9109 + | original: ::std::vec::Vec<crate::model::ConBSetInner>,
|
9110 + | },
|
9111 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9112 + | /// The first component of the tuple is the index in the collection where the
|
9113 + | /// first constraint violation was found.
|
9114 + | #[doc(hidden)]
|
9115 + | Member(usize, crate::model::con_b_set_inner::ConstraintViolation),
|
9309 9116 | }
|
9310 9117 |
|
9311 9118 | impl ::std::fmt::Display for ConstraintViolation {
|
9312 9119 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9313 9120 | let message = match self {
|
9314 - | Self::Length(length) => {
|
9315 - | 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)
|
9316 - | }
|
9121 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9122 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9123 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9124 + | failing_member)
|
9317 9125 | };
|
9318 9126 | write!(f, "{message}")
|
9319 9127 | }
|
9320 9128 | }
|
9321 9129 |
|
9322 9130 | impl ::std::error::Error for ConstraintViolation {}
|
9323 9131 | impl ConstraintViolation {
|
9324 9132 | pub(crate) fn as_validation_exception_field(
|
9325 9133 | self,
|
9326 9134 | path: ::std::string::String,
|
9327 9135 | ) -> crate::model::ValidationExceptionField {
|
9328 9136 | match self {
|
9329 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9330 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9137 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9138 + | crate::model::ValidationExceptionField {
|
9139 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9331 9140 | path,
|
9332 9141 | },
|
9142 + | Self::Member(index, member_constraint_violation) =>
|
9143 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9333 9144 | }
|
9334 9145 | }
|
9335 9146 | }
|
9336 9147 | }
|
9337 - | /// See [`SparseLengthMap`](crate::model::SparseLengthMap).
|
9338 - | pub mod sparse_length_map {
|
9148 + | /// See [`LengthMap`](crate::model::LengthMap).
|
9149 + | pub mod length_map {
|
9339 9150 |
|
9340 9151 | #[allow(clippy::enum_variant_names)]
|
9341 9152 | #[derive(Debug, PartialEq)]
|
9342 9153 | pub enum ConstraintViolation {
|
9343 9154 | Length(usize),
|
9344 9155 | }
|
9345 9156 |
|
9346 9157 | impl ::std::fmt::Display for ConstraintViolation {
|
9347 9158 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9348 9159 | match self {
|
9349 9160 | Self::Length(length) => {
|
9350 - | 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)
|
9161 + | 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)
|
9351 9162 | }
|
9352 9163 | }
|
9353 9164 | }
|
9354 9165 | }
|
9355 9166 |
|
9356 9167 | impl ::std::error::Error for ConstraintViolation {}
|
9357 9168 | impl ConstraintViolation {
|
9358 9169 | pub(crate) fn as_validation_exception_field(
|
9359 9170 | self,
|
9360 9171 | path: ::std::string::String,
|
9361 9172 | ) -> crate::model::ValidationExceptionField {
|
9362 9173 | match self {
|
9363 9174 | Self::Length(length) => crate::model::ValidationExceptionField {
|
9364 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9175 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9365 9176 | path,
|
9366 9177 | },
|
9367 9178 | }
|
9368 9179 | }
|
9369 9180 | }
|
9370 9181 | }
|
9371 - | pub mod sparse_list {
|
9182 + | pub mod map_of_map_of_list_of_list_of_con_b {
|
9372 9183 |
|
9373 9184 | #[allow(clippy::enum_variant_names)]
|
9374 9185 | #[derive(Debug, PartialEq)]
|
9375 9186 | pub enum ConstraintViolation {
|
9376 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9377 - | /// The first component of the tuple is the index in the collection where the
|
9378 - | /// first constraint violation was found.
|
9379 9187 | #[doc(hidden)]
|
9380 - | Member(usize, crate::model::length_string::ConstraintViolation),
|
9188 + | Value(
|
9189 + | ::std::string::String,
|
9190 + | crate::model::map_of_list_of_list_of_con_b::ConstraintViolation,
|
9191 + | ),
|
9381 9192 | }
|
9382 9193 |
|
9383 9194 | impl ::std::fmt::Display for ConstraintViolation {
|
9384 9195 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9385 - | let message = match self {
|
9386 - | Self::Member(index, failing_member) => format!(
|
9387 - | "Value at index {index} failed to satisfy constraint. {}",
|
9388 - | failing_member
|
9389 - | ),
|
9390 - | };
|
9391 - | write!(f, "{message}")
|
9196 + | match self {
|
9197 + | Self::Value(_, value_constraint_violation) => {
|
9198 + | write!(f, "{}", value_constraint_violation)
|
9199 + | }
|
9200 + | }
|
9392 9201 | }
|
9393 9202 | }
|
9394 9203 |
|
9395 9204 | impl ::std::error::Error for ConstraintViolation {}
|
9396 9205 | impl ConstraintViolation {
|
9397 9206 | pub(crate) fn as_validation_exception_field(
|
9398 9207 | self,
|
9399 9208 | path: ::std::string::String,
|
9400 9209 | ) -> crate::model::ValidationExceptionField {
|
9401 9210 | match self {
|
9402 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9403 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9211 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9212 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9404 9213 | }
|
9405 9214 | }
|
9406 9215 | }
|
9407 9216 | }
|
9408 9217 | pub mod sparse_map {
|
9409 9218 |
|
9410 9219 | #[allow(clippy::enum_variant_names)]
|
9411 9220 | #[derive(Debug, PartialEq)]
|
9412 9221 | pub enum ConstraintViolation {
|
9413 9222 | #[doc(hidden)]
|
9414 9223 | Value(
|
9415 9224 | ::std::string::String,
|
9416 9225 | crate::model::unique_items_list::ConstraintViolation,
|
9417 9226 | ),
|
9418 9227 | }
|
9419 9228 |
|
9420 9229 | impl ::std::fmt::Display for ConstraintViolation {
|
9421 9230 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9422 9231 | match self {
|
9423 9232 | Self::Value(_, value_constraint_violation) => {
|
9424 9233 | write!(f, "{}", value_constraint_violation)
|
9425 9234 | }
|
9426 9235 | }
|
9427 9236 | }
|
9428 9237 | }
|
9429 9238 |
|
9430 9239 | impl ::std::error::Error for ConstraintViolation {}
|
9431 9240 | impl ConstraintViolation {
|
9432 9241 | pub(crate) fn as_validation_exception_field(
|
9433 9242 | self,
|
9434 9243 | path: ::std::string::String,
|
9435 9244 | ) -> crate::model::ValidationExceptionField {
|
9436 9245 | match self {
|
9437 9246 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9438 9247 | .as_validation_exception_field(path + "/" + key.as_str()),
|
9439 9248 | }
|
9440 9249 | }
|
9441 9250 | }
|
9442 9251 | }
|
9443 - | /// See [`UniqueItemsList`](crate::model::UniqueItemsList).
|
9444 - | pub mod unique_items_list {
|
9252 + | pub mod sparse_list {
|
9445 9253 |
|
9446 9254 | #[allow(clippy::enum_variant_names)]
|
9447 9255 | #[derive(Debug, PartialEq)]
|
9448 9256 | pub enum ConstraintViolation {
|
9449 - | /// Constraint violation error when the list does not contain unique items
|
9450 - | UniqueItems {
|
9451 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9452 - | /// at least two elements.
|
9453 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9454 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9455 - | /// Nothing is guaranteed about the order of the indices.
|
9456 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9457 - | /// The original vector, that contains duplicate items.
|
9458 - | original: ::std::vec::Vec<::std::string::String>,
|
9459 - | },
|
9257 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9258 + | /// The first component of the tuple is the index in the collection where the
|
9259 + | /// first constraint violation was found.
|
9260 + | #[doc(hidden)]
|
9261 + | Member(usize, crate::model::length_string::ConstraintViolation),
|
9460 9262 | }
|
9461 9263 |
|
9462 9264 | impl ::std::fmt::Display for ConstraintViolation {
|
9463 9265 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9464 9266 | let message = match self {
|
9465 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9466 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9267 + | Self::Member(index, failing_member) => format!(
|
9268 + | "Value at index {index} failed to satisfy constraint. {}",
|
9269 + | failing_member
|
9270 + | ),
|
9467 9271 | };
|
9468 9272 | write!(f, "{message}")
|
9469 9273 | }
|
9470 9274 | }
|
9471 9275 |
|
9472 9276 | impl ::std::error::Error for ConstraintViolation {}
|
9473 9277 | impl ConstraintViolation {
|
9474 9278 | pub(crate) fn as_validation_exception_field(
|
9475 9279 | self,
|
9476 9280 | path: ::std::string::String,
|
9477 9281 | ) -> crate::model::ValidationExceptionField {
|
9478 9282 | match self {
|
9479 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9480 - | crate::model::ValidationExceptionField {
|
9481 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9482 - | path,
|
9483 - | },
|
9283 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9284 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9484 9285 | }
|
9485 9286 | }
|
9486 9287 | }
|
9487 9288 | }
|
9488 - | pub mod map_of_map_of_list_of_list_of_con_b {
|
9289 + | /// See [`SparseLengthMap`](crate::model::SparseLengthMap).
|
9290 + | pub mod sparse_length_map {
|
9489 9291 |
|
9490 9292 | #[allow(clippy::enum_variant_names)]
|
9491 9293 | #[derive(Debug, PartialEq)]
|
9492 9294 | pub enum ConstraintViolation {
|
9493 - | #[doc(hidden)]
|
9494 - | Value(
|
9495 - | ::std::string::String,
|
9496 - | crate::model::map_of_list_of_list_of_con_b::ConstraintViolation,
|
9497 - | ),
|
9295 + | Length(usize),
|
9498 9296 | }
|
9499 9297 |
|
9500 9298 | impl ::std::fmt::Display for ConstraintViolation {
|
9501 9299 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9502 9300 | match self {
|
9503 - | Self::Value(_, value_constraint_violation) => {
|
9504 - | write!(f, "{}", value_constraint_violation)
|
9301 + | Self::Length(length) => {
|
9302 + | 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)
|
9505 9303 | }
|
9506 9304 | }
|
9507 9305 | }
|
9508 9306 | }
|
9509 9307 |
|
9510 9308 | impl ::std::error::Error for ConstraintViolation {}
|
9511 9309 | impl ConstraintViolation {
|
9512 9310 | pub(crate) fn as_validation_exception_field(
|
9513 9311 | self,
|
9514 9312 | path: ::std::string::String,
|
9515 9313 | ) -> crate::model::ValidationExceptionField {
|
9516 9314 | match self {
|
9517 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9518 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9315 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9316 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9317 + | path,
|
9318 + | },
|
9519 9319 | }
|
9520 9320 | }
|
9521 9321 | }
|
9522 9322 | }
|
9523 - | pub mod map_of_list_of_list_of_con_b {
|
9323 + | /// See [`SparseLengthList`](crate::model::SparseLengthList).
|
9324 + | pub mod sparse_length_list {
|
9524 9325 |
|
9525 9326 | #[allow(clippy::enum_variant_names)]
|
9526 9327 | #[derive(Debug, PartialEq)]
|
9527 9328 | pub enum ConstraintViolation {
|
9528 - | #[doc(hidden)]
|
9529 - | Value(
|
9530 - | ::std::string::String,
|
9531 - | crate::model::con_b_list::ConstraintViolation,
|
9532 - | ),
|
9329 + | /// Constraint violation error when the list doesn't have the required length
|
9330 + | Length(usize),
|
9533 9331 | }
|
9534 9332 |
|
9535 9333 | impl ::std::fmt::Display for ConstraintViolation {
|
9536 9334 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9537 - | match self {
|
9538 - | Self::Value(_, value_constraint_violation) => {
|
9539 - | write!(f, "{}", value_constraint_violation)
|
9540 - | }
|
9335 + | let message = match self {
|
9336 + | Self::Length(length) => {
|
9337 + | 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)
|
9541 9338 | }
|
9339 + | };
|
9340 + | write!(f, "{message}")
|
9542 9341 | }
|
9543 9342 | }
|
9544 9343 |
|
9545 9344 | impl ::std::error::Error for ConstraintViolation {}
|
9546 9345 | impl ConstraintViolation {
|
9547 9346 | pub(crate) fn as_validation_exception_field(
|
9548 9347 | self,
|
9549 9348 | path: ::std::string::String,
|
9550 9349 | ) -> crate::model::ValidationExceptionField {
|
9551 9350 | match self {
|
9552 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9553 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9351 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9352 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9353 + | path,
|
9354 + | },
|
9554 9355 | }
|
9555 9356 | }
|
9556 9357 | }
|
9557 9358 | }
|
9558 - | /// See [`LengthMap`](crate::model::LengthMap).
|
9559 - | pub mod length_map {
|
9359 + | pub mod constrained_union {
|
9560 9360 |
|
9361 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9561 9362 | #[allow(clippy::enum_variant_names)]
|
9562 - | #[derive(Debug, PartialEq)]
|
9563 9363 | pub enum ConstraintViolation {
|
9564 - | Length(usize),
|
9364 + | ConBList(crate::model::con_b_list::ConstraintViolation),
|
9365 + | ConBMap(crate::model::con_b_map::ConstraintViolation),
|
9366 + | ConBSet(crate::model::con_b_set::ConstraintViolation),
|
9367 + | ConstrainedStructure(crate::model::con_b::ConstraintViolation),
|
9368 + | EnumString(crate::model::enum_string::ConstraintViolation),
|
9369 + | LengthString(crate::model::length_string::ConstraintViolation),
|
9565 9370 | }
|
9566 - |
|
9567 9371 | impl ::std::fmt::Display for ConstraintViolation {
|
9568 9372 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9569 9373 | match self {
|
9570 - | Self::Length(length) => {
|
9571 - | 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)
|
9572 - | }
|
9374 + | Self::ConBList(inner) => write!(f, "{inner}"),
|
9375 + | Self::ConBMap(inner) => write!(f, "{inner}"),
|
9376 + | Self::ConBSet(inner) => write!(f, "{inner}"),
|
9377 + | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
9378 + | Self::EnumString(inner) => write!(f, "{inner}"),
|
9379 + | Self::LengthString(inner) => write!(f, "{inner}"),
|
9573 9380 | }
|
9574 9381 | }
|
9575 9382 | }
|
9576 9383 |
|
9577 9384 | impl ::std::error::Error for ConstraintViolation {}
|
9578 9385 | impl ConstraintViolation {
|
9579 9386 | pub(crate) fn as_validation_exception_field(
|
9580 9387 | self,
|
9581 9388 | path: ::std::string::String,
|
9582 9389 | ) -> crate::model::ValidationExceptionField {
|
9583 9390 | match self {
|
9584 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9585 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9586 - | path,
|
9587 - | },
|
9391 + | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
9392 + | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
9393 + | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
9394 + | Self::ConstrainedStructure(inner) => {
|
9395 + | inner.as_validation_exception_field(path + "/constrainedStructure")
|
9396 + | }
|
9397 + | Self::EnumString(inner) => {
|
9398 + | inner.as_validation_exception_field(path + "/enumString")
|
9399 + | }
|
9400 + | Self::LengthString(inner) => {
|
9401 + | inner.as_validation_exception_field(path + "/lengthString")
|
9402 + | }
|
9588 9403 | }
|
9589 9404 | }
|
9590 9405 | }
|
9591 9406 | }
|
9592 - | /// See [`SensitiveLengthList`](crate::model::SensitiveLengthList).
|
9593 - | pub mod sensitive_length_list {
|
9407 + | pub mod list_of_length_blob {
|
9594 9408 |
|
9595 9409 | #[allow(clippy::enum_variant_names)]
|
9596 9410 | #[derive(Debug, PartialEq)]
|
9597 9411 | pub enum ConstraintViolation {
|
9598 - | /// Constraint violation error when the list doesn't have the required length
|
9599 - | Length(usize),
|
9412 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9413 + | /// The first component of the tuple is the index in the collection where the
|
9414 + | /// first constraint violation was found.
|
9415 + | #[doc(hidden)]
|
9416 + | Member(usize, crate::model::length_blob::ConstraintViolation),
|
9600 9417 | }
|
9601 9418 |
|
9602 9419 | impl ::std::fmt::Display for ConstraintViolation {
|
9603 9420 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9604 9421 | let message = match self {
|
9605 - | Self::Length(length) => {
|
9606 - | 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)
|
9607 - | }
|
9422 + | Self::Member(index, failing_member) => format!(
|
9423 + | "Value at index {index} failed to satisfy constraint. {}",
|
9424 + | failing_member
|
9425 + | ),
|
9608 9426 | };
|
9609 9427 | write!(f, "{message}")
|
9610 9428 | }
|
9611 9429 | }
|
9612 9430 |
|
9613 9431 | impl ::std::error::Error for ConstraintViolation {}
|
9614 9432 | impl ConstraintViolation {
|
9615 9433 | pub(crate) fn as_validation_exception_field(
|
9616 9434 | self,
|
9617 9435 | path: ::std::string::String,
|
9618 9436 | ) -> crate::model::ValidationExceptionField {
|
9619 9437 | match self {
|
9620 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9621 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9622 - | path,
|
9623 - | },
|
9438 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9439 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9624 9440 | }
|
9625 9441 | }
|
9626 9442 | }
|
9627 9443 | }
|
9628 - | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9629 - | pub mod sensitive_structure {
|
9444 + | pub mod map_of_length_blob {
|
9630 9445 |
|
9631 - | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
9632 - | fn from(builder: Builder) -> Self {
|
9633 - | builder.build()
|
9446 + | #[allow(clippy::enum_variant_names)]
|
9447 + | #[derive(Debug, PartialEq)]
|
9448 + | pub enum ConstraintViolation {
|
9449 + | #[doc(hidden)]
|
9450 + | Value(
|
9451 + | ::std::string::String,
|
9452 + | crate::model::length_blob::ConstraintViolation,
|
9453 + | ),
|
9454 + | }
|
9455 + |
|
9456 + | impl ::std::fmt::Display for ConstraintViolation {
|
9457 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9458 + | match self {
|
9459 + | Self::Value(_, value_constraint_violation) => {
|
9460 + | write!(f, "{}", value_constraint_violation)
|
9634 9461 | }
|
9635 9462 | }
|
9636 - | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9637 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
9638 - | pub struct Builder {}
|
9639 - | impl Builder {
|
9640 - | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9641 - | pub fn build(self) -> crate::model::SensitiveStructure {
|
9642 - | self.build_enforcing_all_constraints()
|
9643 9463 | }
|
9644 - | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
9645 - | crate::model::SensitiveStructure {}
|
9646 9464 | }
|
9465 + |
|
9466 + | impl ::std::error::Error for ConstraintViolation {}
|
9467 + | impl ConstraintViolation {
|
9468 + | pub(crate) fn as_validation_exception_field(
|
9469 + | self,
|
9470 + | path: ::std::string::String,
|
9471 + | ) -> crate::model::ValidationExceptionField {
|
9472 + | match self {
|
9473 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9474 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9647 9475 | }
|
9648 - | impl ::std::fmt::Debug for Builder {
|
9649 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
9650 - | let mut formatter = f.debug_struct("Builder");
|
9651 - | formatter.finish()
|
9652 9476 | }
|
9653 9477 | }
|
9654 9478 | }
|
9655 - | /// See [`LengthList`](crate::model::LengthList).
|
9656 - | pub mod length_list {
|
9479 + | pub mod map_of_range_integer {
|
9657 9480 |
|
9658 9481 | #[allow(clippy::enum_variant_names)]
|
9659 9482 | #[derive(Debug, PartialEq)]
|
9660 9483 | pub enum ConstraintViolation {
|
9661 - | /// Constraint violation error when the list doesn't have the required length
|
9662 - | Length(usize),
|
9484 + | #[doc(hidden)]
|
9485 + | Value(
|
9486 + | ::std::string::String,
|
9487 + | crate::model::range_integer::ConstraintViolation,
|
9488 + | ),
|
9663 9489 | }
|
9664 9490 |
|
9665 9491 | impl ::std::fmt::Display for ConstraintViolation {
|
9666 9492 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9667 - | let message = match self {
|
9668 - | Self::Length(length) => {
|
9669 - | 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)
|
9493 + | match self {
|
9494 + | Self::Value(_, value_constraint_violation) => {
|
9495 + | write!(f, "{}", value_constraint_violation)
|
9496 + | }
|
9670 9497 | }
|
9671 - | };
|
9672 - | write!(f, "{message}")
|
9673 9498 | }
|
9674 9499 | }
|
9675 9500 |
|
9676 9501 | impl ::std::error::Error for ConstraintViolation {}
|
9677 9502 | impl ConstraintViolation {
|
9678 9503 | pub(crate) fn as_validation_exception_field(
|
9679 9504 | self,
|
9680 9505 | path: ::std::string::String,
|
9681 9506 | ) -> crate::model::ValidationExceptionField {
|
9682 9507 | match self {
|
9683 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9684 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9685 - | path,
|
9686 - | },
|
9508 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9509 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9687 9510 | }
|
9688 9511 | }
|
9689 9512 | }
|
9690 9513 | }
|
9691 - | /// See [`FixedValueByte`](crate::model::FixedValueByte).
|
9692 - | pub mod fixed_value_byte {
|
9514 + | pub mod map_of_range_short {
|
9693 9515 |
|
9516 + | #[allow(clippy::enum_variant_names)]
|
9694 9517 | #[derive(Debug, PartialEq)]
|
9695 9518 | pub enum ConstraintViolation {
|
9696 - | Range(i8),
|
9519 + | #[doc(hidden)]
|
9520 + | Value(
|
9521 + | ::std::string::String,
|
9522 + | crate::model::range_short::ConstraintViolation,
|
9523 + | ),
|
9697 9524 | }
|
9698 9525 |
|
9699 9526 | impl ::std::fmt::Display for ConstraintViolation {
|
9700 9527 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9701 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9528 + | match self {
|
9529 + | Self::Value(_, value_constraint_violation) => {
|
9530 + | write!(f, "{}", value_constraint_violation)
|
9531 + | }
|
9532 + | }
|
9702 9533 | }
|
9703 9534 | }
|
9704 9535 |
|
9705 9536 | impl ::std::error::Error for ConstraintViolation {}
|
9706 9537 | impl ConstraintViolation {
|
9707 9538 | pub(crate) fn as_validation_exception_field(
|
9708 9539 | self,
|
9709 9540 | path: ::std::string::String,
|
9710 9541 | ) -> crate::model::ValidationExceptionField {
|
9711 9542 | match self {
|
9712 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9713 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9714 - | path,
|
9715 - | },
|
9543 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9544 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9716 9545 | }
|
9717 9546 | }
|
9718 9547 | }
|
9719 9548 | }
|
9720 - | /// See [`MaxRangeByte`](crate::model::MaxRangeByte).
|
9721 - | pub mod max_range_byte {
|
9549 + | pub mod map_of_range_long {
|
9722 9550 |
|
9551 + | #[allow(clippy::enum_variant_names)]
|
9723 9552 | #[derive(Debug, PartialEq)]
|
9724 9553 | pub enum ConstraintViolation {
|
9725 - | Range(i8),
|
9554 + | #[doc(hidden)]
|
9555 + | Value(
|
9556 + | ::std::string::String,
|
9557 + | crate::model::range_long::ConstraintViolation,
|
9558 + | ),
|
9726 9559 | }
|
9727 9560 |
|
9728 9561 | impl ::std::fmt::Display for ConstraintViolation {
|
9729 9562 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9730 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
9563 + | match self {
|
9564 + | Self::Value(_, value_constraint_violation) => {
|
9565 + | write!(f, "{}", value_constraint_violation)
|
9566 + | }
|
9567 + | }
|
9731 9568 | }
|
9732 9569 | }
|
9733 9570 |
|
9734 9571 | impl ::std::error::Error for ConstraintViolation {}
|
9735 9572 | impl ConstraintViolation {
|
9736 9573 | pub(crate) fn as_validation_exception_field(
|
9737 9574 | self,
|
9738 9575 | path: ::std::string::String,
|
9739 9576 | ) -> crate::model::ValidationExceptionField {
|
9740 9577 | match self {
|
9741 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9742 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9743 - | path,
|
9744 - | },
|
9578 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9579 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9745 9580 | }
|
9746 9581 | }
|
9747 9582 | }
|
9748 9583 | }
|
9749 - | /// See [`MinRangeByte`](crate::model::MinRangeByte).
|
9750 - | pub mod min_range_byte {
|
9584 + | pub mod map_of_range_byte {
|
9751 9585 |
|
9586 + | #[allow(clippy::enum_variant_names)]
|
9752 9587 | #[derive(Debug, PartialEq)]
|
9753 9588 | pub enum ConstraintViolation {
|
9754 - | Range(i8),
|
9589 + | #[doc(hidden)]
|
9590 + | Value(
|
9591 + | ::std::string::String,
|
9592 + | crate::model::range_byte::ConstraintViolation,
|
9593 + | ),
|
9755 9594 | }
|
9756 9595 |
|
9757 9596 | impl ::std::fmt::Display for ConstraintViolation {
|
9758 9597 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9759 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9598 + | match self {
|
9599 + | Self::Value(_, value_constraint_violation) => {
|
9600 + | write!(f, "{}", value_constraint_violation)
|
9601 + | }
|
9602 + | }
|
9760 9603 | }
|
9761 9604 | }
|
9762 9605 |
|
9763 9606 | impl ::std::error::Error for ConstraintViolation {}
|
9764 9607 | impl ConstraintViolation {
|
9765 9608 | pub(crate) fn as_validation_exception_field(
|
9766 9609 | self,
|
9767 9610 | path: ::std::string::String,
|
9768 9611 | ) -> crate::model::ValidationExceptionField {
|
9769 9612 | match self {
|
9770 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9771 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9772 - | path,
|
9773 - | },
|
9613 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9614 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9774 9615 | }
|
9775 9616 | }
|
9776 9617 | }
|
9777 9618 | }
|
9778 - | /// See [`FixedValueLong`](crate::model::FixedValueLong).
|
9779 - | pub mod fixed_value_long {
|
9619 + | /// See [`PatternString`](crate::model::PatternString).
|
9620 + | pub mod pattern_string {
|
9780 9621 |
|
9781 9622 | #[derive(Debug, PartialEq)]
|
9782 9623 | pub enum ConstraintViolation {
|
9783 - | Range(i64),
|
9624 + | /// Error when a string doesn't satisfy its `@pattern`.
|
9625 + | /// Contains the String that failed the pattern.
|
9626 + | Pattern(String),
|
9784 9627 | }
|
9785 9628 |
|
9786 9629 | impl ::std::fmt::Display for ConstraintViolation {
|
9787 9630 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9788 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9631 + | let message = match self {
|
9632 + | Self::Pattern(_) => {
|
9633 + | format!(
|
9634 + | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
9635 + | r#"[a-d]{5}"#
|
9636 + | )
|
9637 + | }
|
9638 + | };
|
9639 + | write!(f, "{message}")
|
9789 9640 | }
|
9790 9641 | }
|
9791 9642 |
|
9792 9643 | impl ::std::error::Error for ConstraintViolation {}
|
9793 9644 | impl ConstraintViolation {
|
9794 9645 | pub(crate) fn as_validation_exception_field(
|
9795 9646 | self,
|
9796 9647 | path: ::std::string::String,
|
9797 9648 | ) -> crate::model::ValidationExceptionField {
|
9798 9649 | match self {
|
9799 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9800 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9801 - | path,
|
9650 + | #[allow(unused_variables)]
|
9651 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
9652 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
9653 + | path
|
9802 9654 | },
|
9803 9655 | }
|
9804 9656 | }
|
9805 9657 | }
|
9806 9658 | }
|
9807 - | /// See [`MaxRangeLong`](crate::model::MaxRangeLong).
|
9808 - | pub mod max_range_long {
|
9659 + | pub mod list_of_pattern_string {
|
9809 9660 |
|
9661 + | #[allow(clippy::enum_variant_names)]
|
9810 9662 | #[derive(Debug, PartialEq)]
|
9811 9663 | pub enum ConstraintViolation {
|
9812 - | Range(i64),
|
9664 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9665 + | /// The first component of the tuple is the index in the collection where the
|
9666 + | /// first constraint violation was found.
|
9667 + | #[doc(hidden)]
|
9668 + | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
9813 9669 | }
|
9814 9670 |
|
9815 9671 | impl ::std::fmt::Display for ConstraintViolation {
|
9816 9672 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9817 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
9673 + | let message = match self {
|
9674 + | Self::Member(index, failing_member) => format!(
|
9675 + | "Value at index {index} failed to satisfy constraint. {}",
|
9676 + | failing_member
|
9677 + | ),
|
9678 + | };
|
9679 + | write!(f, "{message}")
|
9818 9680 | }
|
9819 9681 | }
|
9820 9682 |
|
9821 9683 | impl ::std::error::Error for ConstraintViolation {}
|
9822 9684 | impl ConstraintViolation {
|
9823 9685 | pub(crate) fn as_validation_exception_field(
|
9824 9686 | self,
|
9825 9687 | path: ::std::string::String,
|
9826 9688 | ) -> crate::model::ValidationExceptionField {
|
9827 9689 | match self {
|
9828 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9829 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9830 - | path,
|
9831 - | },
|
9690 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9691 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9832 9692 | }
|
9833 9693 | }
|
9834 9694 | }
|
9835 9695 | }
|
9836 - | /// See [`MinRangeLong`](crate::model::MinRangeLong).
|
9837 - | pub mod min_range_long {
|
9696 + | /// See [`SetOfPatternString`](crate::model::SetOfPatternString).
|
9697 + | pub mod set_of_pattern_string {
|
9838 9698 |
|
9699 + | #[allow(clippy::enum_variant_names)]
|
9839 9700 | #[derive(Debug, PartialEq)]
|
9840 9701 | pub enum ConstraintViolation {
|
9841 - | Range(i64),
|
9702 + | /// Constraint violation error when the list does not contain unique items
|
9703 + | UniqueItems {
|
9704 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9705 + | /// at least two elements.
|
9706 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9707 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9708 + | /// Nothing is guaranteed about the order of the indices.
|
9709 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9710 + | /// The original vector, that contains duplicate items.
|
9711 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
9712 + | },
|
9713 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9714 + | /// The first component of the tuple is the index in the collection where the
|
9715 + | /// first constraint violation was found.
|
9716 + | #[doc(hidden)]
|
9717 + | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
9842 9718 | }
|
9843 9719 |
|
9844 9720 | impl ::std::fmt::Display for ConstraintViolation {
|
9845 9721 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9846 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9722 + | let message = match self {
|
9723 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9724 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9725 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9726 + | failing_member)
|
9727 + | };
|
9728 + | write!(f, "{message}")
|
9847 9729 | }
|
9848 9730 | }
|
9849 9731 |
|
9850 9732 | impl ::std::error::Error for ConstraintViolation {}
|
9851 9733 | impl ConstraintViolation {
|
9852 9734 | pub(crate) fn as_validation_exception_field(
|
9853 9735 | self,
|
9854 9736 | path: ::std::string::String,
|
9855 9737 | ) -> crate::model::ValidationExceptionField {
|
9856 9738 | match self {
|
9857 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9858 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9739 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9740 + | crate::model::ValidationExceptionField {
|
9741 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9859 9742 | path,
|
9860 9743 | },
|
9744 + | Self::Member(index, member_constraint_violation) =>
|
9745 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9861 9746 | }
|
9862 9747 | }
|
9863 9748 | }
|
9864 9749 | }
|
9865 - | /// See [`FixedValueShort`](crate::model::FixedValueShort).
|
9866 - | pub mod fixed_value_short {
|
9750 + | /// See [`LengthPatternString`](crate::model::LengthPatternString).
|
9751 + | pub mod length_pattern_string {
|
9867 9752 |
|
9868 9753 | #[derive(Debug, PartialEq)]
|
9869 9754 | pub enum ConstraintViolation {
|
9870 - | Range(i16),
|
9755 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
9756 + | Length(usize),
|
9757 + | /// Error when a string doesn't satisfy its `@pattern`.
|
9758 + | /// Contains the String that failed the pattern.
|
9759 + | Pattern(String),
|
9871 9760 | }
|
9872 9761 |
|
9873 9762 | impl ::std::fmt::Display for ConstraintViolation {
|
9874 9763 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9875 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9764 + | let message = match self {
|
9765 + | Self::Length(length) => {
|
9766 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
9767 + | }
|
9768 + | Self::Pattern(_) => {
|
9769 + | format!(
|
9770 + | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
9771 + | r#"[a-f0-5]*"#
|
9772 + | )
|
9773 + | }
|
9774 + | };
|
9775 + | write!(f, "{message}")
|
9876 9776 | }
|
9877 9777 | }
|
9878 9778 |
|
9879 9779 | impl ::std::error::Error for ConstraintViolation {}
|
9880 9780 | impl ConstraintViolation {
|
9881 9781 | pub(crate) fn as_validation_exception_field(
|
9882 9782 | self,
|
9883 9783 | path: ::std::string::String,
|
9884 9784 | ) -> crate::model::ValidationExceptionField {
|
9885 9785 | match self {
|
9886 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9887 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9786 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9787 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
9888 9788 | path,
|
9889 9789 | },
|
9790 + |
|
9791 + | #[allow(unused_variables)]
|
9792 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
9793 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
9794 + | path
|
9795 + | },
|
9890 9796 | }
|
9891 9797 | }
|
9892 9798 | }
|
9893 9799 | }
|
9894 - | /// See [`MaxRangeShort`](crate::model::MaxRangeShort).
|
9895 - | pub mod max_range_short {
|
9800 + | pub mod list_of_length_pattern_string {
|
9896 9801 |
|
9802 + | #[allow(clippy::enum_variant_names)]
|
9897 9803 | #[derive(Debug, PartialEq)]
|
9898 9804 | pub enum ConstraintViolation {
|
9899 - | Range(i16),
|
9805 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9806 + | /// The first component of the tuple is the index in the collection where the
|
9807 + | /// first constraint violation was found.
|
9808 + | #[doc(hidden)]
|
9809 + | Member(
|
9810 + | usize,
|
9811 + | crate::model::length_pattern_string::ConstraintViolation,
|
9812 + | ),
|
9900 9813 | }
|
9901 9814 |
|
9902 9815 | impl ::std::fmt::Display for ConstraintViolation {
|
9903 9816 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9904 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
9817 + | let message = match self {
|
9818 + | Self::Member(index, failing_member) => format!(
|
9819 + | "Value at index {index} failed to satisfy constraint. {}",
|
9820 + | failing_member
|
9821 + | ),
|
9822 + | };
|
9823 + | write!(f, "{message}")
|
9905 9824 | }
|
9906 9825 | }
|
9907 9826 |
|
9908 9827 | impl ::std::error::Error for ConstraintViolation {}
|
9909 9828 | impl ConstraintViolation {
|
9910 9829 | pub(crate) fn as_validation_exception_field(
|
9911 9830 | self,
|
9912 9831 | path: ::std::string::String,
|
9913 9832 | ) -> crate::model::ValidationExceptionField {
|
9914 9833 | match self {
|
9915 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9916 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9917 - | path,
|
9918 - | },
|
9834 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9835 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9919 9836 | }
|
9920 9837 | }
|
9921 9838 | }
|
9922 9839 | }
|
9923 - | /// See [`MinRangeShort`](crate::model::MinRangeShort).
|
9924 - | pub mod min_range_short {
|
9840 + | /// See [`SetOfLengthPatternString`](crate::model::SetOfLengthPatternString).
|
9841 + | pub mod set_of_length_pattern_string {
|
9925 9842 |
|
9843 + | #[allow(clippy::enum_variant_names)]
|
9926 9844 | #[derive(Debug, PartialEq)]
|
9927 9845 | pub enum ConstraintViolation {
|
9928 - | Range(i16),
|
9846 + | /// Constraint violation error when the list does not contain unique items
|
9847 + | UniqueItems {
|
9848 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9849 + | /// at least two elements.
|
9850 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9851 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9852 + | /// Nothing is guaranteed about the order of the indices.
|
9853 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9854 + | /// The original vector, that contains duplicate items.
|
9855 + | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
9856 + | },
|
9857 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9858 + | /// The first component of the tuple is the index in the collection where the
|
9859 + | /// first constraint violation was found.
|
9860 + | #[doc(hidden)]
|
9861 + | Member(
|
9862 + | usize,
|
9863 + | crate::model::length_pattern_string::ConstraintViolation,
|
9864 + | ),
|
9929 9865 | }
|
9930 9866 |
|
9931 9867 | impl ::std::fmt::Display for ConstraintViolation {
|
9932 9868 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9933 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9869 + | let message = match self {
|
9870 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9871 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9872 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9873 + | failing_member)
|
9874 + | };
|
9875 + | write!(f, "{message}")
|
9934 9876 | }
|
9935 9877 | }
|
9936 9878 |
|
9937 9879 | impl ::std::error::Error for ConstraintViolation {}
|
9938 9880 | impl ConstraintViolation {
|
9939 9881 | pub(crate) fn as_validation_exception_field(
|
9940 9882 | self,
|
9941 9883 | path: ::std::string::String,
|
9942 9884 | ) -> crate::model::ValidationExceptionField {
|
9943 9885 | match self {
|
9944 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9945 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9886 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9887 + | crate::model::ValidationExceptionField {
|
9888 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9946 9889 | path,
|
9947 9890 | },
|
9891 + | Self::Member(index, member_constraint_violation) =>
|
9892 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9948 9893 | }
|
9949 9894 | }
|
9950 9895 | }
|
9951 9896 | }
|
9952 - | /// See [`FixedValueInteger`](crate::model::FixedValueInteger).
|
9953 - | pub mod fixed_value_integer {
|
9897 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
9898 + | pub mod validation_exception_field {
|
9954 9899 |
|
9955 - | #[derive(Debug, PartialEq)]
|
9900 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9901 + | /// Holds one variant for each of the ways the builder can fail.
|
9902 + | #[non_exhaustive]
|
9903 + | #[allow(clippy::enum_variant_names)]
|
9956 9904 | pub enum ConstraintViolation {
|
9957 - | Range(i32),
|
9905 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
9906 + | MissingPath,
|
9907 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
9908 + | MissingMessage,
|
9958 9909 | }
|
9959 - |
|
9960 9910 | impl ::std::fmt::Display for ConstraintViolation {
|
9961 9911 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9962 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
9912 + | match self {
|
9913 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
9914 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
9915 + | }
|
9963 9916 | }
|
9964 9917 | }
|
9965 - |
|
9966 9918 | impl ::std::error::Error for ConstraintViolation {}
|
9967 - | impl ConstraintViolation {
|
9968 - | pub(crate) fn as_validation_exception_field(
|
9969 - | self,
|
9970 - | path: ::std::string::String,
|
9971 - | ) -> crate::model::ValidationExceptionField {
|
9972 - | match self {
|
9973 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9974 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
9975 - | path,
|
9976 - | },
|
9919 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
9920 + | type Error = ConstraintViolation;
|
9921 + |
|
9922 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9923 + | builder.build()
|
9924 + | }
|
9925 + | }
|
9926 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
9927 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9928 + | pub struct Builder {
|
9929 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
9930 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
9931 + | }
|
9932 + | impl Builder {
|
9933 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9934 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
9935 + | self.path = Some(input);
|
9936 + | self
|
9937 + | }
|
9938 + | /// A detailed description of the validation failure.
|
9939 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
9940 + | self.message = Some(input);
|
9941 + | self
|
9942 + | }
|
9943 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
9944 + | ///
|
9945 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
9946 + | ///
|
9947 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
9948 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
9949 + | self.build_enforcing_all_constraints()
|
9977 9950 | }
|
9951 + | fn build_enforcing_all_constraints(
|
9952 + | self,
|
9953 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
9954 + | Ok(crate::model::ValidationExceptionField {
|
9955 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
9956 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
9957 + | })
|
9978 9958 | }
|
9979 9959 | }
|
9980 9960 | }
|
9981 - | /// See [`MaxRangeInteger`](crate::model::MaxRangeInteger).
|
9982 - | pub mod max_range_integer {
|
9961 + | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
9962 + | pub mod transitively_constrained_structure_in_output {
|
9983 9963 |
|
9984 - | #[derive(Debug, PartialEq)]
|
9985 - | pub enum ConstraintViolation {
|
9986 - | Range(i32),
|
9964 + | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
9965 + | fn from(builder: Builder) -> Self {
|
9966 + | builder.build()
|
9987 9967 | }
|
9988 - |
|
9989 - | impl ::std::fmt::Display for ConstraintViolation {
|
9990 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9991 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
9992 9968 | }
|
9969 + | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
9970 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9971 + | pub struct Builder {
|
9972 + | pub(crate) length_string: ::std::option::Option<crate::model::LengthString>,
|
9993 9973 | }
|
9994 - |
|
9995 - | impl ::std::error::Error for ConstraintViolation {}
|
9996 - | impl ConstraintViolation {
|
9997 - | pub(crate) fn as_validation_exception_field(
|
9974 + | impl Builder {
|
9975 + | #[allow(missing_docs)] // documentation missing in model
|
9976 + | pub fn length_string(
|
9977 + | mut self,
|
9978 + | input: ::std::option::Option<crate::model::LengthString>,
|
9979 + | ) -> Self {
|
9980 + | self.length_string = input;
|
9981 + | self
|
9982 + | }
|
9983 + | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
9984 + | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
9985 + | self.build_enforcing_all_constraints()
|
9986 + | }
|
9987 + | fn build_enforcing_all_constraints(
|
9998 9988 | self,
|
9999 - | path: ::std::string::String,
|
10000 - | ) -> crate::model::ValidationExceptionField {
|
10001 - | match self {
|
10002 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10003 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
10004 - | path,
|
10005 - | },
|
9989 + | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
9990 + | crate::model::TransitivelyConstrainedStructureInOutput {
|
9991 + | length_string: self.length_string,
|
10006 9992 | }
|
10007 9993 | }
|
10008 9994 | }
|
10009 9995 | }
|
10010 - | /// See [`MinRangeInteger`](crate::model::MinRangeInteger).
|
10011 - | pub mod min_range_integer {
|
9996 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
9997 + | pub mod recursive_shapes_input_output_nested2 {
|
10012 9998 |
|
10013 - | #[derive(Debug, PartialEq)]
|
9999 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10000 + | /// Holds one variant for each of the ways the builder can fail.
|
10001 + | #[non_exhaustive]
|
10002 + | #[allow(clippy::enum_variant_names)]
|
10014 10003 | pub enum ConstraintViolation {
|
10015 - | Range(i32),
|
10004 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
10005 + | #[doc(hidden)]
|
10006 + | RecursiveMember(crate::model::recursive_shapes_input_output_nested1::ConstraintViolation),
|
10016 10007 | }
|
10017 - |
|
10018 10008 | impl ::std::fmt::Display for ConstraintViolation {
|
10019 10009 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10020 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10010 + | match self {
|
10011 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
10012 + | }
|
10021 10013 | }
|
10022 10014 | }
|
10023 - |
|
10024 10015 | impl ::std::error::Error for ConstraintViolation {}
|
10025 10016 | impl ConstraintViolation {
|
10026 10017 | pub(crate) fn as_validation_exception_field(
|
10027 10018 | self,
|
10028 10019 | path: ::std::string::String,
|
10029 10020 | ) -> crate::model::ValidationExceptionField {
|
10030 10021 | match self {
|
10031 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10032 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10033 - | path,
|
10034 - | },
|
10022 + | ConstraintViolation::RecursiveMember(inner) => {
|
10023 + | inner.as_validation_exception_field(path + "/recursiveMember")
|
10035 10024 | }
|
10036 10025 | }
|
10037 10026 | }
|
10038 - | }
|
10039 - | /// See [`FixedLengthBlob`](crate::model::FixedLengthBlob).
|
10040 - | pub mod fixed_length_blob {
|
10027 + | }
|
10028 + | impl ::std::convert::From<Builder>
|
10029 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
10030 + | {
|
10031 + | fn from(builder: Builder) -> Self {
|
10032 + | Self::Unconstrained(builder)
|
10033 + | }
|
10034 + | }
|
10035 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
10036 + | type Error = ConstraintViolation;
|
10041 10037 |
|
10042 - | #[derive(Debug, PartialEq)]
|
10043 - | pub enum ConstraintViolation {
|
10044 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10045 - | Length(usize),
|
10038 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
10039 + | builder.build()
|
10040 + | }
|
10041 + | }
|
10042 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10043 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10044 + | pub struct Builder {
|
10045 + | pub(crate) recursive_member: ::std::option::Option<
|
10046 + | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
10047 + | >,
|
10048 + | }
|
10049 + | impl Builder {
|
10050 + | #[allow(missing_docs)] // documentation missing in model
|
10051 + | pub fn recursive_member(
|
10052 + | mut self,
|
10053 + | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
10054 + | ) -> Self {
|
10055 + | self.recursive_member = input.map(crate::constrained::MaybeConstrained::Constrained);
|
10056 + | self
|
10046 10057 | }
|
10058 + | #[allow(missing_docs)] // documentation missing in model
|
10059 + | pub(crate) fn set_recursive_member(
|
10060 + | mut self,
|
10061 + | input: Option<
|
10062 + | impl ::std::convert::Into<
|
10063 + | crate::constrained::MaybeConstrained<
|
10064 + | crate::model::RecursiveShapesInputOutputNested1,
|
10065 + | >,
|
10066 + | >,
|
10067 + | >,
|
10068 + | ) -> Self {
|
10069 + | self.recursive_member = input.map(|v| v.into());
|
10070 + | self
|
10071 + | }
|
10072 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10073 + | ///
|
10074 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
10075 + | ///
|
10076 + | pub fn build(
|
10077 + | self,
|
10078 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
10079 + | self.build_enforcing_all_constraints()
|
10080 + | }
|
10081 + | fn build_enforcing_all_constraints(
|
10082 + | self,
|
10083 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
10084 + | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
10085 + | recursive_member: self
|
10086 + | .recursive_member
|
10087 + | .map(|v| match v {
|
10088 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
10089 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
10090 + | })
|
10091 + | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
10092 + | .transpose()?,
|
10093 + | })
|
10094 + | }
|
10095 + | }
|
10096 + | }
|
10097 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10098 + | pub mod event_stream_regular_message {
|
10047 10099 |
|
10048 - | impl ::std::fmt::Display for ConstraintViolation {
|
10049 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10050 - | let message = match self {
|
10051 - | Self::Length(length) => {
|
10052 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
10100 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
10101 + | fn from(builder: Builder) -> Self {
|
10102 + | builder.build()
|
10103 + | }
|
10104 + | }
|
10105 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10106 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10107 + | pub struct Builder {
|
10108 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
10109 + | }
|
10110 + | impl Builder {
|
10111 + | #[allow(missing_docs)] // documentation missing in model
|
10112 + | pub fn message_content(
|
10113 + | mut self,
|
10114 + | input: ::std::option::Option<::std::string::String>,
|
10115 + | ) -> Self {
|
10116 + | self.message_content = input;
|
10117 + | self
|
10053 10118 | }
|
10054 - | };
|
10055 - | write!(f, "{message}")
|
10119 + | #[allow(missing_docs)] // documentation missing in model
|
10120 + | pub(crate) fn set_message_content(
|
10121 + | mut self,
|
10122 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
10123 + | ) -> Self {
|
10124 + | self.message_content = input.map(|v| v.into());
|
10125 + | self
|
10056 10126 | }
|
10127 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10128 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
10129 + | self.build_enforcing_all_constraints()
|
10057 10130 | }
|
10058 - |
|
10059 - | impl ::std::error::Error for ConstraintViolation {}
|
10060 - | impl ConstraintViolation {
|
10061 - | pub(crate) fn as_validation_exception_field(
|
10062 - | self,
|
10063 - | path: ::std::string::String,
|
10064 - | ) -> crate::model::ValidationExceptionField {
|
10065 - | match self {
|
10066 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10067 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
10068 - | path,
|
10069 - | },
|
10131 + | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
10132 + | crate::model::EventStreamRegularMessage {
|
10133 + | message_content: self.message_content,
|
10070 10134 | }
|
10071 10135 | }
|
10072 10136 | }
|
10073 10137 | }
|
10074 - | /// See [`MaxLengthBlob`](crate::model::MaxLengthBlob).
|
10075 - | pub mod max_length_blob {
|
10138 + | pub mod con_b_list_inner {
|
10076 10139 |
|
10140 + | #[allow(clippy::enum_variant_names)]
|
10077 10141 | #[derive(Debug, PartialEq)]
|
10078 10142 | pub enum ConstraintViolation {
|
10079 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10080 - | Length(usize),
|
10143 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10144 + | /// The first component of the tuple is the index in the collection where the
|
10145 + | /// first constraint violation was found.
|
10146 + | #[doc(hidden)]
|
10147 + | Member(usize, crate::model::con_b::ConstraintViolation),
|
10081 10148 | }
|
10082 10149 |
|
10083 10150 | impl ::std::fmt::Display for ConstraintViolation {
|
10084 10151 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10085 10152 | let message = match self {
|
10086 - | Self::Length(length) => {
|
10087 - | 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)
|
10088 - | }
|
10153 + | Self::Member(index, failing_member) => format!(
|
10154 + | "Value at index {index} failed to satisfy constraint. {}",
|
10155 + | failing_member
|
10156 + | ),
|
10089 10157 | };
|
10090 10158 | write!(f, "{message}")
|
10091 10159 | }
|
10092 10160 | }
|
10093 10161 |
|
10094 10162 | impl ::std::error::Error for ConstraintViolation {}
|
10095 10163 | impl ConstraintViolation {
|
10096 10164 | pub(crate) fn as_validation_exception_field(
|
10097 10165 | self,
|
10098 10166 | path: ::std::string::String,
|
10099 10167 | ) -> crate::model::ValidationExceptionField {
|
10100 10168 | match self {
|
10101 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10102 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
10103 - | path,
|
10104 - | },
|
10169 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10170 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10105 10171 | }
|
10106 10172 | }
|
10107 10173 | }
|
10108 10174 | }
|
10109 - | /// See [`MinLengthBlob`](crate::model::MinLengthBlob).
|
10110 - | pub mod min_length_blob {
|
10175 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10176 + | pub mod sensitive_structure {
|
10111 10177 |
|
10112 - | #[derive(Debug, PartialEq)]
|
10113 - | pub enum ConstraintViolation {
|
10114 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10115 - | Length(usize),
|
10178 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
10179 + | fn from(builder: Builder) -> Self {
|
10180 + | builder.build()
|
10116 10181 | }
|
10117 - |
|
10118 - | impl ::std::fmt::Display for ConstraintViolation {
|
10119 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10120 - | let message = match self {
|
10121 - | Self::Length(length) => {
|
10122 - | 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)
|
10123 10182 | }
|
10124 - | };
|
10125 - | write!(f, "{message}")
|
10183 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10184 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
10185 + | pub struct Builder {}
|
10186 + | impl Builder {
|
10187 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10188 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
10189 + | self.build_enforcing_all_constraints()
|
10126 10190 | }
|
10191 + | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
10192 + | crate::model::SensitiveStructure {}
|
10127 10193 | }
|
10128 - |
|
10129 - | impl ::std::error::Error for ConstraintViolation {}
|
10130 - | impl ConstraintViolation {
|
10131 - | pub(crate) fn as_validation_exception_field(
|
10132 - | self,
|
10133 - | path: ::std::string::String,
|
10134 - | ) -> crate::model::ValidationExceptionField {
|
10135 - | match self {
|
10136 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10137 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10138 - | path,
|
10139 - | },
|
10140 10194 | }
|
10195 + | impl ::std::fmt::Debug for Builder {
|
10196 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
10197 + | let mut formatter = f.debug_struct("Builder");
|
10198 + | formatter.finish()
|
10141 10199 | }
|
10142 10200 | }
|
10143 10201 | }
|
10144 - | /// See [`FixedLengthString`](crate::model::FixedLengthString).
|
10145 - | pub mod fixed_length_string {
|
10202 + | /// See [`ConBSetInner`](crate::model::ConBSetInner).
|
10203 + | pub mod con_b_set_inner {
|
10146 10204 |
|
10205 + | #[allow(clippy::enum_variant_names)]
|
10147 10206 | #[derive(Debug, PartialEq)]
|
10148 10207 | pub enum ConstraintViolation {
|
10149 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10150 - | Length(usize),
|
10208 + | /// Constraint violation error when the list does not contain unique items
|
10209 + | UniqueItems {
|
10210 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10211 + | /// at least two elements.
|
10212 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10213 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10214 + | /// Nothing is guaranteed about the order of the indices.
|
10215 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10216 + | /// The original vector, that contains duplicate items.
|
10217 + | original: ::std::vec::Vec<::std::string::String>,
|
10218 + | },
|
10151 10219 | }
|
10152 10220 |
|
10153 10221 | impl ::std::fmt::Display for ConstraintViolation {
|
10154 10222 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10155 10223 | let message = match self {
|
10156 - | Self::Length(length) => {
|
10157 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
10158 - | }
|
10224 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10225 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10159 10226 | };
|
10160 10227 | write!(f, "{message}")
|
10161 10228 | }
|
10162 10229 | }
|
10163 10230 |
|
10164 10231 | impl ::std::error::Error for ConstraintViolation {}
|
10165 10232 | impl ConstraintViolation {
|
10166 10233 | pub(crate) fn as_validation_exception_field(
|
10167 10234 | self,
|
10168 10235 | path: ::std::string::String,
|
10169 10236 | ) -> crate::model::ValidationExceptionField {
|
10170 10237 | match self {
|
10171 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10172 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
10238 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10239 + | crate::model::ValidationExceptionField {
|
10240 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10173 10241 | path,
|
10174 10242 | },
|
10175 10243 | }
|
10176 10244 | }
|
10177 10245 | }
|
10178 10246 | }
|
10179 - | /// See [`MaxLengthString`](crate::model::MaxLengthString).
|
10180 - | pub mod max_length_string {
|
10247 + | pub mod map_of_list_of_list_of_con_b {
|
10181 10248 |
|
10249 + | #[allow(clippy::enum_variant_names)]
|
10182 10250 | #[derive(Debug, PartialEq)]
|
10183 10251 | pub enum ConstraintViolation {
|
10184 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10185 - | Length(usize),
|
10252 + | #[doc(hidden)]
|
10253 + | Value(
|
10254 + | ::std::string::String,
|
10255 + | crate::model::con_b_list::ConstraintViolation,
|
10256 + | ),
|
10186 10257 | }
|
10187 10258 |
|
10188 10259 | impl ::std::fmt::Display for ConstraintViolation {
|
10189 10260 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10190 - | let message = match self {
|
10191 - | Self::Length(length) => {
|
10192 - | 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)
|
10261 + | match self {
|
10262 + | Self::Value(_, value_constraint_violation) => {
|
10263 + | write!(f, "{}", value_constraint_violation)
|
10264 + | }
|
10193 10265 | }
|
10194 - | };
|
10195 - | write!(f, "{message}")
|
10196 10266 | }
|
10197 10267 | }
|
10198 10268 |
|
10199 10269 | impl ::std::error::Error for ConstraintViolation {}
|
10200 10270 | impl ConstraintViolation {
|
10201 10271 | pub(crate) fn as_validation_exception_field(
|
10202 10272 | self,
|
10203 10273 | path: ::std::string::String,
|
10204 10274 | ) -> crate::model::ValidationExceptionField {
|
10205 10275 | match self {
|
10206 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10207 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10208 - | path,
|
10209 - | },
|
10276 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10277 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10210 10278 | }
|
10211 10279 | }
|
10212 10280 | }
|
10213 10281 | }
|
10214 - | /// See [`MinLengthString`](crate::model::MinLengthString).
|
10215 - | pub mod min_length_string {
|
10282 + | /// See [`UniqueItemsList`](crate::model::UniqueItemsList).
|
10283 + | pub mod unique_items_list {
|
10216 10284 |
|
10285 + | #[allow(clippy::enum_variant_names)]
|
10217 10286 | #[derive(Debug, PartialEq)]
|
10218 10287 | pub enum ConstraintViolation {
|
10219 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10220 - | Length(usize),
|
10288 + | /// Constraint violation error when the list does not contain unique items
|
10289 + | UniqueItems {
|
10290 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10291 + | /// at least two elements.
|
10292 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10293 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10294 + | /// Nothing is guaranteed about the order of the indices.
|
10295 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10296 + | /// The original vector, that contains duplicate items.
|
10297 + | original: ::std::vec::Vec<::std::string::String>,
|
10298 + | },
|
10221 10299 | }
|
10222 10300 |
|
10223 10301 | impl ::std::fmt::Display for ConstraintViolation {
|
10224 10302 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10225 10303 | let message = match self {
|
10226 - | Self::Length(length) => {
|
10227 - | 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)
|
10228 - | }
|
10304 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10305 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10229 10306 | };
|
10230 10307 | write!(f, "{message}")
|
10231 10308 | }
|
10232 10309 | }
|
10233 10310 |
|
10234 10311 | impl ::std::error::Error for ConstraintViolation {}
|
10235 10312 | impl ConstraintViolation {
|
10236 10313 | pub(crate) fn as_validation_exception_field(
|
10237 10314 | self,
|
10238 10315 | path: ::std::string::String,
|
10239 10316 | ) -> crate::model::ValidationExceptionField {
|
10240 10317 | match self {
|
10241 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10242 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10318 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10319 + | crate::model::ValidationExceptionField {
|
10320 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10243 10321 | path,
|
10244 10322 | },
|
10245 10323 | }
|
10246 10324 | }
|
10247 10325 | }
|
10248 10326 | }
|
10249 - | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10250 - | pub mod transitively_constrained_structure_in_output {
|
10251 - |
|
10252 - | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
10253 - | fn from(builder: Builder) -> Self {
|
10254 - | builder.build()
|
10255 - | }
|
10256 - | }
|
10257 - | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10258 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10259 - | pub struct Builder {
|
10260 - | pub(crate) length_string: ::std::option::Option<crate::model::LengthString>,
|
10261 - | }
|
10262 - | impl Builder {
|
10263 - | #[allow(missing_docs)] // documentation missing in model
|
10264 - | pub fn length_string(
|
10265 - | mut self,
|
10266 - | input: ::std::option::Option<crate::model::LengthString>,
|
10267 - | ) -> Self {
|
10268 - | self.length_string = input;
|
10269 - | self
|
10270 - | }
|
10271 - | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10272 - | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10273 - | self.build_enforcing_all_constraints()
|
10274 - | }
|
10275 - | fn build_enforcing_all_constraints(
|
10276 - | self,
|
10277 - | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10278 - | crate::model::TransitivelyConstrainedStructureInOutput {
|
10279 - | length_string: self.length_string,
|
10280 - | }
|
10281 - | }
|
10282 - | }
|
10283 - | }
|
10284 - | /// See [`ConstrainedMapInOutput`](crate::model::ConstrainedMapInOutput).
|
10285 - | pub mod constrained_map_in_output {
|
10286 - |
|
10287 - | #[allow(clippy::enum_variant_names)]
|
10288 - | #[derive(Debug, PartialEq)]
|
10289 - | pub enum ConstraintViolation {
|
10290 - | Length(usize),
|
10291 - | }
|
10292 - |
|
10293 - | impl ::std::fmt::Display for ConstraintViolation {
|
10294 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10295 - | match self {
|
10296 - | Self::Length(length) => {
|
10297 - | 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)
|
10298 - | }
|
10299 - | }
|
10300 - | }
|
10301 - | }
|
10302 - |
|
10303 - | impl ::std::error::Error for ConstraintViolation {}
|
10304 - | }
|
10305 - | /// See [`ConstrainedListInOutput`](crate::model::ConstrainedListInOutput).
|
10306 - | pub mod constrained_list_in_output {
|
10307 - |
|
10308 - | #[allow(clippy::enum_variant_names)]
|
10309 - | #[derive(Debug, PartialEq)]
|
10310 - | pub enum ConstraintViolation {
|
10311 - | /// Constraint violation error when the list doesn't have the required length
|
10312 - | Length(usize),
|
10313 - | }
|
10314 - |
|
10315 - | impl ::std::fmt::Display for ConstraintViolation {
|
10316 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10317 - | let message = match self {
|
10318 - | Self::Length(length) => {
|
10319 - | 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)
|
10320 - | }
|
10321 - | };
|
10322 - | write!(f, "{message}")
|
10323 - | }
|
10324 - | }
|
10325 - |
|
10326 - | impl ::std::error::Error for ConstraintViolation {}
|
10327 - | }
|