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