1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[::pyo3::pyclass]
|
3 - | /// :param path str:
|
4 - | /// :param message str:
|
3 + | /// :param con_b constraints_without_public_constrained_types.model.ConB:
|
4 + | /// :param range_integer int:
|
5 + | /// :param min_range_integer int:
|
6 + | /// :param max_range_integer int:
|
7 + | /// :param fixed_value_integer int:
|
8 + | /// :param range_short int:
|
9 + | /// :param min_range_short int:
|
10 + | /// :param max_range_short int:
|
11 + | /// :param fixed_value_short int:
|
12 + | /// :param range_long int:
|
13 + | /// :param min_range_long int:
|
14 + | /// :param max_range_long int:
|
15 + | /// :param fixed_value_long int:
|
16 + | /// :param range_byte int:
|
17 + | /// :param min_range_byte int:
|
18 + | /// :param max_range_byte int:
|
19 + | /// :param fixed_value_byte int:
|
20 + | /// :param opt_con_b typing.Optional\[constraints_without_public_constrained_types.model.ConB\]:
|
21 + | /// :param length_string typing.Optional\[str\]:
|
22 + | /// :param min_length_string typing.Optional\[str\]:
|
23 + | /// :param max_length_string typing.Optional\[str\]:
|
24 + | /// :param fixed_length_string typing.Optional\[str\]:
|
25 + | /// :param length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
26 + | /// :param min_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
27 + | /// :param max_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
28 + | /// :param fixed_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
29 + | /// :param con_b_list typing.Optional\[typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]:
|
30 + | /// :param length_list typing.Optional\[typing.List\[str\]\]:
|
31 + | /// :param sensitive_length_list typing.Optional\[typing.List\[constraints_without_public_constrained_types.model.SensitiveStructure\]\]:
|
32 + | /// :param con_b_set typing.Optional\[typing.List\[typing.Set\[str\]\]\]:
|
33 + | /// :param con_b_map typing.Optional\[typing.Dict\[str, str\]\]:
|
34 + | /// :param length_map typing.Optional\[typing.Dict\[str, str\]\]:
|
35 + | /// :param map_of_map_of_list_of_list_of_con_b typing.Optional\[typing.Dict\[str, typing.Dict\[str, typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]\]\]:
|
36 + | /// :param sparse_map typing.Optional\[typing.Dict\[str, typing.Optional\[typing.List\[str\]\]\]\]:
|
37 + | /// :param sparse_list typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
38 + | /// :param sparse_length_map typing.Optional\[typing.Dict\[str, typing.Optional\[str\]\]\]:
|
39 + | /// :param sparse_length_list typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
40 + | /// :param constrained_union typing.Optional\[constraints_without_public_constrained_types.model.ConstrainedUnion\]:
|
41 + | /// :param enum_string typing.Optional\[constraints_without_public_constrained_types.model.EnumString\]:
|
42 + | /// :param list_of_length_string typing.Optional\[typing.List\[str\]\]:
|
43 + | /// :param set_of_length_string typing.Optional\[typing.Set\[str\]\]:
|
44 + | /// :param map_of_length_string typing.Optional\[typing.Dict\[str, str\]\]:
|
45 + | /// :param list_of_length_blob typing.Optional\[typing.List\[constraints_without_public_constrained_types.types.Blob\]\]:
|
46 + | /// :param map_of_length_blob typing.Optional\[typing.Dict\[str, constraints_without_public_constrained_types.types.Blob\]\]:
|
47 + | /// :param list_of_range_integer typing.Optional\[typing.List\[int\]\]:
|
48 + | /// :param set_of_range_integer typing.Optional\[typing.List\[int\]\]:
|
49 + | /// :param map_of_range_integer typing.Optional\[typing.Dict\[str, int\]\]:
|
50 + | /// :param list_of_range_short typing.Optional\[typing.List\[int\]\]:
|
51 + | /// :param set_of_range_short typing.Optional\[typing.List\[int\]\]:
|
52 + | /// :param map_of_range_short typing.Optional\[typing.Dict\[str, int\]\]:
|
53 + | /// :param list_of_range_long typing.Optional\[typing.List\[int\]\]:
|
54 + | /// :param set_of_range_long typing.Optional\[typing.List\[int\]\]:
|
55 + | /// :param map_of_range_long typing.Optional\[typing.Dict\[str, int\]\]:
|
56 + | /// :param list_of_range_byte typing.Optional\[typing.List\[int\]\]:
|
57 + | /// :param set_of_range_byte typing.Optional\[typing.List\[int\]\]:
|
58 + | /// :param map_of_range_byte typing.Optional\[typing.Dict\[str, int\]\]:
|
59 + | /// :param non_streaming_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
60 + | /// :param pattern_string typing.Optional\[str\]:
|
61 + | /// :param map_of_pattern_string typing.Optional\[typing.Dict\[str, str\]\]:
|
62 + | /// :param list_of_pattern_string typing.Optional\[typing.List\[str\]\]:
|
63 + | /// :param set_of_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
64 + | /// :param length_length_pattern_string typing.Optional\[str\]:
|
65 + | /// :param map_of_length_pattern_string typing.Optional\[typing.Dict\[str, str\]\]:
|
66 + | /// :param list_of_length_pattern_string typing.Optional\[typing.List\[str\]\]:
|
67 + | /// :param set_of_length_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
68 + | /// :param length_list_of_pattern_string typing.Optional\[typing.List\[str\]\]:
|
69 + | /// :param length_set_of_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
5 70 | /// :rtype None:
|
6 - | /// Describes one specific validation failure for an input member.
|
7 - | #[derive(
|
8 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
9 - | )]
|
10 - | pub struct ValidationExceptionField {
|
71 + | #[allow(missing_docs)] // documentation missing in model
|
72 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
73 + | pub struct ConA {
|
11 74 | #[pyo3(get, set)]
|
12 - | /// :type str:
|
13 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
14 - | pub path: ::std::string::String,
|
75 + | /// :type constraints_without_public_constrained_types.model.ConB:
|
76 + | #[allow(missing_docs)] // documentation missing in model
|
77 + | pub con_b: crate::model::ConB,
|
15 78 | #[pyo3(get, set)]
|
16 - | /// :type str:
|
17 - | /// A detailed description of the validation failure.
|
18 - | pub message: ::std::string::String,
|
19 - | }
|
20 - | impl ValidationExceptionField {
|
21 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
22 - | pub fn path(&self) -> &str {
|
23 - | use std::ops::Deref;
|
24 - | self.path.deref()
|
25 - | }
|
26 - | /// A detailed description of the validation failure.
|
27 - | pub fn message(&self) -> &str {
|
28 - | use std::ops::Deref;
|
29 - | self.message.deref()
|
30 - | }
|
31 - | }
|
32 - | #[allow(clippy::new_without_default)]
|
33 - | #[allow(clippy::too_many_arguments)]
|
34 - | #[::pyo3::pymethods]
|
35 - | impl ValidationExceptionField {
|
36 - | #[new]
|
37 - | pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
|
38 - | Self { path, message }
|
39 - | }
|
40 - | fn __repr__(&self) -> String {
|
41 - | format!("{self:?}")
|
42 - | }
|
43 - | fn __str__(&self) -> String {
|
44 - | format!("{self:?}")
|
45 - | }
|
46 - | }
|
47 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
|
48 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
49 - | ob.extract::<ValidationExceptionField>().map(Box::new)
|
50 - | }
|
51 - | }
|
52 - |
|
53 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
|
54 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
55 - | (*self).into_py(py)
|
56 - | }
|
57 - | }
|
58 - | impl ValidationExceptionField {
|
59 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
60 - | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
61 - | crate::model::validation_exception_field::Builder::default()
|
62 - | }
|
63 - | }
|
64 - |
|
65 - | #[allow(missing_docs)] // documentation missing in model
|
66 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
67 - | pub enum Event {
|
79 + | /// :type typing.Optional\[constraints_without_public_constrained_types.model.ConB\]:
|
68 80 | #[allow(missing_docs)] // documentation missing in model
|
69 - | RegularMessage(crate::model::EventStreamRegularMessage),
|
70 - | }
|
71 - | impl Event {
|
72 - | #[allow(irrefutable_let_patterns)]
|
73 - | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
74 - | /// Returns `Err(&Self)` if it can't be converted.
|
75 - | pub fn as_regular_message(
|
76 - | &self,
|
77 - | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
78 - | if let Event::RegularMessage(val) = &self {
|
79 - | ::std::result::Result::Ok(val)
|
80 - | } else {
|
81 - | ::std::result::Result::Err(self)
|
82 - | }
|
83 - | }
|
84 - | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
85 - | pub fn is_regular_message(&self) -> bool {
|
86 - | self.as_regular_message().is_ok()
|
87 - | }
|
88 - | }
|
89 - | #[pyo3::pyclass(name = "Event")]
|
90 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
91 - | pub struct PyUnionMarkerEvent(pub Event);
|
92 - | #[::pyo3::pymethods]
|
93 - | impl PyUnionMarkerEvent {
|
94 - | #[allow(irrefutable_let_patterns)]
|
95 - | #[staticmethod]
|
96 - | /// Creates a new union instance of [`RegularMessage`](crate::model::Event::RegularMessage)
|
97 - | /// :param data constraints_without_public_constrained_types.model.EventStreamRegularMessage:
|
98 - | /// :rtype Event:
|
99 - | pub fn regular_message(data: crate::model::EventStreamRegularMessage) -> Self {
|
100 - | Self(Event::RegularMessage(data))
|
101 - | }
|
102 - | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
103 - | /// :rtype constraints_without_public_constrained_types.model.EventStreamRegularMessage:
|
104 - | pub fn as_regular_message(&self) -> ::pyo3::PyResult<crate::model::EventStreamRegularMessage> {
|
105 - | match self.0.as_regular_message() {
|
106 - | Ok(variant) => Ok(variant.clone()),
|
107 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
108 - | r"Event variant is not of type constraints_without_public_constrained_types.model.EventStreamRegularMessage",
|
109 - | )),
|
110 - | }
|
111 - | }
|
112 - | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
113 - | /// :rtype bool:
|
114 - | pub fn is_regular_message(&self) -> bool {
|
115 - | self.0.is_regular_message()
|
116 - | }
|
117 - | }
|
118 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for Event {
|
119 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
120 - | PyUnionMarkerEvent(self).into_py(py)
|
121 - | }
|
122 - | }
|
123 - | impl<'source> ::pyo3::FromPyObject<'source> for Event {
|
124 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
125 - | let data: PyUnionMarkerEvent = obj.extract()?;
|
126 - | Ok(data.0)
|
127 - | }
|
128 - | }
|
129 - |
|
130 - | #[::pyo3::pyclass]
|
131 - | /// :param message_content typing.Optional\[str\]:
|
132 - | /// :rtype None:
|
133 - | #[allow(missing_docs)] // documentation missing in model
|
134 - | #[derive(
|
135 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
136 - | )]
|
137 - | pub struct EventStreamRegularMessage {
|
81 + | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
138 82 | #[pyo3(get, set)]
|
139 83 | /// :type typing.Optional\[str\]:
|
140 84 | #[allow(missing_docs)] // documentation missing in model
|
141 - | pub message_content: ::std::option::Option<::std::string::String>,
|
142 - | }
|
143 - | impl EventStreamRegularMessage {
|
85 + | pub length_string: ::std::option::Option<::std::string::String>,
|
86 + | #[pyo3(get, set)]
|
87 + | /// :type typing.Optional\[str\]:
|
144 88 | #[allow(missing_docs)] // documentation missing in model
|
145 - | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
146 - | self.message_content.as_deref()
|
147 - | }
|
148 - | }
|
149 - | #[allow(clippy::new_without_default)]
|
150 - | #[allow(clippy::too_many_arguments)]
|
151 - | #[::pyo3::pymethods]
|
152 - | impl EventStreamRegularMessage {
|
153 - | #[new]
|
154 - | pub fn new(message_content: ::std::option::Option<::std::string::String>) -> Self {
|
155 - | Self { message_content }
|
156 - | }
|
157 - | fn __repr__(&self) -> String {
|
158 - | format!("{self:?}")
|
159 - | }
|
160 - | fn __str__(&self) -> String {
|
161 - | format!("{self:?}")
|
162 - | }
|
163 - | }
|
164 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<EventStreamRegularMessage> {
|
165 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
166 - | ob.extract::<EventStreamRegularMessage>().map(Box::new)
|
167 - | }
|
168 - | }
|
169 - |
|
170 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<EventStreamRegularMessage> {
|
171 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
172 - | (*self).into_py(py)
|
173 - | }
|
174 - | }
|
175 - | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
176 - | type Unconstrained = crate::model::event_stream_regular_message_internal::Builder;
|
177 - | }
|
178 - | impl EventStreamRegularMessage {
|
179 - | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
180 - | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
181 - | crate::model::event_stream_regular_message::Builder::default()
|
182 - | }
|
183 - | }
|
184 - |
|
185 - | #[::pyo3::pyclass]
|
186 - | #[allow(missing_docs)] // documentation missing in model
|
187 - | #[derive(
|
188 - | ::std::clone::Clone,
|
189 - | ::std::cmp::Eq,
|
190 - | ::std::cmp::Ord,
|
191 - | ::std::cmp::PartialEq,
|
192 - | ::std::cmp::PartialOrd,
|
193 - | ::std::fmt::Debug,
|
194 - | ::std::hash::Hash,
|
195 - | )]
|
196 - | pub enum EnumString {
|
89 + | pub min_length_string: ::std::option::Option<::std::string::String>,
|
90 + | #[pyo3(get, set)]
|
91 + | /// :type typing.Optional\[str\]:
|
197 92 | #[allow(missing_docs)] // documentation missing in model
|
198 - | M256Mega,
|
93 + | pub max_length_string: ::std::option::Option<::std::string::String>,
|
94 + | #[pyo3(get, set)]
|
95 + | /// :type typing.Optional\[str\]:
|
199 96 | #[allow(missing_docs)] // documentation missing in model
|
200 - | T2Micro,
|
97 + | pub fixed_length_string: ::std::option::Option<::std::string::String>,
|
98 + | #[pyo3(get, set)]
|
99 + | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
201 100 | #[allow(missing_docs)] // documentation missing in model
|
202 - | T2Nano,
|
203 - | }
|
204 - | pub(crate) mod enum_string_internal {
|
205 - | #[derive(Debug, PartialEq)]
|
206 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
207 - |
|
208 - | impl ::std::fmt::Display for ConstraintViolation {
|
209 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
210 - | write!(
|
211 - | f,
|
212 - | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
213 - | )
|
214 - | }
|
215 - | }
|
216 - |
|
217 - | impl ::std::error::Error for ConstraintViolation {}
|
218 - | impl ConstraintViolation {
|
219 - | pub(crate) fn as_validation_exception_field(
|
220 - | self,
|
221 - | path: ::std::string::String,
|
222 - | ) -> crate::model::ValidationExceptionField {
|
223 - | crate::model::ValidationExceptionField {
|
224 - | message: format!(
|
225 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
226 - | &path
|
227 - | ),
|
228 - | path,
|
229 - | }
|
230 - | }
|
231 - | }
|
232 - | }
|
233 - | impl ::std::convert::TryFrom<&str> for EnumString {
|
234 - | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
235 - | fn try_from(
|
236 - | s: &str,
|
237 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
238 - | match s {
|
239 - | "m256.mega" => Ok(EnumString::M256Mega),
|
240 - | "t2.micro" => Ok(EnumString::T2Micro),
|
241 - | "t2.nano" => Ok(EnumString::T2Nano),
|
242 - | _ => Err(crate::model::enum_string_internal::ConstraintViolation(
|
243 - | s.to_owned(),
|
244 - | )),
|
245 - | }
|
246 - | }
|
247 - | }
|
248 - | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
249 - | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
250 - | fn try_from(
|
251 - | s: ::std::string::String,
|
252 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
253 - | {
|
254 - | s.as_str().try_into()
|
255 - | }
|
256 - | }
|
257 - | impl std::str::FromStr for EnumString {
|
258 - | type Err = crate::model::enum_string_internal::ConstraintViolation;
|
259 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
260 - | Self::try_from(s)
|
261 - | }
|
262 - | }
|
263 - | impl EnumString {
|
264 - | /// Returns the `&str` value of the enum member.
|
265 - | pub fn as_str(&self) -> &str {
|
266 - | match self {
|
267 - | EnumString::M256Mega => "m256.mega",
|
268 - | EnumString::T2Micro => "t2.micro",
|
269 - | EnumString::T2Nano => "t2.nano",
|
270 - | }
|
271 - | }
|
272 - | /// Returns all the `&str` representations of the enum members.
|
273 - | pub const fn values() -> &'static [&'static str] {
|
274 - | &["m256.mega", "t2.micro", "t2.nano"]
|
275 - | }
|
276 - | }
|
277 - | impl ::std::convert::AsRef<str> for EnumString {
|
278 - | fn as_ref(&self) -> &str {
|
279 - | self.as_str()
|
280 - | }
|
281 - | }
|
282 - | #[::pyo3::pymethods]
|
283 - | impl EnumString {
|
284 - | #[getter]
|
285 - | pub fn name(&self) -> &str {
|
286 - | match self {
|
287 - | EnumString::M256Mega => "M256Mega",
|
288 - | EnumString::T2Micro => "T2Micro",
|
289 - | EnumString::T2Nano => "T2Nano",
|
290 - | }
|
291 - | }
|
292 - | #[getter]
|
293 - | pub fn value(&self) -> &str {
|
294 - | self.as_str()
|
295 - | }
|
296 - | fn __repr__(&self) -> String {
|
297 - | self.as_str().to_owned()
|
298 - | }
|
299 - | fn __str__(&self) -> String {
|
300 - | self.as_str().to_owned()
|
301 - | }
|
302 - | }
|
303 - | impl crate::constrained::Constrained for EnumString {
|
304 - | type Unconstrained = ::std::string::String;
|
305 - | }
|
306 - |
|
307 - | impl ::std::convert::From<::std::string::String>
|
308 - | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
309 - | {
|
310 - | fn from(value: ::std::string::String) -> Self {
|
311 - | Self::Unconstrained(value)
|
312 - | }
|
313 - | }
|
314 - |
|
315 - | #[allow(missing_docs)] // documentation missing in model
|
316 - | ///
|
317 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
318 - | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
319 - | ///
|
320 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
321 - | ///
|
322 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
323 - | pub(crate) struct ConBMap(
|
324 - | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
325 - | );
|
326 - | impl ConBMap {
|
327 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
328 - | pub fn into_inner(
|
329 - | self,
|
330 - | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
331 - | self.0
|
332 - | }
|
333 - | }
|
334 - | impl
|
335 - | ::std::convert::TryFrom<
|
336 - | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
337 - | > for ConBMap
|
338 - | {
|
339 - | type Error = crate::model::con_b_map_internal::ConstraintViolation;
|
340 - |
|
341 - | /// 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.
|
342 - | fn try_from(
|
343 - | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
344 - | ) -> ::std::result::Result<Self, Self::Error> {
|
345 - | let length = value.len();
|
346 - | if (1..=69).contains(&length) {
|
347 - | Ok(Self(value))
|
348 - | } else {
|
349 - | Err(crate::model::con_b_map_internal::ConstraintViolation::Length(length))
|
350 - | }
|
351 - | }
|
352 - | }
|
353 - |
|
354 - | impl ::std::convert::From<ConBMap>
|
355 - | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
356 - | {
|
357 - | fn from(value: ConBMap) -> Self {
|
358 - | value.into_inner()
|
359 - | }
|
360 - | }
|
361 - | impl ::std::convert::From<ConBMap>
|
362 - | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
363 - | {
|
364 - | fn from(value: ConBMap) -> Self {
|
365 - | value
|
366 - | .into_inner()
|
367 - | .into_iter()
|
368 - | .map(|(k, v)| (k, v.into()))
|
369 - | .collect()
|
370 - | }
|
371 - | }
|
372 - | impl crate::constrained::Constrained for ConBMap {
|
373 - | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
374 - | }
|
375 - |
|
376 - | #[allow(missing_docs)] // documentation missing in model
|
377 - | ///
|
378 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
379 - | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
380 - | ///
|
381 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
382 - | ///
|
383 - | #[derive(
|
384 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
385 - | )]
|
386 - | pub(crate) struct LengthString(pub(crate) ::std::string::String);
|
387 - | #[allow(dead_code)]
|
388 - | impl LengthString {
|
389 - | /// Extracts a string slice containing the entire underlying `String`.
|
390 - | pub fn as_str(&self) -> &str {
|
391 - | &self.0
|
392 - | }
|
393 - |
|
394 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
395 - | pub fn inner(&self) -> &::std::string::String {
|
396 - | &self.0
|
397 - | }
|
398 - |
|
399 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
400 - | pub fn into_inner(self) -> ::std::string::String {
|
401 - | self.0
|
402 - | }
|
403 - | }
|
404 - | impl LengthString {
|
405 - | fn check_length(
|
406 - | string: &str,
|
407 - | ) -> ::std::result::Result<(), crate::model::length_string_internal::ConstraintViolation> {
|
408 - | let length = string.chars().count();
|
409 - |
|
410 - | if (2..=69).contains(&length) {
|
411 - | Ok(())
|
412 - | } else {
|
413 - | Err(crate::model::length_string_internal::ConstraintViolation::Length(length))
|
414 - | }
|
415 - | }
|
416 - | }
|
417 - | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
418 - | type Error = crate::model::length_string_internal::ConstraintViolation;
|
419 - |
|
420 - | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
421 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
422 - | Self::check_length(&value)?;
|
423 - |
|
424 - | Ok(Self(value))
|
425 - | }
|
426 - | }
|
427 - | impl crate::constrained::Constrained for LengthString {
|
428 - | type Unconstrained = ::std::string::String;
|
429 - | }
|
430 - |
|
431 - | impl ::std::convert::From<::std::string::String>
|
432 - | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
433 - | {
|
434 - | fn from(value: ::std::string::String) -> Self {
|
435 - | Self::Unconstrained(value)
|
436 - | }
|
437 - | }
|
438 - |
|
439 - | impl ::std::fmt::Display for LengthString {
|
440 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
441 - | self.0.fmt(f)
|
442 - | }
|
443 - | }
|
444 - |
|
445 - | impl ::std::convert::From<LengthString> for ::std::string::String {
|
446 - | fn from(value: LengthString) -> Self {
|
447 - | value.into_inner()
|
448 - | }
|
449 - | }
|
450 - |
|
451 - | #[allow(missing_docs)] // documentation missing in model
|
452 - | ///
|
453 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
454 - | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
455 - | ///
|
456 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
457 - | ///
|
458 - | #[derive(
|
459 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
460 - | )]
|
461 - | pub(crate) struct LengthPatternString(pub(crate) ::std::string::String);
|
462 - | #[allow(dead_code)]
|
463 - | impl LengthPatternString {
|
464 - | /// Extracts a string slice containing the entire underlying `String`.
|
465 - | pub fn as_str(&self) -> &str {
|
466 - | &self.0
|
467 - | }
|
468 - |
|
469 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
470 - | pub fn inner(&self) -> &::std::string::String {
|
471 - | &self.0
|
472 - | }
|
473 - |
|
474 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
475 - | pub fn into_inner(self) -> ::std::string::String {
|
476 - | self.0
|
477 - | }
|
478 - | }
|
479 - | impl LengthPatternString {
|
480 - | fn check_length(
|
481 - | string: &str,
|
482 - | ) -> ::std::result::Result<(), crate::model::length_pattern_string_internal::ConstraintViolation>
|
483 - | {
|
484 - | let length = string.chars().count();
|
485 - |
|
486 - | if (5..=10).contains(&length) {
|
487 - | Ok(())
|
488 - | } else {
|
489 - | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Length(length))
|
490 - | }
|
491 - | }
|
492 - |
|
493 - | fn check_pattern(
|
494 - | string: ::std::string::String,
|
495 - | ) -> ::std::result::Result<
|
101 + | pub length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
102 + | #[pyo3(get, set)]
|
103 + | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
104 + | #[allow(missing_docs)] // documentation missing in model
|
105 + | pub min_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
106 + | #[pyo3(get, set)]
|
107 + | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
108 + | #[allow(missing_docs)] // documentation missing in model
|
109 + | pub max_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
110 + | #[pyo3(get, set)]
|
111 + | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
112 + | #[allow(missing_docs)] // documentation missing in model
|
113 + | pub fixed_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
114 + | #[pyo3(get, set)]
|
115 + | /// :type int:
|
116 + | #[allow(missing_docs)] // documentation missing in model
|
117 + | pub range_integer: i32,
|
118 + | #[pyo3(get, set)]
|
119 + | /// :type int:
|
120 + | #[allow(missing_docs)] // documentation missing in model
|
121 + | pub min_range_integer: i32,
|
122 + | #[pyo3(get, set)]
|
123 + | /// :type int:
|
124 + | #[allow(missing_docs)] // documentation missing in model
|
125 + | pub max_range_integer: i32,
|
126 + | #[pyo3(get, set)]
|
127 + | /// :type int:
|
128 + | #[allow(missing_docs)] // documentation missing in model
|
129 + | pub fixed_value_integer: i32,
|
130 + | #[pyo3(get, set)]
|
131 + | /// :type int:
|
132 + | #[allow(missing_docs)] // documentation missing in model
|
133 + | pub range_short: i16,
|
134 + | #[pyo3(get, set)]
|
135 + | /// :type int:
|
136 + | #[allow(missing_docs)] // documentation missing in model
|
137 + | pub min_range_short: i16,
|
138 + | #[pyo3(get, set)]
|
139 + | /// :type int:
|
140 + | #[allow(missing_docs)] // documentation missing in model
|
141 + | pub max_range_short: i16,
|
142 + | #[pyo3(get, set)]
|
143 + | /// :type int:
|
144 + | #[allow(missing_docs)] // documentation missing in model
|
145 + | pub fixed_value_short: i16,
|
146 + | #[pyo3(get, set)]
|
147 + | /// :type int:
|
148 + | #[allow(missing_docs)] // documentation missing in model
|
149 + | pub range_long: i64,
|
150 + | #[pyo3(get, set)]
|
151 + | /// :type int:
|
152 + | #[allow(missing_docs)] // documentation missing in model
|
153 + | pub min_range_long: i64,
|
154 + | #[pyo3(get, set)]
|
155 + | /// :type int:
|
156 + | #[allow(missing_docs)] // documentation missing in model
|
157 + | pub max_range_long: i64,
|
158 + | #[pyo3(get, set)]
|
159 + | /// :type int:
|
160 + | #[allow(missing_docs)] // documentation missing in model
|
161 + | pub fixed_value_long: i64,
|
162 + | #[pyo3(get, set)]
|
163 + | /// :type int:
|
164 + | #[allow(missing_docs)] // documentation missing in model
|
165 + | pub range_byte: i8,
|
166 + | #[pyo3(get, set)]
|
167 + | /// :type int:
|
168 + | #[allow(missing_docs)] // documentation missing in model
|
169 + | pub min_range_byte: i8,
|
170 + | #[pyo3(get, set)]
|
171 + | /// :type int:
|
172 + | #[allow(missing_docs)] // documentation missing in model
|
173 + | pub max_range_byte: i8,
|
174 + | #[pyo3(get, set)]
|
175 + | /// :type int:
|
176 + | #[allow(missing_docs)] // documentation missing in model
|
177 + | pub fixed_value_byte: i8,
|
178 + | #[pyo3(get, set)]
|
179 + | /// :type typing.Optional\[typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]:
|
180 + | #[allow(missing_docs)] // documentation missing in model
|
181 + | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
182 + | #[pyo3(get, set)]
|
183 + | /// :type typing.Optional\[typing.List\[str\]\]:
|
184 + | #[allow(missing_docs)] // documentation missing in model
|
185 + | pub length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
186 + | #[pyo3(get, set)]
|
187 + | /// :type typing.Optional\[typing.List\[constraints_without_public_constrained_types.model.SensitiveStructure\]\]:
|
188 + | #[allow(missing_docs)] // documentation missing in model
|
189 + | pub sensitive_length_list:
|
190 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
191 + | #[pyo3(get, set)]
|
192 + | /// :type typing.Optional\[typing.List\[typing.Set\[str\]\]\]:
|
193 + | #[allow(missing_docs)] // documentation missing in model
|
194 + | pub con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
195 + | #[pyo3(get, set)]
|
196 + | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
197 + | #[allow(missing_docs)] // documentation missing in model
|
198 + | pub con_b_map: ::std::option::Option<
|
199 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
200 + | >,
|
201 + | #[pyo3(get, set)]
|
202 + | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
203 + | #[allow(missing_docs)] // documentation missing in model
|
204 + | pub length_map: ::std::option::Option<
|
205 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
206 + | >,
|
207 + | #[pyo3(get, set)]
|
208 + | /// :type typing.Optional\[typing.Dict\[str, typing.Dict\[str, typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]\]\]:
|
209 + | #[allow(missing_docs)] // documentation missing in model
|
210 + | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
211 + | ::std::collections::HashMap<
|
496 212 | ::std::string::String,
|
497 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
498 - | > {
|
499 - | let regex = Self::compile_regex();
|
500 - |
|
501 - | if regex.is_match(&string) {
|
502 - | Ok(string)
|
503 - | } else {
|
504 - | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Pattern(string))
|
505 - | }
|
506 - | }
|
507 - |
|
508 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
509 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
510 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
511 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
512 - | ::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"#)
|
513 - | });
|
514 - |
|
515 - | ®EX
|
516 - | }
|
517 - | }
|
518 - | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
519 - | type Error = crate::model::length_pattern_string_internal::ConstraintViolation;
|
520 - |
|
521 - | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
522 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
523 - | Self::check_length(&value)?;
|
524 - |
|
525 - | let value = Self::check_pattern(value)?;
|
526 - |
|
527 - | Ok(Self(value))
|
528 - | }
|
529 - | }
|
530 - | impl crate::constrained::Constrained for LengthPatternString {
|
531 - | type Unconstrained = ::std::string::String;
|
532 - | }
|
533 - |
|
534 - | impl ::std::convert::From<::std::string::String>
|
535 - | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
536 - | {
|
537 - | fn from(value: ::std::string::String) -> Self {
|
538 - | Self::Unconstrained(value)
|
539 - | }
|
540 - | }
|
541 - |
|
542 - | impl ::std::fmt::Display for LengthPatternString {
|
543 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
544 - | self.0.fmt(f)
|
545 - | }
|
546 - | }
|
547 - |
|
548 - | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
549 - | fn from(value: LengthPatternString) -> Self {
|
550 - | value.into_inner()
|
551 - | }
|
552 - | }
|
553 - |
|
554 - | #[cfg(test)]
|
555 - | mod test_length_pattern_string {
|
556 - | #[test]
|
557 - | fn regex_compiles() {
|
558 - | crate::model::LengthPatternString::compile_regex();
|
559 - | }
|
560 - | }
|
561 - |
|
562 - | #[allow(missing_docs)] // documentation missing in model
|
563 - | ///
|
564 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
565 - | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
566 - | ///
|
567 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
568 - | ///
|
569 - | #[derive(
|
570 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
571 - | )]
|
572 - | pub(crate) struct PatternString(pub(crate) ::std::string::String);
|
573 - | #[allow(dead_code)]
|
574 - | impl PatternString {
|
575 - | /// Extracts a string slice containing the entire underlying `String`.
|
576 - | pub fn as_str(&self) -> &str {
|
577 - | &self.0
|
578 - | }
|
579 - |
|
580 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
581 - | pub fn inner(&self) -> &::std::string::String {
|
582 - | &self.0
|
583 - | }
|
584 - |
|
585 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
586 - | pub fn into_inner(self) -> ::std::string::String {
|
587 - | self.0
|
588 - | }
|
589 - | }
|
590 - | impl PatternString {
|
591 - | fn check_pattern(
|
592 - | string: ::std::string::String,
|
593 - | ) -> ::std::result::Result<
|
213 + | ::std::collections::HashMap<
|
594 214 | ::std::string::String,
|
595 - | crate::model::pattern_string_internal::ConstraintViolation,
|
596 - | > {
|
597 - | let regex = Self::compile_regex();
|
598 - |
|
599 - | if regex.is_match(&string) {
|
600 - | Ok(string)
|
601 - | } else {
|
602 - | Err(crate::model::pattern_string_internal::ConstraintViolation::Pattern(string))
|
215 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
216 + | >,
|
217 + | >,
|
218 + | >,
|
219 + | #[pyo3(get, set)]
|
220 + | /// :type typing.Optional\[typing.Dict\[str, typing.Optional\[typing.List\[str\]\]\]\]:
|
221 + | #[allow(missing_docs)] // documentation missing in model
|
222 + | pub sparse_map: ::std::option::Option<
|
223 + | ::std::collections::HashMap<
|
224 + | ::std::string::String,
|
225 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
226 + | >,
|
227 + | >,
|
228 + | #[pyo3(get, set)]
|
229 + | /// :type typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
230 + | #[allow(missing_docs)] // documentation missing in model
|
231 + | pub sparse_list:
|
232 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
233 + | #[pyo3(get, set)]
|
234 + | /// :type typing.Optional\[typing.Dict\[str, typing.Optional\[str\]\]\]:
|
235 + | #[allow(missing_docs)] // documentation missing in model
|
236 + | pub sparse_length_map: ::std::option::Option<
|
237 + | ::std::collections::HashMap<
|
238 + | ::std::string::String,
|
239 + | ::std::option::Option<::std::string::String>,
|
240 + | >,
|
241 + | >,
|
242 + | #[pyo3(get, set)]
|
243 + | /// :type typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
244 + | #[allow(missing_docs)] // documentation missing in model
|
245 + | pub sparse_length_list:
|
246 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
247 + | #[pyo3(get, set)]
|
248 + | /// :type typing.Optional\[constraints_without_public_constrained_types.model.ConstrainedUnion\]:
|
249 + | /// A union with constrained members.
|
250 + | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
251 + | #[pyo3(get, set)]
|
252 + | /// :type typing.Optional\[constraints_without_public_constrained_types.model.EnumString\]:
|
253 + | #[allow(missing_docs)] // documentation missing in model
|
254 + | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
255 + | #[pyo3(get, set)]
|
256 + | /// :type typing.Optional\[typing.List\[str\]\]:
|
257 + | #[allow(missing_docs)] // documentation missing in model
|
258 + | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
259 + | #[pyo3(get, set)]
|
260 + | /// :type typing.Optional\[typing.Set\[str\]\]:
|
261 + | #[allow(missing_docs)] // documentation missing in model
|
262 + | pub set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
263 + | #[pyo3(get, set)]
|
264 + | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
265 + | #[allow(missing_docs)] // documentation missing in model
|
266 + | pub map_of_length_string: ::std::option::Option<
|
267 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
268 + | >,
|
269 + | #[pyo3(get, set)]
|
270 + | /// :type typing.Optional\[typing.List\[constraints_without_public_constrained_types.types.Blob\]\]:
|
271 + | #[allow(missing_docs)] // documentation missing in model
|
272 + | pub list_of_length_blob:
|
273 + | ::std::option::Option<::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>>,
|
274 + | #[pyo3(get, set)]
|
275 + | /// :type typing.Optional\[typing.Dict\[str, constraints_without_public_constrained_types.types.Blob\]\]:
|
276 + | #[allow(missing_docs)] // documentation missing in model
|
277 + | pub map_of_length_blob: ::std::option::Option<
|
278 + | ::std::collections::HashMap<
|
279 + | ::std::string::String,
|
280 + | ::aws_smithy_http_server_python::types::Blob,
|
281 + | >,
|
282 + | >,
|
283 + | #[pyo3(get, set)]
|
284 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
285 + | #[allow(missing_docs)] // documentation missing in model
|
286 + | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
287 + | #[pyo3(get, set)]
|
288 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | pub set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
291 + | #[pyo3(get, set)]
|
292 + | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
293 + | #[allow(missing_docs)] // documentation missing in model
|
294 + | pub map_of_range_integer:
|
295 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
296 + | #[pyo3(get, set)]
|
297 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
298 + | #[allow(missing_docs)] // documentation missing in model
|
299 + | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
300 + | #[pyo3(get, set)]
|
301 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
302 + | #[allow(missing_docs)] // documentation missing in model
|
303 + | pub set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
304 + | #[pyo3(get, set)]
|
305 + | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
306 + | #[allow(missing_docs)] // documentation missing in model
|
307 + | pub map_of_range_short:
|
308 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
309 + | #[pyo3(get, set)]
|
310 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
311 + | #[allow(missing_docs)] // documentation missing in model
|
312 + | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
313 + | #[pyo3(get, set)]
|
314 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
315 + | #[allow(missing_docs)] // documentation missing in model
|
316 + | pub set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
317 + | #[pyo3(get, set)]
|
318 + | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub map_of_range_long:
|
321 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
322 + | #[pyo3(get, set)]
|
323 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
324 + | #[allow(missing_docs)] // documentation missing in model
|
325 + | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
326 + | #[pyo3(get, set)]
|
327 + | /// :type typing.Optional\[typing.List\[int\]\]:
|
328 + | #[allow(missing_docs)] // documentation missing in model
|
329 + | pub set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
330 + | #[pyo3(get, set)]
|
331 + | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
332 + | #[allow(missing_docs)] // documentation missing in model
|
333 + | pub map_of_range_byte:
|
334 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
335 + | #[pyo3(get, set)]
|
336 + | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
337 + | #[allow(missing_docs)] // documentation missing in model
|
338 + | pub non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
339 + | #[pyo3(get, set)]
|
340 + | /// :type typing.Optional\[str\]:
|
341 + | #[allow(missing_docs)] // documentation missing in model
|
342 + | pub pattern_string: ::std::option::Option<::std::string::String>,
|
343 + | #[pyo3(get, set)]
|
344 + | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
345 + | #[allow(missing_docs)] // documentation missing in model
|
346 + | pub map_of_pattern_string: ::std::option::Option<
|
347 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
348 + | >,
|
349 + | #[pyo3(get, set)]
|
350 + | /// :type typing.Optional\[typing.List\[str\]\]:
|
351 + | #[allow(missing_docs)] // documentation missing in model
|
352 + | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
353 + | #[pyo3(get, set)]
|
354 + | /// :type typing.Optional\[typing.Set\[str\]\]:
|
355 + | #[allow(missing_docs)] // documentation missing in model
|
356 + | pub set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
357 + | #[pyo3(get, set)]
|
358 + | /// :type typing.Optional\[str\]:
|
359 + | #[allow(missing_docs)] // documentation missing in model
|
360 + | pub length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
361 + | #[pyo3(get, set)]
|
362 + | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
363 + | #[allow(missing_docs)] // documentation missing in model
|
364 + | pub map_of_length_pattern_string: ::std::option::Option<
|
365 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
366 + | >,
|
367 + | #[pyo3(get, set)]
|
368 + | /// :type typing.Optional\[typing.List\[str\]\]:
|
369 + | #[allow(missing_docs)] // documentation missing in model
|
370 + | pub list_of_length_pattern_string:
|
371 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
372 + | #[pyo3(get, set)]
|
373 + | /// :type typing.Optional\[typing.Set\[str\]\]:
|
374 + | #[allow(missing_docs)] // documentation missing in model
|
375 + | pub set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
376 + | #[pyo3(get, set)]
|
377 + | /// :type typing.Optional\[typing.List\[str\]\]:
|
378 + | #[allow(missing_docs)] // documentation missing in model
|
379 + | pub length_list_of_pattern_string:
|
380 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
381 + | #[pyo3(get, set)]
|
382 + | /// :type typing.Optional\[typing.Set\[str\]\]:
|
383 + | #[allow(missing_docs)] // documentation missing in model
|
384 + | pub length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
385 + | }
|
386 + | impl ConA {
|
387 + | #[allow(missing_docs)] // documentation missing in model
|
388 + | pub fn con_b(&self) -> &crate::model::ConB {
|
389 + | &self.con_b
|
603 390 | }
|
391 + | #[allow(missing_docs)] // documentation missing in model
|
392 + | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
393 + | self.opt_con_b.as_ref()
|
604 394 | }
|
605 - |
|
606 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
607 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
608 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
609 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
610 - | ::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"#)
|
611 - | });
|
612 - |
|
613 - | ®EX
|
395 + | #[allow(missing_docs)] // documentation missing in model
|
396 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
397 + | self.length_string.as_deref()
|
614 398 | }
|
615 - | }
|
616 - | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
617 - | type Error = crate::model::pattern_string_internal::ConstraintViolation;
|
618 - |
|
619 - | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
620 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
621 - | let value = Self::check_pattern(value)?;
|
622 - |
|
623 - | Ok(Self(value))
|
399 + | #[allow(missing_docs)] // documentation missing in model
|
400 + | pub fn min_length_string(&self) -> ::std::option::Option<&str> {
|
401 + | self.min_length_string.as_deref()
|
624 402 | }
|
625 - | }
|
626 - | impl crate::constrained::Constrained for PatternString {
|
627 - | type Unconstrained = ::std::string::String;
|
628 - | }
|
629 - |
|
630 - | impl ::std::convert::From<::std::string::String>
|
631 - | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
632 - | {
|
633 - | fn from(value: ::std::string::String) -> Self {
|
634 - | Self::Unconstrained(value)
|
403 + | #[allow(missing_docs)] // documentation missing in model
|
404 + | pub fn max_length_string(&self) -> ::std::option::Option<&str> {
|
405 + | self.max_length_string.as_deref()
|
635 406 | }
|
636 - | }
|
637 - |
|
638 - | impl ::std::fmt::Display for PatternString {
|
639 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
640 - | self.0.fmt(f)
|
407 + | #[allow(missing_docs)] // documentation missing in model
|
408 + | pub fn fixed_length_string(&self) -> ::std::option::Option<&str> {
|
409 + | self.fixed_length_string.as_deref()
|
641 410 | }
|
642 - | }
|
643 - |
|
644 - | impl ::std::convert::From<PatternString> for ::std::string::String {
|
645 - | fn from(value: PatternString) -> Self {
|
646 - | value.into_inner()
|
411 + | #[allow(missing_docs)] // documentation missing in model
|
412 + | pub fn length_blob(
|
413 + | &self,
|
414 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
415 + | self.length_blob.as_ref()
|
647 416 | }
|
648 - | }
|
649 - |
|
650 - | #[cfg(test)]
|
651 - | mod test_pattern_string {
|
652 - | #[test]
|
653 - | fn regex_compiles() {
|
654 - | crate::model::PatternString::compile_regex();
|
655 - | }
|
656 - | }
|
657 - |
|
658 - | #[allow(missing_docs)] // documentation missing in model
|
659 - | ///
|
660 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
661 - | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
662 - | ///
|
663 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
664 - | ///
|
665 - | #[derive(
|
666 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
667 - | )]
|
668 - | pub(crate) struct LengthListOfPatternString(
|
669 - | pub(crate) ::std::vec::Vec<crate::model::PatternString>,
|
670 - | );
|
671 - | impl LengthListOfPatternString {
|
672 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
673 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
674 - | self.0
|
417 + | #[allow(missing_docs)] // documentation missing in model
|
418 + | pub fn min_length_blob(
|
419 + | &self,
|
420 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
421 + | self.min_length_blob.as_ref()
|
675 422 | }
|
676 - |
|
677 - | fn check_length(
|
678 - | length: usize,
|
679 - | ) -> ::std::result::Result<
|
680 - | (),
|
681 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
682 - | > {
|
683 - | if (12..=39).contains(&length) {
|
684 - | Ok(())
|
685 - | } else {
|
686 - | Err(
|
687 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation::Length(
|
688 - | length,
|
689 - | ),
|
690 - | )
|
423 + | #[allow(missing_docs)] // documentation missing in model
|
424 + | pub fn max_length_blob(
|
425 + | &self,
|
426 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
427 + | self.max_length_blob.as_ref()
|
691 428 | }
|
429 + | #[allow(missing_docs)] // documentation missing in model
|
430 + | pub fn fixed_length_blob(
|
431 + | &self,
|
432 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
433 + | self.fixed_length_blob.as_ref()
|
692 434 | }
|
693 - | }
|
694 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
695 - | for LengthListOfPatternString
|
696 - | {
|
697 - | type Error = crate::model::length_list_of_pattern_string_internal::ConstraintViolation;
|
698 - |
|
699 - | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
700 - | fn try_from(
|
701 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
702 - | ) -> ::std::result::Result<Self, Self::Error> {
|
703 - | Self::check_length(value.len())?;
|
704 - |
|
705 - | Ok(Self(value))
|
435 + | #[allow(missing_docs)] // documentation missing in model
|
436 + | pub fn range_integer(&self) -> i32 {
|
437 + | self.range_integer
|
706 438 | }
|
707 - | }
|
708 - |
|
709 - | impl ::std::convert::From<LengthListOfPatternString>
|
710 - | for ::std::vec::Vec<crate::model::PatternString>
|
711 - | {
|
712 - | fn from(value: LengthListOfPatternString) -> Self {
|
713 - | value.into_inner()
|
439 + | #[allow(missing_docs)] // documentation missing in model
|
440 + | pub fn min_range_integer(&self) -> i32 {
|
441 + | self.min_range_integer
|
714 442 | }
|
715 - | }
|
716 - | impl ::std::convert::From<LengthListOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
717 - | fn from(value: LengthListOfPatternString) -> Self {
|
718 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
443 + | #[allow(missing_docs)] // documentation missing in model
|
444 + | pub fn max_range_integer(&self) -> i32 {
|
445 + | self.max_range_integer
|
719 446 | }
|
720 - | }
|
721 - | impl crate::constrained::Constrained for LengthListOfPatternString {
|
722 - | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
723 - | }
|
724 - |
|
725 - | #[allow(missing_docs)] // documentation missing in model
|
726 - | ///
|
727 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
728 - | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
729 - | ///
|
730 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
731 - | ///
|
732 - | #[derive(
|
733 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
734 - | )]
|
735 - | pub(crate) struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
736 - | impl SetOfLengthString {
|
737 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
738 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
739 - | self.0
|
447 + | #[allow(missing_docs)] // documentation missing in model
|
448 + | pub fn fixed_value_integer(&self) -> i32 {
|
449 + | self.fixed_value_integer
|
740 450 | }
|
741 - |
|
742 - | fn check_unique_items(
|
743 - | items: ::std::vec::Vec<crate::model::LengthString>,
|
744 - | ) -> ::std::result::Result<
|
745 - | ::std::vec::Vec<crate::model::LengthString>,
|
746 - | crate::model::set_of_length_string_internal::ConstraintViolation,
|
747 - | > {
|
748 - | let mut seen = ::std::collections::HashMap::new();
|
749 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
750 - | for (idx, item) in items.iter().enumerate() {
|
751 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
752 - | duplicate_indices.push(prev_idx);
|
451 + | #[allow(missing_docs)] // documentation missing in model
|
452 + | pub fn range_short(&self) -> i16 {
|
453 + | self.range_short
|
753 454 | }
|
455 + | #[allow(missing_docs)] // documentation missing in model
|
456 + | pub fn min_range_short(&self) -> i16 {
|
457 + | self.min_range_short
|
754 458 | }
|
755 - |
|
756 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
757 - | for idx in &duplicate_indices {
|
758 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
759 - | last_duplicate_indices.push(prev_idx);
|
459 + | #[allow(missing_docs)] // documentation missing in model
|
460 + | pub fn max_range_short(&self) -> i16 {
|
461 + | self.max_range_short
|
760 462 | }
|
463 + | #[allow(missing_docs)] // documentation missing in model
|
464 + | pub fn fixed_value_short(&self) -> i16 {
|
465 + | self.fixed_value_short
|
761 466 | }
|
762 - | duplicate_indices.extend(last_duplicate_indices);
|
763 - |
|
764 - | if !duplicate_indices.is_empty() {
|
765 - | debug_assert!(duplicate_indices.len() >= 2);
|
766 - | Err(
|
767 - | crate::model::set_of_length_string_internal::ConstraintViolation::UniqueItems {
|
768 - | duplicate_indices,
|
769 - | original: items,
|
770 - | },
|
771 - | )
|
772 - | } else {
|
773 - | Ok(items)
|
467 + | #[allow(missing_docs)] // documentation missing in model
|
468 + | pub fn range_long(&self) -> i64 {
|
469 + | self.range_long
|
774 470 | }
|
471 + | #[allow(missing_docs)] // documentation missing in model
|
472 + | pub fn min_range_long(&self) -> i64 {
|
473 + | self.min_range_long
|
775 474 | }
|
776 - | }
|
777 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
778 - | type Error = crate::model::set_of_length_string_internal::ConstraintViolation;
|
779 - |
|
780 - | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
781 - | fn try_from(
|
782 - | value: ::std::vec::Vec<crate::model::LengthString>,
|
783 - | ) -> ::std::result::Result<Self, Self::Error> {
|
784 - | let value = Self::check_unique_items(value)?;
|
785 - |
|
786 - | Ok(Self(value))
|
475 + | #[allow(missing_docs)] // documentation missing in model
|
476 + | pub fn max_range_long(&self) -> i64 {
|
477 + | self.max_range_long
|
787 478 | }
|
788 - | }
|
789 - |
|
790 - | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
791 - | fn from(value: SetOfLengthString) -> Self {
|
792 - | value.into_inner()
|
479 + | #[allow(missing_docs)] // documentation missing in model
|
480 + | pub fn fixed_value_long(&self) -> i64 {
|
481 + | self.fixed_value_long
|
793 482 | }
|
794 - | }
|
795 - | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
|
796 - | fn from(value: SetOfLengthString) -> Self {
|
797 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
483 + | #[allow(missing_docs)] // documentation missing in model
|
484 + | pub fn range_byte(&self) -> i8 {
|
485 + | self.range_byte
|
798 486 | }
|
799 - | }
|
800 - | impl crate::constrained::Constrained for SetOfLengthString {
|
801 - | type Unconstrained =
|
802 - | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
803 - | }
|
804 - |
|
805 - | #[::pyo3::pyclass]
|
806 - | /// :param recursive_member constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested2:
|
807 - | /// :rtype None:
|
808 - | #[allow(missing_docs)] // documentation missing in model
|
809 - | #[derive(
|
810 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
811 - | )]
|
812 - | pub struct RecursiveShapesInputOutputNested1 {
|
813 - | #[pyo3(get, set)]
|
814 - | /// :type constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested2:
|
815 487 | #[allow(missing_docs)] // documentation missing in model
|
816 - | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
817 - | }
|
818 - | impl RecursiveShapesInputOutputNested1 {
|
488 + | pub fn min_range_byte(&self) -> i8 {
|
489 + | self.min_range_byte
|
490 + | }
|
819 491 | #[allow(missing_docs)] // documentation missing in model
|
820 - | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
821 - | use std::ops::Deref;
|
822 - | self.recursive_member.deref()
|
492 + | pub fn max_range_byte(&self) -> i8 {
|
493 + | self.max_range_byte
|
823 494 | }
|
824 - | }
|
825 - | #[allow(clippy::new_without_default)]
|
826 - | #[allow(clippy::too_many_arguments)]
|
827 - | #[::pyo3::pymethods]
|
828 - | impl RecursiveShapesInputOutputNested1 {
|
829 - | #[new]
|
830 - | pub fn new(
|
831 - | recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
832 - | ) -> Self {
|
833 - | Self { recursive_member }
|
495 + | #[allow(missing_docs)] // documentation missing in model
|
496 + | pub fn fixed_value_byte(&self) -> i8 {
|
497 + | self.fixed_value_byte
|
834 498 | }
|
835 - | fn __repr__(&self) -> String {
|
836 - | format!("{self:?}")
|
499 + | #[allow(missing_docs)] // documentation missing in model
|
500 + | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
501 + | self.con_b_list.as_deref()
|
837 502 | }
|
838 - | fn __str__(&self) -> String {
|
839 - | format!("{self:?}")
|
503 + | #[allow(missing_docs)] // documentation missing in model
|
504 + | pub fn length_list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
505 + | self.length_list.as_deref()
|
840 506 | }
|
841 - | }
|
842 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
843 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
844 - | ob.extract::<RecursiveShapesInputOutputNested1>()
|
845 - | .map(Box::new)
|
507 + | #[allow(missing_docs)] // documentation missing in model
|
508 + | pub fn sensitive_length_list(
|
509 + | &self,
|
510 + | ) -> ::std::option::Option<&[crate::model::SensitiveStructure]> {
|
511 + | self.sensitive_length_list.as_deref()
|
846 512 | }
|
847 - | }
|
848 - |
|
849 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
850 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
851 - | (*self).into_py(py)
|
513 + | #[allow(missing_docs)] // documentation missing in model
|
514 + | pub fn con_b_set(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
515 + | self.con_b_set.as_deref()
|
852 516 | }
|
853 - | }
|
854 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
855 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
856 - | }
|
857 - | impl RecursiveShapesInputOutputNested1 {
|
858 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
859 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
860 - | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
517 + | #[allow(missing_docs)] // documentation missing in model
|
518 + | pub fn con_b_map(
|
519 + | &self,
|
520 + | ) -> ::std::option::Option<
|
521 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
522 + | > {
|
523 + | self.con_b_map.as_ref()
|
861 524 | }
|
862 - | }
|
863 - |
|
864 - | #[::pyo3::pyclass]
|
865 - | /// :param recursive_member typing.Optional\[constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested1\]:
|
866 - | /// :rtype None:
|
867 - | #[allow(missing_docs)] // documentation missing in model
|
868 - | #[derive(
|
869 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
870 - | )]
|
871 - | pub struct RecursiveShapesInputOutputNested2 {
|
872 - | #[pyo3(get, set)]
|
873 - | /// :type typing.Optional\[constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested1\]:
|
874 525 | #[allow(missing_docs)] // documentation missing in model
|
875 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
876 - | }
|
877 - | impl RecursiveShapesInputOutputNested2 {
|
526 + | pub fn length_map(
|
527 + | &self,
|
528 + | ) -> ::std::option::Option<
|
529 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
530 + | > {
|
531 + | self.length_map.as_ref()
|
532 + | }
|
878 533 | #[allow(missing_docs)] // documentation missing in model
|
879 - | pub fn recursive_member(
|
534 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
880 535 | &self,
|
881 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
882 - | self.recursive_member.as_ref()
|
536 + | ) -> ::std::option::Option<
|
537 + | &::std::collections::HashMap<
|
538 + | ::std::string::String,
|
539 + | ::std::collections::HashMap<
|
540 + | ::std::string::String,
|
541 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
542 + | >,
|
543 + | >,
|
544 + | > {
|
545 + | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
883 546 | }
|
884 - | }
|
885 - | #[allow(clippy::new_without_default)]
|
886 - | #[allow(clippy::too_many_arguments)]
|
887 - | #[::pyo3::pymethods]
|
888 - | impl RecursiveShapesInputOutputNested2 {
|
889 - | #[new]
|
890 - | pub fn new(
|
891 - | recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
892 - | ) -> Self {
|
893 - | Self { recursive_member }
|
547 + | #[allow(missing_docs)] // documentation missing in model
|
548 + | pub fn sparse_map(
|
549 + | &self,
|
550 + | ) -> ::std::option::Option<
|
551 + | &::std::collections::HashMap<
|
552 + | ::std::string::String,
|
553 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
554 + | >,
|
555 + | > {
|
556 + | self.sparse_map.as_ref()
|
894 557 | }
|
895 - | fn __repr__(&self) -> String {
|
896 - | format!("{self:?}")
|
558 + | #[allow(missing_docs)] // documentation missing in model
|
559 + | pub fn sparse_list(
|
560 + | &self,
|
561 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
562 + | self.sparse_list.as_deref()
|
897 563 | }
|
898 - | fn __str__(&self) -> String {
|
899 - | format!("{self:?}")
|
564 + | #[allow(missing_docs)] // documentation missing in model
|
565 + | pub fn sparse_length_map(
|
566 + | &self,
|
567 + | ) -> ::std::option::Option<
|
568 + | &::std::collections::HashMap<
|
569 + | ::std::string::String,
|
570 + | ::std::option::Option<::std::string::String>,
|
571 + | >,
|
572 + | > {
|
573 + | self.sparse_length_map.as_ref()
|
900 574 | }
|
901 - | }
|
902 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
903 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
904 - | ob.extract::<RecursiveShapesInputOutputNested2>()
|
905 - | .map(Box::new)
|
575 + | #[allow(missing_docs)] // documentation missing in model
|
576 + | pub fn sparse_length_list(
|
577 + | &self,
|
578 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
579 + | self.sparse_length_list.as_deref()
|
906 580 | }
|
907 - | }
|
908 - |
|
909 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
910 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
911 - | (*self).into_py(py)
|
581 + | /// A union with constrained members.
|
582 + | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
583 + | self.constrained_union.as_ref()
|
912 584 | }
|
913 - | }
|
914 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
915 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
916 - | }
|
917 - | impl RecursiveShapesInputOutputNested2 {
|
918 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
919 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
920 - | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
585 + | #[allow(missing_docs)] // documentation missing in model
|
586 + | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
587 + | self.enum_string.as_ref()
|
921 588 | }
|
922 - | }
|
923 - |
|
924 - | #[::pyo3::pyclass]
|
925 - | /// :param con_b constraints_without_public_constrained_types.model.ConB:
|
926 - | /// :param range_integer int:
|
927 - | /// :param min_range_integer int:
|
928 - | /// :param max_range_integer int:
|
929 - | /// :param fixed_value_integer int:
|
930 - | /// :param range_short int:
|
931 - | /// :param min_range_short int:
|
932 - | /// :param max_range_short int:
|
933 - | /// :param fixed_value_short int:
|
934 - | /// :param range_long int:
|
935 - | /// :param min_range_long int:
|
936 - | /// :param max_range_long int:
|
937 - | /// :param fixed_value_long int:
|
938 - | /// :param range_byte int:
|
939 - | /// :param min_range_byte int:
|
940 - | /// :param max_range_byte int:
|
941 - | /// :param fixed_value_byte int:
|
942 - | /// :param opt_con_b typing.Optional\[constraints_without_public_constrained_types.model.ConB\]:
|
943 - | /// :param length_string typing.Optional\[str\]:
|
944 - | /// :param min_length_string typing.Optional\[str\]:
|
945 - | /// :param max_length_string typing.Optional\[str\]:
|
946 - | /// :param fixed_length_string typing.Optional\[str\]:
|
947 - | /// :param length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
948 - | /// :param min_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
949 - | /// :param max_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
950 - | /// :param fixed_length_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
951 - | /// :param con_b_list typing.Optional\[typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]:
|
952 - | /// :param length_list typing.Optional\[typing.List\[str\]\]:
|
953 - | /// :param sensitive_length_list typing.Optional\[typing.List\[constraints_without_public_constrained_types.model.SensitiveStructure\]\]:
|
954 - | /// :param con_b_set typing.Optional\[typing.List\[typing.Set\[str\]\]\]:
|
955 - | /// :param con_b_map typing.Optional\[typing.Dict\[str, str\]\]:
|
956 - | /// :param length_map typing.Optional\[typing.Dict\[str, str\]\]:
|
957 - | /// :param map_of_map_of_list_of_list_of_con_b typing.Optional\[typing.Dict\[str, typing.Dict\[str, typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]\]\]:
|
958 - | /// :param sparse_map typing.Optional\[typing.Dict\[str, typing.Optional\[typing.List\[str\]\]\]\]:
|
959 - | /// :param sparse_list typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
960 - | /// :param sparse_length_map typing.Optional\[typing.Dict\[str, typing.Optional\[str\]\]\]:
|
961 - | /// :param sparse_length_list typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
962 - | /// :param constrained_union typing.Optional\[constraints_without_public_constrained_types.model.ConstrainedUnion\]:
|
963 - | /// :param enum_string typing.Optional\[constraints_without_public_constrained_types.model.EnumString\]:
|
964 - | /// :param list_of_length_string typing.Optional\[typing.List\[str\]\]:
|
965 - | /// :param set_of_length_string typing.Optional\[typing.Set\[str\]\]:
|
966 - | /// :param map_of_length_string typing.Optional\[typing.Dict\[str, str\]\]:
|
967 - | /// :param list_of_length_blob typing.Optional\[typing.List\[constraints_without_public_constrained_types.types.Blob\]\]:
|
968 - | /// :param map_of_length_blob typing.Optional\[typing.Dict\[str, constraints_without_public_constrained_types.types.Blob\]\]:
|
969 - | /// :param list_of_range_integer typing.Optional\[typing.List\[int\]\]:
|
970 - | /// :param set_of_range_integer typing.Optional\[typing.List\[int\]\]:
|
971 - | /// :param map_of_range_integer typing.Optional\[typing.Dict\[str, int\]\]:
|
972 - | /// :param list_of_range_short typing.Optional\[typing.List\[int\]\]:
|
973 - | /// :param set_of_range_short typing.Optional\[typing.List\[int\]\]:
|
974 - | /// :param map_of_range_short typing.Optional\[typing.Dict\[str, int\]\]:
|
975 - | /// :param list_of_range_long typing.Optional\[typing.List\[int\]\]:
|
976 - | /// :param set_of_range_long typing.Optional\[typing.List\[int\]\]:
|
977 - | /// :param map_of_range_long typing.Optional\[typing.Dict\[str, int\]\]:
|
978 - | /// :param list_of_range_byte typing.Optional\[typing.List\[int\]\]:
|
979 - | /// :param set_of_range_byte typing.Optional\[typing.List\[int\]\]:
|
980 - | /// :param map_of_range_byte typing.Optional\[typing.Dict\[str, int\]\]:
|
981 - | /// :param non_streaming_blob typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
982 - | /// :param pattern_string typing.Optional\[str\]:
|
983 - | /// :param map_of_pattern_string typing.Optional\[typing.Dict\[str, str\]\]:
|
984 - | /// :param list_of_pattern_string typing.Optional\[typing.List\[str\]\]:
|
985 - | /// :param set_of_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
986 - | /// :param length_length_pattern_string typing.Optional\[str\]:
|
987 - | /// :param map_of_length_pattern_string typing.Optional\[typing.Dict\[str, str\]\]:
|
988 - | /// :param list_of_length_pattern_string typing.Optional\[typing.List\[str\]\]:
|
989 - | /// :param set_of_length_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
990 - | /// :param length_list_of_pattern_string typing.Optional\[typing.List\[str\]\]:
|
991 - | /// :param length_set_of_pattern_string typing.Optional\[typing.Set\[str\]\]:
|
992 - | /// :rtype None:
|
993 - | #[allow(missing_docs)] // documentation missing in model
|
994 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
995 - | pub struct ConA {
|
996 - | #[pyo3(get, set)]
|
997 - | /// :type constraints_without_public_constrained_types.model.ConB:
|
998 589 | #[allow(missing_docs)] // documentation missing in model
|
999 - | pub con_b: crate::model::ConB,
|
1000 - | #[pyo3(get, set)]
|
1001 - | /// :type typing.Optional\[constraints_without_public_constrained_types.model.ConB\]:
|
590 + | pub fn list_of_length_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
591 + | self.list_of_length_string.as_deref()
|
592 + | }
|
1002 593 | #[allow(missing_docs)] // documentation missing in model
|
1003 - | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
1004 - | #[pyo3(get, set)]
|
1005 - | /// :type typing.Optional\[str\]:
|
594 + | pub fn set_of_length_string(
|
595 + | &self,
|
596 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
597 + | self.set_of_length_string.as_ref()
|
598 + | }
|
1006 599 | #[allow(missing_docs)] // documentation missing in model
|
1007 - | pub length_string: ::std::option::Option<::std::string::String>,
|
1008 - | #[pyo3(get, set)]
|
1009 - | /// :type typing.Optional\[str\]:
|
600 + | pub fn map_of_length_string(
|
601 + | &self,
|
602 + | ) -> ::std::option::Option<
|
603 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
604 + | > {
|
605 + | self.map_of_length_string.as_ref()
|
606 + | }
|
1010 607 | #[allow(missing_docs)] // documentation missing in model
|
1011 - | pub min_length_string: ::std::option::Option<::std::string::String>,
|
1012 - | #[pyo3(get, set)]
|
1013 - | /// :type typing.Optional\[str\]:
|
608 + | pub fn list_of_length_blob(
|
609 + | &self,
|
610 + | ) -> ::std::option::Option<&[::aws_smithy_http_server_python::types::Blob]> {
|
611 + | self.list_of_length_blob.as_deref()
|
612 + | }
|
1014 613 | #[allow(missing_docs)] // documentation missing in model
|
1015 - | pub max_length_string: ::std::option::Option<::std::string::String>,
|
1016 - | #[pyo3(get, set)]
|
1017 - | /// :type typing.Optional\[str\]:
|
614 + | pub fn map_of_length_blob(
|
615 + | &self,
|
616 + | ) -> ::std::option::Option<
|
617 + | &::std::collections::HashMap<
|
618 + | ::std::string::String,
|
619 + | ::aws_smithy_http_server_python::types::Blob,
|
620 + | >,
|
621 + | > {
|
622 + | self.map_of_length_blob.as_ref()
|
623 + | }
|
1018 624 | #[allow(missing_docs)] // documentation missing in model
|
1019 - | pub fixed_length_string: ::std::option::Option<::std::string::String>,
|
1020 - | #[pyo3(get, set)]
|
1021 - | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
625 + | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
626 + | self.list_of_range_integer.as_deref()
|
627 + | }
|
1022 628 | #[allow(missing_docs)] // documentation missing in model
|
1023 - | pub length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1024 - | #[pyo3(get, set)]
|
1025 - | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
629 + | pub fn set_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
630 + | self.set_of_range_integer.as_deref()
|
631 + | }
|
1026 632 | #[allow(missing_docs)] // documentation missing in model
|
1027 - | pub min_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1028 - | #[pyo3(get, set)]
|
1029 - | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
633 + | pub fn map_of_range_integer(
|
634 + | &self,
|
635 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
636 + | self.map_of_range_integer.as_ref()
|
637 + | }
|
1030 638 | #[allow(missing_docs)] // documentation missing in model
|
1031 - | pub max_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1032 - | #[pyo3(get, set)]
|
1033 - | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
1034 - | #[allow(missing_docs)] // documentation missing in model
|
1035 - | pub fixed_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1036 - | #[pyo3(get, set)]
|
1037 - | /// :type int:
|
1038 - | #[allow(missing_docs)] // documentation missing in model
|
1039 - | pub range_integer: i32,
|
1040 - | #[pyo3(get, set)]
|
1041 - | /// :type int:
|
1042 - | #[allow(missing_docs)] // documentation missing in model
|
1043 - | pub min_range_integer: i32,
|
1044 - | #[pyo3(get, set)]
|
1045 - | /// :type int:
|
639 + | pub fn list_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
640 + | self.list_of_range_short.as_deref()
|
641 + | }
|
1046 642 | #[allow(missing_docs)] // documentation missing in model
|
1047 - | pub max_range_integer: i32,
|
1048 - | #[pyo3(get, set)]
|
1049 - | /// :type int:
|
643 + | pub fn set_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
644 + | self.set_of_range_short.as_deref()
|
645 + | }
|
1050 646 | #[allow(missing_docs)] // documentation missing in model
|
1051 - | pub fixed_value_integer: i32,
|
1052 - | #[pyo3(get, set)]
|
1053 - | /// :type int:
|
647 + | pub fn map_of_range_short(
|
648 + | &self,
|
649 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i16>> {
|
650 + | self.map_of_range_short.as_ref()
|
651 + | }
|
1054 652 | #[allow(missing_docs)] // documentation missing in model
|
1055 - | pub range_short: i16,
|
1056 - | #[pyo3(get, set)]
|
1057 - | /// :type int:
|
653 + | pub fn list_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
654 + | self.list_of_range_long.as_deref()
|
655 + | }
|
1058 656 | #[allow(missing_docs)] // documentation missing in model
|
1059 - | pub min_range_short: i16,
|
1060 - | #[pyo3(get, set)]
|
1061 - | /// :type int:
|
657 + | pub fn set_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
658 + | self.set_of_range_long.as_deref()
|
659 + | }
|
1062 660 | #[allow(missing_docs)] // documentation missing in model
|
1063 - | pub max_range_short: i16,
|
1064 - | #[pyo3(get, set)]
|
1065 - | /// :type int:
|
661 + | pub fn map_of_range_long(
|
662 + | &self,
|
663 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i64>> {
|
664 + | self.map_of_range_long.as_ref()
|
665 + | }
|
1066 666 | #[allow(missing_docs)] // documentation missing in model
|
1067 - | pub fixed_value_short: i16,
|
1068 - | #[pyo3(get, set)]
|
1069 - | /// :type int:
|
667 + | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
668 + | self.list_of_range_byte.as_deref()
|
669 + | }
|
1070 670 | #[allow(missing_docs)] // documentation missing in model
|
1071 - | pub range_long: i64,
|
1072 - | #[pyo3(get, set)]
|
1073 - | /// :type int:
|
671 + | pub fn set_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
672 + | self.set_of_range_byte.as_deref()
|
673 + | }
|
1074 674 | #[allow(missing_docs)] // documentation missing in model
|
1075 - | pub min_range_long: i64,
|
1076 - | #[pyo3(get, set)]
|
1077 - | /// :type int:
|
675 + | pub fn map_of_range_byte(
|
676 + | &self,
|
677 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i8>> {
|
678 + | self.map_of_range_byte.as_ref()
|
679 + | }
|
1078 680 | #[allow(missing_docs)] // documentation missing in model
|
1079 - | pub max_range_long: i64,
|
1080 - | #[pyo3(get, set)]
|
1081 - | /// :type int:
|
681 + | pub fn non_streaming_blob(
|
682 + | &self,
|
683 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
684 + | self.non_streaming_blob.as_ref()
|
685 + | }
|
1082 686 | #[allow(missing_docs)] // documentation missing in model
|
1083 - | pub fixed_value_long: i64,
|
1084 - | #[pyo3(get, set)]
|
1085 - | /// :type int:
|
687 + | pub fn pattern_string(&self) -> ::std::option::Option<&str> {
|
688 + | self.pattern_string.as_deref()
|
689 + | }
|
1086 690 | #[allow(missing_docs)] // documentation missing in model
|
1087 - | pub range_byte: i8,
|
1088 - | #[pyo3(get, set)]
|
1089 - | /// :type int:
|
691 + | pub fn map_of_pattern_string(
|
692 + | &self,
|
693 + | ) -> ::std::option::Option<
|
694 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
695 + | > {
|
696 + | self.map_of_pattern_string.as_ref()
|
697 + | }
|
1090 698 | #[allow(missing_docs)] // documentation missing in model
|
1091 - | pub min_range_byte: i8,
|
1092 - | #[pyo3(get, set)]
|
1093 - | /// :type int:
|
699 + | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
700 + | self.list_of_pattern_string.as_deref()
|
701 + | }
|
1094 702 | #[allow(missing_docs)] // documentation missing in model
|
1095 - | pub max_range_byte: i8,
|
1096 - | #[pyo3(get, set)]
|
1097 - | /// :type int:
|
703 + | pub fn set_of_pattern_string(
|
704 + | &self,
|
705 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
706 + | self.set_of_pattern_string.as_ref()
|
707 + | }
|
1098 708 | #[allow(missing_docs)] // documentation missing in model
|
1099 - | pub fixed_value_byte: i8,
|
1100 - | #[pyo3(get, set)]
|
1101 - | /// :type typing.Optional\[typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]:
|
709 + | pub fn length_length_pattern_string(&self) -> ::std::option::Option<&str> {
|
710 + | self.length_length_pattern_string.as_deref()
|
711 + | }
|
1102 712 | #[allow(missing_docs)] // documentation missing in model
|
1103 - | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
1104 - | #[pyo3(get, set)]
|
1105 - | /// :type typing.Optional\[typing.List\[str\]\]:
|
713 + | pub fn map_of_length_pattern_string(
|
714 + | &self,
|
715 + | ) -> ::std::option::Option<
|
716 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
717 + | > {
|
718 + | self.map_of_length_pattern_string.as_ref()
|
719 + | }
|
1106 720 | #[allow(missing_docs)] // documentation missing in model
|
1107 - | pub length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1108 - | #[pyo3(get, set)]
|
1109 - | /// :type typing.Optional\[typing.List\[constraints_without_public_constrained_types.model.SensitiveStructure\]\]:
|
721 + | pub fn list_of_length_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
722 + | self.list_of_length_pattern_string.as_deref()
|
723 + | }
|
1110 724 | #[allow(missing_docs)] // documentation missing in model
|
1111 - | pub sensitive_length_list:
|
1112 - | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
1113 - | #[pyo3(get, set)]
|
1114 - | /// :type typing.Optional\[typing.List\[typing.Set\[str\]\]\]:
|
725 + | pub fn set_of_length_pattern_string(
|
726 + | &self,
|
727 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
728 + | self.set_of_length_pattern_string.as_ref()
|
729 + | }
|
1115 730 | #[allow(missing_docs)] // documentation missing in model
|
1116 - | pub con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
1117 - | #[pyo3(get, set)]
|
1118 - | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
731 + | pub fn length_list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
732 + | self.length_list_of_pattern_string.as_deref()
|
733 + | }
|
1119 734 | #[allow(missing_docs)] // documentation missing in model
|
1120 - | pub con_b_map: ::std::option::Option<
|
735 + | pub fn length_set_of_pattern_string(
|
736 + | &self,
|
737 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
738 + | self.length_set_of_pattern_string.as_ref()
|
739 + | }
|
740 + | }
|
741 + | #[allow(clippy::new_without_default)]
|
742 + | #[allow(clippy::too_many_arguments)]
|
743 + | #[::pyo3::pymethods]
|
744 + | impl ConA {
|
745 + | #[new]
|
746 + | pub fn new(
|
747 + | con_b: crate::model::ConB,
|
748 + | range_integer: i32,
|
749 + | min_range_integer: i32,
|
750 + | max_range_integer: i32,
|
751 + | fixed_value_integer: i32,
|
752 + | range_short: i16,
|
753 + | min_range_short: i16,
|
754 + | max_range_short: i16,
|
755 + | fixed_value_short: i16,
|
756 + | range_long: i64,
|
757 + | min_range_long: i64,
|
758 + | max_range_long: i64,
|
759 + | fixed_value_long: i64,
|
760 + | range_byte: i8,
|
761 + | min_range_byte: i8,
|
762 + | max_range_byte: i8,
|
763 + | fixed_value_byte: i8,
|
764 + | opt_con_b: ::std::option::Option<crate::model::ConB>,
|
765 + | length_string: ::std::option::Option<::std::string::String>,
|
766 + | min_length_string: ::std::option::Option<::std::string::String>,
|
767 + | max_length_string: ::std::option::Option<::std::string::String>,
|
768 + | fixed_length_string: ::std::option::Option<::std::string::String>,
|
769 + | length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
770 + | min_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
771 + | max_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
772 + | fixed_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
773 + | con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
774 + | length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
775 + | sensitive_length_list: ::std::option::Option<
|
776 + | ::std::vec::Vec<crate::model::SensitiveStructure>,
|
777 + | >,
|
778 + | con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
779 + | con_b_map: ::std::option::Option<
|
1121 780 | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1122 781 | >,
|
1123 - | #[pyo3(get, set)]
|
1124 - | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
1125 - | #[allow(missing_docs)] // documentation missing in model
|
1126 - | pub length_map: ::std::option::Option<
|
782 + | length_map: ::std::option::Option<
|
1127 783 | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1128 784 | >,
|
1129 - | #[pyo3(get, set)]
|
1130 - | /// :type typing.Optional\[typing.Dict\[str, typing.Dict\[str, typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]\]\]\]:
|
1131 - | #[allow(missing_docs)] // documentation missing in model
|
1132 - | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
785 + | map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
1133 786 | ::std::collections::HashMap<
|
1134 787 | ::std::string::String,
|
1135 788 | ::std::collections::HashMap<
|
1136 789 | ::std::string::String,
|
1137 790 | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1138 791 | >,
|
1139 792 | >,
|
1140 793 | >,
|
1141 - | #[pyo3(get, set)]
|
1142 - | /// :type typing.Optional\[typing.Dict\[str, typing.Optional\[typing.List\[str\]\]\]\]:
|
1143 - | #[allow(missing_docs)] // documentation missing in model
|
1144 - | pub sparse_map: ::std::option::Option<
|
794 + | sparse_map: ::std::option::Option<
|
1145 795 | ::std::collections::HashMap<
|
1146 796 | ::std::string::String,
|
1147 797 | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1148 798 | >,
|
1149 799 | >,
|
1150 - | #[pyo3(get, set)]
|
1151 - | /// :type typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
1152 - | #[allow(missing_docs)] // documentation missing in model
|
1153 - | pub sparse_list:
|
1154 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
1155 - | #[pyo3(get, set)]
|
1156 - | /// :type typing.Optional\[typing.Dict\[str, typing.Optional\[str\]\]\]:
|
1157 - | #[allow(missing_docs)] // documentation missing in model
|
1158 - | pub sparse_length_map: ::std::option::Option<
|
800 + | sparse_list: ::std::option::Option<
|
801 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
802 + | >,
|
803 + | sparse_length_map: ::std::option::Option<
|
1159 804 | ::std::collections::HashMap<
|
1160 805 | ::std::string::String,
|
1161 806 | ::std::option::Option<::std::string::String>,
|
1162 807 | >,
|
1163 808 | >,
|
1164 - | #[pyo3(get, set)]
|
1165 - | /// :type typing.Optional\[typing.List\[typing.Optional\[str\]\]\]:
|
1166 - | #[allow(missing_docs)] // documentation missing in model
|
1167 - | pub sparse_length_list:
|
1168 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
1169 - | #[pyo3(get, set)]
|
1170 - | /// :type typing.Optional\[constraints_without_public_constrained_types.model.ConstrainedUnion\]:
|
1171 - | /// A union with constrained members.
|
1172 - | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
1173 - | #[pyo3(get, set)]
|
1174 - | /// :type typing.Optional\[constraints_without_public_constrained_types.model.EnumString\]:
|
1175 - | #[allow(missing_docs)] // documentation missing in model
|
1176 - | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
1177 - | #[pyo3(get, set)]
|
1178 - | /// :type typing.Optional\[typing.List\[str\]\]:
|
1179 - | #[allow(missing_docs)] // documentation missing in model
|
1180 - | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1181 - | #[pyo3(get, set)]
|
1182 - | /// :type typing.Optional\[typing.Set\[str\]\]:
|
1183 - | #[allow(missing_docs)] // documentation missing in model
|
1184 - | pub set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1185 - | #[pyo3(get, set)]
|
1186 - | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
1187 - | #[allow(missing_docs)] // documentation missing in model
|
1188 - | pub map_of_length_string: ::std::option::Option<
|
809 + | sparse_length_list: ::std::option::Option<
|
810 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
811 + | >,
|
812 + | constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
813 + | enum_string: ::std::option::Option<crate::model::EnumString>,
|
814 + | list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
815 + | set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
816 + | map_of_length_string: ::std::option::Option<
|
1189 817 | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1190 818 | >,
|
1191 - | #[pyo3(get, set)]
|
1192 - | /// :type typing.Optional\[typing.List\[constraints_without_public_constrained_types.types.Blob\]\]:
|
1193 - | #[allow(missing_docs)] // documentation missing in model
|
1194 - | pub list_of_length_blob:
|
1195 - | ::std::option::Option<::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>>,
|
1196 - | #[pyo3(get, set)]
|
1197 - | /// :type typing.Optional\[typing.Dict\[str, constraints_without_public_constrained_types.types.Blob\]\]:
|
1198 - | #[allow(missing_docs)] // documentation missing in model
|
1199 - | pub map_of_length_blob: ::std::option::Option<
|
819 + | list_of_length_blob: ::std::option::Option<
|
820 + | ::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>,
|
821 + | >,
|
822 + | map_of_length_blob: ::std::option::Option<
|
1200 823 | ::std::collections::HashMap<
|
1201 824 | ::std::string::String,
|
1202 825 | ::aws_smithy_http_server_python::types::Blob,
|
1203 826 | >,
|
1204 827 | >,
|
1205 - | #[pyo3(get, set)]
|
1206 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1207 - | #[allow(missing_docs)] // documentation missing in model
|
1208 - | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
1209 - | #[pyo3(get, set)]
|
1210 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1211 - | #[allow(missing_docs)] // documentation missing in model
|
1212 - | pub set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
1213 - | #[pyo3(get, set)]
|
1214 - | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
1215 - | #[allow(missing_docs)] // documentation missing in model
|
1216 - | pub map_of_range_integer:
|
1217 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
1218 - | #[pyo3(get, set)]
|
1219 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1220 - | #[allow(missing_docs)] // documentation missing in model
|
1221 - | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
1222 - | #[pyo3(get, set)]
|
1223 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1224 - | #[allow(missing_docs)] // documentation missing in model
|
1225 - | pub set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
1226 - | #[pyo3(get, set)]
|
1227 - | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
1228 - | #[allow(missing_docs)] // documentation missing in model
|
1229 - | pub map_of_range_short:
|
1230 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
1231 - | #[pyo3(get, set)]
|
1232 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1233 - | #[allow(missing_docs)] // documentation missing in model
|
1234 - | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
1235 - | #[pyo3(get, set)]
|
1236 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1237 - | #[allow(missing_docs)] // documentation missing in model
|
1238 - | pub set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
1239 - | #[pyo3(get, set)]
|
1240 - | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
1241 - | #[allow(missing_docs)] // documentation missing in model
|
1242 - | pub map_of_range_long:
|
1243 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
1244 - | #[pyo3(get, set)]
|
1245 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1246 - | #[allow(missing_docs)] // documentation missing in model
|
1247 - | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
1248 - | #[pyo3(get, set)]
|
1249 - | /// :type typing.Optional\[typing.List\[int\]\]:
|
1250 - | #[allow(missing_docs)] // documentation missing in model
|
1251 - | pub set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
1252 - | #[pyo3(get, set)]
|
1253 - | /// :type typing.Optional\[typing.Dict\[str, int\]\]:
|
1254 - | #[allow(missing_docs)] // documentation missing in model
|
1255 - | pub map_of_range_byte:
|
1256 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
1257 - | #[pyo3(get, set)]
|
1258 - | /// :type typing.Optional\[constraints_without_public_constrained_types.types.Blob\]:
|
1259 - | #[allow(missing_docs)] // documentation missing in model
|
1260 - | pub non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1261 - | #[pyo3(get, set)]
|
1262 - | /// :type typing.Optional\[str\]:
|
1263 - | #[allow(missing_docs)] // documentation missing in model
|
1264 - | pub pattern_string: ::std::option::Option<::std::string::String>,
|
1265 - | #[pyo3(get, set)]
|
1266 - | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
1267 - | #[allow(missing_docs)] // documentation missing in model
|
1268 - | pub map_of_pattern_string: ::std::option::Option<
|
828 + | list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
829 + | set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
830 + | map_of_range_integer: ::std::option::Option<
|
831 + | ::std::collections::HashMap<::std::string::String, i32>,
|
832 + | >,
|
833 + | list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
834 + | set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
835 + | map_of_range_short: ::std::option::Option<
|
836 + | ::std::collections::HashMap<::std::string::String, i16>,
|
837 + | >,
|
838 + | list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
839 + | set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
840 + | map_of_range_long: ::std::option::Option<
|
841 + | ::std::collections::HashMap<::std::string::String, i64>,
|
842 + | >,
|
843 + | list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
844 + | set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
845 + | map_of_range_byte: ::std::option::Option<
|
846 + | ::std::collections::HashMap<::std::string::String, i8>,
|
847 + | >,
|
848 + | non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
849 + | pattern_string: ::std::option::Option<::std::string::String>,
|
850 + | map_of_pattern_string: ::std::option::Option<
|
1269 851 | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1270 852 | >,
|
1271 - | #[pyo3(get, set)]
|
1272 - | /// :type typing.Optional\[typing.List\[str\]\]:
|
1273 - | #[allow(missing_docs)] // documentation missing in model
|
1274 - | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1275 - | #[pyo3(get, set)]
|
1276 - | /// :type typing.Optional\[typing.Set\[str\]\]:
|
1277 - | #[allow(missing_docs)] // documentation missing in model
|
1278 - | pub set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1279 - | #[pyo3(get, set)]
|
1280 - | /// :type typing.Optional\[str\]:
|
1281 - | #[allow(missing_docs)] // documentation missing in model
|
1282 - | pub length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
1283 - | #[pyo3(get, set)]
|
1284 - | /// :type typing.Optional\[typing.Dict\[str, str\]\]:
|
1285 - | #[allow(missing_docs)] // documentation missing in model
|
1286 - | pub map_of_length_pattern_string: ::std::option::Option<
|
853 + | list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
854 + | set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
855 + | length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
856 + | map_of_length_pattern_string: ::std::option::Option<
|
1287 857 | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1288 858 | >,
|
1289 - | #[pyo3(get, set)]
|
1290 - | /// :type typing.Optional\[typing.List\[str\]\]:
|
1291 - | #[allow(missing_docs)] // documentation missing in model
|
1292 - | pub list_of_length_pattern_string:
|
1293 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1294 - | #[pyo3(get, set)]
|
1295 - | /// :type typing.Optional\[typing.Set\[str\]\]:
|
1296 - | #[allow(missing_docs)] // documentation missing in model
|
1297 - | pub set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1298 - | #[pyo3(get, set)]
|
1299 - | /// :type typing.Optional\[typing.List\[str\]\]:
|
1300 - | #[allow(missing_docs)] // documentation missing in model
|
1301 - | pub length_list_of_pattern_string:
|
1302 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1303 - | #[pyo3(get, set)]
|
1304 - | /// :type typing.Optional\[typing.Set\[str\]\]:
|
1305 - | #[allow(missing_docs)] // documentation missing in model
|
1306 - | pub length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1307 - | }
|
1308 - | impl ConA {
|
1309 - | #[allow(missing_docs)] // documentation missing in model
|
1310 - | pub fn con_b(&self) -> &crate::model::ConB {
|
1311 - | &self.con_b
|
1312 - | }
|
1313 - | #[allow(missing_docs)] // documentation missing in model
|
1314 - | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
1315 - | self.opt_con_b.as_ref()
|
859 + | list_of_length_pattern_string: ::std::option::Option<
|
860 + | ::std::vec::Vec<::std::string::String>,
|
861 + | >,
|
862 + | set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
863 + | length_list_of_pattern_string: ::std::option::Option<
|
864 + | ::std::vec::Vec<::std::string::String>,
|
865 + | >,
|
866 + | length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
867 + | ) -> Self {
|
868 + | Self {
|
869 + | con_b,
|
870 + | range_integer,
|
871 + | min_range_integer,
|
872 + | max_range_integer,
|
873 + | fixed_value_integer,
|
874 + | range_short,
|
875 + | min_range_short,
|
876 + | max_range_short,
|
877 + | fixed_value_short,
|
878 + | range_long,
|
879 + | min_range_long,
|
880 + | max_range_long,
|
881 + | fixed_value_long,
|
882 + | range_byte,
|
883 + | min_range_byte,
|
884 + | max_range_byte,
|
885 + | fixed_value_byte,
|
886 + | opt_con_b,
|
887 + | length_string,
|
888 + | min_length_string,
|
889 + | max_length_string,
|
890 + | fixed_length_string,
|
891 + | length_blob,
|
892 + | min_length_blob,
|
893 + | max_length_blob,
|
894 + | fixed_length_blob,
|
895 + | con_b_list,
|
896 + | length_list,
|
897 + | sensitive_length_list,
|
898 + | con_b_set,
|
899 + | con_b_map,
|
900 + | length_map,
|
901 + | map_of_map_of_list_of_list_of_con_b,
|
902 + | sparse_map,
|
903 + | sparse_list,
|
904 + | sparse_length_map,
|
905 + | sparse_length_list,
|
906 + | constrained_union,
|
907 + | enum_string,
|
908 + | list_of_length_string,
|
909 + | set_of_length_string,
|
910 + | map_of_length_string,
|
911 + | list_of_length_blob,
|
912 + | map_of_length_blob,
|
913 + | list_of_range_integer,
|
914 + | set_of_range_integer,
|
915 + | map_of_range_integer,
|
916 + | list_of_range_short,
|
917 + | set_of_range_short,
|
918 + | map_of_range_short,
|
919 + | list_of_range_long,
|
920 + | set_of_range_long,
|
921 + | map_of_range_long,
|
922 + | list_of_range_byte,
|
923 + | set_of_range_byte,
|
924 + | map_of_range_byte,
|
925 + | non_streaming_blob,
|
926 + | pattern_string,
|
927 + | map_of_pattern_string,
|
928 + | list_of_pattern_string,
|
929 + | set_of_pattern_string,
|
930 + | length_length_pattern_string,
|
931 + | map_of_length_pattern_string,
|
932 + | list_of_length_pattern_string,
|
933 + | set_of_length_pattern_string,
|
934 + | length_list_of_pattern_string,
|
935 + | length_set_of_pattern_string,
|
1316 936 | }
|
1317 - | #[allow(missing_docs)] // documentation missing in model
|
1318 - | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
1319 - | self.length_string.as_deref()
|
1320 937 | }
|
1321 - | #[allow(missing_docs)] // documentation missing in model
|
1322 - | pub fn min_length_string(&self) -> ::std::option::Option<&str> {
|
1323 - | self.min_length_string.as_deref()
|
938 + | fn __repr__(&self) -> String {
|
939 + | format!("{self:?}")
|
1324 940 | }
|
1325 - | #[allow(missing_docs)] // documentation missing in model
|
1326 - | pub fn max_length_string(&self) -> ::std::option::Option<&str> {
|
1327 - | self.max_length_string.as_deref()
|
941 + | fn __str__(&self) -> String {
|
942 + | format!("{self:?}")
|
1328 943 | }
|
1329 - | #[allow(missing_docs)] // documentation missing in model
|
1330 - | pub fn fixed_length_string(&self) -> ::std::option::Option<&str> {
|
1331 - | self.fixed_length_string.as_deref()
|
944 + | }
|
945 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ConA> {
|
946 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
947 + | ob.extract::<ConA>().map(Box::new)
|
1332 948 | }
|
1333 - | #[allow(missing_docs)] // documentation missing in model
|
1334 - | pub fn length_blob(
|
1335 - | &self,
|
1336 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
1337 - | self.length_blob.as_ref()
|
949 + | }
|
950 + |
|
951 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ConA> {
|
952 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
953 + | (*self).into_py(py)
|
1338 954 | }
|
1339 - | #[allow(missing_docs)] // documentation missing in model
|
1340 - | pub fn min_length_blob(
|
1341 - | &self,
|
1342 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
1343 - | self.min_length_blob.as_ref()
|
1344 - | }
|
1345 - | #[allow(missing_docs)] // documentation missing in model
|
1346 - | pub fn max_length_blob(
|
1347 - | &self,
|
1348 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
1349 - | self.max_length_blob.as_ref()
|
1350 - | }
|
1351 - | #[allow(missing_docs)] // documentation missing in model
|
1352 - | pub fn fixed_length_blob(
|
1353 - | &self,
|
1354 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
1355 - | self.fixed_length_blob.as_ref()
|
955 + | }
|
956 + | impl crate::constrained::Constrained for crate::model::ConA {
|
957 + | type Unconstrained = crate::model::con_a_internal::Builder;
|
958 + | }
|
959 + | impl ConA {
|
960 + | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
961 + | pub fn builder() -> crate::model::con_a::Builder {
|
962 + | crate::model::con_a::Builder::default()
|
1356 963 | }
|
1357 - | #[allow(missing_docs)] // documentation missing in model
|
1358 - | pub fn range_integer(&self) -> i32 {
|
1359 - | self.range_integer
|
964 + | }
|
965 + |
|
966 + | #[allow(missing_docs)] // documentation missing in model
|
967 + | ///
|
968 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
969 + | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
970 + | ///
|
971 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
972 + | ///
|
973 + | #[derive(
|
974 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
975 + | )]
|
976 + | pub(crate) struct ConstrainedListInOutput(
|
977 + | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
978 + | );
|
979 + | impl ConstrainedListInOutput {
|
980 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
981 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
982 + | self.0
|
1360 983 | }
|
1361 - | #[allow(missing_docs)] // documentation missing in model
|
1362 - | pub fn min_range_integer(&self) -> i32 {
|
1363 - | self.min_range_integer
|
984 + |
|
985 + | fn check_length(
|
986 + | length: usize,
|
987 + | ) -> ::std::result::Result<
|
988 + | (),
|
989 + | crate::model::constrained_list_in_output_internal::ConstraintViolation,
|
990 + | > {
|
991 + | if 69 <= length {
|
992 + | Ok(())
|
993 + | } else {
|
994 + | Err(
|
995 + | crate::model::constrained_list_in_output_internal::ConstraintViolation::Length(
|
996 + | length,
|
997 + | ),
|
998 + | )
|
1364 999 | }
|
1365 - | #[allow(missing_docs)] // documentation missing in model
|
1366 - | pub fn max_range_integer(&self) -> i32 {
|
1367 - | self.max_range_integer
|
1368 1000 | }
|
1369 - | #[allow(missing_docs)] // documentation missing in model
|
1370 - | pub fn fixed_value_integer(&self) -> i32 {
|
1371 - | self.fixed_value_integer
|
1001 + | }
|
1002 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
1003 + | for ConstrainedListInOutput
|
1004 + | {
|
1005 + | type Error = crate::model::constrained_list_in_output_internal::ConstraintViolation;
|
1006 + |
|
1007 + | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
1008 + | fn try_from(
|
1009 + | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
1010 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1011 + | Self::check_length(value.len())?;
|
1012 + |
|
1013 + | Ok(Self(value))
|
1372 1014 | }
|
1373 - | #[allow(missing_docs)] // documentation missing in model
|
1374 - | pub fn range_short(&self) -> i16 {
|
1375 - | self.range_short
|
1015 + | }
|
1016 + |
|
1017 + | impl ::std::convert::From<ConstrainedListInOutput>
|
1018 + | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
1019 + | {
|
1020 + | fn from(value: ConstrainedListInOutput) -> Self {
|
1021 + | value.into_inner()
|
1376 1022 | }
|
1377 - | #[allow(missing_docs)] // documentation missing in model
|
1378 - | pub fn min_range_short(&self) -> i16 {
|
1379 - | self.min_range_short
|
1023 + | }
|
1024 + |
|
1025 + | #[allow(missing_docs)] // documentation missing in model
|
1026 + | ///
|
1027 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1028 + | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
1029 + | ///
|
1030 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1031 + | ///
|
1032 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1033 + | pub(crate) struct ConstrainedMapInOutput(
|
1034 + | pub(crate) ::std::collections::HashMap<
|
1035 + | ::std::string::String,
|
1036 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
1037 + | >,
|
1038 + | );
|
1039 + | impl ConstrainedMapInOutput {
|
1040 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
1041 + | pub fn into_inner(
|
1042 + | self,
|
1043 + | ) -> ::std::collections::HashMap<
|
1044 + | ::std::string::String,
|
1045 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
1046 + | > {
|
1047 + | self.0
|
1380 1048 | }
|
1381 - | #[allow(missing_docs)] // documentation missing in model
|
1382 - | pub fn max_range_short(&self) -> i16 {
|
1383 - | self.max_range_short
|
1049 + | }
|
1050 + | impl
|
1051 + | ::std::convert::TryFrom<
|
1052 + | ::std::collections::HashMap<
|
1053 + | ::std::string::String,
|
1054 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
1055 + | >,
|
1056 + | > for ConstrainedMapInOutput
|
1057 + | {
|
1058 + | type Error = crate::model::constrained_map_in_output_internal::ConstraintViolation;
|
1059 + |
|
1060 + | /// 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.
|
1061 + | fn try_from(
|
1062 + | value: ::std::collections::HashMap<
|
1063 + | ::std::string::String,
|
1064 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
1065 + | >,
|
1066 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1067 + | let length = value.len();
|
1068 + | if 69 <= length {
|
1069 + | Ok(Self(value))
|
1070 + | } else {
|
1071 + | Err(
|
1072 + | crate::model::constrained_map_in_output_internal::ConstraintViolation::Length(
|
1073 + | length,
|
1074 + | ),
|
1075 + | )
|
1384 1076 | }
|
1385 - | #[allow(missing_docs)] // documentation missing in model
|
1386 - | pub fn fixed_value_short(&self) -> i16 {
|
1387 - | self.fixed_value_short
|
1388 1077 | }
|
1389 - | #[allow(missing_docs)] // documentation missing in model
|
1390 - | pub fn range_long(&self) -> i64 {
|
1391 - | self.range_long
|
1078 + | }
|
1079 + |
|
1080 + | impl ::std::convert::From<ConstrainedMapInOutput>
|
1081 + | for ::std::collections::HashMap<
|
1082 + | ::std::string::String,
|
1083 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
1084 + | >
|
1085 + | {
|
1086 + | fn from(value: ConstrainedMapInOutput) -> Self {
|
1087 + | value.into_inner()
|
1392 1088 | }
|
1089 + | }
|
1090 + |
|
1091 + | #[allow(missing_docs)] // documentation missing in model
|
1092 + | #[derive(
|
1093 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1094 + | )]
|
1095 + | pub enum ConstrainedUnionInOutput {
|
1393 1096 | #[allow(missing_docs)] // documentation missing in model
|
1394 - | pub fn min_range_long(&self) -> i64 {
|
1395 - | self.min_range_long
|
1097 + | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
1098 + | }
|
1099 + | impl ConstrainedUnionInOutput {
|
1100 + | #[allow(irrefutable_let_patterns)]
|
1101 + | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
1102 + | /// Returns `Err(&Self)` if it can't be converted.
|
1103 + | pub fn as_structure(
|
1104 + | &self,
|
1105 + | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
1106 + | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
1107 + | ::std::result::Result::Ok(val)
|
1108 + | } else {
|
1109 + | ::std::result::Result::Err(self)
|
1396 1110 | }
|
1397 - | #[allow(missing_docs)] // documentation missing in model
|
1398 - | pub fn max_range_long(&self) -> i64 {
|
1399 - | self.max_range_long
|
1400 1111 | }
|
1401 - | #[allow(missing_docs)] // documentation missing in model
|
1402 - | pub fn fixed_value_long(&self) -> i64 {
|
1403 - | self.fixed_value_long
|
1112 + | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
1113 + | pub fn is_structure(&self) -> bool {
|
1114 + | self.as_structure().is_ok()
|
1404 1115 | }
|
1405 - | #[allow(missing_docs)] // documentation missing in model
|
1406 - | pub fn range_byte(&self) -> i8 {
|
1407 - | self.range_byte
|
1116 + | }
|
1117 + | #[pyo3::pyclass(name = "ConstrainedUnionInOutput")]
|
1118 + | #[derive(
|
1119 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1120 + | )]
|
1121 + | pub struct PyUnionMarkerConstrainedUnionInOutput(pub ConstrainedUnionInOutput);
|
1122 + | #[::pyo3::pymethods]
|
1123 + | impl PyUnionMarkerConstrainedUnionInOutput {
|
1124 + | #[allow(irrefutable_let_patterns)]
|
1125 + | #[staticmethod]
|
1126 + | /// Creates a new union instance of [`Structure`](crate::model::ConstrainedUnionInOutput::Structure)
|
1127 + | /// :param data constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput:
|
1128 + | /// :rtype ConstrainedUnionInOutput:
|
1129 + | pub fn structure(data: crate::model::TransitivelyConstrainedStructureInOutput) -> Self {
|
1130 + | Self(ConstrainedUnionInOutput::Structure(data))
|
1408 1131 | }
|
1409 - | #[allow(missing_docs)] // documentation missing in model
|
1410 - | pub fn min_range_byte(&self) -> i8 {
|
1411 - | self.min_range_byte
|
1132 + | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
1133 + | /// :rtype constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput:
|
1134 + | pub fn as_structure(
|
1135 + | &self,
|
1136 + | ) -> ::pyo3::PyResult<crate::model::TransitivelyConstrainedStructureInOutput> {
|
1137 + | match self.0.as_structure() {
|
1138 + | Ok(variant) => Ok(variant.clone()),
|
1139 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1140 + | r"ConstrainedUnionInOutput variant is not of type constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput",
|
1141 + | )),
|
1412 1142 | }
|
1413 - | #[allow(missing_docs)] // documentation missing in model
|
1414 - | pub fn max_range_byte(&self) -> i8 {
|
1415 - | self.max_range_byte
|
1416 1143 | }
|
1417 - | #[allow(missing_docs)] // documentation missing in model
|
1418 - | pub fn fixed_value_byte(&self) -> i8 {
|
1419 - | self.fixed_value_byte
|
1144 + | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
1145 + | /// :rtype bool:
|
1146 + | pub fn is_structure(&self) -> bool {
|
1147 + | self.0.is_structure()
|
1420 1148 | }
|
1421 - | #[allow(missing_docs)] // documentation missing in model
|
1422 - | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
1423 - | self.con_b_list.as_deref()
|
1149 + | }
|
1150 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for ConstrainedUnionInOutput {
|
1151 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1152 + | PyUnionMarkerConstrainedUnionInOutput(self).into_py(py)
|
1424 1153 | }
|
1425 - | #[allow(missing_docs)] // documentation missing in model
|
1426 - | pub fn length_list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1427 - | self.length_list.as_deref()
|
1154 + | }
|
1155 + | impl<'source> ::pyo3::FromPyObject<'source> for ConstrainedUnionInOutput {
|
1156 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1157 + | let data: PyUnionMarkerConstrainedUnionInOutput = obj.extract()?;
|
1158 + | Ok(data.0)
|
1428 1159 | }
|
1429 - | #[allow(missing_docs)] // documentation missing in model
|
1430 - | pub fn sensitive_length_list(
|
1431 - | &self,
|
1432 - | ) -> ::std::option::Option<&[crate::model::SensitiveStructure]> {
|
1433 - | self.sensitive_length_list.as_deref()
|
1160 + | }
|
1161 + |
|
1162 + | #[allow(missing_docs)] // documentation missing in model
|
1163 + | ///
|
1164 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1165 + | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
1166 + | ///
|
1167 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1168 + | ///
|
1169 + | #[derive(
|
1170 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1171 + | )]
|
1172 + | pub(crate) struct LengthString(pub(crate) ::std::string::String);
|
1173 + | #[allow(dead_code)]
|
1174 + | impl LengthString {
|
1175 + | /// Extracts a string slice containing the entire underlying `String`.
|
1176 + | pub fn as_str(&self) -> &str {
|
1177 + | &self.0
|
1434 1178 | }
|
1435 - | #[allow(missing_docs)] // documentation missing in model
|
1436 - | pub fn con_b_set(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
1437 - | self.con_b_set.as_deref()
|
1179 + |
|
1180 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1181 + | pub fn inner(&self) -> &::std::string::String {
|
1182 + | &self.0
|
1438 1183 | }
|
1439 - | #[allow(missing_docs)] // documentation missing in model
|
1440 - | pub fn con_b_map(
|
1441 - | &self,
|
1442 - | ) -> ::std::option::Option<
|
1443 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1444 - | > {
|
1445 - | self.con_b_map.as_ref()
|
1184 + |
|
1185 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1186 + | pub fn into_inner(self) -> ::std::string::String {
|
1187 + | self.0
|
1446 1188 | }
|
1447 - | #[allow(missing_docs)] // documentation missing in model
|
1448 - | pub fn length_map(
|
1449 - | &self,
|
1450 - | ) -> ::std::option::Option<
|
1451 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1452 - | > {
|
1453 - | self.length_map.as_ref()
|
1189 + | }
|
1190 + | impl LengthString {
|
1191 + | fn check_length(
|
1192 + | string: &str,
|
1193 + | ) -> ::std::result::Result<(), crate::model::length_string_internal::ConstraintViolation> {
|
1194 + | let length = string.chars().count();
|
1195 + |
|
1196 + | if (2..=69).contains(&length) {
|
1197 + | Ok(())
|
1198 + | } else {
|
1199 + | Err(crate::model::length_string_internal::ConstraintViolation::Length(length))
|
1454 1200 | }
|
1455 - | #[allow(missing_docs)] // documentation missing in model
|
1456 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
1457 - | &self,
|
1458 - | ) -> ::std::option::Option<
|
1459 - | &::std::collections::HashMap<
|
1460 - | ::std::string::String,
|
1461 - | ::std::collections::HashMap<
|
1462 - | ::std::string::String,
|
1463 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1464 - | >,
|
1465 - | >,
|
1466 - | > {
|
1467 - | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
1468 1201 | }
|
1469 - | #[allow(missing_docs)] // documentation missing in model
|
1470 - | pub fn sparse_map(
|
1471 - | &self,
|
1472 - | ) -> ::std::option::Option<
|
1473 - | &::std::collections::HashMap<
|
1474 - | ::std::string::String,
|
1475 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1476 - | >,
|
1477 - | > {
|
1478 - | self.sparse_map.as_ref()
|
1202 + | }
|
1203 + | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
1204 + | type Error = crate::model::length_string_internal::ConstraintViolation;
|
1205 + |
|
1206 + | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1207 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1208 + | Self::check_length(&value)?;
|
1209 + |
|
1210 + | Ok(Self(value))
|
1479 1211 | }
|
1480 - | #[allow(missing_docs)] // documentation missing in model
|
1481 - | pub fn sparse_list(
|
1482 - | &self,
|
1483 - | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1484 - | self.sparse_list.as_deref()
|
1212 + | }
|
1213 + | impl crate::constrained::Constrained for LengthString {
|
1214 + | type Unconstrained = ::std::string::String;
|
1215 + | }
|
1216 + |
|
1217 + | impl ::std::convert::From<::std::string::String>
|
1218 + | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
1219 + | {
|
1220 + | fn from(value: ::std::string::String) -> Self {
|
1221 + | Self::Unconstrained(value)
|
1485 1222 | }
|
1486 - | #[allow(missing_docs)] // documentation missing in model
|
1487 - | pub fn sparse_length_map(
|
1488 - | &self,
|
1489 - | ) -> ::std::option::Option<
|
1490 - | &::std::collections::HashMap<
|
1491 - | ::std::string::String,
|
1492 - | ::std::option::Option<::std::string::String>,
|
1493 - | >,
|
1494 - | > {
|
1495 - | self.sparse_length_map.as_ref()
|
1223 + | }
|
1224 + |
|
1225 + | impl ::std::fmt::Display for LengthString {
|
1226 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1227 + | self.0.fmt(f)
|
1496 1228 | }
|
1497 - | #[allow(missing_docs)] // documentation missing in model
|
1498 - | pub fn sparse_length_list(
|
1499 - | &self,
|
1500 - | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1501 - | self.sparse_length_list.as_deref()
|
1229 + | }
|
1230 + |
|
1231 + | impl ::std::convert::From<LengthString> for ::std::string::String {
|
1232 + | fn from(value: LengthString) -> Self {
|
1233 + | value.into_inner()
|
1502 1234 | }
|
1503 - | /// A union with constrained members.
|
1504 - | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
1505 - | self.constrained_union.as_ref()
|
1235 + | }
|
1236 + |
|
1237 + | #[allow(missing_docs)] // documentation missing in model
|
1238 + | ///
|
1239 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1240 + | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
1241 + | ///
|
1242 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1243 + | ///
|
1244 + | #[derive(
|
1245 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1246 + | )]
|
1247 + | pub(crate) struct RangeInteger(pub(crate) i32);
|
1248 + | #[allow(dead_code)]
|
1249 + | impl RangeInteger {
|
1250 + | /// Returns an immutable reference to the underlying [`i32`].
|
1251 + | pub fn inner(&self) -> &i32 {
|
1252 + | &self.0
|
1506 1253 | }
|
1507 - | #[allow(missing_docs)] // documentation missing in model
|
1508 - | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
1509 - | self.enum_string.as_ref()
|
1254 + |
|
1255 + | /// Consumes the value, returning the underlying [`i32`].
|
1256 + | pub fn into_inner(self) -> i32 {
|
1257 + | self.0
|
1510 1258 | }
|
1511 - | #[allow(missing_docs)] // documentation missing in model
|
1512 - | pub fn list_of_length_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1513 - | self.list_of_length_string.as_deref()
|
1259 + | }
|
1260 + |
|
1261 + | impl crate::constrained::Constrained for RangeInteger {
|
1262 + | type Unconstrained = i32;
|
1263 + | }
|
1264 + |
|
1265 + | impl ::std::convert::From<i32>
|
1266 + | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
1267 + | {
|
1268 + | fn from(value: i32) -> Self {
|
1269 + | Self::Unconstrained(value)
|
1514 1270 | }
|
1515 - | #[allow(missing_docs)] // documentation missing in model
|
1516 - | pub fn set_of_length_string(
|
1517 - | &self,
|
1518 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1519 - | self.set_of_length_string.as_ref()
|
1271 + | }
|
1272 + |
|
1273 + | impl ::std::fmt::Display for RangeInteger {
|
1274 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1275 + | self.0.fmt(f)
|
1520 1276 | }
|
1521 - | #[allow(missing_docs)] // documentation missing in model
|
1522 - | pub fn map_of_length_string(
|
1523 - | &self,
|
1524 - | ) -> ::std::option::Option<
|
1525 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1526 - | > {
|
1527 - | self.map_of_length_string.as_ref()
|
1277 + | }
|
1278 + |
|
1279 + | impl ::std::convert::From<RangeInteger> for i32 {
|
1280 + | fn from(value: RangeInteger) -> Self {
|
1281 + | value.into_inner()
|
1528 1282 | }
|
1529 - | #[allow(missing_docs)] // documentation missing in model
|
1530 - | pub fn list_of_length_blob(
|
1531 - | &self,
|
1532 - | ) -> ::std::option::Option<&[::aws_smithy_http_server_python::types::Blob]> {
|
1533 - | self.list_of_length_blob.as_deref()
|
1283 + | }
|
1284 + | impl RangeInteger {
|
1285 + | fn check_range(
|
1286 + | value: i32,
|
1287 + | ) -> ::std::result::Result<(), crate::model::range_integer_internal::ConstraintViolation> {
|
1288 + | if (0..=69).contains(&value) {
|
1289 + | Ok(())
|
1290 + | } else {
|
1291 + | Err(crate::model::range_integer_internal::ConstraintViolation::Range(value))
|
1534 1292 | }
|
1535 - | #[allow(missing_docs)] // documentation missing in model
|
1536 - | pub fn map_of_length_blob(
|
1537 - | &self,
|
1538 - | ) -> ::std::option::Option<
|
1539 - | &::std::collections::HashMap<
|
1540 - | ::std::string::String,
|
1541 - | ::aws_smithy_http_server_python::types::Blob,
|
1542 - | >,
|
1543 - | > {
|
1544 - | self.map_of_length_blob.as_ref()
|
1545 1293 | }
|
1546 - | #[allow(missing_docs)] // documentation missing in model
|
1547 - | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1548 - | self.list_of_range_integer.as_deref()
|
1294 + | }
|
1295 + | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
1296 + | type Error = crate::model::range_integer_internal::ConstraintViolation;
|
1297 + |
|
1298 + | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1299 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1300 + | Self::check_range(value)?;
|
1301 + |
|
1302 + | Ok(Self(value))
|
1549 1303 | }
|
1550 - | #[allow(missing_docs)] // documentation missing in model
|
1551 - | pub fn set_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1552 - | self.set_of_range_integer.as_deref()
|
1304 + | }
|
1305 + |
|
1306 + | #[allow(missing_docs)] // documentation missing in model
|
1307 + | ///
|
1308 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1309 + | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
1310 + | ///
|
1311 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1312 + | ///
|
1313 + | #[derive(
|
1314 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1315 + | )]
|
1316 + | pub(crate) struct RangeShort(pub(crate) i16);
|
1317 + | #[allow(dead_code)]
|
1318 + | impl RangeShort {
|
1319 + | /// Returns an immutable reference to the underlying [`i16`].
|
1320 + | pub fn inner(&self) -> &i16 {
|
1321 + | &self.0
|
1553 1322 | }
|
1554 - | #[allow(missing_docs)] // documentation missing in model
|
1555 - | pub fn map_of_range_integer(
|
1556 - | &self,
|
1557 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
1558 - | self.map_of_range_integer.as_ref()
|
1323 + |
|
1324 + | /// Consumes the value, returning the underlying [`i16`].
|
1325 + | pub fn into_inner(self) -> i16 {
|
1326 + | self.0
|
1559 1327 | }
|
1560 - | #[allow(missing_docs)] // documentation missing in model
|
1561 - | pub fn list_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1562 - | self.list_of_range_short.as_deref()
|
1328 + | }
|
1329 + |
|
1330 + | impl crate::constrained::Constrained for RangeShort {
|
1331 + | type Unconstrained = i16;
|
1332 + | }
|
1333 + |
|
1334 + | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
1335 + | fn from(value: i16) -> Self {
|
1336 + | Self::Unconstrained(value)
|
1563 1337 | }
|
1564 - | #[allow(missing_docs)] // documentation missing in model
|
1565 - | pub fn set_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1566 - | self.set_of_range_short.as_deref()
|
1338 + | }
|
1339 + |
|
1340 + | impl ::std::fmt::Display for RangeShort {
|
1341 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1342 + | self.0.fmt(f)
|
1567 1343 | }
|
1568 - | #[allow(missing_docs)] // documentation missing in model
|
1569 - | pub fn map_of_range_short(
|
1570 - | &self,
|
1571 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i16>> {
|
1572 - | self.map_of_range_short.as_ref()
|
1344 + | }
|
1345 + |
|
1346 + | impl ::std::convert::From<RangeShort> for i16 {
|
1347 + | fn from(value: RangeShort) -> Self {
|
1348 + | value.into_inner()
|
1573 1349 | }
|
1574 - | #[allow(missing_docs)] // documentation missing in model
|
1575 - | pub fn list_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1576 - | self.list_of_range_long.as_deref()
|
1350 + | }
|
1351 + | impl RangeShort {
|
1352 + | fn check_range(
|
1353 + | value: i16,
|
1354 + | ) -> ::std::result::Result<(), crate::model::range_short_internal::ConstraintViolation> {
|
1355 + | if (0..=10).contains(&value) {
|
1356 + | Ok(())
|
1357 + | } else {
|
1358 + | Err(crate::model::range_short_internal::ConstraintViolation::Range(value))
|
1577 1359 | }
|
1578 - | #[allow(missing_docs)] // documentation missing in model
|
1579 - | pub fn set_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1580 - | self.set_of_range_long.as_deref()
|
1581 1360 | }
|
1582 - | #[allow(missing_docs)] // documentation missing in model
|
1583 - | pub fn map_of_range_long(
|
1584 - | &self,
|
1585 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i64>> {
|
1586 - | self.map_of_range_long.as_ref()
|
1361 + | }
|
1362 + | impl ::std::convert::TryFrom<i16> for RangeShort {
|
1363 + | type Error = crate::model::range_short_internal::ConstraintViolation;
|
1364 + |
|
1365 + | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
1366 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
1367 + | Self::check_range(value)?;
|
1368 + |
|
1369 + | Ok(Self(value))
|
1587 1370 | }
|
1588 - | #[allow(missing_docs)] // documentation missing in model
|
1589 - | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1590 - | self.list_of_range_byte.as_deref()
|
1371 + | }
|
1372 + |
|
1373 + | #[allow(missing_docs)] // documentation missing in model
|
1374 + | ///
|
1375 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1376 + | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1377 + | ///
|
1378 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1379 + | ///
|
1380 + | #[derive(
|
1381 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1382 + | )]
|
1383 + | pub(crate) struct RangeLong(pub(crate) i64);
|
1384 + | #[allow(dead_code)]
|
1385 + | impl RangeLong {
|
1386 + | /// Returns an immutable reference to the underlying [`i64`].
|
1387 + | pub fn inner(&self) -> &i64 {
|
1388 + | &self.0
|
1591 1389 | }
|
1592 - | #[allow(missing_docs)] // documentation missing in model
|
1593 - | pub fn set_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1594 - | self.set_of_range_byte.as_deref()
|
1390 + |
|
1391 + | /// Consumes the value, returning the underlying [`i64`].
|
1392 + | pub fn into_inner(self) -> i64 {
|
1393 + | self.0
|
1595 1394 | }
|
1596 - | #[allow(missing_docs)] // documentation missing in model
|
1597 - | pub fn map_of_range_byte(
|
1598 - | &self,
|
1599 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i8>> {
|
1600 - | self.map_of_range_byte.as_ref()
|
1395 + | }
|
1396 + |
|
1397 + | impl crate::constrained::Constrained for RangeLong {
|
1398 + | type Unconstrained = i64;
|
1399 + | }
|
1400 + |
|
1401 + | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
1402 + | fn from(value: i64) -> Self {
|
1403 + | Self::Unconstrained(value)
|
1601 1404 | }
|
1602 - | #[allow(missing_docs)] // documentation missing in model
|
1603 - | pub fn non_streaming_blob(
|
1604 - | &self,
|
1605 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
1606 - | self.non_streaming_blob.as_ref()
|
1405 + | }
|
1406 + |
|
1407 + | impl ::std::fmt::Display for RangeLong {
|
1408 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1409 + | self.0.fmt(f)
|
1607 1410 | }
|
1608 - | #[allow(missing_docs)] // documentation missing in model
|
1609 - | pub fn pattern_string(&self) -> ::std::option::Option<&str> {
|
1610 - | self.pattern_string.as_deref()
|
1411 + | }
|
1412 + |
|
1413 + | impl ::std::convert::From<RangeLong> for i64 {
|
1414 + | fn from(value: RangeLong) -> Self {
|
1415 + | value.into_inner()
|
1611 1416 | }
|
1612 - | #[allow(missing_docs)] // documentation missing in model
|
1613 - | pub fn map_of_pattern_string(
|
1614 - | &self,
|
1615 - | ) -> ::std::option::Option<
|
1616 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1617 - | > {
|
1618 - | self.map_of_pattern_string.as_ref()
|
1417 + | }
|
1418 + | impl RangeLong {
|
1419 + | fn check_range(
|
1420 + | value: i64,
|
1421 + | ) -> ::std::result::Result<(), crate::model::range_long_internal::ConstraintViolation> {
|
1422 + | if (0..=10).contains(&value) {
|
1423 + | Ok(())
|
1424 + | } else {
|
1425 + | Err(crate::model::range_long_internal::ConstraintViolation::Range(value))
|
1619 1426 | }
|
1620 - | #[allow(missing_docs)] // documentation missing in model
|
1621 - | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1622 - | self.list_of_pattern_string.as_deref()
|
1623 1427 | }
|
1624 - | #[allow(missing_docs)] // documentation missing in model
|
1625 - | pub fn set_of_pattern_string(
|
1626 - | &self,
|
1627 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1628 - | self.set_of_pattern_string.as_ref()
|
1428 + | }
|
1429 + | impl ::std::convert::TryFrom<i64> for RangeLong {
|
1430 + | type Error = crate::model::range_long_internal::ConstraintViolation;
|
1431 + |
|
1432 + | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1433 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1434 + | Self::check_range(value)?;
|
1435 + |
|
1436 + | Ok(Self(value))
|
1629 1437 | }
|
1630 - | #[allow(missing_docs)] // documentation missing in model
|
1631 - | pub fn length_length_pattern_string(&self) -> ::std::option::Option<&str> {
|
1632 - | self.length_length_pattern_string.as_deref()
|
1438 + | }
|
1439 + |
|
1440 + | #[allow(missing_docs)] // documentation missing in model
|
1441 + | ///
|
1442 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1443 + | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
1444 + | ///
|
1445 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1446 + | ///
|
1447 + | #[derive(
|
1448 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1449 + | )]
|
1450 + | pub(crate) struct RangeByte(pub(crate) i8);
|
1451 + | #[allow(dead_code)]
|
1452 + | impl RangeByte {
|
1453 + | /// Returns an immutable reference to the underlying [`i8`].
|
1454 + | pub fn inner(&self) -> &i8 {
|
1455 + | &self.0
|
1633 1456 | }
|
1634 - | #[allow(missing_docs)] // documentation missing in model
|
1635 - | pub fn map_of_length_pattern_string(
|
1636 - | &self,
|
1637 - | ) -> ::std::option::Option<
|
1638 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1639 - | > {
|
1640 - | self.map_of_length_pattern_string.as_ref()
|
1457 + |
|
1458 + | /// Consumes the value, returning the underlying [`i8`].
|
1459 + | pub fn into_inner(self) -> i8 {
|
1460 + | self.0
|
1641 1461 | }
|
1642 - | #[allow(missing_docs)] // documentation missing in model
|
1643 - | pub fn list_of_length_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1644 - | self.list_of_length_pattern_string.as_deref()
|
1462 + | }
|
1463 + |
|
1464 + | impl crate::constrained::Constrained for RangeByte {
|
1465 + | type Unconstrained = i8;
|
1466 + | }
|
1467 + |
|
1468 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
1469 + | fn from(value: i8) -> Self {
|
1470 + | Self::Unconstrained(value)
|
1645 1471 | }
|
1646 - | #[allow(missing_docs)] // documentation missing in model
|
1647 - | pub fn set_of_length_pattern_string(
|
1648 - | &self,
|
1649 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1650 - | self.set_of_length_pattern_string.as_ref()
|
1472 + | }
|
1473 + |
|
1474 + | impl ::std::fmt::Display for RangeByte {
|
1475 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1476 + | self.0.fmt(f)
|
1651 1477 | }
|
1652 - | #[allow(missing_docs)] // documentation missing in model
|
1653 - | pub fn length_list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1654 - | self.length_list_of_pattern_string.as_deref()
|
1478 + | }
|
1479 + |
|
1480 + | impl ::std::convert::From<RangeByte> for i8 {
|
1481 + | fn from(value: RangeByte) -> Self {
|
1482 + | value.into_inner()
|
1483 + | }
|
1484 + | }
|
1485 + | impl RangeByte {
|
1486 + | fn check_range(
|
1487 + | value: i8,
|
1488 + | ) -> ::std::result::Result<(), crate::model::range_byte_internal::ConstraintViolation> {
|
1489 + | if (0..=10).contains(&value) {
|
1490 + | Ok(())
|
1491 + | } else {
|
1492 + | Err(crate::model::range_byte_internal::ConstraintViolation::Range(value))
|
1655 1493 | }
|
1656 - | #[allow(missing_docs)] // documentation missing in model
|
1657 - | pub fn length_set_of_pattern_string(
|
1658 - | &self,
|
1659 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1660 - | self.length_set_of_pattern_string.as_ref()
|
1661 - | }
|
1662 - | }
|
1663 - | #[allow(clippy::new_without_default)]
|
1664 - | #[allow(clippy::too_many_arguments)]
|
1665 - | #[::pyo3::pymethods]
|
1666 - | impl ConA {
|
1667 - | #[new]
|
1668 - | pub fn new(
|
1669 - | con_b: crate::model::ConB,
|
1670 - | range_integer: i32,
|
1671 - | min_range_integer: i32,
|
1672 - | max_range_integer: i32,
|
1673 - | fixed_value_integer: i32,
|
1674 - | range_short: i16,
|
1675 - | min_range_short: i16,
|
1676 - | max_range_short: i16,
|
1677 - | fixed_value_short: i16,
|
1678 - | range_long: i64,
|
1679 - | min_range_long: i64,
|
1680 - | max_range_long: i64,
|
1681 - | fixed_value_long: i64,
|
1682 - | range_byte: i8,
|
1683 - | min_range_byte: i8,
|
1684 - | max_range_byte: i8,
|
1685 - | fixed_value_byte: i8,
|
1686 - | opt_con_b: ::std::option::Option<crate::model::ConB>,
|
1687 - | length_string: ::std::option::Option<::std::string::String>,
|
1688 - | min_length_string: ::std::option::Option<::std::string::String>,
|
1689 - | max_length_string: ::std::option::Option<::std::string::String>,
|
1690 - | fixed_length_string: ::std::option::Option<::std::string::String>,
|
1691 - | length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1692 - | min_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1693 - | max_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1694 - | fixed_length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1695 - | con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
1696 - | length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1697 - | sensitive_length_list: ::std::option::Option<
|
1698 - | ::std::vec::Vec<crate::model::SensitiveStructure>,
|
1699 - | >,
|
1700 - | con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
1701 - | con_b_map: ::std::option::Option<
|
1702 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1703 - | >,
|
1704 - | length_map: ::std::option::Option<
|
1705 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1706 - | >,
|
1707 - | map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
1708 - | ::std::collections::HashMap<
|
1709 - | ::std::string::String,
|
1710 - | ::std::collections::HashMap<
|
1711 - | ::std::string::String,
|
1712 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1713 - | >,
|
1714 - | >,
|
1715 - | >,
|
1716 - | sparse_map: ::std::option::Option<
|
1717 - | ::std::collections::HashMap<
|
1718 - | ::std::string::String,
|
1719 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1720 - | >,
|
1721 - | >,
|
1722 - | sparse_list: ::std::option::Option<
|
1723 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
1724 - | >,
|
1725 - | sparse_length_map: ::std::option::Option<
|
1726 - | ::std::collections::HashMap<
|
1727 - | ::std::string::String,
|
1728 - | ::std::option::Option<::std::string::String>,
|
1729 - | >,
|
1730 - | >,
|
1731 - | sparse_length_list: ::std::option::Option<
|
1732 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
1733 - | >,
|
1734 - | constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
1735 - | enum_string: ::std::option::Option<crate::model::EnumString>,
|
1736 - | list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1737 - | set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1738 - | map_of_length_string: ::std::option::Option<
|
1739 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1740 - | >,
|
1741 - | list_of_length_blob: ::std::option::Option<
|
1742 - | ::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>,
|
1743 - | >,
|
1744 - | map_of_length_blob: ::std::option::Option<
|
1745 - | ::std::collections::HashMap<
|
1746 - | ::std::string::String,
|
1747 - | ::aws_smithy_http_server_python::types::Blob,
|
1748 - | >,
|
1749 - | >,
|
1750 - | list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
1751 - | set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
1752 - | map_of_range_integer: ::std::option::Option<
|
1753 - | ::std::collections::HashMap<::std::string::String, i32>,
|
1754 - | >,
|
1755 - | list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
1756 - | set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
1757 - | map_of_range_short: ::std::option::Option<
|
1758 - | ::std::collections::HashMap<::std::string::String, i16>,
|
1759 - | >,
|
1760 - | list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
1761 - | set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
1762 - | map_of_range_long: ::std::option::Option<
|
1763 - | ::std::collections::HashMap<::std::string::String, i64>,
|
1764 - | >,
|
1765 - | list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
1766 - | set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
1767 - | map_of_range_byte: ::std::option::Option<
|
1768 - | ::std::collections::HashMap<::std::string::String, i8>,
|
1769 - | >,
|
1770 - | non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
1771 - | pattern_string: ::std::option::Option<::std::string::String>,
|
1772 - | map_of_pattern_string: ::std::option::Option<
|
1773 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1774 - | >,
|
1775 - | list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1776 - | set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1777 - | length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
1778 - | map_of_length_pattern_string: ::std::option::Option<
|
1779 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1780 - | >,
|
1781 - | list_of_length_pattern_string: ::std::option::Option<
|
1782 - | ::std::vec::Vec<::std::string::String>,
|
1783 - | >,
|
1784 - | set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1785 - | length_list_of_pattern_string: ::std::option::Option<
|
1786 - | ::std::vec::Vec<::std::string::String>,
|
1787 - | >,
|
1788 - | length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1789 - | ) -> Self {
|
1790 - | Self {
|
1791 - | con_b,
|
1792 - | range_integer,
|
1793 - | min_range_integer,
|
1794 - | max_range_integer,
|
1795 - | fixed_value_integer,
|
1796 - | range_short,
|
1797 - | min_range_short,
|
1798 - | max_range_short,
|
1799 - | fixed_value_short,
|
1800 - | range_long,
|
1801 - | min_range_long,
|
1802 - | max_range_long,
|
1803 - | fixed_value_long,
|
1804 - | range_byte,
|
1805 - | min_range_byte,
|
1806 - | max_range_byte,
|
1807 - | fixed_value_byte,
|
1808 - | opt_con_b,
|
1809 - | length_string,
|
1810 - | min_length_string,
|
1811 - | max_length_string,
|
1812 - | fixed_length_string,
|
1813 - | length_blob,
|
1814 - | min_length_blob,
|
1815 - | max_length_blob,
|
1816 - | fixed_length_blob,
|
1817 - | con_b_list,
|
1818 - | length_list,
|
1819 - | sensitive_length_list,
|
1820 - | con_b_set,
|
1821 - | con_b_map,
|
1822 - | length_map,
|
1823 - | map_of_map_of_list_of_list_of_con_b,
|
1824 - | sparse_map,
|
1825 - | sparse_list,
|
1826 - | sparse_length_map,
|
1827 - | sparse_length_list,
|
1828 - | constrained_union,
|
1829 - | enum_string,
|
1830 - | list_of_length_string,
|
1831 - | set_of_length_string,
|
1832 - | map_of_length_string,
|
1833 - | list_of_length_blob,
|
1834 - | map_of_length_blob,
|
1835 - | list_of_range_integer,
|
1836 - | set_of_range_integer,
|
1837 - | map_of_range_integer,
|
1838 - | list_of_range_short,
|
1839 - | set_of_range_short,
|
1840 - | map_of_range_short,
|
1841 - | list_of_range_long,
|
1842 - | set_of_range_long,
|
1843 - | map_of_range_long,
|
1844 - | list_of_range_byte,
|
1845 - | set_of_range_byte,
|
1846 - | map_of_range_byte,
|
1847 - | non_streaming_blob,
|
1848 - | pattern_string,
|
1849 - | map_of_pattern_string,
|
1850 - | list_of_pattern_string,
|
1851 - | set_of_pattern_string,
|
1852 - | length_length_pattern_string,
|
1853 - | map_of_length_pattern_string,
|
1854 - | list_of_length_pattern_string,
|
1855 - | set_of_length_pattern_string,
|
1856 - | length_list_of_pattern_string,
|
1857 - | length_set_of_pattern_string,
|
1858 - | }
|
1859 - | }
|
1860 - | fn __repr__(&self) -> String {
|
1861 - | format!("{self:?}")
|
1862 - | }
|
1863 - | fn __str__(&self) -> String {
|
1864 - | format!("{self:?}")
|
1865 - | }
|
1866 - | }
|
1867 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ConA> {
|
1868 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1869 - | ob.extract::<ConA>().map(Box::new)
|
1870 1494 | }
|
1871 1495 | }
|
1496 + | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1497 + | type Error = crate::model::range_byte_internal::ConstraintViolation;
|
1872 1498 |
|
1873 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ConA> {
|
1874 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1875 - | (*self).into_py(py)
|
1876 - | }
|
1877 - | }
|
1878 - | impl crate::constrained::Constrained for crate::model::ConA {
|
1879 - | type Unconstrained = crate::model::con_a_internal::Builder;
|
1880 - | }
|
1881 - | impl ConA {
|
1882 - | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
1883 - | pub fn builder() -> crate::model::con_a::Builder {
|
1884 - | crate::model::con_a::Builder::default()
|
1499 + | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1500 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1501 + | Self::check_range(value)?;
|
1502 + |
|
1503 + | Ok(Self(value))
|
1885 1504 | }
|
1886 1505 | }
|
1887 1506 |
|
1507 + | #[::pyo3::pyclass]
|
1888 1508 | #[allow(missing_docs)] // documentation missing in model
|
1889 - | ///
|
1890 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1891 - | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1892 - | ///
|
1893 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1894 - | ///
|
1895 1509 | #[derive(
|
1896 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1510 + | ::std::clone::Clone,
|
1511 + | ::std::cmp::Eq,
|
1512 + | ::std::cmp::Ord,
|
1513 + | ::std::cmp::PartialEq,
|
1514 + | ::std::cmp::PartialOrd,
|
1515 + | ::std::fmt::Debug,
|
1516 + | ::std::hash::Hash,
|
1897 1517 | )]
|
1898 - | pub(crate) struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1899 - | impl LengthSetOfPatternString {
|
1900 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1901 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1902 - | self.0
|
1903 - | }
|
1518 + | pub enum EnumString {
|
1519 + | #[allow(missing_docs)] // documentation missing in model
|
1520 + | M256Mega,
|
1521 + | #[allow(missing_docs)] // documentation missing in model
|
1522 + | T2Micro,
|
1523 + | #[allow(missing_docs)] // documentation missing in model
|
1524 + | T2Nano,
|
1525 + | }
|
1526 + | pub(crate) mod enum_string_internal {
|
1527 + | #[derive(Debug, PartialEq)]
|
1528 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
1904 1529 |
|
1905 - | fn check_length(
|
1906 - | length: usize,
|
1907 - | ) -> ::std::result::Result<
|
1908 - | (),
|
1909 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1910 - | > {
|
1911 - | if (5..=9).contains(&length) {
|
1912 - | Ok(())
|
1913 - | } else {
|
1914 - | Err(
|
1915 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation::Length(
|
1916 - | length,
|
1917 - | ),
|
1530 + | impl ::std::fmt::Display for ConstraintViolation {
|
1531 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1532 + | write!(
|
1533 + | f,
|
1534 + | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
1918 1535 | )
|
1919 1536 | }
|
1920 1537 | }
|
1921 1538 |
|
1922 - | fn check_unique_items(
|
1923 - | items: ::std::vec::Vec<crate::model::PatternString>,
|
1924 - | ) -> ::std::result::Result<
|
1925 - | ::std::vec::Vec<crate::model::PatternString>,
|
1926 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1927 - | > {
|
1928 - | let mut seen = ::std::collections::HashMap::new();
|
1929 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
1930 - | for (idx, item) in items.iter().enumerate() {
|
1931 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
1932 - | duplicate_indices.push(prev_idx);
|
1933 - | }
|
1539 + | impl ::std::error::Error for ConstraintViolation {}
|
1540 + | impl ConstraintViolation {
|
1541 + | pub(crate) fn as_validation_exception_field(
|
1542 + | self,
|
1543 + | path: ::std::string::String,
|
1544 + | ) -> crate::model::ValidationExceptionField {
|
1545 + | crate::model::ValidationExceptionField {
|
1546 + | message: format!(
|
1547 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
1548 + | &path
|
1549 + | ),
|
1550 + | path,
|
1934 1551 | }
|
1935 - |
|
1936 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1937 - | for idx in &duplicate_indices {
|
1938 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1939 - | last_duplicate_indices.push(prev_idx);
|
1940 1552 | }
|
1941 1553 | }
|
1942 - | duplicate_indices.extend(last_duplicate_indices);
|
1943 - |
|
1944 - | if !duplicate_indices.is_empty() {
|
1945 - | debug_assert!(duplicate_indices.len() >= 2);
|
1946 - | Err(crate::model::length_set_of_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1947 - | } else {
|
1948 - | Ok(items)
|
1554 + | }
|
1555 + | impl ::std::convert::TryFrom<&str> for EnumString {
|
1556 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
1557 + | fn try_from(
|
1558 + | s: &str,
|
1559 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1560 + | match s {
|
1561 + | "m256.mega" => Ok(EnumString::M256Mega),
|
1562 + | "t2.micro" => Ok(EnumString::T2Micro),
|
1563 + | "t2.nano" => Ok(EnumString::T2Nano),
|
1564 + | _ => Err(crate::model::enum_string_internal::ConstraintViolation(
|
1565 + | s.to_owned(),
|
1566 + | )),
|
1949 1567 | }
|
1950 1568 | }
|
1951 1569 | }
|
1952 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1953 - | for LengthSetOfPatternString
|
1954 - | {
|
1955 - | type Error = crate::model::length_set_of_pattern_string_internal::ConstraintViolation;
|
1956 - |
|
1957 - | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1570 + | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
1571 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
1958 1572 | fn try_from(
|
1959 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
1960 - | ) -> ::std::result::Result<Self, Self::Error> {
|
1961 - | Self::check_length(value.len())?;
|
1962 - |
|
1963 - | let value = Self::check_unique_items(value)?;
|
1964 - |
|
1965 - | Ok(Self(value))
|
1573 + | s: ::std::string::String,
|
1574 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1575 + | {
|
1576 + | s.as_str().try_into()
|
1966 1577 | }
|
1967 1578 | }
|
1968 - |
|
1969 - | impl ::std::convert::From<LengthSetOfPatternString>
|
1970 - | for ::std::vec::Vec<crate::model::PatternString>
|
1971 - | {
|
1972 - | fn from(value: LengthSetOfPatternString) -> Self {
|
1973 - | value.into_inner()
|
1579 + | impl std::str::FromStr for EnumString {
|
1580 + | type Err = crate::model::enum_string_internal::ConstraintViolation;
|
1581 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1582 + | Self::try_from(s)
|
1974 1583 | }
|
1975 1584 | }
|
1976 - | impl ::std::convert::From<LengthSetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1977 - | fn from(value: LengthSetOfPatternString) -> Self {
|
1978 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1585 + | impl EnumString {
|
1586 + | /// Returns the `&str` value of the enum member.
|
1587 + | pub fn as_str(&self) -> &str {
|
1588 + | match self {
|
1589 + | EnumString::M256Mega => "m256.mega",
|
1590 + | EnumString::T2Micro => "t2.micro",
|
1591 + | EnumString::T2Nano => "t2.nano",
|
1592 + | }
|
1593 + | }
|
1594 + | /// Returns all the `&str` representations of the enum members.
|
1595 + | pub const fn values() -> &'static [&'static str] {
|
1596 + | &["m256.mega", "t2.micro", "t2.nano"]
|
1979 1597 | }
|
1980 1598 | }
|
1981 - | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1982 - | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1599 + | impl ::std::convert::AsRef<str> for EnumString {
|
1600 + | fn as_ref(&self) -> &str {
|
1601 + | self.as_str()
|
1602 + | }
|
1603 + | }
|
1604 + | #[::pyo3::pymethods]
|
1605 + | impl EnumString {
|
1606 + | #[getter]
|
1607 + | pub fn name(&self) -> &str {
|
1608 + | match self {
|
1609 + | EnumString::M256Mega => "M256Mega",
|
1610 + | EnumString::T2Micro => "T2Micro",
|
1611 + | EnumString::T2Nano => "T2Nano",
|
1612 + | }
|
1613 + | }
|
1614 + | #[getter]
|
1615 + | pub fn value(&self) -> &str {
|
1616 + | self.as_str()
|
1617 + | }
|
1618 + | fn __repr__(&self) -> String {
|
1619 + | self.as_str().to_owned()
|
1620 + | }
|
1621 + | fn __str__(&self) -> String {
|
1622 + | self.as_str().to_owned()
|
1623 + | }
|
1624 + | }
|
1625 + | impl crate::constrained::Constrained for EnumString {
|
1626 + | type Unconstrained = ::std::string::String;
|
1627 + | }
|
1628 + |
|
1629 + | impl ::std::convert::From<::std::string::String>
|
1630 + | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
1631 + | {
|
1632 + | fn from(value: ::std::string::String) -> Self {
|
1633 + | Self::Unconstrained(value)
|
1634 + | }
|
1983 1635 | }
|
1984 1636 |
|
1985 1637 | #[allow(missing_docs)] // documentation missing in model
|
1986 1638 | ///
|
1987 1639 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1988 - | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
1640 + | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
1989 1641 | ///
|
1990 1642 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1991 1643 | ///
|
1992 1644 | #[derive(
|
1993 1645 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1994 1646 | )]
|
1995 - | pub(crate) struct SetOfLengthPatternString(
|
1996 - | pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>,
|
1997 - | );
|
1998 - | impl SetOfLengthPatternString {
|
1999 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
2000 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
1647 + | pub(crate) struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
1648 + | impl SetOfLengthString {
|
1649 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
1650 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
2001 1651 | self.0
|
2002 1652 | }
|
2003 1653 |
|
2004 1654 | fn check_unique_items(
|
2005 - | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1655 + | items: ::std::vec::Vec<crate::model::LengthString>,
|
2006 1656 | ) -> ::std::result::Result<
|
2007 - | ::std::vec::Vec<crate::model::LengthPatternString>,
|
2008 - | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
1657 + | ::std::vec::Vec<crate::model::LengthString>,
|
1658 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
2009 1659 | > {
|
2010 1660 | let mut seen = ::std::collections::HashMap::new();
|
2011 1661 | let mut duplicate_indices = ::std::vec::Vec::new();
|
2012 1662 | for (idx, item) in items.iter().enumerate() {
|
2013 1663 | if let Some(prev_idx) = seen.insert(item, idx) {
|
2014 1664 | duplicate_indices.push(prev_idx);
|
2015 1665 | }
|
2016 1666 | }
|
2017 1667 |
|
2018 1668 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2019 1669 | for idx in &duplicate_indices {
|
2020 1670 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2021 1671 | last_duplicate_indices.push(prev_idx);
|
2022 1672 | }
|
2023 1673 | }
|
2024 1674 | duplicate_indices.extend(last_duplicate_indices);
|
2025 1675 |
|
2026 1676 | if !duplicate_indices.is_empty() {
|
2027 1677 | debug_assert!(duplicate_indices.len() >= 2);
|
2028 - | Err(crate::model::set_of_length_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1678 + | Err(
|
1679 + | crate::model::set_of_length_string_internal::ConstraintViolation::UniqueItems {
|
1680 + | duplicate_indices,
|
1681 + | original: items,
|
1682 + | },
|
1683 + | )
|
2029 1684 | } else {
|
2030 1685 | Ok(items)
|
2031 1686 | }
|
2032 1687 | }
|
2033 1688 | }
|
2034 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
2035 - | for SetOfLengthPatternString
|
2036 - | {
|
2037 - | type Error = crate::model::set_of_length_pattern_string_internal::ConstraintViolation;
|
1689 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
1690 + | type Error = crate::model::set_of_length_string_internal::ConstraintViolation;
|
2038 1691 |
|
2039 - | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1692 + | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
2040 1693 | fn try_from(
|
2041 - | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1694 + | value: ::std::vec::Vec<crate::model::LengthString>,
|
2042 1695 | ) -> ::std::result::Result<Self, Self::Error> {
|
2043 1696 | let value = Self::check_unique_items(value)?;
|
2044 1697 |
|
2045 1698 | Ok(Self(value))
|
2046 1699 | }
|
2047 1700 | }
|
2048 1701 |
|
2049 - | impl ::std::convert::From<SetOfLengthPatternString>
|
2050 - | for ::std::vec::Vec<crate::model::LengthPatternString>
|
2051 - | {
|
2052 - | fn from(value: SetOfLengthPatternString) -> Self {
|
1702 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
1703 + | fn from(value: SetOfLengthString) -> Self {
|
2053 1704 | value.into_inner()
|
2054 1705 | }
|
2055 1706 | }
|
2056 - | impl ::std::convert::From<SetOfLengthPatternString> for ::std::vec::Vec<::std::string::String> {
|
2057 - | fn from(value: SetOfLengthPatternString) -> Self {
|
1707 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
|
1708 + | fn from(value: SetOfLengthString) -> Self {
|
2058 1709 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2059 1710 | }
|
2060 1711 | }
|
2061 - | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
2062 - | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
1712 + | impl crate::constrained::Constrained for SetOfLengthString {
|
1713 + | type Unconstrained =
|
1714 + | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
2063 1715 | }
|
2064 1716 |
|
2065 1717 | #[allow(missing_docs)] // documentation missing in model
|
2066 1718 | ///
|
2067 1719 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2068 - | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
1720 + | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
2069 1721 | ///
|
2070 1722 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2071 1723 | ///
|
2072 1724 | #[derive(
|
2073 1725 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2074 1726 | )]
|
2075 - | pub(crate) struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
2076 - | impl SetOfPatternString {
|
1727 + | pub(crate) struct LengthListOfPatternString(
|
1728 + | pub(crate) ::std::vec::Vec<crate::model::PatternString>,
|
1729 + | );
|
1730 + | impl LengthListOfPatternString {
|
2077 1731 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
2078 1732 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
2079 1733 | self.0
|
2080 1734 | }
|
2081 1735 |
|
2082 - | fn check_unique_items(
|
2083 - | items: ::std::vec::Vec<crate::model::PatternString>,
|
1736 + | fn check_length(
|
1737 + | length: usize,
|
2084 1738 | ) -> ::std::result::Result<
|
2085 - | ::std::vec::Vec<crate::model::PatternString>,
|
2086 - | crate::model::set_of_pattern_string_internal::ConstraintViolation,
|
1739 + | (),
|
1740 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
2087 1741 | > {
|
2088 - | let mut seen = ::std::collections::HashMap::new();
|
2089 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2090 - | for (idx, item) in items.iter().enumerate() {
|
2091 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2092 - | duplicate_indices.push(prev_idx);
|
2093 - | }
|
2094 - | }
|
2095 - |
|
2096 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2097 - | for idx in &duplicate_indices {
|
2098 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2099 - | last_duplicate_indices.push(prev_idx);
|
2100 - | }
|
2101 - | }
|
2102 - | duplicate_indices.extend(last_duplicate_indices);
|
2103 - |
|
2104 - | if !duplicate_indices.is_empty() {
|
2105 - | debug_assert!(duplicate_indices.len() >= 2);
|
1742 + | if (12..=39).contains(&length) {
|
1743 + | Ok(())
|
1744 + | } else {
|
2106 1745 | Err(
|
2107 - | crate::model::set_of_pattern_string_internal::ConstraintViolation::UniqueItems {
|
2108 - | duplicate_indices,
|
2109 - | original: items,
|
2110 - | },
|
1746 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation::Length(
|
1747 + | length,
|
1748 + | ),
|
2111 1749 | )
|
2112 - | } else {
|
2113 - | Ok(items)
|
2114 1750 | }
|
2115 1751 | }
|
2116 1752 | }
|
2117 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
2118 - | type Error = crate::model::set_of_pattern_string_internal::ConstraintViolation;
|
1753 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1754 + | for LengthListOfPatternString
|
1755 + | {
|
1756 + | type Error = crate::model::length_list_of_pattern_string_internal::ConstraintViolation;
|
2119 1757 |
|
2120 - | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1758 + | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
2121 1759 | fn try_from(
|
2122 1760 | value: ::std::vec::Vec<crate::model::PatternString>,
|
2123 1761 | ) -> ::std::result::Result<Self, Self::Error> {
|
2124 - | let value = Self::check_unique_items(value)?;
|
1762 + | Self::check_length(value.len())?;
|
2125 1763 |
|
2126 1764 | Ok(Self(value))
|
2127 1765 | }
|
2128 1766 | }
|
2129 1767 |
|
2130 - | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
2131 - | fn from(value: SetOfPatternString) -> Self {
|
1768 + | impl ::std::convert::From<LengthListOfPatternString>
|
1769 + | for ::std::vec::Vec<crate::model::PatternString>
|
1770 + | {
|
1771 + | fn from(value: LengthListOfPatternString) -> Self {
|
2132 1772 | value.into_inner()
|
2133 1773 | }
|
2134 1774 | }
|
2135 - | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
2136 - | fn from(value: SetOfPatternString) -> Self {
|
1775 + | impl ::std::convert::From<LengthListOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1776 + | fn from(value: LengthListOfPatternString) -> Self {
|
2137 1777 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2138 1778 | }
|
2139 1779 | }
|
2140 - | impl crate::constrained::Constrained for SetOfPatternString {
|
2141 - | type Unconstrained =
|
2142 - | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
1780 + | impl crate::constrained::Constrained for LengthListOfPatternString {
|
1781 + | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
2143 1782 | }
|
2144 1783 |
|
2145 1784 | #[allow(missing_docs)] // documentation missing in model
|
2146 1785 | ///
|
2147 1786 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2148 - | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
1787 + | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
2149 1788 | ///
|
2150 1789 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2151 1790 | ///
|
2152 1791 | #[derive(
|
2153 1792 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2154 1793 | )]
|
2155 - | pub(crate) struct RangeByte(pub(crate) i8);
|
2156 - | #[allow(dead_code)]
|
2157 - | impl RangeByte {
|
2158 - | /// Returns an immutable reference to the underlying [`i8`].
|
2159 - | pub fn inner(&self) -> &i8 {
|
2160 - | &self.0
|
2161 - | }
|
2162 - |
|
2163 - | /// Consumes the value, returning the underlying [`i8`].
|
2164 - | pub fn into_inner(self) -> i8 {
|
1794 + | pub(crate) struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1795 + | impl LengthSetOfPatternString {
|
1796 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1797 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
2165 1798 | self.0
|
2166 1799 | }
|
2167 - | }
|
2168 1800 |
|
2169 - | impl crate::constrained::Constrained for RangeByte {
|
2170 - | type Unconstrained = i8;
|
2171 - | }
|
2172 - |
|
2173 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
2174 - | fn from(value: i8) -> Self {
|
2175 - | Self::Unconstrained(value)
|
1801 + | fn check_length(
|
1802 + | length: usize,
|
1803 + | ) -> ::std::result::Result<
|
1804 + | (),
|
1805 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1806 + | > {
|
1807 + | if (5..=9).contains(&length) {
|
1808 + | Ok(())
|
1809 + | } else {
|
1810 + | Err(
|
1811 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation::Length(
|
1812 + | length,
|
1813 + | ),
|
1814 + | )
|
1815 + | }
|
2176 1816 | }
|
2177 - | }
|
2178 1817 |
|
2179 - | impl ::std::fmt::Display for RangeByte {
|
2180 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2181 - | self.0.fmt(f)
|
1818 + | fn check_unique_items(
|
1819 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
1820 + | ) -> ::std::result::Result<
|
1821 + | ::std::vec::Vec<crate::model::PatternString>,
|
1822 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1823 + | > {
|
1824 + | let mut seen = ::std::collections::HashMap::new();
|
1825 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1826 + | for (idx, item) in items.iter().enumerate() {
|
1827 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1828 + | duplicate_indices.push(prev_idx);
|
1829 + | }
|
2182 1830 | }
|
2183 - | }
|
2184 1831 |
|
2185 - | impl ::std::convert::From<RangeByte> for i8 {
|
2186 - | fn from(value: RangeByte) -> Self {
|
2187 - | value.into_inner()
|
1832 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1833 + | for idx in &duplicate_indices {
|
1834 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1835 + | last_duplicate_indices.push(prev_idx);
|
2188 1836 | }
|
2189 - | }
|
2190 - | impl RangeByte {
|
2191 - | fn check_range(
|
2192 - | value: i8,
|
2193 - | ) -> ::std::result::Result<(), crate::model::range_byte_internal::ConstraintViolation> {
|
2194 - | if (0..=10).contains(&value) {
|
2195 - | Ok(())
|
1837 + | }
|
1838 + | duplicate_indices.extend(last_duplicate_indices);
|
1839 + |
|
1840 + | if !duplicate_indices.is_empty() {
|
1841 + | debug_assert!(duplicate_indices.len() >= 2);
|
1842 + | Err(crate::model::length_set_of_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
2196 1843 | } else {
|
2197 - | Err(crate::model::range_byte_internal::ConstraintViolation::Range(value))
|
1844 + | Ok(items)
|
2198 1845 | }
|
2199 1846 | }
|
2200 1847 | }
|
2201 - | impl ::std::convert::TryFrom<i8> for RangeByte {
|
2202 - | type Error = crate::model::range_byte_internal::ConstraintViolation;
|
1848 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1849 + | for LengthSetOfPatternString
|
1850 + | {
|
1851 + | type Error = crate::model::length_set_of_pattern_string_internal::ConstraintViolation;
|
2203 1852 |
|
2204 - | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2205 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2206 - | Self::check_range(value)?;
|
1853 + | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1854 + | fn try_from(
|
1855 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
1856 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1857 + | Self::check_length(value.len())?;
|
1858 + |
|
1859 + | let value = Self::check_unique_items(value)?;
|
2207 1860 |
|
2208 1861 | Ok(Self(value))
|
2209 1862 | }
|
2210 1863 | }
|
2211 1864 |
|
1865 + | impl ::std::convert::From<LengthSetOfPatternString>
|
1866 + | for ::std::vec::Vec<crate::model::PatternString>
|
1867 + | {
|
1868 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1869 + | value.into_inner()
|
1870 + | }
|
1871 + | }
|
1872 + | impl ::std::convert::From<LengthSetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1873 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1874 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1875 + | }
|
1876 + | }
|
1877 + | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1878 + | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1879 + | }
|
1880 + |
|
2212 1881 | #[allow(missing_docs)] // documentation missing in model
|
2213 1882 | ///
|
2214 1883 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2215 1884 | /// [constraint traits]. Use [`SetOfRangeByte::try_from`] to construct values of this type.
|
2216 1885 | ///
|
2217 1886 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2218 1887 | ///
|
2219 1888 | #[derive(
|
2220 1889 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2221 1890 | )]
|
2285 1954 | }
|
2286 1955 | }
|
2287 1956 | impl crate::constrained::Constrained for SetOfRangeByte {
|
2288 1957 | type Unconstrained =
|
2289 1958 | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained;
|
2290 1959 | }
|
2291 1960 |
|
2292 1961 | #[allow(missing_docs)] // documentation missing in model
|
2293 1962 | ///
|
2294 1963 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2295 - | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1964 + | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
2296 1965 | ///
|
2297 1966 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2298 1967 | ///
|
2299 1968 | #[derive(
|
2300 1969 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2301 1970 | )]
|
2302 - | pub(crate) struct RangeLong(pub(crate) i64);
|
2303 - | #[allow(dead_code)]
|
2304 - | impl RangeLong {
|
2305 - | /// Returns an immutable reference to the underlying [`i64`].
|
2306 - | pub fn inner(&self) -> &i64 {
|
2307 - | &self.0
|
1971 + | pub(crate) struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1972 + | impl SetOfRangeShort {
|
1973 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1974 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1975 + | self.0
|
2308 1976 | }
|
2309 1977 |
|
2310 - | /// Consumes the value, returning the underlying [`i64`].
|
2311 - | pub fn into_inner(self) -> i64 {
|
2312 - | self.0
|
1978 + | fn check_unique_items(
|
1979 + | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1980 + | ) -> ::std::result::Result<
|
1981 + | ::std::vec::Vec<crate::model::RangeShort>,
|
1982 + | crate::model::set_of_range_short_internal::ConstraintViolation,
|
1983 + | > {
|
1984 + | let mut seen = ::std::collections::HashMap::new();
|
1985 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1986 + | for (idx, item) in items.iter().enumerate() {
|
1987 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1988 + | duplicate_indices.push(prev_idx);
|
1989 + | }
|
2313 1990 | }
|
2314 - | }
|
2315 1991 |
|
2316 - | impl crate::constrained::Constrained for RangeLong {
|
2317 - | type Unconstrained = i64;
|
2318 - | }
|
1992 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1993 + | for idx in &duplicate_indices {
|
1994 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1995 + | last_duplicate_indices.push(prev_idx);
|
1996 + | }
|
1997 + | }
|
1998 + | duplicate_indices.extend(last_duplicate_indices);
|
2319 1999 |
|
2320 - | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
2321 - | fn from(value: i64) -> Self {
|
2322 - | Self::Unconstrained(value)
|
2000 + | if !duplicate_indices.is_empty() {
|
2001 + | debug_assert!(duplicate_indices.len() >= 2);
|
2002 + | Err(
|
2003 + | crate::model::set_of_range_short_internal::ConstraintViolation::UniqueItems {
|
2004 + | duplicate_indices,
|
2005 + | original: items,
|
2006 + | },
|
2007 + | )
|
2008 + | } else {
|
2009 + | Ok(items)
|
2010 + | }
|
2323 2011 | }
|
2324 2012 | }
|
2013 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
2014 + | type Error = crate::model::set_of_range_short_internal::ConstraintViolation;
|
2325 2015 |
|
2326 - | impl ::std::fmt::Display for RangeLong {
|
2327 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2328 - | self.0.fmt(f)
|
2016 + | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
2017 + | fn try_from(
|
2018 + | value: ::std::vec::Vec<crate::model::RangeShort>,
|
2019 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2020 + | let value = Self::check_unique_items(value)?;
|
2021 + |
|
2022 + | Ok(Self(value))
|
2329 2023 | }
|
2330 2024 | }
|
2331 2025 |
|
2332 - | impl ::std::convert::From<RangeLong> for i64 {
|
2333 - | fn from(value: RangeLong) -> Self {
|
2026 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
2027 + | fn from(value: SetOfRangeShort) -> Self {
|
2334 2028 | value.into_inner()
|
2335 2029 | }
|
2336 2030 | }
|
2337 - | impl RangeLong {
|
2338 - | fn check_range(
|
2339 - | value: i64,
|
2340 - | ) -> ::std::result::Result<(), crate::model::range_long_internal::ConstraintViolation> {
|
2341 - | if (0..=10).contains(&value) {
|
2342 - | Ok(())
|
2343 - | } else {
|
2344 - | Err(crate::model::range_long_internal::ConstraintViolation::Range(value))
|
2345 - | }
|
2031 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<i16> {
|
2032 + | fn from(value: SetOfRangeShort) -> Self {
|
2033 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2346 2034 | }
|
2347 2035 | }
|
2348 - | impl ::std::convert::TryFrom<i64> for RangeLong {
|
2349 - | type Error = crate::model::range_long_internal::ConstraintViolation;
|
2350 - |
|
2351 - | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2352 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2353 - | Self::check_range(value)?;
|
2354 - |
|
2355 - | Ok(Self(value))
|
2356 - | }
|
2036 + | impl crate::constrained::Constrained for SetOfRangeShort {
|
2037 + | type Unconstrained =
|
2038 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
2357 2039 | }
|
2358 2040 |
|
2359 2041 | #[allow(missing_docs)] // documentation missing in model
|
2360 2042 | ///
|
2361 2043 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2362 - | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
2044 + | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
2363 2045 | ///
|
2364 2046 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2365 2047 | ///
|
2366 2048 | #[derive(
|
2367 2049 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2368 2050 | )]
|
2369 - | pub(crate) struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
2370 - | impl SetOfRangeLong {
|
2371 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
2372 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
2051 + | pub(crate) struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
2052 + | impl SetOfRangeInteger {
|
2053 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2054 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
2373 2055 | self.0
|
2374 2056 | }
|
2375 2057 |
|
2376 2058 | fn check_unique_items(
|
2377 - | items: ::std::vec::Vec<crate::model::RangeLong>,
|
2059 + | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
2378 2060 | ) -> ::std::result::Result<
|
2379 - | ::std::vec::Vec<crate::model::RangeLong>,
|
2380 - | crate::model::set_of_range_long_internal::ConstraintViolation,
|
2061 + | ::std::vec::Vec<crate::model::RangeInteger>,
|
2062 + | crate::model::set_of_range_integer_internal::ConstraintViolation,
|
2381 2063 | > {
|
2382 2064 | let mut seen = ::std::collections::HashMap::new();
|
2383 2065 | let mut duplicate_indices = ::std::vec::Vec::new();
|
2384 2066 | for (idx, item) in items.iter().enumerate() {
|
2385 2067 | if let Some(prev_idx) = seen.insert(item, idx) {
|
2386 2068 | duplicate_indices.push(prev_idx);
|
2387 2069 | }
|
2388 2070 | }
|
2389 2071 |
|
2390 2072 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2391 2073 | for idx in &duplicate_indices {
|
2392 2074 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2393 2075 | last_duplicate_indices.push(prev_idx);
|
2394 2076 | }
|
2395 2077 | }
|
2396 2078 | duplicate_indices.extend(last_duplicate_indices);
|
2397 2079 |
|
2398 2080 | if !duplicate_indices.is_empty() {
|
2399 2081 | debug_assert!(duplicate_indices.len() >= 2);
|
2400 2082 | Err(
|
2401 - | crate::model::set_of_range_long_internal::ConstraintViolation::UniqueItems {
|
2083 + | crate::model::set_of_range_integer_internal::ConstraintViolation::UniqueItems {
|
2402 2084 | duplicate_indices,
|
2403 2085 | original: items,
|
2404 2086 | },
|
2405 2087 | )
|
2406 2088 | } else {
|
2407 2089 | Ok(items)
|
2408 2090 | }
|
2409 2091 | }
|
2410 2092 | }
|
2411 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
2412 - | type Error = crate::model::set_of_range_long_internal::ConstraintViolation;
|
2093 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
2094 + | type Error = crate::model::set_of_range_integer_internal::ConstraintViolation;
|
2413 2095 |
|
2414 - | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
2096 + | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
2415 2097 | fn try_from(
|
2416 - | value: ::std::vec::Vec<crate::model::RangeLong>,
|
2098 + | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
2417 2099 | ) -> ::std::result::Result<Self, Self::Error> {
|
2418 2100 | let value = Self::check_unique_items(value)?;
|
2419 2101 |
|
2420 2102 | Ok(Self(value))
|
2421 2103 | }
|
2422 2104 | }
|
2423 2105 |
|
2424 - | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
2425 - | fn from(value: SetOfRangeLong) -> Self {
|
2106 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
2107 + | fn from(value: SetOfRangeInteger) -> Self {
|
2426 2108 | value.into_inner()
|
2427 2109 | }
|
2428 2110 | }
|
2429 - | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<i64> {
|
2430 - | fn from(value: SetOfRangeLong) -> Self {
|
2111 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<i32> {
|
2112 + | fn from(value: SetOfRangeInteger) -> Self {
|
2431 2113 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2432 2114 | }
|
2433 2115 | }
|
2434 - | impl crate::constrained::Constrained for SetOfRangeLong {
|
2116 + | impl crate::constrained::Constrained for SetOfRangeInteger {
|
2435 2117 | type Unconstrained =
|
2436 - | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
2118 + | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
2437 2119 | }
|
2438 2120 |
|
2439 2121 | #[allow(missing_docs)] // documentation missing in model
|
2440 2122 | ///
|
2441 2123 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2442 - | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
2124 + | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
2443 2125 | ///
|
2444 2126 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2445 2127 | ///
|
2446 2128 | #[derive(
|
2447 2129 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2448 2130 | )]
|
2449 - | pub(crate) struct RangeShort(pub(crate) i16);
|
2450 - | #[allow(dead_code)]
|
2451 - | impl RangeShort {
|
2452 - | /// Returns an immutable reference to the underlying [`i16`].
|
2453 - | pub fn inner(&self) -> &i16 {
|
2454 - | &self.0
|
2455 - | }
|
2456 - |
|
2457 - | /// Consumes the value, returning the underlying [`i16`].
|
2458 - | pub fn into_inner(self) -> i16 {
|
2459 - | self.0
|
2460 - | }
|
2461 - | }
|
2462 - |
|
2463 - | impl crate::constrained::Constrained for RangeShort {
|
2464 - | type Unconstrained = i16;
|
2465 - | }
|
2466 - |
|
2467 - | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
2468 - | fn from(value: i16) -> Self {
|
2469 - | Self::Unconstrained(value)
|
2470 - | }
|
2471 - | }
|
2472 - |
|
2473 - | impl ::std::fmt::Display for RangeShort {
|
2474 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2475 - | self.0.fmt(f)
|
2476 - | }
|
2477 - | }
|
2478 - |
|
2479 - | impl ::std::convert::From<RangeShort> for i16 {
|
2480 - | fn from(value: RangeShort) -> Self {
|
2481 - | value.into_inner()
|
2482 - | }
|
2483 - | }
|
2484 - | impl RangeShort {
|
2485 - | fn check_range(
|
2486 - | value: i16,
|
2487 - | ) -> ::std::result::Result<(), crate::model::range_short_internal::ConstraintViolation> {
|
2488 - | if (0..=10).contains(&value) {
|
2489 - | Ok(())
|
2490 - | } else {
|
2491 - | Err(crate::model::range_short_internal::ConstraintViolation::Range(value))
|
2492 - | }
|
2493 - | }
|
2494 - | }
|
2495 - | impl ::std::convert::TryFrom<i16> for RangeShort {
|
2496 - | type Error = crate::model::range_short_internal::ConstraintViolation;
|
2497 - |
|
2498 - | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2499 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2500 - | Self::check_range(value)?;
|
2501 - |
|
2502 - | Ok(Self(value))
|
2503 - | }
|
2504 - | }
|
2505 - |
|
2506 - | #[allow(missing_docs)] // documentation missing in model
|
2507 - | ///
|
2508 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2509 - | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
2510 - | ///
|
2511 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2512 - | ///
|
2513 - | #[derive(
|
2514 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2515 - | )]
|
2516 - | pub(crate) struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
2517 - | impl SetOfRangeShort {
|
2518 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
2519 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
2131 + | pub(crate) struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
2132 + | impl SetOfRangeLong {
|
2133 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
2134 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
2520 2135 | self.0
|
2521 2136 | }
|
2522 2137 |
|
2523 2138 | fn check_unique_items(
|
2524 - | items: ::std::vec::Vec<crate::model::RangeShort>,
|
2139 + | items: ::std::vec::Vec<crate::model::RangeLong>,
|
2525 2140 | ) -> ::std::result::Result<
|
2526 - | ::std::vec::Vec<crate::model::RangeShort>,
|
2527 - | crate::model::set_of_range_short_internal::ConstraintViolation,
|
2141 + | ::std::vec::Vec<crate::model::RangeLong>,
|
2142 + | crate::model::set_of_range_long_internal::ConstraintViolation,
|
2528 2143 | > {
|
2529 2144 | let mut seen = ::std::collections::HashMap::new();
|
2530 2145 | let mut duplicate_indices = ::std::vec::Vec::new();
|
2531 2146 | for (idx, item) in items.iter().enumerate() {
|
2532 2147 | if let Some(prev_idx) = seen.insert(item, idx) {
|
2533 2148 | duplicate_indices.push(prev_idx);
|
2534 2149 | }
|
2535 2150 | }
|
2536 2151 |
|
2537 2152 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2538 2153 | for idx in &duplicate_indices {
|
2539 2154 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2540 2155 | last_duplicate_indices.push(prev_idx);
|
2541 2156 | }
|
2542 2157 | }
|
2543 2158 | duplicate_indices.extend(last_duplicate_indices);
|
2544 2159 |
|
2545 2160 | if !duplicate_indices.is_empty() {
|
2546 2161 | debug_assert!(duplicate_indices.len() >= 2);
|
2547 2162 | Err(
|
2548 - | crate::model::set_of_range_short_internal::ConstraintViolation::UniqueItems {
|
2163 + | crate::model::set_of_range_long_internal::ConstraintViolation::UniqueItems {
|
2549 2164 | duplicate_indices,
|
2550 2165 | original: items,
|
2551 2166 | },
|
2552 2167 | )
|
2553 2168 | } else {
|
2554 2169 | Ok(items)
|
2555 2170 | }
|
2556 2171 | }
|
2557 2172 | }
|
2558 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
2559 - | type Error = crate::model::set_of_range_short_internal::ConstraintViolation;
|
2173 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
2174 + | type Error = crate::model::set_of_range_long_internal::ConstraintViolation;
|
2560 2175 |
|
2561 - | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
2176 + | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
2562 2177 | fn try_from(
|
2563 - | value: ::std::vec::Vec<crate::model::RangeShort>,
|
2178 + | value: ::std::vec::Vec<crate::model::RangeLong>,
|
2564 2179 | ) -> ::std::result::Result<Self, Self::Error> {
|
2565 2180 | let value = Self::check_unique_items(value)?;
|
2566 2181 |
|
2567 2182 | Ok(Self(value))
|
2568 2183 | }
|
2569 2184 | }
|
2570 2185 |
|
2571 - | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
2572 - | fn from(value: SetOfRangeShort) -> Self {
|
2186 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
2187 + | fn from(value: SetOfRangeLong) -> Self {
|
2573 2188 | value.into_inner()
|
2574 2189 | }
|
2575 2190 | }
|
2576 - | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<i16> {
|
2577 - | fn from(value: SetOfRangeShort) -> Self {
|
2191 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<i64> {
|
2192 + | fn from(value: SetOfRangeLong) -> Self {
|
2578 2193 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2579 2194 | }
|
2580 2195 | }
|
2581 - | impl crate::constrained::Constrained for SetOfRangeShort {
|
2196 + | impl crate::constrained::Constrained for SetOfRangeLong {
|
2582 2197 | type Unconstrained =
|
2583 - | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
2198 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
2584 2199 | }
|
2585 2200 |
|
2201 + | #[::pyo3::pyclass]
|
2202 + | /// :param recursive_member constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested2:
|
2203 + | /// :rtype None:
|
2586 2204 | #[allow(missing_docs)] // documentation missing in model
|
2587 - | ///
|
2588 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2589 - | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
2590 - | ///
|
2591 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2592 - | ///
|
2593 2205 | #[derive(
|
2594 2206 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2595 2207 | )]
|
2596 - | pub(crate) struct RangeInteger(pub(crate) i32);
|
2597 - | #[allow(dead_code)]
|
2598 - | impl RangeInteger {
|
2599 - | /// Returns an immutable reference to the underlying [`i32`].
|
2600 - | pub fn inner(&self) -> &i32 {
|
2601 - | &self.0
|
2602 - | }
|
2603 - |
|
2604 - | /// Consumes the value, returning the underlying [`i32`].
|
2605 - | pub fn into_inner(self) -> i32 {
|
2606 - | self.0
|
2607 - | }
|
2208 + | pub struct RecursiveShapesInputOutputNested1 {
|
2209 + | #[pyo3(get, set)]
|
2210 + | /// :type constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested2:
|
2211 + | #[allow(missing_docs)] // documentation missing in model
|
2212 + | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
2608 2213 | }
|
2609 - |
|
2610 - | impl crate::constrained::Constrained for RangeInteger {
|
2611 - | type Unconstrained = i32;
|
2214 + | impl RecursiveShapesInputOutputNested1 {
|
2215 + | #[allow(missing_docs)] // documentation missing in model
|
2216 + | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
2217 + | use std::ops::Deref;
|
2218 + | self.recursive_member.deref()
|
2219 + | }
|
2612 2220 | }
|
2613 - |
|
2614 - | impl ::std::convert::From<i32>
|
2615 - | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
2616 - | {
|
2617 - | fn from(value: i32) -> Self {
|
2618 - | Self::Unconstrained(value)
|
2221 + | #[allow(clippy::new_without_default)]
|
2222 + | #[allow(clippy::too_many_arguments)]
|
2223 + | #[::pyo3::pymethods]
|
2224 + | impl RecursiveShapesInputOutputNested1 {
|
2225 + | #[new]
|
2226 + | pub fn new(
|
2227 + | recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
2228 + | ) -> Self {
|
2229 + | Self { recursive_member }
|
2230 + | }
|
2231 + | fn __repr__(&self) -> String {
|
2232 + | format!("{self:?}")
|
2233 + | }
|
2234 + | fn __str__(&self) -> String {
|
2235 + | format!("{self:?}")
|
2619 2236 | }
|
2620 2237 | }
|
2621 - |
|
2622 - | impl ::std::fmt::Display for RangeInteger {
|
2623 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2624 - | self.0.fmt(f)
|
2238 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
2239 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2240 + | ob.extract::<RecursiveShapesInputOutputNested1>()
|
2241 + | .map(Box::new)
|
2625 2242 | }
|
2626 2243 | }
|
2627 2244 |
|
2628 - | impl ::std::convert::From<RangeInteger> for i32 {
|
2629 - | fn from(value: RangeInteger) -> Self {
|
2630 - | value.into_inner()
|
2245 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
2246 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2247 + | (*self).into_py(py)
|
2631 2248 | }
|
2632 2249 | }
|
2633 - | impl RangeInteger {
|
2634 - | fn check_range(
|
2635 - | value: i32,
|
2636 - | ) -> ::std::result::Result<(), crate::model::range_integer_internal::ConstraintViolation> {
|
2637 - | if (0..=69).contains(&value) {
|
2638 - | Ok(())
|
2639 - | } else {
|
2640 - | Err(crate::model::range_integer_internal::ConstraintViolation::Range(value))
|
2641 - | }
|
2642 - | }
|
2250 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
2251 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
2643 2252 | }
|
2644 - | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
2645 - | type Error = crate::model::range_integer_internal::ConstraintViolation;
|
2646 - |
|
2647 - | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2648 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2649 - | Self::check_range(value)?;
|
2650 - |
|
2651 - | Ok(Self(value))
|
2253 + | impl RecursiveShapesInputOutputNested1 {
|
2254 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
2255 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
2256 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
2652 2257 | }
|
2653 2258 | }
|
2654 2259 |
|
2655 2260 | #[allow(missing_docs)] // documentation missing in model
|
2656 2261 | ///
|
2657 2262 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2658 - | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
2263 + | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
2659 2264 | ///
|
2660 2265 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2661 2266 | ///
|
2662 - | #[derive(
|
2663 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2664 - | )]
|
2665 - | pub(crate) struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
2666 - | impl SetOfRangeInteger {
|
2667 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2668 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
2267 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2268 + | pub(crate) struct ConBMap(
|
2269 + | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
2270 + | );
|
2271 + | impl ConBMap {
|
2272 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
2273 + | pub fn into_inner(
|
2274 + | self,
|
2275 + | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
2669 2276 | self.0
|
2670 2277 | }
|
2671 - |
|
2672 - | fn check_unique_items(
|
2673 - | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
2674 - | ) -> ::std::result::Result<
|
2675 - | ::std::vec::Vec<crate::model::RangeInteger>,
|
2676 - | crate::model::set_of_range_integer_internal::ConstraintViolation,
|
2677 - | > {
|
2678 - | let mut seen = ::std::collections::HashMap::new();
|
2679 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2680 - | for (idx, item) in items.iter().enumerate() {
|
2681 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2682 - | duplicate_indices.push(prev_idx);
|
2683 - | }
|
2684 - | }
|
2685 - |
|
2686 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2687 - | for idx in &duplicate_indices {
|
2688 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2689 - | last_duplicate_indices.push(prev_idx);
|
2690 - | }
|
2691 - | }
|
2692 - | duplicate_indices.extend(last_duplicate_indices);
|
2693 - |
|
2694 - | if !duplicate_indices.is_empty() {
|
2695 - | debug_assert!(duplicate_indices.len() >= 2);
|
2696 - | Err(
|
2697 - | crate::model::set_of_range_integer_internal::ConstraintViolation::UniqueItems {
|
2698 - | duplicate_indices,
|
2699 - | original: items,
|
2700 - | },
|
2701 - | )
|
2702 - | } else {
|
2703 - | Ok(items)
|
2704 - | }
|
2705 - | }
|
2706 2278 | }
|
2707 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
2708 - | type Error = crate::model::set_of_range_integer_internal::ConstraintViolation;
|
2279 + | impl
|
2280 + | ::std::convert::TryFrom<
|
2281 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
2282 + | > for ConBMap
|
2283 + | {
|
2284 + | type Error = crate::model::con_b_map_internal::ConstraintViolation;
|
2709 2285 |
|
2710 - | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
2286 + | /// 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.
|
2711 2287 | fn try_from(
|
2712 - | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
2288 + | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
2713 2289 | ) -> ::std::result::Result<Self, Self::Error> {
|
2714 - | let value = Self::check_unique_items(value)?;
|
2715 - |
|
2290 + | let length = value.len();
|
2291 + | if (1..=69).contains(&length) {
|
2716 2292 | Ok(Self(value))
|
2293 + | } else {
|
2294 + | Err(crate::model::con_b_map_internal::ConstraintViolation::Length(length))
|
2295 + | }
|
2717 2296 | }
|
2718 2297 | }
|
2719 2298 |
|
2720 - | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
2721 - | fn from(value: SetOfRangeInteger) -> Self {
|
2299 + | impl ::std::convert::From<ConBMap>
|
2300 + | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
2301 + | {
|
2302 + | fn from(value: ConBMap) -> Self {
|
2722 2303 | value.into_inner()
|
2723 2304 | }
|
2724 2305 | }
|
2725 - | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<i32> {
|
2726 - | fn from(value: SetOfRangeInteger) -> Self {
|
2727 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2306 + | impl ::std::convert::From<ConBMap>
|
2307 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
2308 + | {
|
2309 + | fn from(value: ConBMap) -> Self {
|
2310 + | value
|
2311 + | .into_inner()
|
2312 + | .into_iter()
|
2313 + | .map(|(k, v)| (k, v.into()))
|
2314 + | .collect()
|
2728 2315 | }
|
2729 2316 | }
|
2730 - | impl crate::constrained::Constrained for SetOfRangeInteger {
|
2731 - | type Unconstrained =
|
2732 - | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
2317 + | impl crate::constrained::Constrained for ConBMap {
|
2318 + | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
2319 + | }
|
2320 + |
|
2321 + | #[allow(missing_docs)] // documentation missing in model
|
2322 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2323 + | pub enum Event {
|
2324 + | #[allow(missing_docs)] // documentation missing in model
|
2325 + | RegularMessage(crate::model::EventStreamRegularMessage),
|
2326 + | }
|
2327 + | impl Event {
|
2328 + | #[allow(irrefutable_let_patterns)]
|
2329 + | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
2330 + | /// Returns `Err(&Self)` if it can't be converted.
|
2331 + | pub fn as_regular_message(
|
2332 + | &self,
|
2333 + | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
2334 + | if let Event::RegularMessage(val) = &self {
|
2335 + | ::std::result::Result::Ok(val)
|
2336 + | } else {
|
2337 + | ::std::result::Result::Err(self)
|
2338 + | }
|
2339 + | }
|
2340 + | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
2341 + | pub fn is_regular_message(&self) -> bool {
|
2342 + | self.as_regular_message().is_ok()
|
2343 + | }
|
2344 + | }
|
2345 + | #[pyo3::pyclass(name = "Event")]
|
2346 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2347 + | pub struct PyUnionMarkerEvent(pub Event);
|
2348 + | #[::pyo3::pymethods]
|
2349 + | impl PyUnionMarkerEvent {
|
2350 + | #[allow(irrefutable_let_patterns)]
|
2351 + | #[staticmethod]
|
2352 + | /// Creates a new union instance of [`RegularMessage`](crate::model::Event::RegularMessage)
|
2353 + | /// :param data constraints_without_public_constrained_types.model.EventStreamRegularMessage:
|
2354 + | /// :rtype Event:
|
2355 + | pub fn regular_message(data: crate::model::EventStreamRegularMessage) -> Self {
|
2356 + | Self(Event::RegularMessage(data))
|
2357 + | }
|
2358 + | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
2359 + | /// :rtype constraints_without_public_constrained_types.model.EventStreamRegularMessage:
|
2360 + | pub fn as_regular_message(&self) -> ::pyo3::PyResult<crate::model::EventStreamRegularMessage> {
|
2361 + | match self.0.as_regular_message() {
|
2362 + | Ok(variant) => Ok(variant.clone()),
|
2363 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2364 + | r"Event variant is not of type constraints_without_public_constrained_types.model.EventStreamRegularMessage",
|
2365 + | )),
|
2366 + | }
|
2367 + | }
|
2368 + | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
2369 + | /// :rtype bool:
|
2370 + | pub fn is_regular_message(&self) -> bool {
|
2371 + | self.0.is_regular_message()
|
2372 + | }
|
2373 + | }
|
2374 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for Event {
|
2375 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2376 + | PyUnionMarkerEvent(self).into_py(py)
|
2377 + | }
|
2378 + | }
|
2379 + | impl<'source> ::pyo3::FromPyObject<'source> for Event {
|
2380 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2381 + | let data: PyUnionMarkerEvent = obj.extract()?;
|
2382 + | Ok(data.0)
|
2383 + | }
|
2384 + | }
|
2385 + |
|
2386 + | #[::pyo3::pyclass]
|
2387 + | /// :param nice str:
|
2388 + | /// :param int int:
|
2389 + | /// :param opt_nice typing.Optional\[str\]:
|
2390 + | /// :param opt_int typing.Optional\[int\]:
|
2391 + | /// :rtype None:
|
2392 + | #[allow(missing_docs)] // documentation missing in model
|
2393 + | #[derive(
|
2394 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2395 + | )]
|
2396 + | pub struct ConB {
|
2397 + | #[pyo3(get, set)]
|
2398 + | /// :type str:
|
2399 + | #[allow(missing_docs)] // documentation missing in model
|
2400 + | pub nice: ::std::string::String,
|
2401 + | #[pyo3(get, set)]
|
2402 + | /// :type int:
|
2403 + | #[allow(missing_docs)] // documentation missing in model
|
2404 + | pub int: i32,
|
2405 + | #[pyo3(get, set)]
|
2406 + | /// :type typing.Optional\[str\]:
|
2407 + | #[allow(missing_docs)] // documentation missing in model
|
2408 + | pub opt_nice: ::std::option::Option<::std::string::String>,
|
2409 + | #[pyo3(get, set)]
|
2410 + | /// :type typing.Optional\[int\]:
|
2411 + | #[allow(missing_docs)] // documentation missing in model
|
2412 + | pub opt_int: ::std::option::Option<i32>,
|
2413 + | }
|
2414 + | impl ConB {
|
2415 + | #[allow(missing_docs)] // documentation missing in model
|
2416 + | pub fn nice(&self) -> &str {
|
2417 + | use std::ops::Deref;
|
2418 + | self.nice.deref()
|
2419 + | }
|
2420 + | #[allow(missing_docs)] // documentation missing in model
|
2421 + | pub fn int(&self) -> i32 {
|
2422 + | self.int
|
2423 + | }
|
2424 + | #[allow(missing_docs)] // documentation missing in model
|
2425 + | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
2426 + | self.opt_nice.as_deref()
|
2427 + | }
|
2428 + | #[allow(missing_docs)] // documentation missing in model
|
2429 + | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
2430 + | self.opt_int
|
2431 + | }
|
2432 + | }
|
2433 + | #[allow(clippy::new_without_default)]
|
2434 + | #[allow(clippy::too_many_arguments)]
|
2435 + | #[::pyo3::pymethods]
|
2436 + | impl ConB {
|
2437 + | #[new]
|
2438 + | pub fn new(
|
2439 + | nice: ::std::string::String,
|
2440 + | int: i32,
|
2441 + | opt_nice: ::std::option::Option<::std::string::String>,
|
2442 + | opt_int: ::std::option::Option<i32>,
|
2443 + | ) -> Self {
|
2444 + | Self {
|
2445 + | nice,
|
2446 + | int,
|
2447 + | opt_nice,
|
2448 + | opt_int,
|
2449 + | }
|
2450 + | }
|
2451 + | fn __repr__(&self) -> String {
|
2452 + | format!("{self:?}")
|
2453 + | }
|
2454 + | fn __str__(&self) -> String {
|
2455 + | format!("{self:?}")
|
2456 + | }
|
2457 + | }
|
2458 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ConB> {
|
2459 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2460 + | ob.extract::<ConB>().map(Box::new)
|
2461 + | }
|
2462 + | }
|
2463 + |
|
2464 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ConB> {
|
2465 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2466 + | (*self).into_py(py)
|
2467 + | }
|
2468 + | }
|
2469 + | impl crate::constrained::Constrained for crate::model::ConB {
|
2470 + | type Unconstrained = crate::model::con_b_internal::Builder;
|
2471 + | }
|
2472 + | impl ConB {
|
2473 + | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
2474 + | pub fn builder() -> crate::model::con_b::Builder {
|
2475 + | crate::model::con_b::Builder::default()
|
2476 + | }
|
2733 2477 | }
|
2734 2478 |
|
2735 2479 | #[allow(missing_docs)] // documentation missing in model
|
2736 2480 | ///
|
2737 2481 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2738 - | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2482 + | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
2739 2483 | ///
|
2740 2484 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2741 2485 | ///
|
2742 2486 | #[derive(
|
2743 2487 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2744 2488 | )]
|
2745 - | pub(crate) struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2746 - | impl LengthBlob {
|
2747 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2748 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2489 + | pub(crate) struct MinLengthString(pub(crate) ::std::string::String);
|
2490 + | #[allow(dead_code)]
|
2491 + | impl MinLengthString {
|
2492 + | /// Extracts a string slice containing the entire underlying `String`.
|
2493 + | pub fn as_str(&self) -> &str {
|
2494 + | &self.0
|
2495 + | }
|
2496 + |
|
2497 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2498 + | pub fn inner(&self) -> &::std::string::String {
|
2499 + | &self.0
|
2500 + | }
|
2501 + |
|
2502 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2503 + | pub fn into_inner(self) -> ::std::string::String {
|
2749 2504 | self.0
|
2750 2505 | }
|
2751 2506 | }
|
2752 - | impl LengthBlob {
|
2507 + | impl MinLengthString {
|
2753 2508 | fn check_length(
|
2754 - | blob: &::aws_smithy_types::Blob,
|
2755 - | ) -> ::std::result::Result<(), crate::model::length_blob_internal::ConstraintViolation> {
|
2756 - | let length = blob.as_ref().len();
|
2509 + | string: &str,
|
2510 + | ) -> ::std::result::Result<(), crate::model::min_length_string_internal::ConstraintViolation>
|
2511 + | {
|
2512 + | let length = string.chars().count();
|
2757 2513 |
|
2758 - | if (2..=70).contains(&length) {
|
2514 + | if 2 <= length {
|
2759 2515 | Ok(())
|
2760 2516 | } else {
|
2761 - | Err(crate::model::length_blob_internal::ConstraintViolation::Length(length))
|
2517 + | Err(crate::model::min_length_string_internal::ConstraintViolation::Length(length))
|
2762 2518 | }
|
2763 2519 | }
|
2764 2520 | }
|
2765 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2766 - | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2521 + | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
2522 + | type Error = crate::model::min_length_string_internal::ConstraintViolation;
|
2767 2523 |
|
2768 - | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2769 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2524 + | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2525 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2770 2526 | Self::check_length(&value)?;
|
2771 2527 |
|
2772 2528 | Ok(Self(value))
|
2773 2529 | }
|
2774 2530 | }
|
2775 - | impl crate::constrained::Constrained for LengthBlob {
|
2776 - | type Unconstrained = ::aws_smithy_types::Blob;
|
2531 + | impl crate::constrained::Constrained for MinLengthString {
|
2532 + | type Unconstrained = ::std::string::String;
|
2777 2533 | }
|
2778 2534 |
|
2779 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2780 - | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2535 + | impl ::std::convert::From<::std::string::String>
|
2536 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
2781 2537 | {
|
2782 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2538 + | fn from(value: ::std::string::String) -> Self {
|
2783 2539 | Self::Unconstrained(value)
|
2784 2540 | }
|
2785 2541 | }
|
2786 2542 |
|
2787 - | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2788 - | fn from(value: LengthBlob) -> Self {
|
2789 - | value.into_inner()
|
2790 - | }
|
2791 - | }
|
2792 - |
|
2793 - | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
2794 - | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2795 - | {
|
2796 - | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
2797 - | Self::Unconstrained(value.into())
|
2798 - | }
|
2799 - | }
|
2800 - |
|
2801 - | impl ::std::convert::From<LengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
2802 - | fn from(value: LengthBlob) -> Self {
|
2803 - | value.into_inner().into()
|
2543 + | impl ::std::fmt::Display for MinLengthString {
|
2544 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2545 + | self.0.fmt(f)
|
2804 2546 | }
|
2805 2547 | }
|
2806 - | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for LengthBlob {
|
2807 - | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2808 2548 |
|
2809 - | fn try_from(
|
2810 - | value: ::aws_smithy_http_server_python::types::Blob,
|
2811 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2812 - | value.try_into()
|
2549 + | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
2550 + | fn from(value: MinLengthString) -> Self {
|
2551 + | value.into_inner()
|
2813 2552 | }
|
2814 2553 | }
|
2815 2554 |
|
2816 - | /// A union with constrained members.
|
2817 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2818 - | pub enum ConstrainedUnion {
|
2819 - | #[allow(missing_docs)] // documentation missing in model
|
2820 - | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
2821 - | #[allow(missing_docs)] // documentation missing in model
|
2822 - | ConBMap(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
2823 - | #[allow(missing_docs)] // documentation missing in model
|
2824 - | ConBSet(::std::vec::Vec<::std::vec::Vec<::std::string::String>>),
|
2825 - | #[allow(missing_docs)] // documentation missing in model
|
2826 - | ConstrainedStructure(crate::model::ConB),
|
2827 - | #[allow(missing_docs)] // documentation missing in model
|
2828 - | EnumString(crate::model::EnumString),
|
2829 - | #[allow(missing_docs)] // documentation missing in model
|
2830 - | LengthString(::std::string::String),
|
2831 - | }
|
2832 - | impl ConstrainedUnion {
|
2833 - | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
2834 - | /// Returns `Err(&Self)` if it can't be converted.
|
2835 - | pub fn as_con_b_list(
|
2836 - | &self,
|
2837 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
2838 - | if let ConstrainedUnion::ConBList(val) = &self {
|
2839 - | ::std::result::Result::Ok(val)
|
2840 - | } else {
|
2841 - | ::std::result::Result::Err(self)
|
2842 - | }
|
2843 - | }
|
2844 - | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
2845 - | pub fn is_con_b_list(&self) -> bool {
|
2846 - | self.as_con_b_list().is_ok()
|
2847 - | }
|
2848 - | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
2849 - | /// Returns `Err(&Self)` if it can't be converted.
|
2850 - | pub fn as_con_b_map(
|
2851 - | &self,
|
2852 - | ) -> ::std::result::Result<
|
2853 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2854 - | &Self,
|
2855 - | > {
|
2856 - | if let ConstrainedUnion::ConBMap(val) = &self {
|
2857 - | ::std::result::Result::Ok(val)
|
2858 - | } else {
|
2859 - | ::std::result::Result::Err(self)
|
2555 + | #[allow(missing_docs)] // documentation missing in model
|
2556 + | ///
|
2557 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2558 + | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
2559 + | ///
|
2560 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2561 + | ///
|
2562 + | #[derive(
|
2563 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2564 + | )]
|
2565 + | pub(crate) struct MaxLengthString(pub(crate) ::std::string::String);
|
2566 + | #[allow(dead_code)]
|
2567 + | impl MaxLengthString {
|
2568 + | /// Extracts a string slice containing the entire underlying `String`.
|
2569 + | pub fn as_str(&self) -> &str {
|
2570 + | &self.0
|
2860 2571 | }
|
2572 + |
|
2573 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2574 + | pub fn inner(&self) -> &::std::string::String {
|
2575 + | &self.0
|
2861 2576 | }
|
2862 - | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
2863 - | pub fn is_con_b_map(&self) -> bool {
|
2864 - | self.as_con_b_map().is_ok()
|
2577 + |
|
2578 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2579 + | pub fn into_inner(self) -> ::std::string::String {
|
2580 + | self.0
|
2865 2581 | }
|
2866 - | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
2867 - | /// Returns `Err(&Self)` if it can't be converted.
|
2868 - | pub fn as_con_b_set(
|
2869 - | &self,
|
2870 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<::std::string::String>>, &Self>
|
2582 + | }
|
2583 + | impl MaxLengthString {
|
2584 + | fn check_length(
|
2585 + | string: &str,
|
2586 + | ) -> ::std::result::Result<(), crate::model::max_length_string_internal::ConstraintViolation>
|
2871 2587 | {
|
2872 - | if let ConstrainedUnion::ConBSet(val) = &self {
|
2873 - | ::std::result::Result::Ok(val)
|
2588 + | let length = string.chars().count();
|
2589 + |
|
2590 + | if length <= 69 {
|
2591 + | Ok(())
|
2874 2592 | } else {
|
2875 - | ::std::result::Result::Err(self)
|
2593 + | Err(crate::model::max_length_string_internal::ConstraintViolation::Length(length))
|
2876 2594 | }
|
2877 2595 | }
|
2878 - | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
2879 - | pub fn is_con_b_set(&self) -> bool {
|
2880 - | self.as_con_b_set().is_ok()
|
2596 + | }
|
2597 + | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
2598 + | type Error = crate::model::max_length_string_internal::ConstraintViolation;
|
2599 + |
|
2600 + | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2601 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2602 + | Self::check_length(&value)?;
|
2603 + |
|
2604 + | Ok(Self(value))
|
2881 2605 | }
|
2882 - | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
2883 - | /// Returns `Err(&Self)` if it can't be converted.
|
2884 - | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
2885 - | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
2886 - | ::std::result::Result::Ok(val)
|
2887 - | } else {
|
2888 - | ::std::result::Result::Err(self)
|
2606 + | }
|
2607 + | impl crate::constrained::Constrained for MaxLengthString {
|
2608 + | type Unconstrained = ::std::string::String;
|
2609 + | }
|
2610 + |
|
2611 + | impl ::std::convert::From<::std::string::String>
|
2612 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
2613 + | {
|
2614 + | fn from(value: ::std::string::String) -> Self {
|
2615 + | Self::Unconstrained(value)
|
2889 2616 | }
|
2617 + | }
|
2618 + |
|
2619 + | impl ::std::fmt::Display for MaxLengthString {
|
2620 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2621 + | self.0.fmt(f)
|
2890 2622 | }
|
2891 - | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
2892 - | pub fn is_constrained_structure(&self) -> bool {
|
2893 - | self.as_constrained_structure().is_ok()
|
2623 + | }
|
2624 + |
|
2625 + | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
2626 + | fn from(value: MaxLengthString) -> Self {
|
2627 + | value.into_inner()
|
2894 2628 | }
|
2895 - | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
2896 - | /// Returns `Err(&Self)` if it can't be converted.
|
2897 - | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
2898 - | if let ConstrainedUnion::EnumString(val) = &self {
|
2899 - | ::std::result::Result::Ok(val)
|
2900 - | } else {
|
2901 - | ::std::result::Result::Err(self)
|
2629 + | }
|
2630 + |
|
2631 + | #[allow(missing_docs)] // documentation missing in model
|
2632 + | ///
|
2633 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2634 + | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
2635 + | ///
|
2636 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2637 + | ///
|
2638 + | #[derive(
|
2639 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2640 + | )]
|
2641 + | pub(crate) struct FixedLengthString(pub(crate) ::std::string::String);
|
2642 + | #[allow(dead_code)]
|
2643 + | impl FixedLengthString {
|
2644 + | /// Extracts a string slice containing the entire underlying `String`.
|
2645 + | pub fn as_str(&self) -> &str {
|
2646 + | &self.0
|
2902 2647 | }
|
2648 + |
|
2649 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2650 + | pub fn inner(&self) -> &::std::string::String {
|
2651 + | &self.0
|
2903 2652 | }
|
2904 - | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
2905 - | pub fn is_enum_string(&self) -> bool {
|
2906 - | self.as_enum_string().is_ok()
|
2653 + |
|
2654 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2655 + | pub fn into_inner(self) -> ::std::string::String {
|
2656 + | self.0
|
2907 2657 | }
|
2908 - | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
2909 - | /// Returns `Err(&Self)` if it can't be converted.
|
2910 - | pub fn as_length_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
2911 - | if let ConstrainedUnion::LengthString(val) = &self {
|
2912 - | ::std::result::Result::Ok(val)
|
2658 + | }
|
2659 + | impl FixedLengthString {
|
2660 + | fn check_length(
|
2661 + | string: &str,
|
2662 + | ) -> ::std::result::Result<(), crate::model::fixed_length_string_internal::ConstraintViolation>
|
2663 + | {
|
2664 + | let length = string.chars().count();
|
2665 + |
|
2666 + | if (69..=69).contains(&length) {
|
2667 + | Ok(())
|
2913 2668 | } else {
|
2914 - | ::std::result::Result::Err(self)
|
2669 + | Err(crate::model::fixed_length_string_internal::ConstraintViolation::Length(length))
|
2915 2670 | }
|
2916 2671 | }
|
2917 - | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
2918 - | pub fn is_length_string(&self) -> bool {
|
2919 - | self.as_length_string().is_ok()
|
2672 + | }
|
2673 + | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
2674 + | type Error = crate::model::fixed_length_string_internal::ConstraintViolation;
|
2675 + |
|
2676 + | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2677 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2678 + | Self::check_length(&value)?;
|
2679 + |
|
2680 + | Ok(Self(value))
|
2920 2681 | }
|
2921 2682 | }
|
2922 - | #[pyo3::pyclass(name = "ConstrainedUnion")]
|
2923 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2924 - | pub struct PyUnionMarkerConstrainedUnion(pub ConstrainedUnion);
|
2925 - | #[::pyo3::pymethods]
|
2926 - | impl PyUnionMarkerConstrainedUnion {
|
2927 - | #[staticmethod]
|
2928 - | /// Creates a new union instance of [`ConBList`](crate::model::ConstrainedUnion::ConBList)
|
2929 - | /// :param data typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]:
|
2930 - | /// :rtype ConstrainedUnion:
|
2931 - | pub fn con_b_list(data: ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>) -> Self {
|
2932 - | Self(ConstrainedUnion::ConBList(data))
|
2683 + | impl crate::constrained::Constrained for FixedLengthString {
|
2684 + | type Unconstrained = ::std::string::String;
|
2685 + | }
|
2686 + |
|
2687 + | impl ::std::convert::From<::std::string::String>
|
2688 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
2689 + | {
|
2690 + | fn from(value: ::std::string::String) -> Self {
|
2691 + | Self::Unconstrained(value)
|
2933 2692 | }
|
2934 - | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
2935 - | /// :rtype typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]:
|
2936 - | pub fn as_con_b_list(
|
2937 - | &self,
|
2938 - | ) -> ::pyo3::PyResult<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>> {
|
2939 - | match self.0.as_con_b_list() {
|
2940 - | Ok(variant) => Ok(variant.clone()),
|
2941 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2942 - | r"ConstrainedUnion variant is not of type typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]",
|
2943 - | )),
|
2693 + | }
|
2694 + |
|
2695 + | impl ::std::fmt::Display for FixedLengthString {
|
2696 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2697 + | self.0.fmt(f)
|
2944 2698 | }
|
2699 + | }
|
2700 + |
|
2701 + | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
2702 + | fn from(value: FixedLengthString) -> Self {
|
2703 + | value.into_inner()
|
2945 2704 | }
|
2946 - | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
2947 - | /// :rtype bool:
|
2948 - | pub fn is_con_b_list(&self) -> bool {
|
2949 - | self.0.is_con_b_list()
|
2950 - | }
|
2951 - | #[staticmethod]
|
2952 - | /// Creates a new union instance of [`ConBMap`](crate::model::ConstrainedUnion::ConBMap)
|
2953 - | /// :param data typing.Dict\[str, str\]:
|
2954 - | /// :rtype ConstrainedUnion:
|
2955 - | pub fn con_b_map(
|
2956 - | data: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2957 - | ) -> Self {
|
2958 - | Self(ConstrainedUnion::ConBMap(data))
|
2959 - | }
|
2960 - | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
2961 - | /// :rtype typing.Dict\[str, str\]:
|
2962 - | pub fn as_con_b_map(
|
2963 - | &self,
|
2964 - | ) -> ::pyo3::PyResult<::std::collections::HashMap<::std::string::String, ::std::string::String>>
|
2965 - | {
|
2966 - | match self.0.as_con_b_map() {
|
2967 - | Ok(variant) => Ok(variant.clone()),
|
2968 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2969 - | r"ConstrainedUnion variant is not of type typing.Dict\[str, str\]",
|
2970 - | )),
|
2971 - | }
|
2972 - | }
|
2973 - | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
2974 - | /// :rtype bool:
|
2975 - | pub fn is_con_b_map(&self) -> bool {
|
2976 - | self.0.is_con_b_map()
|
2977 - | }
|
2978 - | #[staticmethod]
|
2979 - | /// Creates a new union instance of [`ConBSet`](crate::model::ConstrainedUnion::ConBSet)
|
2980 - | /// :param data typing.List\[typing.Set\[str\]\]:
|
2981 - | /// :rtype ConstrainedUnion:
|
2982 - | pub fn con_b_set(data: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>) -> Self {
|
2983 - | Self(ConstrainedUnion::ConBSet(data))
|
2984 - | }
|
2985 - | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
2986 - | /// :rtype typing.List\[typing.Set\[str\]\]:
|
2987 - | pub fn as_con_b_set(
|
2988 - | &self,
|
2989 - | ) -> ::pyo3::PyResult<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
|
2990 - | match self.0.as_con_b_set() {
|
2991 - | Ok(variant) => Ok(variant.clone()),
|
2992 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2993 - | r"ConstrainedUnion variant is not of type typing.List\[typing.Set\[str\]\]",
|
2994 - | )),
|
2995 - | }
|
2996 - | }
|
2997 - | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
2998 - | /// :rtype bool:
|
2999 - | pub fn is_con_b_set(&self) -> bool {
|
3000 - | self.0.is_con_b_set()
|
3001 - | }
|
3002 - | #[staticmethod]
|
3003 - | /// Creates a new union instance of [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure)
|
3004 - | /// :param data constraints_without_public_constrained_types.model.ConB:
|
3005 - | /// :rtype ConstrainedUnion:
|
3006 - | pub fn constrained_structure(data: crate::model::ConB) -> Self {
|
3007 - | Self(ConstrainedUnion::ConstrainedStructure(data))
|
3008 - | }
|
3009 - | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
3010 - | /// :rtype constraints_without_public_constrained_types.model.ConB:
|
3011 - | pub fn as_constrained_structure(&self) -> ::pyo3::PyResult<crate::model::ConB> {
|
3012 - | match self.0.as_constrained_structure() {
|
3013 - | Ok(variant) => Ok(variant.clone()),
|
3014 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
3015 - | r"ConstrainedUnion variant is not of type constraints_without_public_constrained_types.model.ConB",
|
3016 - | )),
|
3017 - | }
|
3018 - | }
|
3019 - | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
3020 - | /// :rtype bool:
|
3021 - | pub fn is_constrained_structure(&self) -> bool {
|
3022 - | self.0.is_constrained_structure()
|
3023 - | }
|
3024 - | #[staticmethod]
|
3025 - | /// Creates a new union instance of [`EnumString`](crate::model::ConstrainedUnion::EnumString)
|
3026 - | /// :param data constraints_without_public_constrained_types.model.EnumString:
|
3027 - | /// :rtype ConstrainedUnion:
|
3028 - | pub fn enum_string(data: crate::model::EnumString) -> Self {
|
3029 - | Self(ConstrainedUnion::EnumString(data))
|
3030 - | }
|
3031 - | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
3032 - | /// :rtype constraints_without_public_constrained_types.model.EnumString:
|
3033 - | pub fn as_enum_string(&self) -> ::pyo3::PyResult<crate::model::EnumString> {
|
3034 - | match self.0.as_enum_string() {
|
3035 - | Ok(variant) => Ok(variant.clone()),
|
3036 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
3037 - | r"ConstrainedUnion variant is not of type constraints_without_public_constrained_types.model.EnumString",
|
3038 - | )),
|
2705 + | }
|
2706 + |
|
2707 + | #[allow(missing_docs)] // documentation missing in model
|
2708 + | ///
|
2709 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2710 + | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2711 + | ///
|
2712 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2713 + | ///
|
2714 + | #[derive(
|
2715 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2716 + | )]
|
2717 + | pub(crate) struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2718 + | impl LengthBlob {
|
2719 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2720 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2721 + | self.0
|
3039 2722 | }
|
2723 + | }
|
2724 + | impl LengthBlob {
|
2725 + | fn check_length(
|
2726 + | blob: &::aws_smithy_types::Blob,
|
2727 + | ) -> ::std::result::Result<(), crate::model::length_blob_internal::ConstraintViolation> {
|
2728 + | let length = blob.as_ref().len();
|
2729 + |
|
2730 + | if (2..=70).contains(&length) {
|
2731 + | Ok(())
|
2732 + | } else {
|
2733 + | Err(crate::model::length_blob_internal::ConstraintViolation::Length(length))
|
3040 2734 | }
|
3041 - | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
3042 - | /// :rtype bool:
|
3043 - | pub fn is_enum_string(&self) -> bool {
|
3044 - | self.0.is_enum_string()
|
3045 2735 | }
|
3046 - | #[staticmethod]
|
3047 - | /// Creates a new union instance of [`LengthString`](crate::model::ConstrainedUnion::LengthString)
|
3048 - | /// :param data str:
|
3049 - | /// :rtype ConstrainedUnion:
|
3050 - | pub fn length_string(data: ::std::string::String) -> Self {
|
3051 - | Self(ConstrainedUnion::LengthString(data))
|
2736 + | }
|
2737 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2738 + | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2739 + |
|
2740 + | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2741 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2742 + | Self::check_length(&value)?;
|
2743 + |
|
2744 + | Ok(Self(value))
|
3052 2745 | }
|
3053 - | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
3054 - | /// :rtype str:
|
3055 - | pub fn as_length_string(&self) -> ::pyo3::PyResult<::std::string::String> {
|
3056 - | match self.0.as_length_string() {
|
3057 - | Ok(variant) => Ok(variant.clone()),
|
3058 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
3059 - | r"ConstrainedUnion variant is not of type str",
|
3060 - | )),
|
2746 + | }
|
2747 + | impl crate::constrained::Constrained for LengthBlob {
|
2748 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2749 + | }
|
2750 + |
|
2751 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2752 + | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2753 + | {
|
2754 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2755 + | Self::Unconstrained(value)
|
3061 2756 | }
|
2757 + | }
|
2758 + |
|
2759 + | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2760 + | fn from(value: LengthBlob) -> Self {
|
2761 + | value.into_inner()
|
3062 2762 | }
|
3063 - | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
3064 - | /// :rtype bool:
|
3065 - | pub fn is_length_string(&self) -> bool {
|
3066 - | self.0.is_length_string()
|
2763 + | }
|
2764 + |
|
2765 + | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
2766 + | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2767 + | {
|
2768 + | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
2769 + | Self::Unconstrained(value.into())
|
3067 2770 | }
|
3068 2771 | }
|
3069 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for ConstrainedUnion {
|
3070 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3071 - | PyUnionMarkerConstrainedUnion(self).into_py(py)
|
2772 + |
|
2773 + | impl ::std::convert::From<LengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
2774 + | fn from(value: LengthBlob) -> Self {
|
2775 + | value.into_inner().into()
|
3072 2776 | }
|
3073 2777 | }
|
3074 - | impl<'source> ::pyo3::FromPyObject<'source> for ConstrainedUnion {
|
3075 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3076 - | let data: PyUnionMarkerConstrainedUnion = obj.extract()?;
|
3077 - | Ok(data.0)
|
2778 + | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for LengthBlob {
|
2779 + | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2780 + |
|
2781 + | fn try_from(
|
2782 + | value: ::aws_smithy_http_server_python::types::Blob,
|
2783 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2784 + | value.try_into()
|
3078 2785 | }
|
3079 2786 | }
|
3080 2787 |
|
3081 2788 | #[allow(missing_docs)] // documentation missing in model
|
3082 2789 | ///
|
3083 2790 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3084 - | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
2791 + | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
3085 2792 | ///
|
3086 2793 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3087 2794 | ///
|
3088 2795 | #[derive(
|
3089 2796 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3090 2797 | )]
|
3091 - | pub(crate) struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
3092 - | impl ConBSet {
|
3093 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
3094 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
2798 + | pub(crate) struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2799 + | impl MinLengthBlob {
|
2800 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2801 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3095 2802 | self.0
|
3096 2803 | }
|
2804 + | }
|
2805 + | impl MinLengthBlob {
|
2806 + | fn check_length(
|
2807 + | blob: &::aws_smithy_types::Blob,
|
2808 + | ) -> ::std::result::Result<(), crate::model::min_length_blob_internal::ConstraintViolation>
|
2809 + | {
|
2810 + | let length = blob.as_ref().len();
|
3097 2811 |
|
3098 - | fn check_unique_items(
|
3099 - | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3100 - | ) -> ::std::result::Result<
|
3101 - | ::std::vec::Vec<crate::model::ConBSetInner>,
|
3102 - | crate::model::con_b_set_internal::ConstraintViolation,
|
3103 - | > {
|
3104 - | let mut seen = ::std::collections::HashMap::new();
|
3105 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
3106 - | for (idx, item) in items.iter().enumerate() {
|
3107 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
3108 - | duplicate_indices.push(prev_idx);
|
3109 - | }
|
3110 - | }
|
3111 - |
|
3112 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3113 - | for idx in &duplicate_indices {
|
3114 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3115 - | last_duplicate_indices.push(prev_idx);
|
3116 - | }
|
3117 - | }
|
3118 - | duplicate_indices.extend(last_duplicate_indices);
|
3119 - |
|
3120 - | if !duplicate_indices.is_empty() {
|
3121 - | debug_assert!(duplicate_indices.len() >= 2);
|
3122 - | Err(
|
3123 - | crate::model::con_b_set_internal::ConstraintViolation::UniqueItems {
|
3124 - | duplicate_indices,
|
3125 - | original: items,
|
3126 - | },
|
3127 - | )
|
2812 + | if 2 <= length {
|
2813 + | Ok(())
|
3128 2814 | } else {
|
3129 - | Ok(items)
|
2815 + | Err(crate::model::min_length_blob_internal::ConstraintViolation::Length(length))
|
3130 2816 | }
|
3131 2817 | }
|
3132 2818 | }
|
3133 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
3134 - | type Error = crate::model::con_b_set_internal::ConstraintViolation;
|
2819 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
2820 + | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
3135 2821 |
|
3136 - | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
3137 - | fn try_from(
|
3138 - | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3139 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3140 - | let value = Self::check_unique_items(value)?;
|
2822 + | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2823 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2824 + | Self::check_length(&value)?;
|
3141 2825 |
|
3142 2826 | Ok(Self(value))
|
3143 2827 | }
|
3144 2828 | }
|
2829 + | impl crate::constrained::Constrained for MinLengthBlob {
|
2830 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2831 + | }
|
3145 2832 |
|
3146 - | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
3147 - | fn from(value: ConBSet) -> Self {
|
3148 - | value.into_inner()
|
2833 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2834 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
2835 + | {
|
2836 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2837 + | Self::Unconstrained(value)
|
3149 2838 | }
|
3150 2839 | }
|
3151 - | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
3152 - | fn from(value: ConBSet) -> Self {
|
3153 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
2840 + |
|
2841 + | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
2842 + | fn from(value: MinLengthBlob) -> Self {
|
2843 + | value.into_inner()
|
3154 2844 | }
|
3155 2845 | }
|
3156 - | impl crate::constrained::Constrained for ConBSet {
|
3157 - | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
3158 - | }
|
3159 2846 |
|
3160 - | #[allow(missing_docs)] // documentation missing in model
|
3161 - | ///
|
3162 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3163 - | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
2847 + | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
2848 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
2849 + | {
|
2850 + | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
2851 + | Self::Unconstrained(value.into())
|
2852 + | }
|
2853 + | }
|
2854 + |
|
2855 + | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
2856 + | fn from(value: MinLengthBlob) -> Self {
|
2857 + | value.into_inner().into()
|
2858 + | }
|
2859 + | }
|
2860 + | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for MinLengthBlob {
|
2861 + | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
2862 + |
|
2863 + | fn try_from(
|
2864 + | value: ::aws_smithy_http_server_python::types::Blob,
|
2865 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2866 + | value.try_into()
|
2867 + | }
|
2868 + | }
|
2869 + |
|
2870 + | #[allow(missing_docs)] // documentation missing in model
|
2871 + | ///
|
2872 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2873 + | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
3164 2874 | ///
|
3165 2875 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3166 2876 | ///
|
3167 2877 | #[derive(
|
3168 2878 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3169 2879 | )]
|
3170 - | pub(crate) struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3171 - | impl ConBSetInner {
|
3172 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3173 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2880 + | pub(crate) struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2881 + | impl MaxLengthBlob {
|
2882 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2883 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3174 2884 | self.0
|
3175 2885 | }
|
2886 + | }
|
2887 + | impl MaxLengthBlob {
|
2888 + | fn check_length(
|
2889 + | blob: &::aws_smithy_types::Blob,
|
2890 + | ) -> ::std::result::Result<(), crate::model::max_length_blob_internal::ConstraintViolation>
|
2891 + | {
|
2892 + | let length = blob.as_ref().len();
|
3176 2893 |
|
3177 - | fn check_unique_items(
|
3178 - | items: ::std::vec::Vec<::std::string::String>,
|
3179 - | ) -> ::std::result::Result<
|
3180 - | ::std::vec::Vec<::std::string::String>,
|
3181 - | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
3182 - | > {
|
3183 - | let mut seen = ::std::collections::HashMap::new();
|
3184 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
3185 - | for (idx, item) in items.iter().enumerate() {
|
3186 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
3187 - | duplicate_indices.push(prev_idx);
|
3188 - | }
|
3189 - | }
|
3190 - |
|
3191 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3192 - | for idx in &duplicate_indices {
|
3193 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3194 - | last_duplicate_indices.push(prev_idx);
|
3195 - | }
|
3196 - | }
|
3197 - | duplicate_indices.extend(last_duplicate_indices);
|
3198 - |
|
3199 - | if !duplicate_indices.is_empty() {
|
3200 - | debug_assert!(duplicate_indices.len() >= 2);
|
3201 - | Err(
|
3202 - | crate::model::con_b_set_inner_internal::ConstraintViolation::UniqueItems {
|
3203 - | duplicate_indices,
|
3204 - | original: items,
|
3205 - | },
|
3206 - | )
|
2894 + | if length <= 70 {
|
2895 + | Ok(())
|
3207 2896 | } else {
|
3208 - | Ok(items)
|
2897 + | Err(crate::model::max_length_blob_internal::ConstraintViolation::Length(length))
|
3209 2898 | }
|
3210 2899 | }
|
3211 2900 | }
|
3212 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
3213 - | type Error = crate::model::con_b_set_inner_internal::ConstraintViolation;
|
2901 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
2902 + | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
3214 2903 |
|
3215 - | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3216 - | fn try_from(
|
3217 - | value: ::std::vec::Vec<::std::string::String>,
|
3218 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3219 - | let value = Self::check_unique_items(value)?;
|
2904 + | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2905 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2906 + | Self::check_length(&value)?;
|
3220 2907 |
|
3221 2908 | Ok(Self(value))
|
3222 2909 | }
|
3223 2910 | }
|
3224 - |
|
3225 - | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
3226 - | fn from(value: ConBSetInner) -> Self {
|
3227 - | value.into_inner()
|
3228 - | }
|
3229 - | }
|
3230 - | impl crate::constrained::Constrained for ConBSetInner {
|
3231 - | type Unconstrained =
|
3232 - | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
2911 + | impl crate::constrained::Constrained for MaxLengthBlob {
|
2912 + | type Unconstrained = ::aws_smithy_types::Blob;
|
3233 2913 | }
|
3234 2914 |
|
3235 - | #[::pyo3::pyclass]
|
3236 - | /// :param nice str:
|
3237 - | /// :param int int:
|
3238 - | /// :param opt_nice typing.Optional\[str\]:
|
3239 - | /// :param opt_int typing.Optional\[int\]:
|
3240 - | /// :rtype None:
|
3241 - | #[allow(missing_docs)] // documentation missing in model
|
3242 - | #[derive(
|
3243 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3244 - | )]
|
3245 - | pub struct ConB {
|
3246 - | #[pyo3(get, set)]
|
3247 - | /// :type str:
|
3248 - | #[allow(missing_docs)] // documentation missing in model
|
3249 - | pub nice: ::std::string::String,
|
3250 - | #[pyo3(get, set)]
|
3251 - | /// :type int:
|
3252 - | #[allow(missing_docs)] // documentation missing in model
|
3253 - | pub int: i32,
|
3254 - | #[pyo3(get, set)]
|
3255 - | /// :type typing.Optional\[str\]:
|
3256 - | #[allow(missing_docs)] // documentation missing in model
|
3257 - | pub opt_nice: ::std::option::Option<::std::string::String>,
|
3258 - | #[pyo3(get, set)]
|
3259 - | /// :type typing.Optional\[int\]:
|
3260 - | #[allow(missing_docs)] // documentation missing in model
|
3261 - | pub opt_int: ::std::option::Option<i32>,
|
3262 - | }
|
3263 - | impl ConB {
|
3264 - | #[allow(missing_docs)] // documentation missing in model
|
3265 - | pub fn nice(&self) -> &str {
|
3266 - | use std::ops::Deref;
|
3267 - | self.nice.deref()
|
3268 - | }
|
3269 - | #[allow(missing_docs)] // documentation missing in model
|
3270 - | pub fn int(&self) -> i32 {
|
3271 - | self.int
|
3272 - | }
|
3273 - | #[allow(missing_docs)] // documentation missing in model
|
3274 - | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
3275 - | self.opt_nice.as_deref()
|
3276 - | }
|
3277 - | #[allow(missing_docs)] // documentation missing in model
|
3278 - | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
3279 - | self.opt_int
|
2915 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2916 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
2917 + | {
|
2918 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2919 + | Self::Unconstrained(value)
|
3280 2920 | }
|
3281 2921 | }
|
3282 - | #[allow(clippy::new_without_default)]
|
3283 - | #[allow(clippy::too_many_arguments)]
|
3284 - | #[::pyo3::pymethods]
|
3285 - | impl ConB {
|
3286 - | #[new]
|
3287 - | pub fn new(
|
3288 - | nice: ::std::string::String,
|
3289 - | int: i32,
|
3290 - | opt_nice: ::std::option::Option<::std::string::String>,
|
3291 - | opt_int: ::std::option::Option<i32>,
|
3292 - | ) -> Self {
|
3293 - | Self {
|
3294 - | nice,
|
3295 - | int,
|
3296 - | opt_nice,
|
3297 - | opt_int,
|
3298 - | }
|
3299 - | }
|
3300 - | fn __repr__(&self) -> String {
|
3301 - | format!("{self:?}")
|
3302 - | }
|
3303 - | fn __str__(&self) -> String {
|
3304 - | format!("{self:?}")
|
2922 + |
|
2923 + | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
2924 + | fn from(value: MaxLengthBlob) -> Self {
|
2925 + | value.into_inner()
|
3305 2926 | }
|
3306 2927 | }
|
3307 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ConB> {
|
3308 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3309 - | ob.extract::<ConB>().map(Box::new)
|
2928 + |
|
2929 + | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
2930 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
2931 + | {
|
2932 + | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
2933 + | Self::Unconstrained(value.into())
|
3310 2934 | }
|
3311 2935 | }
|
3312 2936 |
|
3313 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ConB> {
|
3314 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3315 - | (*self).into_py(py)
|
2937 + | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
2938 + | fn from(value: MaxLengthBlob) -> Self {
|
2939 + | value.into_inner().into()
|
3316 2940 | }
|
3317 2941 | }
|
3318 - | impl crate::constrained::Constrained for crate::model::ConB {
|
3319 - | type Unconstrained = crate::model::con_b_internal::Builder;
|
3320 - | }
|
3321 - | impl ConB {
|
3322 - | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
3323 - | pub fn builder() -> crate::model::con_b::Builder {
|
3324 - | crate::model::con_b::Builder::default()
|
2942 + | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for MaxLengthBlob {
|
2943 + | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
2944 + |
|
2945 + | fn try_from(
|
2946 + | value: ::aws_smithy_http_server_python::types::Blob,
|
2947 + | ) -> ::std::result::Result<Self, Self::Error> {
|
2948 + | value.try_into()
|
3325 2949 | }
|
3326 2950 | }
|
3327 2951 |
|
3328 2952 | #[allow(missing_docs)] // documentation missing in model
|
3329 2953 | ///
|
3330 2954 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3331 - | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
2955 + | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
3332 2956 | ///
|
3333 2957 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3334 2958 | ///
|
3335 2959 | #[derive(
|
3336 2960 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3337 2961 | )]
|
3338 - | pub(crate) struct SparseLengthList(
|
3339 - | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3340 - | );
|
3341 - | impl SparseLengthList {
|
3342 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
3343 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
2962 + | pub(crate) struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2963 + | impl FixedLengthBlob {
|
2964 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2965 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3344 2966 | self.0
|
3345 2967 | }
|
3346 - |
|
2968 + | }
|
2969 + | impl FixedLengthBlob {
|
3347 2970 | fn check_length(
|
3348 - | length: usize,
|
3349 - | ) -> ::std::result::Result<(), crate::model::sparse_length_list_internal::ConstraintViolation>
|
2971 + | blob: &::aws_smithy_types::Blob,
|
2972 + | ) -> ::std::result::Result<(), crate::model::fixed_length_blob_internal::ConstraintViolation>
|
3350 2973 | {
|
3351 - | if 69 <= length {
|
2974 + | let length = blob.as_ref().len();
|
2975 + |
|
2976 + | if (70..=70).contains(&length) {
|
3352 2977 | Ok(())
|
3353 2978 | } else {
|
3354 - | Err(crate::model::sparse_length_list_internal::ConstraintViolation::Length(length))
|
2979 + | Err(crate::model::fixed_length_blob_internal::ConstraintViolation::Length(length))
|
3355 2980 | }
|
3356 2981 | }
|
3357 2982 | }
|
3358 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
3359 - | for SparseLengthList
|
3360 - | {
|
3361 - | type Error = crate::model::sparse_length_list_internal::ConstraintViolation;
|
2983 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
2984 + | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
3362 2985 |
|
3363 - | /// 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.
|
3364 - | fn try_from(
|
3365 - | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3366 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3367 - | Self::check_length(value.len())?;
|
2986 + | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2987 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2988 + | Self::check_length(&value)?;
|
3368 2989 |
|
3369 2990 | Ok(Self(value))
|
3370 2991 | }
|
3371 2992 | }
|
2993 + | impl crate::constrained::Constrained for FixedLengthBlob {
|
2994 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2995 + | }
|
3372 2996 |
|
3373 - | impl ::std::convert::From<SparseLengthList>
|
3374 - | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
2997 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2998 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
3375 2999 | {
|
3376 - | fn from(value: SparseLengthList) -> Self {
|
3377 - | value.into_inner()
|
3000 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3001 + | Self::Unconstrained(value)
|
3378 3002 | }
|
3379 3003 | }
|
3380 - | impl crate::constrained::Constrained for SparseLengthList {
|
3381 - | type Unconstrained =
|
3382 - | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
3383 - | }
|
3384 3004 |
|
3385 - | #[allow(missing_docs)] // documentation missing in model
|
3386 - | ///
|
3387 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3388 - | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
3389 - | ///
|
3390 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3391 - | ///
|
3392 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3393 - | pub(crate) struct SparseLengthMap(
|
3394 - | pub(crate) ::std::collections::HashMap<
|
3395 - | ::std::string::String,
|
3396 - | ::std::option::Option<::std::string::String>,
|
3397 - | >,
|
3398 - | );
|
3399 - | impl SparseLengthMap {
|
3400 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
3401 - | pub fn into_inner(
|
3402 - | self,
|
3403 - | ) -> ::std::collections::HashMap<
|
3404 - | ::std::string::String,
|
3405 - | ::std::option::Option<::std::string::String>,
|
3406 - | > {
|
3407 - | self.0
|
3005 + | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
3006 + | fn from(value: FixedLengthBlob) -> Self {
|
3007 + | value.into_inner()
|
3408 3008 | }
|
3409 3009 | }
|
3410 - | impl
|
3411 - | ::std::convert::TryFrom<
|
3412 - | ::std::collections::HashMap<
|
3413 - | ::std::string::String,
|
3414 - | ::std::option::Option<::std::string::String>,
|
3415 - | >,
|
3416 - | > for SparseLengthMap
|
3417 - | {
|
3418 - | type Error = crate::model::sparse_length_map_internal::ConstraintViolation;
|
3419 3010 |
|
3420 - | /// 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.
|
3421 - | fn try_from(
|
3422 - | value: ::std::collections::HashMap<
|
3423 - | ::std::string::String,
|
3424 - | ::std::option::Option<::std::string::String>,
|
3425 - | >,
|
3426 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3427 - | let length = value.len();
|
3428 - | if 69 <= length {
|
3429 - | Ok(Self(value))
|
3430 - | } else {
|
3431 - | Err(crate::model::sparse_length_map_internal::ConstraintViolation::Length(length))
|
3432 - | }
|
3011 + | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
3012 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
3013 + | {
|
3014 + | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
3015 + | Self::Unconstrained(value.into())
|
3433 3016 | }
|
3434 3017 | }
|
3435 3018 |
|
3436 - | impl ::std::convert::From<SparseLengthMap>
|
3437 - | for ::std::collections::HashMap<
|
3438 - | ::std::string::String,
|
3439 - | ::std::option::Option<::std::string::String>,
|
3440 - | >
|
3441 - | {
|
3442 - | fn from(value: SparseLengthMap) -> Self {
|
3443 - | value.into_inner()
|
3019 + | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
3020 + | fn from(value: FixedLengthBlob) -> Self {
|
3021 + | value.into_inner().into()
|
3444 3022 | }
|
3445 3023 | }
|
3446 - | impl crate::constrained::Constrained for SparseLengthMap {
|
3447 - | type Unconstrained =
|
3448 - | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
3024 + | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for FixedLengthBlob {
|
3025 + | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
3026 + |
|
3027 + | fn try_from(
|
3028 + | value: ::aws_smithy_http_server_python::types::Blob,
|
3029 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3030 + | value.try_into()
|
3031 + | }
|
3449 3032 | }
|
3450 3033 |
|
3451 3034 | #[allow(missing_docs)] // documentation missing in model
|
3452 3035 | ///
|
3453 3036 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3454 - | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
3037 + | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
3455 3038 | ///
|
3456 3039 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3457 3040 | ///
|
3458 3041 | #[derive(
|
3459 3042 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3460 3043 | )]
|
3461 - | pub(crate) struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3462 - | impl UniqueItemsList {
|
3463 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3464 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
3465 - | self.0
|
3044 + | pub(crate) struct MinRangeInteger(pub(crate) i32);
|
3045 + | #[allow(dead_code)]
|
3046 + | impl MinRangeInteger {
|
3047 + | /// Returns an immutable reference to the underlying [`i32`].
|
3048 + | pub fn inner(&self) -> &i32 {
|
3049 + | &self.0
|
3466 3050 | }
|
3467 3051 |
|
3468 - | fn check_unique_items(
|
3469 - | items: ::std::vec::Vec<::std::string::String>,
|
3470 - | ) -> ::std::result::Result<
|
3471 - | ::std::vec::Vec<::std::string::String>,
|
3472 - | crate::model::unique_items_list_internal::ConstraintViolation,
|
3473 - | > {
|
3474 - | let mut seen = ::std::collections::HashMap::new();
|
3475 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
3476 - | for (idx, item) in items.iter().enumerate() {
|
3477 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
3478 - | duplicate_indices.push(prev_idx);
|
3479 - | }
|
3052 + | /// Consumes the value, returning the underlying [`i32`].
|
3053 + | pub fn into_inner(self) -> i32 {
|
3054 + | self.0
|
3480 3055 | }
|
3056 + | }
|
3481 3057 |
|
3482 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3483 - | for idx in &duplicate_indices {
|
3484 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3485 - | last_duplicate_indices.push(prev_idx);
|
3058 + | impl crate::constrained::Constrained for MinRangeInteger {
|
3059 + | type Unconstrained = i32;
|
3060 + | }
|
3061 + |
|
3062 + | impl ::std::convert::From<i32>
|
3063 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
3064 + | {
|
3065 + | fn from(value: i32) -> Self {
|
3066 + | Self::Unconstrained(value)
|
3486 3067 | }
|
3068 + | }
|
3069 + |
|
3070 + | impl ::std::fmt::Display for MinRangeInteger {
|
3071 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3072 + | self.0.fmt(f)
|
3487 3073 | }
|
3488 - | duplicate_indices.extend(last_duplicate_indices);
|
3074 + | }
|
3489 3075 |
|
3490 - | if !duplicate_indices.is_empty() {
|
3491 - | debug_assert!(duplicate_indices.len() >= 2);
|
3492 - | Err(
|
3493 - | crate::model::unique_items_list_internal::ConstraintViolation::UniqueItems {
|
3494 - | duplicate_indices,
|
3495 - | original: items,
|
3496 - | },
|
3497 - | )
|
3076 + | impl ::std::convert::From<MinRangeInteger> for i32 {
|
3077 + | fn from(value: MinRangeInteger) -> Self {
|
3078 + | value.into_inner()
|
3079 + | }
|
3080 + | }
|
3081 + | impl MinRangeInteger {
|
3082 + | fn check_range(
|
3083 + | value: i32,
|
3084 + | ) -> ::std::result::Result<(), crate::model::min_range_integer_internal::ConstraintViolation>
|
3085 + | {
|
3086 + | if -10 <= value {
|
3087 + | Ok(())
|
3498 3088 | } else {
|
3499 - | Ok(items)
|
3089 + | Err(crate::model::min_range_integer_internal::ConstraintViolation::Range(value))
|
3500 3090 | }
|
3501 3091 | }
|
3502 3092 | }
|
3503 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
3504 - | type Error = crate::model::unique_items_list_internal::ConstraintViolation;
|
3093 + | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
3094 + | type Error = crate::model::min_range_integer_internal::ConstraintViolation;
|
3505 3095 |
|
3506 - | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3507 - | fn try_from(
|
3508 - | value: ::std::vec::Vec<::std::string::String>,
|
3509 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3510 - | let value = Self::check_unique_items(value)?;
|
3096 + | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3097 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3098 + | Self::check_range(value)?;
|
3511 3099 |
|
3512 3100 | Ok(Self(value))
|
3513 3101 | }
|
3514 3102 | }
|
3515 3103 |
|
3516 - | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
3517 - | fn from(value: UniqueItemsList) -> Self {
|
3518 - | value.into_inner()
|
3519 - | }
|
3520 - | }
|
3521 - | impl crate::constrained::Constrained for UniqueItemsList {
|
3522 - | type Unconstrained =
|
3523 - | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
3524 - | }
|
3525 - |
|
3526 3104 | #[allow(missing_docs)] // documentation missing in model
|
3527 3105 | ///
|
3528 3106 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3529 - | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
3107 + | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
3530 3108 | ///
|
3531 3109 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3532 3110 | ///
|
3533 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3534 - | pub(crate) struct LengthMap(
|
3535 - | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3536 - | );
|
3537 - | impl LengthMap {
|
3538 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
3539 - | pub fn into_inner(
|
3540 - | self,
|
3541 - | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
3111 + | #[derive(
|
3112 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3113 + | )]
|
3114 + | pub(crate) struct MaxRangeInteger(pub(crate) i32);
|
3115 + | #[allow(dead_code)]
|
3116 + | impl MaxRangeInteger {
|
3117 + | /// Returns an immutable reference to the underlying [`i32`].
|
3118 + | pub fn inner(&self) -> &i32 {
|
3119 + | &self.0
|
3120 + | }
|
3121 + |
|
3122 + | /// Consumes the value, returning the underlying [`i32`].
|
3123 + | pub fn into_inner(self) -> i32 {
|
3542 3124 | self.0
|
3543 3125 | }
|
3544 3126 | }
|
3545 - | impl
|
3546 - | ::std::convert::TryFrom<
|
3547 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3548 - | > for LengthMap
|
3549 - | {
|
3550 - | type Error = crate::model::length_map_internal::ConstraintViolation;
|
3551 3127 |
|
3552 - | /// 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.
|
3553 - | fn try_from(
|
3554 - | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3555 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3556 - | let length = value.len();
|
3557 - | if (1..=69).contains(&length) {
|
3558 - | Ok(Self(value))
|
3559 - | } else {
|
3560 - | Err(crate::model::length_map_internal::ConstraintViolation::Length(length))
|
3128 + | impl crate::constrained::Constrained for MaxRangeInteger {
|
3129 + | type Unconstrained = i32;
|
3130 + | }
|
3131 + |
|
3132 + | impl ::std::convert::From<i32>
|
3133 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
3134 + | {
|
3135 + | fn from(value: i32) -> Self {
|
3136 + | Self::Unconstrained(value)
|
3561 3137 | }
|
3138 + | }
|
3139 + |
|
3140 + | impl ::std::fmt::Display for MaxRangeInteger {
|
3141 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3142 + | self.0.fmt(f)
|
3562 3143 | }
|
3563 3144 | }
|
3564 3145 |
|
3565 - | impl ::std::convert::From<LengthMap>
|
3566 - | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
3567 - | {
|
3568 - | fn from(value: LengthMap) -> Self {
|
3146 + | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
3147 + | fn from(value: MaxRangeInteger) -> Self {
|
3569 3148 | value.into_inner()
|
3570 3149 | }
|
3571 3150 | }
|
3572 - | impl crate::constrained::Constrained for LengthMap {
|
3573 - | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
3151 + | impl MaxRangeInteger {
|
3152 + | fn check_range(
|
3153 + | value: i32,
|
3154 + | ) -> ::std::result::Result<(), crate::model::max_range_integer_internal::ConstraintViolation>
|
3155 + | {
|
3156 + | if value <= 69 {
|
3157 + | Ok(())
|
3158 + | } else {
|
3159 + | Err(crate::model::max_range_integer_internal::ConstraintViolation::Range(value))
|
3160 + | }
|
3161 + | }
|
3162 + | }
|
3163 + | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
3164 + | type Error = crate::model::max_range_integer_internal::ConstraintViolation;
|
3165 + |
|
3166 + | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3167 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3168 + | Self::check_range(value)?;
|
3169 + |
|
3170 + | Ok(Self(value))
|
3171 + | }
|
3574 3172 | }
|
3575 3173 |
|
3576 3174 | #[allow(missing_docs)] // documentation missing in model
|
3577 3175 | ///
|
3578 3176 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3579 - | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
3177 + | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
3580 3178 | ///
|
3581 3179 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3582 3180 | ///
|
3583 3181 | #[derive(
|
3584 3182 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3585 3183 | )]
|
3586 - | pub(crate) struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
3587 - | impl SensitiveLengthList {
|
3588 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
3589 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
3590 - | self.0
|
3184 + | pub(crate) struct FixedValueInteger(pub(crate) i32);
|
3185 + | #[allow(dead_code)]
|
3186 + | impl FixedValueInteger {
|
3187 + | /// Returns an immutable reference to the underlying [`i32`].
|
3188 + | pub fn inner(&self) -> &i32 {
|
3189 + | &self.0
|
3591 3190 | }
|
3592 3191 |
|
3593 - | fn check_length(
|
3594 - | length: usize,
|
3595 - | ) -> ::std::result::Result<(), crate::model::sensitive_length_list_internal::ConstraintViolation>
|
3596 - | {
|
3597 - | if length <= 69 {
|
3598 - | Ok(())
|
3599 - | } else {
|
3600 - | Err(crate::model::sensitive_length_list_internal::ConstraintViolation::Length(length))
|
3601 - | }
|
3192 + | /// Consumes the value, returning the underlying [`i32`].
|
3193 + | pub fn into_inner(self) -> i32 {
|
3194 + | self.0
|
3602 3195 | }
|
3603 3196 | }
|
3604 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
3605 - | for SensitiveLengthList
|
3606 - | {
|
3607 - | type Error = crate::model::sensitive_length_list_internal::ConstraintViolation;
|
3608 - |
|
3609 - | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
3610 - | fn try_from(
|
3611 - | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
3612 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3613 - | Self::check_length(value.len())?;
|
3614 3197 |
|
3615 - | Ok(Self(value))
|
3616 - | }
|
3198 + | impl crate::constrained::Constrained for FixedValueInteger {
|
3199 + | type Unconstrained = i32;
|
3617 3200 | }
|
3618 3201 |
|
3619 - | impl ::std::convert::From<SensitiveLengthList>
|
3620 - | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
3202 + | impl ::std::convert::From<i32>
|
3203 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
3621 3204 | {
|
3622 - | fn from(value: SensitiveLengthList) -> Self {
|
3623 - | value.into_inner()
|
3205 + | fn from(value: i32) -> Self {
|
3206 + | Self::Unconstrained(value)
|
3624 3207 | }
|
3625 3208 | }
|
3626 - | impl crate::constrained::Constrained for SensitiveLengthList {
|
3627 - | type Unconstrained =
|
3628 - | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
3629 - | }
|
3630 3209 |
|
3631 - | #[::pyo3::pyclass]
|
3632 - | /// :rtype None:
|
3633 - | #[allow(missing_docs)] // documentation missing in model
|
3634 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
3635 - | pub struct SensitiveStructure {}
|
3636 - | impl ::std::fmt::Debug for SensitiveStructure {
|
3637 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
3638 - | let mut formatter = f.debug_struct("SensitiveStructure");
|
3639 - | formatter.finish()
|
3640 - | }
|
3641 - | }
|
3642 - | #[allow(clippy::new_without_default)]
|
3643 - | #[allow(clippy::too_many_arguments)]
|
3644 - | #[::pyo3::pymethods]
|
3645 - | impl SensitiveStructure {
|
3646 - | #[new]
|
3647 - | pub fn new() -> Self {
|
3648 - | Self {}
|
3649 - | }
|
3650 - | fn __repr__(&self) -> String {
|
3651 - | format!("{self:?}")
|
3652 - | }
|
3653 - | fn __str__(&self) -> String {
|
3654 - | format!("{self:?}")
|
3655 - | }
|
3656 - | }
|
3657 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<SensitiveStructure> {
|
3658 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3659 - | ob.extract::<SensitiveStructure>().map(Box::new)
|
3210 + | impl ::std::fmt::Display for FixedValueInteger {
|
3211 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3212 + | self.0.fmt(f)
|
3660 3213 | }
|
3661 3214 | }
|
3662 3215 |
|
3663 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<SensitiveStructure> {
|
3664 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3665 - | (*self).into_py(py)
|
3666 - | }
|
3667 - | }
|
3668 - | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
3669 - | type Unconstrained = crate::model::sensitive_structure_internal::Builder;
|
3670 - | }
|
3671 - | impl SensitiveStructure {
|
3672 - | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
3673 - | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
3674 - | crate::model::sensitive_structure::Builder::default()
|
3216 + | impl ::std::convert::From<FixedValueInteger> for i32 {
|
3217 + | fn from(value: FixedValueInteger) -> Self {
|
3218 + | value.into_inner()
|
3675 3219 | }
|
3676 3220 | }
|
3677 - |
|
3678 - | #[allow(missing_docs)] // documentation missing in model
|
3679 - | ///
|
3680 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3681 - | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
3682 - | ///
|
3683 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3684 - | ///
|
3685 - | #[derive(
|
3686 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3687 - | )]
|
3688 - | pub(crate) struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3689 - | impl LengthList {
|
3690 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3691 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
3692 - | self.0
|
3693 - | }
|
3694 - |
|
3695 - | fn check_length(
|
3696 - | length: usize,
|
3697 - | ) -> ::std::result::Result<(), crate::model::length_list_internal::ConstraintViolation> {
|
3698 - | if length <= 69 {
|
3221 + | impl FixedValueInteger {
|
3222 + | fn check_range(
|
3223 + | value: i32,
|
3224 + | ) -> ::std::result::Result<(), crate::model::fixed_value_integer_internal::ConstraintViolation>
|
3225 + | {
|
3226 + | if (69..=69).contains(&value) {
|
3699 3227 | Ok(())
|
3700 3228 | } else {
|
3701 - | Err(crate::model::length_list_internal::ConstraintViolation::Length(length))
|
3229 + | Err(crate::model::fixed_value_integer_internal::ConstraintViolation::Range(value))
|
3702 3230 | }
|
3703 3231 | }
|
3704 3232 | }
|
3705 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
3706 - | type Error = crate::model::length_list_internal::ConstraintViolation;
|
3233 + | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
3234 + | type Error = crate::model::fixed_value_integer_internal::ConstraintViolation;
|
3707 3235 |
|
3708 - | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3709 - | fn try_from(
|
3710 - | value: ::std::vec::Vec<::std::string::String>,
|
3711 - | ) -> ::std::result::Result<Self, Self::Error> {
|
3712 - | Self::check_length(value.len())?;
|
3236 + | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3237 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3238 + | Self::check_range(value)?;
|
3713 3239 |
|
3714 3240 | Ok(Self(value))
|
3715 3241 | }
|
3716 3242 | }
|
3717 3243 |
|
3718 - | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
3719 - | fn from(value: LengthList) -> Self {
|
3720 - | value.into_inner()
|
3721 - | }
|
3722 - | }
|
3723 - | impl crate::constrained::Constrained for LengthList {
|
3724 - | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
3725 - | }
|
3726 - |
|
3727 3244 | #[allow(missing_docs)] // documentation missing in model
|
3728 3245 | ///
|
3729 3246 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3730 - | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
3247 + | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
3731 3248 | ///
|
3732 3249 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3733 3250 | ///
|
3734 3251 | #[derive(
|
3735 3252 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3736 3253 | )]
|
3737 - | pub(crate) struct FixedValueByte(pub(crate) i8);
|
3254 + | pub(crate) struct MinRangeShort(pub(crate) i16);
|
3738 3255 | #[allow(dead_code)]
|
3739 - | impl FixedValueByte {
|
3740 - | /// Returns an immutable reference to the underlying [`i8`].
|
3741 - | pub fn inner(&self) -> &i8 {
|
3256 + | impl MinRangeShort {
|
3257 + | /// Returns an immutable reference to the underlying [`i16`].
|
3258 + | pub fn inner(&self) -> &i16 {
|
3742 3259 | &self.0
|
3743 3260 | }
|
3744 3261 |
|
3745 - | /// Consumes the value, returning the underlying [`i8`].
|
3746 - | pub fn into_inner(self) -> i8 {
|
3262 + | /// Consumes the value, returning the underlying [`i16`].
|
3263 + | pub fn into_inner(self) -> i16 {
|
3747 3264 | self.0
|
3748 3265 | }
|
3749 3266 | }
|
3750 3267 |
|
3751 - | impl crate::constrained::Constrained for FixedValueByte {
|
3752 - | type Unconstrained = i8;
|
3268 + | impl crate::constrained::Constrained for MinRangeShort {
|
3269 + | type Unconstrained = i16;
|
3753 3270 | }
|
3754 3271 |
|
3755 - | impl ::std::convert::From<i8>
|
3756 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
3272 + | impl ::std::convert::From<i16>
|
3273 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
3757 3274 | {
|
3758 - | fn from(value: i8) -> Self {
|
3275 + | fn from(value: i16) -> Self {
|
3759 3276 | Self::Unconstrained(value)
|
3760 3277 | }
|
3761 3278 | }
|
3762 3279 |
|
3763 - | impl ::std::fmt::Display for FixedValueByte {
|
3280 + | impl ::std::fmt::Display for MinRangeShort {
|
3764 3281 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3765 3282 | self.0.fmt(f)
|
3766 3283 | }
|
3767 3284 | }
|
3768 3285 |
|
3769 - | impl ::std::convert::From<FixedValueByte> for i8 {
|
3770 - | fn from(value: FixedValueByte) -> Self {
|
3286 + | impl ::std::convert::From<MinRangeShort> for i16 {
|
3287 + | fn from(value: MinRangeShort) -> Self {
|
3771 3288 | value.into_inner()
|
3772 3289 | }
|
3773 3290 | }
|
3774 - | impl FixedValueByte {
|
3291 + | impl MinRangeShort {
|
3775 3292 | fn check_range(
|
3776 - | value: i8,
|
3777 - | ) -> ::std::result::Result<(), crate::model::fixed_value_byte_internal::ConstraintViolation>
|
3293 + | value: i16,
|
3294 + | ) -> ::std::result::Result<(), crate::model::min_range_short_internal::ConstraintViolation>
|
3778 3295 | {
|
3779 - | if (10..=10).contains(&value) {
|
3296 + | if -10 <= value {
|
3780 3297 | Ok(())
|
3781 3298 | } else {
|
3782 - | Err(crate::model::fixed_value_byte_internal::ConstraintViolation::Range(value))
|
3299 + | Err(crate::model::min_range_short_internal::ConstraintViolation::Range(value))
|
3783 3300 | }
|
3784 3301 | }
|
3785 3302 | }
|
3786 - | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
3787 - | type Error = crate::model::fixed_value_byte_internal::ConstraintViolation;
|
3303 + | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
3304 + | type Error = crate::model::min_range_short_internal::ConstraintViolation;
|
3788 3305 |
|
3789 - | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3790 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3306 + | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3307 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3791 3308 | Self::check_range(value)?;
|
3792 3309 |
|
3793 3310 | Ok(Self(value))
|
3794 3311 | }
|
3795 3312 | }
|
3796 3313 |
|
3797 3314 | #[allow(missing_docs)] // documentation missing in model
|
3798 3315 | ///
|
3799 3316 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3800 - | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
3317 + | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
3801 3318 | ///
|
3802 3319 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3803 3320 | ///
|
3804 3321 | #[derive(
|
3805 3322 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3806 3323 | )]
|
3807 - | pub(crate) struct MaxRangeByte(pub(crate) i8);
|
3324 + | pub(crate) struct MaxRangeShort(pub(crate) i16);
|
3808 3325 | #[allow(dead_code)]
|
3809 - | impl MaxRangeByte {
|
3810 - | /// Returns an immutable reference to the underlying [`i8`].
|
3811 - | pub fn inner(&self) -> &i8 {
|
3326 + | impl MaxRangeShort {
|
3327 + | /// Returns an immutable reference to the underlying [`i16`].
|
3328 + | pub fn inner(&self) -> &i16 {
|
3812 3329 | &self.0
|
3813 3330 | }
|
3814 3331 |
|
3815 - | /// Consumes the value, returning the underlying [`i8`].
|
3816 - | pub fn into_inner(self) -> i8 {
|
3332 + | /// Consumes the value, returning the underlying [`i16`].
|
3333 + | pub fn into_inner(self) -> i16 {
|
3817 3334 | self.0
|
3818 3335 | }
|
3819 3336 | }
|
3820 3337 |
|
3821 - | impl crate::constrained::Constrained for MaxRangeByte {
|
3822 - | type Unconstrained = i8;
|
3338 + | impl crate::constrained::Constrained for MaxRangeShort {
|
3339 + | type Unconstrained = i16;
|
3823 3340 | }
|
3824 3341 |
|
3825 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
3826 - | fn from(value: i8) -> Self {
|
3342 + | impl ::std::convert::From<i16>
|
3343 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
3344 + | {
|
3345 + | fn from(value: i16) -> Self {
|
3827 3346 | Self::Unconstrained(value)
|
3828 3347 | }
|
3829 3348 | }
|
3830 3349 |
|
3831 - | impl ::std::fmt::Display for MaxRangeByte {
|
3350 + | impl ::std::fmt::Display for MaxRangeShort {
|
3832 3351 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3833 3352 | self.0.fmt(f)
|
3834 3353 | }
|
3835 3354 | }
|
3836 3355 |
|
3837 - | impl ::std::convert::From<MaxRangeByte> for i8 {
|
3838 - | fn from(value: MaxRangeByte) -> Self {
|
3356 + | impl ::std::convert::From<MaxRangeShort> for i16 {
|
3357 + | fn from(value: MaxRangeShort) -> Self {
|
3839 3358 | value.into_inner()
|
3840 3359 | }
|
3841 3360 | }
|
3842 - | impl MaxRangeByte {
|
3361 + | impl MaxRangeShort {
|
3843 3362 | fn check_range(
|
3844 - | value: i8,
|
3845 - | ) -> ::std::result::Result<(), crate::model::max_range_byte_internal::ConstraintViolation> {
|
3363 + | value: i16,
|
3364 + | ) -> ::std::result::Result<(), crate::model::max_range_short_internal::ConstraintViolation>
|
3365 + | {
|
3846 3366 | if value <= 11 {
|
3847 3367 | Ok(())
|
3848 3368 | } else {
|
3849 - | Err(crate::model::max_range_byte_internal::ConstraintViolation::Range(value))
|
3369 + | Err(crate::model::max_range_short_internal::ConstraintViolation::Range(value))
|
3850 3370 | }
|
3851 3371 | }
|
3852 3372 | }
|
3853 - | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
3854 - | type Error = crate::model::max_range_byte_internal::ConstraintViolation;
|
3373 + | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
3374 + | type Error = crate::model::max_range_short_internal::ConstraintViolation;
|
3855 3375 |
|
3856 - | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3857 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3376 + | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3377 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3858 3378 | Self::check_range(value)?;
|
3859 3379 |
|
3860 3380 | Ok(Self(value))
|
3861 3381 | }
|
3862 3382 | }
|
3863 3383 |
|
3864 3384 | #[allow(missing_docs)] // documentation missing in model
|
3865 3385 | ///
|
3866 3386 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3867 - | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
3387 + | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
3868 3388 | ///
|
3869 3389 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3870 3390 | ///
|
3871 3391 | #[derive(
|
3872 3392 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3873 3393 | )]
|
3874 - | pub(crate) struct MinRangeByte(pub(crate) i8);
|
3394 + | pub(crate) struct FixedValueShort(pub(crate) i16);
|
3875 3395 | #[allow(dead_code)]
|
3876 - | impl MinRangeByte {
|
3877 - | /// Returns an immutable reference to the underlying [`i8`].
|
3878 - | pub fn inner(&self) -> &i8 {
|
3396 + | impl FixedValueShort {
|
3397 + | /// Returns an immutable reference to the underlying [`i16`].
|
3398 + | pub fn inner(&self) -> &i16 {
|
3879 3399 | &self.0
|
3880 3400 | }
|
3881 3401 |
|
3882 - | /// Consumes the value, returning the underlying [`i8`].
|
3883 - | pub fn into_inner(self) -> i8 {
|
3402 + | /// Consumes the value, returning the underlying [`i16`].
|
3403 + | pub fn into_inner(self) -> i16 {
|
3884 3404 | self.0
|
3885 3405 | }
|
3886 3406 | }
|
3887 3407 |
|
3888 - | impl crate::constrained::Constrained for MinRangeByte {
|
3889 - | type Unconstrained = i8;
|
3408 + | impl crate::constrained::Constrained for FixedValueShort {
|
3409 + | type Unconstrained = i16;
|
3890 3410 | }
|
3891 3411 |
|
3892 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
3893 - | fn from(value: i8) -> Self {
|
3412 + | impl ::std::convert::From<i16>
|
3413 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
3414 + | {
|
3415 + | fn from(value: i16) -> Self {
|
3894 3416 | Self::Unconstrained(value)
|
3895 3417 | }
|
3896 3418 | }
|
3897 3419 |
|
3898 - | impl ::std::fmt::Display for MinRangeByte {
|
3420 + | impl ::std::fmt::Display for FixedValueShort {
|
3899 3421 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3900 3422 | self.0.fmt(f)
|
3901 3423 | }
|
3902 3424 | }
|
3903 3425 |
|
3904 - | impl ::std::convert::From<MinRangeByte> for i8 {
|
3905 - | fn from(value: MinRangeByte) -> Self {
|
3426 + | impl ::std::convert::From<FixedValueShort> for i16 {
|
3427 + | fn from(value: FixedValueShort) -> Self {
|
3906 3428 | value.into_inner()
|
3907 3429 | }
|
3908 3430 | }
|
3909 - | impl MinRangeByte {
|
3431 + | impl FixedValueShort {
|
3910 3432 | fn check_range(
|
3911 - | value: i8,
|
3912 - | ) -> ::std::result::Result<(), crate::model::min_range_byte_internal::ConstraintViolation> {
|
3913 - | if -10 <= value {
|
3433 + | value: i16,
|
3434 + | ) -> ::std::result::Result<(), crate::model::fixed_value_short_internal::ConstraintViolation>
|
3435 + | {
|
3436 + | if (10..=10).contains(&value) {
|
3914 3437 | Ok(())
|
3915 3438 | } else {
|
3916 - | Err(crate::model::min_range_byte_internal::ConstraintViolation::Range(value))
|
3439 + | Err(crate::model::fixed_value_short_internal::ConstraintViolation::Range(value))
|
3917 3440 | }
|
3918 3441 | }
|
3919 3442 | }
|
3920 - | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3921 - | type Error = crate::model::min_range_byte_internal::ConstraintViolation;
|
3443 + | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
3444 + | type Error = crate::model::fixed_value_short_internal::ConstraintViolation;
|
3922 3445 |
|
3923 - | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3924 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3446 + | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3447 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3925 3448 | Self::check_range(value)?;
|
3926 3449 |
|
3927 3450 | Ok(Self(value))
|
3928 3451 | }
|
3929 3452 | }
|
3930 3453 |
|
3931 3454 | #[allow(missing_docs)] // documentation missing in model
|
3932 3455 | ///
|
3933 3456 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3934 - | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
3457 + | /// [constraint traits]. Use [`MinRangeLong::try_from`] to construct values of this type.
|
3935 3458 | ///
|
3936 3459 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3937 3460 | ///
|
3938 3461 | #[derive(
|
3939 3462 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3940 3463 | )]
|
3941 - | pub(crate) struct FixedValueLong(pub(crate) i64);
|
3464 + | pub(crate) struct MinRangeLong(pub(crate) i64);
|
3942 3465 | #[allow(dead_code)]
|
3943 - | impl FixedValueLong {
|
3466 + | impl MinRangeLong {
|
3944 3467 | /// Returns an immutable reference to the underlying [`i64`].
|
3945 3468 | pub fn inner(&self) -> &i64 {
|
3946 3469 | &self.0
|
3947 3470 | }
|
3948 3471 |
|
3949 3472 | /// Consumes the value, returning the underlying [`i64`].
|
3950 3473 | pub fn into_inner(self) -> i64 {
|
3951 3474 | self.0
|
3952 3475 | }
|
3953 3476 | }
|
3954 3477 |
|
3955 - | impl crate::constrained::Constrained for FixedValueLong {
|
3478 + | impl crate::constrained::Constrained for MinRangeLong {
|
3956 3479 | type Unconstrained = i64;
|
3957 3480 | }
|
3958 3481 |
|
3959 3482 | impl ::std::convert::From<i64>
|
3960 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
3483 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeLong>
|
3961 3484 | {
|
3962 3485 | fn from(value: i64) -> Self {
|
3963 3486 | Self::Unconstrained(value)
|
3964 3487 | }
|
3965 3488 | }
|
3966 3489 |
|
3967 - | impl ::std::fmt::Display for FixedValueLong {
|
3490 + | impl ::std::fmt::Display for MinRangeLong {
|
3968 3491 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3969 3492 | self.0.fmt(f)
|
3970 3493 | }
|
3971 3494 | }
|
3972 3495 |
|
3973 - | impl ::std::convert::From<FixedValueLong> for i64 {
|
3974 - | fn from(value: FixedValueLong) -> Self {
|
3496 + | impl ::std::convert::From<MinRangeLong> for i64 {
|
3497 + | fn from(value: MinRangeLong) -> Self {
|
3975 3498 | value.into_inner()
|
3976 3499 | }
|
3977 3500 | }
|
3978 - | impl FixedValueLong {
|
3501 + | impl MinRangeLong {
|
3979 3502 | fn check_range(
|
3980 3503 | value: i64,
|
3981 - | ) -> ::std::result::Result<(), crate::model::fixed_value_long_internal::ConstraintViolation>
|
3982 - | {
|
3983 - | if (10..=10).contains(&value) {
|
3504 + | ) -> ::std::result::Result<(), crate::model::min_range_long_internal::ConstraintViolation> {
|
3505 + | if -10 <= value {
|
3984 3506 | Ok(())
|
3985 3507 | } else {
|
3986 - | Err(crate::model::fixed_value_long_internal::ConstraintViolation::Range(value))
|
3508 + | Err(crate::model::min_range_long_internal::ConstraintViolation::Range(value))
|
3987 3509 | }
|
3988 3510 | }
|
3989 3511 | }
|
3990 - | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
3991 - | type Error = crate::model::fixed_value_long_internal::ConstraintViolation;
|
3512 + | impl ::std::convert::TryFrom<i64> for MinRangeLong {
|
3513 + | type Error = crate::model::min_range_long_internal::ConstraintViolation;
|
3992 3514 |
|
3993 - | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3515 + | /// Constructs a `MinRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3994 3516 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3995 3517 | Self::check_range(value)?;
|
3996 3518 |
|
3997 3519 | Ok(Self(value))
|
3998 3520 | }
|
3999 3521 | }
|
4000 3522 |
|
4001 3523 | #[allow(missing_docs)] // documentation missing in model
|
4002 3524 | ///
|
4003 3525 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4063 3585 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
4064 3586 | Self::check_range(value)?;
|
4065 3587 |
|
4066 3588 | Ok(Self(value))
|
4067 3589 | }
|
4068 3590 | }
|
4069 3591 |
|
4070 3592 | #[allow(missing_docs)] // documentation missing in model
|
4071 3593 | ///
|
4072 3594 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4073 - | /// [constraint traits]. Use [`MinRangeLong::try_from`] to construct values of this type.
|
3595 + | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
4074 3596 | ///
|
4075 3597 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4076 3598 | ///
|
4077 3599 | #[derive(
|
4078 3600 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4079 3601 | )]
|
4080 - | pub(crate) struct MinRangeLong(pub(crate) i64);
|
3602 + | pub(crate) struct FixedValueLong(pub(crate) i64);
|
4081 3603 | #[allow(dead_code)]
|
4082 - | impl MinRangeLong {
|
3604 + | impl FixedValueLong {
|
4083 3605 | /// Returns an immutable reference to the underlying [`i64`].
|
4084 3606 | pub fn inner(&self) -> &i64 {
|
4085 3607 | &self.0
|
4086 3608 | }
|
4087 3609 |
|
4088 3610 | /// Consumes the value, returning the underlying [`i64`].
|
4089 3611 | pub fn into_inner(self) -> i64 {
|
4090 3612 | self.0
|
4091 3613 | }
|
4092 3614 | }
|
4093 3615 |
|
4094 - | impl crate::constrained::Constrained for MinRangeLong {
|
3616 + | impl crate::constrained::Constrained for FixedValueLong {
|
4095 3617 | type Unconstrained = i64;
|
4096 3618 | }
|
4097 3619 |
|
4098 3620 | impl ::std::convert::From<i64>
|
4099 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeLong>
|
3621 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
4100 3622 | {
|
4101 3623 | fn from(value: i64) -> Self {
|
4102 3624 | Self::Unconstrained(value)
|
4103 3625 | }
|
4104 3626 | }
|
4105 3627 |
|
4106 - | impl ::std::fmt::Display for MinRangeLong {
|
3628 + | impl ::std::fmt::Display for FixedValueLong {
|
4107 3629 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4108 3630 | self.0.fmt(f)
|
4109 3631 | }
|
4110 3632 | }
|
4111 3633 |
|
4112 - | impl ::std::convert::From<MinRangeLong> for i64 {
|
4113 - | fn from(value: MinRangeLong) -> Self {
|
3634 + | impl ::std::convert::From<FixedValueLong> for i64 {
|
3635 + | fn from(value: FixedValueLong) -> Self {
|
4114 3636 | value.into_inner()
|
4115 3637 | }
|
4116 3638 | }
|
4117 - | impl MinRangeLong {
|
3639 + | impl FixedValueLong {
|
4118 3640 | fn check_range(
|
4119 3641 | value: i64,
|
4120 - | ) -> ::std::result::Result<(), crate::model::min_range_long_internal::ConstraintViolation> {
|
4121 - | if -10 <= value {
|
3642 + | ) -> ::std::result::Result<(), crate::model::fixed_value_long_internal::ConstraintViolation>
|
3643 + | {
|
3644 + | if (10..=10).contains(&value) {
|
4122 3645 | Ok(())
|
4123 3646 | } else {
|
4124 - | Err(crate::model::min_range_long_internal::ConstraintViolation::Range(value))
|
3647 + | Err(crate::model::fixed_value_long_internal::ConstraintViolation::Range(value))
|
4125 3648 | }
|
4126 3649 | }
|
4127 3650 | }
|
4128 - | impl ::std::convert::TryFrom<i64> for MinRangeLong {
|
4129 - | type Error = crate::model::min_range_long_internal::ConstraintViolation;
|
3651 + | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
3652 + | type Error = crate::model::fixed_value_long_internal::ConstraintViolation;
|
4130 3653 |
|
4131 - | /// Constructs a `MinRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3654 + | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
4132 3655 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
4133 3656 | Self::check_range(value)?;
|
4134 3657 |
|
4135 3658 | Ok(Self(value))
|
4136 3659 | }
|
4137 3660 | }
|
4138 3661 |
|
4139 3662 | #[allow(missing_docs)] // documentation missing in model
|
4140 3663 | ///
|
4141 3664 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4142 - | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
3665 + | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
4143 3666 | ///
|
4144 3667 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4145 3668 | ///
|
4146 3669 | #[derive(
|
4147 3670 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4148 3671 | )]
|
4149 - | pub(crate) struct FixedValueShort(pub(crate) i16);
|
3672 + | pub(crate) struct MinRangeByte(pub(crate) i8);
|
4150 3673 | #[allow(dead_code)]
|
4151 - | impl FixedValueShort {
|
4152 - | /// Returns an immutable reference to the underlying [`i16`].
|
4153 - | pub fn inner(&self) -> &i16 {
|
3674 + | impl MinRangeByte {
|
3675 + | /// Returns an immutable reference to the underlying [`i8`].
|
3676 + | pub fn inner(&self) -> &i8 {
|
4154 3677 | &self.0
|
4155 3678 | }
|
4156 3679 |
|
4157 - | /// Consumes the value, returning the underlying [`i16`].
|
4158 - | pub fn into_inner(self) -> i16 {
|
3680 + | /// Consumes the value, returning the underlying [`i8`].
|
3681 + | pub fn into_inner(self) -> i8 {
|
4159 3682 | self.0
|
4160 3683 | }
|
4161 3684 | }
|
4162 3685 |
|
4163 - | impl crate::constrained::Constrained for FixedValueShort {
|
4164 - | type Unconstrained = i16;
|
3686 + | impl crate::constrained::Constrained for MinRangeByte {
|
3687 + | type Unconstrained = i8;
|
4165 3688 | }
|
4166 3689 |
|
4167 - | impl ::std::convert::From<i16>
|
4168 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
4169 - | {
|
4170 - | fn from(value: i16) -> Self {
|
3690 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
3691 + | fn from(value: i8) -> Self {
|
4171 3692 | Self::Unconstrained(value)
|
4172 3693 | }
|
4173 3694 | }
|
4174 3695 |
|
4175 - | impl ::std::fmt::Display for FixedValueShort {
|
3696 + | impl ::std::fmt::Display for MinRangeByte {
|
4176 3697 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4177 3698 | self.0.fmt(f)
|
4178 3699 | }
|
4179 3700 | }
|
4180 3701 |
|
4181 - | impl ::std::convert::From<FixedValueShort> for i16 {
|
4182 - | fn from(value: FixedValueShort) -> Self {
|
3702 + | impl ::std::convert::From<MinRangeByte> for i8 {
|
3703 + | fn from(value: MinRangeByte) -> Self {
|
4183 3704 | value.into_inner()
|
4184 3705 | }
|
4185 3706 | }
|
4186 - | impl FixedValueShort {
|
3707 + | impl MinRangeByte {
|
4187 3708 | fn check_range(
|
4188 - | value: i16,
|
4189 - | ) -> ::std::result::Result<(), crate::model::fixed_value_short_internal::ConstraintViolation>
|
4190 - | {
|
4191 - | if (10..=10).contains(&value) {
|
3709 + | value: i8,
|
3710 + | ) -> ::std::result::Result<(), crate::model::min_range_byte_internal::ConstraintViolation> {
|
3711 + | if -10 <= value {
|
4192 3712 | Ok(())
|
4193 3713 | } else {
|
4194 - | Err(crate::model::fixed_value_short_internal::ConstraintViolation::Range(value))
|
3714 + | Err(crate::model::min_range_byte_internal::ConstraintViolation::Range(value))
|
4195 3715 | }
|
4196 3716 | }
|
4197 3717 | }
|
4198 - | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
4199 - | type Error = crate::model::fixed_value_short_internal::ConstraintViolation;
|
3718 + | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3719 + | type Error = crate::model::min_range_byte_internal::ConstraintViolation;
|
4200 3720 |
|
4201 - | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
4202 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3721 + | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3722 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
4203 3723 | Self::check_range(value)?;
|
4204 3724 |
|
4205 3725 | Ok(Self(value))
|
4206 3726 | }
|
4207 3727 | }
|
4208 3728 |
|
4209 3729 | #[allow(missing_docs)] // documentation missing in model
|
4210 3730 | ///
|
4211 3731 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4212 - | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
3732 + | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
4213 3733 | ///
|
4214 3734 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4215 3735 | ///
|
4216 3736 | #[derive(
|
4217 3737 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4218 3738 | )]
|
4219 - | pub(crate) struct MaxRangeShort(pub(crate) i16);
|
3739 + | pub(crate) struct MaxRangeByte(pub(crate) i8);
|
4220 3740 | #[allow(dead_code)]
|
4221 - | impl MaxRangeShort {
|
4222 - | /// Returns an immutable reference to the underlying [`i16`].
|
4223 - | pub fn inner(&self) -> &i16 {
|
3741 + | impl MaxRangeByte {
|
3742 + | /// Returns an immutable reference to the underlying [`i8`].
|
3743 + | pub fn inner(&self) -> &i8 {
|
4224 3744 | &self.0
|
4225 3745 | }
|
4226 3746 |
|
4227 - | /// Consumes the value, returning the underlying [`i16`].
|
4228 - | pub fn into_inner(self) -> i16 {
|
3747 + | /// Consumes the value, returning the underlying [`i8`].
|
3748 + | pub fn into_inner(self) -> i8 {
|
4229 3749 | self.0
|
4230 3750 | }
|
4231 3751 | }
|
4232 3752 |
|
4233 - | impl crate::constrained::Constrained for MaxRangeShort {
|
4234 - | type Unconstrained = i16;
|
3753 + | impl crate::constrained::Constrained for MaxRangeByte {
|
3754 + | type Unconstrained = i8;
|
4235 3755 | }
|
4236 3756 |
|
4237 - | impl ::std::convert::From<i16>
|
4238 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
4239 - | {
|
4240 - | fn from(value: i16) -> Self {
|
3757 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
3758 + | fn from(value: i8) -> Self {
|
4241 3759 | Self::Unconstrained(value)
|
4242 3760 | }
|
4243 3761 | }
|
4244 3762 |
|
4245 - | impl ::std::fmt::Display for MaxRangeShort {
|
3763 + | impl ::std::fmt::Display for MaxRangeByte {
|
4246 3764 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4247 3765 | self.0.fmt(f)
|
4248 3766 | }
|
4249 3767 | }
|
4250 3768 |
|
4251 - | impl ::std::convert::From<MaxRangeShort> for i16 {
|
4252 - | fn from(value: MaxRangeShort) -> Self {
|
3769 + | impl ::std::convert::From<MaxRangeByte> for i8 {
|
3770 + | fn from(value: MaxRangeByte) -> Self {
|
4253 3771 | value.into_inner()
|
4254 3772 | }
|
4255 3773 | }
|
4256 - | impl MaxRangeShort {
|
3774 + | impl MaxRangeByte {
|
4257 3775 | fn check_range(
|
4258 - | value: i16,
|
4259 - | ) -> ::std::result::Result<(), crate::model::max_range_short_internal::ConstraintViolation>
|
4260 - | {
|
3776 + | value: i8,
|
3777 + | ) -> ::std::result::Result<(), crate::model::max_range_byte_internal::ConstraintViolation> {
|
4261 3778 | if value <= 11 {
|
4262 3779 | Ok(())
|
4263 3780 | } else {
|
4264 - | Err(crate::model::max_range_short_internal::ConstraintViolation::Range(value))
|
3781 + | Err(crate::model::max_range_byte_internal::ConstraintViolation::Range(value))
|
4265 3782 | }
|
4266 3783 | }
|
4267 3784 | }
|
4268 - | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
4269 - | type Error = crate::model::max_range_short_internal::ConstraintViolation;
|
3785 + | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
3786 + | type Error = crate::model::max_range_byte_internal::ConstraintViolation;
|
4270 3787 |
|
4271 - | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
4272 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3788 + | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3789 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
4273 3790 | Self::check_range(value)?;
|
4274 3791 |
|
4275 3792 | Ok(Self(value))
|
4276 3793 | }
|
4277 3794 | }
|
4278 3795 |
|
4279 3796 | #[allow(missing_docs)] // documentation missing in model
|
4280 3797 | ///
|
4281 3798 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4282 - | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
3799 + | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
4283 3800 | ///
|
4284 3801 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4285 3802 | ///
|
4286 3803 | #[derive(
|
4287 3804 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4288 3805 | )]
|
4289 - | pub(crate) struct MinRangeShort(pub(crate) i16);
|
3806 + | pub(crate) struct FixedValueByte(pub(crate) i8);
|
4290 3807 | #[allow(dead_code)]
|
4291 - | impl MinRangeShort {
|
4292 - | /// Returns an immutable reference to the underlying [`i16`].
|
4293 - | pub fn inner(&self) -> &i16 {
|
3808 + | impl FixedValueByte {
|
3809 + | /// Returns an immutable reference to the underlying [`i8`].
|
3810 + | pub fn inner(&self) -> &i8 {
|
4294 3811 | &self.0
|
4295 3812 | }
|
4296 3813 |
|
4297 - | /// Consumes the value, returning the underlying [`i16`].
|
4298 - | pub fn into_inner(self) -> i16 {
|
3814 + | /// Consumes the value, returning the underlying [`i8`].
|
3815 + | pub fn into_inner(self) -> i8 {
|
4299 3816 | self.0
|
4300 3817 | }
|
4301 3818 | }
|
4302 3819 |
|
4303 - | impl crate::constrained::Constrained for MinRangeShort {
|
4304 - | type Unconstrained = i16;
|
3820 + | impl crate::constrained::Constrained for FixedValueByte {
|
3821 + | type Unconstrained = i8;
|
4305 3822 | }
|
4306 3823 |
|
4307 - | impl ::std::convert::From<i16>
|
4308 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
3824 + | impl ::std::convert::From<i8>
|
3825 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
4309 3826 | {
|
4310 - | fn from(value: i16) -> Self {
|
3827 + | fn from(value: i8) -> Self {
|
4311 3828 | Self::Unconstrained(value)
|
4312 3829 | }
|
4313 3830 | }
|
4314 3831 |
|
4315 - | impl ::std::fmt::Display for MinRangeShort {
|
3832 + | impl ::std::fmt::Display for FixedValueByte {
|
4316 3833 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4317 3834 | self.0.fmt(f)
|
4318 3835 | }
|
4319 3836 | }
|
4320 3837 |
|
4321 - | impl ::std::convert::From<MinRangeShort> for i16 {
|
4322 - | fn from(value: MinRangeShort) -> Self {
|
3838 + | impl ::std::convert::From<FixedValueByte> for i8 {
|
3839 + | fn from(value: FixedValueByte) -> Self {
|
4323 3840 | value.into_inner()
|
4324 3841 | }
|
4325 3842 | }
|
4326 - | impl MinRangeShort {
|
3843 + | impl FixedValueByte {
|
4327 3844 | fn check_range(
|
4328 - | value: i16,
|
4329 - | ) -> ::std::result::Result<(), crate::model::min_range_short_internal::ConstraintViolation>
|
3845 + | value: i8,
|
3846 + | ) -> ::std::result::Result<(), crate::model::fixed_value_byte_internal::ConstraintViolation>
|
4330 3847 | {
|
4331 - | if -10 <= value {
|
3848 + | if (10..=10).contains(&value) {
|
4332 3849 | Ok(())
|
4333 3850 | } else {
|
4334 - | Err(crate::model::min_range_short_internal::ConstraintViolation::Range(value))
|
3851 + | Err(crate::model::fixed_value_byte_internal::ConstraintViolation::Range(value))
|
4335 3852 | }
|
4336 3853 | }
|
4337 3854 | }
|
4338 - | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
4339 - | type Error = crate::model::min_range_short_internal::ConstraintViolation;
|
3855 + | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
3856 + | type Error = crate::model::fixed_value_byte_internal::ConstraintViolation;
|
4340 3857 |
|
4341 - | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
4342 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3858 + | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3859 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
4343 3860 | Self::check_range(value)?;
|
4344 3861 |
|
4345 3862 | Ok(Self(value))
|
4346 3863 | }
|
4347 3864 | }
|
4348 3865 |
|
4349 3866 | #[allow(missing_docs)] // documentation missing in model
|
4350 3867 | ///
|
4351 3868 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4352 - | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
3869 + | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
4353 3870 | ///
|
4354 3871 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4355 3872 | ///
|
4356 3873 | #[derive(
|
4357 3874 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4358 3875 | )]
|
4359 - | pub(crate) struct FixedValueInteger(pub(crate) i32);
|
4360 - | #[allow(dead_code)]
|
4361 - | impl FixedValueInteger {
|
4362 - | /// Returns an immutable reference to the underlying [`i32`].
|
4363 - | pub fn inner(&self) -> &i32 {
|
4364 - | &self.0
|
3876 + | pub(crate) struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3877 + | impl LengthList {
|
3878 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3879 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
3880 + | self.0
|
4365 3881 | }
|
4366 3882 |
|
4367 - | /// Consumes the value, returning the underlying [`i32`].
|
4368 - | pub fn into_inner(self) -> i32 {
|
4369 - | self.0
|
3883 + | fn check_length(
|
3884 + | length: usize,
|
3885 + | ) -> ::std::result::Result<(), crate::model::length_list_internal::ConstraintViolation> {
|
3886 + | if length <= 69 {
|
3887 + | Ok(())
|
3888 + | } else {
|
3889 + | Err(crate::model::length_list_internal::ConstraintViolation::Length(length))
|
4370 3890 | }
|
4371 - | }
|
4372 - |
|
4373 - | impl crate::constrained::Constrained for FixedValueInteger {
|
4374 - | type Unconstrained = i32;
|
4375 - | }
|
4376 - |
|
4377 - | impl ::std::convert::From<i32>
|
4378 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
4379 - | {
|
4380 - | fn from(value: i32) -> Self {
|
4381 - | Self::Unconstrained(value)
|
4382 3891 | }
|
4383 3892 | }
|
3893 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
3894 + | type Error = crate::model::length_list_internal::ConstraintViolation;
|
4384 3895 |
|
4385 - | impl ::std::fmt::Display for FixedValueInteger {
|
4386 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4387 - | self.0.fmt(f)
|
3896 + | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3897 + | fn try_from(
|
3898 + | value: ::std::vec::Vec<::std::string::String>,
|
3899 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3900 + | Self::check_length(value.len())?;
|
3901 + |
|
3902 + | Ok(Self(value))
|
4388 3903 | }
|
4389 3904 | }
|
4390 3905 |
|
4391 - | impl ::std::convert::From<FixedValueInteger> for i32 {
|
4392 - | fn from(value: FixedValueInteger) -> Self {
|
3906 + | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
3907 + | fn from(value: LengthList) -> Self {
|
4393 3908 | value.into_inner()
|
4394 3909 | }
|
4395 3910 | }
|
4396 - | impl FixedValueInteger {
|
4397 - | fn check_range(
|
4398 - | value: i32,
|
4399 - | ) -> ::std::result::Result<(), crate::model::fixed_value_integer_internal::ConstraintViolation>
|
4400 - | {
|
4401 - | if (69..=69).contains(&value) {
|
4402 - | Ok(())
|
4403 - | } else {
|
4404 - | Err(crate::model::fixed_value_integer_internal::ConstraintViolation::Range(value))
|
4405 - | }
|
4406 - | }
|
4407 - | }
|
4408 - | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
4409 - | type Error = crate::model::fixed_value_integer_internal::ConstraintViolation;
|
4410 - |
|
4411 - | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
4412 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
4413 - | Self::check_range(value)?;
|
4414 - |
|
4415 - | Ok(Self(value))
|
4416 - | }
|
3911 + | impl crate::constrained::Constrained for LengthList {
|
3912 + | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
4417 3913 | }
|
4418 3914 |
|
4419 3915 | #[allow(missing_docs)] // documentation missing in model
|
4420 3916 | ///
|
4421 3917 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4422 - | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
3918 + | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
4423 3919 | ///
|
4424 3920 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4425 3921 | ///
|
4426 3922 | #[derive(
|
4427 3923 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4428 3924 | )]
|
4429 - | pub(crate) struct MaxRangeInteger(pub(crate) i32);
|
4430 - | #[allow(dead_code)]
|
4431 - | impl MaxRangeInteger {
|
4432 - | /// Returns an immutable reference to the underlying [`i32`].
|
4433 - | pub fn inner(&self) -> &i32 {
|
4434 - | &self.0
|
4435 - | }
|
4436 - |
|
4437 - | /// Consumes the value, returning the underlying [`i32`].
|
4438 - | pub fn into_inner(self) -> i32 {
|
3925 + | pub(crate) struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
3926 + | impl SensitiveLengthList {
|
3927 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
3928 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
4439 3929 | self.0
|
4440 3930 | }
|
4441 - | }
|
4442 - |
|
4443 - | impl crate::constrained::Constrained for MaxRangeInteger {
|
4444 - | type Unconstrained = i32;
|
4445 - | }
|
4446 - |
|
4447 - | impl ::std::convert::From<i32>
|
4448 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
4449 - | {
|
4450 - | fn from(value: i32) -> Self {
|
4451 - | Self::Unconstrained(value)
|
4452 - | }
|
4453 - | }
|
4454 - |
|
4455 - | impl ::std::fmt::Display for MaxRangeInteger {
|
4456 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4457 - | self.0.fmt(f)
|
4458 - | }
|
4459 - | }
|
4460 3931 |
|
4461 - | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
4462 - | fn from(value: MaxRangeInteger) -> Self {
|
4463 - | value.into_inner()
|
4464 - | }
|
4465 - | }
|
4466 - | impl MaxRangeInteger {
|
4467 - | fn check_range(
|
4468 - | value: i32,
|
4469 - | ) -> ::std::result::Result<(), crate::model::max_range_integer_internal::ConstraintViolation>
|
3932 + | fn check_length(
|
3933 + | length: usize,
|
3934 + | ) -> ::std::result::Result<(), crate::model::sensitive_length_list_internal::ConstraintViolation>
|
4470 3935 | {
|
4471 - | if value <= 69 {
|
3936 + | if length <= 69 {
|
4472 3937 | Ok(())
|
4473 3938 | } else {
|
4474 - | Err(crate::model::max_range_integer_internal::ConstraintViolation::Range(value))
|
3939 + | Err(crate::model::sensitive_length_list_internal::ConstraintViolation::Length(length))
|
4475 3940 | }
|
4476 3941 | }
|
4477 3942 | }
|
4478 - | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
4479 - | type Error = crate::model::max_range_integer_internal::ConstraintViolation;
|
3943 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
3944 + | for SensitiveLengthList
|
3945 + | {
|
3946 + | type Error = crate::model::sensitive_length_list_internal::ConstraintViolation;
|
4480 3947 |
|
4481 - | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
4482 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
4483 - | Self::check_range(value)?;
|
3948 + | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
3949 + | fn try_from(
|
3950 + | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
3951 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3952 + | Self::check_length(value.len())?;
|
4484 3953 |
|
4485 3954 | Ok(Self(value))
|
4486 3955 | }
|
4487 3956 | }
|
4488 3957 |
|
3958 + | impl ::std::convert::From<SensitiveLengthList>
|
3959 + | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
3960 + | {
|
3961 + | fn from(value: SensitiveLengthList) -> Self {
|
3962 + | value.into_inner()
|
3963 + | }
|
3964 + | }
|
3965 + | impl crate::constrained::Constrained for SensitiveLengthList {
|
3966 + | type Unconstrained =
|
3967 + | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
3968 + | }
|
3969 + |
|
4489 3970 | #[allow(missing_docs)] // documentation missing in model
|
4490 3971 | ///
|
4491 3972 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4492 - | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
3973 + | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
4493 3974 | ///
|
4494 3975 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4495 3976 | ///
|
4496 3977 | #[derive(
|
4497 3978 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4498 3979 | )]
|
4499 - | pub(crate) struct MinRangeInteger(pub(crate) i32);
|
4500 - | #[allow(dead_code)]
|
4501 - | impl MinRangeInteger {
|
4502 - | /// Returns an immutable reference to the underlying [`i32`].
|
4503 - | pub fn inner(&self) -> &i32 {
|
4504 - | &self.0
|
3980 + | pub(crate) struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
3981 + | impl ConBSet {
|
3982 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
3983 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
3984 + | self.0
|
4505 3985 | }
|
4506 3986 |
|
4507 - | /// Consumes the value, returning the underlying [`i32`].
|
4508 - | pub fn into_inner(self) -> i32 {
|
4509 - | self.0
|
3987 + | fn check_unique_items(
|
3988 + | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3989 + | ) -> ::std::result::Result<
|
3990 + | ::std::vec::Vec<crate::model::ConBSetInner>,
|
3991 + | crate::model::con_b_set_internal::ConstraintViolation,
|
3992 + | > {
|
3993 + | let mut seen = ::std::collections::HashMap::new();
|
3994 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3995 + | for (idx, item) in items.iter().enumerate() {
|
3996 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3997 + | duplicate_indices.push(prev_idx);
|
3998 + | }
|
4510 3999 | }
|
4511 - | }
|
4512 4000 |
|
4513 - | impl crate::constrained::Constrained for MinRangeInteger {
|
4514 - | type Unconstrained = i32;
|
4515 - | }
|
4001 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4002 + | for idx in &duplicate_indices {
|
4003 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4004 + | last_duplicate_indices.push(prev_idx);
|
4005 + | }
|
4006 + | }
|
4007 + | duplicate_indices.extend(last_duplicate_indices);
|
4516 4008 |
|
4517 - | impl ::std::convert::From<i32>
|
4518 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
4519 - | {
|
4520 - | fn from(value: i32) -> Self {
|
4521 - | Self::Unconstrained(value)
|
4009 + | if !duplicate_indices.is_empty() {
|
4010 + | debug_assert!(duplicate_indices.len() >= 2);
|
4011 + | Err(
|
4012 + | crate::model::con_b_set_internal::ConstraintViolation::UniqueItems {
|
4013 + | duplicate_indices,
|
4014 + | original: items,
|
4015 + | },
|
4016 + | )
|
4017 + | } else {
|
4018 + | Ok(items)
|
4019 + | }
|
4522 4020 | }
|
4523 4021 | }
|
4022 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
4023 + | type Error = crate::model::con_b_set_internal::ConstraintViolation;
|
4524 4024 |
|
4525 - | impl ::std::fmt::Display for MinRangeInteger {
|
4526 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4527 - | self.0.fmt(f)
|
4025 + | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
4026 + | fn try_from(
|
4027 + | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
4028 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4029 + | let value = Self::check_unique_items(value)?;
|
4030 + |
|
4031 + | Ok(Self(value))
|
4528 4032 | }
|
4529 4033 | }
|
4530 4034 |
|
4531 - | impl ::std::convert::From<MinRangeInteger> for i32 {
|
4532 - | fn from(value: MinRangeInteger) -> Self {
|
4035 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
4036 + | fn from(value: ConBSet) -> Self {
|
4533 4037 | value.into_inner()
|
4534 4038 | }
|
4535 4039 | }
|
4536 - | impl MinRangeInteger {
|
4537 - | fn check_range(
|
4538 - | value: i32,
|
4539 - | ) -> ::std::result::Result<(), crate::model::min_range_integer_internal::ConstraintViolation>
|
4540 - | {
|
4541 - | if -10 <= value {
|
4542 - | Ok(())
|
4543 - | } else {
|
4544 - | Err(crate::model::min_range_integer_internal::ConstraintViolation::Range(value))
|
4545 - | }
|
4040 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
4041 + | fn from(value: ConBSet) -> Self {
|
4042 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
4546 4043 | }
|
4547 4044 | }
|
4548 - | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
4549 - | type Error = crate::model::min_range_integer_internal::ConstraintViolation;
|
4550 - |
|
4551 - | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
4552 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
4553 - | Self::check_range(value)?;
|
4554 - |
|
4555 - | Ok(Self(value))
|
4556 - | }
|
4045 + | impl crate::constrained::Constrained for ConBSet {
|
4046 + | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
4557 4047 | }
|
4558 4048 |
|
4559 4049 | #[allow(missing_docs)] // documentation missing in model
|
4560 4050 | ///
|
4561 4051 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4562 - | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
4052 + | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
4563 4053 | ///
|
4564 4054 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4565 4055 | ///
|
4566 - | #[derive(
|
4567 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4568 - | )]
|
4569 - | pub(crate) struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
4570 - | impl FixedLengthBlob {
|
4571 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
4572 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
4056 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4057 + | pub(crate) struct LengthMap(
|
4058 + | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4059 + | );
|
4060 + | impl LengthMap {
|
4061 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
4062 + | pub fn into_inner(
|
4063 + | self,
|
4064 + | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
4573 4065 | self.0
|
4574 4066 | }
|
4575 4067 | }
|
4576 - | impl FixedLengthBlob {
|
4577 - | fn check_length(
|
4578 - | blob: &::aws_smithy_types::Blob,
|
4579 - | ) -> ::std::result::Result<(), crate::model::fixed_length_blob_internal::ConstraintViolation>
|
4580 - | {
|
4581 - | let length = blob.as_ref().len();
|
4582 - |
|
4583 - | if (70..=70).contains(&length) {
|
4584 - | Ok(())
|
4585 - | } else {
|
4586 - | Err(crate::model::fixed_length_blob_internal::ConstraintViolation::Length(length))
|
4587 - | }
|
4588 - | }
|
4589 - | }
|
4590 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
4591 - | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
4592 - |
|
4593 - | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
4594 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
4595 - | Self::check_length(&value)?;
|
4068 + | impl
|
4069 + | ::std::convert::TryFrom<
|
4070 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4071 + | > for LengthMap
|
4072 + | {
|
4073 + | type Error = crate::model::length_map_internal::ConstraintViolation;
|
4596 4074 |
|
4075 + | /// 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.
|
4076 + | fn try_from(
|
4077 + | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4078 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4079 + | let length = value.len();
|
4080 + | if (1..=69).contains(&length) {
|
4597 4081 | Ok(Self(value))
|
4082 + | } else {
|
4083 + | Err(crate::model::length_map_internal::ConstraintViolation::Length(length))
|
4598 4084 | }
|
4599 - | }
|
4600 - | impl crate::constrained::Constrained for FixedLengthBlob {
|
4601 - | type Unconstrained = ::aws_smithy_types::Blob;
|
4602 - | }
|
4603 - |
|
4604 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
4605 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
4606 - | {
|
4607 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
4608 - | Self::Unconstrained(value)
|
4609 - | }
|
4610 - | }
|
4611 - |
|
4612 - | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
4613 - | fn from(value: FixedLengthBlob) -> Self {
|
4614 - | value.into_inner()
|
4615 4085 | }
|
4616 4086 | }
|
4617 4087 |
|
4618 - | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
4619 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
4088 + | impl ::std::convert::From<LengthMap>
|
4089 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
4620 4090 | {
|
4621 - | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
4622 - | Self::Unconstrained(value.into())
|
4623 - | }
|
4624 - | }
|
4625 - |
|
4626 - | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
4627 - | fn from(value: FixedLengthBlob) -> Self {
|
4628 - | value.into_inner().into()
|
4091 + | fn from(value: LengthMap) -> Self {
|
4092 + | value.into_inner()
|
4629 4093 | }
|
4630 4094 | }
|
4631 - | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for FixedLengthBlob {
|
4632 - | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
4633 - |
|
4634 - | fn try_from(
|
4635 - | value: ::aws_smithy_http_server_python::types::Blob,
|
4636 - | ) -> ::std::result::Result<Self, Self::Error> {
|
4637 - | value.try_into()
|
4638 - | }
|
4095 + | impl crate::constrained::Constrained for LengthMap {
|
4096 + | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
4639 4097 | }
|
4640 4098 |
|
4641 4099 | #[allow(missing_docs)] // documentation missing in model
|
4642 4100 | ///
|
4643 4101 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4644 - | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
4102 + | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
4645 4103 | ///
|
4646 4104 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4647 4105 | ///
|
4648 - | #[derive(
|
4649 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4650 - | )]
|
4651 - | pub(crate) struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
4652 - | impl MaxLengthBlob {
|
4653 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
4654 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
4106 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4107 + | pub(crate) struct SparseLengthMap(
|
4108 + | pub(crate) ::std::collections::HashMap<
|
4109 + | ::std::string::String,
|
4110 + | ::std::option::Option<::std::string::String>,
|
4111 + | >,
|
4112 + | );
|
4113 + | impl SparseLengthMap {
|
4114 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
4115 + | pub fn into_inner(
|
4116 + | self,
|
4117 + | ) -> ::std::collections::HashMap<
|
4118 + | ::std::string::String,
|
4119 + | ::std::option::Option<::std::string::String>,
|
4120 + | > {
|
4655 4121 | self.0
|
4656 4122 | }
|
4657 4123 | }
|
4658 - | impl MaxLengthBlob {
|
4659 - | fn check_length(
|
4660 - | blob: &::aws_smithy_types::Blob,
|
4661 - | ) -> ::std::result::Result<(), crate::model::max_length_blob_internal::ConstraintViolation>
|
4662 - | {
|
4663 - | let length = blob.as_ref().len();
|
4124 + | impl
|
4125 + | ::std::convert::TryFrom<
|
4126 + | ::std::collections::HashMap<
|
4127 + | ::std::string::String,
|
4128 + | ::std::option::Option<::std::string::String>,
|
4129 + | >,
|
4130 + | > for SparseLengthMap
|
4131 + | {
|
4132 + | type Error = crate::model::sparse_length_map_internal::ConstraintViolation;
|
4664 4133 |
|
4665 - | if length <= 70 {
|
4666 - | Ok(())
|
4134 + | /// 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.
|
4135 + | fn try_from(
|
4136 + | value: ::std::collections::HashMap<
|
4137 + | ::std::string::String,
|
4138 + | ::std::option::Option<::std::string::String>,
|
4139 + | >,
|
4140 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4141 + | let length = value.len();
|
4142 + | if 69 <= length {
|
4143 + | Ok(Self(value))
|
4667 4144 | } else {
|
4668 - | Err(crate::model::max_length_blob_internal::ConstraintViolation::Length(length))
|
4669 - | }
|
4145 + | Err(crate::model::sparse_length_map_internal::ConstraintViolation::Length(length))
|
4670 4146 | }
|
4671 - | }
|
4672 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
4673 - | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
4674 - |
|
4675 - | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
4676 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
4677 - | Self::check_length(&value)?;
|
4678 - |
|
4679 - | Ok(Self(value))
|
4680 4147 | }
|
4681 4148 | }
|
4682 - | impl crate::constrained::Constrained for MaxLengthBlob {
|
4683 - | type Unconstrained = ::aws_smithy_types::Blob;
|
4684 - | }
|
4685 4149 |
|
4686 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
4687 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
4150 + | impl ::std::convert::From<SparseLengthMap>
|
4151 + | for ::std::collections::HashMap<
|
4152 + | ::std::string::String,
|
4153 + | ::std::option::Option<::std::string::String>,
|
4154 + | >
|
4688 4155 | {
|
4689 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
4690 - | Self::Unconstrained(value)
|
4691 - | }
|
4692 - | }
|
4693 - |
|
4694 - | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
4695 - | fn from(value: MaxLengthBlob) -> Self {
|
4156 + | fn from(value: SparseLengthMap) -> Self {
|
4696 4157 | value.into_inner()
|
4697 4158 | }
|
4698 4159 | }
|
4699 - |
|
4700 - | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
4701 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
4702 - | {
|
4703 - | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
4704 - | Self::Unconstrained(value.into())
|
4705 - | }
|
4706 - | }
|
4707 - |
|
4708 - | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
4709 - | fn from(value: MaxLengthBlob) -> Self {
|
4710 - | value.into_inner().into()
|
4711 - | }
|
4712 - | }
|
4713 - | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for MaxLengthBlob {
|
4714 - | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
4715 - |
|
4716 - | fn try_from(
|
4717 - | value: ::aws_smithy_http_server_python::types::Blob,
|
4718 - | ) -> ::std::result::Result<Self, Self::Error> {
|
4719 - | value.try_into()
|
4720 - | }
|
4160 + | impl crate::constrained::Constrained for SparseLengthMap {
|
4161 + | type Unconstrained =
|
4162 + | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
4721 4163 | }
|
4722 4164 |
|
4723 4165 | #[allow(missing_docs)] // documentation missing in model
|
4724 4166 | ///
|
4725 4167 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4726 - | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
4168 + | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
4727 4169 | ///
|
4728 4170 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4729 4171 | ///
|
4730 4172 | #[derive(
|
4731 4173 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4732 4174 | )]
|
4733 - | pub(crate) struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
4734 - | impl MinLengthBlob {
|
4735 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
4736 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
4175 + | pub(crate) struct SparseLengthList(
|
4176 + | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
4177 + | );
|
4178 + | impl SparseLengthList {
|
4179 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
4180 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
4737 4181 | self.0
|
4738 4182 | }
|
4739 - | }
|
4740 - | impl MinLengthBlob {
|
4183 + |
|
4741 4184 | fn check_length(
|
4742 - | blob: &::aws_smithy_types::Blob,
|
4743 - | ) -> ::std::result::Result<(), crate::model::min_length_blob_internal::ConstraintViolation>
|
4185 + | length: usize,
|
4186 + | ) -> ::std::result::Result<(), crate::model::sparse_length_list_internal::ConstraintViolation>
|
4744 4187 | {
|
4745 - | let length = blob.as_ref().len();
|
4746 - |
|
4747 - | if 2 <= length {
|
4188 + | if 69 <= length {
|
4748 4189 | Ok(())
|
4749 4190 | } else {
|
4750 - | Err(crate::model::min_length_blob_internal::ConstraintViolation::Length(length))
|
4191 + | Err(crate::model::sparse_length_list_internal::ConstraintViolation::Length(length))
|
4751 4192 | }
|
4752 4193 | }
|
4753 4194 | }
|
4754 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
4755 - | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
4195 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
4196 + | for SparseLengthList
|
4197 + | {
|
4198 + | type Error = crate::model::sparse_length_list_internal::ConstraintViolation;
|
4756 4199 |
|
4757 - | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
4758 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
4759 - | Self::check_length(&value)?;
|
4200 + | /// 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.
|
4201 + | fn try_from(
|
4202 + | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
4203 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4204 + | Self::check_length(value.len())?;
|
4760 4205 |
|
4761 4206 | Ok(Self(value))
|
4762 4207 | }
|
4763 4208 | }
|
4764 - | impl crate::constrained::Constrained for MinLengthBlob {
|
4765 - | type Unconstrained = ::aws_smithy_types::Blob;
|
4766 - | }
|
4767 4209 |
|
4768 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
4769 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
4210 + | impl ::std::convert::From<SparseLengthList>
|
4211 + | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
4770 4212 | {
|
4771 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
4772 - | Self::Unconstrained(value)
|
4773 - | }
|
4774 - | }
|
4775 - |
|
4776 - | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
4777 - | fn from(value: MinLengthBlob) -> Self {
|
4213 + | fn from(value: SparseLengthList) -> Self {
|
4778 4214 | value.into_inner()
|
4779 4215 | }
|
4780 4216 | }
|
4781 - |
|
4782 - | impl ::std::convert::From<::aws_smithy_http_server_python::types::Blob>
|
4783 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
4784 - | {
|
4785 - | fn from(value: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
4786 - | Self::Unconstrained(value.into())
|
4787 - | }
|
4217 + | impl crate::constrained::Constrained for SparseLengthList {
|
4218 + | type Unconstrained =
|
4219 + | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
4788 4220 | }
|
4789 4221 |
|
4790 - | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_http_server_python::types::Blob {
|
4791 - | fn from(value: MinLengthBlob) -> Self {
|
4792 - | value.into_inner().into()
|
4793 - | }
|
4222 + | /// A union with constrained members.
|
4223 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4224 + | pub enum ConstrainedUnion {
|
4225 + | #[allow(missing_docs)] // documentation missing in model
|
4226 + | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
4227 + | #[allow(missing_docs)] // documentation missing in model
|
4228 + | ConBMap(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
4229 + | #[allow(missing_docs)] // documentation missing in model
|
4230 + | ConBSet(::std::vec::Vec<::std::vec::Vec<::std::string::String>>),
|
4231 + | #[allow(missing_docs)] // documentation missing in model
|
4232 + | ConstrainedStructure(crate::model::ConB),
|
4233 + | #[allow(missing_docs)] // documentation missing in model
|
4234 + | EnumString(crate::model::EnumString),
|
4235 + | #[allow(missing_docs)] // documentation missing in model
|
4236 + | LengthString(::std::string::String),
|
4794 4237 | }
|
4795 - | impl ::std::convert::TryFrom<::aws_smithy_http_server_python::types::Blob> for MinLengthBlob {
|
4796 - | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
4797 - |
|
4798 - | fn try_from(
|
4799 - | value: ::aws_smithy_http_server_python::types::Blob,
|
4800 - | ) -> ::std::result::Result<Self, Self::Error> {
|
4801 - | value.try_into()
|
4802 - | }
|
4803 - | }
|
4804 - |
|
4805 - | #[allow(missing_docs)] // documentation missing in model
|
4806 - | ///
|
4807 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4808 - | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
4809 - | ///
|
4810 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4811 - | ///
|
4812 - | #[derive(
|
4813 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4814 - | )]
|
4815 - | pub(crate) struct FixedLengthString(pub(crate) ::std::string::String);
|
4816 - | #[allow(dead_code)]
|
4817 - | impl FixedLengthString {
|
4818 - | /// Extracts a string slice containing the entire underlying `String`.
|
4819 - | pub fn as_str(&self) -> &str {
|
4820 - | &self.0
|
4238 + | impl ConstrainedUnion {
|
4239 + | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
4240 + | /// Returns `Err(&Self)` if it can't be converted.
|
4241 + | pub fn as_con_b_list(
|
4242 + | &self,
|
4243 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
4244 + | if let ConstrainedUnion::ConBList(val) = &self {
|
4245 + | ::std::result::Result::Ok(val)
|
4246 + | } else {
|
4247 + | ::std::result::Result::Err(self)
|
4821 4248 | }
|
4822 - |
|
4823 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4824 - | pub fn inner(&self) -> &::std::string::String {
|
4825 - | &self.0
|
4826 4249 | }
|
4827 - |
|
4828 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4829 - | pub fn into_inner(self) -> ::std::string::String {
|
4830 - | self.0
|
4250 + | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
4251 + | pub fn is_con_b_list(&self) -> bool {
|
4252 + | self.as_con_b_list().is_ok()
|
4831 4253 | }
|
4832 - | }
|
4833 - | impl FixedLengthString {
|
4834 - | fn check_length(
|
4835 - | string: &str,
|
4836 - | ) -> ::std::result::Result<(), crate::model::fixed_length_string_internal::ConstraintViolation>
|
4837 - | {
|
4838 - | let length = string.chars().count();
|
4839 - |
|
4840 - | if (69..=69).contains(&length) {
|
4841 - | Ok(())
|
4254 + | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
4255 + | /// Returns `Err(&Self)` if it can't be converted.
|
4256 + | pub fn as_con_b_map(
|
4257 + | &self,
|
4258 + | ) -> ::std::result::Result<
|
4259 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4260 + | &Self,
|
4261 + | > {
|
4262 + | if let ConstrainedUnion::ConBMap(val) = &self {
|
4263 + | ::std::result::Result::Ok(val)
|
4842 4264 | } else {
|
4843 - | Err(crate::model::fixed_length_string_internal::ConstraintViolation::Length(length))
|
4265 + | ::std::result::Result::Err(self)
|
4844 4266 | }
|
4845 4267 | }
|
4846 - | }
|
4847 - | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
4848 - | type Error = crate::model::fixed_length_string_internal::ConstraintViolation;
|
4849 - |
|
4850 - | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4851 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4852 - | Self::check_length(&value)?;
|
4853 - |
|
4854 - | Ok(Self(value))
|
4268 + | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
4269 + | pub fn is_con_b_map(&self) -> bool {
|
4270 + | self.as_con_b_map().is_ok()
|
4855 4271 | }
|
4856 - | }
|
4857 - | impl crate::constrained::Constrained for FixedLengthString {
|
4858 - | type Unconstrained = ::std::string::String;
|
4859 - | }
|
4860 - |
|
4861 - | impl ::std::convert::From<::std::string::String>
|
4862 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
4863 - | {
|
4864 - | fn from(value: ::std::string::String) -> Self {
|
4865 - | Self::Unconstrained(value)
|
4272 + | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
4273 + | /// Returns `Err(&Self)` if it can't be converted.
|
4274 + | pub fn as_con_b_set(
|
4275 + | &self,
|
4276 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<::std::string::String>>, &Self>
|
4277 + | {
|
4278 + | if let ConstrainedUnion::ConBSet(val) = &self {
|
4279 + | ::std::result::Result::Ok(val)
|
4280 + | } else {
|
4281 + | ::std::result::Result::Err(self)
|
4866 4282 | }
|
4867 - | }
|
4868 - |
|
4869 - | impl ::std::fmt::Display for FixedLengthString {
|
4870 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4871 - | self.0.fmt(f)
|
4872 4283 | }
|
4873 - | }
|
4874 - |
|
4875 - | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
4876 - | fn from(value: FixedLengthString) -> Self {
|
4877 - | value.into_inner()
|
4284 + | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
4285 + | pub fn is_con_b_set(&self) -> bool {
|
4286 + | self.as_con_b_set().is_ok()
|
4878 4287 | }
|
4879 - | }
|
4880 - |
|
4881 - | #[allow(missing_docs)] // documentation missing in model
|
4882 - | ///
|
4883 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4884 - | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
4885 - | ///
|
4886 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4887 - | ///
|
4888 - | #[derive(
|
4889 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4890 - | )]
|
4891 - | pub(crate) struct MaxLengthString(pub(crate) ::std::string::String);
|
4892 - | #[allow(dead_code)]
|
4893 - | impl MaxLengthString {
|
4894 - | /// Extracts a string slice containing the entire underlying `String`.
|
4895 - | pub fn as_str(&self) -> &str {
|
4896 - | &self.0
|
4288 + | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
4289 + | /// Returns `Err(&Self)` if it can't be converted.
|
4290 + | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
4291 + | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
4292 + | ::std::result::Result::Ok(val)
|
4293 + | } else {
|
4294 + | ::std::result::Result::Err(self)
|
4897 4295 | }
|
4898 - |
|
4899 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4900 - | pub fn inner(&self) -> &::std::string::String {
|
4901 - | &self.0
|
4902 4296 | }
|
4903 - |
|
4904 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4905 - | pub fn into_inner(self) -> ::std::string::String {
|
4906 - | self.0
|
4297 + | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
4298 + | pub fn is_constrained_structure(&self) -> bool {
|
4299 + | self.as_constrained_structure().is_ok()
|
4907 4300 | }
|
4908 - | }
|
4909 - | impl MaxLengthString {
|
4910 - | fn check_length(
|
4911 - | string: &str,
|
4912 - | ) -> ::std::result::Result<(), crate::model::max_length_string_internal::ConstraintViolation>
|
4913 - | {
|
4914 - | let length = string.chars().count();
|
4915 - |
|
4916 - | if length <= 69 {
|
4917 - | Ok(())
|
4301 + | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
4302 + | /// Returns `Err(&Self)` if it can't be converted.
|
4303 + | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
4304 + | if let ConstrainedUnion::EnumString(val) = &self {
|
4305 + | ::std::result::Result::Ok(val)
|
4918 4306 | } else {
|
4919 - | Err(crate::model::max_length_string_internal::ConstraintViolation::Length(length))
|
4307 + | ::std::result::Result::Err(self)
|
4920 4308 | }
|
4921 4309 | }
|
4922 - | }
|
4923 - | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
4924 - | type Error = crate::model::max_length_string_internal::ConstraintViolation;
|
4925 - |
|
4926 - | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4927 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4928 - | Self::check_length(&value)?;
|
4929 - |
|
4930 - | Ok(Self(value))
|
4310 + | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
4311 + | pub fn is_enum_string(&self) -> bool {
|
4312 + | self.as_enum_string().is_ok()
|
4931 4313 | }
|
4932 - | }
|
4933 - | impl crate::constrained::Constrained for MaxLengthString {
|
4934 - | type Unconstrained = ::std::string::String;
|
4935 - | }
|
4936 - |
|
4937 - | impl ::std::convert::From<::std::string::String>
|
4938 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
4939 - | {
|
4940 - | fn from(value: ::std::string::String) -> Self {
|
4941 - | Self::Unconstrained(value)
|
4314 + | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
4315 + | /// Returns `Err(&Self)` if it can't be converted.
|
4316 + | pub fn as_length_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
4317 + | if let ConstrainedUnion::LengthString(val) = &self {
|
4318 + | ::std::result::Result::Ok(val)
|
4319 + | } else {
|
4320 + | ::std::result::Result::Err(self)
|
4942 4321 | }
|
4943 - | }
|
4944 - |
|
4945 - | impl ::std::fmt::Display for MaxLengthString {
|
4946 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4947 - | self.0.fmt(f)
|
4948 4322 | }
|
4949 - | }
|
4950 - |
|
4951 - | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
4952 - | fn from(value: MaxLengthString) -> Self {
|
4953 - | value.into_inner()
|
4323 + | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
4324 + | pub fn is_length_string(&self) -> bool {
|
4325 + | self.as_length_string().is_ok()
|
4954 4326 | }
|
4955 4327 | }
|
4956 - |
|
4957 - | #[allow(missing_docs)] // documentation missing in model
|
4958 - | ///
|
4959 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4960 - | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
4961 - | ///
|
4962 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4963 - | ///
|
4964 - | #[derive(
|
4965 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4966 - | )]
|
4967 - | pub(crate) struct MinLengthString(pub(crate) ::std::string::String);
|
4968 - | #[allow(dead_code)]
|
4969 - | impl MinLengthString {
|
4970 - | /// Extracts a string slice containing the entire underlying `String`.
|
4971 - | pub fn as_str(&self) -> &str {
|
4972 - | &self.0
|
4328 + | #[pyo3::pyclass(name = "ConstrainedUnion")]
|
4329 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4330 + | pub struct PyUnionMarkerConstrainedUnion(pub ConstrainedUnion);
|
4331 + | #[::pyo3::pymethods]
|
4332 + | impl PyUnionMarkerConstrainedUnion {
|
4333 + | #[staticmethod]
|
4334 + | /// Creates a new union instance of [`ConBList`](crate::model::ConstrainedUnion::ConBList)
|
4335 + | /// :param data typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]:
|
4336 + | /// :rtype ConstrainedUnion:
|
4337 + | pub fn con_b_list(data: ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>) -> Self {
|
4338 + | Self(ConstrainedUnion::ConBList(data))
|
4973 4339 | }
|
4974 - |
|
4975 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4976 - | pub fn inner(&self) -> &::std::string::String {
|
4977 - | &self.0
|
4340 + | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
4341 + | /// :rtype typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]:
|
4342 + | pub fn as_con_b_list(
|
4343 + | &self,
|
4344 + | ) -> ::pyo3::PyResult<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>> {
|
4345 + | match self.0.as_con_b_list() {
|
4346 + | Ok(variant) => Ok(variant.clone()),
|
4347 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
4348 + | r"ConstrainedUnion variant is not of type typing.List\[typing.List\[constraints_without_public_constrained_types.model.ConB\]\]",
|
4349 + | )),
|
4978 4350 | }
|
4979 - |
|
4980 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4981 - | pub fn into_inner(self) -> ::std::string::String {
|
4982 - | self.0
|
4983 4351 | }
|
4984 - | }
|
4985 - | impl MinLengthString {
|
4986 - | fn check_length(
|
4987 - | string: &str,
|
4988 - | ) -> ::std::result::Result<(), crate::model::min_length_string_internal::ConstraintViolation>
|
4989 - | {
|
4990 - | let length = string.chars().count();
|
4991 - |
|
4992 - | if 2 <= length {
|
4993 - | Ok(())
|
4994 - | } else {
|
4995 - | Err(crate::model::min_length_string_internal::ConstraintViolation::Length(length))
|
4352 + | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
4353 + | /// :rtype bool:
|
4354 + | pub fn is_con_b_list(&self) -> bool {
|
4355 + | self.0.is_con_b_list()
|
4996 4356 | }
|
4357 + | #[staticmethod]
|
4358 + | /// Creates a new union instance of [`ConBMap`](crate::model::ConstrainedUnion::ConBMap)
|
4359 + | /// :param data typing.Dict\[str, str\]:
|
4360 + | /// :rtype ConstrainedUnion:
|
4361 + | pub fn con_b_map(
|
4362 + | data: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4363 + | ) -> Self {
|
4364 + | Self(ConstrainedUnion::ConBMap(data))
|
4997 4365 | }
|
4998 - | }
|
4999 - | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
5000 - | type Error = crate::model::min_length_string_internal::ConstraintViolation;
|
5001 - |
|
5002 - | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5003 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5004 - | Self::check_length(&value)?;
|
5005 - |
|
5006 - | Ok(Self(value))
|
4366 + | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
4367 + | /// :rtype typing.Dict\[str, str\]:
|
4368 + | pub fn as_con_b_map(
|
4369 + | &self,
|
4370 + | ) -> ::pyo3::PyResult<::std::collections::HashMap<::std::string::String, ::std::string::String>>
|
4371 + | {
|
4372 + | match self.0.as_con_b_map() {
|
4373 + | Ok(variant) => Ok(variant.clone()),
|
4374 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
4375 + | r"ConstrainedUnion variant is not of type typing.Dict\[str, str\]",
|
4376 + | )),
|
5007 4377 | }
|
5008 - | }
|
5009 - | impl crate::constrained::Constrained for MinLengthString {
|
5010 - | type Unconstrained = ::std::string::String;
|
5011 - | }
|
5012 - |
|
5013 - | impl ::std::convert::From<::std::string::String>
|
5014 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
5015 - | {
|
5016 - | fn from(value: ::std::string::String) -> Self {
|
5017 - | Self::Unconstrained(value)
|
5018 4378 | }
|
5019 - | }
|
5020 - |
|
5021 - | impl ::std::fmt::Display for MinLengthString {
|
5022 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5023 - | self.0.fmt(f)
|
4379 + | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
4380 + | /// :rtype bool:
|
4381 + | pub fn is_con_b_map(&self) -> bool {
|
4382 + | self.0.is_con_b_map()
|
5024 4383 | }
|
5025 - | }
|
5026 - |
|
5027 - | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
5028 - | fn from(value: MinLengthString) -> Self {
|
5029 - | value.into_inner()
|
4384 + | #[staticmethod]
|
4385 + | /// Creates a new union instance of [`ConBSet`](crate::model::ConstrainedUnion::ConBSet)
|
4386 + | /// :param data typing.List\[typing.Set\[str\]\]:
|
4387 + | /// :rtype ConstrainedUnion:
|
4388 + | pub fn con_b_set(data: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>) -> Self {
|
4389 + | Self(ConstrainedUnion::ConBSet(data))
|
5030 4390 | }
|
5031 - | }
|
5032 - |
|
5033 - | #[allow(missing_docs)] // documentation missing in model
|
5034 - | #[derive(
|
5035 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5036 - | )]
|
5037 - | pub enum ConstrainedUnionInOutput {
|
5038 - | #[allow(missing_docs)] // documentation missing in model
|
5039 - | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
5040 - | }
|
5041 - | impl ConstrainedUnionInOutput {
|
5042 - | #[allow(irrefutable_let_patterns)]
|
5043 - | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
5044 - | /// Returns `Err(&Self)` if it can't be converted.
|
5045 - | pub fn as_structure(
|
4391 + | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
4392 + | /// :rtype typing.List\[typing.Set\[str\]\]:
|
4393 + | pub fn as_con_b_set(
|
5046 4394 | &self,
|
5047 - | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
5048 - | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
5049 - | ::std::result::Result::Ok(val)
|
5050 - | } else {
|
5051 - | ::std::result::Result::Err(self)
|
4395 + | ) -> ::pyo3::PyResult<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
|
4396 + | match self.0.as_con_b_set() {
|
4397 + | Ok(variant) => Ok(variant.clone()),
|
4398 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
4399 + | r"ConstrainedUnion variant is not of type typing.List\[typing.Set\[str\]\]",
|
4400 + | )),
|
5052 4401 | }
|
5053 4402 | }
|
5054 - | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
5055 - | pub fn is_structure(&self) -> bool {
|
5056 - | self.as_structure().is_ok()
|
4403 + | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
4404 + | /// :rtype bool:
|
4405 + | pub fn is_con_b_set(&self) -> bool {
|
4406 + | self.0.is_con_b_set()
|
5057 4407 | }
|
5058 - | }
|
5059 - | #[pyo3::pyclass(name = "ConstrainedUnionInOutput")]
|
5060 - | #[derive(
|
5061 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5062 - | )]
|
5063 - | pub struct PyUnionMarkerConstrainedUnionInOutput(pub ConstrainedUnionInOutput);
|
5064 - | #[::pyo3::pymethods]
|
5065 - | impl PyUnionMarkerConstrainedUnionInOutput {
|
5066 - | #[allow(irrefutable_let_patterns)]
|
5067 4408 | #[staticmethod]
|
5068 - | /// Creates a new union instance of [`Structure`](crate::model::ConstrainedUnionInOutput::Structure)
|
5069 - | /// :param data constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput:
|
5070 - | /// :rtype ConstrainedUnionInOutput:
|
5071 - | pub fn structure(data: crate::model::TransitivelyConstrainedStructureInOutput) -> Self {
|
5072 - | Self(ConstrainedUnionInOutput::Structure(data))
|
4409 + | /// Creates a new union instance of [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure)
|
4410 + | /// :param data constraints_without_public_constrained_types.model.ConB:
|
4411 + | /// :rtype ConstrainedUnion:
|
4412 + | pub fn constrained_structure(data: crate::model::ConB) -> Self {
|
4413 + | Self(ConstrainedUnion::ConstrainedStructure(data))
|
5073 4414 | }
|
5074 - | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
5075 - | /// :rtype constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput:
|
5076 - | pub fn as_structure(
|
5077 - | &self,
|
5078 - | ) -> ::pyo3::PyResult<crate::model::TransitivelyConstrainedStructureInOutput> {
|
5079 - | match self.0.as_structure() {
|
4415 + | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
4416 + | /// :rtype constraints_without_public_constrained_types.model.ConB:
|
4417 + | pub fn as_constrained_structure(&self) -> ::pyo3::PyResult<crate::model::ConB> {
|
4418 + | match self.0.as_constrained_structure() {
|
5080 4419 | Ok(variant) => Ok(variant.clone()),
|
5081 4420 | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
5082 - | r"ConstrainedUnionInOutput variant is not of type constraints_without_public_constrained_types.model.TransitivelyConstrainedStructureInOutput",
|
4421 + | r"ConstrainedUnion variant is not of type constraints_without_public_constrained_types.model.ConB",
|
5083 4422 | )),
|
5084 4423 | }
|
5085 4424 | }
|
5086 - | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
4425 + | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
5087 4426 | /// :rtype bool:
|
5088 - | pub fn is_structure(&self) -> bool {
|
5089 - | self.0.is_structure()
|
4427 + | pub fn is_constrained_structure(&self) -> bool {
|
4428 + | self.0.is_constrained_structure()
|
5090 4429 | }
|
5091 - | }
|
5092 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for ConstrainedUnionInOutput {
|
5093 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
5094 - | PyUnionMarkerConstrainedUnionInOutput(self).into_py(py)
|
4430 + | #[staticmethod]
|
4431 + | /// Creates a new union instance of [`EnumString`](crate::model::ConstrainedUnion::EnumString)
|
4432 + | /// :param data constraints_without_public_constrained_types.model.EnumString:
|
4433 + | /// :rtype ConstrainedUnion:
|
4434 + | pub fn enum_string(data: crate::model::EnumString) -> Self {
|
4435 + | Self(ConstrainedUnion::EnumString(data))
|
5095 4436 | }
|
5096 - | }
|
5097 - | impl<'source> ::pyo3::FromPyObject<'source> for ConstrainedUnionInOutput {
|
5098 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
5099 - | let data: PyUnionMarkerConstrainedUnionInOutput = obj.extract()?;
|
5100 - | Ok(data.0)
|
4437 + | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
4438 + | /// :rtype constraints_without_public_constrained_types.model.EnumString:
|
4439 + | pub fn as_enum_string(&self) -> ::pyo3::PyResult<crate::model::EnumString> {
|
4440 + | match self.0.as_enum_string() {
|
4441 + | Ok(variant) => Ok(variant.clone()),
|
4442 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
4443 + | r"ConstrainedUnion variant is not of type constraints_without_public_constrained_types.model.EnumString",
|
4444 + | )),
|
5101 4445 | }
|
5102 - | }
|
5103 - |
|
5104 - | #[::pyo3::pyclass]
|
5105 - | /// :param length_string typing.Optional\[str\]:
|
5106 - | /// :rtype None:
|
5107 - | #[allow(missing_docs)] // documentation missing in model
|
5108 - | #[derive(
|
5109 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5110 - | )]
|
5111 - | pub struct TransitivelyConstrainedStructureInOutput {
|
5112 - | #[pyo3(get, set)]
|
5113 - | /// :type typing.Optional\[str\]:
|
5114 - | #[allow(missing_docs)] // documentation missing in model
|
5115 - | pub length_string: ::std::option::Option<::std::string::String>,
|
5116 - | }
|
5117 - | impl TransitivelyConstrainedStructureInOutput {
|
5118 - | #[allow(missing_docs)] // documentation missing in model
|
5119 - | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
5120 - | self.length_string.as_deref()
|
5121 4446 | }
|
5122 - | }
|
5123 - | #[allow(clippy::new_without_default)]
|
5124 - | #[allow(clippy::too_many_arguments)]
|
5125 - | #[::pyo3::pymethods]
|
5126 - | impl TransitivelyConstrainedStructureInOutput {
|
5127 - | #[new]
|
5128 - | pub fn new(length_string: ::std::option::Option<::std::string::String>) -> Self {
|
5129 - | Self { length_string }
|
4447 + | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
4448 + | /// :rtype bool:
|
4449 + | pub fn is_enum_string(&self) -> bool {
|
4450 + | self.0.is_enum_string()
|
5130 4451 | }
|
5131 - | fn __repr__(&self) -> String {
|
5132 - | format!("{self:?}")
|
4452 + | #[staticmethod]
|
4453 + | /// Creates a new union instance of [`LengthString`](crate::model::ConstrainedUnion::LengthString)
|
4454 + | /// :param data str:
|
4455 + | /// :rtype ConstrainedUnion:
|
4456 + | pub fn length_string(data: ::std::string::String) -> Self {
|
4457 + | Self(ConstrainedUnion::LengthString(data))
|
5133 4458 | }
|
5134 - | fn __str__(&self) -> String {
|
5135 - | format!("{self:?}")
|
4459 + | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
4460 + | /// :rtype str:
|
4461 + | pub fn as_length_string(&self) -> ::pyo3::PyResult<::std::string::String> {
|
4462 + | match self.0.as_length_string() {
|
4463 + | Ok(variant) => Ok(variant.clone()),
|
4464 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
4465 + | r"ConstrainedUnion variant is not of type str",
|
4466 + | )),
|
5136 4467 | }
|
5137 - | }
|
5138 - | impl<'source> ::pyo3::FromPyObject<'source>
|
5139 - | for std::boxed::Box<TransitivelyConstrainedStructureInOutput>
|
5140 - | {
|
5141 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
5142 - | ob.extract::<TransitivelyConstrainedStructureInOutput>()
|
5143 - | .map(Box::new)
|
4468 + | }
|
4469 + | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
4470 + | /// :rtype bool:
|
4471 + | pub fn is_length_string(&self) -> bool {
|
4472 + | self.0.is_length_string()
|
5144 4473 | }
|
5145 4474 | }
|
5146 - |
|
5147 - | impl ::pyo3::IntoPy<::pyo3::PyObject>
|
5148 - | for std::boxed::Box<TransitivelyConstrainedStructureInOutput>
|
5149 - | {
|
4475 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for ConstrainedUnion {
|
5150 4476 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
5151 - | (*self).into_py(py)
|
4477 + | PyUnionMarkerConstrainedUnion(self).into_py(py)
|
5152 4478 | }
|
5153 4479 | }
|
5154 - | impl TransitivelyConstrainedStructureInOutput {
|
5155 - | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
5156 - | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
5157 - | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
4480 + | impl<'source> ::pyo3::FromPyObject<'source> for ConstrainedUnion {
|
4481 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
4482 + | let data: PyUnionMarkerConstrainedUnion = obj.extract()?;
|
4483 + | Ok(data.0)
|
5158 4484 | }
|
5159 4485 | }
|
5160 4486 |
|
5161 4487 | #[allow(missing_docs)] // documentation missing in model
|
5162 4488 | ///
|
5163 4489 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5164 - | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
4490 + | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
5165 4491 | ///
|
5166 4492 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5167 4493 | ///
|
5168 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5169 - | pub(crate) struct ConstrainedMapInOutput(
|
5170 - | pub(crate) ::std::collections::HashMap<
|
5171 - | ::std::string::String,
|
5172 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
5173 - | >,
|
5174 - | );
|
5175 - | impl ConstrainedMapInOutput {
|
5176 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
5177 - | pub fn into_inner(
|
5178 - | self,
|
5179 - | ) -> ::std::collections::HashMap<
|
5180 - | ::std::string::String,
|
5181 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
5182 - | > {
|
4494 + | #[derive(
|
4495 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4496 + | )]
|
4497 + | pub(crate) struct PatternString(pub(crate) ::std::string::String);
|
4498 + | #[allow(dead_code)]
|
4499 + | impl PatternString {
|
4500 + | /// Extracts a string slice containing the entire underlying `String`.
|
4501 + | pub fn as_str(&self) -> &str {
|
4502 + | &self.0
|
4503 + | }
|
4504 + |
|
4505 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4506 + | pub fn inner(&self) -> &::std::string::String {
|
4507 + | &self.0
|
4508 + | }
|
4509 + |
|
4510 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4511 + | pub fn into_inner(self) -> ::std::string::String {
|
5183 4512 | self.0
|
5184 4513 | }
|
5185 4514 | }
|
5186 - | impl
|
5187 - | ::std::convert::TryFrom<
|
5188 - | ::std::collections::HashMap<
|
4515 + | impl PatternString {
|
4516 + | fn check_pattern(
|
4517 + | string: ::std::string::String,
|
4518 + | ) -> ::std::result::Result<
|
5189 4519 | ::std::string::String,
|
5190 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
5191 - | >,
|
5192 - | > for ConstrainedMapInOutput
|
5193 - | {
|
5194 - | type Error = crate::model::constrained_map_in_output_internal::ConstraintViolation;
|
4520 + | crate::model::pattern_string_internal::ConstraintViolation,
|
4521 + | > {
|
4522 + | let regex = Self::compile_regex();
|
5195 4523 |
|
5196 - | /// 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.
|
5197 - | fn try_from(
|
5198 - | value: ::std::collections::HashMap<
|
5199 - | ::std::string::String,
|
5200 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
5201 - | >,
|
5202 - | ) -> ::std::result::Result<Self, Self::Error> {
|
5203 - | let length = value.len();
|
5204 - | if 69 <= length {
|
5205 - | Ok(Self(value))
|
4524 + | if regex.is_match(&string) {
|
4525 + | Ok(string)
|
5206 4526 | } else {
|
5207 - | Err(
|
5208 - | crate::model::constrained_map_in_output_internal::ConstraintViolation::Length(
|
5209 - | length,
|
5210 - | ),
|
5211 - | )
|
4527 + | Err(crate::model::pattern_string_internal::ConstraintViolation::Pattern(string))
|
4528 + | }
|
4529 + | }
|
4530 + |
|
4531 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
4532 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
4533 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
4534 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
4535 + | ::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"#)
|
4536 + | });
|
4537 + |
|
4538 + | ®EX
|
5212 4539 | }
|
4540 + | }
|
4541 + | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
4542 + | type Error = crate::model::pattern_string_internal::ConstraintViolation;
|
4543 + |
|
4544 + | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4545 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4546 + | let value = Self::check_pattern(value)?;
|
4547 + |
|
4548 + | Ok(Self(value))
|
5213 4549 | }
|
5214 4550 | }
|
4551 + | impl crate::constrained::Constrained for PatternString {
|
4552 + | type Unconstrained = ::std::string::String;
|
4553 + | }
|
5215 4554 |
|
5216 - | impl ::std::convert::From<ConstrainedMapInOutput>
|
5217 - | for ::std::collections::HashMap<
|
5218 - | ::std::string::String,
|
5219 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
5220 - | >
|
4555 + | impl ::std::convert::From<::std::string::String>
|
4556 + | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
5221 4557 | {
|
5222 - | fn from(value: ConstrainedMapInOutput) -> Self {
|
4558 + | fn from(value: ::std::string::String) -> Self {
|
4559 + | Self::Unconstrained(value)
|
4560 + | }
|
4561 + | }
|
4562 + |
|
4563 + | impl ::std::fmt::Display for PatternString {
|
4564 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4565 + | self.0.fmt(f)
|
4566 + | }
|
4567 + | }
|
4568 + |
|
4569 + | impl ::std::convert::From<PatternString> for ::std::string::String {
|
4570 + | fn from(value: PatternString) -> Self {
|
5223 4571 | value.into_inner()
|
5224 4572 | }
|
5225 4573 | }
|
5226 4574 |
|
4575 + | #[cfg(test)]
|
4576 + | mod test_pattern_string {
|
4577 + | #[test]
|
4578 + | fn regex_compiles() {
|
4579 + | crate::model::PatternString::compile_regex();
|
4580 + | }
|
4581 + | }
|
4582 + |
|
5227 4583 | #[allow(missing_docs)] // documentation missing in model
|
5228 4584 | ///
|
5229 4585 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5230 - | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
4586 + | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
5231 4587 | ///
|
5232 4588 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5233 4589 | ///
|
5234 4590 | #[derive(
|
5235 4591 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5236 4592 | )]
|
5237 - | pub(crate) struct ConstrainedListInOutput(
|
5238 - | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
5239 - | );
|
5240 - | impl ConstrainedListInOutput {
|
5241 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
5242 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
4593 + | pub(crate) struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
4594 + | impl SetOfPatternString {
|
4595 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
4596 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
5243 4597 | self.0
|
5244 4598 | }
|
5245 4599 |
|
5246 - | fn check_length(
|
5247 - | length: usize,
|
4600 + | fn check_unique_items(
|
4601 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
5248 4602 | ) -> ::std::result::Result<
|
5249 - | (),
|
5250 - | crate::model::constrained_list_in_output_internal::ConstraintViolation,
|
4603 + | ::std::vec::Vec<crate::model::PatternString>,
|
4604 + | crate::model::set_of_pattern_string_internal::ConstraintViolation,
|
5251 4605 | > {
|
5252 - | if 69 <= length {
|
5253 - | Ok(())
|
5254 - | } else {
|
4606 + | let mut seen = ::std::collections::HashMap::new();
|
4607 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4608 + | for (idx, item) in items.iter().enumerate() {
|
4609 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4610 + | duplicate_indices.push(prev_idx);
|
4611 + | }
|
4612 + | }
|
4613 + |
|
4614 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4615 + | for idx in &duplicate_indices {
|
4616 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4617 + | last_duplicate_indices.push(prev_idx);
|
4618 + | }
|
4619 + | }
|
4620 + | duplicate_indices.extend(last_duplicate_indices);
|
4621 + |
|
4622 + | if !duplicate_indices.is_empty() {
|
4623 + | debug_assert!(duplicate_indices.len() >= 2);
|
5255 4624 | Err(
|
5256 - | crate::model::constrained_list_in_output_internal::ConstraintViolation::Length(
|
5257 - | length,
|
5258 - | ),
|
4625 + | crate::model::set_of_pattern_string_internal::ConstraintViolation::UniqueItems {
|
4626 + | duplicate_indices,
|
4627 + | original: items,
|
4628 + | },
|
5259 4629 | )
|
4630 + | } else {
|
4631 + | Ok(items)
|
5260 4632 | }
|
5261 4633 | }
|
5262 4634 | }
|
5263 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
5264 - | for ConstrainedListInOutput
|
5265 - | {
|
5266 - | type Error = crate::model::constrained_list_in_output_internal::ConstraintViolation;
|
4635 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
4636 + | type Error = crate::model::set_of_pattern_string_internal::ConstraintViolation;
|
5267 4637 |
|
5268 - | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
4638 + | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
5269 4639 | fn try_from(
|
5270 - | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4640 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
5271 4641 | ) -> ::std::result::Result<Self, Self::Error> {
|
5272 - | Self::check_length(value.len())?;
|
4642 + | let value = Self::check_unique_items(value)?;
|
5273 4643 |
|
5274 4644 | Ok(Self(value))
|
5275 4645 | }
|
5276 4646 | }
|
5277 4647 |
|
5278 - | impl ::std::convert::From<ConstrainedListInOutput>
|
5279 - | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
5280 - | {
|
5281 - | fn from(value: ConstrainedListInOutput) -> Self {
|
4648 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
4649 + | fn from(value: SetOfPatternString) -> Self {
|
5282 4650 | value.into_inner()
|
5283 4651 | }
|
5284 4652 | }
|
4653 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
4654 + | fn from(value: SetOfPatternString) -> Self {
|
4655 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
4656 + | }
|
4657 + | }
|
4658 + | impl crate::constrained::Constrained for SetOfPatternString {
|
4659 + | type Unconstrained =
|
4660 + | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
4661 + | }
|
5285 4662 |
|
5286 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
5287 - | pub mod validation_exception_field {
|
4663 + | #[allow(missing_docs)] // documentation missing in model
|
4664 + | ///
|
4665 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4666 + | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
4667 + | ///
|
4668 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4669 + | ///
|
4670 + | #[derive(
|
4671 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4672 + | )]
|
4673 + | pub(crate) struct LengthPatternString(pub(crate) ::std::string::String);
|
4674 + | #[allow(dead_code)]
|
4675 + | impl LengthPatternString {
|
4676 + | /// Extracts a string slice containing the entire underlying `String`.
|
4677 + | pub fn as_str(&self) -> &str {
|
4678 + | &self.0
|
4679 + | }
|
5288 4680 |
|
5289 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5290 - | /// Holds one variant for each of the ways the builder can fail.
|
5291 - | #[allow(clippy::enum_variant_names)]
|
5292 - | pub enum ConstraintViolation {
|
5293 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
5294 - | MissingPath,
|
5295 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
5296 - | MissingMessage,
|
4681 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4682 + | pub fn inner(&self) -> &::std::string::String {
|
4683 + | &self.0
|
5297 4684 | }
|
5298 - | impl ::std::fmt::Display for ConstraintViolation {
|
5299 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5300 - | match self {
|
5301 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
5302 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4685 + |
|
4686 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4687 + | pub fn into_inner(self) -> ::std::string::String {
|
4688 + | self.0
|
5303 4689 | }
|
4690 + | }
|
4691 + | impl LengthPatternString {
|
4692 + | fn check_length(
|
4693 + | string: &str,
|
4694 + | ) -> ::std::result::Result<(), crate::model::length_pattern_string_internal::ConstraintViolation>
|
4695 + | {
|
4696 + | let length = string.chars().count();
|
4697 + |
|
4698 + | if (5..=10).contains(&length) {
|
4699 + | Ok(())
|
4700 + | } else {
|
4701 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Length(length))
|
5304 4702 | }
|
5305 4703 | }
|
5306 - | impl ::std::error::Error for ConstraintViolation {}
|
5307 - | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
5308 - | type Error = ConstraintViolation;
|
5309 4704 |
|
5310 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5311 - | builder.build()
|
4705 + | fn check_pattern(
|
4706 + | string: ::std::string::String,
|
4707 + | ) -> ::std::result::Result<
|
4708 + | ::std::string::String,
|
4709 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4710 + | > {
|
4711 + | let regex = Self::compile_regex();
|
4712 + |
|
4713 + | if regex.is_match(&string) {
|
4714 + | Ok(string)
|
4715 + | } else {
|
4716 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Pattern(string))
|
5312 4717 | }
|
5313 4718 | }
|
5314 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
5315 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5316 - | pub struct Builder {
|
5317 - | pub(crate) path: ::std::option::Option<::std::string::String>,
|
5318 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
5319 - | }
|
5320 - | impl Builder {
|
5321 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
5322 - | pub fn path(mut self, input: ::std::string::String) -> Self {
|
5323 - | self.path = Some(input);
|
5324 - | self
|
5325 - | }
|
5326 - | /// A detailed description of the validation failure.
|
5327 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
5328 - | self.message = Some(input);
|
5329 - | self
|
5330 - | }
|
5331 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
5332 - | ///
|
5333 - | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
5334 - | ///
|
5335 - | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
5336 - | self.build_enforcing_required_and_enum_traits()
|
5337 - | }
|
5338 - | fn build_enforcing_required_and_enum_traits(
|
5339 - | self,
|
5340 - | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
5341 - | Ok(crate::model::ValidationExceptionField {
|
5342 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
5343 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
5344 - | })
|
5345 - | }
|
5346 - | }
|
5347 - | }
|
5348 - | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5349 - | pub(crate) mod event_stream_regular_message_internal {
|
5350 4719 |
|
5351 - | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
5352 - | fn from(builder: Builder) -> Self {
|
5353 - | builder.build()
|
5354 - | }
|
5355 - | }
|
5356 - | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5357 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5358 - | pub(crate) struct Builder {
|
5359 - | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
5360 - | }
|
5361 - | impl Builder {
|
5362 - | #[allow(missing_docs)] // documentation missing in model
|
5363 - | pub(crate) fn set_message_content(
|
5364 - | mut self,
|
5365 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5366 - | ) -> Self {
|
5367 - | self.message_content = input.map(|v| v.into());
|
5368 - | self
|
5369 - | }
|
5370 - | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5371 - | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
5372 - | self.build_enforcing_all_constraints()
|
5373 - | }
|
5374 - | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
5375 - | crate::model::EventStreamRegularMessage {
|
5376 - | message_content: self.message_content,
|
5377 - | }
|
5378 - | }
|
4720 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
4721 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
4722 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
4723 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
4724 + | ::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"#)
|
4725 + | });
|
4726 + |
|
4727 + | ®EX
|
5379 4728 | }
|
5380 4729 | }
|
5381 - | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5382 - | pub mod event_stream_regular_message {
|
4730 + | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
4731 + | type Error = crate::model::length_pattern_string_internal::ConstraintViolation;
|
5383 4732 |
|
5384 - | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
5385 - | fn from(builder: Builder) -> Self {
|
5386 - | builder.build()
|
5387 - | }
|
5388 - | }
|
5389 - | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5390 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5391 - | pub struct Builder {
|
5392 - | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
5393 - | }
|
5394 - | impl Builder {
|
5395 - | #[allow(missing_docs)] // documentation missing in model
|
5396 - | pub fn message_content(
|
5397 - | mut self,
|
5398 - | input: ::std::option::Option<::std::string::String>,
|
5399 - | ) -> Self {
|
5400 - | self.message_content = input;
|
5401 - | self
|
5402 - | }
|
5403 - | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5404 - | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
5405 - | self.build_enforcing_required_and_enum_traits()
|
5406 - | }
|
5407 - | fn build_enforcing_required_and_enum_traits(
|
5408 - | self,
|
5409 - | ) -> crate::model::EventStreamRegularMessage {
|
5410 - | crate::model::EventStreamRegularMessage {
|
5411 - | message_content: self.message_content,
|
5412 - | }
|
5413 - | }
|
4733 + | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4734 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4735 + | Self::check_length(&value)?;
|
4736 + |
|
4737 + | let value = Self::check_pattern(value)?;
|
4738 + |
|
4739 + | Ok(Self(value))
|
5414 4740 | }
|
5415 4741 | }
|
5416 - | pub(crate) mod map_of_enum_string_internal {
|
4742 + | impl crate::constrained::Constrained for LengthPatternString {
|
4743 + | type Unconstrained = ::std::string::String;
|
4744 + | }
|
5417 4745 |
|
5418 - | #[allow(clippy::enum_variant_names)]
|
5419 - | #[derive(Debug, PartialEq)]
|
5420 - | pub(crate) enum ConstraintViolation {
|
5421 - | #[doc(hidden)]
|
5422 - | Key(crate::model::enum_string_internal::ConstraintViolation),
|
5423 - | #[doc(hidden)]
|
5424 - | Value(
|
5425 - | crate::model::EnumString,
|
5426 - | crate::model::enum_string_internal::ConstraintViolation,
|
5427 - | ),
|
4746 + | impl ::std::convert::From<::std::string::String>
|
4747 + | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
4748 + | {
|
4749 + | fn from(value: ::std::string::String) -> Self {
|
4750 + | Self::Unconstrained(value)
|
5428 4751 | }
|
4752 + | }
|
5429 4753 |
|
5430 - | impl ::std::fmt::Display for ConstraintViolation {
|
4754 + | impl ::std::fmt::Display for LengthPatternString {
|
5431 4755 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5432 - | match self {
|
5433 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5434 - | Self::Value(_, value_constraint_violation) => {
|
5435 - | write!(f, "{}", value_constraint_violation)
|
5436 - | }
|
5437 - | }
|
5438 - | }
|
4756 + | self.0.fmt(f)
|
5439 4757 | }
|
4758 + | }
|
5440 4759 |
|
5441 - | impl ::std::error::Error for ConstraintViolation {}
|
5442 - | impl ConstraintViolation {
|
5443 - | pub(crate) fn as_validation_exception_field(
|
5444 - | self,
|
5445 - | path: ::std::string::String,
|
5446 - | ) -> crate::model::ValidationExceptionField {
|
5447 - | match self {
|
5448 - | Self::Key(key_constraint_violation) => {
|
5449 - | key_constraint_violation.as_validation_exception_field(path)
|
5450 - | }
|
5451 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5452 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5453 - | }
|
5454 - | }
|
4760 + | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
4761 + | fn from(value: LengthPatternString) -> Self {
|
4762 + | value.into_inner()
|
5455 4763 | }
|
5456 4764 | }
|
5457 - | pub(crate) mod con_b_map_internal {
|
5458 - |
|
5459 - | #[allow(clippy::enum_variant_names)]
|
5460 - | #[derive(Debug, PartialEq)]
|
5461 - | pub(crate) enum ConstraintViolation {
|
5462 - | Length(usize),
|
5463 4765 |
|
5464 - | #[doc(hidden)]
|
5465 - | Value(
|
5466 - | ::std::string::String,
|
5467 - | crate::model::length_string_internal::ConstraintViolation,
|
5468 - | ),
|
4766 + | #[cfg(test)]
|
4767 + | mod test_length_pattern_string {
|
4768 + | #[test]
|
4769 + | fn regex_compiles() {
|
4770 + | crate::model::LengthPatternString::compile_regex();
|
5469 4771 | }
|
4772 + | }
|
5470 4773 |
|
5471 - | impl ::std::fmt::Display for ConstraintViolation {
|
5472 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5473 - | match self {
|
5474 - | Self::Length(length) => {
|
5475 - | 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)
|
4774 + | #[allow(missing_docs)] // documentation missing in model
|
4775 + | ///
|
4776 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4777 + | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
4778 + | ///
|
4779 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4780 + | ///
|
4781 + | #[derive(
|
4782 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4783 + | )]
|
4784 + | pub(crate) struct SetOfLengthPatternString(
|
4785 + | pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>,
|
4786 + | );
|
4787 + | impl SetOfLengthPatternString {
|
4788 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
4789 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
4790 + | self.0
|
5476 4791 | }
|
5477 4792 |
|
5478 - | Self::Value(_, value_constraint_violation) => {
|
5479 - | write!(f, "{}", value_constraint_violation)
|
4793 + | fn check_unique_items(
|
4794 + | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
4795 + | ) -> ::std::result::Result<
|
4796 + | ::std::vec::Vec<crate::model::LengthPatternString>,
|
4797 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
4798 + | > {
|
4799 + | let mut seen = ::std::collections::HashMap::new();
|
4800 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4801 + | for (idx, item) in items.iter().enumerate() {
|
4802 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4803 + | duplicate_indices.push(prev_idx);
|
5480 4804 | }
|
5481 4805 | }
|
4806 + |
|
4807 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4808 + | for idx in &duplicate_indices {
|
4809 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4810 + | last_duplicate_indices.push(prev_idx);
|
5482 4811 | }
|
5483 4812 | }
|
4813 + | duplicate_indices.extend(last_duplicate_indices);
|
5484 4814 |
|
5485 - | impl ::std::error::Error for ConstraintViolation {}
|
5486 - | impl ConstraintViolation {
|
5487 - | pub(crate) fn as_validation_exception_field(
|
5488 - | self,
|
5489 - | path: ::std::string::String,
|
5490 - | ) -> crate::model::ValidationExceptionField {
|
5491 - | match self {
|
5492 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
5493 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
5494 - | path,
|
5495 - | },
|
5496 - | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
5497 - | }
|
4815 + | if !duplicate_indices.is_empty() {
|
4816 + | debug_assert!(duplicate_indices.len() >= 2);
|
4817 + | Err(crate::model::set_of_length_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
4818 + | } else {
|
4819 + | Ok(items)
|
5498 4820 | }
|
5499 4821 | }
|
5500 4822 | }
|
5501 - | pub(crate) mod length_string_internal {
|
4823 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
4824 + | for SetOfLengthPatternString
|
4825 + | {
|
4826 + | type Error = crate::model::set_of_length_pattern_string_internal::ConstraintViolation;
|
5502 4827 |
|
5503 - | #[derive(Debug, PartialEq)]
|
5504 - | pub enum ConstraintViolation {
|
5505 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
5506 - | Length(usize),
|
5507 - | }
|
4828 + | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
4829 + | fn try_from(
|
4830 + | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
4831 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4832 + | let value = Self::check_unique_items(value)?;
|
5508 4833 |
|
5509 - | impl ::std::fmt::Display for ConstraintViolation {
|
5510 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5511 - | let message = match self {
|
5512 - | Self::Length(length) => {
|
5513 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
5514 - | }
|
5515 - | };
|
5516 - | write!(f, "{message}")
|
5517 - | }
|
4834 + | Ok(Self(value))
|
5518 4835 | }
|
4836 + | }
|
5519 4837 |
|
5520 - | impl ::std::error::Error for ConstraintViolation {}
|
5521 - | impl ConstraintViolation {
|
5522 - | pub(crate) fn as_validation_exception_field(
|
5523 - | self,
|
5524 - | path: ::std::string::String,
|
5525 - | ) -> crate::model::ValidationExceptionField {
|
5526 - | match self {
|
5527 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
5528 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
5529 - | path,
|
5530 - | },
|
5531 - | }
|
5532 - | }
|
4838 + | impl ::std::convert::From<SetOfLengthPatternString>
|
4839 + | for ::std::vec::Vec<crate::model::LengthPatternString>
|
4840 + | {
|
4841 + | fn from(value: SetOfLengthPatternString) -> Self {
|
4842 + | value.into_inner()
|
5533 4843 | }
|
5534 4844 | }
|
5535 - | pub(crate) mod map_of_list_of_length_pattern_string_internal {
|
5536 - |
|
5537 - | #[allow(clippy::enum_variant_names)]
|
5538 - | #[derive(Debug, PartialEq)]
|
5539 - | pub(crate) enum ConstraintViolation {
|
5540 - | #[doc(hidden)]
|
5541 - | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
5542 - | #[doc(hidden)]
|
5543 - | Value(
|
5544 - | crate::model::LengthPatternString,
|
5545 - | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
5546 - | ),
|
4845 + | impl ::std::convert::From<SetOfLengthPatternString> for ::std::vec::Vec<::std::string::String> {
|
4846 + | fn from(value: SetOfLengthPatternString) -> Self {
|
4847 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
5547 4848 | }
|
4849 + | }
|
4850 + | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
4851 + | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
4852 + | }
|
5548 4853 |
|
5549 - | impl ::std::fmt::Display for ConstraintViolation {
|
5550 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5551 - | match self {
|
5552 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5553 - | Self::Value(_, value_constraint_violation) => {
|
5554 - | write!(f, "{}", value_constraint_violation)
|
5555 - | }
|
5556 - | }
|
4854 + | #[::pyo3::pyclass]
|
4855 + | /// :param path str:
|
4856 + | /// :param message str:
|
4857 + | /// :rtype None:
|
4858 + | /// Describes one specific validation failure for an input member.
|
4859 + | #[derive(
|
4860 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4861 + | )]
|
4862 + | pub struct ValidationExceptionField {
|
4863 + | #[pyo3(get, set)]
|
4864 + | /// :type str:
|
4865 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4866 + | pub path: ::std::string::String,
|
4867 + | #[pyo3(get, set)]
|
4868 + | /// :type str:
|
4869 + | /// A detailed description of the validation failure.
|
4870 + | pub message: ::std::string::String,
|
4871 + | }
|
4872 + | impl ValidationExceptionField {
|
4873 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4874 + | pub fn path(&self) -> &str {
|
4875 + | use std::ops::Deref;
|
4876 + | self.path.deref()
|
5557 4877 | }
|
4878 + | /// A detailed description of the validation failure.
|
4879 + | pub fn message(&self) -> &str {
|
4880 + | use std::ops::Deref;
|
4881 + | self.message.deref()
|
5558 4882 | }
|
5559 - |
|
5560 - | impl ::std::error::Error for ConstraintViolation {}
|
5561 - | impl ConstraintViolation {
|
5562 - | pub(crate) fn as_validation_exception_field(
|
5563 - | self,
|
5564 - | path: ::std::string::String,
|
5565 - | ) -> crate::model::ValidationExceptionField {
|
5566 - | match self {
|
5567 - | Self::Key(key_constraint_violation) => {
|
5568 - | key_constraint_violation.as_validation_exception_field(path)
|
4883 + | }
|
4884 + | #[allow(clippy::new_without_default)]
|
4885 + | #[allow(clippy::too_many_arguments)]
|
4886 + | #[::pyo3::pymethods]
|
4887 + | impl ValidationExceptionField {
|
4888 + | #[new]
|
4889 + | pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
|
4890 + | Self { path, message }
|
5569 4891 | }
|
5570 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5571 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4892 + | fn __repr__(&self) -> String {
|
4893 + | format!("{self:?}")
|
5572 4894 | }
|
4895 + | fn __str__(&self) -> String {
|
4896 + | format!("{self:?}")
|
5573 4897 | }
|
4898 + | }
|
4899 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
|
4900 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
4901 + | ob.extract::<ValidationExceptionField>().map(Box::new)
|
5574 4902 | }
|
5575 4903 | }
|
5576 - | pub(crate) mod list_of_length_pattern_string_internal {
|
5577 4904 |
|
5578 - | #[allow(clippy::enum_variant_names)]
|
5579 - | #[derive(Debug, PartialEq)]
|
5580 - | pub(crate) enum ConstraintViolation {
|
5581 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5582 - | /// The first component of the tuple is the index in the collection where the
|
5583 - | /// first constraint violation was found.
|
5584 - | #[doc(hidden)]
|
5585 - | Member(
|
5586 - | usize,
|
5587 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
5588 - | ),
|
4905 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
|
4906 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
4907 + | (*self).into_py(py)
|
4908 + | }
|
4909 + | }
|
4910 + | impl ValidationExceptionField {
|
4911 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4912 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
4913 + | crate::model::validation_exception_field::Builder::default()
|
5589 4914 | }
|
4915 + | }
|
5590 4916 |
|
5591 - | impl ::std::fmt::Display for ConstraintViolation {
|
5592 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5593 - | let message = match self {
|
5594 - | Self::Member(index, failing_member) => format!(
|
5595 - | "Value at index {index} failed to satisfy constraint. {}",
|
5596 - | failing_member
|
5597 - | ),
|
5598 - | };
|
5599 - | write!(f, "{message}")
|
4917 + | #[::pyo3::pyclass]
|
4918 + | /// :param length_string typing.Optional\[str\]:
|
4919 + | /// :rtype None:
|
4920 + | #[allow(missing_docs)] // documentation missing in model
|
4921 + | #[derive(
|
4922 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4923 + | )]
|
4924 + | pub struct TransitivelyConstrainedStructureInOutput {
|
4925 + | #[pyo3(get, set)]
|
4926 + | /// :type typing.Optional\[str\]:
|
4927 + | #[allow(missing_docs)] // documentation missing in model
|
4928 + | pub length_string: ::std::option::Option<::std::string::String>,
|
4929 + | }
|
4930 + | impl TransitivelyConstrainedStructureInOutput {
|
4931 + | #[allow(missing_docs)] // documentation missing in model
|
4932 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
4933 + | self.length_string.as_deref()
|
5600 4934 | }
|
4935 + | }
|
4936 + | #[allow(clippy::new_without_default)]
|
4937 + | #[allow(clippy::too_many_arguments)]
|
4938 + | #[::pyo3::pymethods]
|
4939 + | impl TransitivelyConstrainedStructureInOutput {
|
4940 + | #[new]
|
4941 + | pub fn new(length_string: ::std::option::Option<::std::string::String>) -> Self {
|
4942 + | Self { length_string }
|
5601 4943 | }
|
5602 - |
|
5603 - | impl ::std::error::Error for ConstraintViolation {}
|
5604 - | impl ConstraintViolation {
|
5605 - | pub(crate) fn as_validation_exception_field(
|
5606 - | self,
|
5607 - | path: ::std::string::String,
|
5608 - | ) -> crate::model::ValidationExceptionField {
|
5609 - | match self {
|
5610 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5611 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4944 + | fn __repr__(&self) -> String {
|
4945 + | format!("{self:?}")
|
5612 4946 | }
|
4947 + | fn __str__(&self) -> String {
|
4948 + | format!("{self:?}")
|
5613 4949 | }
|
4950 + | }
|
4951 + | impl<'source> ::pyo3::FromPyObject<'source>
|
4952 + | for std::boxed::Box<TransitivelyConstrainedStructureInOutput>
|
4953 + | {
|
4954 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
4955 + | ob.extract::<TransitivelyConstrainedStructureInOutput>()
|
4956 + | .map(Box::new)
|
5614 4957 | }
|
5615 4958 | }
|
5616 - | pub(crate) mod length_pattern_string_internal {
|
5617 4959 |
|
5618 - | #[derive(Debug, PartialEq)]
|
5619 - | pub enum ConstraintViolation {
|
5620 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
5621 - | Length(usize),
|
5622 - | /// Error when a string doesn't satisfy its `@pattern`.
|
5623 - | /// Contains the String that failed the pattern.
|
5624 - | Pattern(String),
|
4960 + | impl ::pyo3::IntoPy<::pyo3::PyObject>
|
4961 + | for std::boxed::Box<TransitivelyConstrainedStructureInOutput>
|
4962 + | {
|
4963 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
4964 + | (*self).into_py(py)
|
4965 + | }
|
4966 + | }
|
4967 + | impl TransitivelyConstrainedStructureInOutput {
|
4968 + | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4969 + | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4970 + | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
5625 4971 | }
|
4972 + | }
|
5626 4973 |
|
5627 - | impl ::std::fmt::Display for ConstraintViolation {
|
5628 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5629 - | let message = match self {
|
5630 - | Self::Length(length) => {
|
5631 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
4974 + | #[::pyo3::pyclass]
|
4975 + | /// :param recursive_member typing.Optional\[constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested1\]:
|
4976 + | /// :rtype None:
|
4977 + | #[allow(missing_docs)] // documentation missing in model
|
4978 + | #[derive(
|
4979 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4980 + | )]
|
4981 + | pub struct RecursiveShapesInputOutputNested2 {
|
4982 + | #[pyo3(get, set)]
|
4983 + | /// :type typing.Optional\[constraints_without_public_constrained_types.model.RecursiveShapesInputOutputNested1\]:
|
4984 + | #[allow(missing_docs)] // documentation missing in model
|
4985 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4986 + | }
|
4987 + | impl RecursiveShapesInputOutputNested2 {
|
4988 + | #[allow(missing_docs)] // documentation missing in model
|
4989 + | pub fn recursive_member(
|
4990 + | &self,
|
4991 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
4992 + | self.recursive_member.as_ref()
|
5632 4993 | }
|
5633 - | Self::Pattern(_) => {
|
5634 - | format!(
|
5635 - | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5636 - | r#"[a-f0-5]*"#
|
5637 - | )
|
4994 + | }
|
4995 + | #[allow(clippy::new_without_default)]
|
4996 + | #[allow(clippy::too_many_arguments)]
|
4997 + | #[::pyo3::pymethods]
|
4998 + | impl RecursiveShapesInputOutputNested2 {
|
4999 + | #[new]
|
5000 + | pub fn new(
|
5001 + | recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5002 + | ) -> Self {
|
5003 + | Self { recursive_member }
|
5638 5004 | }
|
5639 - | };
|
5640 - | write!(f, "{message}")
|
5005 + | fn __repr__(&self) -> String {
|
5006 + | format!("{self:?}")
|
5641 5007 | }
|
5008 + | fn __str__(&self) -> String {
|
5009 + | format!("{self:?}")
|
5010 + | }
|
5011 + | }
|
5012 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
5013 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
5014 + | ob.extract::<RecursiveShapesInputOutputNested2>()
|
5015 + | .map(Box::new)
|
5642 5016 | }
|
5017 + | }
|
5643 5018 |
|
5644 - | impl ::std::error::Error for ConstraintViolation {}
|
5645 - | impl ConstraintViolation {
|
5646 - | pub(crate) fn as_validation_exception_field(
|
5647 - | self,
|
5648 - | path: ::std::string::String,
|
5649 - | ) -> crate::model::ValidationExceptionField {
|
5650 - | match self {
|
5651 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
5652 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
5653 - | path,
|
5654 - | },
|
5655 - |
|
5656 - | #[allow(unused_variables)]
|
5657 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5658 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
5659 - | path
|
5660 - | },
|
5661 - | }
|
5019 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
5020 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
5021 + | (*self).into_py(py)
|
5662 5022 | }
|
5023 + | }
|
5024 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
5025 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
5026 + | }
|
5027 + | impl RecursiveShapesInputOutputNested2 {
|
5028 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5029 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
5030 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
5663 5031 | }
|
5664 5032 | }
|
5665 - | pub(crate) mod map_of_length_pattern_string_internal {
|
5666 5033 |
|
5667 - | #[allow(clippy::enum_variant_names)]
|
5668 - | #[derive(Debug, PartialEq)]
|
5669 - | pub(crate) enum ConstraintViolation {
|
5670 - | #[doc(hidden)]
|
5671 - | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
5672 - | #[doc(hidden)]
|
5673 - | Value(
|
5674 - | crate::model::LengthPatternString,
|
5675 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
5676 - | ),
|
5034 + | #[::pyo3::pyclass]
|
5035 + | /// :param message_content typing.Optional\[str\]:
|
5036 + | /// :rtype None:
|
5037 + | #[allow(missing_docs)] // documentation missing in model
|
5038 + | #[derive(
|
5039 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5040 + | )]
|
5041 + | pub struct EventStreamRegularMessage {
|
5042 + | #[pyo3(get, set)]
|
5043 + | /// :type typing.Optional\[str\]:
|
5044 + | #[allow(missing_docs)] // documentation missing in model
|
5045 + | pub message_content: ::std::option::Option<::std::string::String>,
|
5046 + | }
|
5047 + | impl EventStreamRegularMessage {
|
5048 + | #[allow(missing_docs)] // documentation missing in model
|
5049 + | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
5050 + | self.message_content.as_deref()
|
5677 5051 | }
|
5678 - |
|
5679 - | impl ::std::fmt::Display for ConstraintViolation {
|
5680 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5681 - | match self {
|
5682 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5683 - | Self::Value(_, value_constraint_violation) => {
|
5684 - | write!(f, "{}", value_constraint_violation)
|
5052 + | }
|
5053 + | #[allow(clippy::new_without_default)]
|
5054 + | #[allow(clippy::too_many_arguments)]
|
5055 + | #[::pyo3::pymethods]
|
5056 + | impl EventStreamRegularMessage {
|
5057 + | #[new]
|
5058 + | pub fn new(message_content: ::std::option::Option<::std::string::String>) -> Self {
|
5059 + | Self { message_content }
|
5685 5060 | }
|
5061 + | fn __repr__(&self) -> String {
|
5062 + | format!("{self:?}")
|
5686 5063 | }
|
5064 + | fn __str__(&self) -> String {
|
5065 + | format!("{self:?}")
|
5687 5066 | }
|
5067 + | }
|
5068 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<EventStreamRegularMessage> {
|
5069 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
5070 + | ob.extract::<EventStreamRegularMessage>().map(Box::new)
|
5688 5071 | }
|
5072 + | }
|
5689 5073 |
|
5690 - | impl ::std::error::Error for ConstraintViolation {}
|
5691 - | impl ConstraintViolation {
|
5692 - | pub(crate) fn as_validation_exception_field(
|
5693 - | self,
|
5694 - | path: ::std::string::String,
|
5695 - | ) -> crate::model::ValidationExceptionField {
|
5696 - | match self {
|
5697 - | Self::Key(key_constraint_violation) => {
|
5698 - | key_constraint_violation.as_validation_exception_field(path)
|
5699 - | }
|
5700 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5701 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5702 - | }
|
5074 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<EventStreamRegularMessage> {
|
5075 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
5076 + | (*self).into_py(py)
|
5703 5077 | }
|
5078 + | }
|
5079 + | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
5080 + | type Unconstrained = crate::model::event_stream_regular_message_internal::Builder;
|
5081 + | }
|
5082 + | impl EventStreamRegularMessage {
|
5083 + | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
5084 + | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
5085 + | crate::model::event_stream_regular_message::Builder::default()
|
5704 5086 | }
|
5705 5087 | }
|
5706 - | pub(crate) mod map_of_list_of_pattern_string_internal {
|
5707 5088 |
|
5708 - | #[allow(clippy::enum_variant_names)]
|
5709 - | #[derive(Debug, PartialEq)]
|
5710 - | pub(crate) enum ConstraintViolation {
|
5711 - | #[doc(hidden)]
|
5712 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
5713 - | #[doc(hidden)]
|
5714 - | Value(
|
5715 - | crate::model::PatternString,
|
5716 - | crate::model::list_of_pattern_string_internal::ConstraintViolation,
|
5717 - | ),
|
5089 + | #[::pyo3::pyclass]
|
5090 + | /// :rtype None:
|
5091 + | #[allow(missing_docs)] // documentation missing in model
|
5092 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
5093 + | pub struct SensitiveStructure {}
|
5094 + | impl ::std::fmt::Debug for SensitiveStructure {
|
5095 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
5096 + | let mut formatter = f.debug_struct("SensitiveStructure");
|
5097 + | formatter.finish()
|
5718 5098 | }
|
5719 - |
|
5720 - | impl ::std::fmt::Display for ConstraintViolation {
|
5721 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5722 - | match self {
|
5723 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5724 - | Self::Value(_, value_constraint_violation) => {
|
5725 - | write!(f, "{}", value_constraint_violation)
|
5099 + | }
|
5100 + | #[allow(clippy::new_without_default)]
|
5101 + | #[allow(clippy::too_many_arguments)]
|
5102 + | #[::pyo3::pymethods]
|
5103 + | impl SensitiveStructure {
|
5104 + | #[new]
|
5105 + | pub fn new() -> Self {
|
5106 + | Self {}
|
5726 5107 | }
|
5108 + | fn __repr__(&self) -> String {
|
5109 + | format!("{self:?}")
|
5727 5110 | }
|
5111 + | fn __str__(&self) -> String {
|
5112 + | format!("{self:?}")
|
5728 5113 | }
|
5114 + | }
|
5115 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<SensitiveStructure> {
|
5116 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
5117 + | ob.extract::<SensitiveStructure>().map(Box::new)
|
5729 5118 | }
|
5119 + | }
|
5730 5120 |
|
5731 - | impl ::std::error::Error for ConstraintViolation {}
|
5732 - | impl ConstraintViolation {
|
5733 - | pub(crate) fn as_validation_exception_field(
|
5734 - | self,
|
5735 - | path: ::std::string::String,
|
5736 - | ) -> crate::model::ValidationExceptionField {
|
5737 - | match self {
|
5738 - | Self::Key(key_constraint_violation) => {
|
5739 - | key_constraint_violation.as_validation_exception_field(path)
|
5740 - | }
|
5741 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5742 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5743 - | }
|
5121 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<SensitiveStructure> {
|
5122 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
5123 + | (*self).into_py(py)
|
5744 5124 | }
|
5125 + | }
|
5126 + | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
5127 + | type Unconstrained = crate::model::sensitive_structure_internal::Builder;
|
5128 + | }
|
5129 + | impl SensitiveStructure {
|
5130 + | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
5131 + | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
5132 + | crate::model::sensitive_structure::Builder::default()
|
5745 5133 | }
|
5746 5134 | }
|
5747 - | pub(crate) mod list_of_pattern_string_internal {
|
5748 5135 |
|
5749 - | #[allow(clippy::enum_variant_names)]
|
5750 - | #[derive(Debug, PartialEq)]
|
5751 - | pub(crate) enum ConstraintViolation {
|
5752 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5753 - | /// The first component of the tuple is the index in the collection where the
|
5754 - | /// first constraint violation was found.
|
5755 - | #[doc(hidden)]
|
5756 - | Member(
|
5757 - | usize,
|
5758 - | crate::model::pattern_string_internal::ConstraintViolation,
|
5759 - | ),
|
5136 + | #[allow(missing_docs)] // documentation missing in model
|
5137 + | ///
|
5138 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5139 + | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
5140 + | ///
|
5141 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5142 + | ///
|
5143 + | #[derive(
|
5144 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5145 + | )]
|
5146 + | pub(crate) struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
5147 + | impl ConBSetInner {
|
5148 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
5149 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
5150 + | self.0
|
5760 5151 | }
|
5761 5152 |
|
5762 - | impl ::std::fmt::Display for ConstraintViolation {
|
5763 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5764 - | let message = match self {
|
5765 - | Self::Member(index, failing_member) => format!(
|
5766 - | "Value at index {index} failed to satisfy constraint. {}",
|
5767 - | failing_member
|
5768 - | ),
|
5769 - | };
|
5770 - | write!(f, "{message}")
|
5153 + | fn check_unique_items(
|
5154 + | items: ::std::vec::Vec<::std::string::String>,
|
5155 + | ) -> ::std::result::Result<
|
5156 + | ::std::vec::Vec<::std::string::String>,
|
5157 + | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
5158 + | > {
|
5159 + | let mut seen = ::std::collections::HashMap::new();
|
5160 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
5161 + | for (idx, item) in items.iter().enumerate() {
|
5162 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
5163 + | duplicate_indices.push(prev_idx);
|
5771 5164 | }
|
5772 5165 | }
|
5773 5166 |
|
5774 - | impl ::std::error::Error for ConstraintViolation {}
|
5775 - | impl ConstraintViolation {
|
5776 - | pub(crate) fn as_validation_exception_field(
|
5777 - | self,
|
5778 - | path: ::std::string::String,
|
5779 - | ) -> crate::model::ValidationExceptionField {
|
5780 - | match self {
|
5781 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5782 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5783 - | }
|
5167 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
5168 + | for idx in &duplicate_indices {
|
5169 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
5170 + | last_duplicate_indices.push(prev_idx);
|
5784 5171 | }
|
5785 5172 | }
|
5786 - | }
|
5787 - | pub(crate) mod pattern_string_internal {
|
5173 + | duplicate_indices.extend(last_duplicate_indices);
|
5788 5174 |
|
5789 - | #[derive(Debug, PartialEq)]
|
5790 - | pub enum ConstraintViolation {
|
5791 - | /// Error when a string doesn't satisfy its `@pattern`.
|
5792 - | /// Contains the String that failed the pattern.
|
5793 - | Pattern(String),
|
5175 + | if !duplicate_indices.is_empty() {
|
5176 + | debug_assert!(duplicate_indices.len() >= 2);
|
5177 + | Err(
|
5178 + | crate::model::con_b_set_inner_internal::ConstraintViolation::UniqueItems {
|
5179 + | duplicate_indices,
|
5180 + | original: items,
|
5181 + | },
|
5182 + | )
|
5183 + | } else {
|
5184 + | Ok(items)
|
5185 + | }
|
5794 5186 | }
|
5187 + | }
|
5188 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
5189 + | type Error = crate::model::con_b_set_inner_internal::ConstraintViolation;
|
5795 5190 |
|
5796 - | impl ::std::fmt::Display for ConstraintViolation {
|
5797 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5798 - | let message = match self {
|
5799 - | Self::Pattern(_) => {
|
5800 - | format!(
|
5801 - | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5802 - | r#"[a-d]{5}"#
|
5803 - | )
|
5804 - | }
|
5805 - | };
|
5806 - | write!(f, "{message}")
|
5807 - | }
|
5808 - | }
|
5191 + | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
5192 + | fn try_from(
|
5193 + | value: ::std::vec::Vec<::std::string::String>,
|
5194 + | ) -> ::std::result::Result<Self, Self::Error> {
|
5195 + | let value = Self::check_unique_items(value)?;
|
5809 5196 |
|
5810 - | impl ::std::error::Error for ConstraintViolation {}
|
5811 - | impl ConstraintViolation {
|
5812 - | pub(crate) fn as_validation_exception_field(
|
5813 - | self,
|
5814 - | path: ::std::string::String,
|
5815 - | ) -> crate::model::ValidationExceptionField {
|
5816 - | match self {
|
5817 - | #[allow(unused_variables)]
|
5818 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5819 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
5820 - | path
|
5821 - | },
|
5822 - | }
|
5823 - | }
|
5197 + | Ok(Self(value))
|
5824 5198 | }
|
5825 5199 | }
|
5826 - | pub(crate) mod map_of_pattern_string_internal {
|
5827 - |
|
5828 - | #[allow(clippy::enum_variant_names)]
|
5829 - | #[derive(Debug, PartialEq)]
|
5830 - | pub(crate) enum ConstraintViolation {
|
5831 - | #[doc(hidden)]
|
5832 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
5833 - | #[doc(hidden)]
|
5834 - | Value(
|
5835 - | crate::model::PatternString,
|
5836 - | crate::model::pattern_string_internal::ConstraintViolation,
|
5837 - | ),
|
5838 - | }
|
5839 - |
|
5840 - | impl ::std::fmt::Display for ConstraintViolation {
|
5841 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5842 - | match self {
|
5843 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5844 - | Self::Value(_, value_constraint_violation) => {
|
5845 - | write!(f, "{}", value_constraint_violation)
|
5846 - | }
|
5847 - | }
|
5848 - | }
|
5849 - | }
|
5850 5200 |
|
5851 - | impl ::std::error::Error for ConstraintViolation {}
|
5852 - | impl ConstraintViolation {
|
5853 - | pub(crate) fn as_validation_exception_field(
|
5854 - | self,
|
5855 - | path: ::std::string::String,
|
5856 - | ) -> crate::model::ValidationExceptionField {
|
5857 - | match self {
|
5858 - | Self::Key(key_constraint_violation) => {
|
5859 - | key_constraint_violation.as_validation_exception_field(path)
|
5860 - | }
|
5861 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5862 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5863 - | }
|
5864 - | }
|
5201 + | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
5202 + | fn from(value: ConBSetInner) -> Self {
|
5203 + | value.into_inner()
|
5865 5204 | }
|
5866 5205 | }
|
5867 - | pub(crate) mod map_of_list_of_enum_string_internal {
|
5206 + | impl crate::constrained::Constrained for ConBSetInner {
|
5207 + | type Unconstrained =
|
5208 + | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
5209 + | }
|
5868 5210 |
|
5869 - | #[allow(clippy::enum_variant_names)]
|
5870 - | #[derive(Debug, PartialEq)]
|
5871 - | pub(crate) enum ConstraintViolation {
|
5872 - | #[doc(hidden)]
|
5873 - | Key(crate::model::enum_string_internal::ConstraintViolation),
|
5874 - | #[doc(hidden)]
|
5875 - | Value(
|
5876 - | crate::model::EnumString,
|
5877 - | crate::model::list_of_enum_string_internal::ConstraintViolation,
|
5878 - | ),
|
5211 + | #[allow(missing_docs)] // documentation missing in model
|
5212 + | ///
|
5213 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5214 + | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
5215 + | ///
|
5216 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5217 + | ///
|
5218 + | #[derive(
|
5219 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5220 + | )]
|
5221 + | pub(crate) struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
5222 + | impl UniqueItemsList {
|
5223 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
5224 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
5225 + | self.0
|
5879 5226 | }
|
5880 5227 |
|
5881 - | impl ::std::fmt::Display for ConstraintViolation {
|
5882 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5883 - | match self {
|
5884 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5885 - | Self::Value(_, value_constraint_violation) => {
|
5886 - | write!(f, "{}", value_constraint_violation)
|
5887 - | }
|
5888 - | }
|
5228 + | fn check_unique_items(
|
5229 + | items: ::std::vec::Vec<::std::string::String>,
|
5230 + | ) -> ::std::result::Result<
|
5231 + | ::std::vec::Vec<::std::string::String>,
|
5232 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
5233 + | > {
|
5234 + | let mut seen = ::std::collections::HashMap::new();
|
5235 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
5236 + | for (idx, item) in items.iter().enumerate() {
|
5237 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
5238 + | duplicate_indices.push(prev_idx);
|
5889 5239 | }
|
5890 5240 | }
|
5891 5241 |
|
5892 - | impl ::std::error::Error for ConstraintViolation {}
|
5893 - | impl ConstraintViolation {
|
5894 - | pub(crate) fn as_validation_exception_field(
|
5895 - | self,
|
5896 - | path: ::std::string::String,
|
5897 - | ) -> crate::model::ValidationExceptionField {
|
5898 - | match self {
|
5899 - | Self::Key(key_constraint_violation) => {
|
5900 - | key_constraint_violation.as_validation_exception_field(path)
|
5242 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
5243 + | for idx in &duplicate_indices {
|
5244 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
5245 + | last_duplicate_indices.push(prev_idx);
|
5901 5246 | }
|
5902 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5903 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5904 5247 | }
|
5248 + | duplicate_indices.extend(last_duplicate_indices);
|
5249 + |
|
5250 + | if !duplicate_indices.is_empty() {
|
5251 + | debug_assert!(duplicate_indices.len() >= 2);
|
5252 + | Err(
|
5253 + | crate::model::unique_items_list_internal::ConstraintViolation::UniqueItems {
|
5254 + | duplicate_indices,
|
5255 + | original: items,
|
5256 + | },
|
5257 + | )
|
5258 + | } else {
|
5259 + | Ok(items)
|
5905 5260 | }
|
5906 5261 | }
|
5907 5262 | }
|
5908 - | pub(crate) mod list_of_enum_string_internal {
|
5263 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
5264 + | type Error = crate::model::unique_items_list_internal::ConstraintViolation;
|
5909 5265 |
|
5910 - | #[allow(clippy::enum_variant_names)]
|
5911 - | #[derive(Debug, PartialEq)]
|
5912 - | pub(crate) enum ConstraintViolation {
|
5913 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5914 - | /// The first component of the tuple is the index in the collection where the
|
5915 - | /// first constraint violation was found.
|
5916 - | #[doc(hidden)]
|
5917 - | Member(
|
5918 - | usize,
|
5919 - | crate::model::enum_string_internal::ConstraintViolation,
|
5920 - | ),
|
5921 - | }
|
5266 + | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
5267 + | fn try_from(
|
5268 + | value: ::std::vec::Vec<::std::string::String>,
|
5269 + | ) -> ::std::result::Result<Self, Self::Error> {
|
5270 + | let value = Self::check_unique_items(value)?;
|
5922 5271 |
|
5923 - | impl ::std::fmt::Display for ConstraintViolation {
|
5924 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5925 - | let message = match self {
|
5926 - | Self::Member(index, failing_member) => format!(
|
5927 - | "Value at index {index} failed to satisfy constraint. {}",
|
5928 - | failing_member
|
5929 - | ),
|
5930 - | };
|
5931 - | write!(f, "{message}")
|
5932 - | }
|
5272 + | Ok(Self(value))
|
5933 5273 | }
|
5274 + | }
|
5934 5275 |
|
5935 - | impl ::std::error::Error for ConstraintViolation {}
|
5936 - | impl ConstraintViolation {
|
5937 - | pub(crate) fn as_validation_exception_field(
|
5938 - | self,
|
5939 - | path: ::std::string::String,
|
5940 - | ) -> crate::model::ValidationExceptionField {
|
5941 - | match self {
|
5942 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5943 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5944 - | }
|
5945 - | }
|
5276 + | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
5277 + | fn from(value: UniqueItemsList) -> Self {
|
5278 + | value.into_inner()
|
5946 5279 | }
|
5947 5280 | }
|
5948 - | pub(crate) mod map_of_length_list_of_pattern_string_internal {
|
5281 + | impl crate::constrained::Constrained for UniqueItemsList {
|
5282 + | type Unconstrained =
|
5283 + | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
5284 + | }
|
5285 + |
|
5286 + | /// See [`ConA`](crate::model::ConA).
|
5287 + | pub(crate) mod con_a_internal {
|
5949 5288 |
|
5289 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5290 + | /// Holds one variant for each of the ways the builder can fail.
|
5291 + | #[non_exhaustive]
|
5950 5292 | #[allow(clippy::enum_variant_names)]
|
5951 - | #[derive(Debug, PartialEq)]
|
5952 5293 | pub(crate) enum ConstraintViolation {
|
5294 + | /// `con_b` was not provided but it is required when building `ConA`.
|
5295 + | MissingConB,
|
5296 + | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
5953 5297 | #[doc(hidden)]
|
5954 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
5298 + | ConB(crate::model::con_b_internal::ConstraintViolation),
|
5299 + | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
5955 5300 | #[doc(hidden)]
|
5956 - | Value(
|
5957 - | crate::model::PatternString,
|
5958 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
5959 - | ),
|
5960 - | }
|
5961 - |
|
5962 - | impl ::std::fmt::Display for ConstraintViolation {
|
5963 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5964 - | match self {
|
5965 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5966 - | Self::Value(_, value_constraint_violation) => {
|
5967 - | write!(f, "{}", value_constraint_violation)
|
5968 - | }
|
5969 - | }
|
5970 - | }
|
5971 - | }
|
5972 - |
|
5973 - | impl ::std::error::Error for ConstraintViolation {}
|
5974 - | impl ConstraintViolation {
|
5975 - | pub(crate) fn as_validation_exception_field(
|
5976 - | self,
|
5977 - | path: ::std::string::String,
|
5978 - | ) -> crate::model::ValidationExceptionField {
|
5979 - | match self {
|
5980 - | Self::Key(key_constraint_violation) => {
|
5981 - | key_constraint_violation.as_validation_exception_field(path)
|
5982 - | }
|
5983 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5984 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5985 - | }
|
5986 - | }
|
5987 - | }
|
5988 - | }
|
5989 - | pub(crate) mod length_list_of_pattern_string_internal {
|
5990 - |
|
5991 - | #[allow(clippy::enum_variant_names)]
|
5992 - | #[derive(Debug, PartialEq)]
|
5993 - | pub(crate) enum ConstraintViolation {
|
5994 - | /// Constraint violation error when the list doesn't have the required length
|
5995 - | Length(usize),
|
5996 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5997 - | /// The first component of the tuple is the index in the collection where the
|
5998 - | /// first constraint violation was found.
|
5301 + | OptConB(crate::model::con_b_internal::ConstraintViolation),
|
5302 + | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
5999 5303 | #[doc(hidden)]
|
6000 - | Member(
|
6001 - | usize,
|
6002 - | crate::model::pattern_string_internal::ConstraintViolation,
|
5304 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
5305 + | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
5306 + | #[doc(hidden)]
|
5307 + | MinLengthString(crate::model::min_length_string_internal::ConstraintViolation),
|
5308 + | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
5309 + | #[doc(hidden)]
|
5310 + | MaxLengthString(crate::model::max_length_string_internal::ConstraintViolation),
|
5311 + | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
5312 + | #[doc(hidden)]
|
5313 + | FixedLengthString(crate::model::fixed_length_string_internal::ConstraintViolation),
|
5314 + | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
5315 + | #[doc(hidden)]
|
5316 + | LengthBlob(crate::model::length_blob_internal::ConstraintViolation),
|
5317 + | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
5318 + | #[doc(hidden)]
|
5319 + | MinLengthBlob(crate::model::min_length_blob_internal::ConstraintViolation),
|
5320 + | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
5321 + | #[doc(hidden)]
|
5322 + | MaxLengthBlob(crate::model::max_length_blob_internal::ConstraintViolation),
|
5323 + | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
5324 + | #[doc(hidden)]
|
5325 + | FixedLengthBlob(crate::model::fixed_length_blob_internal::ConstraintViolation),
|
5326 + | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
5327 + | #[doc(hidden)]
|
5328 + | RangeInteger(crate::model::range_integer_internal::ConstraintViolation),
|
5329 + | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
5330 + | #[doc(hidden)]
|
5331 + | MinRangeInteger(crate::model::min_range_integer_internal::ConstraintViolation),
|
5332 + | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
5333 + | #[doc(hidden)]
|
5334 + | MaxRangeInteger(crate::model::max_range_integer_internal::ConstraintViolation),
|
5335 + | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
5336 + | #[doc(hidden)]
|
5337 + | FixedValueInteger(crate::model::fixed_value_integer_internal::ConstraintViolation),
|
5338 + | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
5339 + | #[doc(hidden)]
|
5340 + | RangeShort(crate::model::range_short_internal::ConstraintViolation),
|
5341 + | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
5342 + | #[doc(hidden)]
|
5343 + | MinRangeShort(crate::model::min_range_short_internal::ConstraintViolation),
|
5344 + | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
5345 + | #[doc(hidden)]
|
5346 + | MaxRangeShort(crate::model::max_range_short_internal::ConstraintViolation),
|
5347 + | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
5348 + | #[doc(hidden)]
|
5349 + | FixedValueShort(crate::model::fixed_value_short_internal::ConstraintViolation),
|
5350 + | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
5351 + | #[doc(hidden)]
|
5352 + | RangeLong(crate::model::range_long_internal::ConstraintViolation),
|
5353 + | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
5354 + | #[doc(hidden)]
|
5355 + | MinRangeLong(crate::model::min_range_long_internal::ConstraintViolation),
|
5356 + | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
5357 + | #[doc(hidden)]
|
5358 + | MaxRangeLong(crate::model::max_range_long_internal::ConstraintViolation),
|
5359 + | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
5360 + | #[doc(hidden)]
|
5361 + | FixedValueLong(crate::model::fixed_value_long_internal::ConstraintViolation),
|
5362 + | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
5363 + | #[doc(hidden)]
|
5364 + | RangeByte(crate::model::range_byte_internal::ConstraintViolation),
|
5365 + | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
5366 + | #[doc(hidden)]
|
5367 + | MinRangeByte(crate::model::min_range_byte_internal::ConstraintViolation),
|
5368 + | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
5369 + | #[doc(hidden)]
|
5370 + | MaxRangeByte(crate::model::max_range_byte_internal::ConstraintViolation),
|
5371 + | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
5372 + | #[doc(hidden)]
|
5373 + | FixedValueByte(crate::model::fixed_value_byte_internal::ConstraintViolation),
|
5374 + | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
5375 + | #[doc(hidden)]
|
5376 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
5377 + | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
5378 + | #[doc(hidden)]
|
5379 + | LengthList(crate::model::length_list_internal::ConstraintViolation),
|
5380 + | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
5381 + | #[doc(hidden)]
|
5382 + | SensitiveLengthList(crate::model::sensitive_length_list_internal::ConstraintViolation),
|
5383 + | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
5384 + | #[doc(hidden)]
|
5385 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
5386 + | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
5387 + | #[doc(hidden)]
|
5388 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
5389 + | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
5390 + | #[doc(hidden)]
|
5391 + | LengthMap(crate::model::length_map_internal::ConstraintViolation),
|
5392 + | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
5393 + | #[doc(hidden)]
|
5394 + | MapOfMapOfListOfListOfConB(
|
5395 + | crate::model::map_of_map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
6003 5396 | ),
|
6004 - | }
|
6005 - |
|
6006 - | impl ::std::fmt::Display for ConstraintViolation {
|
6007 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6008 - | let message = match self {
|
6009 - | Self::Length(length) => {
|
6010 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
6011 - | }
|
6012 - | Self::Member(index, failing_member) => format!(
|
6013 - | "Value at index {index} failed to satisfy constraint. {}",
|
6014 - | failing_member
|
5397 + | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
5398 + | #[doc(hidden)]
|
5399 + | SparseMap(crate::model::sparse_map_internal::ConstraintViolation),
|
5400 + | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
5401 + | #[doc(hidden)]
|
5402 + | SparseList(crate::model::sparse_list_internal::ConstraintViolation),
|
5403 + | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
5404 + | #[doc(hidden)]
|
5405 + | SparseLengthMap(crate::model::sparse_length_map_internal::ConstraintViolation),
|
5406 + | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
5407 + | #[doc(hidden)]
|
5408 + | SparseLengthList(crate::model::sparse_length_list_internal::ConstraintViolation),
|
5409 + | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
5410 + | #[doc(hidden)]
|
5411 + | ConstrainedUnion(crate::model::constrained_union_internal::ConstraintViolation),
|
5412 + | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
5413 + | #[doc(hidden)]
|
5414 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
5415 + | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
5416 + | #[doc(hidden)]
|
5417 + | ListOfLengthString(crate::model::list_of_length_string_internal::ConstraintViolation),
|
5418 + | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
5419 + | #[doc(hidden)]
|
5420 + | SetOfLengthString(crate::model::set_of_length_string_internal::ConstraintViolation),
|
5421 + | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
5422 + | #[doc(hidden)]
|
5423 + | MapOfLengthString(crate::model::map_of_length_string_internal::ConstraintViolation),
|
5424 + | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
5425 + | #[doc(hidden)]
|
5426 + | ListOfLengthBlob(crate::model::list_of_length_blob_internal::ConstraintViolation),
|
5427 + | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
5428 + | #[doc(hidden)]
|
5429 + | MapOfLengthBlob(crate::model::map_of_length_blob_internal::ConstraintViolation),
|
5430 + | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
5431 + | #[doc(hidden)]
|
5432 + | ListOfRangeInteger(crate::model::list_of_range_integer_internal::ConstraintViolation),
|
5433 + | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
5434 + | #[doc(hidden)]
|
5435 + | SetOfRangeInteger(crate::model::set_of_range_integer_internal::ConstraintViolation),
|
5436 + | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
5437 + | #[doc(hidden)]
|
5438 + | MapOfRangeInteger(crate::model::map_of_range_integer_internal::ConstraintViolation),
|
5439 + | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
5440 + | #[doc(hidden)]
|
5441 + | ListOfRangeShort(crate::model::list_of_range_short_internal::ConstraintViolation),
|
5442 + | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
5443 + | #[doc(hidden)]
|
5444 + | SetOfRangeShort(crate::model::set_of_range_short_internal::ConstraintViolation),
|
5445 + | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
5446 + | #[doc(hidden)]
|
5447 + | MapOfRangeShort(crate::model::map_of_range_short_internal::ConstraintViolation),
|
5448 + | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
5449 + | #[doc(hidden)]
|
5450 + | ListOfRangeLong(crate::model::list_of_range_long_internal::ConstraintViolation),
|
5451 + | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
5452 + | #[doc(hidden)]
|
5453 + | SetOfRangeLong(crate::model::set_of_range_long_internal::ConstraintViolation),
|
5454 + | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
5455 + | #[doc(hidden)]
|
5456 + | MapOfRangeLong(crate::model::map_of_range_long_internal::ConstraintViolation),
|
5457 + | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
5458 + | #[doc(hidden)]
|
5459 + | ListOfRangeByte(crate::model::list_of_range_byte_internal::ConstraintViolation),
|
5460 + | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
5461 + | #[doc(hidden)]
|
5462 + | SetOfRangeByte(crate::model::set_of_range_byte_internal::ConstraintViolation),
|
5463 + | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
5464 + | #[doc(hidden)]
|
5465 + | MapOfRangeByte(crate::model::map_of_range_byte_internal::ConstraintViolation),
|
5466 + | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
5467 + | #[doc(hidden)]
|
5468 + | PatternString(crate::model::pattern_string_internal::ConstraintViolation),
|
5469 + | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
5470 + | #[doc(hidden)]
|
5471 + | MapOfPatternString(crate::model::map_of_pattern_string_internal::ConstraintViolation),
|
5472 + | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
5473 + | #[doc(hidden)]
|
5474 + | ListOfPatternString(crate::model::list_of_pattern_string_internal::ConstraintViolation),
|
5475 + | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
5476 + | #[doc(hidden)]
|
5477 + | SetOfPatternString(crate::model::set_of_pattern_string_internal::ConstraintViolation),
|
5478 + | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
5479 + | #[doc(hidden)]
|
5480 + | LengthLengthPatternString(
|
5481 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
6015 5482 | ),
|
6016 - | };
|
6017 - | write!(f, "{message}")
|
6018 - | }
|
6019 - | }
|
6020 - |
|
6021 - | impl ::std::error::Error for ConstraintViolation {}
|
6022 - | impl ConstraintViolation {
|
6023 - | pub(crate) fn as_validation_exception_field(
|
6024 - | self,
|
6025 - | path: ::std::string::String,
|
6026 - | ) -> crate::model::ValidationExceptionField {
|
6027 - | match self {
|
6028 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
6029 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
6030 - | path,
|
6031 - | },
|
6032 - | Self::Member(index, member_constraint_violation) =>
|
6033 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
6034 - | }
|
6035 - | }
|
6036 - | }
|
6037 - | }
|
6038 - | pub(crate) mod map_of_set_of_length_string_internal {
|
6039 - |
|
6040 - | #[allow(clippy::enum_variant_names)]
|
6041 - | #[derive(Debug, PartialEq)]
|
6042 - | pub(crate) enum ConstraintViolation {
|
5483 + | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
6043 5484 | #[doc(hidden)]
|
6044 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
5485 + | MapOfLengthPatternString(
|
5486 + | crate::model::map_of_length_pattern_string_internal::ConstraintViolation,
|
5487 + | ),
|
5488 + | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
6045 5489 | #[doc(hidden)]
|
6046 - | Value(
|
6047 - | crate::model::LengthString,
|
6048 - | crate::model::set_of_length_string_internal::ConstraintViolation,
|
5490 + | ListOfLengthPatternString(
|
5491 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
5492 + | ),
|
5493 + | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
5494 + | #[doc(hidden)]
|
5495 + | SetOfLengthPatternString(
|
5496 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
5497 + | ),
|
5498 + | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
5499 + | #[doc(hidden)]
|
5500 + | LengthListOfPatternString(
|
5501 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
5502 + | ),
|
5503 + | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
5504 + | #[doc(hidden)]
|
5505 + | LengthSetOfPatternString(
|
5506 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
6049 5507 | ),
|
6050 5508 | }
|
6051 - |
|
6052 5509 | impl ::std::fmt::Display for ConstraintViolation {
|
6053 5510 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6054 5511 | match self {
|
6055 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
6056 - | Self::Value(_, value_constraint_violation) => {
|
6057 - | write!(f, "{}", value_constraint_violation)
|
6058 - | }
|
6059 - | }
|
6060 - | }
|
6061 - | }
|
6062 - |
|
6063 - | impl ::std::error::Error for ConstraintViolation {}
|
6064 - | impl ConstraintViolation {
|
6065 - | pub(crate) fn as_validation_exception_field(
|
6066 - | self,
|
6067 - | path: ::std::string::String,
|
6068 - | ) -> crate::model::ValidationExceptionField {
|
6069 - | match self {
|
6070 - | Self::Key(key_constraint_violation) => {
|
6071 - | key_constraint_violation.as_validation_exception_field(path)
|
6072 - | }
|
6073 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
6074 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
6075 - | }
|
6076 - | }
|
6077 - | }
|
6078 - | }
|
6079 - | pub(crate) mod set_of_length_string_internal {
|
6080 - |
|
6081 - | #[allow(clippy::enum_variant_names)]
|
6082 - | #[derive(Debug, PartialEq)]
|
6083 - | pub(crate) enum ConstraintViolation {
|
6084 - | /// Constraint violation error when the list does not contain unique items
|
6085 - | UniqueItems {
|
6086 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
6087 - | /// at least two elements.
|
6088 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
6089 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
6090 - | /// Nothing is guaranteed about the order of the indices.
|
6091 - | duplicate_indices: ::std::vec::Vec<usize>,
|
6092 - | /// The original vector, that contains duplicate items.
|
6093 - | original: ::std::vec::Vec<crate::model::LengthString>,
|
6094 - | },
|
6095 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
6096 - | /// The first component of the tuple is the index in the collection where the
|
6097 - | /// first constraint violation was found.
|
6098 - | #[doc(hidden)]
|
6099 - | Member(
|
6100 - | usize,
|
6101 - | crate::model::length_string_internal::ConstraintViolation,
|
6102 - | ),
|
5512 + | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
5513 + | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
5514 + | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
5515 + | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
5516 + | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
5517 + | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
5518 + | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
5519 + | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
5520 + | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
5521 + | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
5522 + | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
5523 + | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
5524 + | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
5525 + | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
5526 + | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
5527 + | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
5528 + | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
5529 + | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
5530 + | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
5531 + | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
5532 + | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
5533 + | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
5534 + | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
5535 + | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
5536 + | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
5537 + | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
5538 + | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
5539 + | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
5540 + | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
5541 + | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
5542 + | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
5543 + | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
5544 + | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
5545 + | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
5546 + | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
5547 + | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
5548 + | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
5549 + | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
5550 + | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
5551 + | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
5552 + | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
5553 + | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
5554 + | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
5555 + | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
5556 + | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
5557 + | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
5558 + | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
5559 + | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
5560 + | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
5561 + | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
5562 + | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
5563 + | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
5564 + | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
5565 + | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
5566 + | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
5567 + | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
5568 + | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
5569 + | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
5570 + | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
5571 + | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
5572 + | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
5573 + | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
5574 + | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
5575 + | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
5576 + | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
5577 + | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
5578 + | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
6103 5579 | }
|
6104 - |
|
6105 - | impl ::std::fmt::Display for ConstraintViolation {
|
6106 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6107 - | let message = match self {
|
6108 - | Self::UniqueItems { duplicate_indices, .. } =>
|
6109 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
6110 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
6111 - | failing_member)
|
6112 - | };
|
6113 - | write!(f, "{message}")
|
6114 5580 | }
|
6115 5581 | }
|
6116 - |
|
6117 5582 | impl ::std::error::Error for ConstraintViolation {}
|
6118 5583 | impl ConstraintViolation {
|
6119 5584 | pub(crate) fn as_validation_exception_field(
|
6120 5585 | self,
|
6121 5586 | path: ::std::string::String,
|
6122 5587 | ) -> crate::model::ValidationExceptionField {
|
6123 5588 | match self {
|
6124 - | Self::UniqueItems { duplicate_indices, .. } =>
|
6125 - | crate::model::ValidationExceptionField {
|
6126 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
6127 - | path,
|
5589 + | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
5590 + | message: format!(
|
5591 + | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
5592 + | path
|
5593 + | ),
|
5594 + | path: path + "/conB",
|
6128 5595 | },
|
6129 - | Self::Member(index, member_constraint_violation) =>
|
6130 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
6131 - | }
|
5596 + | ConstraintViolation::ConB(inner) => {
|
5597 + | inner.as_validation_exception_field(path + "/conB")
|
6132 5598 | }
|
5599 + | ConstraintViolation::OptConB(inner) => {
|
5600 + | inner.as_validation_exception_field(path + "/optConB")
|
6133 5601 | }
|
6134 - | }
|
6135 - | pub(crate) mod map_of_list_of_length_string_internal {
|
6136 - |
|
6137 - | #[allow(clippy::enum_variant_names)]
|
6138 - | #[derive(Debug, PartialEq)]
|
6139 - | pub(crate) enum ConstraintViolation {
|
6140 - | #[doc(hidden)]
|
6141 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
6142 - | #[doc(hidden)]
|
6143 - | Value(
|
6144 - | crate::model::LengthString,
|
6145 - | crate::model::list_of_length_string_internal::ConstraintViolation,
|
6146 - | ),
|
5602 + | ConstraintViolation::LengthString(inner) => {
|
5603 + | inner.as_validation_exception_field(path + "/lengthString")
|
6147 5604 | }
|
6148 - |
|
6149 - | impl ::std::fmt::Display for ConstraintViolation {
|
6150 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6151 - | match self {
|
6152 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
6153 - | Self::Value(_, value_constraint_violation) => {
|
6154 - | write!(f, "{}", value_constraint_violation)
|
5605 + | ConstraintViolation::MinLengthString(inner) => {
|
5606 + | inner.as_validation_exception_field(path + "/minLengthString")
|
6155 5607 | }
|
5608 + | ConstraintViolation::MaxLengthString(inner) => {
|
5609 + | inner.as_validation_exception_field(path + "/maxLengthString")
|
6156 5610 | }
|
5611 + | ConstraintViolation::FixedLengthString(inner) => {
|
5612 + | inner.as_validation_exception_field(path + "/fixedLengthString")
|
6157 5613 | }
|
5614 + | ConstraintViolation::LengthBlob(inner) => {
|
5615 + | inner.as_validation_exception_field(path + "/lengthBlob")
|
6158 5616 | }
|
6159 - |
|
6160 - | impl ::std::error::Error for ConstraintViolation {}
|
6161 - | impl ConstraintViolation {
|
6162 - | pub(crate) fn as_validation_exception_field(
|
6163 - | self,
|
6164 - | path: ::std::string::String,
|
6165 - | ) -> crate::model::ValidationExceptionField {
|
6166 - | match self {
|
6167 - | Self::Key(key_constraint_violation) => {
|
6168 - | key_constraint_violation.as_validation_exception_field(path)
|
5617 + | ConstraintViolation::MinLengthBlob(inner) => {
|
5618 + | inner.as_validation_exception_field(path + "/minLengthBlob")
|
6169 5619 | }
|
6170 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
6171 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5620 + | ConstraintViolation::MaxLengthBlob(inner) => {
|
5621 + | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
6172 5622 | }
|
5623 + | ConstraintViolation::FixedLengthBlob(inner) => {
|
5624 + | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
6173 5625 | }
|
5626 + | ConstraintViolation::RangeInteger(inner) => {
|
5627 + | inner.as_validation_exception_field(path + "/rangeInteger")
|
6174 5628 | }
|
6175 - | }
|
6176 - | pub(crate) mod list_of_length_string_internal {
|
6177 - |
|
6178 - | #[allow(clippy::enum_variant_names)]
|
6179 - | #[derive(Debug, PartialEq)]
|
6180 - | pub(crate) enum ConstraintViolation {
|
6181 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
6182 - | /// The first component of the tuple is the index in the collection where the
|
6183 - | /// first constraint violation was found.
|
6184 - | #[doc(hidden)]
|
6185 - | Member(
|
6186 - | usize,
|
6187 - | crate::model::length_string_internal::ConstraintViolation,
|
6188 - | ),
|
5629 + | ConstraintViolation::MinRangeInteger(inner) => {
|
5630 + | inner.as_validation_exception_field(path + "/minRangeInteger")
|
6189 5631 | }
|
6190 - |
|
6191 - | impl ::std::fmt::Display for ConstraintViolation {
|
6192 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6193 - | let message = match self {
|
6194 - | Self::Member(index, failing_member) => format!(
|
6195 - | "Value at index {index} failed to satisfy constraint. {}",
|
6196 - | failing_member
|
6197 - | ),
|
6198 - | };
|
6199 - | write!(f, "{message}")
|
5632 + | ConstraintViolation::MaxRangeInteger(inner) => {
|
5633 + | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
6200 5634 | }
|
5635 + | ConstraintViolation::FixedValueInteger(inner) => {
|
5636 + | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
6201 5637 | }
|
6202 - |
|
6203 - | impl ::std::error::Error for ConstraintViolation {}
|
6204 - | impl ConstraintViolation {
|
6205 - | pub(crate) fn as_validation_exception_field(
|
6206 - | self,
|
6207 - | path: ::std::string::String,
|
6208 - | ) -> crate::model::ValidationExceptionField {
|
6209 - | match self {
|
6210 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
6211 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5638 + | ConstraintViolation::RangeShort(inner) => {
|
5639 + | inner.as_validation_exception_field(path + "/rangeShort")
|
6212 5640 | }
|
5641 + | ConstraintViolation::MinRangeShort(inner) => {
|
5642 + | inner.as_validation_exception_field(path + "/minRangeShort")
|
6213 5643 | }
|
5644 + | ConstraintViolation::MaxRangeShort(inner) => {
|
5645 + | inner.as_validation_exception_field(path + "/maxRangeShort")
|
6214 5646 | }
|
6215 - | }
|
6216 - | pub(crate) mod map_of_length_string_internal {
|
6217 - |
|
6218 - | #[allow(clippy::enum_variant_names)]
|
6219 - | #[derive(Debug, PartialEq)]
|
6220 - | pub(crate) enum ConstraintViolation {
|
6221 - | #[doc(hidden)]
|
6222 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
6223 - | #[doc(hidden)]
|
6224 - | Value(
|
6225 - | crate::model::LengthString,
|
6226 - | crate::model::length_string_internal::ConstraintViolation,
|
6227 - | ),
|
5647 + | ConstraintViolation::FixedValueShort(inner) => {
|
5648 + | inner.as_validation_exception_field(path + "/fixedValueShort")
|
6228 5649 | }
|
6229 - |
|
6230 - | impl ::std::fmt::Display for ConstraintViolation {
|
6231 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6232 - | match self {
|
6233 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
6234 - | Self::Value(_, value_constraint_violation) => {
|
6235 - | write!(f, "{}", value_constraint_violation)
|
5650 + | ConstraintViolation::RangeLong(inner) => {
|
5651 + | inner.as_validation_exception_field(path + "/rangeLong")
|
6236 5652 | }
|
5653 + | ConstraintViolation::MinRangeLong(inner) => {
|
5654 + | inner.as_validation_exception_field(path + "/minRangeLong")
|
6237 5655 | }
|
5656 + | ConstraintViolation::MaxRangeLong(inner) => {
|
5657 + | inner.as_validation_exception_field(path + "/maxRangeLong")
|
6238 5658 | }
|
5659 + | ConstraintViolation::FixedValueLong(inner) => {
|
5660 + | inner.as_validation_exception_field(path + "/fixedValueLong")
|
6239 5661 | }
|
6240 - |
|
6241 - | impl ::std::error::Error for ConstraintViolation {}
|
6242 - | impl ConstraintViolation {
|
6243 - | pub(crate) fn as_validation_exception_field(
|
6244 - | self,
|
6245 - | path: ::std::string::String,
|
6246 - | ) -> crate::model::ValidationExceptionField {
|
6247 - | match self {
|
6248 - | Self::Key(key_constraint_violation) => {
|
6249 - | key_constraint_violation.as_validation_exception_field(path)
|
5662 + | ConstraintViolation::RangeByte(inner) => {
|
5663 + | inner.as_validation_exception_field(path + "/rangeByte")
|
6250 5664 | }
|
6251 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
6252 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5665 + | ConstraintViolation::MinRangeByte(inner) => {
|
5666 + | inner.as_validation_exception_field(path + "/minRangeByte")
|
6253 5667 | }
|
5668 + | ConstraintViolation::MaxRangeByte(inner) => {
|
5669 + | inner.as_validation_exception_field(path + "/maxRangeByte")
|
6254 5670 | }
|
5671 + | ConstraintViolation::FixedValueByte(inner) => {
|
5672 + | inner.as_validation_exception_field(path + "/fixedValueByte")
|
6255 5673 | }
|
6256 - | }
|
6257 - | pub(crate) mod recursive_list_internal {
|
6258 - |
|
6259 - | #[allow(clippy::enum_variant_names)]
|
6260 - | #[derive(Debug, PartialEq)]
|
6261 - | pub(crate) enum ConstraintViolation {
|
6262 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
6263 - | /// The first component of the tuple is the index in the collection where the
|
6264 - | /// first constraint violation was found.
|
6265 - | #[doc(hidden)]
|
6266 - | Member(
|
6267 - | usize,
|
6268 - | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
6269 - | ),
|
5674 + | ConstraintViolation::ConBList(inner) => {
|
5675 + | inner.as_validation_exception_field(path + "/conBList")
|
6270 5676 | }
|
6271 - |
|
6272 - | impl ::std::fmt::Display for ConstraintViolation {
|
6273 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6274 - | let message = match self {
|
6275 - | Self::Member(index, failing_member) => format!(
|
6276 - | "Value at index {index} failed to satisfy constraint. {}",
|
6277 - | failing_member
|
6278 - | ),
|
6279 - | };
|
6280 - | write!(f, "{message}")
|
5677 + | ConstraintViolation::LengthList(inner) => {
|
5678 + | inner.as_validation_exception_field(path + "/lengthList")
|
6281 5679 | }
|
5680 + | ConstraintViolation::SensitiveLengthList(inner) => {
|
5681 + | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
6282 5682 | }
|
6283 - |
|
6284 - | impl ::std::error::Error for ConstraintViolation {}
|
6285 - | impl ConstraintViolation {
|
6286 - | pub(crate) fn as_validation_exception_field(
|
6287 - | self,
|
6288 - | path: ::std::string::String,
|
6289 - | ) -> crate::model::ValidationExceptionField {
|
6290 - | match self {
|
6291 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
6292 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5683 + | ConstraintViolation::ConBSet(inner) => {
|
5684 + | inner.as_validation_exception_field(path + "/conBSet")
|
6293 5685 | }
|
5686 + | ConstraintViolation::ConBMap(inner) => {
|
5687 + | inner.as_validation_exception_field(path + "/conBMap")
|
6294 5688 | }
|
5689 + | ConstraintViolation::LengthMap(inner) => {
|
5690 + | inner.as_validation_exception_field(path + "/lengthMap")
|
6295 5691 | }
|
6296 - | }
|
6297 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6298 - | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
6299 - |
|
6300 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6301 - | /// Holds one variant for each of the ways the builder can fail.
|
6302 - | #[non_exhaustive]
|
6303 - | #[allow(clippy::enum_variant_names)]
|
6304 - | pub(crate) enum ConstraintViolation {
|
6305 - | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
6306 - | MissingRecursiveMember,
|
6307 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
6308 - | #[doc(hidden)]
|
6309 - | RecursiveMember(
|
6310 - | ::std::boxed::Box<
|
6311 - | crate::model::recursive_shapes_input_output_nested2_internal::ConstraintViolation,
|
6312 - | >,
|
6313 - | ),
|
5692 + | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
5693 + | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
6314 5694 | }
|
6315 - | impl ::std::fmt::Display for ConstraintViolation {
|
6316 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6317 - | match self {
|
6318 - | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
6319 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
5695 + | ConstraintViolation::SparseMap(inner) => {
|
5696 + | inner.as_validation_exception_field(path + "/sparseMap")
|
6320 5697 | }
|
5698 + | ConstraintViolation::SparseList(inner) => {
|
5699 + | inner.as_validation_exception_field(path + "/sparseList")
|
6321 5700 | }
|
5701 + | ConstraintViolation::SparseLengthMap(inner) => {
|
5702 + | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
6322 5703 | }
|
6323 - | impl ::std::error::Error for ConstraintViolation {}
|
6324 - | impl ConstraintViolation {
|
6325 - | pub(crate) fn as_validation_exception_field(
|
6326 - | self,
|
6327 - | path: ::std::string::String,
|
6328 - | ) -> crate::model::ValidationExceptionField {
|
6329 - | match self {
|
6330 - | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
6331 - | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
6332 - | path: path + "/recursiveMember",
|
6333 - | },
|
6334 - | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
5704 + | ConstraintViolation::SparseLengthList(inner) => {
|
5705 + | inner.as_validation_exception_field(path + "/sparseLengthList")
|
6335 5706 | }
|
5707 + | ConstraintViolation::ConstrainedUnion(inner) => {
|
5708 + | inner.as_validation_exception_field(path + "/constrainedUnion")
|
6336 5709 | }
|
5710 + | ConstraintViolation::EnumString(inner) => {
|
5711 + | inner.as_validation_exception_field(path + "/enumString")
|
6337 5712 | }
|
6338 - | impl ::std::convert::From<Builder>
|
6339 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
6340 - | {
|
6341 - | fn from(builder: Builder) -> Self {
|
6342 - | Self::Unconstrained(builder)
|
5713 + | ConstraintViolation::ListOfLengthString(inner) => {
|
5714 + | inner.as_validation_exception_field(path + "/listOfLengthString")
|
6343 5715 | }
|
5716 + | ConstraintViolation::SetOfLengthString(inner) => {
|
5717 + | inner.as_validation_exception_field(path + "/setOfLengthString")
|
6344 5718 | }
|
6345 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
6346 - | type Error = ConstraintViolation;
|
6347 - |
|
6348 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6349 - | builder.build()
|
5719 + | ConstraintViolation::MapOfLengthString(inner) => {
|
5720 + | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
6350 5721 | }
|
5722 + | ConstraintViolation::ListOfLengthBlob(inner) => {
|
5723 + | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
6351 5724 | }
|
6352 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6353 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6354 - | pub(crate) struct Builder {
|
6355 - | pub(crate) recursive_member: ::std::option::Option<
|
6356 - | ::std::boxed::Box<
|
6357 - | crate::constrained::MaybeConstrained<
|
6358 - | crate::model::RecursiveShapesInputOutputNested2,
|
6359 - | >,
|
6360 - | >,
|
6361 - | >,
|
5725 + | ConstraintViolation::MapOfLengthBlob(inner) => {
|
5726 + | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
6362 5727 | }
|
6363 - | impl Builder {
|
6364 - | #[allow(missing_docs)] // documentation missing in model
|
6365 - | pub(crate) fn set_recursive_member(
|
6366 - | mut self,
|
6367 - | input: impl ::std::convert::Into<
|
6368 - | ::std::boxed::Box<
|
6369 - | crate::constrained::MaybeConstrained<
|
6370 - | crate::model::RecursiveShapesInputOutputNested2,
|
6371 - | >,
|
6372 - | >,
|
6373 - | >,
|
6374 - | ) -> Self {
|
6375 - | self.recursive_member = Some(input.into());
|
6376 - | self
|
5728 + | ConstraintViolation::ListOfRangeInteger(inner) => {
|
5729 + | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
6377 5730 | }
|
6378 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6379 - | ///
|
6380 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
6381 - | ///
|
6382 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6383 - | pub fn build(
|
6384 - | self,
|
6385 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
6386 - | self.build_enforcing_all_constraints()
|
5731 + | ConstraintViolation::SetOfRangeInteger(inner) => {
|
5732 + | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
6387 5733 | }
|
6388 - | fn build_enforcing_all_constraints(
|
6389 - | self,
|
6390 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
6391 - | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
6392 - | recursive_member: self
|
6393 - | .recursive_member
|
6394 - | .map(|v| match *v {
|
6395 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
6396 - | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
6397 - | Ok(Box::new(x.try_into()?))
|
5734 + | ConstraintViolation::MapOfRangeInteger(inner) => {
|
5735 + | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
6398 5736 | }
|
6399 - | })
|
6400 - | .map(|res| {
|
6401 - | res.map_err(Box::new)
|
6402 - | .map_err(ConstraintViolation::RecursiveMember)
|
6403 - | })
|
6404 - | .transpose()?
|
6405 - | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
6406 - | })
|
5737 + | ConstraintViolation::ListOfRangeShort(inner) => {
|
5738 + | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
6407 5739 | }
|
5740 + | ConstraintViolation::SetOfRangeShort(inner) => {
|
5741 + | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
6408 5742 | }
|
6409 - | }
|
6410 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6411 - | pub mod recursive_shapes_input_output_nested1 {
|
6412 - |
|
6413 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6414 - | /// Holds one variant for each of the ways the builder can fail.
|
6415 - | #[allow(clippy::enum_variant_names)]
|
6416 - | pub enum ConstraintViolation {
|
6417 - | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
6418 - | MissingRecursiveMember,
|
5743 + | ConstraintViolation::MapOfRangeShort(inner) => {
|
5744 + | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
6419 5745 | }
|
6420 - | impl ::std::fmt::Display for ConstraintViolation {
|
6421 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6422 - | match self {
|
6423 - | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5746 + | ConstraintViolation::ListOfRangeLong(inner) => {
|
5747 + | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
6424 5748 | }
|
5749 + | ConstraintViolation::SetOfRangeLong(inner) => {
|
5750 + | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
6425 5751 | }
|
5752 + | ConstraintViolation::MapOfRangeLong(inner) => {
|
5753 + | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
6426 5754 | }
|
6427 - | impl ::std::error::Error for ConstraintViolation {}
|
6428 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
6429 - | type Error = ConstraintViolation;
|
6430 - |
|
6431 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6432 - | builder.build()
|
5755 + | ConstraintViolation::ListOfRangeByte(inner) => {
|
5756 + | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
6433 5757 | }
|
5758 + | ConstraintViolation::SetOfRangeByte(inner) => {
|
5759 + | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
6434 5760 | }
|
6435 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6436 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6437 - | pub struct Builder {
|
6438 - | pub(crate) recursive_member: ::std::option::Option<
|
6439 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
6440 - | >,
|
5761 + | ConstraintViolation::MapOfRangeByte(inner) => {
|
5762 + | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
6441 5763 | }
|
6442 - | impl Builder {
|
6443 - | #[allow(missing_docs)] // documentation missing in model
|
6444 - | pub fn recursive_member(
|
6445 - | mut self,
|
6446 - | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
6447 - | ) -> Self {
|
6448 - | self.recursive_member = Some(input);
|
6449 - | self
|
5764 + | ConstraintViolation::PatternString(inner) => {
|
5765 + | inner.as_validation_exception_field(path + "/patternString")
|
6450 5766 | }
|
6451 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6452 - | ///
|
6453 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if you do not provide a value for all non-`Option`al members.
|
6454 - | ///
|
6455 - | pub fn build(
|
6456 - | self,
|
6457 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
6458 - | self.build_enforcing_required_and_enum_traits()
|
5767 + | ConstraintViolation::MapOfPatternString(inner) => {
|
5768 + | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
6459 5769 | }
|
6460 - | fn build_enforcing_required_and_enum_traits(
|
6461 - | self,
|
6462 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
6463 - | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
6464 - | recursive_member: self
|
6465 - | .recursive_member
|
6466 - | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
6467 - | })
|
5770 + | ConstraintViolation::ListOfPatternString(inner) => {
|
5771 + | inner.as_validation_exception_field(path + "/listOfPatternString")
|
6468 5772 | }
|
5773 + | ConstraintViolation::SetOfPatternString(inner) => {
|
5774 + | inner.as_validation_exception_field(path + "/setOfPatternString")
|
6469 5775 | }
|
6470 - | }
|
6471 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6472 - | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
6473 - |
|
6474 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6475 - | /// Holds one variant for each of the ways the builder can fail.
|
6476 - | #[non_exhaustive]
|
6477 - | #[allow(clippy::enum_variant_names)]
|
6478 - | pub(crate) enum ConstraintViolation {
|
6479 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
6480 - | #[doc(hidden)]
|
6481 - | RecursiveMember(
|
6482 - | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
6483 - | ),
|
5776 + | ConstraintViolation::LengthLengthPatternString(inner) => {
|
5777 + | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
6484 5778 | }
|
6485 - | impl ::std::fmt::Display for ConstraintViolation {
|
6486 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6487 - | match self {
|
6488 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
5779 + | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
5780 + | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
6489 5781 | }
|
5782 + | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
5783 + | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
6490 5784 | }
|
5785 + | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
5786 + | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
6491 5787 | }
|
6492 - | impl ::std::error::Error for ConstraintViolation {}
|
6493 - | impl ConstraintViolation {
|
6494 - | pub(crate) fn as_validation_exception_field(
|
6495 - | self,
|
6496 - | path: ::std::string::String,
|
6497 - | ) -> crate::model::ValidationExceptionField {
|
6498 - | match self {
|
6499 - | ConstraintViolation::RecursiveMember(inner) => {
|
6500 - | inner.as_validation_exception_field(path + "/recursiveMember")
|
5788 + | ConstraintViolation::LengthListOfPatternString(inner) => {
|
5789 + | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
6501 5790 | }
|
5791 + | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
5792 + | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
6502 5793 | }
|
6503 5794 | }
|
6504 5795 | }
|
6505 - | impl ::std::convert::From<Builder>
|
6506 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
6507 - | {
|
5796 + | }
|
5797 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
6508 5798 | fn from(builder: Builder) -> Self {
|
6509 5799 | Self::Unconstrained(builder)
|
6510 5800 | }
|
6511 5801 | }
|
6512 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5802 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
6513 5803 | type Error = ConstraintViolation;
|
6514 5804 |
|
6515 5805 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6516 5806 | builder.build()
|
6517 5807 | }
|
6518 5808 | }
|
6519 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5809 + | /// A builder for [`ConA`](crate::model::ConA).
|
6520 5810 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6521 5811 | pub(crate) struct Builder {
|
6522 - | pub(crate) recursive_member: ::std::option::Option<
|
6523 - | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
6524 - | >,
|
5812 + | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5813 + | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5814 + | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
5815 + | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
5816 + | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
5817 + | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
5818 + | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
5819 + | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
5820 + | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
5821 + | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
5822 + | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
5823 + | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
5824 + | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
5825 + | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
5826 + | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
5827 + | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
5828 + | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
5829 + | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
5830 + | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
5831 + | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
5832 + | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
5833 + | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
5834 + | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
5835 + | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
5836 + | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
5837 + | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
5838 + | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
5839 + | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
5840 + | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
5841 + | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
5842 + | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
5843 + | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
5844 + | 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>>,
|
5845 + | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
5846 + | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
5847 + | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
5848 + | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
5849 + | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
5850 + | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
5851 + | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
5852 + | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
5853 + | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
5854 + | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
5855 + | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
5856 + | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
5857 + | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
5858 + | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
5859 + | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
5860 + | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
5861 + | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
5862 + | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
5863 + | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
5864 + | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
5865 + | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
5866 + | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
5867 + | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
5868 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
5869 + | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
5870 + | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
5871 + | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
5872 + | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
5873 + | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
5874 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
5875 + | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
5876 + | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
5877 + | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
5878 + | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
6525 5879 | }
|
6526 5880 | impl Builder {
|
6527 5881 | #[allow(missing_docs)] // documentation missing in model
|
6528 - | pub(crate) fn set_recursive_member(
|
5882 + | pub(crate) fn set_con_b(
|
5883 + | mut self,
|
5884 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5885 + | ) -> Self {
|
5886 + | self.con_b = Some(input.into());
|
5887 + | self
|
5888 + | }
|
5889 + | #[allow(missing_docs)] // documentation missing in model
|
5890 + | pub(crate) fn set_opt_con_b(
|
6529 5891 | mut self,
|
6530 5892 | input: Option<
|
6531 - | impl ::std::convert::Into<
|
6532 - | crate::constrained::MaybeConstrained<
|
6533 - | crate::model::RecursiveShapesInputOutputNested1,
|
5893 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6534 5894 | >,
|
5895 + | ) -> Self {
|
5896 + | self.opt_con_b = input.map(|v| v.into());
|
5897 + | self
|
5898 + | }
|
5899 + | #[allow(missing_docs)] // documentation missing in model
|
5900 + | pub(crate) fn set_length_string(
|
5901 + | mut self,
|
5902 + | input: Option<
|
5903 + | impl ::std::convert::Into<
|
5904 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
6535 5905 | >,
|
6536 5906 | >,
|
6537 5907 | ) -> Self {
|
6538 - | self.recursive_member = input.map(|v| v.into());
|
5908 + | self.length_string = input.map(|v| v.into());
|
6539 5909 | self
|
6540 5910 | }
|
6541 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6542 - | ///
|
6543 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
6544 - | ///
|
6545 - | pub fn build(
|
6546 - | self,
|
6547 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
6548 - | self.build_enforcing_all_constraints()
|
6549 - | }
|
6550 - | fn build_enforcing_all_constraints(
|
6551 - | self,
|
6552 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
6553 - | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
6554 - | recursive_member: self
|
6555 - | .recursive_member
|
6556 - | .map(|v| match v {
|
6557 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6558 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6559 - | })
|
6560 - | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
6561 - | .transpose()?,
|
6562 - | })
|
6563 - | }
|
6564 - | }
|
6565 - | }
|
6566 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6567 - | pub mod recursive_shapes_input_output_nested2 {
|
6568 - |
|
6569 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
6570 - | fn from(builder: Builder) -> Self {
|
6571 - | builder.build()
|
5911 + | #[allow(missing_docs)] // documentation missing in model
|
5912 + | pub(crate) fn set_min_length_string(
|
5913 + | mut self,
|
5914 + | input: Option<
|
5915 + | impl ::std::convert::Into<
|
5916 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
5917 + | >,
|
5918 + | >,
|
5919 + | ) -> Self {
|
5920 + | self.min_length_string = input.map(|v| v.into());
|
5921 + | self
|
6572 5922 | }
|
5923 + | #[allow(missing_docs)] // documentation missing in model
|
5924 + | pub(crate) fn set_max_length_string(
|
5925 + | mut self,
|
5926 + | input: Option<
|
5927 + | impl ::std::convert::Into<
|
5928 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
5929 + | >,
|
5930 + | >,
|
5931 + | ) -> Self {
|
5932 + | self.max_length_string = input.map(|v| v.into());
|
5933 + | self
|
6573 5934 | }
|
6574 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6575 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6576 - | pub struct Builder {
|
6577 - | pub(crate) recursive_member:
|
6578 - | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5935 + | #[allow(missing_docs)] // documentation missing in model
|
5936 + | pub(crate) fn set_fixed_length_string(
|
5937 + | mut self,
|
5938 + | input: Option<
|
5939 + | impl ::std::convert::Into<
|
5940 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
5941 + | >,
|
5942 + | >,
|
5943 + | ) -> Self {
|
5944 + | self.fixed_length_string = input.map(|v| v.into());
|
5945 + | self
|
6579 5946 | }
|
6580 - | impl Builder {
|
6581 5947 | #[allow(missing_docs)] // documentation missing in model
|
6582 - | pub fn recursive_member(
|
5948 + | pub(crate) fn set_length_blob(
|
6583 5949 | mut self,
|
6584 - | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5950 + | input: Option<
|
5951 + | impl ::std::convert::Into<
|
5952 + | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
5953 + | >,
|
5954 + | >,
|
6585 5955 | ) -> Self {
|
6586 - | self.recursive_member = input;
|
5956 + | self.length_blob = input.map(|v| v.into());
|
6587 5957 | self
|
6588 5958 | }
|
6589 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6590 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
6591 - | self.build_enforcing_required_and_enum_traits()
|
6592 - | }
|
6593 - | fn build_enforcing_required_and_enum_traits(
|
6594 - | self,
|
6595 - | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
6596 - | crate::model::RecursiveShapesInputOutputNested2 {
|
6597 - | recursive_member: self.recursive_member,
|
5959 + | #[allow(missing_docs)] // documentation missing in model
|
5960 + | pub(crate) fn set_min_length_blob(
|
5961 + | mut self,
|
5962 + | input: Option<
|
5963 + | impl ::std::convert::Into<
|
5964 + | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
5965 + | >,
|
5966 + | >,
|
5967 + | ) -> Self {
|
5968 + | self.min_length_blob = input.map(|v| v.into());
|
5969 + | self
|
6598 5970 | }
|
5971 + | #[allow(missing_docs)] // documentation missing in model
|
5972 + | pub(crate) fn set_max_length_blob(
|
5973 + | mut self,
|
5974 + | input: Option<
|
5975 + | impl ::std::convert::Into<
|
5976 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
5977 + | >,
|
5978 + | >,
|
5979 + | ) -> Self {
|
5980 + | self.max_length_blob = input.map(|v| v.into());
|
5981 + | self
|
6599 5982 | }
|
5983 + | #[allow(missing_docs)] // documentation missing in model
|
5984 + | pub(crate) fn set_fixed_length_blob(
|
5985 + | mut self,
|
5986 + | input: Option<
|
5987 + | impl ::std::convert::Into<
|
5988 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
5989 + | >,
|
5990 + | >,
|
5991 + | ) -> Self {
|
5992 + | self.fixed_length_blob = input.map(|v| v.into());
|
5993 + | self
|
6600 5994 | }
|
6601 - | }
|
6602 - | /// See [`ConA`](crate::model::ConA).
|
6603 - | pub(crate) mod con_a_internal {
|
6604 - |
|
6605 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6606 - | /// Holds one variant for each of the ways the builder can fail.
|
6607 - | #[non_exhaustive]
|
6608 - | #[allow(clippy::enum_variant_names)]
|
6609 - | pub(crate) enum ConstraintViolation {
|
6610 - | /// `con_b` was not provided but it is required when building `ConA`.
|
6611 - | MissingConB,
|
6612 - | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
6613 - | #[doc(hidden)]
|
6614 - | ConB(crate::model::con_b_internal::ConstraintViolation),
|
6615 - | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
6616 - | #[doc(hidden)]
|
6617 - | OptConB(crate::model::con_b_internal::ConstraintViolation),
|
6618 - | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
6619 - | #[doc(hidden)]
|
6620 - | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
6621 - | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
6622 - | #[doc(hidden)]
|
6623 - | MinLengthString(crate::model::min_length_string_internal::ConstraintViolation),
|
6624 - | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
6625 - | #[doc(hidden)]
|
6626 - | MaxLengthString(crate::model::max_length_string_internal::ConstraintViolation),
|
6627 - | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
6628 - | #[doc(hidden)]
|
6629 - | FixedLengthString(crate::model::fixed_length_string_internal::ConstraintViolation),
|
6630 - | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
6631 - | #[doc(hidden)]
|
6632 - | LengthBlob(crate::model::length_blob_internal::ConstraintViolation),
|
6633 - | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
6634 - | #[doc(hidden)]
|
6635 - | MinLengthBlob(crate::model::min_length_blob_internal::ConstraintViolation),
|
6636 - | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
6637 - | #[doc(hidden)]
|
6638 - | MaxLengthBlob(crate::model::max_length_blob_internal::ConstraintViolation),
|
6639 - | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
6640 - | #[doc(hidden)]
|
6641 - | FixedLengthBlob(crate::model::fixed_length_blob_internal::ConstraintViolation),
|
6642 - | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
6643 - | #[doc(hidden)]
|
6644 - | RangeInteger(crate::model::range_integer_internal::ConstraintViolation),
|
6645 - | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
6646 - | #[doc(hidden)]
|
6647 - | MinRangeInteger(crate::model::min_range_integer_internal::ConstraintViolation),
|
6648 - | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
6649 - | #[doc(hidden)]
|
6650 - | MaxRangeInteger(crate::model::max_range_integer_internal::ConstraintViolation),
|
6651 - | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
6652 - | #[doc(hidden)]
|
6653 - | FixedValueInteger(crate::model::fixed_value_integer_internal::ConstraintViolation),
|
6654 - | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
6655 - | #[doc(hidden)]
|
6656 - | RangeShort(crate::model::range_short_internal::ConstraintViolation),
|
6657 - | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
6658 - | #[doc(hidden)]
|
6659 - | MinRangeShort(crate::model::min_range_short_internal::ConstraintViolation),
|
6660 - | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
6661 - | #[doc(hidden)]
|
6662 - | MaxRangeShort(crate::model::max_range_short_internal::ConstraintViolation),
|
6663 - | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
6664 - | #[doc(hidden)]
|
6665 - | FixedValueShort(crate::model::fixed_value_short_internal::ConstraintViolation),
|
6666 - | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
6667 - | #[doc(hidden)]
|
6668 - | RangeLong(crate::model::range_long_internal::ConstraintViolation),
|
6669 - | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
6670 - | #[doc(hidden)]
|
6671 - | MinRangeLong(crate::model::min_range_long_internal::ConstraintViolation),
|
6672 - | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
6673 - | #[doc(hidden)]
|
6674 - | MaxRangeLong(crate::model::max_range_long_internal::ConstraintViolation),
|
6675 - | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
6676 - | #[doc(hidden)]
|
6677 - | FixedValueLong(crate::model::fixed_value_long_internal::ConstraintViolation),
|
6678 - | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
6679 - | #[doc(hidden)]
|
6680 - | RangeByte(crate::model::range_byte_internal::ConstraintViolation),
|
6681 - | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
6682 - | #[doc(hidden)]
|
6683 - | MinRangeByte(crate::model::min_range_byte_internal::ConstraintViolation),
|
6684 - | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
6685 - | #[doc(hidden)]
|
6686 - | MaxRangeByte(crate::model::max_range_byte_internal::ConstraintViolation),
|
6687 - | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
6688 - | #[doc(hidden)]
|
6689 - | FixedValueByte(crate::model::fixed_value_byte_internal::ConstraintViolation),
|
6690 - | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
6691 - | #[doc(hidden)]
|
6692 - | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
6693 - | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
6694 - | #[doc(hidden)]
|
6695 - | LengthList(crate::model::length_list_internal::ConstraintViolation),
|
6696 - | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
6697 - | #[doc(hidden)]
|
6698 - | SensitiveLengthList(crate::model::sensitive_length_list_internal::ConstraintViolation),
|
6699 - | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
6700 - | #[doc(hidden)]
|
6701 - | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
6702 - | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
6703 - | #[doc(hidden)]
|
6704 - | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
6705 - | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
6706 - | #[doc(hidden)]
|
6707 - | LengthMap(crate::model::length_map_internal::ConstraintViolation),
|
6708 - | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
6709 - | #[doc(hidden)]
|
6710 - | MapOfMapOfListOfListOfConB(
|
6711 - | crate::model::map_of_map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
6712 - | ),
|
6713 - | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
6714 - | #[doc(hidden)]
|
6715 - | SparseMap(crate::model::sparse_map_internal::ConstraintViolation),
|
6716 - | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
6717 - | #[doc(hidden)]
|
6718 - | SparseList(crate::model::sparse_list_internal::ConstraintViolation),
|
6719 - | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
6720 - | #[doc(hidden)]
|
6721 - | SparseLengthMap(crate::model::sparse_length_map_internal::ConstraintViolation),
|
6722 - | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
6723 - | #[doc(hidden)]
|
6724 - | SparseLengthList(crate::model::sparse_length_list_internal::ConstraintViolation),
|
6725 - | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
6726 - | #[doc(hidden)]
|
6727 - | ConstrainedUnion(crate::model::constrained_union_internal::ConstraintViolation),
|
6728 - | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
6729 - | #[doc(hidden)]
|
6730 - | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
6731 - | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
6732 - | #[doc(hidden)]
|
6733 - | ListOfLengthString(crate::model::list_of_length_string_internal::ConstraintViolation),
|
6734 - | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
6735 - | #[doc(hidden)]
|
6736 - | SetOfLengthString(crate::model::set_of_length_string_internal::ConstraintViolation),
|
6737 - | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
6738 - | #[doc(hidden)]
|
6739 - | MapOfLengthString(crate::model::map_of_length_string_internal::ConstraintViolation),
|
6740 - | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
6741 - | #[doc(hidden)]
|
6742 - | ListOfLengthBlob(crate::model::list_of_length_blob_internal::ConstraintViolation),
|
6743 - | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
6744 - | #[doc(hidden)]
|
6745 - | MapOfLengthBlob(crate::model::map_of_length_blob_internal::ConstraintViolation),
|
6746 - | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
6747 - | #[doc(hidden)]
|
6748 - | ListOfRangeInteger(crate::model::list_of_range_integer_internal::ConstraintViolation),
|
6749 - | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
6750 - | #[doc(hidden)]
|
6751 - | SetOfRangeInteger(crate::model::set_of_range_integer_internal::ConstraintViolation),
|
6752 - | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
6753 - | #[doc(hidden)]
|
6754 - | MapOfRangeInteger(crate::model::map_of_range_integer_internal::ConstraintViolation),
|
6755 - | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
6756 - | #[doc(hidden)]
|
6757 - | ListOfRangeShort(crate::model::list_of_range_short_internal::ConstraintViolation),
|
6758 - | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
6759 - | #[doc(hidden)]
|
6760 - | SetOfRangeShort(crate::model::set_of_range_short_internal::ConstraintViolation),
|
6761 - | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
6762 - | #[doc(hidden)]
|
6763 - | MapOfRangeShort(crate::model::map_of_range_short_internal::ConstraintViolation),
|
6764 - | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
6765 - | #[doc(hidden)]
|
6766 - | ListOfRangeLong(crate::model::list_of_range_long_internal::ConstraintViolation),
|
6767 - | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
6768 - | #[doc(hidden)]
|
6769 - | SetOfRangeLong(crate::model::set_of_range_long_internal::ConstraintViolation),
|
6770 - | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
6771 - | #[doc(hidden)]
|
6772 - | MapOfRangeLong(crate::model::map_of_range_long_internal::ConstraintViolation),
|
6773 - | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
6774 - | #[doc(hidden)]
|
6775 - | ListOfRangeByte(crate::model::list_of_range_byte_internal::ConstraintViolation),
|
6776 - | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
6777 - | #[doc(hidden)]
|
6778 - | SetOfRangeByte(crate::model::set_of_range_byte_internal::ConstraintViolation),
|
6779 - | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
6780 - | #[doc(hidden)]
|
6781 - | MapOfRangeByte(crate::model::map_of_range_byte_internal::ConstraintViolation),
|
6782 - | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
6783 - | #[doc(hidden)]
|
6784 - | PatternString(crate::model::pattern_string_internal::ConstraintViolation),
|
6785 - | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
6786 - | #[doc(hidden)]
|
6787 - | MapOfPatternString(crate::model::map_of_pattern_string_internal::ConstraintViolation),
|
6788 - | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
6789 - | #[doc(hidden)]
|
6790 - | ListOfPatternString(crate::model::list_of_pattern_string_internal::ConstraintViolation),
|
6791 - | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
6792 - | #[doc(hidden)]
|
6793 - | SetOfPatternString(crate::model::set_of_pattern_string_internal::ConstraintViolation),
|
6794 - | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
6795 - | #[doc(hidden)]
|
6796 - | LengthLengthPatternString(
|
6797 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
6798 - | ),
|
6799 - | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
6800 - | #[doc(hidden)]
|
6801 - | MapOfLengthPatternString(
|
6802 - | crate::model::map_of_length_pattern_string_internal::ConstraintViolation,
|
6803 - | ),
|
6804 - | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
6805 - | #[doc(hidden)]
|
6806 - | ListOfLengthPatternString(
|
6807 - | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
6808 - | ),
|
6809 - | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
6810 - | #[doc(hidden)]
|
6811 - | SetOfLengthPatternString(
|
6812 - | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
6813 - | ),
|
6814 - | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
6815 - | #[doc(hidden)]
|
6816 - | LengthListOfPatternString(
|
6817 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
6818 - | ),
|
6819 - | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
6820 - | #[doc(hidden)]
|
6821 - | LengthSetOfPatternString(
|
6822 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
6823 - | ),
|
5995 + | #[allow(missing_docs)] // documentation missing in model
|
5996 + | pub(crate) fn set_range_integer(
|
5997 + | mut self,
|
5998 + | input: impl ::std::convert::Into<
|
5999 + | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
6000 + | >,
|
6001 + | ) -> Self {
|
6002 + | self.range_integer = Some(input.into());
|
6003 + | self
|
6824 6004 | }
|
6825 - | impl ::std::fmt::Display for ConstraintViolation {
|
6826 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6827 - | match self {
|
6828 - | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
6829 - | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
6830 - | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
6831 - | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
6832 - | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
6833 - | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
6834 - | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
6835 - | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
6836 - | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
6837 - | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
6838 - | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
6839 - | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
6840 - | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
6841 - | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
6842 - | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
6843 - | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
6844 - | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
6845 - | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
6846 - | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
6847 - | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
6848 - | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
6849 - | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
6850 - | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
6851 - | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
6852 - | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
6853 - | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
6854 - | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
6855 - | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
6856 - | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
6857 - | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
6858 - | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
6859 - | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
6860 - | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
6861 - | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
6862 - | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
6863 - | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
6864 - | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
6865 - | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
6866 - | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
6867 - | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
6868 - | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
6869 - | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
6870 - | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
6871 - | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
6872 - | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
6873 - | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
6874 - | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
6875 - | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
6876 - | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
6877 - | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
6878 - | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
6879 - | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
6880 - | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
6881 - | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
6882 - | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
6883 - | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
6884 - | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
6885 - | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
6886 - | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
6887 - | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
6888 - | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
6889 - | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
6890 - | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
6891 - | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
6892 - | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
6893 - | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
6894 - | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
6895 - | }
|
6896 - | }
|
6897 - | }
|
6898 - | impl ::std::error::Error for ConstraintViolation {}
|
6899 - | impl ConstraintViolation {
|
6900 - | pub(crate) fn as_validation_exception_field(
|
6901 - | self,
|
6902 - | path: ::std::string::String,
|
6903 - | ) -> crate::model::ValidationExceptionField {
|
6904 - | match self {
|
6905 - | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
6906 - | message: format!(
|
6907 - | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
6908 - | path
|
6909 - | ),
|
6910 - | path: path + "/conB",
|
6911 - | },
|
6912 - | ConstraintViolation::ConB(inner) => {
|
6913 - | inner.as_validation_exception_field(path + "/conB")
|
6914 - | }
|
6915 - | ConstraintViolation::OptConB(inner) => {
|
6916 - | inner.as_validation_exception_field(path + "/optConB")
|
6005 + | #[allow(missing_docs)] // documentation missing in model
|
6006 + | pub(crate) fn set_min_range_integer(
|
6007 + | mut self,
|
6008 + | input: impl ::std::convert::Into<
|
6009 + | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
6010 + | >,
|
6011 + | ) -> Self {
|
6012 + | self.min_range_integer = Some(input.into());
|
6013 + | self
|
6917 6014 | }
|
6918 - | ConstraintViolation::LengthString(inner) => {
|
6919 - | inner.as_validation_exception_field(path + "/lengthString")
|
6015 + | #[allow(missing_docs)] // documentation missing in model
|
6016 + | pub(crate) fn set_max_range_integer(
|
6017 + | mut self,
|
6018 + | input: impl ::std::convert::Into<
|
6019 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
6020 + | >,
|
6021 + | ) -> Self {
|
6022 + | self.max_range_integer = Some(input.into());
|
6023 + | self
|
6920 6024 | }
|
6921 - | ConstraintViolation::MinLengthString(inner) => {
|
6922 - | inner.as_validation_exception_field(path + "/minLengthString")
|
6025 + | #[allow(missing_docs)] // documentation missing in model
|
6026 + | pub(crate) fn set_fixed_value_integer(
|
6027 + | mut self,
|
6028 + | input: impl ::std::convert::Into<
|
6029 + | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
6030 + | >,
|
6031 + | ) -> Self {
|
6032 + | self.fixed_value_integer = Some(input.into());
|
6033 + | self
|
6923 6034 | }
|
6924 - | ConstraintViolation::MaxLengthString(inner) => {
|
6925 - | inner.as_validation_exception_field(path + "/maxLengthString")
|
6035 + | #[allow(missing_docs)] // documentation missing in model
|
6036 + | pub(crate) fn set_range_short(
|
6037 + | mut self,
|
6038 + | input: impl ::std::convert::Into<
|
6039 + | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
6040 + | >,
|
6041 + | ) -> Self {
|
6042 + | self.range_short = Some(input.into());
|
6043 + | self
|
6926 6044 | }
|
6927 - | ConstraintViolation::FixedLengthString(inner) => {
|
6928 - | inner.as_validation_exception_field(path + "/fixedLengthString")
|
6045 + | #[allow(missing_docs)] // documentation missing in model
|
6046 + | pub(crate) fn set_min_range_short(
|
6047 + | mut self,
|
6048 + | input: impl ::std::convert::Into<
|
6049 + | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
6050 + | >,
|
6051 + | ) -> Self {
|
6052 + | self.min_range_short = Some(input.into());
|
6053 + | self
|
6929 6054 | }
|
6930 - | ConstraintViolation::LengthBlob(inner) => {
|
6931 - | inner.as_validation_exception_field(path + "/lengthBlob")
|
6055 + | #[allow(missing_docs)] // documentation missing in model
|
6056 + | pub(crate) fn set_max_range_short(
|
6057 + | mut self,
|
6058 + | input: impl ::std::convert::Into<
|
6059 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
6060 + | >,
|
6061 + | ) -> Self {
|
6062 + | self.max_range_short = Some(input.into());
|
6063 + | self
|
6932 6064 | }
|
6933 - | ConstraintViolation::MinLengthBlob(inner) => {
|
6934 - | inner.as_validation_exception_field(path + "/minLengthBlob")
|
6065 + | #[allow(missing_docs)] // documentation missing in model
|
6066 + | pub(crate) fn set_fixed_value_short(
|
6067 + | mut self,
|
6068 + | input: impl ::std::convert::Into<
|
6069 + | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
6070 + | >,
|
6071 + | ) -> Self {
|
6072 + | self.fixed_value_short = Some(input.into());
|
6073 + | self
|
6935 6074 | }
|
6936 - | ConstraintViolation::MaxLengthBlob(inner) => {
|
6937 - | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
6075 + | #[allow(missing_docs)] // documentation missing in model
|
6076 + | pub(crate) fn set_range_long(
|
6077 + | mut self,
|
6078 + | input: impl ::std::convert::Into<
|
6079 + | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
6080 + | >,
|
6081 + | ) -> Self {
|
6082 + | self.range_long = Some(input.into());
|
6083 + | self
|
6938 6084 | }
|
6939 - | ConstraintViolation::FixedLengthBlob(inner) => {
|
6940 - | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
6085 + | #[allow(missing_docs)] // documentation missing in model
|
6086 + | pub(crate) fn set_min_range_long(
|
6087 + | mut self,
|
6088 + | input: impl ::std::convert::Into<
|
6089 + | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
6090 + | >,
|
6091 + | ) -> Self {
|
6092 + | self.min_range_long = Some(input.into());
|
6093 + | self
|
6941 6094 | }
|
6942 - | ConstraintViolation::RangeInteger(inner) => {
|
6943 - | inner.as_validation_exception_field(path + "/rangeInteger")
|
6095 + | #[allow(missing_docs)] // documentation missing in model
|
6096 + | pub(crate) fn set_max_range_long(
|
6097 + | mut self,
|
6098 + | input: impl ::std::convert::Into<
|
6099 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
6100 + | >,
|
6101 + | ) -> Self {
|
6102 + | self.max_range_long = Some(input.into());
|
6103 + | self
|
6944 6104 | }
|
6945 - | ConstraintViolation::MinRangeInteger(inner) => {
|
6946 - | inner.as_validation_exception_field(path + "/minRangeInteger")
|
6105 + | #[allow(missing_docs)] // documentation missing in model
|
6106 + | pub(crate) fn set_fixed_value_long(
|
6107 + | mut self,
|
6108 + | input: impl ::std::convert::Into<
|
6109 + | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
6110 + | >,
|
6111 + | ) -> Self {
|
6112 + | self.fixed_value_long = Some(input.into());
|
6113 + | self
|
6947 6114 | }
|
6948 - | ConstraintViolation::MaxRangeInteger(inner) => {
|
6949 - | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
6115 + | #[allow(missing_docs)] // documentation missing in model
|
6116 + | pub(crate) fn set_range_byte(
|
6117 + | mut self,
|
6118 + | input: impl ::std::convert::Into<
|
6119 + | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
6120 + | >,
|
6121 + | ) -> Self {
|
6122 + | self.range_byte = Some(input.into());
|
6123 + | self
|
6950 6124 | }
|
6951 - | ConstraintViolation::FixedValueInteger(inner) => {
|
6952 - | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
6125 + | #[allow(missing_docs)] // documentation missing in model
|
6126 + | pub(crate) fn set_min_range_byte(
|
6127 + | mut self,
|
6128 + | input: impl ::std::convert::Into<
|
6129 + | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
6130 + | >,
|
6131 + | ) -> Self {
|
6132 + | self.min_range_byte = Some(input.into());
|
6133 + | self
|
6953 6134 | }
|
6954 - | ConstraintViolation::RangeShort(inner) => {
|
6955 - | inner.as_validation_exception_field(path + "/rangeShort")
|
6135 + | #[allow(missing_docs)] // documentation missing in model
|
6136 + | pub(crate) fn set_max_range_byte(
|
6137 + | mut self,
|
6138 + | input: impl ::std::convert::Into<
|
6139 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
6140 + | >,
|
6141 + | ) -> Self {
|
6142 + | self.max_range_byte = Some(input.into());
|
6143 + | self
|
6956 6144 | }
|
6957 - | ConstraintViolation::MinRangeShort(inner) => {
|
6958 - | inner.as_validation_exception_field(path + "/minRangeShort")
|
6145 + | #[allow(missing_docs)] // documentation missing in model
|
6146 + | pub(crate) fn set_fixed_value_byte(
|
6147 + | mut self,
|
6148 + | input: impl ::std::convert::Into<
|
6149 + | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
6150 + | >,
|
6151 + | ) -> Self {
|
6152 + | self.fixed_value_byte = Some(input.into());
|
6153 + | self
|
6959 6154 | }
|
6960 - | ConstraintViolation::MaxRangeShort(inner) => {
|
6961 - | inner.as_validation_exception_field(path + "/maxRangeShort")
|
6962 - | }
|
6963 - | ConstraintViolation::FixedValueShort(inner) => {
|
6964 - | inner.as_validation_exception_field(path + "/fixedValueShort")
|
6155 + | #[allow(missing_docs)] // documentation missing in model
|
6156 + | pub(crate) fn set_con_b_list(
|
6157 + | mut self,
|
6158 + | input: Option<
|
6159 + | impl ::std::convert::Into<
|
6160 + | crate::constrained::MaybeConstrained<
|
6161 + | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
6162 + | >,
|
6163 + | >,
|
6164 + | >,
|
6165 + | ) -> Self {
|
6166 + | self.con_b_list = input.map(|v| v.into());
|
6167 + | self
|
6965 6168 | }
|
6966 - | ConstraintViolation::RangeLong(inner) => {
|
6967 - | inner.as_validation_exception_field(path + "/rangeLong")
|
6169 + | #[allow(missing_docs)] // documentation missing in model
|
6170 + | pub(crate) fn set_length_list(
|
6171 + | mut self,
|
6172 + | input: Option<
|
6173 + | impl ::std::convert::Into<
|
6174 + | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
6175 + | >,
|
6176 + | >,
|
6177 + | ) -> Self {
|
6178 + | self.length_list = input.map(|v| v.into());
|
6179 + | self
|
6968 6180 | }
|
6969 - | ConstraintViolation::MinRangeLong(inner) => {
|
6970 - | inner.as_validation_exception_field(path + "/minRangeLong")
|
6181 + | #[allow(missing_docs)] // documentation missing in model
|
6182 + | pub(crate) fn set_sensitive_length_list(
|
6183 + | mut self,
|
6184 + | input: Option<
|
6185 + | impl ::std::convert::Into<
|
6186 + | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
6187 + | >,
|
6188 + | >,
|
6189 + | ) -> Self {
|
6190 + | self.sensitive_length_list = input.map(|v| v.into());
|
6191 + | self
|
6971 6192 | }
|
6972 - | ConstraintViolation::MaxRangeLong(inner) => {
|
6973 - | inner.as_validation_exception_field(path + "/maxRangeLong")
|
6193 + | #[allow(missing_docs)] // documentation missing in model
|
6194 + | pub(crate) fn set_con_b_set(
|
6195 + | mut self,
|
6196 + | input: Option<
|
6197 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6198 + | >,
|
6199 + | ) -> Self {
|
6200 + | self.con_b_set = input.map(|v| v.into());
|
6201 + | self
|
6974 6202 | }
|
6975 - | ConstraintViolation::FixedValueLong(inner) => {
|
6976 - | inner.as_validation_exception_field(path + "/fixedValueLong")
|
6203 + | #[allow(missing_docs)] // documentation missing in model
|
6204 + | pub(crate) fn set_con_b_map(
|
6205 + | mut self,
|
6206 + | input: Option<
|
6207 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6208 + | >,
|
6209 + | ) -> Self {
|
6210 + | self.con_b_map = input.map(|v| v.into());
|
6211 + | self
|
6977 6212 | }
|
6978 - | ConstraintViolation::RangeByte(inner) => {
|
6979 - | inner.as_validation_exception_field(path + "/rangeByte")
|
6213 + | #[allow(missing_docs)] // documentation missing in model
|
6214 + | pub(crate) fn set_length_map(
|
6215 + | mut self,
|
6216 + | input: Option<
|
6217 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6218 + | >,
|
6219 + | ) -> Self {
|
6220 + | self.length_map = input.map(|v| v.into());
|
6221 + | self
|
6980 6222 | }
|
6981 - | ConstraintViolation::MinRangeByte(inner) => {
|
6982 - | inner.as_validation_exception_field(path + "/minRangeByte")
|
6223 + | #[allow(missing_docs)] // documentation missing in model
|
6224 + | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
6225 + | mut self,
|
6226 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
6227 + | ) -> Self {
|
6228 + | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
6229 + | self
|
6983 6230 | }
|
6984 - | ConstraintViolation::MaxRangeByte(inner) => {
|
6985 - | inner.as_validation_exception_field(path + "/maxRangeByte")
|
6231 + | #[allow(missing_docs)] // documentation missing in model
|
6232 + | pub(crate) fn set_sparse_map(
|
6233 + | mut self,
|
6234 + | input: Option<
|
6235 + | impl ::std::convert::Into<
|
6236 + | crate::constrained::MaybeConstrained<
|
6237 + | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
6238 + | >,
|
6239 + | >,
|
6240 + | >,
|
6241 + | ) -> Self {
|
6242 + | self.sparse_map = input.map(|v| v.into());
|
6243 + | self
|
6986 6244 | }
|
6987 - | ConstraintViolation::FixedValueByte(inner) => {
|
6988 - | inner.as_validation_exception_field(path + "/fixedValueByte")
|
6245 + | #[allow(missing_docs)] // documentation missing in model
|
6246 + | pub(crate) fn set_sparse_list(
|
6247 + | mut self,
|
6248 + | input: Option<
|
6249 + | impl ::std::convert::Into<
|
6250 + | crate::constrained::MaybeConstrained<
|
6251 + | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
6252 + | >,
|
6253 + | >,
|
6254 + | >,
|
6255 + | ) -> Self {
|
6256 + | self.sparse_list = input.map(|v| v.into());
|
6257 + | self
|
6989 6258 | }
|
6990 - | ConstraintViolation::ConBList(inner) => {
|
6991 - | inner.as_validation_exception_field(path + "/conBList")
|
6259 + | #[allow(missing_docs)] // documentation missing in model
|
6260 + | pub(crate) fn set_sparse_length_map(
|
6261 + | mut self,
|
6262 + | input: Option<
|
6263 + | impl ::std::convert::Into<
|
6264 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
6265 + | >,
|
6266 + | >,
|
6267 + | ) -> Self {
|
6268 + | self.sparse_length_map = input.map(|v| v.into());
|
6269 + | self
|
6992 6270 | }
|
6993 - | ConstraintViolation::LengthList(inner) => {
|
6994 - | inner.as_validation_exception_field(path + "/lengthList")
|
6271 + | #[allow(missing_docs)] // documentation missing in model
|
6272 + | pub(crate) fn set_sparse_length_list(
|
6273 + | mut self,
|
6274 + | input: Option<
|
6275 + | impl ::std::convert::Into<
|
6276 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
6277 + | >,
|
6278 + | >,
|
6279 + | ) -> Self {
|
6280 + | self.sparse_length_list = input.map(|v| v.into());
|
6281 + | self
|
6995 6282 | }
|
6996 - | ConstraintViolation::SensitiveLengthList(inner) => {
|
6997 - | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
6283 + | /// A union with constrained members.
|
6284 + | pub(crate) fn set_constrained_union(
|
6285 + | mut self,
|
6286 + | input: Option<
|
6287 + | impl ::std::convert::Into<
|
6288 + | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
6289 + | >,
|
6290 + | >,
|
6291 + | ) -> Self {
|
6292 + | self.constrained_union = input.map(|v| v.into());
|
6293 + | self
|
6998 6294 | }
|
6999 - | ConstraintViolation::ConBSet(inner) => {
|
7000 - | inner.as_validation_exception_field(path + "/conBSet")
|
6295 + | #[allow(missing_docs)] // documentation missing in model
|
6296 + | pub(crate) fn set_enum_string(
|
6297 + | mut self,
|
6298 + | input: Option<
|
6299 + | impl ::std::convert::Into<
|
6300 + | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6301 + | >,
|
6302 + | >,
|
6303 + | ) -> Self {
|
6304 + | self.enum_string = input.map(|v| v.into());
|
6305 + | self
|
7001 6306 | }
|
7002 - | ConstraintViolation::ConBMap(inner) => {
|
7003 - | inner.as_validation_exception_field(path + "/conBMap")
|
6307 + | #[allow(missing_docs)] // documentation missing in model
|
6308 + | pub(crate) fn set_list_of_length_string(
|
6309 + | mut self,
|
6310 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
6311 + | ) -> Self {
|
6312 + | self.list_of_length_string = input.map(|v| v.into());
|
6313 + | self
|
7004 6314 | }
|
7005 - | ConstraintViolation::LengthMap(inner) => {
|
7006 - | inner.as_validation_exception_field(path + "/lengthMap")
|
6315 + | #[allow(missing_docs)] // documentation missing in model
|
6316 + | pub(crate) fn set_set_of_length_string(
|
6317 + | mut self,
|
6318 + | input: Option<
|
6319 + | impl ::std::convert::Into<
|
6320 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
6321 + | >,
|
6322 + | >,
|
6323 + | ) -> Self {
|
6324 + | self.set_of_length_string = input.map(|v| v.into());
|
6325 + | self
|
7007 6326 | }
|
7008 - | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
7009 - | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
6327 + | #[allow(missing_docs)] // documentation missing in model
|
6328 + | pub(crate) fn set_map_of_length_string(
|
6329 + | mut self,
|
6330 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
6331 + | ) -> Self {
|
6332 + | self.map_of_length_string = input.map(|v| v.into());
|
6333 + | self
|
7010 6334 | }
|
7011 - | ConstraintViolation::SparseMap(inner) => {
|
7012 - | inner.as_validation_exception_field(path + "/sparseMap")
|
6335 + | #[allow(missing_docs)] // documentation missing in model
|
6336 + | pub(crate) fn set_list_of_length_blob(
|
6337 + | mut self,
|
6338 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
6339 + | ) -> Self {
|
6340 + | self.list_of_length_blob = input.map(|v| v.into());
|
6341 + | self
|
7013 6342 | }
|
7014 - | ConstraintViolation::SparseList(inner) => {
|
7015 - | inner.as_validation_exception_field(path + "/sparseList")
|
6343 + | #[allow(missing_docs)] // documentation missing in model
|
6344 + | pub(crate) fn set_map_of_length_blob(
|
6345 + | mut self,
|
6346 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
6347 + | ) -> Self {
|
6348 + | self.map_of_length_blob = input.map(|v| v.into());
|
6349 + | self
|
7016 6350 | }
|
7017 - | ConstraintViolation::SparseLengthMap(inner) => {
|
7018 - | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
6351 + | #[allow(missing_docs)] // documentation missing in model
|
6352 + | pub(crate) fn set_list_of_range_integer(
|
6353 + | mut self,
|
6354 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
6355 + | ) -> Self {
|
6356 + | self.list_of_range_integer = input.map(|v| v.into());
|
6357 + | self
|
7019 6358 | }
|
7020 - | ConstraintViolation::SparseLengthList(inner) => {
|
7021 - | inner.as_validation_exception_field(path + "/sparseLengthList")
|
6359 + | #[allow(missing_docs)] // documentation missing in model
|
6360 + | pub(crate) fn set_set_of_range_integer(
|
6361 + | mut self,
|
6362 + | input: Option<
|
6363 + | impl ::std::convert::Into<
|
6364 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
6365 + | >,
|
6366 + | >,
|
6367 + | ) -> Self {
|
6368 + | self.set_of_range_integer = input.map(|v| v.into());
|
6369 + | self
|
7022 6370 | }
|
7023 - | ConstraintViolation::ConstrainedUnion(inner) => {
|
7024 - | inner.as_validation_exception_field(path + "/constrainedUnion")
|
6371 + | #[allow(missing_docs)] // documentation missing in model
|
6372 + | pub(crate) fn set_map_of_range_integer(
|
6373 + | mut self,
|
6374 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
6375 + | ) -> Self {
|
6376 + | self.map_of_range_integer = input.map(|v| v.into());
|
6377 + | self
|
7025 6378 | }
|
7026 - | ConstraintViolation::EnumString(inner) => {
|
7027 - | inner.as_validation_exception_field(path + "/enumString")
|
6379 + | #[allow(missing_docs)] // documentation missing in model
|
6380 + | pub(crate) fn set_list_of_range_short(
|
6381 + | mut self,
|
6382 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
6383 + | ) -> Self {
|
6384 + | self.list_of_range_short = input.map(|v| v.into());
|
6385 + | self
|
7028 6386 | }
|
7029 - | ConstraintViolation::ListOfLengthString(inner) => {
|
7030 - | inner.as_validation_exception_field(path + "/listOfLengthString")
|
7031 - | }
|
7032 - | ConstraintViolation::SetOfLengthString(inner) => {
|
7033 - | inner.as_validation_exception_field(path + "/setOfLengthString")
|
7034 - | }
|
7035 - | ConstraintViolation::MapOfLengthString(inner) => {
|
7036 - | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
7037 - | }
|
7038 - | ConstraintViolation::ListOfLengthBlob(inner) => {
|
7039 - | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
7040 - | }
|
7041 - | ConstraintViolation::MapOfLengthBlob(inner) => {
|
7042 - | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
7043 - | }
|
7044 - | ConstraintViolation::ListOfRangeInteger(inner) => {
|
7045 - | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
7046 - | }
|
7047 - | ConstraintViolation::SetOfRangeInteger(inner) => {
|
7048 - | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
7049 - | }
|
7050 - | ConstraintViolation::MapOfRangeInteger(inner) => {
|
7051 - | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
7052 - | }
|
7053 - | ConstraintViolation::ListOfRangeShort(inner) => {
|
7054 - | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
7055 - | }
|
7056 - | ConstraintViolation::SetOfRangeShort(inner) => {
|
7057 - | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
7058 - | }
|
7059 - | ConstraintViolation::MapOfRangeShort(inner) => {
|
7060 - | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
7061 - | }
|
7062 - | ConstraintViolation::ListOfRangeLong(inner) => {
|
7063 - | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
7064 - | }
|
7065 - | ConstraintViolation::SetOfRangeLong(inner) => {
|
7066 - | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
7067 - | }
|
7068 - | ConstraintViolation::MapOfRangeLong(inner) => {
|
7069 - | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
7070 - | }
|
7071 - | ConstraintViolation::ListOfRangeByte(inner) => {
|
7072 - | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
7073 - | }
|
7074 - | ConstraintViolation::SetOfRangeByte(inner) => {
|
7075 - | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
7076 - | }
|
7077 - | ConstraintViolation::MapOfRangeByte(inner) => {
|
7078 - | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
7079 - | }
|
7080 - | ConstraintViolation::PatternString(inner) => {
|
7081 - | inner.as_validation_exception_field(path + "/patternString")
|
7082 - | }
|
7083 - | ConstraintViolation::MapOfPatternString(inner) => {
|
7084 - | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
7085 - | }
|
7086 - | ConstraintViolation::ListOfPatternString(inner) => {
|
7087 - | inner.as_validation_exception_field(path + "/listOfPatternString")
|
7088 - | }
|
7089 - | ConstraintViolation::SetOfPatternString(inner) => {
|
7090 - | inner.as_validation_exception_field(path + "/setOfPatternString")
|
7091 - | }
|
7092 - | ConstraintViolation::LengthLengthPatternString(inner) => {
|
7093 - | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
7094 - | }
|
7095 - | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
7096 - | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
7097 - | }
|
7098 - | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
7099 - | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
7100 - | }
|
7101 - | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
7102 - | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
7103 - | }
|
7104 - | ConstraintViolation::LengthListOfPatternString(inner) => {
|
7105 - | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
7106 - | }
|
7107 - | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
7108 - | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
7109 - | }
|
7110 - | }
|
7111 - | }
|
7112 - | }
|
7113 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
7114 - | fn from(builder: Builder) -> Self {
|
7115 - | Self::Unconstrained(builder)
|
7116 - | }
|
7117 - | }
|
7118 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
7119 - | type Error = ConstraintViolation;
|
7120 - |
|
7121 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7122 - | builder.build()
|
7123 - | }
|
7124 - | }
|
7125 - | /// A builder for [`ConA`](crate::model::ConA).
|
7126 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7127 - | pub(crate) struct Builder {
|
7128 - | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
7129 - | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
7130 - | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
7131 - | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
7132 - | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
7133 - | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
7134 - | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
7135 - | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
7136 - | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
7137 - | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
7138 - | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
7139 - | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
7140 - | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
7141 - | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
7142 - | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
7143 - | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
7144 - | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
7145 - | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
7146 - | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
7147 - | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
7148 - | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
7149 - | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
7150 - | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
7151 - | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
7152 - | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
7153 - | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
7154 - | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
7155 - | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
7156 - | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
7157 - | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
7158 - | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
7159 - | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
7160 - | 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>>,
|
7161 - | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
7162 - | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
7163 - | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
7164 - | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
7165 - | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
7166 - | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
7167 - | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
7168 - | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
7169 - | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
7170 - | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
7171 - | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
7172 - | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
7173 - | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
7174 - | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
7175 - | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
7176 - | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
7177 - | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
7178 - | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
7179 - | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
7180 - | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
7181 - | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
7182 - | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
7183 - | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
7184 - | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7185 - | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
7186 - | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
7187 - | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
7188 - | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
7189 - | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
7190 - | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
7191 - | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
7192 - | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
7193 - | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
7194 - | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
7195 - | }
|
7196 - | impl Builder {
|
7197 6387 | #[allow(missing_docs)] // documentation missing in model
|
7198 - | pub(crate) fn set_con_b(
|
6388 + | pub(crate) fn set_set_of_range_short(
|
7199 6389 | mut self,
|
7200 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6390 + | input: Option<
|
6391 + | impl ::std::convert::Into<
|
6392 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
6393 + | >,
|
6394 + | >,
|
7201 6395 | ) -> Self {
|
7202 - | self.con_b = Some(input.into());
|
6396 + | self.set_of_range_short = input.map(|v| v.into());
|
7203 6397 | self
|
7204 6398 | }
|
7205 6399 | #[allow(missing_docs)] // documentation missing in model
|
7206 - | pub(crate) fn set_opt_con_b(
|
6400 + | pub(crate) fn set_map_of_range_short(
|
7207 6401 | mut self,
|
7208 - | input: Option<
|
7209 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
7210 - | >,
|
6402 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
7211 6403 | ) -> Self {
|
7212 - | self.opt_con_b = input.map(|v| v.into());
|
6404 + | self.map_of_range_short = input.map(|v| v.into());
|
7213 6405 | self
|
7214 6406 | }
|
7215 6407 | #[allow(missing_docs)] // documentation missing in model
|
7216 - | pub(crate) fn set_length_string(
|
6408 + | pub(crate) fn set_list_of_range_long(
|
7217 6409 | mut self,
|
7218 - | input: Option<
|
7219 - | impl ::std::convert::Into<
|
7220 - | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
7221 - | >,
|
7222 - | >,
|
6410 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
7223 6411 | ) -> Self {
|
7224 - | self.length_string = input.map(|v| v.into());
|
6412 + | self.list_of_range_long = input.map(|v| v.into());
|
7225 6413 | self
|
7226 6414 | }
|
7227 6415 | #[allow(missing_docs)] // documentation missing in model
|
7228 - | pub(crate) fn set_min_length_string(
|
6416 + | pub(crate) fn set_set_of_range_long(
|
7229 6417 | mut self,
|
7230 6418 | input: Option<
|
7231 6419 | impl ::std::convert::Into<
|
7232 - | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
6420 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
7233 6421 | >,
|
7234 6422 | >,
|
7235 6423 | ) -> Self {
|
7236 - | self.min_length_string = input.map(|v| v.into());
|
6424 + | self.set_of_range_long = input.map(|v| v.into());
|
7237 6425 | self
|
7238 6426 | }
|
7239 6427 | #[allow(missing_docs)] // documentation missing in model
|
7240 - | pub(crate) fn set_max_length_string(
|
6428 + | pub(crate) fn set_map_of_range_long(
|
7241 6429 | mut self,
|
7242 - | input: Option<
|
7243 - | impl ::std::convert::Into<
|
7244 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
7245 - | >,
|
7246 - | >,
|
6430 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
7247 6431 | ) -> Self {
|
7248 - | self.max_length_string = input.map(|v| v.into());
|
6432 + | self.map_of_range_long = input.map(|v| v.into());
|
7249 6433 | self
|
7250 6434 | }
|
7251 6435 | #[allow(missing_docs)] // documentation missing in model
|
7252 - | pub(crate) fn set_fixed_length_string(
|
6436 + | pub(crate) fn set_list_of_range_byte(
|
7253 6437 | mut self,
|
7254 - | input: Option<
|
7255 - | impl ::std::convert::Into<
|
7256 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
7257 - | >,
|
7258 - | >,
|
6438 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
7259 6439 | ) -> Self {
|
7260 - | self.fixed_length_string = input.map(|v| v.into());
|
6440 + | self.list_of_range_byte = input.map(|v| v.into());
|
7261 6441 | self
|
7262 6442 | }
|
7263 6443 | #[allow(missing_docs)] // documentation missing in model
|
7264 - | pub(crate) fn set_length_blob(
|
6444 + | pub(crate) fn set_set_of_range_byte(
|
7265 6445 | mut self,
|
7266 6446 | input: Option<
|
7267 6447 | impl ::std::convert::Into<
|
7268 - | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
6448 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
7269 6449 | >,
|
7270 6450 | >,
|
7271 6451 | ) -> Self {
|
7272 - | self.length_blob = input.map(|v| v.into());
|
6452 + | self.set_of_range_byte = input.map(|v| v.into());
|
7273 6453 | self
|
7274 6454 | }
|
7275 6455 | #[allow(missing_docs)] // documentation missing in model
|
7276 - | pub(crate) fn set_min_length_blob(
|
6456 + | pub(crate) fn set_map_of_range_byte(
|
7277 6457 | mut self,
|
7278 - | input: Option<
|
7279 - | impl ::std::convert::Into<
|
7280 - | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
7281 - | >,
|
7282 - | >,
|
6458 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
7283 6459 | ) -> Self {
|
7284 - | self.min_length_blob = input.map(|v| v.into());
|
6460 + | self.map_of_range_byte = input.map(|v| v.into());
|
7285 6461 | self
|
7286 6462 | }
|
7287 6463 | #[allow(missing_docs)] // documentation missing in model
|
7288 - | pub(crate) fn set_max_length_blob(
|
6464 + | pub(crate) fn set_non_streaming_blob(
|
7289 6465 | mut self,
|
7290 - | input: Option<
|
7291 - | impl ::std::convert::Into<
|
7292 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
7293 - | >,
|
7294 - | >,
|
6466 + | input: Option<impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>>,
|
7295 6467 | ) -> Self {
|
7296 - | self.max_length_blob = input.map(|v| v.into());
|
6468 + | self.non_streaming_blob = input.map(|v| v.into());
|
7297 6469 | self
|
7298 6470 | }
|
7299 6471 | #[allow(missing_docs)] // documentation missing in model
|
7300 - | pub(crate) fn set_fixed_length_blob(
|
6472 + | pub(crate) fn set_pattern_string(
|
7301 6473 | mut self,
|
7302 6474 | input: Option<
|
7303 6475 | impl ::std::convert::Into<
|
7304 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
6476 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
7305 6477 | >,
|
7306 6478 | >,
|
7307 6479 | ) -> Self {
|
7308 - | self.fixed_length_blob = input.map(|v| v.into());
|
6480 + | self.pattern_string = input.map(|v| v.into());
|
7309 6481 | self
|
7310 6482 | }
|
7311 6483 | #[allow(missing_docs)] // documentation missing in model
|
7312 - | pub(crate) fn set_range_integer(
|
6484 + | pub(crate) fn set_map_of_pattern_string(
|
7313 6485 | mut self,
|
7314 - | input: impl ::std::convert::Into<
|
7315 - | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
7316 - | >,
|
7317 - | ) -> Self {
|
7318 - | self.range_integer = Some(input.into());
|
7319 - | self
|
7320 - | }
|
7321 - | #[allow(missing_docs)] // documentation missing in model
|
7322 - | pub(crate) fn set_min_range_integer(
|
7323 - | mut self,
|
7324 - | input: impl ::std::convert::Into<
|
7325 - | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
7326 - | >,
|
7327 - | ) -> Self {
|
7328 - | self.min_range_integer = Some(input.into());
|
7329 - | self
|
7330 - | }
|
7331 - | #[allow(missing_docs)] // documentation missing in model
|
7332 - | pub(crate) fn set_max_range_integer(
|
7333 - | mut self,
|
7334 - | input: impl ::std::convert::Into<
|
7335 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
7336 - | >,
|
7337 - | ) -> Self {
|
7338 - | self.max_range_integer = Some(input.into());
|
7339 - | self
|
7340 - | }
|
7341 - | #[allow(missing_docs)] // documentation missing in model
|
7342 - | pub(crate) fn set_fixed_value_integer(
|
7343 - | mut self,
|
7344 - | input: impl ::std::convert::Into<
|
7345 - | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
7346 - | >,
|
7347 - | ) -> Self {
|
7348 - | self.fixed_value_integer = Some(input.into());
|
7349 - | self
|
7350 - | }
|
7351 - | #[allow(missing_docs)] // documentation missing in model
|
7352 - | pub(crate) fn set_range_short(
|
7353 - | mut self,
|
7354 - | input: impl ::std::convert::Into<
|
7355 - | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
7356 - | >,
|
7357 - | ) -> Self {
|
7358 - | self.range_short = Some(input.into());
|
7359 - | self
|
7360 - | }
|
7361 - | #[allow(missing_docs)] // documentation missing in model
|
7362 - | pub(crate) fn set_min_range_short(
|
7363 - | mut self,
|
7364 - | input: impl ::std::convert::Into<
|
7365 - | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
7366 - | >,
|
7367 - | ) -> Self {
|
7368 - | self.min_range_short = Some(input.into());
|
7369 - | self
|
7370 - | }
|
7371 - | #[allow(missing_docs)] // documentation missing in model
|
7372 - | pub(crate) fn set_max_range_short(
|
7373 - | mut self,
|
7374 - | input: impl ::std::convert::Into<
|
7375 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
7376 - | >,
|
7377 - | ) -> Self {
|
7378 - | self.max_range_short = Some(input.into());
|
7379 - | self
|
7380 - | }
|
7381 - | #[allow(missing_docs)] // documentation missing in model
|
7382 - | pub(crate) fn set_fixed_value_short(
|
7383 - | mut self,
|
7384 - | input: impl ::std::convert::Into<
|
7385 - | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
7386 - | >,
|
7387 - | ) -> Self {
|
7388 - | self.fixed_value_short = Some(input.into());
|
7389 - | self
|
7390 - | }
|
7391 - | #[allow(missing_docs)] // documentation missing in model
|
7392 - | pub(crate) fn set_range_long(
|
7393 - | mut self,
|
7394 - | input: impl ::std::convert::Into<
|
7395 - | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
7396 - | >,
|
7397 - | ) -> Self {
|
7398 - | self.range_long = Some(input.into());
|
7399 - | self
|
7400 - | }
|
7401 - | #[allow(missing_docs)] // documentation missing in model
|
7402 - | pub(crate) fn set_min_range_long(
|
7403 - | mut self,
|
7404 - | input: impl ::std::convert::Into<
|
7405 - | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
7406 - | >,
|
7407 - | ) -> Self {
|
7408 - | self.min_range_long = Some(input.into());
|
7409 - | self
|
7410 - | }
|
7411 - | #[allow(missing_docs)] // documentation missing in model
|
7412 - | pub(crate) fn set_max_range_long(
|
7413 - | mut self,
|
7414 - | input: impl ::std::convert::Into<
|
7415 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
7416 - | >,
|
7417 - | ) -> Self {
|
7418 - | self.max_range_long = Some(input.into());
|
7419 - | self
|
7420 - | }
|
7421 - | #[allow(missing_docs)] // documentation missing in model
|
7422 - | pub(crate) fn set_fixed_value_long(
|
7423 - | mut self,
|
7424 - | input: impl ::std::convert::Into<
|
7425 - | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
7426 - | >,
|
7427 - | ) -> Self {
|
7428 - | self.fixed_value_long = Some(input.into());
|
7429 - | self
|
7430 - | }
|
7431 - | #[allow(missing_docs)] // documentation missing in model
|
7432 - | pub(crate) fn set_range_byte(
|
7433 - | mut self,
|
7434 - | input: impl ::std::convert::Into<
|
7435 - | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
7436 - | >,
|
7437 - | ) -> Self {
|
7438 - | self.range_byte = Some(input.into());
|
7439 - | self
|
7440 - | }
|
7441 - | #[allow(missing_docs)] // documentation missing in model
|
7442 - | pub(crate) fn set_min_range_byte(
|
7443 - | mut self,
|
7444 - | input: impl ::std::convert::Into<
|
7445 - | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
7446 - | >,
|
7447 - | ) -> Self {
|
7448 - | self.min_range_byte = Some(input.into());
|
7449 - | self
|
7450 - | }
|
7451 - | #[allow(missing_docs)] // documentation missing in model
|
7452 - | pub(crate) fn set_max_range_byte(
|
7453 - | mut self,
|
7454 - | input: impl ::std::convert::Into<
|
7455 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
7456 - | >,
|
7457 - | ) -> Self {
|
7458 - | self.max_range_byte = Some(input.into());
|
7459 - | self
|
7460 - | }
|
7461 - | #[allow(missing_docs)] // documentation missing in model
|
7462 - | pub(crate) fn set_fixed_value_byte(
|
7463 - | mut self,
|
7464 - | input: impl ::std::convert::Into<
|
7465 - | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
7466 - | >,
|
6486 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
7467 6487 | ) -> Self {
|
7468 - | self.fixed_value_byte = Some(input.into());
|
6488 + | self.map_of_pattern_string = input.map(|v| v.into());
|
7469 6489 | self
|
7470 6490 | }
|
7471 6491 | #[allow(missing_docs)] // documentation missing in model
|
7472 - | pub(crate) fn set_con_b_list(
|
6492 + | pub(crate) fn set_list_of_pattern_string(
|
7473 6493 | mut self,
|
7474 - | input: Option<
|
7475 - | impl ::std::convert::Into<
|
7476 - | crate::constrained::MaybeConstrained<
|
7477 - | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
7478 - | >,
|
7479 - | >,
|
7480 - | >,
|
6494 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
7481 6495 | ) -> Self {
|
7482 - | self.con_b_list = input.map(|v| v.into());
|
6496 + | self.list_of_pattern_string = input.map(|v| v.into());
|
7483 6497 | self
|
7484 6498 | }
|
7485 6499 | #[allow(missing_docs)] // documentation missing in model
|
7486 - | pub(crate) fn set_length_list(
|
6500 + | pub(crate) fn set_set_of_pattern_string(
|
7487 6501 | mut self,
|
7488 6502 | input: Option<
|
7489 6503 | impl ::std::convert::Into<
|
7490 - | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
6504 + | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
7491 6505 | >,
|
7492 6506 | >,
|
7493 6507 | ) -> Self {
|
7494 - | self.length_list = input.map(|v| v.into());
|
6508 + | self.set_of_pattern_string = input.map(|v| v.into());
|
7495 6509 | self
|
7496 6510 | }
|
7497 6511 | #[allow(missing_docs)] // documentation missing in model
|
7498 - | pub(crate) fn set_sensitive_length_list(
|
6512 + | pub(crate) fn set_length_length_pattern_string(
|
7499 6513 | mut self,
|
7500 6514 | input: Option<
|
7501 6515 | impl ::std::convert::Into<
|
7502 - | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
7503 - | >,
|
7504 - | >,
|
7505 - | ) -> Self {
|
7506 - | self.sensitive_length_list = input.map(|v| v.into());
|
7507 - | self
|
7508 - | }
|
7509 - | #[allow(missing_docs)] // documentation missing in model
|
7510 - | pub(crate) fn set_con_b_set(
|
7511 - | mut self,
|
7512 - | input: Option<
|
7513 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6516 + | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
7514 6517 | >,
|
7515 - | ) -> Self {
|
7516 - | self.con_b_set = input.map(|v| v.into());
|
7517 - | self
|
7518 - | }
|
7519 - | #[allow(missing_docs)] // documentation missing in model
|
7520 - | pub(crate) fn set_con_b_map(
|
7521 - | mut self,
|
7522 - | input: Option<
|
7523 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
7524 6518 | >,
|
7525 6519 | ) -> Self {
|
7526 - | self.con_b_map = input.map(|v| v.into());
|
6520 + | self.length_length_pattern_string = input.map(|v| v.into());
|
7527 6521 | self
|
7528 6522 | }
|
7529 6523 | #[allow(missing_docs)] // documentation missing in model
|
7530 - | pub(crate) fn set_length_map(
|
6524 + | pub(crate) fn set_map_of_length_pattern_string(
|
7531 6525 | mut self,
|
7532 - | input: Option<
|
7533 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
7534 - | >,
|
6526 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
7535 6527 | ) -> Self {
|
7536 - | self.length_map = input.map(|v| v.into());
|
6528 + | self.map_of_length_pattern_string = input.map(|v| v.into());
|
7537 6529 | self
|
7538 6530 | }
|
7539 6531 | #[allow(missing_docs)] // documentation missing in model
|
7540 - | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
6532 + | pub(crate) fn set_list_of_length_pattern_string(
|
7541 6533 | mut self,
|
7542 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
6534 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
7543 6535 | ) -> Self {
|
7544 - | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
6536 + | self.list_of_length_pattern_string = input.map(|v| v.into());
|
7545 6537 | self
|
7546 6538 | }
|
7547 6539 | #[allow(missing_docs)] // documentation missing in model
|
7548 - | pub(crate) fn set_sparse_map(
|
6540 + | pub(crate) fn set_set_of_length_pattern_string(
|
7549 6541 | mut self,
|
7550 6542 | input: Option<
|
7551 6543 | impl ::std::convert::Into<
|
7552 - | crate::constrained::MaybeConstrained<
|
7553 - | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
7554 - | >,
|
6544 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
7555 6545 | >,
|
7556 6546 | >,
|
7557 6547 | ) -> Self {
|
7558 - | self.sparse_map = input.map(|v| v.into());
|
6548 + | self.set_of_length_pattern_string = input.map(|v| v.into());
|
7559 6549 | self
|
7560 6550 | }
|
7561 6551 | #[allow(missing_docs)] // documentation missing in model
|
7562 - | pub(crate) fn set_sparse_list(
|
6552 + | pub(crate) fn set_length_list_of_pattern_string(
|
7563 6553 | mut self,
|
7564 6554 | input: Option<
|
7565 6555 | impl ::std::convert::Into<
|
7566 - | crate::constrained::MaybeConstrained<
|
7567 - | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
7568 - | >,
|
6556 + | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
7569 6557 | >,
|
7570 6558 | >,
|
7571 6559 | ) -> Self {
|
7572 - | self.sparse_list = input.map(|v| v.into());
|
6560 + | self.length_list_of_pattern_string = input.map(|v| v.into());
|
7573 6561 | self
|
7574 6562 | }
|
7575 6563 | #[allow(missing_docs)] // documentation missing in model
|
7576 - | pub(crate) fn set_sparse_length_map(
|
6564 + | pub(crate) fn set_length_set_of_pattern_string(
|
7577 6565 | mut self,
|
7578 6566 | input: Option<
|
7579 6567 | impl ::std::convert::Into<
|
7580 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
6568 + | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
7581 6569 | >,
|
7582 6570 | >,
|
7583 6571 | ) -> Self {
|
7584 - | self.sparse_length_map = input.map(|v| v.into());
|
6572 + | self.length_set_of_pattern_string = input.map(|v| v.into());
|
7585 6573 | self
|
7586 6574 | }
|
7587 - | #[allow(missing_docs)] // documentation missing in model
|
7588 - | pub(crate) fn set_sparse_length_list(
|
7589 - | mut self,
|
7590 - | input: Option<
|
7591 - | impl ::std::convert::Into<
|
7592 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
7593 - | >,
|
7594 - | >,
|
7595 - | ) -> Self {
|
7596 - | self.sparse_length_list = input.map(|v| v.into());
|
7597 - | self
|
7598 - | }
|
7599 - | /// A union with constrained members.
|
7600 - | pub(crate) fn set_constrained_union(
|
7601 - | mut self,
|
7602 - | input: Option<
|
7603 - | impl ::std::convert::Into<
|
7604 - | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
7605 - | >,
|
7606 - | >,
|
7607 - | ) -> Self {
|
7608 - | self.constrained_union = input.map(|v| v.into());
|
7609 - | self
|
7610 - | }
|
7611 - | #[allow(missing_docs)] // documentation missing in model
|
7612 - | pub(crate) fn set_enum_string(
|
7613 - | mut self,
|
7614 - | input: Option<
|
7615 - | impl ::std::convert::Into<
|
7616 - | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
7617 - | >,
|
7618 - | >,
|
7619 - | ) -> Self {
|
7620 - | self.enum_string = input.map(|v| v.into());
|
7621 - | self
|
7622 - | }
|
7623 - | #[allow(missing_docs)] // documentation missing in model
|
7624 - | pub(crate) fn set_list_of_length_string(
|
7625 - | mut self,
|
7626 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
7627 - | ) -> Self {
|
7628 - | self.list_of_length_string = input.map(|v| v.into());
|
7629 - | self
|
7630 - | }
|
7631 - | #[allow(missing_docs)] // documentation missing in model
|
7632 - | pub(crate) fn set_set_of_length_string(
|
7633 - | mut self,
|
7634 - | input: Option<
|
7635 - | impl ::std::convert::Into<
|
7636 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
7637 - | >,
|
7638 - | >,
|
7639 - | ) -> Self {
|
7640 - | self.set_of_length_string = input.map(|v| v.into());
|
7641 - | self
|
7642 - | }
|
7643 - | #[allow(missing_docs)] // documentation missing in model
|
7644 - | pub(crate) fn set_map_of_length_string(
|
7645 - | mut self,
|
7646 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
7647 - | ) -> Self {
|
7648 - | self.map_of_length_string = input.map(|v| v.into());
|
7649 - | self
|
7650 - | }
|
7651 - | #[allow(missing_docs)] // documentation missing in model
|
7652 - | pub(crate) fn set_list_of_length_blob(
|
7653 - | mut self,
|
7654 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
7655 - | ) -> Self {
|
7656 - | self.list_of_length_blob = input.map(|v| v.into());
|
7657 - | self
|
7658 - | }
|
7659 - | #[allow(missing_docs)] // documentation missing in model
|
7660 - | pub(crate) fn set_map_of_length_blob(
|
7661 - | mut self,
|
7662 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
7663 - | ) -> Self {
|
7664 - | self.map_of_length_blob = input.map(|v| v.into());
|
7665 - | self
|
7666 - | }
|
7667 - | #[allow(missing_docs)] // documentation missing in model
|
7668 - | pub(crate) fn set_list_of_range_integer(
|
7669 - | mut self,
|
7670 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
7671 - | ) -> Self {
|
7672 - | self.list_of_range_integer = input.map(|v| v.into());
|
7673 - | self
|
7674 - | }
|
7675 - | #[allow(missing_docs)] // documentation missing in model
|
7676 - | pub(crate) fn set_set_of_range_integer(
|
7677 - | mut self,
|
7678 - | input: Option<
|
7679 - | impl ::std::convert::Into<
|
7680 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
7681 - | >,
|
7682 - | >,
|
7683 - | ) -> Self {
|
7684 - | self.set_of_range_integer = input.map(|v| v.into());
|
7685 - | self
|
7686 - | }
|
7687 - | #[allow(missing_docs)] // documentation missing in model
|
7688 - | pub(crate) fn set_map_of_range_integer(
|
7689 - | mut self,
|
7690 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
7691 - | ) -> Self {
|
7692 - | self.map_of_range_integer = input.map(|v| v.into());
|
7693 - | self
|
7694 - | }
|
7695 - | #[allow(missing_docs)] // documentation missing in model
|
7696 - | pub(crate) fn set_list_of_range_short(
|
7697 - | mut self,
|
7698 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
7699 - | ) -> Self {
|
7700 - | self.list_of_range_short = input.map(|v| v.into());
|
7701 - | self
|
7702 - | }
|
7703 - | #[allow(missing_docs)] // documentation missing in model
|
7704 - | pub(crate) fn set_set_of_range_short(
|
7705 - | mut self,
|
7706 - | input: Option<
|
7707 - | impl ::std::convert::Into<
|
7708 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
7709 - | >,
|
7710 - | >,
|
7711 - | ) -> Self {
|
7712 - | self.set_of_range_short = input.map(|v| v.into());
|
7713 - | self
|
7714 - | }
|
7715 - | #[allow(missing_docs)] // documentation missing in model
|
7716 - | pub(crate) fn set_map_of_range_short(
|
7717 - | mut self,
|
7718 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
7719 - | ) -> Self {
|
7720 - | self.map_of_range_short = input.map(|v| v.into());
|
7721 - | self
|
7722 - | }
|
7723 - | #[allow(missing_docs)] // documentation missing in model
|
7724 - | pub(crate) fn set_list_of_range_long(
|
7725 - | mut self,
|
7726 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
7727 - | ) -> Self {
|
7728 - | self.list_of_range_long = input.map(|v| v.into());
|
7729 - | self
|
7730 - | }
|
7731 - | #[allow(missing_docs)] // documentation missing in model
|
7732 - | pub(crate) fn set_set_of_range_long(
|
7733 - | mut self,
|
7734 - | input: Option<
|
7735 - | impl ::std::convert::Into<
|
7736 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
7737 - | >,
|
7738 - | >,
|
7739 - | ) -> Self {
|
7740 - | self.set_of_range_long = input.map(|v| v.into());
|
7741 - | self
|
7742 - | }
|
7743 - | #[allow(missing_docs)] // documentation missing in model
|
7744 - | pub(crate) fn set_map_of_range_long(
|
7745 - | mut self,
|
7746 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
7747 - | ) -> Self {
|
7748 - | self.map_of_range_long = input.map(|v| v.into());
|
7749 - | self
|
7750 - | }
|
7751 - | #[allow(missing_docs)] // documentation missing in model
|
7752 - | pub(crate) fn set_list_of_range_byte(
|
7753 - | mut self,
|
7754 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
7755 - | ) -> Self {
|
7756 - | self.list_of_range_byte = input.map(|v| v.into());
|
7757 - | self
|
7758 - | }
|
7759 - | #[allow(missing_docs)] // documentation missing in model
|
7760 - | pub(crate) fn set_set_of_range_byte(
|
7761 - | mut self,
|
7762 - | input: Option<
|
7763 - | impl ::std::convert::Into<
|
7764 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
7765 - | >,
|
7766 - | >,
|
7767 - | ) -> Self {
|
7768 - | self.set_of_range_byte = input.map(|v| v.into());
|
7769 - | self
|
7770 - | }
|
7771 - | #[allow(missing_docs)] // documentation missing in model
|
7772 - | pub(crate) fn set_map_of_range_byte(
|
7773 - | mut self,
|
7774 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
7775 - | ) -> Self {
|
7776 - | self.map_of_range_byte = input.map(|v| v.into());
|
7777 - | self
|
7778 - | }
|
7779 - | #[allow(missing_docs)] // documentation missing in model
|
7780 - | pub(crate) fn set_non_streaming_blob(
|
7781 - | mut self,
|
7782 - | input: Option<impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>>,
|
7783 - | ) -> Self {
|
7784 - | self.non_streaming_blob = input.map(|v| v.into());
|
7785 - | self
|
7786 - | }
|
7787 - | #[allow(missing_docs)] // documentation missing in model
|
7788 - | pub(crate) fn set_pattern_string(
|
7789 - | mut self,
|
7790 - | input: Option<
|
7791 - | impl ::std::convert::Into<
|
7792 - | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
7793 - | >,
|
7794 - | >,
|
7795 - | ) -> Self {
|
7796 - | self.pattern_string = input.map(|v| v.into());
|
7797 - | self
|
7798 - | }
|
7799 - | #[allow(missing_docs)] // documentation missing in model
|
7800 - | pub(crate) fn set_map_of_pattern_string(
|
7801 - | mut self,
|
7802 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
7803 - | ) -> Self {
|
7804 - | self.map_of_pattern_string = input.map(|v| v.into());
|
7805 - | self
|
7806 - | }
|
7807 - | #[allow(missing_docs)] // documentation missing in model
|
7808 - | pub(crate) fn set_list_of_pattern_string(
|
7809 - | mut self,
|
7810 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
7811 - | ) -> Self {
|
7812 - | self.list_of_pattern_string = input.map(|v| v.into());
|
7813 - | self
|
7814 - | }
|
7815 - | #[allow(missing_docs)] // documentation missing in model
|
7816 - | pub(crate) fn set_set_of_pattern_string(
|
7817 - | mut self,
|
7818 - | input: Option<
|
7819 - | impl ::std::convert::Into<
|
7820 - | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
7821 - | >,
|
7822 - | >,
|
7823 - | ) -> Self {
|
7824 - | self.set_of_pattern_string = input.map(|v| v.into());
|
7825 - | self
|
7826 - | }
|
7827 - | #[allow(missing_docs)] // documentation missing in model
|
7828 - | pub(crate) fn set_length_length_pattern_string(
|
7829 - | mut self,
|
7830 - | input: Option<
|
7831 - | impl ::std::convert::Into<
|
7832 - | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
7833 - | >,
|
7834 - | >,
|
7835 - | ) -> Self {
|
7836 - | self.length_length_pattern_string = input.map(|v| v.into());
|
7837 - | self
|
7838 - | }
|
7839 - | #[allow(missing_docs)] // documentation missing in model
|
7840 - | pub(crate) fn set_map_of_length_pattern_string(
|
7841 - | mut self,
|
7842 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
7843 - | ) -> Self {
|
7844 - | self.map_of_length_pattern_string = input.map(|v| v.into());
|
7845 - | self
|
7846 - | }
|
7847 - | #[allow(missing_docs)] // documentation missing in model
|
7848 - | pub(crate) fn set_list_of_length_pattern_string(
|
7849 - | mut self,
|
7850 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
7851 - | ) -> Self {
|
7852 - | self.list_of_length_pattern_string = input.map(|v| v.into());
|
7853 - | self
|
7854 - | }
|
7855 - | #[allow(missing_docs)] // documentation missing in model
|
7856 - | pub(crate) fn set_set_of_length_pattern_string(
|
7857 - | mut self,
|
7858 - | input: Option<
|
7859 - | impl ::std::convert::Into<
|
7860 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
7861 - | >,
|
7862 - | >,
|
7863 - | ) -> Self {
|
7864 - | self.set_of_length_pattern_string = input.map(|v| v.into());
|
7865 - | self
|
7866 - | }
|
7867 - | #[allow(missing_docs)] // documentation missing in model
|
7868 - | pub(crate) fn set_length_list_of_pattern_string(
|
7869 - | mut self,
|
7870 - | input: Option<
|
7871 - | impl ::std::convert::Into<
|
7872 - | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
7873 - | >,
|
7874 - | >,
|
7875 - | ) -> Self {
|
7876 - | self.length_list_of_pattern_string = input.map(|v| v.into());
|
7877 - | self
|
7878 - | }
|
7879 - | #[allow(missing_docs)] // documentation missing in model
|
7880 - | pub(crate) fn set_length_set_of_pattern_string(
|
7881 - | mut self,
|
7882 - | input: Option<
|
7883 - | impl ::std::convert::Into<
|
7884 - | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
7885 - | >,
|
7886 - | >,
|
7887 - | ) -> Self {
|
7888 - | self.length_set_of_pattern_string = input.map(|v| v.into());
|
7889 - | self
|
7890 - | }
|
7891 - | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
7892 - | ///
|
7893 - | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
7894 - | ///
|
7895 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
7896 - | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
7897 - | self.build_enforcing_all_constraints()
|
6575 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
6576 + | ///
|
6577 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
6578 + | ///
|
6579 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6580 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
6581 + | self.build_enforcing_all_constraints()
|
7898 6582 | }
|
7899 6583 | fn build_enforcing_all_constraints(
|
7900 6584 | self,
|
7901 6585 | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
7902 6586 | Ok(crate::model::ConA {
|
7903 6587 | con_b: self
|
7904 6588 | .con_b
|
7905 6589 | .map(|v| match v {
|
7906 6590 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7907 6591 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8418 7102 | list_of_range_byte: self
|
8419 7103 | .list_of_range_byte
|
8420 7104 | .map(|v| match v {
|
8421 7105 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8422 7106 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8423 7107 | })
|
8424 7108 | .map(|res| {
|
8425 7109 | res.map(|v| v.into())
|
8426 7110 | .map_err(ConstraintViolation::ListOfRangeByte)
|
8427 7111 | })
|
8428 - | .transpose()?,
|
8429 - | set_of_range_byte: self
|
8430 - | .set_of_range_byte
|
7112 + | .transpose()?,
|
7113 + | set_of_range_byte: self
|
7114 + | .set_of_range_byte
|
7115 + | .map(|v| match v {
|
7116 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7117 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7118 + | })
|
7119 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeByte))
|
7120 + | .transpose()?
|
7121 + | .map(|v: crate::model::SetOfRangeByte| v.into()),
|
7122 + | map_of_range_byte: self
|
7123 + | .map_of_range_byte
|
7124 + | .map(|v| match v {
|
7125 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7126 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7127 + | })
|
7128 + | .map(|res| {
|
7129 + | res.map(|v| v.into())
|
7130 + | .map_err(ConstraintViolation::MapOfRangeByte)
|
7131 + | })
|
7132 + | .transpose()?,
|
7133 + | non_streaming_blob: self.non_streaming_blob,
|
7134 + | pattern_string: self
|
7135 + | .pattern_string
|
7136 + | .map(|v| match v {
|
7137 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7138 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7139 + | })
|
7140 + | .map(|res| res.map_err(ConstraintViolation::PatternString))
|
7141 + | .transpose()?
|
7142 + | .map(|v: crate::model::PatternString| v.into()),
|
7143 + | map_of_pattern_string: self
|
7144 + | .map_of_pattern_string
|
7145 + | .map(|v| match v {
|
7146 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7147 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7148 + | })
|
7149 + | .map(|res| {
|
7150 + | res.map(|v| v.into())
|
7151 + | .map_err(ConstraintViolation::MapOfPatternString)
|
7152 + | })
|
7153 + | .transpose()?,
|
7154 + | list_of_pattern_string: self
|
7155 + | .list_of_pattern_string
|
7156 + | .map(|v| match v {
|
7157 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7158 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7159 + | })
|
7160 + | .map(|res| {
|
7161 + | res.map(|v| v.into())
|
7162 + | .map_err(ConstraintViolation::ListOfPatternString)
|
7163 + | })
|
7164 + | .transpose()?,
|
7165 + | set_of_pattern_string: self
|
7166 + | .set_of_pattern_string
|
7167 + | .map(|v| match v {
|
7168 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7169 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7170 + | })
|
7171 + | .map(|res| res.map_err(ConstraintViolation::SetOfPatternString))
|
7172 + | .transpose()?
|
7173 + | .map(|v: crate::model::SetOfPatternString| v.into()),
|
7174 + | length_length_pattern_string: self
|
7175 + | .length_length_pattern_string
|
7176 + | .map(|v| match v {
|
7177 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7178 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7179 + | })
|
7180 + | .map(|res| res.map_err(ConstraintViolation::LengthLengthPatternString))
|
7181 + | .transpose()?
|
7182 + | .map(|v: crate::model::LengthPatternString| v.into()),
|
7183 + | map_of_length_pattern_string: self
|
7184 + | .map_of_length_pattern_string
|
7185 + | .map(|v| match v {
|
7186 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7187 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7188 + | })
|
7189 + | .map(|res| {
|
7190 + | res.map(|v| v.into())
|
7191 + | .map_err(ConstraintViolation::MapOfLengthPatternString)
|
7192 + | })
|
7193 + | .transpose()?,
|
7194 + | list_of_length_pattern_string: self
|
7195 + | .list_of_length_pattern_string
|
7196 + | .map(|v| match v {
|
7197 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7198 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7199 + | })
|
7200 + | .map(|res| {
|
7201 + | res.map(|v| v.into())
|
7202 + | .map_err(ConstraintViolation::ListOfLengthPatternString)
|
7203 + | })
|
7204 + | .transpose()?,
|
7205 + | set_of_length_pattern_string: self
|
7206 + | .set_of_length_pattern_string
|
7207 + | .map(|v| match v {
|
7208 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7209 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7210 + | })
|
7211 + | .map(|res| res.map_err(ConstraintViolation::SetOfLengthPatternString))
|
7212 + | .transpose()?
|
7213 + | .map(|v: crate::model::SetOfLengthPatternString| v.into()),
|
7214 + | length_list_of_pattern_string: self
|
7215 + | .length_list_of_pattern_string
|
8431 7216 | .map(|v| match v {
|
8432 7217 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8433 7218 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8434 7219 | })
|
8435 - | .map(|res| res.map_err(ConstraintViolation::SetOfRangeByte))
|
7220 + | .map(|res| res.map_err(ConstraintViolation::LengthListOfPatternString))
|
8436 7221 | .transpose()?
|
8437 - | .map(|v: crate::model::SetOfRangeByte| v.into()),
|
8438 - | map_of_range_byte: self
|
8439 - | .map_of_range_byte
|
7222 + | .map(|v: crate::model::LengthListOfPatternString| v.into()),
|
7223 + | length_set_of_pattern_string: self
|
7224 + | .length_set_of_pattern_string
|
8440 7225 | .map(|v| match v {
|
8441 7226 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8442 7227 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8443 7228 | })
|
8444 - | .map(|res| {
|
8445 - | res.map(|v| v.into())
|
8446 - | .map_err(ConstraintViolation::MapOfRangeByte)
|
7229 + | .map(|res| res.map_err(ConstraintViolation::LengthSetOfPatternString))
|
7230 + | .transpose()?
|
7231 + | .map(|v: crate::model::LengthSetOfPatternString| v.into()),
|
8447 7232 | })
|
8448 - | .transpose()?,
|
7233 + | }
|
7234 + | }
|
7235 + | }
|
7236 + | /// See [`ConA`](crate::model::ConA).
|
7237 + | pub mod con_a {
|
7238 + |
|
7239 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7240 + | /// Holds one variant for each of the ways the builder can fail.
|
7241 + | #[allow(clippy::enum_variant_names)]
|
7242 + | pub enum ConstraintViolation {
|
7243 + | /// `con_b` was not provided but it is required when building `ConA`.
|
7244 + | MissingConB,
|
7245 + | }
|
7246 + | impl ::std::fmt::Display for ConstraintViolation {
|
7247 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7248 + | match self {
|
7249 + | ConstraintViolation::MissingConB => write!(
|
7250 + | f,
|
7251 + | "`con_b` was not provided but it is required when building `ConA`"
|
7252 + | ),
|
7253 + | }
|
7254 + | }
|
7255 + | }
|
7256 + | impl ::std::error::Error for ConstraintViolation {}
|
7257 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
7258 + | type Error = ConstraintViolation;
|
7259 + |
|
7260 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7261 + | builder.build()
|
7262 + | }
|
7263 + | }
|
7264 + | /// A builder for [`ConA`](crate::model::ConA).
|
7265 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7266 + | pub struct Builder {
|
7267 + | pub(crate) con_b: ::std::option::Option<crate::model::ConB>,
|
7268 + | pub(crate) opt_con_b: ::std::option::Option<crate::model::ConB>,
|
7269 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
7270 + | pub(crate) min_length_string: ::std::option::Option<::std::string::String>,
|
7271 + | pub(crate) max_length_string: ::std::option::Option<::std::string::String>,
|
7272 + | pub(crate) fixed_length_string: ::std::option::Option<::std::string::String>,
|
7273 + | pub(crate) length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7274 + | pub(crate) min_length_blob:
|
7275 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7276 + | pub(crate) max_length_blob:
|
7277 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7278 + | pub(crate) fixed_length_blob:
|
7279 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7280 + | pub(crate) range_integer: ::std::option::Option<i32>,
|
7281 + | pub(crate) min_range_integer: ::std::option::Option<i32>,
|
7282 + | pub(crate) max_range_integer: ::std::option::Option<i32>,
|
7283 + | pub(crate) fixed_value_integer: ::std::option::Option<i32>,
|
7284 + | pub(crate) range_short: ::std::option::Option<i16>,
|
7285 + | pub(crate) min_range_short: ::std::option::Option<i16>,
|
7286 + | pub(crate) max_range_short: ::std::option::Option<i16>,
|
7287 + | pub(crate) fixed_value_short: ::std::option::Option<i16>,
|
7288 + | pub(crate) range_long: ::std::option::Option<i64>,
|
7289 + | pub(crate) min_range_long: ::std::option::Option<i64>,
|
7290 + | pub(crate) max_range_long: ::std::option::Option<i64>,
|
7291 + | pub(crate) fixed_value_long: ::std::option::Option<i64>,
|
7292 + | pub(crate) range_byte: ::std::option::Option<i8>,
|
7293 + | pub(crate) min_range_byte: ::std::option::Option<i8>,
|
7294 + | pub(crate) max_range_byte: ::std::option::Option<i8>,
|
7295 + | pub(crate) fixed_value_byte: ::std::option::Option<i8>,
|
7296 + | pub(crate) con_b_list:
|
7297 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7298 + | pub(crate) length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7299 + | pub(crate) sensitive_length_list:
|
7300 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7301 + | pub(crate) con_b_set:
|
7302 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7303 + | pub(crate) con_b_map: ::std::option::Option<
|
7304 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7305 + | >,
|
7306 + | pub(crate) length_map: ::std::option::Option<
|
7307 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7308 + | >,
|
7309 + | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
7310 + | ::std::collections::HashMap<
|
7311 + | ::std::string::String,
|
7312 + | ::std::collections::HashMap<
|
7313 + | ::std::string::String,
|
7314 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7315 + | >,
|
7316 + | >,
|
7317 + | >,
|
7318 + | pub(crate) sparse_map: ::std::option::Option<
|
7319 + | ::std::collections::HashMap<
|
7320 + | ::std::string::String,
|
7321 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7322 + | >,
|
7323 + | >,
|
7324 + | pub(crate) sparse_list:
|
7325 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7326 + | pub(crate) sparse_length_map: ::std::option::Option<
|
7327 + | ::std::collections::HashMap<
|
7328 + | ::std::string::String,
|
7329 + | ::std::option::Option<::std::string::String>,
|
7330 + | >,
|
7331 + | >,
|
7332 + | pub(crate) sparse_length_list:
|
7333 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7334 + | pub(crate) constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7335 + | pub(crate) enum_string: ::std::option::Option<crate::model::EnumString>,
|
7336 + | pub(crate) list_of_length_string:
|
7337 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7338 + | pub(crate) set_of_length_string:
|
7339 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7340 + | pub(crate) map_of_length_string: ::std::option::Option<
|
7341 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7342 + | >,
|
7343 + | pub(crate) list_of_length_blob:
|
7344 + | ::std::option::Option<::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>>,
|
7345 + | pub(crate) map_of_length_blob: ::std::option::Option<
|
7346 + | ::std::collections::HashMap<
|
7347 + | ::std::string::String,
|
7348 + | ::aws_smithy_http_server_python::types::Blob,
|
7349 + | >,
|
7350 + | >,
|
7351 + | pub(crate) list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7352 + | pub(crate) set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7353 + | pub(crate) map_of_range_integer:
|
7354 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
7355 + | pub(crate) list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7356 + | pub(crate) set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7357 + | pub(crate) map_of_range_short:
|
7358 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
7359 + | pub(crate) list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7360 + | pub(crate) set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7361 + | pub(crate) map_of_range_long:
|
7362 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
7363 + | pub(crate) list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7364 + | pub(crate) set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7365 + | pub(crate) map_of_range_byte:
|
7366 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
7367 + | pub(crate) non_streaming_blob:
|
7368 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7369 + | pub(crate) pattern_string: ::std::option::Option<::std::string::String>,
|
7370 + | pub(crate) map_of_pattern_string: ::std::option::Option<
|
7371 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7372 + | >,
|
7373 + | pub(crate) list_of_pattern_string:
|
7374 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7375 + | pub(crate) set_of_pattern_string:
|
7376 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7377 + | pub(crate) length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
7378 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<
|
7379 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7380 + | >,
|
7381 + | pub(crate) list_of_length_pattern_string:
|
7382 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7383 + | pub(crate) set_of_length_pattern_string:
|
7384 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7385 + | pub(crate) length_list_of_pattern_string:
|
7386 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7387 + | pub(crate) length_set_of_pattern_string:
|
7388 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7389 + | }
|
7390 + | impl Builder {
|
7391 + | #[allow(missing_docs)] // documentation missing in model
|
7392 + | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
7393 + | self.con_b = Some(input);
|
7394 + | self
|
7395 + | }
|
7396 + | #[allow(missing_docs)] // documentation missing in model
|
7397 + | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
7398 + | self.opt_con_b = input;
|
7399 + | self
|
7400 + | }
|
7401 + | #[allow(missing_docs)] // documentation missing in model
|
7402 + | pub fn length_string(
|
7403 + | mut self,
|
7404 + | input: ::std::option::Option<::std::string::String>,
|
7405 + | ) -> Self {
|
7406 + | self.length_string = input;
|
7407 + | self
|
7408 + | }
|
7409 + | #[allow(missing_docs)] // documentation missing in model
|
7410 + | pub fn min_length_string(
|
7411 + | mut self,
|
7412 + | input: ::std::option::Option<::std::string::String>,
|
7413 + | ) -> Self {
|
7414 + | self.min_length_string = input;
|
7415 + | self
|
7416 + | }
|
7417 + | #[allow(missing_docs)] // documentation missing in model
|
7418 + | pub fn max_length_string(
|
7419 + | mut self,
|
7420 + | input: ::std::option::Option<::std::string::String>,
|
7421 + | ) -> Self {
|
7422 + | self.max_length_string = input;
|
7423 + | self
|
7424 + | }
|
7425 + | #[allow(missing_docs)] // documentation missing in model
|
7426 + | pub fn fixed_length_string(
|
7427 + | mut self,
|
7428 + | input: ::std::option::Option<::std::string::String>,
|
7429 + | ) -> Self {
|
7430 + | self.fixed_length_string = input;
|
7431 + | self
|
7432 + | }
|
7433 + | #[allow(missing_docs)] // documentation missing in model
|
7434 + | pub fn length_blob(
|
7435 + | mut self,
|
7436 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7437 + | ) -> Self {
|
7438 + | self.length_blob = input;
|
7439 + | self
|
7440 + | }
|
7441 + | #[allow(missing_docs)] // documentation missing in model
|
7442 + | pub fn min_length_blob(
|
7443 + | mut self,
|
7444 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7445 + | ) -> Self {
|
7446 + | self.min_length_blob = input;
|
7447 + | self
|
7448 + | }
|
7449 + | #[allow(missing_docs)] // documentation missing in model
|
7450 + | pub fn max_length_blob(
|
7451 + | mut self,
|
7452 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7453 + | ) -> Self {
|
7454 + | self.max_length_blob = input;
|
7455 + | self
|
7456 + | }
|
7457 + | #[allow(missing_docs)] // documentation missing in model
|
7458 + | pub fn fixed_length_blob(
|
7459 + | mut self,
|
7460 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7461 + | ) -> Self {
|
7462 + | self.fixed_length_blob = input;
|
7463 + | self
|
7464 + | }
|
7465 + | #[allow(missing_docs)] // documentation missing in model
|
7466 + | pub fn range_integer(mut self, input: i32) -> Self {
|
7467 + | self.range_integer = Some(input);
|
7468 + | self
|
7469 + | }
|
7470 + | #[allow(missing_docs)] // documentation missing in model
|
7471 + | pub fn min_range_integer(mut self, input: i32) -> Self {
|
7472 + | self.min_range_integer = Some(input);
|
7473 + | self
|
7474 + | }
|
7475 + | #[allow(missing_docs)] // documentation missing in model
|
7476 + | pub fn max_range_integer(mut self, input: i32) -> Self {
|
7477 + | self.max_range_integer = Some(input);
|
7478 + | self
|
7479 + | }
|
7480 + | #[allow(missing_docs)] // documentation missing in model
|
7481 + | pub fn fixed_value_integer(mut self, input: i32) -> Self {
|
7482 + | self.fixed_value_integer = Some(input);
|
7483 + | self
|
7484 + | }
|
7485 + | #[allow(missing_docs)] // documentation missing in model
|
7486 + | pub fn range_short(mut self, input: i16) -> Self {
|
7487 + | self.range_short = Some(input);
|
7488 + | self
|
7489 + | }
|
7490 + | #[allow(missing_docs)] // documentation missing in model
|
7491 + | pub fn min_range_short(mut self, input: i16) -> Self {
|
7492 + | self.min_range_short = Some(input);
|
7493 + | self
|
7494 + | }
|
7495 + | #[allow(missing_docs)] // documentation missing in model
|
7496 + | pub fn max_range_short(mut self, input: i16) -> Self {
|
7497 + | self.max_range_short = Some(input);
|
7498 + | self
|
7499 + | }
|
7500 + | #[allow(missing_docs)] // documentation missing in model
|
7501 + | pub fn fixed_value_short(mut self, input: i16) -> Self {
|
7502 + | self.fixed_value_short = Some(input);
|
7503 + | self
|
7504 + | }
|
7505 + | #[allow(missing_docs)] // documentation missing in model
|
7506 + | pub fn range_long(mut self, input: i64) -> Self {
|
7507 + | self.range_long = Some(input);
|
7508 + | self
|
7509 + | }
|
7510 + | #[allow(missing_docs)] // documentation missing in model
|
7511 + | pub fn min_range_long(mut self, input: i64) -> Self {
|
7512 + | self.min_range_long = Some(input);
|
7513 + | self
|
7514 + | }
|
7515 + | #[allow(missing_docs)] // documentation missing in model
|
7516 + | pub fn max_range_long(mut self, input: i64) -> Self {
|
7517 + | self.max_range_long = Some(input);
|
7518 + | self
|
7519 + | }
|
7520 + | #[allow(missing_docs)] // documentation missing in model
|
7521 + | pub fn fixed_value_long(mut self, input: i64) -> Self {
|
7522 + | self.fixed_value_long = Some(input);
|
7523 + | self
|
7524 + | }
|
7525 + | #[allow(missing_docs)] // documentation missing in model
|
7526 + | pub fn range_byte(mut self, input: i8) -> Self {
|
7527 + | self.range_byte = Some(input);
|
7528 + | self
|
7529 + | }
|
7530 + | #[allow(missing_docs)] // documentation missing in model
|
7531 + | pub fn min_range_byte(mut self, input: i8) -> Self {
|
7532 + | self.min_range_byte = Some(input);
|
7533 + | self
|
7534 + | }
|
7535 + | #[allow(missing_docs)] // documentation missing in model
|
7536 + | pub fn max_range_byte(mut self, input: i8) -> Self {
|
7537 + | self.max_range_byte = Some(input);
|
7538 + | self
|
7539 + | }
|
7540 + | #[allow(missing_docs)] // documentation missing in model
|
7541 + | pub fn fixed_value_byte(mut self, input: i8) -> Self {
|
7542 + | self.fixed_value_byte = Some(input);
|
7543 + | self
|
7544 + | }
|
7545 + | #[allow(missing_docs)] // documentation missing in model
|
7546 + | pub fn con_b_list(
|
7547 + | mut self,
|
7548 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7549 + | ) -> Self {
|
7550 + | self.con_b_list = input;
|
7551 + | self
|
7552 + | }
|
7553 + | #[allow(missing_docs)] // documentation missing in model
|
7554 + | pub fn length_list(
|
7555 + | mut self,
|
7556 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7557 + | ) -> Self {
|
7558 + | self.length_list = input;
|
7559 + | self
|
7560 + | }
|
7561 + | #[allow(missing_docs)] // documentation missing in model
|
7562 + | pub fn sensitive_length_list(
|
7563 + | mut self,
|
7564 + | input: ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7565 + | ) -> Self {
|
7566 + | self.sensitive_length_list = input;
|
7567 + | self
|
7568 + | }
|
7569 + | #[allow(missing_docs)] // documentation missing in model
|
7570 + | pub fn con_b_set(
|
7571 + | mut self,
|
7572 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7573 + | ) -> Self {
|
7574 + | self.con_b_set = input;
|
7575 + | self
|
7576 + | }
|
7577 + | #[allow(missing_docs)] // documentation missing in model
|
7578 + | pub fn con_b_map(
|
7579 + | mut self,
|
7580 + | input: ::std::option::Option<
|
7581 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7582 + | >,
|
7583 + | ) -> Self {
|
7584 + | self.con_b_map = input;
|
7585 + | self
|
7586 + | }
|
7587 + | #[allow(missing_docs)] // documentation missing in model
|
7588 + | pub fn length_map(
|
7589 + | mut self,
|
7590 + | input: ::std::option::Option<
|
7591 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7592 + | >,
|
7593 + | ) -> Self {
|
7594 + | self.length_map = input;
|
7595 + | self
|
7596 + | }
|
7597 + | #[allow(missing_docs)] // documentation missing in model
|
7598 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
7599 + | mut self,
|
7600 + | input: ::std::option::Option<
|
7601 + | ::std::collections::HashMap<
|
7602 + | ::std::string::String,
|
7603 + | ::std::collections::HashMap<
|
7604 + | ::std::string::String,
|
7605 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7606 + | >,
|
7607 + | >,
|
7608 + | >,
|
7609 + | ) -> Self {
|
7610 + | self.map_of_map_of_list_of_list_of_con_b = input;
|
7611 + | self
|
7612 + | }
|
7613 + | #[allow(missing_docs)] // documentation missing in model
|
7614 + | pub fn sparse_map(
|
7615 + | mut self,
|
7616 + | input: ::std::option::Option<
|
7617 + | ::std::collections::HashMap<
|
7618 + | ::std::string::String,
|
7619 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7620 + | >,
|
7621 + | >,
|
7622 + | ) -> Self {
|
7623 + | self.sparse_map = input;
|
7624 + | self
|
7625 + | }
|
7626 + | #[allow(missing_docs)] // documentation missing in model
|
7627 + | pub fn sparse_list(
|
7628 + | mut self,
|
7629 + | input: ::std::option::Option<
|
7630 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7631 + | >,
|
7632 + | ) -> Self {
|
7633 + | self.sparse_list = input;
|
7634 + | self
|
7635 + | }
|
7636 + | #[allow(missing_docs)] // documentation missing in model
|
7637 + | pub fn sparse_length_map(
|
7638 + | mut self,
|
7639 + | input: ::std::option::Option<
|
7640 + | ::std::collections::HashMap<
|
7641 + | ::std::string::String,
|
7642 + | ::std::option::Option<::std::string::String>,
|
7643 + | >,
|
7644 + | >,
|
7645 + | ) -> Self {
|
7646 + | self.sparse_length_map = input;
|
7647 + | self
|
7648 + | }
|
7649 + | #[allow(missing_docs)] // documentation missing in model
|
7650 + | pub fn sparse_length_list(
|
7651 + | mut self,
|
7652 + | input: ::std::option::Option<
|
7653 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7654 + | >,
|
7655 + | ) -> Self {
|
7656 + | self.sparse_length_list = input;
|
7657 + | self
|
7658 + | }
|
7659 + | /// A union with constrained members.
|
7660 + | pub fn constrained_union(
|
7661 + | mut self,
|
7662 + | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7663 + | ) -> Self {
|
7664 + | self.constrained_union = input;
|
7665 + | self
|
7666 + | }
|
7667 + | #[allow(missing_docs)] // documentation missing in model
|
7668 + | pub fn enum_string(
|
7669 + | mut self,
|
7670 + | input: ::std::option::Option<crate::model::EnumString>,
|
7671 + | ) -> Self {
|
7672 + | self.enum_string = input;
|
7673 + | self
|
7674 + | }
|
7675 + | #[allow(missing_docs)] // documentation missing in model
|
7676 + | pub fn list_of_length_string(
|
7677 + | mut self,
|
7678 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7679 + | ) -> Self {
|
7680 + | self.list_of_length_string = input;
|
7681 + | self
|
7682 + | }
|
7683 + | #[allow(missing_docs)] // documentation missing in model
|
7684 + | pub fn set_of_length_string(
|
7685 + | mut self,
|
7686 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7687 + | ) -> Self {
|
7688 + | self.set_of_length_string = input;
|
7689 + | self
|
7690 + | }
|
7691 + | #[allow(missing_docs)] // documentation missing in model
|
7692 + | pub fn map_of_length_string(
|
7693 + | mut self,
|
7694 + | input: ::std::option::Option<
|
7695 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7696 + | >,
|
7697 + | ) -> Self {
|
7698 + | self.map_of_length_string = input;
|
7699 + | self
|
7700 + | }
|
7701 + | #[allow(missing_docs)] // documentation missing in model
|
7702 + | pub fn list_of_length_blob(
|
7703 + | mut self,
|
7704 + | input: ::std::option::Option<
|
7705 + | ::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>,
|
7706 + | >,
|
7707 + | ) -> Self {
|
7708 + | self.list_of_length_blob = input;
|
7709 + | self
|
7710 + | }
|
7711 + | #[allow(missing_docs)] // documentation missing in model
|
7712 + | pub fn map_of_length_blob(
|
7713 + | mut self,
|
7714 + | input: ::std::option::Option<
|
7715 + | ::std::collections::HashMap<
|
7716 + | ::std::string::String,
|
7717 + | ::aws_smithy_http_server_python::types::Blob,
|
7718 + | >,
|
7719 + | >,
|
7720 + | ) -> Self {
|
7721 + | self.map_of_length_blob = input;
|
7722 + | self
|
7723 + | }
|
7724 + | #[allow(missing_docs)] // documentation missing in model
|
7725 + | pub fn list_of_range_integer(
|
7726 + | mut self,
|
7727 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
7728 + | ) -> Self {
|
7729 + | self.list_of_range_integer = input;
|
7730 + | self
|
7731 + | }
|
7732 + | #[allow(missing_docs)] // documentation missing in model
|
7733 + | pub fn set_of_range_integer(
|
7734 + | mut self,
|
7735 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
7736 + | ) -> Self {
|
7737 + | self.set_of_range_integer = input;
|
7738 + | self
|
7739 + | }
|
7740 + | #[allow(missing_docs)] // documentation missing in model
|
7741 + | pub fn map_of_range_integer(
|
7742 + | mut self,
|
7743 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
7744 + | ) -> Self {
|
7745 + | self.map_of_range_integer = input;
|
7746 + | self
|
7747 + | }
|
7748 + | #[allow(missing_docs)] // documentation missing in model
|
7749 + | pub fn list_of_range_short(
|
7750 + | mut self,
|
7751 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
7752 + | ) -> Self {
|
7753 + | self.list_of_range_short = input;
|
7754 + | self
|
7755 + | }
|
7756 + | #[allow(missing_docs)] // documentation missing in model
|
7757 + | pub fn set_of_range_short(
|
7758 + | mut self,
|
7759 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
7760 + | ) -> Self {
|
7761 + | self.set_of_range_short = input;
|
7762 + | self
|
7763 + | }
|
7764 + | #[allow(missing_docs)] // documentation missing in model
|
7765 + | pub fn map_of_range_short(
|
7766 + | mut self,
|
7767 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
7768 + | ) -> Self {
|
7769 + | self.map_of_range_short = input;
|
7770 + | self
|
7771 + | }
|
7772 + | #[allow(missing_docs)] // documentation missing in model
|
7773 + | pub fn list_of_range_long(
|
7774 + | mut self,
|
7775 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
7776 + | ) -> Self {
|
7777 + | self.list_of_range_long = input;
|
7778 + | self
|
7779 + | }
|
7780 + | #[allow(missing_docs)] // documentation missing in model
|
7781 + | pub fn set_of_range_long(
|
7782 + | mut self,
|
7783 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
7784 + | ) -> Self {
|
7785 + | self.set_of_range_long = input;
|
7786 + | self
|
7787 + | }
|
7788 + | #[allow(missing_docs)] // documentation missing in model
|
7789 + | pub fn map_of_range_long(
|
7790 + | mut self,
|
7791 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
7792 + | ) -> Self {
|
7793 + | self.map_of_range_long = input;
|
7794 + | self
|
7795 + | }
|
7796 + | #[allow(missing_docs)] // documentation missing in model
|
7797 + | pub fn list_of_range_byte(
|
7798 + | mut self,
|
7799 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
7800 + | ) -> Self {
|
7801 + | self.list_of_range_byte = input;
|
7802 + | self
|
7803 + | }
|
7804 + | #[allow(missing_docs)] // documentation missing in model
|
7805 + | pub fn set_of_range_byte(
|
7806 + | mut self,
|
7807 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
7808 + | ) -> Self {
|
7809 + | self.set_of_range_byte = input;
|
7810 + | self
|
7811 + | }
|
7812 + | #[allow(missing_docs)] // documentation missing in model
|
7813 + | pub fn map_of_range_byte(
|
7814 + | mut self,
|
7815 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
7816 + | ) -> Self {
|
7817 + | self.map_of_range_byte = input;
|
7818 + | self
|
7819 + | }
|
7820 + | #[allow(missing_docs)] // documentation missing in model
|
7821 + | pub fn non_streaming_blob(
|
7822 + | mut self,
|
7823 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
7824 + | ) -> Self {
|
7825 + | self.non_streaming_blob = input;
|
7826 + | self
|
7827 + | }
|
7828 + | #[allow(missing_docs)] // documentation missing in model
|
7829 + | pub fn pattern_string(
|
7830 + | mut self,
|
7831 + | input: ::std::option::Option<::std::string::String>,
|
7832 + | ) -> Self {
|
7833 + | self.pattern_string = input;
|
7834 + | self
|
7835 + | }
|
7836 + | #[allow(missing_docs)] // documentation missing in model
|
7837 + | pub fn map_of_pattern_string(
|
7838 + | mut self,
|
7839 + | input: ::std::option::Option<
|
7840 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7841 + | >,
|
7842 + | ) -> Self {
|
7843 + | self.map_of_pattern_string = input;
|
7844 + | self
|
7845 + | }
|
7846 + | #[allow(missing_docs)] // documentation missing in model
|
7847 + | pub fn list_of_pattern_string(
|
7848 + | mut self,
|
7849 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7850 + | ) -> Self {
|
7851 + | self.list_of_pattern_string = input;
|
7852 + | self
|
7853 + | }
|
7854 + | #[allow(missing_docs)] // documentation missing in model
|
7855 + | pub fn set_of_pattern_string(
|
7856 + | mut self,
|
7857 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7858 + | ) -> Self {
|
7859 + | self.set_of_pattern_string = input;
|
7860 + | self
|
7861 + | }
|
7862 + | #[allow(missing_docs)] // documentation missing in model
|
7863 + | pub fn length_length_pattern_string(
|
7864 + | mut self,
|
7865 + | input: ::std::option::Option<::std::string::String>,
|
7866 + | ) -> Self {
|
7867 + | self.length_length_pattern_string = input;
|
7868 + | self
|
7869 + | }
|
7870 + | #[allow(missing_docs)] // documentation missing in model
|
7871 + | pub fn map_of_length_pattern_string(
|
7872 + | mut self,
|
7873 + | input: ::std::option::Option<
|
7874 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7875 + | >,
|
7876 + | ) -> Self {
|
7877 + | self.map_of_length_pattern_string = input;
|
7878 + | self
|
7879 + | }
|
7880 + | #[allow(missing_docs)] // documentation missing in model
|
7881 + | pub fn list_of_length_pattern_string(
|
7882 + | mut self,
|
7883 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7884 + | ) -> Self {
|
7885 + | self.list_of_length_pattern_string = input;
|
7886 + | self
|
7887 + | }
|
7888 + | #[allow(missing_docs)] // documentation missing in model
|
7889 + | pub fn set_of_length_pattern_string(
|
7890 + | mut self,
|
7891 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7892 + | ) -> Self {
|
7893 + | self.set_of_length_pattern_string = input;
|
7894 + | self
|
7895 + | }
|
7896 + | #[allow(missing_docs)] // documentation missing in model
|
7897 + | pub fn length_list_of_pattern_string(
|
7898 + | mut self,
|
7899 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7900 + | ) -> Self {
|
7901 + | self.length_list_of_pattern_string = input;
|
7902 + | self
|
7903 + | }
|
7904 + | #[allow(missing_docs)] // documentation missing in model
|
7905 + | pub fn length_set_of_pattern_string(
|
7906 + | mut self,
|
7907 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7908 + | ) -> Self {
|
7909 + | self.length_set_of_pattern_string = input;
|
7910 + | self
|
7911 + | }
|
7912 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
7913 + | ///
|
7914 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if you do not provide a value for all non-`Option`al members.
|
7915 + | ///
|
7916 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
7917 + | self.build_enforcing_required_and_enum_traits()
|
7918 + | }
|
7919 + | fn build_enforcing_required_and_enum_traits(
|
7920 + | self,
|
7921 + | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
7922 + | Ok(crate::model::ConA {
|
7923 + | con_b: self.con_b.ok_or(ConstraintViolation::MissingConB)?,
|
7924 + | opt_con_b: self.opt_con_b,
|
7925 + | length_string: self.length_string,
|
7926 + | min_length_string: self.min_length_string,
|
7927 + | max_length_string: self.max_length_string,
|
7928 + | fixed_length_string: self.fixed_length_string,
|
7929 + | length_blob: self.length_blob,
|
7930 + | min_length_blob: self.min_length_blob,
|
7931 + | max_length_blob: self.max_length_blob,
|
7932 + | fixed_length_blob: self.fixed_length_blob,
|
7933 + | range_integer: self.range_integer.unwrap_or(0i32),
|
7934 + | min_range_integer: self.min_range_integer.unwrap_or(0i32),
|
7935 + | max_range_integer: self.max_range_integer.unwrap_or(0i32),
|
7936 + | fixed_value_integer: self.fixed_value_integer.unwrap_or(0i32),
|
7937 + | range_short: self.range_short.unwrap_or(0i16),
|
7938 + | min_range_short: self.min_range_short.unwrap_or(0i16),
|
7939 + | max_range_short: self.max_range_short.unwrap_or(0i16),
|
7940 + | fixed_value_short: self.fixed_value_short.unwrap_or(0i16),
|
7941 + | range_long: self.range_long.unwrap_or(0i64),
|
7942 + | min_range_long: self.min_range_long.unwrap_or(0i64),
|
7943 + | max_range_long: self.max_range_long.unwrap_or(0i64),
|
7944 + | fixed_value_long: self.fixed_value_long.unwrap_or(0i64),
|
7945 + | range_byte: self.range_byte.unwrap_or(0i8),
|
7946 + | min_range_byte: self.min_range_byte.unwrap_or(0i8),
|
7947 + | max_range_byte: self.max_range_byte.unwrap_or(0i8),
|
7948 + | fixed_value_byte: self.fixed_value_byte.unwrap_or(0i8),
|
7949 + | con_b_list: self.con_b_list,
|
7950 + | length_list: self.length_list,
|
7951 + | sensitive_length_list: self.sensitive_length_list,
|
7952 + | con_b_set: self.con_b_set,
|
7953 + | con_b_map: self.con_b_map,
|
7954 + | length_map: self.length_map,
|
7955 + | map_of_map_of_list_of_list_of_con_b: self.map_of_map_of_list_of_list_of_con_b,
|
7956 + | sparse_map: self.sparse_map,
|
7957 + | sparse_list: self.sparse_list,
|
7958 + | sparse_length_map: self.sparse_length_map,
|
7959 + | sparse_length_list: self.sparse_length_list,
|
7960 + | constrained_union: self.constrained_union,
|
7961 + | enum_string: self.enum_string,
|
7962 + | list_of_length_string: self.list_of_length_string,
|
7963 + | set_of_length_string: self.set_of_length_string,
|
7964 + | map_of_length_string: self.map_of_length_string,
|
7965 + | list_of_length_blob: self.list_of_length_blob,
|
7966 + | map_of_length_blob: self.map_of_length_blob,
|
7967 + | list_of_range_integer: self.list_of_range_integer,
|
7968 + | set_of_range_integer: self.set_of_range_integer,
|
7969 + | map_of_range_integer: self.map_of_range_integer,
|
7970 + | list_of_range_short: self.list_of_range_short,
|
7971 + | set_of_range_short: self.set_of_range_short,
|
7972 + | map_of_range_short: self.map_of_range_short,
|
7973 + | list_of_range_long: self.list_of_range_long,
|
7974 + | set_of_range_long: self.set_of_range_long,
|
7975 + | map_of_range_long: self.map_of_range_long,
|
7976 + | list_of_range_byte: self.list_of_range_byte,
|
7977 + | set_of_range_byte: self.set_of_range_byte,
|
7978 + | map_of_range_byte: self.map_of_range_byte,
|
8449 7979 | non_streaming_blob: self.non_streaming_blob,
|
8450 - | pattern_string: self
|
8451 - | .pattern_string
|
8452 - | .map(|v| match v {
|
8453 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8454 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8455 - | })
|
8456 - | .map(|res| res.map_err(ConstraintViolation::PatternString))
|
8457 - | .transpose()?
|
8458 - | .map(|v: crate::model::PatternString| v.into()),
|
8459 - | map_of_pattern_string: self
|
8460 - | .map_of_pattern_string
|
8461 - | .map(|v| match v {
|
8462 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8463 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8464 - | })
|
8465 - | .map(|res| {
|
8466 - | res.map(|v| v.into())
|
8467 - | .map_err(ConstraintViolation::MapOfPatternString)
|
8468 - | })
|
8469 - | .transpose()?,
|
8470 - | list_of_pattern_string: self
|
8471 - | .list_of_pattern_string
|
8472 - | .map(|v| match v {
|
8473 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8474 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8475 - | })
|
8476 - | .map(|res| {
|
8477 - | res.map(|v| v.into())
|
8478 - | .map_err(ConstraintViolation::ListOfPatternString)
|
8479 - | })
|
8480 - | .transpose()?,
|
8481 - | set_of_pattern_string: self
|
8482 - | .set_of_pattern_string
|
8483 - | .map(|v| match v {
|
8484 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8485 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8486 - | })
|
8487 - | .map(|res| res.map_err(ConstraintViolation::SetOfPatternString))
|
8488 - | .transpose()?
|
8489 - | .map(|v: crate::model::SetOfPatternString| v.into()),
|
8490 - | length_length_pattern_string: self
|
8491 - | .length_length_pattern_string
|
8492 - | .map(|v| match v {
|
8493 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8494 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8495 - | })
|
8496 - | .map(|res| res.map_err(ConstraintViolation::LengthLengthPatternString))
|
8497 - | .transpose()?
|
8498 - | .map(|v: crate::model::LengthPatternString| v.into()),
|
8499 - | map_of_length_pattern_string: self
|
8500 - | .map_of_length_pattern_string
|
8501 - | .map(|v| match v {
|
8502 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8503 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8504 - | })
|
8505 - | .map(|res| {
|
8506 - | res.map(|v| v.into())
|
8507 - | .map_err(ConstraintViolation::MapOfLengthPatternString)
|
7980 + | pattern_string: self.pattern_string,
|
7981 + | map_of_pattern_string: self.map_of_pattern_string,
|
7982 + | list_of_pattern_string: self.list_of_pattern_string,
|
7983 + | set_of_pattern_string: self.set_of_pattern_string,
|
7984 + | length_length_pattern_string: self.length_length_pattern_string,
|
7985 + | map_of_length_pattern_string: self.map_of_length_pattern_string,
|
7986 + | list_of_length_pattern_string: self.list_of_length_pattern_string,
|
7987 + | set_of_length_pattern_string: self.set_of_length_pattern_string,
|
7988 + | length_list_of_pattern_string: self.length_list_of_pattern_string,
|
7989 + | length_set_of_pattern_string: self.length_set_of_pattern_string,
|
8508 7990 | })
|
8509 - | .transpose()?,
|
8510 - | list_of_length_pattern_string: self
|
8511 - | .list_of_length_pattern_string
|
8512 - | .map(|v| match v {
|
8513 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8514 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7991 + | }
|
7992 + | }
|
7993 + | }
|
7994 + | pub(crate) mod constrained_list_in_output_internal {
|
7995 + |
|
7996 + | #[allow(clippy::enum_variant_names)]
|
7997 + | #[derive(Debug, PartialEq)]
|
7998 + | pub(crate) enum ConstraintViolation {
|
7999 + | /// Constraint violation error when the list doesn't have the required length
|
8000 + | Length(usize),
|
8001 + | }
|
8002 + |
|
8003 + | impl ::std::fmt::Display for ConstraintViolation {
|
8004 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8005 + | let message = match self {
|
8006 + | Self::Length(length) => {
|
8007 + | 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)
|
8008 + | }
|
8009 + | };
|
8010 + | write!(f, "{message}")
|
8011 + | }
|
8012 + | }
|
8013 + |
|
8014 + | impl ::std::error::Error for ConstraintViolation {}
|
8015 + | }
|
8016 + | pub(crate) mod constrained_map_in_output_internal {
|
8017 + |
|
8018 + | #[allow(clippy::enum_variant_names)]
|
8019 + | #[derive(Debug, PartialEq)]
|
8020 + | pub(crate) enum ConstraintViolation {
|
8021 + | Length(usize),
|
8022 + | }
|
8023 + |
|
8024 + | impl ::std::fmt::Display for ConstraintViolation {
|
8025 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8026 + | match self {
|
8027 + | Self::Length(length) => {
|
8028 + | 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)
|
8029 + | }
|
8030 + | }
|
8031 + | }
|
8032 + | }
|
8033 + |
|
8034 + | impl ::std::error::Error for ConstraintViolation {}
|
8035 + | }
|
8036 + | pub(crate) mod length_string_internal {
|
8037 + |
|
8038 + | #[derive(Debug, PartialEq)]
|
8039 + | pub enum ConstraintViolation {
|
8040 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8041 + | Length(usize),
|
8042 + | }
|
8043 + |
|
8044 + | impl ::std::fmt::Display for ConstraintViolation {
|
8045 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8046 + | let message = match self {
|
8047 + | Self::Length(length) => {
|
8048 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
8049 + | }
|
8050 + | };
|
8051 + | write!(f, "{message}")
|
8052 + | }
|
8053 + | }
|
8054 + |
|
8055 + | impl ::std::error::Error for ConstraintViolation {}
|
8056 + | impl ConstraintViolation {
|
8057 + | pub(crate) fn as_validation_exception_field(
|
8058 + | self,
|
8059 + | path: ::std::string::String,
|
8060 + | ) -> crate::model::ValidationExceptionField {
|
8061 + | match self {
|
8062 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8063 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
8064 + | path,
|
8065 + | },
|
8066 + | }
|
8067 + | }
|
8068 + | }
|
8069 + | }
|
8070 + | pub(crate) mod range_integer_internal {
|
8071 + |
|
8072 + | #[derive(Debug, PartialEq)]
|
8073 + | pub enum ConstraintViolation {
|
8074 + | Range(i32),
|
8075 + | }
|
8076 + |
|
8077 + | impl ::std::fmt::Display for ConstraintViolation {
|
8078 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8079 + | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
8080 + | }
|
8081 + | }
|
8082 + |
|
8083 + | impl ::std::error::Error for ConstraintViolation {}
|
8084 + | impl ConstraintViolation {
|
8085 + | pub(crate) fn as_validation_exception_field(
|
8086 + | self,
|
8087 + | path: ::std::string::String,
|
8088 + | ) -> crate::model::ValidationExceptionField {
|
8089 + | match self {
|
8090 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8091 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
8092 + | path,
|
8093 + | },
|
8094 + | }
|
8095 + | }
|
8096 + | }
|
8097 + | }
|
8098 + | pub(crate) mod range_short_internal {
|
8099 + |
|
8100 + | #[derive(Debug, PartialEq)]
|
8101 + | pub enum ConstraintViolation {
|
8102 + | Range(i16),
|
8103 + | }
|
8104 + |
|
8105 + | impl ::std::fmt::Display for ConstraintViolation {
|
8106 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8107 + | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8108 + | }
|
8109 + | }
|
8110 + |
|
8111 + | impl ::std::error::Error for ConstraintViolation {}
|
8112 + | impl ConstraintViolation {
|
8113 + | pub(crate) fn as_validation_exception_field(
|
8114 + | self,
|
8115 + | path: ::std::string::String,
|
8116 + | ) -> crate::model::ValidationExceptionField {
|
8117 + | match self {
|
8118 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8119 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8120 + | path,
|
8121 + | },
|
8122 + | }
|
8123 + | }
|
8124 + | }
|
8125 + | }
|
8126 + | pub(crate) mod range_long_internal {
|
8127 + |
|
8128 + | #[derive(Debug, PartialEq)]
|
8129 + | pub enum ConstraintViolation {
|
8130 + | Range(i64),
|
8131 + | }
|
8132 + |
|
8133 + | impl ::std::fmt::Display for ConstraintViolation {
|
8134 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8135 + | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8136 + | }
|
8137 + | }
|
8138 + |
|
8139 + | impl ::std::error::Error for ConstraintViolation {}
|
8140 + | impl ConstraintViolation {
|
8141 + | pub(crate) fn as_validation_exception_field(
|
8142 + | self,
|
8143 + | path: ::std::string::String,
|
8144 + | ) -> crate::model::ValidationExceptionField {
|
8145 + | match self {
|
8146 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8147 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8148 + | path,
|
8149 + | },
|
8150 + | }
|
8151 + | }
|
8152 + | }
|
8153 + | }
|
8154 + | pub(crate) mod range_byte_internal {
|
8155 + |
|
8156 + | #[derive(Debug, PartialEq)]
|
8157 + | pub enum ConstraintViolation {
|
8158 + | Range(i8),
|
8159 + | }
|
8160 + |
|
8161 + | impl ::std::fmt::Display for ConstraintViolation {
|
8162 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8163 + | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8164 + | }
|
8165 + | }
|
8166 + |
|
8167 + | impl ::std::error::Error for ConstraintViolation {}
|
8168 + | impl ConstraintViolation {
|
8169 + | pub(crate) fn as_validation_exception_field(
|
8170 + | self,
|
8171 + | path: ::std::string::String,
|
8172 + | ) -> crate::model::ValidationExceptionField {
|
8173 + | match self {
|
8174 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8175 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8176 + | path,
|
8177 + | },
|
8178 + | }
|
8179 + | }
|
8180 + | }
|
8181 + | }
|
8182 + | pub(crate) mod map_of_length_string_internal {
|
8183 + |
|
8184 + | #[allow(clippy::enum_variant_names)]
|
8185 + | #[derive(Debug, PartialEq)]
|
8186 + | pub(crate) enum ConstraintViolation {
|
8187 + | #[doc(hidden)]
|
8188 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
8189 + | #[doc(hidden)]
|
8190 + | Value(
|
8191 + | crate::model::LengthString,
|
8192 + | crate::model::length_string_internal::ConstraintViolation,
|
8193 + | ),
|
8194 + | }
|
8195 + |
|
8196 + | impl ::std::fmt::Display for ConstraintViolation {
|
8197 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8198 + | match self {
|
8199 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8200 + | Self::Value(_, value_constraint_violation) => {
|
8201 + | write!(f, "{}", value_constraint_violation)
|
8202 + | }
|
8203 + | }
|
8204 + | }
|
8205 + | }
|
8206 + |
|
8207 + | impl ::std::error::Error for ConstraintViolation {}
|
8208 + | impl ConstraintViolation {
|
8209 + | pub(crate) fn as_validation_exception_field(
|
8210 + | self,
|
8211 + | path: ::std::string::String,
|
8212 + | ) -> crate::model::ValidationExceptionField {
|
8213 + | match self {
|
8214 + | Self::Key(key_constraint_violation) => {
|
8215 + | key_constraint_violation.as_validation_exception_field(path)
|
8216 + | }
|
8217 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8218 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8219 + | }
|
8220 + | }
|
8221 + | }
|
8222 + | }
|
8223 + | pub(crate) mod set_of_length_string_internal {
|
8224 + |
|
8225 + | #[allow(clippy::enum_variant_names)]
|
8226 + | #[derive(Debug, PartialEq)]
|
8227 + | pub(crate) enum ConstraintViolation {
|
8228 + | /// Constraint violation error when the list does not contain unique items
|
8229 + | UniqueItems {
|
8230 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8231 + | /// at least two elements.
|
8232 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8233 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8234 + | /// Nothing is guaranteed about the order of the indices.
|
8235 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8236 + | /// The original vector, that contains duplicate items.
|
8237 + | original: ::std::vec::Vec<crate::model::LengthString>,
|
8238 + | },
|
8239 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8240 + | /// The first component of the tuple is the index in the collection where the
|
8241 + | /// first constraint violation was found.
|
8242 + | #[doc(hidden)]
|
8243 + | Member(
|
8244 + | usize,
|
8245 + | crate::model::length_string_internal::ConstraintViolation,
|
8246 + | ),
|
8247 + | }
|
8248 + |
|
8249 + | impl ::std::fmt::Display for ConstraintViolation {
|
8250 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8251 + | let message = match self {
|
8252 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8253 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8254 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8255 + | failing_member)
|
8256 + | };
|
8257 + | write!(f, "{message}")
|
8258 + | }
|
8259 + | }
|
8260 + |
|
8261 + | impl ::std::error::Error for ConstraintViolation {}
|
8262 + | impl ConstraintViolation {
|
8263 + | pub(crate) fn as_validation_exception_field(
|
8264 + | self,
|
8265 + | path: ::std::string::String,
|
8266 + | ) -> crate::model::ValidationExceptionField {
|
8267 + | match self {
|
8268 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8269 + | crate::model::ValidationExceptionField {
|
8270 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8271 + | path,
|
8272 + | },
|
8273 + | Self::Member(index, member_constraint_violation) =>
|
8274 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8275 + | }
|
8276 + | }
|
8277 + | }
|
8278 + | }
|
8279 + | pub(crate) mod list_of_length_string_internal {
|
8280 + |
|
8281 + | #[allow(clippy::enum_variant_names)]
|
8282 + | #[derive(Debug, PartialEq)]
|
8283 + | pub(crate) enum ConstraintViolation {
|
8284 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8285 + | /// The first component of the tuple is the index in the collection where the
|
8286 + | /// first constraint violation was found.
|
8287 + | #[doc(hidden)]
|
8288 + | Member(
|
8289 + | usize,
|
8290 + | crate::model::length_string_internal::ConstraintViolation,
|
8291 + | ),
|
8292 + | }
|
8293 + |
|
8294 + | impl ::std::fmt::Display for ConstraintViolation {
|
8295 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8296 + | let message = match self {
|
8297 + | Self::Member(index, failing_member) => format!(
|
8298 + | "Value at index {index} failed to satisfy constraint. {}",
|
8299 + | failing_member
|
8300 + | ),
|
8301 + | };
|
8302 + | write!(f, "{message}")
|
8303 + | }
|
8304 + | }
|
8305 + |
|
8306 + | impl ::std::error::Error for ConstraintViolation {}
|
8307 + | impl ConstraintViolation {
|
8308 + | pub(crate) fn as_validation_exception_field(
|
8309 + | self,
|
8310 + | path: ::std::string::String,
|
8311 + | ) -> crate::model::ValidationExceptionField {
|
8312 + | match self {
|
8313 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8314 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8315 + | }
|
8316 + | }
|
8317 + | }
|
8318 + | }
|
8319 + | pub(crate) mod length_list_of_pattern_string_internal {
|
8320 + |
|
8321 + | #[allow(clippy::enum_variant_names)]
|
8322 + | #[derive(Debug, PartialEq)]
|
8323 + | pub(crate) enum ConstraintViolation {
|
8324 + | /// Constraint violation error when the list doesn't have the required length
|
8325 + | Length(usize),
|
8326 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8327 + | /// The first component of the tuple is the index in the collection where the
|
8328 + | /// first constraint violation was found.
|
8329 + | #[doc(hidden)]
|
8330 + | Member(
|
8331 + | usize,
|
8332 + | crate::model::pattern_string_internal::ConstraintViolation,
|
8333 + | ),
|
8334 + | }
|
8335 + |
|
8336 + | impl ::std::fmt::Display for ConstraintViolation {
|
8337 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8338 + | let message = match self {
|
8339 + | Self::Length(length) => {
|
8340 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
8341 + | }
|
8342 + | Self::Member(index, failing_member) => format!(
|
8343 + | "Value at index {index} failed to satisfy constraint. {}",
|
8344 + | failing_member
|
8345 + | ),
|
8346 + | };
|
8347 + | write!(f, "{message}")
|
8348 + | }
|
8349 + | }
|
8350 + |
|
8351 + | impl ::std::error::Error for ConstraintViolation {}
|
8352 + | impl ConstraintViolation {
|
8353 + | pub(crate) fn as_validation_exception_field(
|
8354 + | self,
|
8355 + | path: ::std::string::String,
|
8356 + | ) -> crate::model::ValidationExceptionField {
|
8357 + | match self {
|
8358 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8359 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
8360 + | path,
|
8361 + | },
|
8362 + | Self::Member(index, member_constraint_violation) =>
|
8363 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8364 + | }
|
8365 + | }
|
8366 + | }
|
8367 + | }
|
8368 + | pub(crate) mod length_set_of_pattern_string_internal {
|
8369 + |
|
8370 + | #[allow(clippy::enum_variant_names)]
|
8371 + | #[derive(Debug, PartialEq)]
|
8372 + | pub(crate) enum ConstraintViolation {
|
8373 + | /// Constraint violation error when the list doesn't have the required length
|
8374 + | Length(usize),
|
8375 + | /// Constraint violation error when the list does not contain unique items
|
8376 + | UniqueItems {
|
8377 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8378 + | /// at least two elements.
|
8379 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8380 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8381 + | /// Nothing is guaranteed about the order of the indices.
|
8382 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8383 + | /// The original vector, that contains duplicate items.
|
8384 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
8385 + | },
|
8386 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8387 + | /// The first component of the tuple is the index in the collection where the
|
8388 + | /// first constraint violation was found.
|
8389 + | #[doc(hidden)]
|
8390 + | Member(
|
8391 + | usize,
|
8392 + | crate::model::pattern_string_internal::ConstraintViolation,
|
8393 + | ),
|
8394 + | }
|
8395 + |
|
8396 + | impl ::std::fmt::Display for ConstraintViolation {
|
8397 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8398 + | let message = match self {
|
8399 + | Self::Length(length) => {
|
8400 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
8401 + | },
|
8402 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8403 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8404 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8405 + | failing_member)
|
8406 + | };
|
8407 + | write!(f, "{message}")
|
8408 + | }
|
8409 + | }
|
8410 + |
|
8411 + | impl ::std::error::Error for ConstraintViolation {}
|
8412 + | impl ConstraintViolation {
|
8413 + | pub(crate) fn as_validation_exception_field(
|
8414 + | self,
|
8415 + | path: ::std::string::String,
|
8416 + | ) -> crate::model::ValidationExceptionField {
|
8417 + | match self {
|
8418 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8419 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
8420 + | path,
|
8421 + | },
|
8422 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8423 + | crate::model::ValidationExceptionField {
|
8424 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8425 + | path,
|
8426 + | },
|
8427 + | Self::Member(index, member_constraint_violation) =>
|
8428 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8429 + | }
|
8430 + | }
|
8431 + | }
|
8432 + | }
|
8433 + | pub(crate) mod set_of_range_byte_internal {
|
8434 + |
|
8435 + | #[allow(clippy::enum_variant_names)]
|
8436 + | #[derive(Debug, PartialEq)]
|
8437 + | pub(crate) enum ConstraintViolation {
|
8438 + | /// Constraint violation error when the list does not contain unique items
|
8439 + | UniqueItems {
|
8440 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8441 + | /// at least two elements.
|
8442 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8443 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8444 + | /// Nothing is guaranteed about the order of the indices.
|
8445 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8446 + | /// The original vector, that contains duplicate items.
|
8447 + | original: ::std::vec::Vec<crate::model::RangeByte>,
|
8448 + | },
|
8449 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8450 + | /// The first component of the tuple is the index in the collection where the
|
8451 + | /// first constraint violation was found.
|
8452 + | #[doc(hidden)]
|
8453 + | Member(
|
8454 + | usize,
|
8455 + | crate::model::range_byte_internal::ConstraintViolation,
|
8456 + | ),
|
8457 + | }
|
8458 + |
|
8459 + | impl ::std::fmt::Display for ConstraintViolation {
|
8460 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8461 + | let message = match self {
|
8462 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8463 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8464 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8465 + | failing_member)
|
8466 + | };
|
8467 + | write!(f, "{message}")
|
8468 + | }
|
8469 + | }
|
8470 + |
|
8471 + | impl ::std::error::Error for ConstraintViolation {}
|
8472 + | impl ConstraintViolation {
|
8473 + | pub(crate) fn as_validation_exception_field(
|
8474 + | self,
|
8475 + | path: ::std::string::String,
|
8476 + | ) -> crate::model::ValidationExceptionField {
|
8477 + | match self {
|
8478 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8479 + | crate::model::ValidationExceptionField {
|
8480 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8481 + | path,
|
8482 + | },
|
8483 + | Self::Member(index, member_constraint_violation) =>
|
8484 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8485 + | }
|
8486 + | }
|
8487 + | }
|
8488 + | }
|
8489 + | pub(crate) mod set_of_range_short_internal {
|
8490 + |
|
8491 + | #[allow(clippy::enum_variant_names)]
|
8492 + | #[derive(Debug, PartialEq)]
|
8493 + | pub(crate) enum ConstraintViolation {
|
8494 + | /// Constraint violation error when the list does not contain unique items
|
8495 + | UniqueItems {
|
8496 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8497 + | /// at least two elements.
|
8498 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8499 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8500 + | /// Nothing is guaranteed about the order of the indices.
|
8501 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8502 + | /// The original vector, that contains duplicate items.
|
8503 + | original: ::std::vec::Vec<crate::model::RangeShort>,
|
8504 + | },
|
8505 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8506 + | /// The first component of the tuple is the index in the collection where the
|
8507 + | /// first constraint violation was found.
|
8508 + | #[doc(hidden)]
|
8509 + | Member(
|
8510 + | usize,
|
8511 + | crate::model::range_short_internal::ConstraintViolation,
|
8512 + | ),
|
8513 + | }
|
8514 + |
|
8515 + | impl ::std::fmt::Display for ConstraintViolation {
|
8516 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8517 + | let message = match self {
|
8518 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8519 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8520 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8521 + | failing_member)
|
8522 + | };
|
8523 + | write!(f, "{message}")
|
8524 + | }
|
8525 + | }
|
8526 + |
|
8527 + | impl ::std::error::Error for ConstraintViolation {}
|
8528 + | impl ConstraintViolation {
|
8529 + | pub(crate) fn as_validation_exception_field(
|
8530 + | self,
|
8531 + | path: ::std::string::String,
|
8532 + | ) -> crate::model::ValidationExceptionField {
|
8533 + | match self {
|
8534 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8535 + | crate::model::ValidationExceptionField {
|
8536 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8537 + | path,
|
8538 + | },
|
8539 + | Self::Member(index, member_constraint_violation) =>
|
8540 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8541 + | }
|
8542 + | }
|
8543 + | }
|
8544 + | }
|
8545 + | pub(crate) mod set_of_range_integer_internal {
|
8546 + |
|
8547 + | #[allow(clippy::enum_variant_names)]
|
8548 + | #[derive(Debug, PartialEq)]
|
8549 + | pub(crate) enum ConstraintViolation {
|
8550 + | /// Constraint violation error when the list does not contain unique items
|
8551 + | UniqueItems {
|
8552 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8553 + | /// at least two elements.
|
8554 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8555 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8556 + | /// Nothing is guaranteed about the order of the indices.
|
8557 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8558 + | /// The original vector, that contains duplicate items.
|
8559 + | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
8560 + | },
|
8561 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8562 + | /// The first component of the tuple is the index in the collection where the
|
8563 + | /// first constraint violation was found.
|
8564 + | #[doc(hidden)]
|
8565 + | Member(
|
8566 + | usize,
|
8567 + | crate::model::range_integer_internal::ConstraintViolation,
|
8568 + | ),
|
8569 + | }
|
8570 + |
|
8571 + | impl ::std::fmt::Display for ConstraintViolation {
|
8572 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8573 + | let message = match self {
|
8574 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8575 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8576 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8577 + | failing_member)
|
8578 + | };
|
8579 + | write!(f, "{message}")
|
8580 + | }
|
8581 + | }
|
8582 + |
|
8583 + | impl ::std::error::Error for ConstraintViolation {}
|
8584 + | impl ConstraintViolation {
|
8585 + | pub(crate) fn as_validation_exception_field(
|
8586 + | self,
|
8587 + | path: ::std::string::String,
|
8588 + | ) -> crate::model::ValidationExceptionField {
|
8589 + | match self {
|
8590 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8591 + | crate::model::ValidationExceptionField {
|
8592 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8593 + | path,
|
8594 + | },
|
8595 + | Self::Member(index, member_constraint_violation) =>
|
8596 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8597 + | }
|
8598 + | }
|
8599 + | }
|
8600 + | }
|
8601 + | pub(crate) mod set_of_range_long_internal {
|
8602 + |
|
8603 + | #[allow(clippy::enum_variant_names)]
|
8604 + | #[derive(Debug, PartialEq)]
|
8605 + | pub(crate) enum ConstraintViolation {
|
8606 + | /// Constraint violation error when the list does not contain unique items
|
8607 + | UniqueItems {
|
8608 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8609 + | /// at least two elements.
|
8610 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8611 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8612 + | /// Nothing is guaranteed about the order of the indices.
|
8613 + | duplicate_indices: ::std::vec::Vec<usize>,
|
8614 + | /// The original vector, that contains duplicate items.
|
8615 + | original: ::std::vec::Vec<crate::model::RangeLong>,
|
8616 + | },
|
8617 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8618 + | /// The first component of the tuple is the index in the collection where the
|
8619 + | /// first constraint violation was found.
|
8620 + | #[doc(hidden)]
|
8621 + | Member(
|
8622 + | usize,
|
8623 + | crate::model::range_long_internal::ConstraintViolation,
|
8624 + | ),
|
8625 + | }
|
8626 + |
|
8627 + | impl ::std::fmt::Display for ConstraintViolation {
|
8628 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8629 + | let message = match self {
|
8630 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8631 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8632 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8633 + | failing_member)
|
8634 + | };
|
8635 + | write!(f, "{message}")
|
8636 + | }
|
8637 + | }
|
8638 + |
|
8639 + | impl ::std::error::Error for ConstraintViolation {}
|
8640 + | impl ConstraintViolation {
|
8641 + | pub(crate) fn as_validation_exception_field(
|
8642 + | self,
|
8643 + | path: ::std::string::String,
|
8644 + | ) -> crate::model::ValidationExceptionField {
|
8645 + | match self {
|
8646 + | Self::UniqueItems { duplicate_indices, .. } =>
|
8647 + | crate::model::ValidationExceptionField {
|
8648 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8649 + | path,
|
8650 + | },
|
8651 + | Self::Member(index, member_constraint_violation) =>
|
8652 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8653 + | }
|
8654 + | }
|
8655 + | }
|
8656 + | }
|
8657 + | pub(crate) mod list_of_range_byte_internal {
|
8658 + |
|
8659 + | #[allow(clippy::enum_variant_names)]
|
8660 + | #[derive(Debug, PartialEq)]
|
8661 + | pub(crate) enum ConstraintViolation {
|
8662 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8663 + | /// The first component of the tuple is the index in the collection where the
|
8664 + | /// first constraint violation was found.
|
8665 + | #[doc(hidden)]
|
8666 + | Member(
|
8667 + | usize,
|
8668 + | crate::model::range_byte_internal::ConstraintViolation,
|
8669 + | ),
|
8670 + | }
|
8671 + |
|
8672 + | impl ::std::fmt::Display for ConstraintViolation {
|
8673 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8674 + | let message = match self {
|
8675 + | Self::Member(index, failing_member) => format!(
|
8676 + | "Value at index {index} failed to satisfy constraint. {}",
|
8677 + | failing_member
|
8678 + | ),
|
8679 + | };
|
8680 + | write!(f, "{message}")
|
8681 + | }
|
8682 + | }
|
8683 + |
|
8684 + | impl ::std::error::Error for ConstraintViolation {}
|
8685 + | impl ConstraintViolation {
|
8686 + | pub(crate) fn as_validation_exception_field(
|
8687 + | self,
|
8688 + | path: ::std::string::String,
|
8689 + | ) -> crate::model::ValidationExceptionField {
|
8690 + | match self {
|
8691 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8692 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8693 + | }
|
8694 + | }
|
8695 + | }
|
8696 + | }
|
8697 + | pub(crate) mod list_of_range_short_internal {
|
8698 + |
|
8699 + | #[allow(clippy::enum_variant_names)]
|
8700 + | #[derive(Debug, PartialEq)]
|
8701 + | pub(crate) enum ConstraintViolation {
|
8702 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8703 + | /// The first component of the tuple is the index in the collection where the
|
8704 + | /// first constraint violation was found.
|
8705 + | #[doc(hidden)]
|
8706 + | Member(
|
8707 + | usize,
|
8708 + | crate::model::range_short_internal::ConstraintViolation,
|
8709 + | ),
|
8710 + | }
|
8711 + |
|
8712 + | impl ::std::fmt::Display for ConstraintViolation {
|
8713 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8714 + | let message = match self {
|
8715 + | Self::Member(index, failing_member) => format!(
|
8716 + | "Value at index {index} failed to satisfy constraint. {}",
|
8717 + | failing_member
|
8718 + | ),
|
8719 + | };
|
8720 + | write!(f, "{message}")
|
8721 + | }
|
8722 + | }
|
8723 + |
|
8724 + | impl ::std::error::Error for ConstraintViolation {}
|
8725 + | impl ConstraintViolation {
|
8726 + | pub(crate) fn as_validation_exception_field(
|
8727 + | self,
|
8728 + | path: ::std::string::String,
|
8729 + | ) -> crate::model::ValidationExceptionField {
|
8730 + | match self {
|
8731 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8732 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8733 + | }
|
8734 + | }
|
8735 + | }
|
8736 + | }
|
8737 + | pub(crate) mod list_of_range_integer_internal {
|
8738 + |
|
8739 + | #[allow(clippy::enum_variant_names)]
|
8740 + | #[derive(Debug, PartialEq)]
|
8741 + | pub(crate) enum ConstraintViolation {
|
8742 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8743 + | /// The first component of the tuple is the index in the collection where the
|
8744 + | /// first constraint violation was found.
|
8745 + | #[doc(hidden)]
|
8746 + | Member(
|
8747 + | usize,
|
8748 + | crate::model::range_integer_internal::ConstraintViolation,
|
8749 + | ),
|
8750 + | }
|
8751 + |
|
8752 + | impl ::std::fmt::Display for ConstraintViolation {
|
8753 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8754 + | let message = match self {
|
8755 + | Self::Member(index, failing_member) => format!(
|
8756 + | "Value at index {index} failed to satisfy constraint. {}",
|
8757 + | failing_member
|
8758 + | ),
|
8759 + | };
|
8760 + | write!(f, "{message}")
|
8761 + | }
|
8762 + | }
|
8763 + |
|
8764 + | impl ::std::error::Error for ConstraintViolation {}
|
8765 + | impl ConstraintViolation {
|
8766 + | pub(crate) fn as_validation_exception_field(
|
8767 + | self,
|
8768 + | path: ::std::string::String,
|
8769 + | ) -> crate::model::ValidationExceptionField {
|
8770 + | match self {
|
8771 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8772 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8773 + | }
|
8774 + | }
|
8775 + | }
|
8776 + | }
|
8777 + | pub(crate) mod list_of_range_long_internal {
|
8778 + |
|
8779 + | #[allow(clippy::enum_variant_names)]
|
8780 + | #[derive(Debug, PartialEq)]
|
8781 + | pub(crate) enum ConstraintViolation {
|
8782 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8783 + | /// The first component of the tuple is the index in the collection where the
|
8784 + | /// first constraint violation was found.
|
8785 + | #[doc(hidden)]
|
8786 + | Member(
|
8787 + | usize,
|
8788 + | crate::model::range_long_internal::ConstraintViolation,
|
8789 + | ),
|
8790 + | }
|
8791 + |
|
8792 + | impl ::std::fmt::Display for ConstraintViolation {
|
8793 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8794 + | let message = match self {
|
8795 + | Self::Member(index, failing_member) => format!(
|
8796 + | "Value at index {index} failed to satisfy constraint. {}",
|
8797 + | failing_member
|
8798 + | ),
|
8799 + | };
|
8800 + | write!(f, "{message}")
|
8801 + | }
|
8802 + | }
|
8803 + |
|
8804 + | impl ::std::error::Error for ConstraintViolation {}
|
8805 + | impl ConstraintViolation {
|
8806 + | pub(crate) fn as_validation_exception_field(
|
8807 + | self,
|
8808 + | path: ::std::string::String,
|
8809 + | ) -> crate::model::ValidationExceptionField {
|
8810 + | match self {
|
8811 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8812 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8813 + | }
|
8814 + | }
|
8815 + | }
|
8816 + | }
|
8817 + | pub(crate) mod list_of_enum_string_internal {
|
8818 + |
|
8819 + | #[allow(clippy::enum_variant_names)]
|
8820 + | #[derive(Debug, PartialEq)]
|
8821 + | pub(crate) enum ConstraintViolation {
|
8822 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8823 + | /// The first component of the tuple is the index in the collection where the
|
8824 + | /// first constraint violation was found.
|
8825 + | #[doc(hidden)]
|
8826 + | Member(
|
8827 + | usize,
|
8828 + | crate::model::enum_string_internal::ConstraintViolation,
|
8829 + | ),
|
8830 + | }
|
8831 + |
|
8832 + | impl ::std::fmt::Display for ConstraintViolation {
|
8833 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8834 + | let message = match self {
|
8835 + | Self::Member(index, failing_member) => format!(
|
8836 + | "Value at index {index} failed to satisfy constraint. {}",
|
8837 + | failing_member
|
8838 + | ),
|
8839 + | };
|
8840 + | write!(f, "{message}")
|
8841 + | }
|
8842 + | }
|
8843 + |
|
8844 + | impl ::std::error::Error for ConstraintViolation {}
|
8845 + | impl ConstraintViolation {
|
8846 + | pub(crate) fn as_validation_exception_field(
|
8847 + | self,
|
8848 + | path: ::std::string::String,
|
8849 + | ) -> crate::model::ValidationExceptionField {
|
8850 + | match self {
|
8851 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8852 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8853 + | }
|
8854 + | }
|
8855 + | }
|
8856 + | }
|
8857 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
8858 + | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
8859 + |
|
8860 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8861 + | /// Holds one variant for each of the ways the builder can fail.
|
8862 + | #[non_exhaustive]
|
8863 + | #[allow(clippy::enum_variant_names)]
|
8864 + | pub(crate) enum ConstraintViolation {
|
8865 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
8866 + | MissingRecursiveMember,
|
8867 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
8868 + | #[doc(hidden)]
|
8869 + | RecursiveMember(
|
8870 + | ::std::boxed::Box<
|
8871 + | crate::model::recursive_shapes_input_output_nested2_internal::ConstraintViolation,
|
8872 + | >,
|
8873 + | ),
|
8874 + | }
|
8875 + | impl ::std::fmt::Display for ConstraintViolation {
|
8876 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8877 + | match self {
|
8878 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
8879 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
8880 + | }
|
8881 + | }
|
8882 + | }
|
8883 + | impl ::std::error::Error for ConstraintViolation {}
|
8884 + | impl ConstraintViolation {
|
8885 + | pub(crate) fn as_validation_exception_field(
|
8886 + | self,
|
8887 + | path: ::std::string::String,
|
8888 + | ) -> crate::model::ValidationExceptionField {
|
8889 + | match self {
|
8890 + | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
8891 + | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
8892 + | path: path + "/recursiveMember",
|
8893 + | },
|
8894 + | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
8895 + | }
|
8896 + | }
|
8897 + | }
|
8898 + | impl ::std::convert::From<Builder>
|
8899 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
8900 + | {
|
8901 + | fn from(builder: Builder) -> Self {
|
8902 + | Self::Unconstrained(builder)
|
8903 + | }
|
8904 + | }
|
8905 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
8906 + | type Error = ConstraintViolation;
|
8907 + |
|
8908 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8909 + | builder.build()
|
8910 + | }
|
8911 + | }
|
8912 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
8913 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8914 + | pub(crate) struct Builder {
|
8915 + | pub(crate) recursive_member: ::std::option::Option<
|
8916 + | ::std::boxed::Box<
|
8917 + | crate::constrained::MaybeConstrained<
|
8918 + | crate::model::RecursiveShapesInputOutputNested2,
|
8919 + | >,
|
8920 + | >,
|
8921 + | >,
|
8922 + | }
|
8923 + | impl Builder {
|
8924 + | #[allow(missing_docs)] // documentation missing in model
|
8925 + | pub(crate) fn set_recursive_member(
|
8926 + | mut self,
|
8927 + | input: impl ::std::convert::Into<
|
8928 + | ::std::boxed::Box<
|
8929 + | crate::constrained::MaybeConstrained<
|
8930 + | crate::model::RecursiveShapesInputOutputNested2,
|
8931 + | >,
|
8932 + | >,
|
8933 + | >,
|
8934 + | ) -> Self {
|
8935 + | self.recursive_member = Some(input.into());
|
8936 + | self
|
8937 + | }
|
8938 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
8939 + | ///
|
8940 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
8941 + | ///
|
8942 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
8943 + | pub fn build(
|
8944 + | self,
|
8945 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
8946 + | self.build_enforcing_all_constraints()
|
8947 + | }
|
8948 + | fn build_enforcing_all_constraints(
|
8949 + | self,
|
8950 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
8951 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
8952 + | recursive_member: self
|
8953 + | .recursive_member
|
8954 + | .map(|v| match *v {
|
8955 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
8956 + | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
8957 + | Ok(Box::new(x.try_into()?))
|
8958 + | }
|
8515 8959 | })
|
8516 8960 | .map(|res| {
|
8517 - | res.map(|v| v.into())
|
8518 - | .map_err(ConstraintViolation::ListOfLengthPatternString)
|
8519 - | })
|
8520 - | .transpose()?,
|
8521 - | set_of_length_pattern_string: self
|
8522 - | .set_of_length_pattern_string
|
8523 - | .map(|v| match v {
|
8524 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8525 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8526 - | })
|
8527 - | .map(|res| res.map_err(ConstraintViolation::SetOfLengthPatternString))
|
8528 - | .transpose()?
|
8529 - | .map(|v: crate::model::SetOfLengthPatternString| v.into()),
|
8530 - | length_list_of_pattern_string: self
|
8531 - | .length_list_of_pattern_string
|
8532 - | .map(|v| match v {
|
8533 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8534 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8961 + | res.map_err(Box::new)
|
8962 + | .map_err(ConstraintViolation::RecursiveMember)
|
8535 8963 | })
|
8536 - | .map(|res| res.map_err(ConstraintViolation::LengthListOfPatternString))
|
8537 8964 | .transpose()?
|
8538 - | .map(|v: crate::model::LengthListOfPatternString| v.into()),
|
8539 - | length_set_of_pattern_string: self
|
8540 - | .length_set_of_pattern_string
|
8541 - | .map(|v| match v {
|
8542 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
8543 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
8965 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
8544 8966 | })
|
8545 - | .map(|res| res.map_err(ConstraintViolation::LengthSetOfPatternString))
|
8546 - | .transpose()?
|
8547 - | .map(|v: crate::model::LengthSetOfPatternString| v.into()),
|
8967 + | }
|
8968 + | }
|
8969 + | }
|
8970 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
8971 + | pub mod recursive_shapes_input_output_nested1 {
|
8972 + |
|
8973 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8974 + | /// Holds one variant for each of the ways the builder can fail.
|
8975 + | #[allow(clippy::enum_variant_names)]
|
8976 + | pub enum ConstraintViolation {
|
8977 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
8978 + | MissingRecursiveMember,
|
8979 + | }
|
8980 + | impl ::std::fmt::Display for ConstraintViolation {
|
8981 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8982 + | match self {
|
8983 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
8984 + | }
|
8985 + | }
|
8986 + | }
|
8987 + | impl ::std::error::Error for ConstraintViolation {}
|
8988 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
8989 + | type Error = ConstraintViolation;
|
8990 + |
|
8991 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8992 + | builder.build()
|
8993 + | }
|
8994 + | }
|
8995 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
8996 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8997 + | pub struct Builder {
|
8998 + | pub(crate) recursive_member: ::std::option::Option<
|
8999 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
9000 + | >,
|
9001 + | }
|
9002 + | impl Builder {
|
9003 + | #[allow(missing_docs)] // documentation missing in model
|
9004 + | pub fn recursive_member(
|
9005 + | mut self,
|
9006 + | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
9007 + | ) -> Self {
|
9008 + | self.recursive_member = Some(input);
|
9009 + | self
|
9010 + | }
|
9011 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
9012 + | ///
|
9013 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if you do not provide a value for all non-`Option`al members.
|
9014 + | ///
|
9015 + | pub fn build(
|
9016 + | self,
|
9017 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
9018 + | self.build_enforcing_required_and_enum_traits()
|
9019 + | }
|
9020 + | fn build_enforcing_required_and_enum_traits(
|
9021 + | self,
|
9022 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
9023 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
9024 + | recursive_member: self
|
9025 + | .recursive_member
|
9026 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
8548 9027 | })
|
8549 9028 | }
|
8550 9029 | }
|
8551 9030 | }
|
8552 - | /// See [`ConA`](crate::model::ConA).
|
8553 - | pub mod con_a {
|
9031 + | pub(crate) mod recursive_list_internal {
|
9032 + |
|
9033 + | #[allow(clippy::enum_variant_names)]
|
9034 + | #[derive(Debug, PartialEq)]
|
9035 + | pub(crate) enum ConstraintViolation {
|
9036 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9037 + | /// The first component of the tuple is the index in the collection where the
|
9038 + | /// first constraint violation was found.
|
9039 + | #[doc(hidden)]
|
9040 + | Member(
|
9041 + | usize,
|
9042 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
9043 + | ),
|
9044 + | }
|
9045 + |
|
9046 + | impl ::std::fmt::Display for ConstraintViolation {
|
9047 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9048 + | let message = match self {
|
9049 + | Self::Member(index, failing_member) => format!(
|
9050 + | "Value at index {index} failed to satisfy constraint. {}",
|
9051 + | failing_member
|
9052 + | ),
|
9053 + | };
|
9054 + | write!(f, "{message}")
|
9055 + | }
|
9056 + | }
|
9057 + |
|
9058 + | impl ::std::error::Error for ConstraintViolation {}
|
9059 + | impl ConstraintViolation {
|
9060 + | pub(crate) fn as_validation_exception_field(
|
9061 + | self,
|
9062 + | path: ::std::string::String,
|
9063 + | ) -> crate::model::ValidationExceptionField {
|
9064 + | match self {
|
9065 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9066 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9067 + | }
|
9068 + | }
|
9069 + | }
|
9070 + | }
|
9071 + | pub(crate) mod con_b_map_internal {
|
9072 + |
|
9073 + | #[allow(clippy::enum_variant_names)]
|
9074 + | #[derive(Debug, PartialEq)]
|
9075 + | pub(crate) enum ConstraintViolation {
|
9076 + | Length(usize),
|
9077 + |
|
9078 + | #[doc(hidden)]
|
9079 + | Value(
|
9080 + | ::std::string::String,
|
9081 + | crate::model::length_string_internal::ConstraintViolation,
|
9082 + | ),
|
9083 + | }
|
9084 + |
|
9085 + | impl ::std::fmt::Display for ConstraintViolation {
|
9086 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9087 + | match self {
|
9088 + | Self::Length(length) => {
|
9089 + | 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)
|
9090 + | }
|
9091 + |
|
9092 + | Self::Value(_, value_constraint_violation) => {
|
9093 + | write!(f, "{}", value_constraint_violation)
|
9094 + | }
|
9095 + | }
|
9096 + | }
|
9097 + | }
|
9098 + |
|
9099 + | impl ::std::error::Error for ConstraintViolation {}
|
9100 + | impl ConstraintViolation {
|
9101 + | pub(crate) fn as_validation_exception_field(
|
9102 + | self,
|
9103 + | path: ::std::string::String,
|
9104 + | ) -> crate::model::ValidationExceptionField {
|
9105 + | match self {
|
9106 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9107 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9108 + | path,
|
9109 + | },
|
9110 + | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
9111 + | }
|
9112 + | }
|
9113 + | }
|
9114 + | }
|
9115 + | pub(crate) mod map_of_list_of_length_string_internal {
|
9116 + |
|
9117 + | #[allow(clippy::enum_variant_names)]
|
9118 + | #[derive(Debug, PartialEq)]
|
9119 + | pub(crate) enum ConstraintViolation {
|
9120 + | #[doc(hidden)]
|
9121 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
9122 + | #[doc(hidden)]
|
9123 + | Value(
|
9124 + | crate::model::LengthString,
|
9125 + | crate::model::list_of_length_string_internal::ConstraintViolation,
|
9126 + | ),
|
9127 + | }
|
9128 + |
|
9129 + | impl ::std::fmt::Display for ConstraintViolation {
|
9130 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9131 + | match self {
|
9132 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9133 + | Self::Value(_, value_constraint_violation) => {
|
9134 + | write!(f, "{}", value_constraint_violation)
|
9135 + | }
|
9136 + | }
|
9137 + | }
|
9138 + | }
|
9139 + |
|
9140 + | impl ::std::error::Error for ConstraintViolation {}
|
9141 + | impl ConstraintViolation {
|
9142 + | pub(crate) fn as_validation_exception_field(
|
9143 + | self,
|
9144 + | path: ::std::string::String,
|
9145 + | ) -> crate::model::ValidationExceptionField {
|
9146 + | match self {
|
9147 + | Self::Key(key_constraint_violation) => {
|
9148 + | key_constraint_violation.as_validation_exception_field(path)
|
9149 + | }
|
9150 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9151 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9152 + | }
|
9153 + | }
|
9154 + | }
|
9155 + | }
|
9156 + | pub(crate) mod map_of_set_of_length_string_internal {
|
9157 + |
|
9158 + | #[allow(clippy::enum_variant_names)]
|
9159 + | #[derive(Debug, PartialEq)]
|
9160 + | pub(crate) enum ConstraintViolation {
|
9161 + | #[doc(hidden)]
|
9162 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
9163 + | #[doc(hidden)]
|
9164 + | Value(
|
9165 + | crate::model::LengthString,
|
9166 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
9167 + | ),
|
9168 + | }
|
9169 + |
|
9170 + | impl ::std::fmt::Display for ConstraintViolation {
|
9171 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9172 + | match self {
|
9173 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9174 + | Self::Value(_, value_constraint_violation) => {
|
9175 + | write!(f, "{}", value_constraint_violation)
|
9176 + | }
|
9177 + | }
|
9178 + | }
|
9179 + | }
|
9180 + |
|
9181 + | impl ::std::error::Error for ConstraintViolation {}
|
9182 + | impl ConstraintViolation {
|
9183 + | pub(crate) fn as_validation_exception_field(
|
9184 + | self,
|
9185 + | path: ::std::string::String,
|
9186 + | ) -> crate::model::ValidationExceptionField {
|
9187 + | match self {
|
9188 + | Self::Key(key_constraint_violation) => {
|
9189 + | key_constraint_violation.as_validation_exception_field(path)
|
9190 + | }
|
9191 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9192 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9193 + | }
|
9194 + | }
|
9195 + | }
|
9196 + | }
|
9197 + | pub(crate) mod map_of_length_list_of_pattern_string_internal {
|
8554 9198 |
|
8555 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8556 - | /// Holds one variant for each of the ways the builder can fail.
|
8557 9199 | #[allow(clippy::enum_variant_names)]
|
8558 - | pub enum ConstraintViolation {
|
8559 - | /// `con_b` was not provided but it is required when building `ConA`.
|
8560 - | MissingConB,
|
9200 + | #[derive(Debug, PartialEq)]
|
9201 + | pub(crate) enum ConstraintViolation {
|
9202 + | #[doc(hidden)]
|
9203 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
9204 + | #[doc(hidden)]
|
9205 + | Value(
|
9206 + | crate::model::PatternString,
|
9207 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
9208 + | ),
|
8561 9209 | }
|
9210 + |
|
8562 9211 | impl ::std::fmt::Display for ConstraintViolation {
|
8563 9212 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8564 9213 | match self {
|
8565 - | ConstraintViolation::MissingConB => write!(
|
8566 - | f,
|
8567 - | "`con_b` was not provided but it is required when building `ConA`"
|
8568 - | ),
|
9214 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9215 + | Self::Value(_, value_constraint_violation) => {
|
9216 + | write!(f, "{}", value_constraint_violation)
|
9217 + | }
|
8569 9218 | }
|
8570 9219 | }
|
8571 9220 | }
|
8572 - | impl ::std::error::Error for ConstraintViolation {}
|
8573 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
8574 - | type Error = ConstraintViolation;
|
8575 9221 |
|
8576 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8577 - | builder.build()
|
9222 + | impl ::std::error::Error for ConstraintViolation {}
|
9223 + | impl ConstraintViolation {
|
9224 + | pub(crate) fn as_validation_exception_field(
|
9225 + | self,
|
9226 + | path: ::std::string::String,
|
9227 + | ) -> crate::model::ValidationExceptionField {
|
9228 + | match self {
|
9229 + | Self::Key(key_constraint_violation) => {
|
9230 + | key_constraint_violation.as_validation_exception_field(path)
|
8578 9231 | }
|
9232 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9233 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8579 9234 | }
|
8580 - | /// A builder for [`ConA`](crate::model::ConA).
|
8581 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8582 - | pub struct Builder {
|
8583 - | pub(crate) con_b: ::std::option::Option<crate::model::ConB>,
|
8584 - | pub(crate) opt_con_b: ::std::option::Option<crate::model::ConB>,
|
8585 - | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
8586 - | pub(crate) min_length_string: ::std::option::Option<::std::string::String>,
|
8587 - | pub(crate) max_length_string: ::std::option::Option<::std::string::String>,
|
8588 - | pub(crate) fixed_length_string: ::std::option::Option<::std::string::String>,
|
8589 - | pub(crate) length_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8590 - | pub(crate) min_length_blob:
|
8591 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8592 - | pub(crate) max_length_blob:
|
8593 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8594 - | pub(crate) fixed_length_blob:
|
8595 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8596 - | pub(crate) range_integer: ::std::option::Option<i32>,
|
8597 - | pub(crate) min_range_integer: ::std::option::Option<i32>,
|
8598 - | pub(crate) max_range_integer: ::std::option::Option<i32>,
|
8599 - | pub(crate) fixed_value_integer: ::std::option::Option<i32>,
|
8600 - | pub(crate) range_short: ::std::option::Option<i16>,
|
8601 - | pub(crate) min_range_short: ::std::option::Option<i16>,
|
8602 - | pub(crate) max_range_short: ::std::option::Option<i16>,
|
8603 - | pub(crate) fixed_value_short: ::std::option::Option<i16>,
|
8604 - | pub(crate) range_long: ::std::option::Option<i64>,
|
8605 - | pub(crate) min_range_long: ::std::option::Option<i64>,
|
8606 - | pub(crate) max_range_long: ::std::option::Option<i64>,
|
8607 - | pub(crate) fixed_value_long: ::std::option::Option<i64>,
|
8608 - | pub(crate) range_byte: ::std::option::Option<i8>,
|
8609 - | pub(crate) min_range_byte: ::std::option::Option<i8>,
|
8610 - | pub(crate) max_range_byte: ::std::option::Option<i8>,
|
8611 - | pub(crate) fixed_value_byte: ::std::option::Option<i8>,
|
8612 - | pub(crate) con_b_list:
|
8613 - | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
8614 - | pub(crate) length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8615 - | pub(crate) sensitive_length_list:
|
8616 - | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
8617 - | pub(crate) con_b_set:
|
8618 - | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
8619 - | pub(crate) con_b_map: ::std::option::Option<
|
8620 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8621 - | >,
|
8622 - | pub(crate) length_map: ::std::option::Option<
|
8623 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8624 - | >,
|
8625 - | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
8626 - | ::std::collections::HashMap<
|
8627 - | ::std::string::String,
|
8628 - | ::std::collections::HashMap<
|
8629 - | ::std::string::String,
|
8630 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
8631 - | >,
|
8632 - | >,
|
8633 - | >,
|
8634 - | pub(crate) sparse_map: ::std::option::Option<
|
8635 - | ::std::collections::HashMap<
|
8636 - | ::std::string::String,
|
8637 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8638 - | >,
|
8639 - | >,
|
8640 - | pub(crate) sparse_list:
|
8641 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
8642 - | pub(crate) sparse_length_map: ::std::option::Option<
|
8643 - | ::std::collections::HashMap<
|
8644 - | ::std::string::String,
|
8645 - | ::std::option::Option<::std::string::String>,
|
8646 - | >,
|
8647 - | >,
|
8648 - | pub(crate) sparse_length_list:
|
8649 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
8650 - | pub(crate) constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
8651 - | pub(crate) enum_string: ::std::option::Option<crate::model::EnumString>,
|
8652 - | pub(crate) list_of_length_string:
|
8653 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8654 - | pub(crate) set_of_length_string:
|
8655 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8656 - | pub(crate) map_of_length_string: ::std::option::Option<
|
8657 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8658 - | >,
|
8659 - | pub(crate) list_of_length_blob:
|
8660 - | ::std::option::Option<::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>>,
|
8661 - | pub(crate) map_of_length_blob: ::std::option::Option<
|
8662 - | ::std::collections::HashMap<
|
8663 - | ::std::string::String,
|
8664 - | ::aws_smithy_http_server_python::types::Blob,
|
8665 - | >,
|
8666 - | >,
|
8667 - | pub(crate) list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
8668 - | pub(crate) set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
8669 - | pub(crate) map_of_range_integer:
|
8670 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
8671 - | pub(crate) list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
8672 - | pub(crate) set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
8673 - | pub(crate) map_of_range_short:
|
8674 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
8675 - | pub(crate) list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
8676 - | pub(crate) set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
8677 - | pub(crate) map_of_range_long:
|
8678 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
8679 - | pub(crate) list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
8680 - | pub(crate) set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
8681 - | pub(crate) map_of_range_byte:
|
8682 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
8683 - | pub(crate) non_streaming_blob:
|
8684 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8685 - | pub(crate) pattern_string: ::std::option::Option<::std::string::String>,
|
8686 - | pub(crate) map_of_pattern_string: ::std::option::Option<
|
8687 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8688 - | >,
|
8689 - | pub(crate) list_of_pattern_string:
|
8690 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8691 - | pub(crate) set_of_pattern_string:
|
8692 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8693 - | pub(crate) length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
8694 - | pub(crate) map_of_length_pattern_string: ::std::option::Option<
|
8695 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8696 - | >,
|
8697 - | pub(crate) list_of_length_pattern_string:
|
8698 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8699 - | pub(crate) set_of_length_pattern_string:
|
8700 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8701 - | pub(crate) length_list_of_pattern_string:
|
8702 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8703 - | pub(crate) length_set_of_pattern_string:
|
8704 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8705 9235 | }
|
8706 - | impl Builder {
|
8707 - | #[allow(missing_docs)] // documentation missing in model
|
8708 - | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
8709 - | self.con_b = Some(input);
|
8710 - | self
|
8711 9236 | }
|
8712 - | #[allow(missing_docs)] // documentation missing in model
|
8713 - | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
8714 - | self.opt_con_b = input;
|
8715 - | self
|
9237 + | }
|
9238 + | pub(crate) mod map_of_list_of_enum_string_internal {
|
9239 + |
|
9240 + | #[allow(clippy::enum_variant_names)]
|
9241 + | #[derive(Debug, PartialEq)]
|
9242 + | pub(crate) enum ConstraintViolation {
|
9243 + | #[doc(hidden)]
|
9244 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
9245 + | #[doc(hidden)]
|
9246 + | Value(
|
9247 + | crate::model::EnumString,
|
9248 + | crate::model::list_of_enum_string_internal::ConstraintViolation,
|
9249 + | ),
|
8716 9250 | }
|
8717 - | #[allow(missing_docs)] // documentation missing in model
|
8718 - | pub fn length_string(
|
8719 - | mut self,
|
8720 - | input: ::std::option::Option<::std::string::String>,
|
8721 - | ) -> Self {
|
8722 - | self.length_string = input;
|
8723 - | self
|
9251 + |
|
9252 + | impl ::std::fmt::Display for ConstraintViolation {
|
9253 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9254 + | match self {
|
9255 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9256 + | Self::Value(_, value_constraint_violation) => {
|
9257 + | write!(f, "{}", value_constraint_violation)
|
8724 9258 | }
|
8725 - | #[allow(missing_docs)] // documentation missing in model
|
8726 - | pub fn min_length_string(
|
8727 - | mut self,
|
8728 - | input: ::std::option::Option<::std::string::String>,
|
8729 - | ) -> Self {
|
8730 - | self.min_length_string = input;
|
8731 - | self
|
8732 9259 | }
|
8733 - | #[allow(missing_docs)] // documentation missing in model
|
8734 - | pub fn max_length_string(
|
8735 - | mut self,
|
8736 - | input: ::std::option::Option<::std::string::String>,
|
8737 - | ) -> Self {
|
8738 - | self.max_length_string = input;
|
8739 - | self
|
8740 9260 | }
|
8741 - | #[allow(missing_docs)] // documentation missing in model
|
8742 - | pub fn fixed_length_string(
|
8743 - | mut self,
|
8744 - | input: ::std::option::Option<::std::string::String>,
|
8745 - | ) -> Self {
|
8746 - | self.fixed_length_string = input;
|
8747 - | self
|
8748 9261 | }
|
8749 - | #[allow(missing_docs)] // documentation missing in model
|
8750 - | pub fn length_blob(
|
8751 - | mut self,
|
8752 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8753 - | ) -> Self {
|
8754 - | self.length_blob = input;
|
8755 - | self
|
9262 + |
|
9263 + | impl ::std::error::Error for ConstraintViolation {}
|
9264 + | impl ConstraintViolation {
|
9265 + | pub(crate) fn as_validation_exception_field(
|
9266 + | self,
|
9267 + | path: ::std::string::String,
|
9268 + | ) -> crate::model::ValidationExceptionField {
|
9269 + | match self {
|
9270 + | Self::Key(key_constraint_violation) => {
|
9271 + | key_constraint_violation.as_validation_exception_field(path)
|
8756 9272 | }
|
8757 - | #[allow(missing_docs)] // documentation missing in model
|
8758 - | pub fn min_length_blob(
|
8759 - | mut self,
|
8760 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8761 - | ) -> Self {
|
8762 - | self.min_length_blob = input;
|
8763 - | self
|
9273 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9274 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8764 9275 | }
|
8765 - | #[allow(missing_docs)] // documentation missing in model
|
8766 - | pub fn max_length_blob(
|
8767 - | mut self,
|
8768 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8769 - | ) -> Self {
|
8770 - | self.max_length_blob = input;
|
8771 - | self
|
8772 9276 | }
|
8773 - | #[allow(missing_docs)] // documentation missing in model
|
8774 - | pub fn fixed_length_blob(
|
8775 - | mut self,
|
8776 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
8777 - | ) -> Self {
|
8778 - | self.fixed_length_blob = input;
|
8779 - | self
|
8780 9277 | }
|
8781 - | #[allow(missing_docs)] // documentation missing in model
|
8782 - | pub fn range_integer(mut self, input: i32) -> Self {
|
8783 - | self.range_integer = Some(input);
|
8784 - | self
|
9278 + | }
|
9279 + | pub(crate) mod map_of_pattern_string_internal {
|
9280 + |
|
9281 + | #[allow(clippy::enum_variant_names)]
|
9282 + | #[derive(Debug, PartialEq)]
|
9283 + | pub(crate) enum ConstraintViolation {
|
9284 + | #[doc(hidden)]
|
9285 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
9286 + | #[doc(hidden)]
|
9287 + | Value(
|
9288 + | crate::model::PatternString,
|
9289 + | crate::model::pattern_string_internal::ConstraintViolation,
|
9290 + | ),
|
8785 9291 | }
|
8786 - | #[allow(missing_docs)] // documentation missing in model
|
8787 - | pub fn min_range_integer(mut self, input: i32) -> Self {
|
8788 - | self.min_range_integer = Some(input);
|
8789 - | self
|
9292 + |
|
9293 + | impl ::std::fmt::Display for ConstraintViolation {
|
9294 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9295 + | match self {
|
9296 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9297 + | Self::Value(_, value_constraint_violation) => {
|
9298 + | write!(f, "{}", value_constraint_violation)
|
8790 9299 | }
|
8791 - | #[allow(missing_docs)] // documentation missing in model
|
8792 - | pub fn max_range_integer(mut self, input: i32) -> Self {
|
8793 - | self.max_range_integer = Some(input);
|
8794 - | self
|
8795 9300 | }
|
8796 - | #[allow(missing_docs)] // documentation missing in model
|
8797 - | pub fn fixed_value_integer(mut self, input: i32) -> Self {
|
8798 - | self.fixed_value_integer = Some(input);
|
8799 - | self
|
8800 9301 | }
|
8801 - | #[allow(missing_docs)] // documentation missing in model
|
8802 - | pub fn range_short(mut self, input: i16) -> Self {
|
8803 - | self.range_short = Some(input);
|
8804 - | self
|
8805 9302 | }
|
8806 - | #[allow(missing_docs)] // documentation missing in model
|
8807 - | pub fn min_range_short(mut self, input: i16) -> Self {
|
8808 - | self.min_range_short = Some(input);
|
8809 - | self
|
9303 + |
|
9304 + | impl ::std::error::Error for ConstraintViolation {}
|
9305 + | impl ConstraintViolation {
|
9306 + | pub(crate) fn as_validation_exception_field(
|
9307 + | self,
|
9308 + | path: ::std::string::String,
|
9309 + | ) -> crate::model::ValidationExceptionField {
|
9310 + | match self {
|
9311 + | Self::Key(key_constraint_violation) => {
|
9312 + | key_constraint_violation.as_validation_exception_field(path)
|
8810 9313 | }
|
8811 - | #[allow(missing_docs)] // documentation missing in model
|
8812 - | pub fn max_range_short(mut self, input: i16) -> Self {
|
8813 - | self.max_range_short = Some(input);
|
8814 - | self
|
9314 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9315 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8815 9316 | }
|
8816 - | #[allow(missing_docs)] // documentation missing in model
|
8817 - | pub fn fixed_value_short(mut self, input: i16) -> Self {
|
8818 - | self.fixed_value_short = Some(input);
|
8819 - | self
|
8820 9317 | }
|
8821 - | #[allow(missing_docs)] // documentation missing in model
|
8822 - | pub fn range_long(mut self, input: i64) -> Self {
|
8823 - | self.range_long = Some(input);
|
8824 - | self
|
8825 9318 | }
|
8826 - | #[allow(missing_docs)] // documentation missing in model
|
8827 - | pub fn min_range_long(mut self, input: i64) -> Self {
|
8828 - | self.min_range_long = Some(input);
|
8829 - | self
|
9319 + | }
|
9320 + | pub(crate) mod map_of_list_of_pattern_string_internal {
|
9321 + |
|
9322 + | #[allow(clippy::enum_variant_names)]
|
9323 + | #[derive(Debug, PartialEq)]
|
9324 + | pub(crate) enum ConstraintViolation {
|
9325 + | #[doc(hidden)]
|
9326 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
9327 + | #[doc(hidden)]
|
9328 + | Value(
|
9329 + | crate::model::PatternString,
|
9330 + | crate::model::list_of_pattern_string_internal::ConstraintViolation,
|
9331 + | ),
|
8830 9332 | }
|
8831 - | #[allow(missing_docs)] // documentation missing in model
|
8832 - | pub fn max_range_long(mut self, input: i64) -> Self {
|
8833 - | self.max_range_long = Some(input);
|
8834 - | self
|
9333 + |
|
9334 + | impl ::std::fmt::Display for ConstraintViolation {
|
9335 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9336 + | match self {
|
9337 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9338 + | Self::Value(_, value_constraint_violation) => {
|
9339 + | write!(f, "{}", value_constraint_violation)
|
8835 9340 | }
|
8836 - | #[allow(missing_docs)] // documentation missing in model
|
8837 - | pub fn fixed_value_long(mut self, input: i64) -> Self {
|
8838 - | self.fixed_value_long = Some(input);
|
8839 - | self
|
8840 9341 | }
|
8841 - | #[allow(missing_docs)] // documentation missing in model
|
8842 - | pub fn range_byte(mut self, input: i8) -> Self {
|
8843 - | self.range_byte = Some(input);
|
8844 - | self
|
8845 9342 | }
|
8846 - | #[allow(missing_docs)] // documentation missing in model
|
8847 - | pub fn min_range_byte(mut self, input: i8) -> Self {
|
8848 - | self.min_range_byte = Some(input);
|
8849 - | self
|
8850 9343 | }
|
8851 - | #[allow(missing_docs)] // documentation missing in model
|
8852 - | pub fn max_range_byte(mut self, input: i8) -> Self {
|
8853 - | self.max_range_byte = Some(input);
|
8854 - | self
|
9344 + |
|
9345 + | impl ::std::error::Error for ConstraintViolation {}
|
9346 + | impl ConstraintViolation {
|
9347 + | pub(crate) fn as_validation_exception_field(
|
9348 + | self,
|
9349 + | path: ::std::string::String,
|
9350 + | ) -> crate::model::ValidationExceptionField {
|
9351 + | match self {
|
9352 + | Self::Key(key_constraint_violation) => {
|
9353 + | key_constraint_violation.as_validation_exception_field(path)
|
8855 9354 | }
|
8856 - | #[allow(missing_docs)] // documentation missing in model
|
8857 - | pub fn fixed_value_byte(mut self, input: i8) -> Self {
|
8858 - | self.fixed_value_byte = Some(input);
|
8859 - | self
|
9355 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9356 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8860 9357 | }
|
8861 - | #[allow(missing_docs)] // documentation missing in model
|
8862 - | pub fn con_b_list(
|
8863 - | mut self,
|
8864 - | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
8865 - | ) -> Self {
|
8866 - | self.con_b_list = input;
|
8867 - | self
|
8868 9358 | }
|
8869 - | #[allow(missing_docs)] // documentation missing in model
|
8870 - | pub fn length_list(
|
8871 - | mut self,
|
8872 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8873 - | ) -> Self {
|
8874 - | self.length_list = input;
|
8875 - | self
|
8876 9359 | }
|
8877 - | #[allow(missing_docs)] // documentation missing in model
|
8878 - | pub fn sensitive_length_list(
|
8879 - | mut self,
|
8880 - | input: ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
8881 - | ) -> Self {
|
8882 - | self.sensitive_length_list = input;
|
8883 - | self
|
9360 + | }
|
9361 + | pub(crate) mod map_of_length_pattern_string_internal {
|
9362 + |
|
9363 + | #[allow(clippy::enum_variant_names)]
|
9364 + | #[derive(Debug, PartialEq)]
|
9365 + | pub(crate) enum ConstraintViolation {
|
9366 + | #[doc(hidden)]
|
9367 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
9368 + | #[doc(hidden)]
|
9369 + | Value(
|
9370 + | crate::model::LengthPatternString,
|
9371 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
9372 + | ),
|
8884 9373 | }
|
8885 - | #[allow(missing_docs)] // documentation missing in model
|
8886 - | pub fn con_b_set(
|
8887 - | mut self,
|
8888 - | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
8889 - | ) -> Self {
|
8890 - | self.con_b_set = input;
|
8891 - | self
|
9374 + |
|
9375 + | impl ::std::fmt::Display for ConstraintViolation {
|
9376 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9377 + | match self {
|
9378 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9379 + | Self::Value(_, value_constraint_violation) => {
|
9380 + | write!(f, "{}", value_constraint_violation)
|
8892 9381 | }
|
8893 - | #[allow(missing_docs)] // documentation missing in model
|
8894 - | pub fn con_b_map(
|
8895 - | mut self,
|
8896 - | input: ::std::option::Option<
|
8897 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8898 - | >,
|
8899 - | ) -> Self {
|
8900 - | self.con_b_map = input;
|
8901 - | self
|
8902 9382 | }
|
8903 - | #[allow(missing_docs)] // documentation missing in model
|
8904 - | pub fn length_map(
|
8905 - | mut self,
|
8906 - | input: ::std::option::Option<
|
8907 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8908 - | >,
|
8909 - | ) -> Self {
|
8910 - | self.length_map = input;
|
8911 - | self
|
8912 9383 | }
|
8913 - | #[allow(missing_docs)] // documentation missing in model
|
8914 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
8915 - | mut self,
|
8916 - | input: ::std::option::Option<
|
8917 - | ::std::collections::HashMap<
|
8918 - | ::std::string::String,
|
8919 - | ::std::collections::HashMap<
|
8920 - | ::std::string::String,
|
8921 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
8922 - | >,
|
8923 - | >,
|
8924 - | >,
|
8925 - | ) -> Self {
|
8926 - | self.map_of_map_of_list_of_list_of_con_b = input;
|
8927 - | self
|
8928 9384 | }
|
8929 - | #[allow(missing_docs)] // documentation missing in model
|
8930 - | pub fn sparse_map(
|
8931 - | mut self,
|
8932 - | input: ::std::option::Option<
|
8933 - | ::std::collections::HashMap<
|
8934 - | ::std::string::String,
|
8935 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8936 - | >,
|
8937 - | >,
|
8938 - | ) -> Self {
|
8939 - | self.sparse_map = input;
|
8940 - | self
|
9385 + |
|
9386 + | impl ::std::error::Error for ConstraintViolation {}
|
9387 + | impl ConstraintViolation {
|
9388 + | pub(crate) fn as_validation_exception_field(
|
9389 + | self,
|
9390 + | path: ::std::string::String,
|
9391 + | ) -> crate::model::ValidationExceptionField {
|
9392 + | match self {
|
9393 + | Self::Key(key_constraint_violation) => {
|
9394 + | key_constraint_violation.as_validation_exception_field(path)
|
8941 9395 | }
|
8942 - | #[allow(missing_docs)] // documentation missing in model
|
8943 - | pub fn sparse_list(
|
8944 - | mut self,
|
8945 - | input: ::std::option::Option<
|
8946 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
8947 - | >,
|
8948 - | ) -> Self {
|
8949 - | self.sparse_list = input;
|
8950 - | self
|
9396 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9397 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8951 9398 | }
|
8952 - | #[allow(missing_docs)] // documentation missing in model
|
8953 - | pub fn sparse_length_map(
|
8954 - | mut self,
|
8955 - | input: ::std::option::Option<
|
8956 - | ::std::collections::HashMap<
|
8957 - | ::std::string::String,
|
8958 - | ::std::option::Option<::std::string::String>,
|
8959 - | >,
|
8960 - | >,
|
8961 - | ) -> Self {
|
8962 - | self.sparse_length_map = input;
|
8963 - | self
|
8964 9399 | }
|
8965 - | #[allow(missing_docs)] // documentation missing in model
|
8966 - | pub fn sparse_length_list(
|
8967 - | mut self,
|
8968 - | input: ::std::option::Option<
|
8969 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
8970 - | >,
|
8971 - | ) -> Self {
|
8972 - | self.sparse_length_list = input;
|
8973 - | self
|
8974 9400 | }
|
8975 - | /// A union with constrained members.
|
8976 - | pub fn constrained_union(
|
8977 - | mut self,
|
8978 - | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
8979 - | ) -> Self {
|
8980 - | self.constrained_union = input;
|
8981 - | self
|
9401 + | }
|
9402 + | pub(crate) mod map_of_list_of_length_pattern_string_internal {
|
9403 + |
|
9404 + | #[allow(clippy::enum_variant_names)]
|
9405 + | #[derive(Debug, PartialEq)]
|
9406 + | pub(crate) enum ConstraintViolation {
|
9407 + | #[doc(hidden)]
|
9408 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
9409 + | #[doc(hidden)]
|
9410 + | Value(
|
9411 + | crate::model::LengthPatternString,
|
9412 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
9413 + | ),
|
8982 9414 | }
|
8983 - | #[allow(missing_docs)] // documentation missing in model
|
8984 - | pub fn enum_string(
|
8985 - | mut self,
|
8986 - | input: ::std::option::Option<crate::model::EnumString>,
|
8987 - | ) -> Self {
|
8988 - | self.enum_string = input;
|
8989 - | self
|
9415 + |
|
9416 + | impl ::std::fmt::Display for ConstraintViolation {
|
9417 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9418 + | match self {
|
9419 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9420 + | Self::Value(_, value_constraint_violation) => {
|
9421 + | write!(f, "{}", value_constraint_violation)
|
8990 9422 | }
|
8991 - | #[allow(missing_docs)] // documentation missing in model
|
8992 - | pub fn list_of_length_string(
|
8993 - | mut self,
|
8994 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8995 - | ) -> Self {
|
8996 - | self.list_of_length_string = input;
|
8997 - | self
|
8998 9423 | }
|
8999 - | #[allow(missing_docs)] // documentation missing in model
|
9000 - | pub fn set_of_length_string(
|
9001 - | mut self,
|
9002 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9003 - | ) -> Self {
|
9004 - | self.set_of_length_string = input;
|
9005 - | self
|
9006 9424 | }
|
9007 - | #[allow(missing_docs)] // documentation missing in model
|
9008 - | pub fn map_of_length_string(
|
9009 - | mut self,
|
9010 - | input: ::std::option::Option<
|
9011 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
9012 - | >,
|
9013 - | ) -> Self {
|
9014 - | self.map_of_length_string = input;
|
9015 - | self
|
9016 9425 | }
|
9017 - | #[allow(missing_docs)] // documentation missing in model
|
9018 - | pub fn list_of_length_blob(
|
9019 - | mut self,
|
9020 - | input: ::std::option::Option<
|
9021 - | ::std::vec::Vec<::aws_smithy_http_server_python::types::Blob>,
|
9022 - | >,
|
9023 - | ) -> Self {
|
9024 - | self.list_of_length_blob = input;
|
9025 - | self
|
9426 + |
|
9427 + | impl ::std::error::Error for ConstraintViolation {}
|
9428 + | impl ConstraintViolation {
|
9429 + | pub(crate) fn as_validation_exception_field(
|
9430 + | self,
|
9431 + | path: ::std::string::String,
|
9432 + | ) -> crate::model::ValidationExceptionField {
|
9433 + | match self {
|
9434 + | Self::Key(key_constraint_violation) => {
|
9435 + | key_constraint_violation.as_validation_exception_field(path)
|
9026 9436 | }
|
9027 - | #[allow(missing_docs)] // documentation missing in model
|
9028 - | pub fn map_of_length_blob(
|
9029 - | mut self,
|
9030 - | input: ::std::option::Option<
|
9031 - | ::std::collections::HashMap<
|
9032 - | ::std::string::String,
|
9033 - | ::aws_smithy_http_server_python::types::Blob,
|
9034 - | >,
|
9035 - | >,
|
9036 - | ) -> Self {
|
9037 - | self.map_of_length_blob = input;
|
9038 - | self
|
9437 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9438 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9039 9439 | }
|
9040 - | #[allow(missing_docs)] // documentation missing in model
|
9041 - | pub fn list_of_range_integer(
|
9042 - | mut self,
|
9043 - | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
9044 - | ) -> Self {
|
9045 - | self.list_of_range_integer = input;
|
9046 - | self
|
9047 9440 | }
|
9048 - | #[allow(missing_docs)] // documentation missing in model
|
9049 - | pub fn set_of_range_integer(
|
9050 - | mut self,
|
9051 - | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
9052 - | ) -> Self {
|
9053 - | self.set_of_range_integer = input;
|
9054 - | self
|
9055 9441 | }
|
9056 - | #[allow(missing_docs)] // documentation missing in model
|
9057 - | pub fn map_of_range_integer(
|
9058 - | mut self,
|
9059 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
9060 - | ) -> Self {
|
9061 - | self.map_of_range_integer = input;
|
9062 - | self
|
9442 + | }
|
9443 + | pub(crate) mod map_of_enum_string_internal {
|
9444 + |
|
9445 + | #[allow(clippy::enum_variant_names)]
|
9446 + | #[derive(Debug, PartialEq)]
|
9447 + | pub(crate) enum ConstraintViolation {
|
9448 + | #[doc(hidden)]
|
9449 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
9450 + | #[doc(hidden)]
|
9451 + | Value(
|
9452 + | crate::model::EnumString,
|
9453 + | crate::model::enum_string_internal::ConstraintViolation,
|
9454 + | ),
|
9063 9455 | }
|
9064 - | #[allow(missing_docs)] // documentation missing in model
|
9065 - | pub fn list_of_range_short(
|
9066 - | mut self,
|
9067 - | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
9068 - | ) -> Self {
|
9069 - | self.list_of_range_short = input;
|
9070 - | self
|
9456 + |
|
9457 + | impl ::std::fmt::Display for ConstraintViolation {
|
9458 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9459 + | match self {
|
9460 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
9461 + | Self::Value(_, value_constraint_violation) => {
|
9462 + | write!(f, "{}", value_constraint_violation)
|
9071 9463 | }
|
9072 - | #[allow(missing_docs)] // documentation missing in model
|
9073 - | pub fn set_of_range_short(
|
9074 - | mut self,
|
9075 - | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
9076 - | ) -> Self {
|
9077 - | self.set_of_range_short = input;
|
9078 - | self
|
9079 9464 | }
|
9080 - | #[allow(missing_docs)] // documentation missing in model
|
9081 - | pub fn map_of_range_short(
|
9082 - | mut self,
|
9083 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
9084 - | ) -> Self {
|
9085 - | self.map_of_range_short = input;
|
9086 - | self
|
9087 9465 | }
|
9088 - | #[allow(missing_docs)] // documentation missing in model
|
9089 - | pub fn list_of_range_long(
|
9090 - | mut self,
|
9091 - | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
9092 - | ) -> Self {
|
9093 - | self.list_of_range_long = input;
|
9094 - | self
|
9095 9466 | }
|
9096 - | #[allow(missing_docs)] // documentation missing in model
|
9097 - | pub fn set_of_range_long(
|
9098 - | mut self,
|
9099 - | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
9100 - | ) -> Self {
|
9101 - | self.set_of_range_long = input;
|
9102 - | self
|
9467 + |
|
9468 + | impl ::std::error::Error for ConstraintViolation {}
|
9469 + | impl ConstraintViolation {
|
9470 + | pub(crate) fn as_validation_exception_field(
|
9471 + | self,
|
9472 + | path: ::std::string::String,
|
9473 + | ) -> crate::model::ValidationExceptionField {
|
9474 + | match self {
|
9475 + | Self::Key(key_constraint_violation) => {
|
9476 + | key_constraint_violation.as_validation_exception_field(path)
|
9103 9477 | }
|
9104 - | #[allow(missing_docs)] // documentation missing in model
|
9105 - | pub fn map_of_range_long(
|
9106 - | mut self,
|
9107 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
9108 - | ) -> Self {
|
9109 - | self.map_of_range_long = input;
|
9110 - | self
|
9478 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9479 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9111 9480 | }
|
9112 - | #[allow(missing_docs)] // documentation missing in model
|
9113 - | pub fn list_of_range_byte(
|
9114 - | mut self,
|
9115 - | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
9116 - | ) -> Self {
|
9117 - | self.list_of_range_byte = input;
|
9118 - | self
|
9119 9481 | }
|
9120 - | #[allow(missing_docs)] // documentation missing in model
|
9121 - | pub fn set_of_range_byte(
|
9122 - | mut self,
|
9123 - | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
9124 - | ) -> Self {
|
9125 - | self.set_of_range_byte = input;
|
9126 - | self
|
9127 9482 | }
|
9128 - | #[allow(missing_docs)] // documentation missing in model
|
9129 - | pub fn map_of_range_byte(
|
9130 - | mut self,
|
9131 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
9132 - | ) -> Self {
|
9133 - | self.map_of_range_byte = input;
|
9134 - | self
|
9483 + | }
|
9484 + | /// See [`ConB`](crate::model::ConB).
|
9485 + | pub(crate) mod con_b_internal {
|
9486 + |
|
9487 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9488 + | /// Holds one variant for each of the ways the builder can fail.
|
9489 + | #[non_exhaustive]
|
9490 + | #[allow(clippy::enum_variant_names)]
|
9491 + | pub(crate) enum ConstraintViolation {
|
9492 + | /// `nice` was not provided but it is required when building `ConB`.
|
9493 + | MissingNice,
|
9494 + | /// `int` was not provided but it is required when building `ConB`.
|
9495 + | MissingInt,
|
9496 + | }
|
9497 + | impl ::std::fmt::Display for ConstraintViolation {
|
9498 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9499 + | match self {
|
9500 + | ConstraintViolation::MissingNice => write!(
|
9501 + | f,
|
9502 + | "`nice` was not provided but it is required when building `ConB`"
|
9503 + | ),
|
9504 + | ConstraintViolation::MissingInt => write!(
|
9505 + | f,
|
9506 + | "`int` was not provided but it is required when building `ConB`"
|
9507 + | ),
|
9508 + | }
|
9509 + | }
|
9135 9510 | }
|
9136 - | #[allow(missing_docs)] // documentation missing in model
|
9137 - | pub fn non_streaming_blob(
|
9138 - | mut self,
|
9139 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
9140 - | ) -> Self {
|
9141 - | self.non_streaming_blob = input;
|
9142 - | self
|
9511 + | impl ::std::error::Error for ConstraintViolation {}
|
9512 + | impl ConstraintViolation {
|
9513 + | pub(crate) fn as_validation_exception_field(
|
9514 + | self,
|
9515 + | path: ::std::string::String,
|
9516 + | ) -> crate::model::ValidationExceptionField {
|
9517 + | match self {
|
9518 + | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
9519 + | message: format!(
|
9520 + | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
9521 + | path
|
9522 + | ),
|
9523 + | path: path + "/nice",
|
9524 + | },
|
9525 + | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
9526 + | message: format!(
|
9527 + | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
9528 + | path
|
9529 + | ),
|
9530 + | path: path + "/int",
|
9531 + | },
|
9143 9532 | }
|
9144 - | #[allow(missing_docs)] // documentation missing in model
|
9145 - | pub fn pattern_string(
|
9146 - | mut self,
|
9147 - | input: ::std::option::Option<::std::string::String>,
|
9148 - | ) -> Self {
|
9149 - | self.pattern_string = input;
|
9150 - | self
|
9151 9533 | }
|
9152 - | #[allow(missing_docs)] // documentation missing in model
|
9153 - | pub fn map_of_pattern_string(
|
9154 - | mut self,
|
9155 - | input: ::std::option::Option<
|
9156 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
9157 - | >,
|
9158 - | ) -> Self {
|
9159 - | self.map_of_pattern_string = input;
|
9160 - | self
|
9161 9534 | }
|
9162 - | #[allow(missing_docs)] // documentation missing in model
|
9163 - | pub fn list_of_pattern_string(
|
9164 - | mut self,
|
9165 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9166 - | ) -> Self {
|
9167 - | self.list_of_pattern_string = input;
|
9168 - | self
|
9535 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
9536 + | fn from(builder: Builder) -> Self {
|
9537 + | Self::Unconstrained(builder)
|
9169 9538 | }
|
9170 - | #[allow(missing_docs)] // documentation missing in model
|
9171 - | pub fn set_of_pattern_string(
|
9172 - | mut self,
|
9173 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9174 - | ) -> Self {
|
9175 - | self.set_of_pattern_string = input;
|
9176 - | self
|
9177 9539 | }
|
9178 - | #[allow(missing_docs)] // documentation missing in model
|
9179 - | pub fn length_length_pattern_string(
|
9180 - | mut self,
|
9181 - | input: ::std::option::Option<::std::string::String>,
|
9182 - | ) -> Self {
|
9183 - | self.length_length_pattern_string = input;
|
9184 - | self
|
9540 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9541 + | type Error = ConstraintViolation;
|
9542 + |
|
9543 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9544 + | builder.build()
|
9185 9545 | }
|
9186 - | #[allow(missing_docs)] // documentation missing in model
|
9187 - | pub fn map_of_length_pattern_string(
|
9188 - | mut self,
|
9189 - | input: ::std::option::Option<
|
9190 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
9191 - | >,
|
9192 - | ) -> Self {
|
9193 - | self.map_of_length_pattern_string = input;
|
9194 - | self
|
9195 9546 | }
|
9547 + | /// A builder for [`ConB`](crate::model::ConB).
|
9548 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9549 + | pub(crate) struct Builder {
|
9550 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9551 + | pub(crate) int: ::std::option::Option<i32>,
|
9552 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9553 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
9554 + | }
|
9555 + | impl Builder {
|
9196 9556 | #[allow(missing_docs)] // documentation missing in model
|
9197 - | pub fn list_of_length_pattern_string(
|
9557 + | pub(crate) fn set_nice(
|
9198 9558 | mut self,
|
9199 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9559 + | input: impl ::std::convert::Into<::std::string::String>,
|
9200 9560 | ) -> Self {
|
9201 - | self.list_of_length_pattern_string = input;
|
9561 + | self.nice = Some(input.into());
|
9202 9562 | self
|
9203 9563 | }
|
9204 9564 | #[allow(missing_docs)] // documentation missing in model
|
9205 - | pub fn set_of_length_pattern_string(
|
9206 - | mut self,
|
9207 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9208 - | ) -> Self {
|
9209 - | self.set_of_length_pattern_string = input;
|
9565 + | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
9566 + | self.int = Some(input.into());
|
9210 9567 | self
|
9211 9568 | }
|
9212 9569 | #[allow(missing_docs)] // documentation missing in model
|
9213 - | pub fn length_list_of_pattern_string(
|
9570 + | pub(crate) fn set_opt_nice(
|
9214 9571 | mut self,
|
9215 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9572 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
9216 9573 | ) -> Self {
|
9217 - | self.length_list_of_pattern_string = input;
|
9574 + | self.opt_nice = input.map(|v| v.into());
|
9218 9575 | self
|
9219 9576 | }
|
9220 9577 | #[allow(missing_docs)] // documentation missing in model
|
9221 - | pub fn length_set_of_pattern_string(
|
9222 - | mut self,
|
9223 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9224 - | ) -> Self {
|
9225 - | self.length_set_of_pattern_string = input;
|
9578 + | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
9579 + | self.opt_int = input.map(|v| v.into());
|
9226 9580 | self
|
9227 9581 | }
|
9228 - | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
9229 - | ///
|
9230 - | /// The builder fails to construct a [`ConA`](crate::model::ConA) if you do not provide a value for all non-`Option`al members.
|
9582 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9231 9583 | ///
|
9232 - | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
9233 - | self.build_enforcing_required_and_enum_traits()
|
9234 - | }
|
9235 - | fn build_enforcing_required_and_enum_traits(
|
9236 - | self,
|
9237 - | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
9238 - | Ok(crate::model::ConA {
|
9239 - | con_b: self.con_b.ok_or(ConstraintViolation::MissingConB)?,
|
9240 - | opt_con_b: self.opt_con_b,
|
9241 - | length_string: self.length_string,
|
9242 - | min_length_string: self.min_length_string,
|
9243 - | max_length_string: self.max_length_string,
|
9244 - | fixed_length_string: self.fixed_length_string,
|
9245 - | length_blob: self.length_blob,
|
9246 - | min_length_blob: self.min_length_blob,
|
9247 - | max_length_blob: self.max_length_blob,
|
9248 - | fixed_length_blob: self.fixed_length_blob,
|
9249 - | range_integer: self.range_integer.unwrap_or(0i32),
|
9250 - | min_range_integer: self.min_range_integer.unwrap_or(0i32),
|
9251 - | max_range_integer: self.max_range_integer.unwrap_or(0i32),
|
9252 - | fixed_value_integer: self.fixed_value_integer.unwrap_or(0i32),
|
9253 - | range_short: self.range_short.unwrap_or(0i16),
|
9254 - | min_range_short: self.min_range_short.unwrap_or(0i16),
|
9255 - | max_range_short: self.max_range_short.unwrap_or(0i16),
|
9256 - | fixed_value_short: self.fixed_value_short.unwrap_or(0i16),
|
9257 - | range_long: self.range_long.unwrap_or(0i64),
|
9258 - | min_range_long: self.min_range_long.unwrap_or(0i64),
|
9259 - | max_range_long: self.max_range_long.unwrap_or(0i64),
|
9260 - | fixed_value_long: self.fixed_value_long.unwrap_or(0i64),
|
9261 - | range_byte: self.range_byte.unwrap_or(0i8),
|
9262 - | min_range_byte: self.min_range_byte.unwrap_or(0i8),
|
9263 - | max_range_byte: self.max_range_byte.unwrap_or(0i8),
|
9264 - | fixed_value_byte: self.fixed_value_byte.unwrap_or(0i8),
|
9265 - | con_b_list: self.con_b_list,
|
9266 - | length_list: self.length_list,
|
9267 - | sensitive_length_list: self.sensitive_length_list,
|
9268 - | con_b_set: self.con_b_set,
|
9269 - | con_b_map: self.con_b_map,
|
9270 - | length_map: self.length_map,
|
9271 - | map_of_map_of_list_of_list_of_con_b: self.map_of_map_of_list_of_list_of_con_b,
|
9272 - | sparse_map: self.sparse_map,
|
9273 - | sparse_list: self.sparse_list,
|
9274 - | sparse_length_map: self.sparse_length_map,
|
9275 - | sparse_length_list: self.sparse_length_list,
|
9276 - | constrained_union: self.constrained_union,
|
9277 - | enum_string: self.enum_string,
|
9278 - | list_of_length_string: self.list_of_length_string,
|
9279 - | set_of_length_string: self.set_of_length_string,
|
9280 - | map_of_length_string: self.map_of_length_string,
|
9281 - | list_of_length_blob: self.list_of_length_blob,
|
9282 - | map_of_length_blob: self.map_of_length_blob,
|
9283 - | list_of_range_integer: self.list_of_range_integer,
|
9284 - | set_of_range_integer: self.set_of_range_integer,
|
9285 - | map_of_range_integer: self.map_of_range_integer,
|
9286 - | list_of_range_short: self.list_of_range_short,
|
9287 - | set_of_range_short: self.set_of_range_short,
|
9288 - | map_of_range_short: self.map_of_range_short,
|
9289 - | list_of_range_long: self.list_of_range_long,
|
9290 - | set_of_range_long: self.set_of_range_long,
|
9291 - | map_of_range_long: self.map_of_range_long,
|
9292 - | list_of_range_byte: self.list_of_range_byte,
|
9293 - | set_of_range_byte: self.set_of_range_byte,
|
9294 - | map_of_range_byte: self.map_of_range_byte,
|
9295 - | non_streaming_blob: self.non_streaming_blob,
|
9296 - | pattern_string: self.pattern_string,
|
9297 - | map_of_pattern_string: self.map_of_pattern_string,
|
9298 - | list_of_pattern_string: self.list_of_pattern_string,
|
9299 - | set_of_pattern_string: self.set_of_pattern_string,
|
9300 - | length_length_pattern_string: self.length_length_pattern_string,
|
9301 - | map_of_length_pattern_string: self.map_of_length_pattern_string,
|
9302 - | list_of_length_pattern_string: self.list_of_length_pattern_string,
|
9303 - | set_of_length_pattern_string: self.set_of_length_pattern_string,
|
9304 - | length_list_of_pattern_string: self.length_list_of_pattern_string,
|
9305 - | length_set_of_pattern_string: self.length_set_of_pattern_string,
|
9306 - | })
|
9307 - | }
|
9308 - | }
|
9309 - | }
|
9310 - | pub(crate) mod length_set_of_pattern_string_internal {
|
9311 - |
|
9312 - | #[allow(clippy::enum_variant_names)]
|
9313 - | #[derive(Debug, PartialEq)]
|
9314 - | pub(crate) enum ConstraintViolation {
|
9315 - | /// Constraint violation error when the list doesn't have the required length
|
9316 - | Length(usize),
|
9317 - | /// Constraint violation error when the list does not contain unique items
|
9318 - | UniqueItems {
|
9319 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9320 - | /// at least two elements.
|
9321 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9322 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9323 - | /// Nothing is guaranteed about the order of the indices.
|
9324 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9325 - | /// The original vector, that contains duplicate items.
|
9326 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
9327 - | },
|
9328 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9329 - | /// The first component of the tuple is the index in the collection where the
|
9330 - | /// first constraint violation was found.
|
9331 - | #[doc(hidden)]
|
9332 - | Member(
|
9333 - | usize,
|
9334 - | crate::model::pattern_string_internal::ConstraintViolation,
|
9335 - | ),
|
9336 - | }
|
9337 - |
|
9338 - | impl ::std::fmt::Display for ConstraintViolation {
|
9339 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9340 - | let message = match self {
|
9341 - | Self::Length(length) => {
|
9342 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
9343 - | },
|
9344 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9345 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9346 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9347 - | failing_member)
|
9348 - | };
|
9349 - | write!(f, "{message}")
|
9350 - | }
|
9584 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
9585 + | ///
|
9586 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
9587 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9588 + | self.build_enforcing_all_constraints()
|
9351 9589 | }
|
9352 - |
|
9353 - | impl ::std::error::Error for ConstraintViolation {}
|
9354 - | impl ConstraintViolation {
|
9355 - | pub(crate) fn as_validation_exception_field(
|
9590 + | fn build_enforcing_all_constraints(
|
9356 9591 | self,
|
9357 - | path: ::std::string::String,
|
9358 - | ) -> crate::model::ValidationExceptionField {
|
9359 - | match self {
|
9360 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9361 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
9362 - | path,
|
9363 - | },
|
9364 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9365 - | crate::model::ValidationExceptionField {
|
9366 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9367 - | path,
|
9368 - | },
|
9369 - | Self::Member(index, member_constraint_violation) =>
|
9370 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9371 - | }
|
9592 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9593 + | Ok(crate::model::ConB {
|
9594 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9595 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9596 + | opt_nice: self.opt_nice,
|
9597 + | opt_int: self.opt_int,
|
9598 + | })
|
9372 9599 | }
|
9373 9600 | }
|
9374 9601 | }
|
9375 - | pub(crate) mod set_of_length_pattern_string_internal {
|
9602 + | /// See [`ConB`](crate::model::ConB).
|
9603 + | pub mod con_b {
|
9376 9604 |
|
9605 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9606 + | /// Holds one variant for each of the ways the builder can fail.
|
9377 9607 | #[allow(clippy::enum_variant_names)]
|
9378 - | #[derive(Debug, PartialEq)]
|
9379 - | pub(crate) enum ConstraintViolation {
|
9380 - | /// Constraint violation error when the list does not contain unique items
|
9381 - | UniqueItems {
|
9382 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9383 - | /// at least two elements.
|
9384 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9385 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9386 - | /// Nothing is guaranteed about the order of the indices.
|
9387 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9388 - | /// The original vector, that contains duplicate items.
|
9389 - | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
9390 - | },
|
9391 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9392 - | /// The first component of the tuple is the index in the collection where the
|
9393 - | /// first constraint violation was found.
|
9394 - | #[doc(hidden)]
|
9395 - | Member(
|
9396 - | usize,
|
9397 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
9398 - | ),
|
9608 + | pub enum ConstraintViolation {
|
9609 + | /// `nice` was not provided but it is required when building `ConB`.
|
9610 + | MissingNice,
|
9611 + | /// `int` was not provided but it is required when building `ConB`.
|
9612 + | MissingInt,
|
9399 9613 | }
|
9400 - |
|
9401 9614 | impl ::std::fmt::Display for ConstraintViolation {
|
9402 9615 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9403 - | let message = match self {
|
9404 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9405 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9406 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9407 - | failing_member)
|
9408 - | };
|
9409 - | write!(f, "{message}")
|
9616 + | match self {
|
9617 + | ConstraintViolation::MissingNice => write!(
|
9618 + | f,
|
9619 + | "`nice` was not provided but it is required when building `ConB`"
|
9620 + | ),
|
9621 + | ConstraintViolation::MissingInt => write!(
|
9622 + | f,
|
9623 + | "`int` was not provided but it is required when building `ConB`"
|
9624 + | ),
|
9625 + | }
|
9410 9626 | }
|
9411 9627 | }
|
9412 - |
|
9413 9628 | impl ::std::error::Error for ConstraintViolation {}
|
9414 - | impl ConstraintViolation {
|
9415 - | pub(crate) fn as_validation_exception_field(
|
9416 - | self,
|
9417 - | path: ::std::string::String,
|
9418 - | ) -> crate::model::ValidationExceptionField {
|
9419 - | match self {
|
9420 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9421 - | crate::model::ValidationExceptionField {
|
9422 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9423 - | path,
|
9424 - | },
|
9425 - | Self::Member(index, member_constraint_violation) =>
|
9426 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9629 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9630 + | type Error = ConstraintViolation;
|
9631 + |
|
9632 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9633 + | builder.build()
|
9634 + | }
|
9635 + | }
|
9636 + | /// A builder for [`ConB`](crate::model::ConB).
|
9637 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9638 + | pub struct Builder {
|
9639 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9640 + | pub(crate) int: ::std::option::Option<i32>,
|
9641 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9642 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
9643 + | }
|
9644 + | impl Builder {
|
9645 + | #[allow(missing_docs)] // documentation missing in model
|
9646 + | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
9647 + | self.nice = Some(input);
|
9648 + | self
|
9649 + | }
|
9650 + | #[allow(missing_docs)] // documentation missing in model
|
9651 + | pub fn int(mut self, input: i32) -> Self {
|
9652 + | self.int = Some(input);
|
9653 + | self
|
9654 + | }
|
9655 + | #[allow(missing_docs)] // documentation missing in model
|
9656 + | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
9657 + | self.opt_nice = input;
|
9658 + | self
|
9659 + | }
|
9660 + | #[allow(missing_docs)] // documentation missing in model
|
9661 + | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
9662 + | self.opt_int = input;
|
9663 + | self
|
9664 + | }
|
9665 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9666 + | ///
|
9667 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if you do not provide a value for all non-`Option`al members.
|
9668 + | ///
|
9669 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9670 + | self.build_enforcing_required_and_enum_traits()
|
9427 9671 | }
|
9672 + | fn build_enforcing_required_and_enum_traits(
|
9673 + | self,
|
9674 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9675 + | Ok(crate::model::ConB {
|
9676 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9677 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9678 + | opt_nice: self.opt_nice,
|
9679 + | opt_int: self.opt_int,
|
9680 + | })
|
9428 9681 | }
|
9429 9682 | }
|
9430 9683 | }
|
9431 - | pub(crate) mod set_of_pattern_string_internal {
|
9684 + | pub(crate) mod min_length_string_internal {
|
9432 9685 |
|
9433 - | #[allow(clippy::enum_variant_names)]
|
9434 9686 | #[derive(Debug, PartialEq)]
|
9435 - | pub(crate) enum ConstraintViolation {
|
9436 - | /// Constraint violation error when the list does not contain unique items
|
9437 - | UniqueItems {
|
9438 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9439 - | /// at least two elements.
|
9440 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9441 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9442 - | /// Nothing is guaranteed about the order of the indices.
|
9443 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9444 - | /// The original vector, that contains duplicate items.
|
9445 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
9446 - | },
|
9447 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9448 - | /// The first component of the tuple is the index in the collection where the
|
9449 - | /// first constraint violation was found.
|
9450 - | #[doc(hidden)]
|
9451 - | Member(
|
9452 - | usize,
|
9453 - | crate::model::pattern_string_internal::ConstraintViolation,
|
9454 - | ),
|
9687 + | pub enum ConstraintViolation {
|
9688 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
9689 + | Length(usize),
|
9455 9690 | }
|
9456 9691 |
|
9457 9692 | impl ::std::fmt::Display for ConstraintViolation {
|
9458 9693 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9459 9694 | let message = match self {
|
9460 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9461 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9462 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9463 - | failing_member)
|
9695 + | Self::Length(length) => {
|
9696 + | 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)
|
9697 + | }
|
9464 9698 | };
|
9465 9699 | write!(f, "{message}")
|
9466 9700 | }
|
9467 9701 | }
|
9468 9702 |
|
9469 9703 | impl ::std::error::Error for ConstraintViolation {}
|
9470 9704 | impl ConstraintViolation {
|
9471 9705 | pub(crate) fn as_validation_exception_field(
|
9472 9706 | self,
|
9473 9707 | path: ::std::string::String,
|
9474 9708 | ) -> crate::model::ValidationExceptionField {
|
9475 9709 | match self {
|
9476 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9477 - | crate::model::ValidationExceptionField {
|
9478 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9710 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9711 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
9479 9712 | path,
|
9480 9713 | },
|
9481 - | Self::Member(index, member_constraint_violation) =>
|
9482 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9483 9714 | }
|
9484 9715 | }
|
9485 9716 | }
|
9486 9717 | }
|
9487 - | pub(crate) mod map_of_range_byte_internal {
|
9718 + | pub(crate) mod max_length_string_internal {
|
9488 9719 |
|
9489 - | #[allow(clippy::enum_variant_names)]
|
9490 9720 | #[derive(Debug, PartialEq)]
|
9491 - | pub(crate) enum ConstraintViolation {
|
9492 - | #[doc(hidden)]
|
9493 - | Value(
|
9494 - | ::std::string::String,
|
9495 - | crate::model::range_byte_internal::ConstraintViolation,
|
9496 - | ),
|
9721 + | pub enum ConstraintViolation {
|
9722 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
9723 + | Length(usize),
|
9497 9724 | }
|
9498 9725 |
|
9499 9726 | impl ::std::fmt::Display for ConstraintViolation {
|
9500 9727 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9501 - | match self {
|
9502 - | Self::Value(_, value_constraint_violation) => {
|
9503 - | write!(f, "{}", value_constraint_violation)
|
9504 - | }
|
9728 + | let message = match self {
|
9729 + | Self::Length(length) => {
|
9730 + | 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)
|
9505 9731 | }
|
9732 + | };
|
9733 + | write!(f, "{message}")
|
9506 9734 | }
|
9507 9735 | }
|
9508 9736 |
|
9509 9737 | impl ::std::error::Error for ConstraintViolation {}
|
9510 9738 | impl ConstraintViolation {
|
9511 9739 | pub(crate) fn as_validation_exception_field(
|
9512 9740 | self,
|
9513 9741 | path: ::std::string::String,
|
9514 9742 | ) -> crate::model::ValidationExceptionField {
|
9515 9743 | match self {
|
9516 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9517 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9744 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9745 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9746 + | path,
|
9747 + | },
|
9518 9748 | }
|
9519 9749 | }
|
9520 9750 | }
|
9521 9751 | }
|
9522 - | pub(crate) mod range_byte_internal {
|
9752 + | pub(crate) mod fixed_length_string_internal {
|
9523 9753 |
|
9524 9754 | #[derive(Debug, PartialEq)]
|
9525 9755 | pub enum ConstraintViolation {
|
9526 - | Range(i8),
|
9756 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
9757 + | Length(usize),
|
9527 9758 | }
|
9528 9759 |
|
9529 9760 | impl ::std::fmt::Display for ConstraintViolation {
|
9530 9761 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9531 - | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
9762 + | let message = match self {
|
9763 + | Self::Length(length) => {
|
9764 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
9765 + | }
|
9766 + | };
|
9767 + | write!(f, "{message}")
|
9532 9768 | }
|
9533 9769 | }
|
9534 9770 |
|
9535 9771 | impl ::std::error::Error for ConstraintViolation {}
|
9536 9772 | impl ConstraintViolation {
|
9537 9773 | pub(crate) fn as_validation_exception_field(
|
9538 9774 | self,
|
9539 9775 | path: ::std::string::String,
|
9540 9776 | ) -> crate::model::ValidationExceptionField {
|
9541 9777 | match self {
|
9542 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9543 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
9778 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9779 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
9544 9780 | path,
|
9545 9781 | },
|
9546 9782 | }
|
9547 - | }
|
9548 - | }
|
9549 - | }
|
9550 - | pub(crate) mod set_of_range_byte_internal {
|
9551 - |
|
9552 - | #[allow(clippy::enum_variant_names)]
|
9553 - | #[derive(Debug, PartialEq)]
|
9554 - | pub(crate) enum ConstraintViolation {
|
9555 - | /// Constraint violation error when the list does not contain unique items
|
9556 - | UniqueItems {
|
9557 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9558 - | /// at least two elements.
|
9559 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9560 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9561 - | /// Nothing is guaranteed about the order of the indices.
|
9562 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9563 - | /// The original vector, that contains duplicate items.
|
9564 - | original: ::std::vec::Vec<crate::model::RangeByte>,
|
9565 - | },
|
9566 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9567 - | /// The first component of the tuple is the index in the collection where the
|
9568 - | /// first constraint violation was found.
|
9569 - | #[doc(hidden)]
|
9570 - | Member(
|
9571 - | usize,
|
9572 - | crate::model::range_byte_internal::ConstraintViolation,
|
9573 - | ),
|
9574 - | }
|
9783 + | }
|
9784 + | }
|
9785 + | }
|
9786 + | pub(crate) mod length_blob_internal {
|
9787 + |
|
9788 + | #[derive(Debug, PartialEq)]
|
9789 + | pub enum ConstraintViolation {
|
9790 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9791 + | Length(usize),
|
9792 + | }
|
9575 9793 |
|
9576 9794 | impl ::std::fmt::Display for ConstraintViolation {
|
9577 9795 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9578 9796 | let message = match self {
|
9579 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9580 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9581 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9582 - | failing_member)
|
9797 + | Self::Length(length) => {
|
9798 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
9799 + | }
|
9583 9800 | };
|
9584 9801 | write!(f, "{message}")
|
9585 9802 | }
|
9586 9803 | }
|
9587 9804 |
|
9588 9805 | impl ::std::error::Error for ConstraintViolation {}
|
9589 9806 | impl ConstraintViolation {
|
9590 9807 | pub(crate) fn as_validation_exception_field(
|
9591 9808 | self,
|
9592 9809 | path: ::std::string::String,
|
9593 9810 | ) -> crate::model::ValidationExceptionField {
|
9594 9811 | match self {
|
9595 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9596 - | crate::model::ValidationExceptionField {
|
9597 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9812 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9813 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
9598 9814 | path,
|
9599 9815 | },
|
9600 - | Self::Member(index, member_constraint_violation) =>
|
9601 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9602 9816 | }
|
9603 9817 | }
|
9604 9818 | }
|
9605 9819 | }
|
9606 - | pub(crate) mod list_of_range_byte_internal {
|
9820 + | pub(crate) mod min_length_blob_internal {
|
9607 9821 |
|
9608 - | #[allow(clippy::enum_variant_names)]
|
9609 9822 | #[derive(Debug, PartialEq)]
|
9610 - | pub(crate) enum ConstraintViolation {
|
9611 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9612 - | /// The first component of the tuple is the index in the collection where the
|
9613 - | /// first constraint violation was found.
|
9614 - | #[doc(hidden)]
|
9615 - | Member(
|
9616 - | usize,
|
9617 - | crate::model::range_byte_internal::ConstraintViolation,
|
9618 - | ),
|
9823 + | pub enum ConstraintViolation {
|
9824 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9825 + | Length(usize),
|
9619 9826 | }
|
9620 9827 |
|
9621 9828 | impl ::std::fmt::Display for ConstraintViolation {
|
9622 9829 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9623 9830 | let message = match self {
|
9624 - | Self::Member(index, failing_member) => format!(
|
9625 - | "Value at index {index} failed to satisfy constraint. {}",
|
9626 - | failing_member
|
9627 - | ),
|
9831 + | Self::Length(length) => {
|
9832 + | 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)
|
9833 + | }
|
9628 9834 | };
|
9629 9835 | write!(f, "{message}")
|
9630 9836 | }
|
9631 9837 | }
|
9632 9838 |
|
9633 9839 | impl ::std::error::Error for ConstraintViolation {}
|
9634 9840 | impl ConstraintViolation {
|
9635 9841 | pub(crate) fn as_validation_exception_field(
|
9636 9842 | self,
|
9637 9843 | path: ::std::string::String,
|
9638 9844 | ) -> crate::model::ValidationExceptionField {
|
9639 9845 | match self {
|
9640 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9641 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9846 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9847 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
9848 + | path,
|
9849 + | },
|
9642 9850 | }
|
9643 9851 | }
|
9644 9852 | }
|
9645 9853 | }
|
9646 - | pub(crate) mod map_of_range_long_internal {
|
9854 + | pub(crate) mod max_length_blob_internal {
|
9647 9855 |
|
9648 - | #[allow(clippy::enum_variant_names)]
|
9649 9856 | #[derive(Debug, PartialEq)]
|
9650 - | pub(crate) enum ConstraintViolation {
|
9651 - | #[doc(hidden)]
|
9652 - | Value(
|
9653 - | ::std::string::String,
|
9654 - | crate::model::range_long_internal::ConstraintViolation,
|
9655 - | ),
|
9857 + | pub enum ConstraintViolation {
|
9858 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9859 + | Length(usize),
|
9656 9860 | }
|
9657 9861 |
|
9658 9862 | impl ::std::fmt::Display for ConstraintViolation {
|
9659 9863 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9660 - | match self {
|
9661 - | Self::Value(_, value_constraint_violation) => {
|
9662 - | write!(f, "{}", value_constraint_violation)
|
9663 - | }
|
9864 + | let message = match self {
|
9865 + | Self::Length(length) => {
|
9866 + | 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)
|
9664 9867 | }
|
9868 + | };
|
9869 + | write!(f, "{message}")
|
9665 9870 | }
|
9666 9871 | }
|
9667 9872 |
|
9668 9873 | impl ::std::error::Error for ConstraintViolation {}
|
9669 9874 | impl ConstraintViolation {
|
9670 9875 | pub(crate) fn as_validation_exception_field(
|
9671 9876 | self,
|
9672 9877 | path: ::std::string::String,
|
9673 9878 | ) -> crate::model::ValidationExceptionField {
|
9674 9879 | match self {
|
9675 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9676 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9880 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9881 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
9882 + | path,
|
9883 + | },
|
9677 9884 | }
|
9678 9885 | }
|
9679 9886 | }
|
9680 9887 | }
|
9681 - | pub(crate) mod range_long_internal {
|
9888 + | pub(crate) mod fixed_length_blob_internal {
|
9682 9889 |
|
9683 9890 | #[derive(Debug, PartialEq)]
|
9684 9891 | pub enum ConstraintViolation {
|
9685 - | Range(i64),
|
9892 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9893 + | Length(usize),
|
9686 9894 | }
|
9687 9895 |
|
9688 9896 | impl ::std::fmt::Display for ConstraintViolation {
|
9689 9897 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9690 - | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
9898 + | let message = match self {
|
9899 + | Self::Length(length) => {
|
9900 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
9901 + | }
|
9902 + | };
|
9903 + | write!(f, "{message}")
|
9691 9904 | }
|
9692 9905 | }
|
9693 9906 |
|
9694 9907 | impl ::std::error::Error for ConstraintViolation {}
|
9695 9908 | impl ConstraintViolation {
|
9696 9909 | pub(crate) fn as_validation_exception_field(
|
9697 9910 | self,
|
9698 9911 | path: ::std::string::String,
|
9699 9912 | ) -> crate::model::ValidationExceptionField {
|
9700 9913 | match self {
|
9701 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
9702 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
9914 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9915 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
9703 9916 | path,
|
9704 9917 | },
|
9705 9918 | }
|
9706 9919 | }
|
9707 9920 | }
|
9708 9921 | }
|
9709 - | pub(crate) mod set_of_range_long_internal {
|
9922 + | pub(crate) mod min_range_integer_internal {
|
9710 9923 |
|
9711 - | #[allow(clippy::enum_variant_names)]
|
9712 9924 | #[derive(Debug, PartialEq)]
|
9713 - | pub(crate) enum ConstraintViolation {
|
9714 - | /// Constraint violation error when the list does not contain unique items
|
9715 - | UniqueItems {
|
9716 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9717 - | /// at least two elements.
|
9718 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9719 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9720 - | /// Nothing is guaranteed about the order of the indices.
|
9721 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9722 - | /// The original vector, that contains duplicate items.
|
9723 - | original: ::std::vec::Vec<crate::model::RangeLong>,
|
9724 - | },
|
9725 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9726 - | /// The first component of the tuple is the index in the collection where the
|
9727 - | /// first constraint violation was found.
|
9728 - | #[doc(hidden)]
|
9729 - | Member(
|
9730 - | usize,
|
9731 - | crate::model::range_long_internal::ConstraintViolation,
|
9732 - | ),
|
9925 + | pub enum ConstraintViolation {
|
9926 + | Range(i32),
|
9733 9927 | }
|
9734 9928 |
|
9735 9929 | impl ::std::fmt::Display for ConstraintViolation {
|
9736 9930 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9737 - | let message = match self {
|
9738 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9739 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9740 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9741 - | failing_member)
|
9742 - | };
|
9743 - | write!(f, "{message}")
|
9931 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9744 9932 | }
|
9745 9933 | }
|
9746 9934 |
|
9747 9935 | impl ::std::error::Error for ConstraintViolation {}
|
9748 9936 | impl ConstraintViolation {
|
9749 9937 | pub(crate) fn as_validation_exception_field(
|
9750 9938 | self,
|
9751 9939 | path: ::std::string::String,
|
9752 9940 | ) -> crate::model::ValidationExceptionField {
|
9753 9941 | match self {
|
9754 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9755 - | crate::model::ValidationExceptionField {
|
9756 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9942 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9943 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9757 9944 | path,
|
9758 9945 | },
|
9759 - | Self::Member(index, member_constraint_violation) =>
|
9760 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9761 9946 | }
|
9762 9947 | }
|
9763 9948 | }
|
9764 9949 | }
|
9765 - | pub(crate) mod list_of_range_long_internal {
|
9950 + | pub(crate) mod max_range_integer_internal {
|
9766 9951 |
|
9767 - | #[allow(clippy::enum_variant_names)]
|
9768 9952 | #[derive(Debug, PartialEq)]
|
9769 - | pub(crate) enum ConstraintViolation {
|
9770 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9771 - | /// The first component of the tuple is the index in the collection where the
|
9772 - | /// first constraint violation was found.
|
9773 - | #[doc(hidden)]
|
9774 - | Member(
|
9775 - | usize,
|
9776 - | crate::model::range_long_internal::ConstraintViolation,
|
9777 - | ),
|
9953 + | pub enum ConstraintViolation {
|
9954 + | Range(i32),
|
9778 9955 | }
|
9779 9956 |
|
9780 9957 | impl ::std::fmt::Display for ConstraintViolation {
|
9781 9958 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9782 - | let message = match self {
|
9783 - | Self::Member(index, failing_member) => format!(
|
9784 - | "Value at index {index} failed to satisfy constraint. {}",
|
9785 - | failing_member
|
9786 - | ),
|
9787 - | };
|
9788 - | write!(f, "{message}")
|
9959 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
9789 9960 | }
|
9790 9961 | }
|
9791 9962 |
|
9792 9963 | impl ::std::error::Error for ConstraintViolation {}
|
9793 9964 | impl ConstraintViolation {
|
9794 9965 | pub(crate) fn as_validation_exception_field(
|
9795 9966 | self,
|
9796 9967 | path: ::std::string::String,
|
9797 9968 | ) -> crate::model::ValidationExceptionField {
|
9798 9969 | match self {
|
9799 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9800 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9970 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9971 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
9972 + | path,
|
9973 + | },
|
9801 9974 | }
|
9802 9975 | }
|
9803 9976 | }
|
9804 9977 | }
|
9805 - | pub(crate) mod map_of_range_short_internal {
|
9978 + | pub(crate) mod fixed_value_integer_internal {
|
9806 9979 |
|
9807 - | #[allow(clippy::enum_variant_names)]
|
9808 9980 | #[derive(Debug, PartialEq)]
|
9809 - | pub(crate) enum ConstraintViolation {
|
9810 - | #[doc(hidden)]
|
9811 - | Value(
|
9812 - | ::std::string::String,
|
9813 - | crate::model::range_short_internal::ConstraintViolation,
|
9814 - | ),
|
9981 + | pub enum ConstraintViolation {
|
9982 + | Range(i32),
|
9815 9983 | }
|
9816 9984 |
|
9817 9985 | impl ::std::fmt::Display for ConstraintViolation {
|
9818 9986 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9819 - | match self {
|
9820 - | Self::Value(_, value_constraint_violation) => {
|
9821 - | write!(f, "{}", value_constraint_violation)
|
9822 - | }
|
9823 - | }
|
9987 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
9824 9988 | }
|
9825 9989 | }
|
9826 9990 |
|
9827 9991 | impl ::std::error::Error for ConstraintViolation {}
|
9828 9992 | impl ConstraintViolation {
|
9829 9993 | pub(crate) fn as_validation_exception_field(
|
9830 9994 | self,
|
9831 9995 | path: ::std::string::String,
|
9832 9996 | ) -> crate::model::ValidationExceptionField {
|
9833 9997 | match self {
|
9834 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9835 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9998 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9999 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
10000 + | path,
|
10001 + | },
|
9836 10002 | }
|
9837 10003 | }
|
9838 10004 | }
|
9839 10005 | }
|
9840 - | pub(crate) mod range_short_internal {
|
10006 + | pub(crate) mod min_range_short_internal {
|
9841 10007 |
|
9842 10008 | #[derive(Debug, PartialEq)]
|
9843 10009 | pub enum ConstraintViolation {
|
9844 10010 | Range(i16),
|
9845 10011 | }
|
9846 10012 |
|
9847 10013 | impl ::std::fmt::Display for ConstraintViolation {
|
9848 10014 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9849 - | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
10015 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9850 10016 | }
|
9851 10017 | }
|
9852 10018 |
|
9853 10019 | impl ::std::error::Error for ConstraintViolation {}
|
9854 10020 | impl ConstraintViolation {
|
9855 10021 | pub(crate) fn as_validation_exception_field(
|
9856 10022 | self,
|
9857 10023 | path: ::std::string::String,
|
9858 10024 | ) -> crate::model::ValidationExceptionField {
|
9859 10025 | match self {
|
9860 10026 | Self::Range(_) => crate::model::ValidationExceptionField {
|
9861 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
10027 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9862 10028 | path,
|
9863 10029 | },
|
9864 10030 | }
|
9865 10031 | }
|
9866 10032 | }
|
9867 10033 | }
|
9868 - | pub(crate) mod set_of_range_short_internal {
|
10034 + | pub(crate) mod max_range_short_internal {
|
9869 10035 |
|
9870 - | #[allow(clippy::enum_variant_names)]
|
9871 10036 | #[derive(Debug, PartialEq)]
|
9872 - | pub(crate) enum ConstraintViolation {
|
9873 - | /// Constraint violation error when the list does not contain unique items
|
9874 - | UniqueItems {
|
9875 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9876 - | /// at least two elements.
|
9877 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9878 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9879 - | /// Nothing is guaranteed about the order of the indices.
|
9880 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9881 - | /// The original vector, that contains duplicate items.
|
9882 - | original: ::std::vec::Vec<crate::model::RangeShort>,
|
9883 - | },
|
9884 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9885 - | /// The first component of the tuple is the index in the collection where the
|
9886 - | /// first constraint violation was found.
|
9887 - | #[doc(hidden)]
|
9888 - | Member(
|
9889 - | usize,
|
9890 - | crate::model::range_short_internal::ConstraintViolation,
|
9891 - | ),
|
10037 + | pub enum ConstraintViolation {
|
10038 + | Range(i16),
|
9892 10039 | }
|
9893 10040 |
|
9894 10041 | impl ::std::fmt::Display for ConstraintViolation {
|
9895 10042 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9896 - | let message = match self {
|
9897 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9898 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9899 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9900 - | failing_member)
|
9901 - | };
|
9902 - | write!(f, "{message}")
|
10043 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
9903 10044 | }
|
9904 10045 | }
|
9905 10046 |
|
9906 10047 | impl ::std::error::Error for ConstraintViolation {}
|
9907 10048 | impl ConstraintViolation {
|
9908 10049 | pub(crate) fn as_validation_exception_field(
|
9909 10050 | self,
|
9910 10051 | path: ::std::string::String,
|
9911 10052 | ) -> crate::model::ValidationExceptionField {
|
9912 10053 | match self {
|
9913 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9914 - | crate::model::ValidationExceptionField {
|
9915 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10054 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10055 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9916 10056 | path,
|
9917 10057 | },
|
9918 - | Self::Member(index, member_constraint_violation) =>
|
9919 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9920 10058 | }
|
9921 10059 | }
|
9922 10060 | }
|
9923 10061 | }
|
9924 - | pub(crate) mod list_of_range_short_internal {
|
10062 + | pub(crate) mod fixed_value_short_internal {
|
9925 10063 |
|
9926 - | #[allow(clippy::enum_variant_names)]
|
9927 10064 | #[derive(Debug, PartialEq)]
|
9928 - | pub(crate) enum ConstraintViolation {
|
9929 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9930 - | /// The first component of the tuple is the index in the collection where the
|
9931 - | /// first constraint violation was found.
|
9932 - | #[doc(hidden)]
|
9933 - | Member(
|
9934 - | usize,
|
9935 - | crate::model::range_short_internal::ConstraintViolation,
|
9936 - | ),
|
9937 - | }
|
9938 - |
|
9939 - | impl ::std::fmt::Display for ConstraintViolation {
|
9940 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9941 - | let message = match self {
|
9942 - | Self::Member(index, failing_member) => format!(
|
9943 - | "Value at index {index} failed to satisfy constraint. {}",
|
9944 - | failing_member
|
9945 - | ),
|
9946 - | };
|
9947 - | write!(f, "{message}")
|
10065 + | pub enum ConstraintViolation {
|
10066 + | Range(i16),
|
10067 + | }
|
10068 + |
|
10069 + | impl ::std::fmt::Display for ConstraintViolation {
|
10070 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10071 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9948 10072 | }
|
9949 10073 | }
|
9950 10074 |
|
9951 10075 | impl ::std::error::Error for ConstraintViolation {}
|
9952 10076 | impl ConstraintViolation {
|
9953 10077 | pub(crate) fn as_validation_exception_field(
|
9954 10078 | self,
|
9955 10079 | path: ::std::string::String,
|
9956 10080 | ) -> crate::model::ValidationExceptionField {
|
9957 10081 | match self {
|
9958 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9959 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10082 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10083 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10084 + | path,
|
10085 + | },
|
9960 10086 | }
|
9961 10087 | }
|
9962 10088 | }
|
9963 10089 | }
|
9964 - | pub(crate) mod map_of_range_integer_internal {
|
10090 + | pub(crate) mod min_range_long_internal {
|
9965 10091 |
|
9966 - | #[allow(clippy::enum_variant_names)]
|
9967 10092 | #[derive(Debug, PartialEq)]
|
9968 - | pub(crate) enum ConstraintViolation {
|
9969 - | #[doc(hidden)]
|
9970 - | Value(
|
9971 - | ::std::string::String,
|
9972 - | crate::model::range_integer_internal::ConstraintViolation,
|
9973 - | ),
|
10093 + | pub enum ConstraintViolation {
|
10094 + | Range(i64),
|
9974 10095 | }
|
9975 10096 |
|
9976 10097 | impl ::std::fmt::Display for ConstraintViolation {
|
9977 10098 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9978 - | match self {
|
9979 - | Self::Value(_, value_constraint_violation) => {
|
9980 - | write!(f, "{}", value_constraint_violation)
|
9981 - | }
|
9982 - | }
|
10099 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9983 10100 | }
|
9984 10101 | }
|
9985 10102 |
|
9986 10103 | impl ::std::error::Error for ConstraintViolation {}
|
9987 10104 | impl ConstraintViolation {
|
9988 10105 | pub(crate) fn as_validation_exception_field(
|
9989 10106 | self,
|
9990 10107 | path: ::std::string::String,
|
9991 10108 | ) -> crate::model::ValidationExceptionField {
|
9992 10109 | match self {
|
9993 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9994 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
10110 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10111 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10112 + | path,
|
10113 + | },
|
9995 10114 | }
|
9996 10115 | }
|
9997 10116 | }
|
9998 10117 | }
|
9999 - | pub(crate) mod range_integer_internal {
|
10118 + | pub(crate) mod max_range_long_internal {
|
10000 10119 |
|
10001 10120 | #[derive(Debug, PartialEq)]
|
10002 10121 | pub enum ConstraintViolation {
|
10003 - | Range(i32),
|
10122 + | Range(i64),
|
10004 10123 | }
|
10005 10124 |
|
10006 10125 | impl ::std::fmt::Display for ConstraintViolation {
|
10007 10126 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10008 - | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
10127 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
10009 10128 | }
|
10010 10129 | }
|
10011 10130 |
|
10012 10131 | impl ::std::error::Error for ConstraintViolation {}
|
10013 10132 | impl ConstraintViolation {
|
10014 10133 | pub(crate) fn as_validation_exception_field(
|
10015 10134 | self,
|
10016 10135 | path: ::std::string::String,
|
10017 10136 | ) -> crate::model::ValidationExceptionField {
|
10018 10137 | match self {
|
10019 10138 | Self::Range(_) => crate::model::ValidationExceptionField {
|
10020 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
10139 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10021 10140 | path,
|
10022 10141 | },
|
10023 10142 | }
|
10024 10143 | }
|
10025 10144 | }
|
10026 10145 | }
|
10027 - | pub(crate) mod set_of_range_integer_internal {
|
10146 + | pub(crate) mod fixed_value_long_internal {
|
10028 10147 |
|
10029 - | #[allow(clippy::enum_variant_names)]
|
10030 10148 | #[derive(Debug, PartialEq)]
|
10031 - | pub(crate) enum ConstraintViolation {
|
10032 - | /// Constraint violation error when the list does not contain unique items
|
10033 - | UniqueItems {
|
10034 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10035 - | /// at least two elements.
|
10036 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10037 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10038 - | /// Nothing is guaranteed about the order of the indices.
|
10039 - | duplicate_indices: ::std::vec::Vec<usize>,
|
10040 - | /// The original vector, that contains duplicate items.
|
10041 - | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
10042 - | },
|
10043 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10044 - | /// The first component of the tuple is the index in the collection where the
|
10045 - | /// first constraint violation was found.
|
10046 - | #[doc(hidden)]
|
10047 - | Member(
|
10048 - | usize,
|
10049 - | crate::model::range_integer_internal::ConstraintViolation,
|
10050 - | ),
|
10149 + | pub enum ConstraintViolation {
|
10150 + | Range(i64),
|
10051 10151 | }
|
10052 10152 |
|
10053 10153 | impl ::std::fmt::Display for ConstraintViolation {
|
10054 10154 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10055 - | let message = match self {
|
10056 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10057 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10058 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
10059 - | failing_member)
|
10060 - | };
|
10061 - | write!(f, "{message}")
|
10155 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10062 10156 | }
|
10063 10157 | }
|
10064 10158 |
|
10065 10159 | impl ::std::error::Error for ConstraintViolation {}
|
10066 10160 | impl ConstraintViolation {
|
10067 10161 | pub(crate) fn as_validation_exception_field(
|
10068 10162 | self,
|
10069 10163 | path: ::std::string::String,
|
10070 10164 | ) -> crate::model::ValidationExceptionField {
|
10071 10165 | match self {
|
10072 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10073 - | crate::model::ValidationExceptionField {
|
10074 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10166 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10167 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10075 10168 | path,
|
10076 10169 | },
|
10077 - | Self::Member(index, member_constraint_violation) =>
|
10078 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
10079 10170 | }
|
10080 10171 | }
|
10081 10172 | }
|
10082 10173 | }
|
10083 - | pub(crate) mod list_of_range_integer_internal {
|
10174 + | pub(crate) mod min_range_byte_internal {
|
10084 10175 |
|
10085 - | #[allow(clippy::enum_variant_names)]
|
10086 10176 | #[derive(Debug, PartialEq)]
|
10087 - | pub(crate) enum ConstraintViolation {
|
10088 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10089 - | /// The first component of the tuple is the index in the collection where the
|
10090 - | /// first constraint violation was found.
|
10091 - | #[doc(hidden)]
|
10092 - | Member(
|
10093 - | usize,
|
10094 - | crate::model::range_integer_internal::ConstraintViolation,
|
10095 - | ),
|
10177 + | pub enum ConstraintViolation {
|
10178 + | Range(i8),
|
10096 10179 | }
|
10097 10180 |
|
10098 10181 | impl ::std::fmt::Display for ConstraintViolation {
|
10099 10182 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10100 - | let message = match self {
|
10101 - | Self::Member(index, failing_member) => format!(
|
10102 - | "Value at index {index} failed to satisfy constraint. {}",
|
10103 - | failing_member
|
10104 - | ),
|
10105 - | };
|
10106 - | write!(f, "{message}")
|
10183 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10107 10184 | }
|
10108 10185 | }
|
10109 10186 |
|
10110 10187 | impl ::std::error::Error for ConstraintViolation {}
|
10111 10188 | impl ConstraintViolation {
|
10112 10189 | pub(crate) fn as_validation_exception_field(
|
10113 10190 | self,
|
10114 10191 | path: ::std::string::String,
|
10115 10192 | ) -> crate::model::ValidationExceptionField {
|
10116 10193 | match self {
|
10117 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10118 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10194 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10195 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10196 + | path,
|
10197 + | },
|
10119 10198 | }
|
10120 10199 | }
|
10121 10200 | }
|
10122 10201 | }
|
10123 - | pub(crate) mod map_of_length_blob_internal {
|
10202 + | pub(crate) mod max_range_byte_internal {
|
10124 10203 |
|
10125 - | #[allow(clippy::enum_variant_names)]
|
10126 10204 | #[derive(Debug, PartialEq)]
|
10127 - | pub(crate) enum ConstraintViolation {
|
10128 - | #[doc(hidden)]
|
10129 - | Value(
|
10130 - | ::std::string::String,
|
10131 - | crate::model::length_blob_internal::ConstraintViolation,
|
10132 - | ),
|
10205 + | pub enum ConstraintViolation {
|
10206 + | Range(i8),
|
10133 10207 | }
|
10134 10208 |
|
10135 10209 | impl ::std::fmt::Display for ConstraintViolation {
|
10136 10210 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10137 - | match self {
|
10138 - | Self::Value(_, value_constraint_violation) => {
|
10139 - | write!(f, "{}", value_constraint_violation)
|
10140 - | }
|
10141 - | }
|
10211 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
10142 10212 | }
|
10143 10213 | }
|
10144 10214 |
|
10145 10215 | impl ::std::error::Error for ConstraintViolation {}
|
10146 10216 | impl ConstraintViolation {
|
10147 10217 | pub(crate) fn as_validation_exception_field(
|
10148 10218 | self,
|
10149 10219 | path: ::std::string::String,
|
10150 10220 | ) -> crate::model::ValidationExceptionField {
|
10151 10221 | match self {
|
10152 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10153 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
10222 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10223 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10224 + | path,
|
10225 + | },
|
10154 10226 | }
|
10155 10227 | }
|
10156 10228 | }
|
10157 10229 | }
|
10158 - | pub(crate) mod length_blob_internal {
|
10230 + | pub(crate) mod fixed_value_byte_internal {
|
10159 10231 |
|
10160 10232 | #[derive(Debug, PartialEq)]
|
10161 10233 | pub enum ConstraintViolation {
|
10162 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10163 - | Length(usize),
|
10234 + | Range(i8),
|
10164 10235 | }
|
10165 10236 |
|
10166 10237 | impl ::std::fmt::Display for ConstraintViolation {
|
10167 10238 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10168 - | let message = match self {
|
10169 - | Self::Length(length) => {
|
10170 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
10171 - | }
|
10172 - | };
|
10173 - | write!(f, "{message}")
|
10239 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10174 10240 | }
|
10175 10241 | }
|
10176 10242 |
|
10177 10243 | impl ::std::error::Error for ConstraintViolation {}
|
10178 10244 | impl ConstraintViolation {
|
10179 10245 | pub(crate) fn as_validation_exception_field(
|
10180 10246 | self,
|
10181 10247 | path: ::std::string::String,
|
10182 10248 | ) -> crate::model::ValidationExceptionField {
|
10183 10249 | match self {
|
10184 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10185 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
10250 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
10251 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10186 10252 | path,
|
10187 10253 | },
|
10188 10254 | }
|
10189 10255 | }
|
10190 10256 | }
|
10191 10257 | }
|
10192 - | pub(crate) mod list_of_length_blob_internal {
|
10258 + | pub(crate) mod con_b_list_internal {
|
10193 10259 |
|
10194 10260 | #[allow(clippy::enum_variant_names)]
|
10195 10261 | #[derive(Debug, PartialEq)]
|
10196 10262 | pub(crate) enum ConstraintViolation {
|
10197 10263 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10198 10264 | /// The first component of the tuple is the index in the collection where the
|
10199 10265 | /// first constraint violation was found.
|
10200 10266 | #[doc(hidden)]
|
10201 10267 | Member(
|
10202 10268 | usize,
|
10203 - | crate::model::length_blob_internal::ConstraintViolation,
|
10269 + | crate::model::con_b_list_inner_internal::ConstraintViolation,
|
10204 10270 | ),
|
10205 10271 | }
|
10206 10272 |
|
10207 10273 | impl ::std::fmt::Display for ConstraintViolation {
|
10208 10274 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10209 10275 | let message = match self {
|
10210 10276 | Self::Member(index, failing_member) => format!(
|
10211 10277 | "Value at index {index} failed to satisfy constraint. {}",
|
10212 10278 | failing_member
|
10213 10279 | ),
|
10214 10280 | };
|
10215 10281 | write!(f, "{message}")
|
10216 10282 | }
|
10217 10283 | }
|
10218 10284 |
|
10219 10285 | impl ::std::error::Error for ConstraintViolation {}
|
10220 10286 | impl ConstraintViolation {
|
10221 10287 | pub(crate) fn as_validation_exception_field(
|
10222 10288 | self,
|
10223 10289 | path: ::std::string::String,
|
10224 10290 | ) -> crate::model::ValidationExceptionField {
|
10225 10291 | match self {
|
10226 10292 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10227 10293 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10228 10294 | }
|
10229 10295 | }
|
10230 10296 | }
|
10231 10297 | }
|
10232 - | pub(crate) mod constrained_union_internal {
|
10298 + | pub(crate) mod length_list_internal {
|
10233 10299 |
|
10234 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10235 10300 | #[allow(clippy::enum_variant_names)]
|
10301 + | #[derive(Debug, PartialEq)]
|
10236 10302 | pub(crate) enum ConstraintViolation {
|
10237 - | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
10238 - | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
10239 - | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
10240 - | ConstrainedStructure(crate::model::con_b_internal::ConstraintViolation),
|
10241 - | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
10242 - | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
10303 + | /// Constraint violation error when the list doesn't have the required length
|
10304 + | Length(usize),
|
10243 10305 | }
|
10306 + |
|
10244 10307 | impl ::std::fmt::Display for ConstraintViolation {
|
10245 10308 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10246 - | match self {
|
10247 - | Self::ConBList(inner) => write!(f, "{inner}"),
|
10248 - | Self::ConBMap(inner) => write!(f, "{inner}"),
|
10249 - | Self::ConBSet(inner) => write!(f, "{inner}"),
|
10250 - | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
10251 - | Self::EnumString(inner) => write!(f, "{inner}"),
|
10252 - | Self::LengthString(inner) => write!(f, "{inner}"),
|
10309 + | let message = match self {
|
10310 + | Self::Length(length) => {
|
10311 + | 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)
|
10253 10312 | }
|
10313 + | };
|
10314 + | write!(f, "{message}")
|
10254 10315 | }
|
10255 10316 | }
|
10256 10317 |
|
10257 10318 | impl ::std::error::Error for ConstraintViolation {}
|
10258 10319 | impl ConstraintViolation {
|
10259 10320 | pub(crate) fn as_validation_exception_field(
|
10260 10321 | self,
|
10261 10322 | path: ::std::string::String,
|
10262 10323 | ) -> crate::model::ValidationExceptionField {
|
10263 10324 | match self {
|
10264 - | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
10265 - | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
10266 - | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
10267 - | Self::ConstrainedStructure(inner) => {
|
10268 - | inner.as_validation_exception_field(path + "/constrainedStructure")
|
10325 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10326 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10327 + | path,
|
10328 + | },
|
10269 10329 | }
|
10270 - | Self::EnumString(inner) => {
|
10271 - | inner.as_validation_exception_field(path + "/enumString")
|
10272 10330 | }
|
10273 - | Self::LengthString(inner) => {
|
10274 - | inner.as_validation_exception_field(path + "/lengthString")
|
10275 10331 | }
|
10332 + | }
|
10333 + | pub(crate) mod sensitive_length_list_internal {
|
10334 + |
|
10335 + | #[allow(clippy::enum_variant_names)]
|
10336 + | #[derive(Debug, PartialEq)]
|
10337 + | pub(crate) enum ConstraintViolation {
|
10338 + | /// Constraint violation error when the list doesn't have the required length
|
10339 + | Length(usize),
|
10340 + | }
|
10341 + |
|
10342 + | impl ::std::fmt::Display for ConstraintViolation {
|
10343 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10344 + | let message = match self {
|
10345 + | Self::Length(length) => {
|
10346 + | 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)
|
10347 + | }
|
10348 + | };
|
10349 + | write!(f, "{message}")
|
10350 + | }
|
10351 + | }
|
10352 + |
|
10353 + | impl ::std::error::Error for ConstraintViolation {}
|
10354 + | impl ConstraintViolation {
|
10355 + | pub(crate) fn as_validation_exception_field(
|
10356 + | self,
|
10357 + | path: ::std::string::String,
|
10358 + | ) -> crate::model::ValidationExceptionField {
|
10359 + | match self {
|
10360 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10361 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10362 + | path,
|
10363 + | },
|
10276 10364 | }
|
10277 10365 | }
|
10278 10366 | }
|
10279 10367 | }
|
10280 10368 | pub(crate) mod con_b_set_internal {
|
10281 10369 |
|
10282 10370 | #[allow(clippy::enum_variant_names)]
|
10283 10371 | #[derive(Debug, PartialEq)]
|
10284 10372 | pub(crate) enum ConstraintViolation {
|
10285 10373 | /// Constraint violation error when the list does not contain unique items
|
10286 10374 | UniqueItems {
|
10287 10375 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10288 10376 | /// at least two elements.
|
10289 10377 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10290 10378 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10291 10379 | /// Nothing is guaranteed about the order of the indices.
|
10292 10380 | duplicate_indices: ::std::vec::Vec<usize>,
|
10293 10381 | /// The original vector, that contains duplicate items.
|
10294 10382 | original: ::std::vec::Vec<crate::model::ConBSetInner>,
|
10295 10383 | },
|
10296 10384 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10297 10385 | /// The first component of the tuple is the index in the collection where the
|
10298 10386 | /// first constraint violation was found.
|
10299 10387 | #[doc(hidden)]
|
10300 10388 | Member(
|
10301 10389 | usize,
|
10302 10390 | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
10303 10391 | ),
|
10304 10392 | }
|
10305 10393 |
|
10306 10394 | impl ::std::fmt::Display for ConstraintViolation {
|
10307 10395 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10308 10396 | let message = match self {
|
10309 10397 | Self::UniqueItems { duplicate_indices, .. } =>
|
10310 10398 | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10311 10399 | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
10312 10400 | failing_member)
|
10313 10401 | };
|
10314 10402 | write!(f, "{message}")
|
10315 10403 | }
|
10316 10404 | }
|
10317 10405 |
|
10318 10406 | impl ::std::error::Error for ConstraintViolation {}
|
10319 10407 | impl ConstraintViolation {
|
10320 10408 | pub(crate) fn as_validation_exception_field(
|
10321 10409 | self,
|
10322 10410 | path: ::std::string::String,
|
10323 10411 | ) -> crate::model::ValidationExceptionField {
|
10324 10412 | match self {
|
10325 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10326 - | crate::model::ValidationExceptionField {
|
10327 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10413 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10414 + | crate::model::ValidationExceptionField {
|
10415 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10416 + | path,
|
10417 + | },
|
10418 + | Self::Member(index, member_constraint_violation) =>
|
10419 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
10420 + | }
|
10421 + | }
|
10422 + | }
|
10423 + | }
|
10424 + | pub(crate) mod length_map_internal {
|
10425 + |
|
10426 + | #[allow(clippy::enum_variant_names)]
|
10427 + | #[derive(Debug, PartialEq)]
|
10428 + | pub(crate) enum ConstraintViolation {
|
10429 + | Length(usize),
|
10430 + | }
|
10431 + |
|
10432 + | impl ::std::fmt::Display for ConstraintViolation {
|
10433 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10434 + | match self {
|
10435 + | Self::Length(length) => {
|
10436 + | 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)
|
10437 + | }
|
10438 + | }
|
10439 + | }
|
10440 + | }
|
10441 + |
|
10442 + | impl ::std::error::Error for ConstraintViolation {}
|
10443 + | impl ConstraintViolation {
|
10444 + | pub(crate) fn as_validation_exception_field(
|
10445 + | self,
|
10446 + | path: ::std::string::String,
|
10447 + | ) -> crate::model::ValidationExceptionField {
|
10448 + | match self {
|
10449 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10450 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
10328 10451 | path,
|
10329 10452 | },
|
10330 - | Self::Member(index, member_constraint_violation) =>
|
10331 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
10332 10453 | }
|
10333 10454 | }
|
10334 10455 | }
|
10335 10456 | }
|
10336 - | pub(crate) mod con_b_set_inner_internal {
|
10457 + | pub(crate) mod map_of_map_of_list_of_list_of_con_b_internal {
|
10337 10458 |
|
10338 10459 | #[allow(clippy::enum_variant_names)]
|
10339 10460 | #[derive(Debug, PartialEq)]
|
10340 10461 | pub(crate) enum ConstraintViolation {
|
10341 - | /// Constraint violation error when the list does not contain unique items
|
10342 - | UniqueItems {
|
10343 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10344 - | /// at least two elements.
|
10345 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10346 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10347 - | /// Nothing is guaranteed about the order of the indices.
|
10348 - | duplicate_indices: ::std::vec::Vec<usize>,
|
10349 - | /// The original vector, that contains duplicate items.
|
10350 - | original: ::std::vec::Vec<::std::string::String>,
|
10351 - | },
|
10462 + | #[doc(hidden)]
|
10463 + | Value(
|
10464 + | ::std::string::String,
|
10465 + | crate::model::map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
10466 + | ),
|
10352 10467 | }
|
10353 10468 |
|
10354 10469 | impl ::std::fmt::Display for ConstraintViolation {
|
10355 10470 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10356 - | let message = match self {
|
10357 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10358 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10359 - | };
|
10360 - | write!(f, "{message}")
|
10471 + | match self {
|
10472 + | Self::Value(_, value_constraint_violation) => {
|
10473 + | write!(f, "{}", value_constraint_violation)
|
10474 + | }
|
10475 + | }
|
10361 10476 | }
|
10362 10477 | }
|
10363 10478 |
|
10364 10479 | impl ::std::error::Error for ConstraintViolation {}
|
10365 10480 | impl ConstraintViolation {
|
10366 10481 | pub(crate) fn as_validation_exception_field(
|
10367 10482 | self,
|
10368 10483 | path: ::std::string::String,
|
10369 10484 | ) -> crate::model::ValidationExceptionField {
|
10370 10485 | match self {
|
10371 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10372 - | crate::model::ValidationExceptionField {
|
10373 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10374 - | path,
|
10375 - | },
|
10486 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10487 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10376 10488 | }
|
10377 10489 | }
|
10378 10490 | }
|
10379 10491 | }
|
10380 - | pub(crate) mod con_b_list_internal {
|
10492 + | pub(crate) mod sparse_map_internal {
|
10381 10493 |
|
10382 10494 | #[allow(clippy::enum_variant_names)]
|
10383 10495 | #[derive(Debug, PartialEq)]
|
10384 10496 | pub(crate) enum ConstraintViolation {
|
10385 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10386 - | /// The first component of the tuple is the index in the collection where the
|
10387 - | /// first constraint violation was found.
|
10388 10497 | #[doc(hidden)]
|
10389 - | Member(
|
10390 - | usize,
|
10391 - | crate::model::con_b_list_inner_internal::ConstraintViolation,
|
10498 + | Value(
|
10499 + | ::std::string::String,
|
10500 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
10392 10501 | ),
|
10393 10502 | }
|
10394 10503 |
|
10395 10504 | impl ::std::fmt::Display for ConstraintViolation {
|
10396 10505 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10397 - | let message = match self {
|
10398 - | Self::Member(index, failing_member) => format!(
|
10399 - | "Value at index {index} failed to satisfy constraint. {}",
|
10400 - | failing_member
|
10401 - | ),
|
10402 - | };
|
10403 - | write!(f, "{message}")
|
10506 + | match self {
|
10507 + | Self::Value(_, value_constraint_violation) => {
|
10508 + | write!(f, "{}", value_constraint_violation)
|
10509 + | }
|
10510 + | }
|
10404 10511 | }
|
10405 10512 | }
|
10406 10513 |
|
10407 10514 | impl ::std::error::Error for ConstraintViolation {}
|
10408 10515 | impl ConstraintViolation {
|
10409 10516 | pub(crate) fn as_validation_exception_field(
|
10410 10517 | self,
|
10411 10518 | path: ::std::string::String,
|
10412 10519 | ) -> crate::model::ValidationExceptionField {
|
10413 10520 | match self {
|
10414 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10415 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10521 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10522 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10416 10523 | }
|
10417 10524 | }
|
10418 10525 | }
|
10419 10526 | }
|
10420 - | pub(crate) mod con_b_list_inner_internal {
|
10527 + | pub(crate) mod sparse_list_internal {
|
10421 10528 |
|
10422 10529 | #[allow(clippy::enum_variant_names)]
|
10423 10530 | #[derive(Debug, PartialEq)]
|
10424 10531 | pub(crate) enum ConstraintViolation {
|
10425 10532 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10426 10533 | /// The first component of the tuple is the index in the collection where the
|
10427 10534 | /// first constraint violation was found.
|
10428 10535 | #[doc(hidden)]
|
10429 - | Member(usize, crate::model::con_b_internal::ConstraintViolation),
|
10536 + | Member(
|
10537 + | usize,
|
10538 + | crate::model::length_string_internal::ConstraintViolation,
|
10539 + | ),
|
10430 10540 | }
|
10431 10541 |
|
10432 10542 | impl ::std::fmt::Display for ConstraintViolation {
|
10433 10543 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10434 10544 | let message = match self {
|
10435 10545 | Self::Member(index, failing_member) => format!(
|
10436 10546 | "Value at index {index} failed to satisfy constraint. {}",
|
10437 10547 | failing_member
|
10438 10548 | ),
|
10439 10549 | };
|
10440 10550 | write!(f, "{message}")
|
10441 10551 | }
|
10442 10552 | }
|
10443 10553 |
|
10444 10554 | impl ::std::error::Error for ConstraintViolation {}
|
10445 10555 | impl ConstraintViolation {
|
10446 10556 | pub(crate) fn as_validation_exception_field(
|
10447 10557 | self,
|
10448 10558 | path: ::std::string::String,
|
10449 10559 | ) -> crate::model::ValidationExceptionField {
|
10450 10560 | match self {
|
10451 10561 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10452 10562 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10453 10563 | }
|
10454 10564 | }
|
10455 10565 | }
|
10456 10566 | }
|
10457 - | /// See [`ConB`](crate::model::ConB).
|
10458 - | pub(crate) mod con_b_internal {
|
10567 + | pub(crate) mod sparse_length_map_internal {
|
10459 10568 |
|
10460 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10461 - | /// Holds one variant for each of the ways the builder can fail.
|
10462 - | #[non_exhaustive]
|
10463 10569 | #[allow(clippy::enum_variant_names)]
|
10570 + | #[derive(Debug, PartialEq)]
|
10464 10571 | pub(crate) enum ConstraintViolation {
|
10465 - | /// `nice` was not provided but it is required when building `ConB`.
|
10466 - | MissingNice,
|
10467 - | /// `int` was not provided but it is required when building `ConB`.
|
10468 - | MissingInt,
|
10469 - | }
|
10470 - | impl ::std::fmt::Display for ConstraintViolation {
|
10471 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10472 - | match self {
|
10473 - | ConstraintViolation::MissingNice => write!(
|
10474 - | f,
|
10475 - | "`nice` was not provided but it is required when building `ConB`"
|
10476 - | ),
|
10477 - | ConstraintViolation::MissingInt => write!(
|
10478 - | f,
|
10479 - | "`int` was not provided but it is required when building `ConB`"
|
10480 - | ),
|
10481 - | }
|
10482 - | }
|
10483 - | }
|
10484 - | impl ::std::error::Error for ConstraintViolation {}
|
10485 - | impl ConstraintViolation {
|
10486 - | pub(crate) fn as_validation_exception_field(
|
10487 - | self,
|
10488 - | path: ::std::string::String,
|
10489 - | ) -> crate::model::ValidationExceptionField {
|
10490 - | match self {
|
10491 - | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
10492 - | message: format!(
|
10493 - | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
10494 - | path
|
10495 - | ),
|
10496 - | path: path + "/nice",
|
10497 - | },
|
10498 - | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
10499 - | message: format!(
|
10500 - | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
10501 - | path
|
10502 - | ),
|
10503 - | path: path + "/int",
|
10504 - | },
|
10505 - | }
|
10506 - | }
|
10507 - | }
|
10508 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
10509 - | fn from(builder: Builder) -> Self {
|
10510 - | Self::Unconstrained(builder)
|
10511 - | }
|
10512 - | }
|
10513 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
10514 - | type Error = ConstraintViolation;
|
10515 - |
|
10516 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
10517 - | builder.build()
|
10518 - | }
|
10519 - | }
|
10520 - | /// A builder for [`ConB`](crate::model::ConB).
|
10521 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10522 - | pub(crate) struct Builder {
|
10523 - | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
10524 - | pub(crate) int: ::std::option::Option<i32>,
|
10525 - | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
10526 - | pub(crate) opt_int: ::std::option::Option<i32>,
|
10527 - | }
|
10528 - | impl Builder {
|
10529 - | #[allow(missing_docs)] // documentation missing in model
|
10530 - | pub(crate) fn set_nice(
|
10531 - | mut self,
|
10532 - | input: impl ::std::convert::Into<::std::string::String>,
|
10533 - | ) -> Self {
|
10534 - | self.nice = Some(input.into());
|
10535 - | self
|
10536 - | }
|
10537 - | #[allow(missing_docs)] // documentation missing in model
|
10538 - | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
10539 - | self.int = Some(input.into());
|
10540 - | self
|
10541 - | }
|
10542 - | #[allow(missing_docs)] // documentation missing in model
|
10543 - | pub(crate) fn set_opt_nice(
|
10544 - | mut self,
|
10545 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
10546 - | ) -> Self {
|
10547 - | self.opt_nice = input.map(|v| v.into());
|
10548 - | self
|
10549 - | }
|
10550 - | #[allow(missing_docs)] // documentation missing in model
|
10551 - | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
10552 - | self.opt_int = input.map(|v| v.into());
|
10553 - | self
|
10554 - | }
|
10555 - | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
10556 - | ///
|
10557 - | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
10558 - | ///
|
10559 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
10560 - | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
10561 - | self.build_enforcing_all_constraints()
|
10562 - | }
|
10563 - | fn build_enforcing_all_constraints(
|
10564 - | self,
|
10565 - | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
10566 - | Ok(crate::model::ConB {
|
10567 - | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
10568 - | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
10569 - | opt_nice: self.opt_nice,
|
10570 - | opt_int: self.opt_int,
|
10571 - | })
|
10572 - | }
|
10572 + | Length(usize),
|
10573 10573 | }
|
10574 - | }
|
10575 - | /// See [`ConB`](crate::model::ConB).
|
10576 - | pub mod con_b {
|
10577 10574 |
|
10578 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10579 - | /// Holds one variant for each of the ways the builder can fail.
|
10580 - | #[allow(clippy::enum_variant_names)]
|
10581 - | pub enum ConstraintViolation {
|
10582 - | /// `nice` was not provided but it is required when building `ConB`.
|
10583 - | MissingNice,
|
10584 - | /// `int` was not provided but it is required when building `ConB`.
|
10585 - | MissingInt,
|
10586 - | }
|
10587 10575 | impl ::std::fmt::Display for ConstraintViolation {
|
10588 10576 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10589 10577 | match self {
|
10590 - | ConstraintViolation::MissingNice => write!(
|
10591 - | f,
|
10592 - | "`nice` was not provided but it is required when building `ConB`"
|
10593 - | ),
|
10594 - | ConstraintViolation::MissingInt => write!(
|
10595 - | f,
|
10596 - | "`int` was not provided but it is required when building `ConB`"
|
10597 - | ),
|
10598 - | }
|
10599 - | }
|
10600 - | }
|
10601 - | impl ::std::error::Error for ConstraintViolation {}
|
10602 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
10603 - | type Error = ConstraintViolation;
|
10604 - |
|
10605 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
10606 - | builder.build()
|
10607 - | }
|
10608 - | }
|
10609 - | /// A builder for [`ConB`](crate::model::ConB).
|
10610 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10611 - | pub struct Builder {
|
10612 - | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
10613 - | pub(crate) int: ::std::option::Option<i32>,
|
10614 - | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
10615 - | pub(crate) opt_int: ::std::option::Option<i32>,
|
10616 - | }
|
10617 - | impl Builder {
|
10618 - | #[allow(missing_docs)] // documentation missing in model
|
10619 - | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
10620 - | self.nice = Some(input);
|
10621 - | self
|
10622 - | }
|
10623 - | #[allow(missing_docs)] // documentation missing in model
|
10624 - | pub fn int(mut self, input: i32) -> Self {
|
10625 - | self.int = Some(input);
|
10626 - | self
|
10627 - | }
|
10628 - | #[allow(missing_docs)] // documentation missing in model
|
10629 - | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
10630 - | self.opt_nice = input;
|
10631 - | self
|
10632 - | }
|
10633 - | #[allow(missing_docs)] // documentation missing in model
|
10634 - | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
10635 - | self.opt_int = input;
|
10636 - | self
|
10578 + | Self::Length(length) => {
|
10579 + | 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)
|
10637 10580 | }
|
10638 - | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
10639 - | ///
|
10640 - | /// The builder fails to construct a [`ConB`](crate::model::ConB) if you do not provide a value for all non-`Option`al members.
|
10641 - | ///
|
10642 - | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
10643 - | self.build_enforcing_required_and_enum_traits()
|
10644 10581 | }
|
10645 - | fn build_enforcing_required_and_enum_traits(
|
10582 + | }
|
10583 + | }
|
10584 + |
|
10585 + | impl ::std::error::Error for ConstraintViolation {}
|
10586 + | impl ConstraintViolation {
|
10587 + | pub(crate) fn as_validation_exception_field(
|
10646 10588 | self,
|
10647 - | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
10648 - | Ok(crate::model::ConB {
|
10649 - | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
10650 - | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
10651 - | opt_nice: self.opt_nice,
|
10652 - | opt_int: self.opt_int,
|
10653 - | })
|
10589 + | path: ::std::string::String,
|
10590 + | ) -> crate::model::ValidationExceptionField {
|
10591 + | match self {
|
10592 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10593 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
10594 + | path,
|
10595 + | },
|
10596 + | }
|
10654 10597 | }
|
10655 10598 | }
|
10656 10599 | }
|
10657 10600 | pub(crate) mod sparse_length_list_internal {
|
10658 10601 |
|
10659 10602 | #[allow(clippy::enum_variant_names)]
|
10660 10603 | #[derive(Debug, PartialEq)]
|
10661 10604 | pub(crate) enum ConstraintViolation {
|
10662 10605 | /// Constraint violation error when the list doesn't have the required length
|
10663 10606 | Length(usize),
|
10664 10607 | }
|
10665 10608 |
|
10666 10609 | impl ::std::fmt::Display for ConstraintViolation {
|
10667 10610 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10668 10611 | let message = match self {
|
10669 10612 | Self::Length(length) => {
|
10670 10613 | 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)
|
10671 10614 | }
|
10672 10615 | };
|
10673 10616 | write!(f, "{message}")
|
10674 10617 | }
|
10675 10618 | }
|
10676 10619 |
|
10677 10620 | impl ::std::error::Error for ConstraintViolation {}
|
10678 10621 | impl ConstraintViolation {
|
10679 10622 | pub(crate) fn as_validation_exception_field(
|
10680 10623 | self,
|
10681 10624 | path: ::std::string::String,
|
10682 10625 | ) -> crate::model::ValidationExceptionField {
|
10683 10626 | match self {
|
10684 10627 | Self::Length(length) => crate::model::ValidationExceptionField {
|
10685 10628 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
10686 10629 | path,
|
10687 10630 | },
|
10688 10631 | }
|
10689 10632 | }
|
10690 10633 | }
|
10691 10634 | }
|
10692 - | pub(crate) mod sparse_length_map_internal {
|
10635 + | pub(crate) mod constrained_union_internal {
|
10693 10636 |
|
10637 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10694 10638 | #[allow(clippy::enum_variant_names)]
|
10695 - | #[derive(Debug, PartialEq)]
|
10696 10639 | pub(crate) enum ConstraintViolation {
|
10697 - | Length(usize),
|
10640 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
10641 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
10642 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
10643 + | ConstrainedStructure(crate::model::con_b_internal::ConstraintViolation),
|
10644 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
10645 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
10698 10646 | }
|
10699 - |
|
10700 10647 | impl ::std::fmt::Display for ConstraintViolation {
|
10701 10648 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10702 10649 | match self {
|
10703 - | Self::Length(length) => {
|
10704 - | 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)
|
10705 - | }
|
10650 + | Self::ConBList(inner) => write!(f, "{inner}"),
|
10651 + | Self::ConBMap(inner) => write!(f, "{inner}"),
|
10652 + | Self::ConBSet(inner) => write!(f, "{inner}"),
|
10653 + | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
10654 + | Self::EnumString(inner) => write!(f, "{inner}"),
|
10655 + | Self::LengthString(inner) => write!(f, "{inner}"),
|
10706 10656 | }
|
10707 10657 | }
|
10708 10658 | }
|
10709 10659 |
|
10710 10660 | impl ::std::error::Error for ConstraintViolation {}
|
10711 10661 | impl ConstraintViolation {
|
10712 10662 | pub(crate) fn as_validation_exception_field(
|
10713 10663 | self,
|
10714 10664 | path: ::std::string::String,
|
10715 10665 | ) -> crate::model::ValidationExceptionField {
|
10716 10666 | match self {
|
10717 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10718 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
10719 - | path,
|
10720 - | },
|
10667 + | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
10668 + | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
10669 + | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
10670 + | Self::ConstrainedStructure(inner) => {
|
10671 + | inner.as_validation_exception_field(path + "/constrainedStructure")
|
10672 + | }
|
10673 + | Self::EnumString(inner) => {
|
10674 + | inner.as_validation_exception_field(path + "/enumString")
|
10675 + | }
|
10676 + | Self::LengthString(inner) => {
|
10677 + | inner.as_validation_exception_field(path + "/lengthString")
|
10678 + | }
|
10721 10679 | }
|
10722 10680 | }
|
10723 10681 | }
|
10724 10682 | }
|
10725 - | pub(crate) mod sparse_list_internal {
|
10683 + | pub(crate) mod list_of_length_blob_internal {
|
10726 10684 |
|
10727 10685 | #[allow(clippy::enum_variant_names)]
|
10728 10686 | #[derive(Debug, PartialEq)]
|
10729 10687 | pub(crate) enum ConstraintViolation {
|
10730 10688 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10731 10689 | /// The first component of the tuple is the index in the collection where the
|
10732 10690 | /// first constraint violation was found.
|
10733 10691 | #[doc(hidden)]
|
10734 10692 | Member(
|
10735 10693 | usize,
|
10736 - | crate::model::length_string_internal::ConstraintViolation,
|
10694 + | crate::model::length_blob_internal::ConstraintViolation,
|
10737 10695 | ),
|
10738 10696 | }
|
10739 10697 |
|
10740 10698 | impl ::std::fmt::Display for ConstraintViolation {
|
10741 10699 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10742 10700 | let message = match self {
|
10743 10701 | Self::Member(index, failing_member) => format!(
|
10744 10702 | "Value at index {index} failed to satisfy constraint. {}",
|
10745 10703 | failing_member
|
10746 10704 | ),
|
10747 10705 | };
|
10748 10706 | write!(f, "{message}")
|
10749 10707 | }
|
10750 10708 | }
|
10751 10709 |
|
10752 10710 | impl ::std::error::Error for ConstraintViolation {}
|
10753 10711 | impl ConstraintViolation {
|
10754 10712 | pub(crate) fn as_validation_exception_field(
|
10755 10713 | self,
|
10756 10714 | path: ::std::string::String,
|
10757 10715 | ) -> crate::model::ValidationExceptionField {
|
10758 10716 | match self {
|
10759 10717 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10760 10718 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10761 10719 | }
|
10762 10720 | }
|
10763 10721 | }
|
10764 10722 | }
|
10765 - | pub(crate) mod sparse_map_internal {
|
10723 + | pub(crate) mod map_of_length_blob_internal {
|
10766 10724 |
|
10767 10725 | #[allow(clippy::enum_variant_names)]
|
10768 10726 | #[derive(Debug, PartialEq)]
|
10769 10727 | pub(crate) enum ConstraintViolation {
|
10770 10728 | #[doc(hidden)]
|
10771 10729 | Value(
|
10772 10730 | ::std::string::String,
|
10773 - | crate::model::unique_items_list_internal::ConstraintViolation,
|
10731 + | crate::model::length_blob_internal::ConstraintViolation,
|
10774 10732 | ),
|
10775 10733 | }
|
10776 10734 |
|
10777 10735 | impl ::std::fmt::Display for ConstraintViolation {
|
10778 10736 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10779 10737 | match self {
|
10780 10738 | Self::Value(_, value_constraint_violation) => {
|
10781 10739 | write!(f, "{}", value_constraint_violation)
|
10782 10740 | }
|
10783 10741 | }
|
10784 10742 | }
|
10785 10743 | }
|
10786 10744 |
|
10787 10745 | impl ::std::error::Error for ConstraintViolation {}
|
10788 10746 | impl ConstraintViolation {
|
10789 10747 | pub(crate) fn as_validation_exception_field(
|
10790 10748 | self,
|
10791 10749 | path: ::std::string::String,
|
10792 10750 | ) -> crate::model::ValidationExceptionField {
|
10793 10751 | match self {
|
10794 10752 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10795 10753 | .as_validation_exception_field(path + "/" + key.as_str()),
|
10796 10754 | }
|
10797 10755 | }
|
10798 10756 | }
|
10799 10757 | }
|
10800 - | pub(crate) mod unique_items_list_internal {
|
10758 + | pub(crate) mod map_of_range_integer_internal {
|
10801 10759 |
|
10802 10760 | #[allow(clippy::enum_variant_names)]
|
10803 10761 | #[derive(Debug, PartialEq)]
|
10804 10762 | pub(crate) enum ConstraintViolation {
|
10805 - | /// Constraint violation error when the list does not contain unique items
|
10806 - | UniqueItems {
|
10807 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10808 - | /// at least two elements.
|
10809 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10810 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10811 - | /// Nothing is guaranteed about the order of the indices.
|
10812 - | duplicate_indices: ::std::vec::Vec<usize>,
|
10813 - | /// The original vector, that contains duplicate items.
|
10814 - | original: ::std::vec::Vec<::std::string::String>,
|
10815 - | },
|
10763 + | #[doc(hidden)]
|
10764 + | Value(
|
10765 + | ::std::string::String,
|
10766 + | crate::model::range_integer_internal::ConstraintViolation,
|
10767 + | ),
|
10816 10768 | }
|
10817 10769 |
|
10818 10770 | impl ::std::fmt::Display for ConstraintViolation {
|
10819 10771 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10820 - | let message = match self {
|
10821 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10822 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10823 - | };
|
10824 - | write!(f, "{message}")
|
10772 + | match self {
|
10773 + | Self::Value(_, value_constraint_violation) => {
|
10774 + | write!(f, "{}", value_constraint_violation)
|
10775 + | }
|
10776 + | }
|
10825 10777 | }
|
10826 10778 | }
|
10827 10779 |
|
10828 10780 | impl ::std::error::Error for ConstraintViolation {}
|
10829 10781 | impl ConstraintViolation {
|
10830 10782 | pub(crate) fn as_validation_exception_field(
|
10831 10783 | self,
|
10832 10784 | path: ::std::string::String,
|
10833 10785 | ) -> crate::model::ValidationExceptionField {
|
10834 10786 | match self {
|
10835 - | Self::UniqueItems { duplicate_indices, .. } =>
|
10836 - | crate::model::ValidationExceptionField {
|
10837 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10838 - | path,
|
10839 - | },
|
10787 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10788 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10840 10789 | }
|
10841 10790 | }
|
10842 10791 | }
|
10843 10792 | }
|
10844 - | pub(crate) mod map_of_map_of_list_of_list_of_con_b_internal {
|
10793 + | pub(crate) mod map_of_range_short_internal {
|
10845 10794 |
|
10846 10795 | #[allow(clippy::enum_variant_names)]
|
10847 10796 | #[derive(Debug, PartialEq)]
|
10848 10797 | pub(crate) enum ConstraintViolation {
|
10849 10798 | #[doc(hidden)]
|
10850 10799 | Value(
|
10851 10800 | ::std::string::String,
|
10852 - | crate::model::map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
10801 + | crate::model::range_short_internal::ConstraintViolation,
|
10853 10802 | ),
|
10854 10803 | }
|
10855 10804 |
|
10856 10805 | impl ::std::fmt::Display for ConstraintViolation {
|
10857 10806 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10858 10807 | match self {
|
10859 10808 | Self::Value(_, value_constraint_violation) => {
|
10860 10809 | write!(f, "{}", value_constraint_violation)
|
10861 10810 | }
|
10862 10811 | }
|
10863 10812 | }
|
10864 10813 | }
|
10865 10814 |
|
10866 10815 | impl ::std::error::Error for ConstraintViolation {}
|
10867 10816 | impl ConstraintViolation {
|
10868 10817 | pub(crate) fn as_validation_exception_field(
|
10869 10818 | self,
|
10870 10819 | path: ::std::string::String,
|
10871 10820 | ) -> crate::model::ValidationExceptionField {
|
10872 10821 | match self {
|
10873 10822 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10874 10823 | .as_validation_exception_field(path + "/" + key.as_str()),
|
10875 10824 | }
|
10876 10825 | }
|
10877 10826 | }
|
10878 10827 | }
|
10879 - | pub(crate) mod map_of_list_of_list_of_con_b_internal {
|
10828 + | pub(crate) mod map_of_range_long_internal {
|
10880 10829 |
|
10881 10830 | #[allow(clippy::enum_variant_names)]
|
10882 10831 | #[derive(Debug, PartialEq)]
|
10883 10832 | pub(crate) enum ConstraintViolation {
|
10884 10833 | #[doc(hidden)]
|
10885 10834 | Value(
|
10886 10835 | ::std::string::String,
|
10887 - | crate::model::con_b_list_internal::ConstraintViolation,
|
10836 + | crate::model::range_long_internal::ConstraintViolation,
|
10888 10837 | ),
|
10889 10838 | }
|
10890 10839 |
|
10891 10840 | impl ::std::fmt::Display for ConstraintViolation {
|
10892 10841 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10893 10842 | match self {
|
10894 10843 | Self::Value(_, value_constraint_violation) => {
|
10895 10844 | write!(f, "{}", value_constraint_violation)
|
10896 10845 | }
|
10897 10846 | }
|
10898 10847 | }
|
10899 10848 | }
|
10900 10849 |
|
10901 10850 | impl ::std::error::Error for ConstraintViolation {}
|
10902 10851 | impl ConstraintViolation {
|
10903 10852 | pub(crate) fn as_validation_exception_field(
|
10904 10853 | self,
|
10905 10854 | path: ::std::string::String,
|
10906 10855 | ) -> crate::model::ValidationExceptionField {
|
10907 10856 | match self {
|
10908 10857 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10909 10858 | .as_validation_exception_field(path + "/" + key.as_str()),
|
10910 10859 | }
|
10911 10860 | }
|
10912 10861 | }
|
10913 10862 | }
|
10914 - | pub(crate) mod length_map_internal {
|
10863 + | pub(crate) mod map_of_range_byte_internal {
|
10915 10864 |
|
10916 10865 | #[allow(clippy::enum_variant_names)]
|
10917 10866 | #[derive(Debug, PartialEq)]
|
10918 10867 | pub(crate) enum ConstraintViolation {
|
10919 - | Length(usize),
|
10868 + | #[doc(hidden)]
|
10869 + | Value(
|
10870 + | ::std::string::String,
|
10871 + | crate::model::range_byte_internal::ConstraintViolation,
|
10872 + | ),
|
10920 10873 | }
|
10921 10874 |
|
10922 10875 | impl ::std::fmt::Display for ConstraintViolation {
|
10923 10876 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10924 10877 | match self {
|
10925 - | Self::Length(length) => {
|
10926 - | 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)
|
10878 + | Self::Value(_, value_constraint_violation) => {
|
10879 + | write!(f, "{}", value_constraint_violation)
|
10927 10880 | }
|
10928 10881 | }
|
10929 10882 | }
|
10930 10883 | }
|
10931 10884 |
|
10932 10885 | impl ::std::error::Error for ConstraintViolation {}
|
10933 10886 | impl ConstraintViolation {
|
10934 10887 | pub(crate) fn as_validation_exception_field(
|
10935 10888 | self,
|
10936 10889 | path: ::std::string::String,
|
10937 10890 | ) -> crate::model::ValidationExceptionField {
|
10938 10891 | match self {
|
10939 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10940 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
10941 - | path,
|
10942 - | },
|
10892 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10893 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10943 10894 | }
|
10944 10895 | }
|
10945 10896 | }
|
10946 10897 | }
|
10947 - | pub(crate) mod sensitive_length_list_internal {
|
10898 + | pub(crate) mod pattern_string_internal {
|
10948 10899 |
|
10949 - | #[allow(clippy::enum_variant_names)]
|
10950 10900 | #[derive(Debug, PartialEq)]
|
10951 - | pub(crate) enum ConstraintViolation {
|
10952 - | /// Constraint violation error when the list doesn't have the required length
|
10953 - | Length(usize),
|
10901 + | pub enum ConstraintViolation {
|
10902 + | /// Error when a string doesn't satisfy its `@pattern`.
|
10903 + | /// Contains the String that failed the pattern.
|
10904 + | Pattern(String),
|
10954 10905 | }
|
10955 10906 |
|
10956 10907 | impl ::std::fmt::Display for ConstraintViolation {
|
10957 10908 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10958 10909 | let message = match self {
|
10959 - | Self::Length(length) => {
|
10960 - | 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)
|
10910 + | Self::Pattern(_) => {
|
10911 + | format!(
|
10912 + | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
10913 + | r#"[a-d]{5}"#
|
10914 + | )
|
10961 10915 | }
|
10962 10916 | };
|
10963 10917 | write!(f, "{message}")
|
10964 10918 | }
|
10965 10919 | }
|
10966 10920 |
|
10967 10921 | impl ::std::error::Error for ConstraintViolation {}
|
10968 10922 | impl ConstraintViolation {
|
10969 10923 | pub(crate) fn as_validation_exception_field(
|
10970 10924 | self,
|
10971 10925 | path: ::std::string::String,
|
10972 10926 | ) -> crate::model::ValidationExceptionField {
|
10973 10927 | match self {
|
10974 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10975 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10976 - | path,
|
10928 + | #[allow(unused_variables)]
|
10929 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
10930 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
10931 + | path
|
10977 10932 | },
|
10978 10933 | }
|
10979 10934 | }
|
10980 10935 | }
|
10981 10936 | }
|
10982 - | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10983 - | pub(crate) mod sensitive_structure_internal {
|
10984 - |
|
10985 - | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
10986 - | fn from(builder: Builder) -> Self {
|
10987 - | builder.build()
|
10988 - | }
|
10989 - | }
|
10990 - | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10991 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
10992 - | pub(crate) struct Builder {}
|
10993 - | impl Builder {
|
10994 - | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10995 - | pub fn build(self) -> crate::model::SensitiveStructure {
|
10996 - | self.build_enforcing_all_constraints()
|
10997 - | }
|
10998 - | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
10999 - | crate::model::SensitiveStructure {}
|
11000 - | }
|
11001 - | }
|
11002 - | impl ::std::fmt::Debug for Builder {
|
11003 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
11004 - | let mut formatter = f.debug_struct("Builder");
|
11005 - | formatter.finish()
|
11006 - | }
|
11007 - | }
|
11008 - | }
|
11009 - | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11010 - | pub mod sensitive_structure {
|
11011 - |
|
11012 - | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
11013 - | fn from(builder: Builder) -> Self {
|
11014 - | builder.build()
|
11015 - | }
|
11016 - | }
|
11017 - | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11018 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
11019 - | pub struct Builder {}
|
11020 - | impl Builder {
|
11021 - | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11022 - | pub fn build(self) -> crate::model::SensitiveStructure {
|
11023 - | self.build_enforcing_required_and_enum_traits()
|
11024 - | }
|
11025 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SensitiveStructure {
|
11026 - | crate::model::SensitiveStructure {}
|
11027 - | }
|
11028 - | }
|
11029 - | }
|
11030 - | pub(crate) mod length_list_internal {
|
10937 + | pub(crate) mod list_of_pattern_string_internal {
|
11031 10938 |
|
11032 10939 | #[allow(clippy::enum_variant_names)]
|
11033 10940 | #[derive(Debug, PartialEq)]
|
11034 10941 | pub(crate) enum ConstraintViolation {
|
11035 - | /// Constraint violation error when the list doesn't have the required length
|
11036 - | Length(usize),
|
10942 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10943 + | /// The first component of the tuple is the index in the collection where the
|
10944 + | /// first constraint violation was found.
|
10945 + | #[doc(hidden)]
|
10946 + | Member(
|
10947 + | usize,
|
10948 + | crate::model::pattern_string_internal::ConstraintViolation,
|
10949 + | ),
|
11037 10950 | }
|
11038 10951 |
|
11039 10952 | impl ::std::fmt::Display for ConstraintViolation {
|
11040 10953 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11041 10954 | let message = match self {
|
11042 - | Self::Length(length) => {
|
11043 - | 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)
|
11044 - | }
|
11045 - | };
|
11046 - | write!(f, "{message}")
|
11047 - | }
|
11048 - | }
|
11049 - |
|
11050 - | impl ::std::error::Error for ConstraintViolation {}
|
11051 - | impl ConstraintViolation {
|
11052 - | pub(crate) fn as_validation_exception_field(
|
11053 - | self,
|
11054 - | path: ::std::string::String,
|
11055 - | ) -> crate::model::ValidationExceptionField {
|
11056 - | match self {
|
11057 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11058 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
11059 - | path,
|
11060 - | },
|
11061 - | }
|
11062 - | }
|
11063 - | }
|
11064 - | }
|
11065 - | pub(crate) mod fixed_value_byte_internal {
|
11066 - |
|
11067 - | #[derive(Debug, PartialEq)]
|
11068 - | pub enum ConstraintViolation {
|
11069 - | Range(i8),
|
11070 - | }
|
11071 - |
|
11072 - | impl ::std::fmt::Display for ConstraintViolation {
|
11073 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11074 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10955 + | Self::Member(index, failing_member) => format!(
|
10956 + | "Value at index {index} failed to satisfy constraint. {}",
|
10957 + | failing_member
|
10958 + | ),
|
10959 + | };
|
10960 + | write!(f, "{message}")
|
11075 10961 | }
|
11076 10962 | }
|
11077 10963 |
|
11078 10964 | impl ::std::error::Error for ConstraintViolation {}
|
11079 10965 | impl ConstraintViolation {
|
11080 10966 | pub(crate) fn as_validation_exception_field(
|
11081 10967 | self,
|
11082 10968 | path: ::std::string::String,
|
11083 10969 | ) -> crate::model::ValidationExceptionField {
|
11084 10970 | match self {
|
11085 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11086 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
11087 - | path,
|
11088 - | },
|
10971 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10972 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
11089 10973 | }
|
11090 10974 | }
|
11091 10975 | }
|
11092 10976 | }
|
11093 - | pub(crate) mod max_range_byte_internal {
|
10977 + | pub(crate) mod set_of_pattern_string_internal {
|
11094 10978 |
|
10979 + | #[allow(clippy::enum_variant_names)]
|
11095 10980 | #[derive(Debug, PartialEq)]
|
11096 - | pub enum ConstraintViolation {
|
11097 - | Range(i8),
|
10981 + | pub(crate) enum ConstraintViolation {
|
10982 + | /// Constraint violation error when the list does not contain unique items
|
10983 + | UniqueItems {
|
10984 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10985 + | /// at least two elements.
|
10986 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10987 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10988 + | /// Nothing is guaranteed about the order of the indices.
|
10989 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10990 + | /// The original vector, that contains duplicate items.
|
10991 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
10992 + | },
|
10993 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10994 + | /// The first component of the tuple is the index in the collection where the
|
10995 + | /// first constraint violation was found.
|
10996 + | #[doc(hidden)]
|
10997 + | Member(
|
10998 + | usize,
|
10999 + | crate::model::pattern_string_internal::ConstraintViolation,
|
11000 + | ),
|
11098 11001 | }
|
11099 11002 |
|
11100 11003 | impl ::std::fmt::Display for ConstraintViolation {
|
11101 11004 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11102 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
11005 + | let message = match self {
|
11006 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11007 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
11008 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
11009 + | failing_member)
|
11010 + | };
|
11011 + | write!(f, "{message}")
|
11103 11012 | }
|
11104 11013 | }
|
11105 11014 |
|
11106 11015 | impl ::std::error::Error for ConstraintViolation {}
|
11107 11016 | impl ConstraintViolation {
|
11108 11017 | pub(crate) fn as_validation_exception_field(
|
11109 11018 | self,
|
11110 11019 | path: ::std::string::String,
|
11111 11020 | ) -> crate::model::ValidationExceptionField {
|
11112 11021 | match self {
|
11113 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11114 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
11022 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11023 + | crate::model::ValidationExceptionField {
|
11024 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
11115 11025 | path,
|
11116 11026 | },
|
11027 + | Self::Member(index, member_constraint_violation) =>
|
11028 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
11117 11029 | }
|
11118 11030 | }
|
11119 11031 | }
|
11120 11032 | }
|
11121 - | pub(crate) mod min_range_byte_internal {
|
11033 + | pub(crate) mod length_pattern_string_internal {
|
11122 11034 |
|
11123 11035 | #[derive(Debug, PartialEq)]
|
11124 11036 | pub enum ConstraintViolation {
|
11125 - | Range(i8),
|
11037 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
11038 + | Length(usize),
|
11039 + | /// Error when a string doesn't satisfy its `@pattern`.
|
11040 + | /// Contains the String that failed the pattern.
|
11041 + | Pattern(String),
|
11126 11042 | }
|
11127 11043 |
|
11128 11044 | impl ::std::fmt::Display for ConstraintViolation {
|
11129 11045 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11130 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
11046 + | let message = match self {
|
11047 + | Self::Length(length) => {
|
11048 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
11049 + | }
|
11050 + | Self::Pattern(_) => {
|
11051 + | format!(
|
11052 + | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
11053 + | r#"[a-f0-5]*"#
|
11054 + | )
|
11055 + | }
|
11056 + | };
|
11057 + | write!(f, "{message}")
|
11131 11058 | }
|
11132 11059 | }
|
11133 11060 |
|
11134 11061 | impl ::std::error::Error for ConstraintViolation {}
|
11135 11062 | impl ConstraintViolation {
|
11136 11063 | pub(crate) fn as_validation_exception_field(
|
11137 11064 | self,
|
11138 11065 | path: ::std::string::String,
|
11139 11066 | ) -> crate::model::ValidationExceptionField {
|
11140 11067 | match self {
|
11141 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11142 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
11068 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
11069 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
11143 11070 | path,
|
11144 11071 | },
|
11072 + |
|
11073 + | #[allow(unused_variables)]
|
11074 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
11075 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
11076 + | path
|
11077 + | },
|
11145 11078 | }
|
11146 11079 | }
|
11147 11080 | }
|
11148 11081 | }
|
11149 - | pub(crate) mod fixed_value_long_internal {
|
11082 + | pub(crate) mod list_of_length_pattern_string_internal {
|
11150 11083 |
|
11084 + | #[allow(clippy::enum_variant_names)]
|
11151 11085 | #[derive(Debug, PartialEq)]
|
11152 - | pub enum ConstraintViolation {
|
11153 - | Range(i64),
|
11086 + | pub(crate) enum ConstraintViolation {
|
11087 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
11088 + | /// The first component of the tuple is the index in the collection where the
|
11089 + | /// first constraint violation was found.
|
11090 + | #[doc(hidden)]
|
11091 + | Member(
|
11092 + | usize,
|
11093 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
11094 + | ),
|
11154 11095 | }
|
11155 11096 |
|
11156 11097 | impl ::std::fmt::Display for ConstraintViolation {
|
11157 11098 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11158 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
11099 + | let message = match self {
|
11100 + | Self::Member(index, failing_member) => format!(
|
11101 + | "Value at index {index} failed to satisfy constraint. {}",
|
11102 + | failing_member
|
11103 + | ),
|
11104 + | };
|
11105 + | write!(f, "{message}")
|
11159 11106 | }
|
11160 11107 | }
|
11161 11108 |
|
11162 11109 | impl ::std::error::Error for ConstraintViolation {}
|
11163 11110 | impl ConstraintViolation {
|
11164 11111 | pub(crate) fn as_validation_exception_field(
|
11165 11112 | self,
|
11166 11113 | path: ::std::string::String,
|
11167 11114 | ) -> crate::model::ValidationExceptionField {
|
11168 11115 | match self {
|
11169 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11170 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
11171 - | path,
|
11172 - | },
|
11116 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
11117 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
11173 11118 | }
|
11174 11119 | }
|
11175 11120 | }
|
11176 11121 | }
|
11177 - | pub(crate) mod max_range_long_internal {
|
11122 + | pub(crate) mod set_of_length_pattern_string_internal {
|
11178 11123 |
|
11124 + | #[allow(clippy::enum_variant_names)]
|
11179 11125 | #[derive(Debug, PartialEq)]
|
11180 - | pub enum ConstraintViolation {
|
11181 - | Range(i64),
|
11126 + | pub(crate) enum ConstraintViolation {
|
11127 + | /// Constraint violation error when the list does not contain unique items
|
11128 + | UniqueItems {
|
11129 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
11130 + | /// at least two elements.
|
11131 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
11132 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
11133 + | /// Nothing is guaranteed about the order of the indices.
|
11134 + | duplicate_indices: ::std::vec::Vec<usize>,
|
11135 + | /// The original vector, that contains duplicate items.
|
11136 + | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
11137 + | },
|
11138 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
11139 + | /// The first component of the tuple is the index in the collection where the
|
11140 + | /// first constraint violation was found.
|
11141 + | #[doc(hidden)]
|
11142 + | Member(
|
11143 + | usize,
|
11144 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
11145 + | ),
|
11182 11146 | }
|
11183 11147 |
|
11184 11148 | impl ::std::fmt::Display for ConstraintViolation {
|
11185 11149 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11186 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
11150 + | let message = match self {
|
11151 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11152 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
11153 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
11154 + | failing_member)
|
11155 + | };
|
11156 + | write!(f, "{message}")
|
11187 11157 | }
|
11188 11158 | }
|
11189 11159 |
|
11190 11160 | impl ::std::error::Error for ConstraintViolation {}
|
11191 11161 | impl ConstraintViolation {
|
11192 11162 | pub(crate) fn as_validation_exception_field(
|
11193 11163 | self,
|
11194 11164 | path: ::std::string::String,
|
11195 11165 | ) -> crate::model::ValidationExceptionField {
|
11196 11166 | match self {
|
11197 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11198 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
11167 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11168 + | crate::model::ValidationExceptionField {
|
11169 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
11199 11170 | path,
|
11200 11171 | },
|
11172 + | Self::Member(index, member_constraint_violation) =>
|
11173 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
11201 11174 | }
|
11202 11175 | }
|
11203 11176 | }
|
11204 11177 | }
|
11205 - | pub(crate) mod min_range_long_internal {
|
11178 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
11179 + | pub mod validation_exception_field {
|
11206 11180 |
|
11207 - | #[derive(Debug, PartialEq)]
|
11181 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
11182 + | /// Holds one variant for each of the ways the builder can fail.
|
11183 + | #[allow(clippy::enum_variant_names)]
|
11208 11184 | pub enum ConstraintViolation {
|
11209 - | Range(i64),
|
11185 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
11186 + | MissingPath,
|
11187 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
11188 + | MissingMessage,
|
11210 11189 | }
|
11211 - |
|
11212 11190 | impl ::std::fmt::Display for ConstraintViolation {
|
11213 11191 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11214 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
11192 + | match self {
|
11193 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
11194 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
11195 + | }
|
11215 11196 | }
|
11216 11197 | }
|
11217 - |
|
11218 11198 | impl ::std::error::Error for ConstraintViolation {}
|
11219 - | impl ConstraintViolation {
|
11220 - | pub(crate) fn as_validation_exception_field(
|
11221 - | self,
|
11222 - | path: ::std::string::String,
|
11223 - | ) -> crate::model::ValidationExceptionField {
|
11224 - | match self {
|
11225 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11226 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
11227 - | path,
|
11228 - | },
|
11199 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
11200 + | type Error = ConstraintViolation;
|
11201 + |
|
11202 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
11203 + | builder.build()
|
11204 + | }
|
11205 + | }
|
11206 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
11207 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11208 + | pub struct Builder {
|
11209 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
11210 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
11211 + | }
|
11212 + | impl Builder {
|
11213 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
11214 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
11215 + | self.path = Some(input);
|
11216 + | self
|
11217 + | }
|
11218 + | /// A detailed description of the validation failure.
|
11219 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
11220 + | self.message = Some(input);
|
11221 + | self
|
11222 + | }
|
11223 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
11224 + | ///
|
11225 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
11226 + | ///
|
11227 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
11228 + | self.build_enforcing_required_and_enum_traits()
|
11229 11229 | }
|
11230 + | fn build_enforcing_required_and_enum_traits(
|
11231 + | self,
|
11232 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
11233 + | Ok(crate::model::ValidationExceptionField {
|
11234 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
11235 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
11236 + | })
|
11230 11237 | }
|
11231 11238 | }
|
11232 11239 | }
|
11233 - | pub(crate) mod fixed_value_short_internal {
|
11240 + | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11241 + | pub mod transitively_constrained_structure_in_output {
|
11234 11242 |
|
11235 - | #[derive(Debug, PartialEq)]
|
11236 - | pub enum ConstraintViolation {
|
11237 - | Range(i16),
|
11243 + | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
11244 + | fn from(builder: Builder) -> Self {
|
11245 + | builder.build()
|
11238 11246 | }
|
11239 - |
|
11240 - | impl ::std::fmt::Display for ConstraintViolation {
|
11241 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11242 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
11243 11247 | }
|
11248 + | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11249 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11250 + | pub struct Builder {
|
11251 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
11244 11252 | }
|
11245 - |
|
11246 - | impl ::std::error::Error for ConstraintViolation {}
|
11247 - | impl ConstraintViolation {
|
11248 - | pub(crate) fn as_validation_exception_field(
|
11253 + | impl Builder {
|
11254 + | #[allow(missing_docs)] // documentation missing in model
|
11255 + | pub fn length_string(
|
11256 + | mut self,
|
11257 + | input: ::std::option::Option<::std::string::String>,
|
11258 + | ) -> Self {
|
11259 + | self.length_string = input;
|
11260 + | self
|
11261 + | }
|
11262 + | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11263 + | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
11264 + | self.build_enforcing_required_and_enum_traits()
|
11265 + | }
|
11266 + | fn build_enforcing_required_and_enum_traits(
|
11249 11267 | self,
|
11250 - | path: ::std::string::String,
|
11251 - | ) -> crate::model::ValidationExceptionField {
|
11252 - | match self {
|
11253 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11254 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
11255 - | path,
|
11256 - | },
|
11268 + | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
11269 + | crate::model::TransitivelyConstrainedStructureInOutput {
|
11270 + | length_string: self.length_string,
|
11257 11271 | }
|
11258 11272 | }
|
11259 11273 | }
|
11260 11274 | }
|
11261 - | pub(crate) mod max_range_short_internal {
|
11275 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11276 + | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
11262 11277 |
|
11263 - | #[derive(Debug, PartialEq)]
|
11264 - | pub enum ConstraintViolation {
|
11265 - | Range(i16),
|
11278 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
11279 + | /// Holds one variant for each of the ways the builder can fail.
|
11280 + | #[non_exhaustive]
|
11281 + | #[allow(clippy::enum_variant_names)]
|
11282 + | pub(crate) enum ConstraintViolation {
|
11283 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
11284 + | #[doc(hidden)]
|
11285 + | RecursiveMember(
|
11286 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
11287 + | ),
|
11266 11288 | }
|
11267 - |
|
11268 11289 | impl ::std::fmt::Display for ConstraintViolation {
|
11269 11290 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11270 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
11291 + | match self {
|
11292 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
11293 + | }
|
11271 11294 | }
|
11272 11295 | }
|
11273 - |
|
11274 11296 | impl ::std::error::Error for ConstraintViolation {}
|
11275 11297 | impl ConstraintViolation {
|
11276 11298 | pub(crate) fn as_validation_exception_field(
|
11277 11299 | self,
|
11278 11300 | path: ::std::string::String,
|
11279 11301 | ) -> crate::model::ValidationExceptionField {
|
11280 11302 | match self {
|
11281 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11282 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
11283 - | path,
|
11284 - | },
|
11303 + | ConstraintViolation::RecursiveMember(inner) => {
|
11304 + | inner.as_validation_exception_field(path + "/recursiveMember")
|
11285 11305 | }
|
11286 11306 | }
|
11287 11307 | }
|
11288 - | }
|
11289 - | pub(crate) mod min_range_short_internal {
|
11290 - |
|
11291 - | #[derive(Debug, PartialEq)]
|
11292 - | pub enum ConstraintViolation {
|
11293 - | Range(i16),
|
11294 11308 | }
|
11295 - |
|
11296 - | impl ::std::fmt::Display for ConstraintViolation {
|
11297 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11298 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
11309 + | impl ::std::convert::From<Builder>
|
11310 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
11311 + | {
|
11312 + | fn from(builder: Builder) -> Self {
|
11313 + | Self::Unconstrained(builder)
|
11299 11314 | }
|
11300 11315 | }
|
11316 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
11317 + | type Error = ConstraintViolation;
|
11301 11318 |
|
11302 - | impl ::std::error::Error for ConstraintViolation {}
|
11303 - | impl ConstraintViolation {
|
11304 - | pub(crate) fn as_validation_exception_field(
|
11305 - | self,
|
11306 - | path: ::std::string::String,
|
11307 - | ) -> crate::model::ValidationExceptionField {
|
11308 - | match self {
|
11309 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11310 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
11311 - | path,
|
11312 - | },
|
11313 - | }
|
11314 - | }
|
11319 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
11320 + | builder.build()
|
11315 11321 | }
|
11316 - | }
|
11317 - | pub(crate) mod fixed_value_integer_internal {
|
11318 - |
|
11319 - | #[derive(Debug, PartialEq)]
|
11320 - | pub enum ConstraintViolation {
|
11321 - | Range(i32),
|
11322 11322 | }
|
11323 - |
|
11324 - | impl ::std::fmt::Display for ConstraintViolation {
|
11325 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11326 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
11323 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11324 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11325 + | pub(crate) struct Builder {
|
11326 + | pub(crate) recursive_member: ::std::option::Option<
|
11327 + | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
11328 + | >,
|
11327 11329 | }
|
11330 + | impl Builder {
|
11331 + | #[allow(missing_docs)] // documentation missing in model
|
11332 + | pub(crate) fn set_recursive_member(
|
11333 + | mut self,
|
11334 + | input: Option<
|
11335 + | impl ::std::convert::Into<
|
11336 + | crate::constrained::MaybeConstrained<
|
11337 + | crate::model::RecursiveShapesInputOutputNested1,
|
11338 + | >,
|
11339 + | >,
|
11340 + | >,
|
11341 + | ) -> Self {
|
11342 + | self.recursive_member = input.map(|v| v.into());
|
11343 + | self
|
11328 11344 | }
|
11329 - |
|
11330 - | impl ::std::error::Error for ConstraintViolation {}
|
11331 - | impl ConstraintViolation {
|
11332 - | pub(crate) fn as_validation_exception_field(
|
11345 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11346 + | ///
|
11347 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
11348 + | ///
|
11349 + | pub fn build(
|
11333 11350 | self,
|
11334 - | path: ::std::string::String,
|
11335 - | ) -> crate::model::ValidationExceptionField {
|
11336 - | match self {
|
11337 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11338 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
11339 - | path,
|
11340 - | },
|
11351 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
11352 + | self.build_enforcing_all_constraints()
|
11341 11353 | }
|
11354 + | fn build_enforcing_all_constraints(
|
11355 + | self,
|
11356 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
11357 + | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
11358 + | recursive_member: self
|
11359 + | .recursive_member
|
11360 + | .map(|v| match v {
|
11361 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
11362 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
11363 + | })
|
11364 + | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
11365 + | .transpose()?,
|
11366 + | })
|
11342 11367 | }
|
11343 11368 | }
|
11344 11369 | }
|
11345 - | pub(crate) mod max_range_integer_internal {
|
11370 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11371 + | pub mod recursive_shapes_input_output_nested2 {
|
11346 11372 |
|
11347 - | #[derive(Debug, PartialEq)]
|
11348 - | pub enum ConstraintViolation {
|
11349 - | Range(i32),
|
11373 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
11374 + | fn from(builder: Builder) -> Self {
|
11375 + | builder.build()
|
11350 11376 | }
|
11351 - |
|
11352 - | impl ::std::fmt::Display for ConstraintViolation {
|
11353 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11354 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
11355 11377 | }
|
11378 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11379 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11380 + | pub struct Builder {
|
11381 + | pub(crate) recursive_member:
|
11382 + | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
11356 11383 | }
|
11357 - |
|
11358 - | impl ::std::error::Error for ConstraintViolation {}
|
11359 - | impl ConstraintViolation {
|
11360 - | pub(crate) fn as_validation_exception_field(
|
11384 + | impl Builder {
|
11385 + | #[allow(missing_docs)] // documentation missing in model
|
11386 + | pub fn recursive_member(
|
11387 + | mut self,
|
11388 + | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
11389 + | ) -> Self {
|
11390 + | self.recursive_member = input;
|
11391 + | self
|
11392 + | }
|
11393 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
11394 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
11395 + | self.build_enforcing_required_and_enum_traits()
|
11396 + | }
|
11397 + | fn build_enforcing_required_and_enum_traits(
|
11361 11398 | self,
|
11362 - | path: ::std::string::String,
|
11363 - | ) -> crate::model::ValidationExceptionField {
|
11364 - | match self {
|
11365 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11366 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
11367 - | path,
|
11368 - | },
|
11399 + | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
11400 + | crate::model::RecursiveShapesInputOutputNested2 {
|
11401 + | recursive_member: self.recursive_member,
|
11369 11402 | }
|
11370 11403 | }
|
11371 11404 | }
|
11372 11405 | }
|
11373 - | pub(crate) mod min_range_integer_internal {
|
11406 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11407 + | pub(crate) mod event_stream_regular_message_internal {
|
11374 11408 |
|
11375 - | #[derive(Debug, PartialEq)]
|
11376 - | pub enum ConstraintViolation {
|
11377 - | Range(i32),
|
11409 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
11410 + | fn from(builder: Builder) -> Self {
|
11411 + | builder.build()
|
11378 11412 | }
|
11379 - |
|
11380 - | impl ::std::fmt::Display for ConstraintViolation {
|
11381 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11382 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
11383 11413 | }
|
11414 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11415 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11416 + | pub(crate) struct Builder {
|
11417 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
11384 11418 | }
|
11385 - |
|
11386 - | impl ::std::error::Error for ConstraintViolation {}
|
11387 - | impl ConstraintViolation {
|
11388 - | pub(crate) fn as_validation_exception_field(
|
11389 - | self,
|
11390 - | path: ::std::string::String,
|
11391 - | ) -> crate::model::ValidationExceptionField {
|
11392 - | match self {
|
11393 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
11394 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
11395 - | path,
|
11396 - | },
|
11419 + | impl Builder {
|
11420 + | #[allow(missing_docs)] // documentation missing in model
|
11421 + | pub(crate) fn set_message_content(
|
11422 + | mut self,
|
11423 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
11424 + | ) -> Self {
|
11425 + | self.message_content = input.map(|v| v.into());
|
11426 + | self
|
11427 + | }
|
11428 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11429 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
11430 + | self.build_enforcing_all_constraints()
|
11431 + | }
|
11432 + | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
11433 + | crate::model::EventStreamRegularMessage {
|
11434 + | message_content: self.message_content,
|
11397 11435 | }
|
11398 11436 | }
|
11399 11437 | }
|
11400 11438 | }
|
11401 - | pub(crate) mod fixed_length_blob_internal {
|
11439 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11440 + | pub mod event_stream_regular_message {
|
11402 11441 |
|
11403 - | #[derive(Debug, PartialEq)]
|
11404 - | pub enum ConstraintViolation {
|
11405 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
11406 - | Length(usize),
|
11442 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
11443 + | fn from(builder: Builder) -> Self {
|
11444 + | builder.build()
|
11407 11445 | }
|
11408 - |
|
11409 - | impl ::std::fmt::Display for ConstraintViolation {
|
11410 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11411 - | let message = match self {
|
11412 - | Self::Length(length) => {
|
11413 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
11414 11446 | }
|
11415 - | };
|
11416 - | write!(f, "{message}")
|
11447 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11448 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11449 + | pub struct Builder {
|
11450 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
11417 11451 | }
|
11452 + | impl Builder {
|
11453 + | #[allow(missing_docs)] // documentation missing in model
|
11454 + | pub fn message_content(
|
11455 + | mut self,
|
11456 + | input: ::std::option::Option<::std::string::String>,
|
11457 + | ) -> Self {
|
11458 + | self.message_content = input;
|
11459 + | self
|
11418 11460 | }
|
11419 - |
|
11420 - | impl ::std::error::Error for ConstraintViolation {}
|
11421 - | impl ConstraintViolation {
|
11422 - | pub(crate) fn as_validation_exception_field(
|
11423 - | self,
|
11424 - | path: ::std::string::String,
|
11425 - | ) -> crate::model::ValidationExceptionField {
|
11426 - | match self {
|
11427 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11428 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
11429 - | path,
|
11430 - | },
|
11461 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
11462 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
11463 + | self.build_enforcing_required_and_enum_traits()
|
11464 + | }
|
11465 + | fn build_enforcing_required_and_enum_traits(
|
11466 + | self,
|
11467 + | ) -> crate::model::EventStreamRegularMessage {
|
11468 + | crate::model::EventStreamRegularMessage {
|
11469 + | message_content: self.message_content,
|
11431 11470 | }
|
11432 11471 | }
|
11433 11472 | }
|
11434 11473 | }
|
11435 - | pub(crate) mod max_length_blob_internal {
|
11474 + | pub(crate) mod con_b_list_inner_internal {
|
11436 11475 |
|
11476 + | #[allow(clippy::enum_variant_names)]
|
11437 11477 | #[derive(Debug, PartialEq)]
|
11438 - | pub enum ConstraintViolation {
|
11439 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
11440 - | Length(usize),
|
11478 + | pub(crate) enum ConstraintViolation {
|
11479 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
11480 + | /// The first component of the tuple is the index in the collection where the
|
11481 + | /// first constraint violation was found.
|
11482 + | #[doc(hidden)]
|
11483 + | Member(usize, crate::model::con_b_internal::ConstraintViolation),
|
11441 11484 | }
|
11442 11485 |
|
11443 11486 | impl ::std::fmt::Display for ConstraintViolation {
|
11444 11487 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11445 11488 | let message = match self {
|
11446 - | Self::Length(length) => {
|
11447 - | 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)
|
11448 - | }
|
11489 + | Self::Member(index, failing_member) => format!(
|
11490 + | "Value at index {index} failed to satisfy constraint. {}",
|
11491 + | failing_member
|
11492 + | ),
|
11449 11493 | };
|
11450 11494 | write!(f, "{message}")
|
11451 11495 | }
|
11452 11496 | }
|
11453 11497 |
|
11454 11498 | impl ::std::error::Error for ConstraintViolation {}
|
11455 11499 | impl ConstraintViolation {
|
11456 11500 | pub(crate) fn as_validation_exception_field(
|
11457 11501 | self,
|
11458 11502 | path: ::std::string::String,
|
11459 11503 | ) -> crate::model::ValidationExceptionField {
|
11460 11504 | match self {
|
11461 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11462 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
11463 - | path,
|
11464 - | },
|
11505 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
11506 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
11465 11507 | }
|
11466 11508 | }
|
11467 11509 | }
|
11468 11510 | }
|
11469 - | pub(crate) mod min_length_blob_internal {
|
11511 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11512 + | pub(crate) mod sensitive_structure_internal {
|
11470 11513 |
|
11471 - | #[derive(Debug, PartialEq)]
|
11472 - | pub enum ConstraintViolation {
|
11473 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
11474 - | Length(usize),
|
11514 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
11515 + | fn from(builder: Builder) -> Self {
|
11516 + | builder.build()
|
11475 11517 | }
|
11476 - |
|
11477 - | impl ::std::fmt::Display for ConstraintViolation {
|
11478 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11479 - | let message = match self {
|
11480 - | Self::Length(length) => {
|
11481 - | 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)
|
11482 11518 | }
|
11483 - | };
|
11484 - | write!(f, "{message}")
|
11519 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11520 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
11521 + | pub(crate) struct Builder {}
|
11522 + | impl Builder {
|
11523 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11524 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
11525 + | self.build_enforcing_all_constraints()
|
11526 + | }
|
11527 + | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
11528 + | crate::model::SensitiveStructure {}
|
11529 + | }
|
11530 + | }
|
11531 + | impl ::std::fmt::Debug for Builder {
|
11532 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
11533 + | let mut formatter = f.debug_struct("Builder");
|
11534 + | formatter.finish()
|
11485 11535 | }
|
11486 11536 | }
|
11537 + | }
|
11538 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11539 + | pub mod sensitive_structure {
|
11487 11540 |
|
11488 - | impl ::std::error::Error for ConstraintViolation {}
|
11489 - | impl ConstraintViolation {
|
11490 - | pub(crate) fn as_validation_exception_field(
|
11491 - | self,
|
11492 - | path: ::std::string::String,
|
11493 - | ) -> crate::model::ValidationExceptionField {
|
11494 - | match self {
|
11495 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11496 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
11497 - | path,
|
11498 - | },
|
11541 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
11542 + | fn from(builder: Builder) -> Self {
|
11543 + | builder.build()
|
11544 + | }
|
11545 + | }
|
11546 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11547 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
11548 + | pub struct Builder {}
|
11549 + | impl Builder {
|
11550 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
11551 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
11552 + | self.build_enforcing_required_and_enum_traits()
|
11499 11553 | }
|
11554 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SensitiveStructure {
|
11555 + | crate::model::SensitiveStructure {}
|
11500 11556 | }
|
11501 11557 | }
|
11502 11558 | }
|
11503 - | pub(crate) mod fixed_length_string_internal {
|
11559 + | pub(crate) mod con_b_set_inner_internal {
|
11504 11560 |
|
11561 + | #[allow(clippy::enum_variant_names)]
|
11505 11562 | #[derive(Debug, PartialEq)]
|
11506 - | pub enum ConstraintViolation {
|
11507 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
11508 - | Length(usize),
|
11563 + | pub(crate) enum ConstraintViolation {
|
11564 + | /// Constraint violation error when the list does not contain unique items
|
11565 + | UniqueItems {
|
11566 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
11567 + | /// at least two elements.
|
11568 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
11569 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
11570 + | /// Nothing is guaranteed about the order of the indices.
|
11571 + | duplicate_indices: ::std::vec::Vec<usize>,
|
11572 + | /// The original vector, that contains duplicate items.
|
11573 + | original: ::std::vec::Vec<::std::string::String>,
|
11574 + | },
|
11509 11575 | }
|
11510 11576 |
|
11511 11577 | impl ::std::fmt::Display for ConstraintViolation {
|
11512 11578 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11513 11579 | let message = match self {
|
11514 - | Self::Length(length) => {
|
11515 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
11516 - | }
|
11580 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11581 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
11517 11582 | };
|
11518 11583 | write!(f, "{message}")
|
11519 11584 | }
|
11520 11585 | }
|
11521 11586 |
|
11522 11587 | impl ::std::error::Error for ConstraintViolation {}
|
11523 11588 | impl ConstraintViolation {
|
11524 11589 | pub(crate) fn as_validation_exception_field(
|
11525 11590 | self,
|
11526 11591 | path: ::std::string::String,
|
11527 11592 | ) -> crate::model::ValidationExceptionField {
|
11528 11593 | match self {
|
11529 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11530 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
11594 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11595 + | crate::model::ValidationExceptionField {
|
11596 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
11531 11597 | path,
|
11532 11598 | },
|
11533 11599 | }
|
11534 11600 | }
|
11535 11601 | }
|
11536 11602 | }
|
11537 - | pub(crate) mod max_length_string_internal {
|
11603 + | pub(crate) mod map_of_list_of_list_of_con_b_internal {
|
11538 11604 |
|
11605 + | #[allow(clippy::enum_variant_names)]
|
11539 11606 | #[derive(Debug, PartialEq)]
|
11540 - | pub enum ConstraintViolation {
|
11541 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
11542 - | Length(usize),
|
11607 + | pub(crate) enum ConstraintViolation {
|
11608 + | #[doc(hidden)]
|
11609 + | Value(
|
11610 + | ::std::string::String,
|
11611 + | crate::model::con_b_list_internal::ConstraintViolation,
|
11612 + | ),
|
11543 11613 | }
|
11544 11614 |
|
11545 11615 | impl ::std::fmt::Display for ConstraintViolation {
|
11546 11616 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11547 - | let message = match self {
|
11548 - | Self::Length(length) => {
|
11549 - | 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)
|
11617 + | match self {
|
11618 + | Self::Value(_, value_constraint_violation) => {
|
11619 + | write!(f, "{}", value_constraint_violation)
|
11620 + | }
|
11550 11621 | }
|
11551 - | };
|
11552 - | write!(f, "{message}")
|
11553 11622 | }
|
11554 11623 | }
|
11555 11624 |
|
11556 11625 | impl ::std::error::Error for ConstraintViolation {}
|
11557 11626 | impl ConstraintViolation {
|
11558 11627 | pub(crate) fn as_validation_exception_field(
|
11559 11628 | self,
|
11560 11629 | path: ::std::string::String,
|
11561 11630 | ) -> crate::model::ValidationExceptionField {
|
11562 11631 | match self {
|
11563 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11564 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
11565 - | path,
|
11566 - | },
|
11632 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
11633 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
11567 11634 | }
|
11568 11635 | }
|
11569 11636 | }
|
11570 11637 | }
|
11571 - | pub(crate) mod min_length_string_internal {
|
11638 + | pub(crate) mod unique_items_list_internal {
|
11572 11639 |
|
11640 + | #[allow(clippy::enum_variant_names)]
|
11573 11641 | #[derive(Debug, PartialEq)]
|
11574 - | pub enum ConstraintViolation {
|
11575 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
11576 - | Length(usize),
|
11642 + | pub(crate) enum ConstraintViolation {
|
11643 + | /// Constraint violation error when the list does not contain unique items
|
11644 + | UniqueItems {
|
11645 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
11646 + | /// at least two elements.
|
11647 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
11648 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
11649 + | /// Nothing is guaranteed about the order of the indices.
|
11650 + | duplicate_indices: ::std::vec::Vec<usize>,
|
11651 + | /// The original vector, that contains duplicate items.
|
11652 + | original: ::std::vec::Vec<::std::string::String>,
|
11653 + | },
|
11577 11654 | }
|
11578 11655 |
|
11579 11656 | impl ::std::fmt::Display for ConstraintViolation {
|
11580 11657 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11581 11658 | let message = match self {
|
11582 - | Self::Length(length) => {
|
11583 - | 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)
|
11584 - | }
|
11659 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11660 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
11585 11661 | };
|
11586 11662 | write!(f, "{message}")
|
11587 11663 | }
|
11588 11664 | }
|
11589 11665 |
|
11590 11666 | impl ::std::error::Error for ConstraintViolation {}
|
11591 11667 | impl ConstraintViolation {
|
11592 11668 | pub(crate) fn as_validation_exception_field(
|
11593 11669 | self,
|
11594 11670 | path: ::std::string::String,
|
11595 11671 | ) -> crate::model::ValidationExceptionField {
|
11596 11672 | match self {
|
11597 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
11598 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
11673 + | Self::UniqueItems { duplicate_indices, .. } =>
|
11674 + | crate::model::ValidationExceptionField {
|
11675 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
11599 11676 | path,
|
11600 11677 | },
|
11601 11678 | }
|
11602 11679 | }
|
11603 11680 | }
|
11604 11681 | }
|
11605 - | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11606 - | pub mod transitively_constrained_structure_in_output {
|
11607 - |
|
11608 - | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
11609 - | fn from(builder: Builder) -> Self {
|
11610 - | builder.build()
|
11611 - | }
|
11612 - | }
|
11613 - | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11614 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
11615 - | pub struct Builder {
|
11616 - | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
11617 - | }
|
11618 - | impl Builder {
|
11619 - | #[allow(missing_docs)] // documentation missing in model
|
11620 - | pub fn length_string(
|
11621 - | mut self,
|
11622 - | input: ::std::option::Option<::std::string::String>,
|
11623 - | ) -> Self {
|
11624 - | self.length_string = input;
|
11625 - | self
|
11626 - | }
|
11627 - | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
11628 - | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
11629 - | self.build_enforcing_required_and_enum_traits()
|
11630 - | }
|
11631 - | fn build_enforcing_required_and_enum_traits(
|
11632 - | self,
|
11633 - | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
11634 - | crate::model::TransitivelyConstrainedStructureInOutput {
|
11635 - | length_string: self.length_string,
|
11636 - | }
|
11637 - | }
|
11638 - | }
|
11639 - | }
|
11640 - | pub(crate) mod constrained_map_in_output_internal {
|
11641 - |
|
11642 - | #[allow(clippy::enum_variant_names)]
|
11643 - | #[derive(Debug, PartialEq)]
|
11644 - | pub(crate) enum ConstraintViolation {
|
11645 - | Length(usize),
|
11646 - | }
|
11647 - |
|
11648 - | impl ::std::fmt::Display for ConstraintViolation {
|
11649 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11650 - | match self {
|
11651 - | Self::Length(length) => {
|
11652 - | 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)
|
11653 - | }
|
11654 - | }
|
11655 - | }
|
11656 - | }
|
11657 - |
|
11658 - | impl ::std::error::Error for ConstraintViolation {}
|
11659 - | }
|
11660 - | pub(crate) mod constrained_list_in_output_internal {
|
11661 - |
|
11662 - | #[allow(clippy::enum_variant_names)]
|
11663 - | #[derive(Debug, PartialEq)]
|
11664 - | pub(crate) enum ConstraintViolation {
|
11665 - | /// Constraint violation error when the list doesn't have the required length
|
11666 - | Length(usize),
|
11667 - | }
|
11668 - |
|
11669 - | impl ::std::fmt::Display for ConstraintViolation {
|
11670 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
11671 - | let message = match self {
|
11672 - | Self::Length(length) => {
|
11673 - | 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)
|
11674 - | }
|
11675 - | };
|
11676 - | write!(f, "{message}")
|
11677 - | }
|
11678 - | }
|
11679 - |
|
11680 - | impl ::std::error::Error for ConstraintViolation {}
|
11681 - | }
|