1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[::pyo3::pyclass]
|
4 + | /* PythonServerStructureGenerator.kt:63 */
|
3 5 | /// :param path str:
|
4 6 | /// :param message str:
|
5 7 | /// :rtype None:
|
6 - | /// Describes one specific validation failure for an input member.
|
8 + | /// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
|
9 + | /* RustType.kt:516 */
|
7 10 | #[derive(
|
8 11 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
9 12 | )]
|
10 - | pub struct ValidationExceptionField {
|
13 + | pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
|
14 + | /* RustType.kt:516 */
|
11 15 | #[pyo3(get, set)]
|
16 + | /* PythonServerStructureGenerator.kt:80 */
|
12 17 | /// :type str:
|
13 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
18 + | /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
14 19 | pub path: ::std::string::String,
|
20 + | /* RustType.kt:516 */
|
15 21 | #[pyo3(get, set)]
|
22 + | /* PythonServerStructureGenerator.kt:80 */
|
16 23 | /// :type str:
|
17 - | /// A detailed description of the validation failure.
|
24 + | /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
|
18 25 | pub message: ::std::string::String,
|
26 + | /* StructureGenerator.kt:201 */
|
19 27 | }
|
28 + | /* StructureGenerator.kt:135 */
|
20 29 | impl ValidationExceptionField {
|
21 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
30 + | /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
31 + | /* StructureGenerator.kt:166 */
|
22 32 | pub fn path(&self) -> &str {
|
33 + | /* StructureGenerator.kt:171 */
|
23 34 | use std::ops::Deref;
|
24 35 | self.path.deref()
|
36 + | /* StructureGenerator.kt:166 */
|
25 37 | }
|
26 - | /// A detailed description of the validation failure.
|
38 + | /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
|
39 + | /* StructureGenerator.kt:166 */
|
27 40 | pub fn message(&self) -> &str {
|
41 + | /* StructureGenerator.kt:171 */
|
28 42 | use std::ops::Deref;
|
29 43 | self.message.deref()
|
44 + | /* StructureGenerator.kt:166 */
|
30 45 | }
|
46 + | /* StructureGenerator.kt:135 */
|
31 47 | }
|
48 + | /* RustType.kt:516 */
|
32 49 | #[allow(clippy::new_without_default)]
|
50 + | /* RustType.kt:516 */
|
33 51 | #[allow(clippy::too_many_arguments)]
|
52 + | /* RustType.kt:516 */
|
34 53 | #[::pyo3::pymethods]
|
54 + | /* PythonServerStructureGenerator.kt:88 */
|
35 55 | impl ValidationExceptionField {
|
36 56 | #[new]
|
37 57 | pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
|
38 58 | Self { path, message }
|
39 59 | }
|
40 60 | fn __repr__(&self) -> String {
|
41 61 | format!("{self:?}")
|
42 62 | }
|
43 63 | fn __str__(&self) -> String {
|
44 64 | format!("{self:?}")
|
45 65 | }
|
46 66 | }
|
67 + | /* PythonServerStructureGenerator.kt:111 */
|
47 68 | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
|
48 69 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
49 70 | ob.extract::<ValidationExceptionField>().map(Box::new)
|
50 71 | }
|
51 72 | }
|
52 73 |
|
53 74 | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
|
54 75 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
55 76 | (*self).into_py(py)
|
56 77 | }
|
57 78 | }
|
79 + | /* ServerCodegenVisitor.kt:370 */
|
58 80 | impl ValidationExceptionField {
|
59 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
81 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
82 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
60 83 | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
84 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
|
61 85 | crate::model::validation_exception_field::Builder::default()
|
86 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
62 87 | }
|
88 + | /* ServerCodegenVisitor.kt:370 */
|
63 89 | }
|
64 90 |
|
91 + | /* ConstrainedCollectionGenerator.kt:93 */
|
65 92 | #[allow(missing_docs)] // documentation missing in model
|
66 - | ///
|
93 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
67 94 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
68 95 | /// [constraint traits]. Use [`ComplexSet::try_from`] to construct values of this type.
|
69 96 | ///
|
70 97 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
71 98 | ///
|
99 + | /* RustType.kt:516 */
|
72 100 | #[derive(
|
73 101 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
74 102 | )]
|
75 - | pub(crate) struct ComplexSet(pub(crate) ::std::vec::Vec<crate::model::ComplexSetStruct>);
|
103 + | pub(crate) /* ConstrainedCollectionGenerator.kt:97 */ struct ComplexSet(
|
104 + | pub(crate) ::std::vec::Vec<crate::model::ComplexSetStruct>,
|
105 + | );
|
106 + | /* ConstrainedCollectionGenerator.kt:104 */
|
76 107 | impl ComplexSet {
|
108 + | /* ConstrainedCollectionGenerator.kt:116 */
|
77 109 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ComplexSetStruct>`].
|
78 110 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ComplexSetStruct> {
|
79 111 | self.0
|
80 112 | }
|
81 113 |
|
82 114 | fn check_unique_items(
|
83 115 | items: ::std::vec::Vec<crate::model::ComplexSetStruct>,
|
84 116 | ) -> ::std::result::Result<
|
85 117 | ::std::vec::Vec<crate::model::ComplexSetStruct>,
|
86 118 | crate::model::complex_set_internal::ConstraintViolation,
|
87 119 | > {
|
88 120 | let mut seen = ::std::collections::HashMap::new();
|
89 121 | let mut duplicate_indices = ::std::vec::Vec::new();
|
90 122 | for (idx, item) in items.iter().enumerate() {
|
91 123 | if let Some(prev_idx) = seen.insert(item, idx) {
|
92 124 | duplicate_indices.push(prev_idx);
|
93 125 | }
|
94 126 | }
|
95 127 |
|
96 128 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
97 129 | for idx in &duplicate_indices {
|
98 130 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
99 131 | last_duplicate_indices.push(prev_idx);
|
100 132 | }
|
101 133 | }
|
102 134 | duplicate_indices.extend(last_duplicate_indices);
|
103 135 |
|
104 136 | if !duplicate_indices.is_empty() {
|
105 137 | debug_assert!(duplicate_indices.len() >= 2);
|
106 138 | Err(
|
107 139 | crate::model::complex_set_internal::ConstraintViolation::UniqueItems {
|
108 140 | duplicate_indices,
|
109 141 | original: items,
|
110 142 | },
|
111 143 | )
|
112 144 | } else {
|
113 145 | Ok(items)
|
114 146 | }
|
115 147 | }
|
148 + | /* ConstrainedCollectionGenerator.kt:104 */
|
116 149 | }
|
150 + | /* ConstrainedCollectionGenerator.kt:133 */
|
117 151 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ComplexSetStruct>> for ComplexSet {
|
118 152 | type Error = crate::model::complex_set_internal::ConstraintViolation;
|
119 153 |
|
120 154 | /// Constructs a `ComplexSet` from an [`::std::vec::Vec<crate::model::ComplexSetStruct>`], failing when the provided value does not satisfy the modeled constraints.
|
121 155 | fn try_from(
|
122 156 | value: ::std::vec::Vec<crate::model::ComplexSetStruct>,
|
123 157 | ) -> ::std::result::Result<Self, Self::Error> {
|
124 158 | let value = Self::check_unique_items(value)?;
|
125 159 |
|
126 160 | Ok(Self(value))
|
127 161 | }
|
128 162 | }
|
129 163 |
|
130 164 | impl ::std::convert::From<ComplexSet> for ::std::vec::Vec<crate::model::ComplexSetStruct> {
|
131 165 | fn from(value: ComplexSet) -> Self {
|
132 166 | value.into_inner()
|
133 167 | }
|
134 168 | }
|
169 + | /* ConstrainedCollectionGenerator.kt:181 */
|
135 170 | impl crate::constrained::Constrained for ComplexSet {
|
136 171 | type Unconstrained = crate::unconstrained::complex_set_unconstrained::ComplexSetUnconstrained;
|
137 172 | }
|
138 173 |
|
174 + | /* RustType.kt:516 */
|
139 175 | #[::pyo3::pyclass]
|
176 + | /* PythonServerStructureGenerator.kt:63 */
|
140 177 | /// :param foo typing.Optional\[bool\]:
|
141 178 | /// :param blob typing.Optional\[unique_items.types.Blob\]:
|
142 179 | /// :rtype None:
|
180 + | /* StructureGenerator.kt:197 */
|
143 181 | #[allow(missing_docs)] // documentation missing in model
|
182 + | /* RustType.kt:516 */
|
144 183 | #[derive(
|
145 184 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
146 185 | )]
|
147 - | pub struct ComplexSetStruct {
|
186 + | pub /* StructureGenerator.kt:201 */ struct ComplexSetStruct {
|
187 + | /* RustType.kt:516 */
|
148 188 | #[pyo3(get, set)]
|
189 + | /* PythonServerStructureGenerator.kt:80 */
|
149 190 | /// :type typing.Optional\[bool\]:
|
191 + | /* StructureGenerator.kt:231 */
|
150 192 | #[allow(missing_docs)] // documentation missing in model
|
151 193 | pub foo: ::std::option::Option<bool>,
|
194 + | /* RustType.kt:516 */
|
152 195 | #[pyo3(get, set)]
|
196 + | /* PythonServerStructureGenerator.kt:80 */
|
153 197 | /// :type typing.Optional\[unique_items.types.Blob\]:
|
198 + | /* StructureGenerator.kt:231 */
|
154 199 | #[allow(missing_docs)] // documentation missing in model
|
155 200 | pub blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
201 + | /* StructureGenerator.kt:201 */
|
156 202 | }
|
203 + | /* StructureGenerator.kt:135 */
|
157 204 | impl ComplexSetStruct {
|
205 + | /* StructureGenerator.kt:231 */
|
158 206 | #[allow(missing_docs)] // documentation missing in model
|
207 + | /* StructureGenerator.kt:166 */
|
159 208 | pub fn foo(&self) -> ::std::option::Option<bool> {
|
209 + | /* StructureGenerator.kt:168 */
|
160 210 | self.foo
|
211 + | /* StructureGenerator.kt:166 */
|
161 212 | }
|
213 + | /* StructureGenerator.kt:231 */
|
162 214 | #[allow(missing_docs)] // documentation missing in model
|
215 + | /* StructureGenerator.kt:166 */
|
163 216 | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
217 + | /* StructureGenerator.kt:170 */
|
164 218 | self.blob.as_ref()
|
219 + | /* StructureGenerator.kt:166 */
|
165 220 | }
|
221 + | /* StructureGenerator.kt:135 */
|
166 222 | }
|
223 + | /* RustType.kt:516 */
|
167 224 | #[allow(clippy::new_without_default)]
|
225 + | /* RustType.kt:516 */
|
168 226 | #[allow(clippy::too_many_arguments)]
|
227 + | /* RustType.kt:516 */
|
169 228 | #[::pyo3::pymethods]
|
229 + | /* PythonServerStructureGenerator.kt:88 */
|
170 230 | impl ComplexSetStruct {
|
171 231 | #[new]
|
172 232 | pub fn new(
|
173 233 | foo: ::std::option::Option<bool>,
|
174 234 | blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
175 235 | ) -> Self {
|
176 236 | Self { foo, blob }
|
177 237 | }
|
178 238 | fn __repr__(&self) -> String {
|
179 239 | format!("{self:?}")
|
180 240 | }
|
181 241 | fn __str__(&self) -> String {
|
182 242 | format!("{self:?}")
|
183 243 | }
|
184 244 | }
|
245 + | /* PythonServerStructureGenerator.kt:111 */
|
185 246 | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ComplexSetStruct> {
|
186 247 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
187 248 | ob.extract::<ComplexSetStruct>().map(Box::new)
|
188 249 | }
|
189 250 | }
|
190 251 |
|
191 252 | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ComplexSetStruct> {
|
192 253 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
193 254 | (*self).into_py(py)
|
194 255 | }
|
195 256 | }
|
257 + | /* ServerStructureConstrainedTraitImpl.kt:21 */
|
196 258 | impl crate::constrained::Constrained for crate::model::ComplexSetStruct {
|
197 259 | type Unconstrained = crate::model::complex_set_struct_internal::Builder;
|
198 260 | }
|
261 + | /* ServerCodegenVisitor.kt:370 */
|
199 262 | impl ComplexSetStruct {
|
200 - | /// Creates a new builder-style object to manufacture [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
263 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
264 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
201 265 | pub fn builder() -> crate::model::complex_set_struct::Builder {
|
266 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
|
202 267 | crate::model::complex_set_struct::Builder::default()
|
268 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
203 269 | }
|
270 + | /* ServerCodegenVisitor.kt:370 */
|
204 271 | }
|
205 272 |
|
273 + | /* ConstrainedCollectionGenerator.kt:93 */
|
206 274 | #[allow(missing_docs)] // documentation missing in model
|
207 - | ///
|
275 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
208 276 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
209 277 | /// [constraint traits]. Use [`SimpleSet::try_from`] to construct values of this type.
|
210 278 | ///
|
211 279 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
212 280 | ///
|
281 + | /* RustType.kt:516 */
|
213 282 | #[derive(
|
214 283 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
215 284 | )]
|
216 - | pub(crate) struct SimpleSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
285 + | pub(crate) /* ConstrainedCollectionGenerator.kt:97 */ struct SimpleSet(
|
286 + | pub(crate) ::std::vec::Vec<::std::string::String>,
|
287 + | );
|
288 + | /* ConstrainedCollectionGenerator.kt:104 */
|
217 289 | impl SimpleSet {
|
290 + | /* ConstrainedCollectionGenerator.kt:116 */
|
218 291 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
219 292 | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
220 293 | self.0
|
221 294 | }
|
222 295 |
|
223 296 | fn check_unique_items(
|
224 297 | items: ::std::vec::Vec<::std::string::String>,
|
225 298 | ) -> ::std::result::Result<
|
226 299 | ::std::vec::Vec<::std::string::String>,
|
227 300 | crate::model::simple_set_internal::ConstraintViolation,
|
228 301 | > {
|
229 302 | let mut seen = ::std::collections::HashMap::new();
|
230 303 | let mut duplicate_indices = ::std::vec::Vec::new();
|
231 304 | for (idx, item) in items.iter().enumerate() {
|
232 305 | if let Some(prev_idx) = seen.insert(item, idx) {
|
233 306 | duplicate_indices.push(prev_idx);
|
234 307 | }
|
235 308 | }
|
236 309 |
|
237 310 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
238 311 | for idx in &duplicate_indices {
|
239 312 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
240 313 | last_duplicate_indices.push(prev_idx);
|
241 314 | }
|
242 315 | }
|
243 316 | duplicate_indices.extend(last_duplicate_indices);
|
244 317 |
|
245 318 | if !duplicate_indices.is_empty() {
|
246 319 | debug_assert!(duplicate_indices.len() >= 2);
|
247 320 | Err(
|
248 321 | crate::model::simple_set_internal::ConstraintViolation::UniqueItems {
|
249 322 | duplicate_indices,
|
250 323 | original: items,
|
251 324 | },
|
252 325 | )
|
253 326 | } else {
|
254 327 | Ok(items)
|
255 328 | }
|
256 329 | }
|
330 + | /* ConstrainedCollectionGenerator.kt:104 */
|
257 331 | }
|
332 + | /* ConstrainedCollectionGenerator.kt:133 */
|
258 333 | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for SimpleSet {
|
259 334 | type Error = crate::model::simple_set_internal::ConstraintViolation;
|
260 335 |
|
261 336 | /// Constructs a `SimpleSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
262 337 | fn try_from(
|
263 338 | value: ::std::vec::Vec<::std::string::String>,
|
264 339 | ) -> ::std::result::Result<Self, Self::Error> {
|
265 340 | let value = Self::check_unique_items(value)?;
|
266 341 |
|
267 342 | Ok(Self(value))
|
268 343 | }
|
269 344 | }
|
270 345 |
|
271 346 | impl ::std::convert::From<SimpleSet> for ::std::vec::Vec<::std::string::String> {
|
272 347 | fn from(value: SimpleSet) -> Self {
|
273 348 | value.into_inner()
|
274 349 | }
|
275 350 | }
|
351 + | /* ConstrainedCollectionGenerator.kt:181 */
|
276 352 | impl crate::constrained::Constrained for SimpleSet {
|
277 353 | type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
|
278 354 | }
|
279 355 |
|
280 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
356 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
281 357 | pub mod validation_exception_field {
|
282 358 |
|
359 + | /* RustType.kt:516 */
|
283 360 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
284 - | /// Holds one variant for each of the ways the builder can fail.
|
285 - |
|
361 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
362 + | /* ServerBuilderConstraintViolations.kt:75 */
|
286 363 | #[allow(clippy::enum_variant_names)]
|
287 364 | pub enum ConstraintViolation {
|
288 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
365 + | /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
|
366 + | /* ServerBuilderConstraintViolations.kt:143 */
|
289 367 | MissingPath,
|
290 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
368 + | /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
|
369 + | /* ServerBuilderConstraintViolations.kt:143 */
|
291 370 | MissingMessage,
|
371 + | /* ServerBuilderConstraintViolations.kt:75 */
|
292 372 | }
|
373 + | /* ServerBuilderConstraintViolations.kt:117 */
|
293 374 | impl ::std::fmt::Display for ConstraintViolation {
|
375 + | /* ServerBuilderConstraintViolations.kt:118 */
|
294 376 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
377 + | /* ServerBuilderConstraintViolations.kt:119 */
|
295 378 | match self {
|
296 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
297 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
298 - | }
|
379 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
380 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
381 + | /* ServerBuilderConstraintViolations.kt:119 */}
|
382 + | /* ServerBuilderConstraintViolations.kt:118 */
|
299 383 | }
|
384 + | /* ServerBuilderConstraintViolations.kt:117 */
|
300 385 | }
|
386 + | /* ServerBuilderConstraintViolations.kt:84 */
|
301 387 | impl ::std::error::Error for ConstraintViolation {}
|
388 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:254 */
|
302 389 | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
303 390 | type Error = ConstraintViolation;
|
304 391 |
|
305 392 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
306 393 | builder.build()
|
307 394 | }
|
308 395 | }
|
309 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
396 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
397 + | /* RustType.kt:516 */
|
310 398 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
399 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
311 400 | pub struct Builder {
|
401 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
312 402 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
403 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
313 404 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
405 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
314 406 | }
|
407 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
315 408 | impl Builder {
|
316 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
409 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
410 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
317 411 | pub fn path(mut self, input: ::std::string::String) -> Self {
|
318 - | self.path = Some(input);
|
412 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
413 + | self.path =
|
414 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
|
415 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
416 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
|
417 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
319 418 | self
|
419 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
320 420 | }
|
321 - | /// A detailed description of the validation failure.
|
421 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */A detailed description of the validation failure.
|
422 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
322 423 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
323 - | self.message = Some(input);
|
424 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
425 + | self.message =
|
426 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
|
427 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
428 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
|
429 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
324 430 | self
|
431 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
325 432 | }
|
326 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
327 - | ///
|
433 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
434 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:152 */
|
328 435 | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
329 436 | ///
|
437 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
|
330 438 | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
331 439 | self.build_enforcing_required_and_enum_traits()
|
332 440 | }
|
441 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
333 442 | fn build_enforcing_required_and_enum_traits(
|
334 443 | self,
|
335 444 | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
336 - | Ok(crate::model::ValidationExceptionField {
|
337 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
338 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
339 - | })
|
445 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
446 + | Ok(
|
447 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
448 + | crate::model::ValidationExceptionField {
|
449 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
450 + | path: self
|
451 + | .path
|
452 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
|
453 + | .ok_or(ConstraintViolation::MissingPath)?,
|
454 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
455 + | message: self
|
456 + | .message
|
457 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
|
458 + | .ok_or(ConstraintViolation::MissingMessage)?,
|
459 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
460 + | }, /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
461 + | )
|
462 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
340 463 | }
|
464 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
341 465 | }
|
466 + |
|
467 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
342 468 | }
|
343 469 | pub(crate) mod complex_set_internal {
|
344 470 |
|
471 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
345 472 | #[allow(clippy::enum_variant_names)]
|
346 473 | #[derive(Debug, PartialEq)]
|
347 474 | pub(crate) enum ConstraintViolation {
|
348 475 | /// Constraint violation error when the list does not contain unique items
|
349 476 | UniqueItems {
|
350 477 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
351 478 | /// at least two elements.
|
352 479 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
353 480 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
354 481 | /// Nothing is guaranteed about the order of the indices.
|
355 482 | duplicate_indices: ::std::vec::Vec<usize>,
|
356 483 | /// The original vector, that contains duplicate items.
|
357 484 | original: ::std::vec::Vec<crate::model::ComplexSetStruct>,
|
358 485 | },
|
359 486 | }
|
360 487 |
|
361 488 | impl ::std::fmt::Display for ConstraintViolation {
|
362 489 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
363 490 | let message = match self {
|
364 491 | Self::UniqueItems { duplicate_indices, .. } =>
|
365 492 | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ComplexSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
366 493 | };
|
367 494 | write!(f, "{message}")
|
368 495 | }
|
369 496 | }
|
370 497 |
|
371 498 | impl ::std::error::Error for ConstraintViolation {}
|
499 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
372 500 | impl ConstraintViolation {
|
373 501 | pub(crate) fn as_validation_exception_field(
|
374 502 | self,
|
375 503 | path: ::std::string::String,
|
376 504 | ) -> crate::model::ValidationExceptionField {
|
377 505 | match self {
|
378 506 | Self::UniqueItems { duplicate_indices, .. } =>
|
379 507 | crate::model::ValidationExceptionField {
|
380 508 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
381 509 | path,
|
382 510 | },
|
383 511 | }
|
384 512 | }
|
385 513 | }
|
514 + |
|
515 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
386 516 | }
|
387 - | /// See [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
517 + | /// /* ServerBuilderGenerator.kt:171 */See [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
388 518 | pub(crate) mod complex_set_struct_internal {
|
389 519 |
|
520 + | /* ServerBuilderGenerator.kt:461 */
|
390 521 | impl ::std::convert::From<Builder> for crate::model::ComplexSetStruct {
|
391 522 | fn from(builder: Builder) -> Self {
|
392 523 | builder.build()
|
393 524 | }
|
394 525 | }
|
395 - | /// A builder for [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
526 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
527 + | /* RustType.kt:516 */
|
396 528 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
529 + | /* ServerBuilderGenerator.kt:211 */
|
397 530 | pub(crate) struct Builder {
|
398 - | pub(crate) foo: ::std::option::Option<bool>,
|
531 + | /* ServerBuilderGenerator.kt:308 */ pub(crate) foo: ::std::option::Option<bool>,
|
532 + | /* ServerBuilderGenerator.kt:308 */
|
399 533 | pub(crate) blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
534 + | /* ServerBuilderGenerator.kt:211 */
|
400 535 | }
|
536 + | /* ServerBuilderGenerator.kt:215 */
|
401 537 | impl Builder {
|
538 + | /* ServerBuilderGenerator.kt:426 */
|
402 539 | #[allow(missing_docs)] // documentation missing in model
|
540 + | /* ServerBuilderGenerator.kt:428 */
|
403 541 | pub(crate) fn set_foo(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
542 + | /* ServerBuilderGenerator.kt:429 */
|
404 543 | self.foo = input.map(|v| v.into());
|
405 544 | self
|
545 + | /* ServerBuilderGenerator.kt:428 */
|
406 546 | }
|
547 + | /* ServerBuilderGenerator.kt:426 */
|
407 548 | #[allow(missing_docs)] // documentation missing in model
|
549 + | /* ServerBuilderGenerator.kt:428 */
|
408 550 | pub(crate) fn set_blob(
|
409 551 | mut self,
|
410 552 | input: Option<impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>>,
|
411 553 | ) -> Self {
|
554 + | /* ServerBuilderGenerator.kt:429 */
|
412 555 | self.blob = input.map(|v| v.into());
|
413 556 | self
|
557 + | /* ServerBuilderGenerator.kt:428 */
|
414 558 | }
|
415 - | /// Consumes the builder and constructs a [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
559 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
560 + | /* ServerBuilderGenerator.kt:271 */
|
416 561 | pub fn build(self) -> crate::model::ComplexSetStruct {
|
417 562 | self.build_enforcing_all_constraints()
|
418 563 | }
|
564 + | /* ServerBuilderGenerator.kt:283 */
|
419 565 | fn build_enforcing_all_constraints(self) -> crate::model::ComplexSetStruct {
|
566 + | /* ServerBuilderGenerator.kt:542 */
|
420 567 | crate::model::ComplexSetStruct {
|
568 + | /* ServerBuilderGenerator.kt:546 */
|
421 569 | foo: self.foo,
|
570 + | /* ServerBuilderGenerator.kt:546 */
|
422 571 | blob: self.blob,
|
572 + | /* ServerBuilderGenerator.kt:542 */
|
423 573 | }
|
574 + | /* ServerBuilderGenerator.kt:283 */
|
424 575 | }
|
576 + | /* ServerBuilderGenerator.kt:215 */
|
425 577 | }
|
578 + |
|
579 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
426 580 | }
|
427 - | /// See [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
581 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
428 582 | pub mod complex_set_struct {
|
429 583 |
|
584 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:269 */
|
430 585 | impl ::std::convert::From<Builder> for crate::model::ComplexSetStruct {
|
431 586 | fn from(builder: Builder) -> Self {
|
432 587 | builder.build()
|
433 588 | }
|
434 589 | }
|
435 - | /// A builder for [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
590 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
591 + | /* RustType.kt:516 */
|
436 592 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
593 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
437 594 | pub struct Builder {
|
595 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
438 596 | pub(crate) foo: ::std::option::Option<bool>,
|
597 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
439 598 | pub(crate) blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
599 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
440 600 | }
|
601 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
441 602 | impl Builder {
|
603 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
|
442 604 | #[allow(missing_docs)] // documentation missing in model
|
605 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
443 606 | pub fn foo(mut self, input: ::std::option::Option<bool>) -> Self {
|
444 - | self.foo = input;
|
607 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
608 + | self.foo =
|
609 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
610 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
445 611 | self
|
612 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
446 613 | }
|
614 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
|
447 615 | #[allow(missing_docs)] // documentation missing in model
|
616 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
448 617 | pub fn blob(
|
449 618 | mut self,
|
450 619 | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
451 620 | ) -> Self {
|
452 - | self.blob = input;
|
621 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
622 + | self.blob =
|
623 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
624 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
453 625 | self
|
626 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
454 627 | }
|
455 - | /// Consumes the builder and constructs a [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
628 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`ComplexSetStruct`](crate::model::ComplexSetStruct).
|
629 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
|
456 630 | pub fn build(self) -> crate::model::ComplexSetStruct {
|
457 631 | self.build_enforcing_required_and_enum_traits()
|
458 632 | }
|
633 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
459 634 | fn build_enforcing_required_and_enum_traits(self) -> crate::model::ComplexSetStruct {
|
635 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
460 636 | crate::model::ComplexSetStruct {
|
637 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
461 638 | foo: self.foo,
|
639 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
462 640 | blob: self.blob,
|
641 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
463 642 | }
|
643 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
464 644 | }
|
645 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
465 646 | }
|
647 + |
|
648 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
466 649 | }
|
467 650 | pub(crate) mod simple_set_internal {
|
468 651 |
|
652 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
469 653 | #[allow(clippy::enum_variant_names)]
|
470 654 | #[derive(Debug, PartialEq)]
|
471 655 | pub(crate) enum ConstraintViolation {
|
472 656 | /// Constraint violation error when the list does not contain unique items
|
473 657 | UniqueItems {
|
474 658 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
475 659 | /// at least two elements.
|
476 660 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
477 661 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
478 662 | /// Nothing is guaranteed about the order of the indices.
|
479 663 | duplicate_indices: ::std::vec::Vec<usize>,
|
480 664 | /// The original vector, that contains duplicate items.
|
481 665 | original: ::std::vec::Vec<::std::string::String>,
|
482 666 | },
|
483 667 | }
|
484 668 |
|
485 669 | impl ::std::fmt::Display for ConstraintViolation {
|
486 670 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
487 671 | let message = match self {
|
488 672 | Self::UniqueItems { duplicate_indices, .. } =>
|
489 673 | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SimpleSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
490 674 | };
|
491 675 | write!(f, "{message}")
|
492 676 | }
|
493 677 | }
|
494 678 |
|
495 679 | impl ::std::error::Error for ConstraintViolation {}
|
680 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
496 681 | impl ConstraintViolation {
|
497 682 | pub(crate) fn as_validation_exception_field(
|
498 683 | self,
|
499 684 | path: ::std::string::String,
|
500 685 | ) -> crate::model::ValidationExceptionField {
|
501 686 | match self {
|
502 687 | Self::UniqueItems { duplicate_indices, .. } =>
|
503 688 | crate::model::ValidationExceptionField {
|
504 689 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
505 690 | path,
|
506 691 | },
|
507 692 | }
|
508 693 | }
|
509 694 | }
|
695 + |
|
696 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
510 697 | }
|